All pastes #175179 Raw Edit

Smith

public php v1 · immutable
·published 2006-09-18 15:54 UTC
rendered paste body
$template -> AddRow("articles");for($i=0;($i<(5)) && ($i<$total_result);$i++) {	$articles = sql_fetch_object($main_result);		$result=sql_query("SELECT title, address FROM ".$SQL_PREFIX."_articles_column WHERE id = '" . $articles->column_ . "';");	$column = sql_fetch_object($result);		/* Authors */	$articles->author = explode(';', $articles->authors);	for($j=0;$j<(count($articles->author)-1);$j++) 	{		$result = sql_query("SELECT name, item FROM ".$SQL_PREFIX."_authors WHERE id = '" . $articles->author[$j] . "';");		$author = sql_fetch_object($result);				if($j != (count($articles->author)-2)) 		{			if($cfg['url_rewrite'] == 1) 			{				$article_authors .= '<a href="'. $cfg['server_url'] .'author/'. $author->item .'">'. $author->name .'</a>, ';			}			else 			{				$article_authors .= '<a href="'. $cfg['server_url'] .'author.php?name='. $author->item .'">'. $author->name .'</a>, ';			}		} 		else 		{			if($cfg['url_rewrite'] == 1) 			{				$article_authors .= '<a href="'. $cfg['server_url'] .'author/'. $author->item .'">'. $author->name .'</a>';			}			else 			{				$article_authors .= '<a href="'. $cfg['server_url'] .'author.php?name='. $author->item .'">'. $author->name .'</a>';			}		}					}	        	$result=sql_query("SELECT id FROM ".$SQL_PREFIX."_comments_articles WHERE idw = '" . $articles->article . "';");	$post['count'] = sql_num_rows($result);			  	$result=sql_query("SELECT type FROM ".$SQL_PREFIX."_articles_types WHERE id = '" . $articles->type . "';");	$row_array = sql_fetch_row($result);		$type = $row_array[0];	        	include('lib/comments.php');		if($articles->date_pub != $articles->date_update) 	{		$articles->updated = 1;	}		$date = $articles->date_pub;	$date_pub = DateFormat($date);	$date = $articles->date_update;	$date_update = DateFormat($date); 			/* Normal articles */if(empty($articles->redir)) {		if(!empty($articles->img)) 	{ 		$template -> AddTag("ARTICLE_IMG_P1", '<table class="article-index-table"><tr><td style="width:82px;">		<img src="data/stories/'.$articles->img.'" alt="'. $articles->title   . '"  width="80" height="80" /></td><td>', "articles");	}		/* 		SEO URL	*/	if($cfg['url_rewrite'] == 1) 	{		$template -> AddTag("ARTICLE_URL", $cfg['server_url'] .'article/'. $column->address .'/'. $articles->item, "articles");	} 	else 	{		$template -> AddTag("ARTICLE_URL", $cfg['server_url'] .'article.php?item='. $articles->item, "articles");	}	$template -> AddTag("ARTICLE_TITLE", $articles->title, "articles");	$template -> AddTag("ARTICLE_DATE_PUB", $date_pub, "articles");		if($articles->updated == 1) { $template -> AddTag("ARTICLE_DATE_UPDATE", '<span style="color:#ff0000;font-weight:bold;">'. $lang[updated] .': '. $date_update .'</span>', "articles"); }		$template -> AddTag("ARTICLE_AUTHORS", ', '. $article_authors, "articles");	$template -> AddTag("ARTICLE_TYPE", ', '.$type, "articles");	$template -> AddTag("ARTICLE_COMMENTS", ', <a href="comments.php?article='.$articles->article .'">'. $post['count'] . ' ' . $post['name'] .'</a>', "articles");		$template -> AddTag("ARTICLE_ANNOTATION", $articles->annotation, "articles");	if(!empty($articles->img)) { $template -> AddTag("ARTICLE_IMG_P2", '</td></tr></table>', "articles"); }}/* Redirect articles *//*if(!empty($articles->redir)) {	echo('<div class="article-index">');	if(!empty($articles->img)) { echo('<table class="article-index-table"><tr><td style="width:82px;">');		echo('<img src="data/stories/'.$articles->img.'" alt="'. $articles->title   . '"  width="80" height="80" />');		echo('</td><td>'); 	}	echo('<h3><a href="redirect.php?url='. $articles->redir   . '">'. $articles->title   . '</a></h3>');	echo('<div class="info">'. $date . ', '.$type.'</div>');	echo('<div class="annotation">'. $articles->annotation .'</div>');	if(!empty($articles->img)) {echo('</td></tr></table>');}	echo('</div>');}*/		unset($article_authors);		$template -> ParseRow("articles");	}$template -> AddMainTemplate('main.php');echo($template -> Render());