289,290c289,290
< function ExtDynamicPageList2__languageGetMagic( &$magicWords, $langCode ) 	{ 
< 	return ExtDynamicPageList2::languageGetMagic( $magicWords, $langCode ); 
---
> function ExtDynamicPageList2__languageGetMagic( &$magicWords, $langCode ) {
> 	return ExtDynamicPageList2::languageGetMagic( $magicWords, $langCode );
292c292
< function ExtDynamicPageList2__endReset( &$parser, $text ) 					{ 
---
> function ExtDynamicPageList2__endReset( &$parser, $text ) { 
295c295
< function ExtDynamicPageList2__endEliminate( &$parser, $text )			 	{ 
---
> function ExtDynamicPageList2__endEliminate( &$parser, $text ) { 
301c301
<     const VERSION = '1.6.9';               // current version
---
>     const VERSION = '1.6.9-custom0';               // current version
648c648,649
<         'firstrevisionsince'   => array('default' => '', 'pattern' => '#^[-./:0-9]+$#'),
---
>         #'firstrevisionsince'   => array('default' => '', 'pattern' => '#^[-./:0-9]+$#'),
>         'firstrevisionsince'   => array('default' => '', 'pattern' => '#^([-./:0-9]+|-\d+(y|m|d))$#'), // fous zcu hi-hack
652c653,654
<         'allrevisionssince'    => array('default' => '', 'pattern' => '#^[-./:0-9]+$#'),
---
>         #'allrevisionssince'    => array('default' => '', 'pattern' => '#^[-./:0-9]+$#'),
>         'allrevisionssince'    => array('default' => '', 'pattern' => '#^([-./:0-9]+|-\d+(y|m|d))$#'), // fous zcu hi-hack
653a656,659
> 	 * linkdate = show links on date // fous zcu patch
> 	 */
> 	'linkdate'	=> array('default' => 'no', 'yes'),
> 	/**
731,732c737,740
<         'shownamespace'        => array('default' => 'true', 'false', 'no', 'yes', '0', '1', 'off', 'on'),
<         /**
---
>         'shownamespace'        => array('default' => 'true', 'false', 'no', 'yes', '0', '1', 'off', 'on'), 
> 	# zcu addfirstparagraph
> 	'addfirstparagraph'	=> array('default' => 'false', 'true', 'no', 'yes', '0', '1', 'off', 'on'),
> 	/**
756c764
< 
---
>     
758,759c766,768
<         // Page Transclusion, adopted from Steve Sanbeg´s LabeledSectionTransclusion
<         require_once( 'DynamicPageList2Include.php' );
---
> 	
> 	// Page Transclusion, adopted from Steve Sanbeg´s LabeledSectionTransclusion
>         #require_once( 'DynamicPageList2Include.php' );
885c894
<         $arg_list = func_get_args();
---
> 	$arg_list = func_get_args();
1041c1050
<     
---
>     	
1120a1130
> 	$sLinkDate = self::$options['linkdate']['default']; // fous zcu hack
1137a1148,1150
> 	
> 	# zcu hack
> 	$bAddFirstParagraph = self::argBoolean(self::$options['addfirstparagraph']['default']); 
1139c1152
<         $bAddFirstCategoryDate = self::argBoolean(self::$options['addfirstcategorydate']['default']);
---
> 	$bAddFirstCategoryDate = self::argBoolean(self::$options['addfirstcategorydate']['default']);
1413c1426
<                         if( !in_array($sNs, self::$options['namespace']) )
---
>                         if( !in_array($sNs, self::$options['namespace']) ) {
1414a1428
> 			}
1612,1617c1626,1653
<                     if( preg_match(self::$options[$sType]['pattern'], $sArg) ) {
<                         if (($sType) == 'lastrevisionbefore')	$sLastRevisionBefore = str_pad(preg_replace('/[^0-9]/','',$sArg),14,'0');
<                         if (($sType) == 'allrevisionsbefore')	$sAllRevisionsBefore = str_pad(preg_replace('/[^0-9]/','',$sArg),14,'0');
<                         if (($sType) == 'firstrevisionsince')	$sFirstRevisionSince = str_pad(preg_replace('/[^0-9]/','',$sArg),14,'0');
<                         if (($sType) == 'allrevisionssince')	$sAllRevisionsSince  = str_pad(preg_replace('/[^0-9]/','',$sArg),14,'0');
<                         $bConflictsWithOpenReferences=true;
---
> 		    if( preg_match(self::$options[$sType]['pattern'], $sArg) ) { // fous zcu hack
>                         if (($sType) == 'lastrevisionbefore')	$ptr = &$sLastRevisionBefore;
>                         if (($sType) == 'allrevisionsbefore')	$ptr = &$sAllRevisionsBefore;
>                         if (($sType) == 'firstrevisionsince')   $ptr = &$sFirstRevisionSince;
>                         if (($sType) == 'allrevisionssince')	$ptr = &$sAllRevisionsSince;
> 			
> 			if ( preg_match('/^(-|\+)(\d+)(y|m|d)$/', $sArg, $marr) ) {
> 				switch ($marr[3]) {
> 					case 'y': 
> 						$dsh = $marr[2] * 365 * 24 * 60 * 60;
> 						break;
> 					case 'm': 
> 						$dsh = $marr[2] * 30.41 * 24 * 60 * 60;
> 						break;
> 					case 'd': 
> 						$dsh = $marr[2] * 24 * 60 * 60;
> 						break;
> 					default: //wrong value
> 						$output.= $logger->msgWrongParam($sType, $sArg);
> 				}
> 				$ptr = str_pad(date('Ymd', ($marr[1] == '+') ? time() + $dsh : time() - $dsh), 14, '0');
> 				#print "$ptr $dsh $marr[1] $marr[2] $marr[3]\n";
> 			}
> 			else {
> 				$ptr = str_pad(preg_replace('/[^0-9]/','',$sArg),14,'0');
> 			}
>                         
> 			$bConflictsWithOpenReferences = true;
1622c1658,1666
<                     
---
>                 
> 		case 'linkdate':
>                     if( in_array($sArg, self::$options['linkdate'])) {
>                         $sLinkDate = self::argBoolean($sArg);
>                     }
>                     else
>                         $output .= $logger->msgWrongParam('linkdate', $sArg);
> 		    break;
> 
2080c2124,2132
<                                     
---
>                 
> 		# zcu hack
> 		case 'addfirstparagraph':
> 			if( in_array($sArg, self::$options['addfirstparagraph']))
> 				$bAddFirstParagraph = $sArg == 'true';
> 			else
> 				$output .= $logger->msgWrongParam('addfirstparagraph', $sArg);
> 			break;
> 		
2099c2151
<         // debug level 5 puts nowiki tags around the output
---
> 	// debug level 5 puts nowiki tags around the output
2845,2846c2897,2901
<         
<         // pick some elements by random
---
> 	
> 	//first paragraphs of articles
> 	$aFirstParagraphs = array();
> 	
> 	// pick some elements by random
2944c2999,3000
<                 if( $sLastRevisionBefore.$sAllRevisionsBefore.$sFirstRevisionSince.$sAllRevisionsSince !='') {
---
>                 // fous zcu hack
> 		if( $sLastRevisionBefore.$sAllRevisionsBefore.$sFirstRevisionSince.$sAllRevisionsSince !='' && $sLinkDate ) {
2957c3013
<                     $dplArticle->myDate = gmdate($sUserDateFormat,wfTimeStamp(TS_UNIX,$dplArticle->mDate)).' ';
---
>                     $dplArticle->myDate = date($sUserDateFormat,wfTimeStamp(TS_UNIX,$dplArticle->mDate)).' ';
2970c3026,3027
<                 if($bAddUser || $bAddAuthor || $bAddLastEditor || $sLastRevisionBefore.$sAllRevisionsBefore.$sFirstRevisionSince.$sAllRevisionsSince != '') {
---
>                 #if($bAddUser || $bAddAuthor || $bAddLastEditor || $sLastRevisionBefore.$sAllRevisionsBefore.$sFirstRevisionSince.$sAllRevisionsSince != '') { 
> 		if($bAddUser || $bAddAuthor || $bAddLastEditor) { //fous zcu hack
3009,3010c3066,3087
<             $aArticles[] = $dplArticle;
<         }
---
> 	    //zcu hack: ADD FIRST PARAGRAPH
> 	    if ($bAddFirstParagraph) {
> 		$parseOptions = ParserOptions::newFromUser($wgUser);
> 		$myParser = new Parser();
> 		$title = Title::makeTitle($row->page_namespace, $row->page_title);
> 		$tmpArticle = new Article( $title );
> 		$tmpArticle->fetchContent();
> 	        if (preg_match("/^(.*)[\n=]/", $tmpArticle->mContent, $match)) {
> 			// puvodne se to muselo nejspis parsovat do html, ale ted se nejspis 
> 			// zavola parser nad celym obsahem, takze by to parsovalo dvakrat a bylo by to fuj
> 			//$myParseOutput = $myParser->parse(":" .$match[0], $title, $parseOptions);
> 			$aFirstParagraphs[] = "<p> </p>" . $match[0]. "<p> </p>";
> 		}
> 		else {
> 			$aFirstParagraphs[] = '';
> 		}
> 	    } else {
> 		$aFirstParagraphs[] = '';
> 	    }
> 	    
> 	    $aArticles[] = $dplArticle;
> 	}
3020,3022d3096
<     
<     // ###### SHOW OUTPUT ######
<     
3032c3106
<                         $iTitleMaxLen, $defaultTemplateSuffix, $aTableRow, $bIncludeTrim);
---
>                         $iTitleMaxLen, $defaultTemplateSuffix, $aTableRow, $bIncludeTrim, $aFirstParagraphs);
3349c3423,3424
< 	
---
> 	var $mFirstParagraphs;
> 
3353c3428
< 				  $defaultTemplateSuffix, $aTableRow, $bIncludeTrim ) {
---
> 				  $defaultTemplateSuffix, $aTableRow, $bIncludeTrim, $aFirstParagraphs ) {
3374a3450
> 		$this->mFirstParagraphs = $aFirstParagraphs;
3548d3623
< 		
3763a3839,3842
> 			// zcu hack
> 			if ($this->mFirstParagraphs[$i]) {
> 				$r .= $this->mFirstParagraphs[$i];
> 			}
3961c4040
< ?>
\ No newline at end of file
---
> ?>
