All pastes #430781 Raw Edit

Jonano

public php v1 · immutable
·published 2007-04-09 07:50 UTC
rendered paste body
	$result = $db->sql_query("SELECT sid, catid, aid, title, time, hometext, bodytext, comments, counter, topic, informant, notes, acomm, score, ratings FROM ".$prefix."_stories $qdb $querylang ORDER BY sid DESC limit $storynum");	while ($row = $db->sql_fetchrow($result)) {		$s_sid = intval($row['sid']);		$catid = intval($row['catid']);		$aid = filter($row['aid'], "nohtml");		$title = filter($row['title'], "nohtml");		$time = $row['time'];		$hometext = filter($row['hometext']);		$bodytext = filter($row['bodytext']);		$comments = intval($row['comments']);		$counter = intval($row['counter']);		$topic = intval($row['topic']);		$informant = filter($row['informant'], "nohtml");		$notes = filter($row['notes']);		$acomm = intval($row['acomm']);		$score = intval($row['score']);		$ratings = intval($row['ratings']);		if ($catid > 0) {			$row2 = $db->sql_fetchrow($db->sql_query("SELECT title FROM ".$prefix."_stories_cat WHERE catid='$catid'"));			$cattitle = stripslashes(check_html($row2['title'], "nohtml"));		}		getTopics($s_sid);		formatTimestamp($time);		$subject = filter($subject, "nohtml");		$introcount = strlen($hometext);		$fullcount = strlen($bodytext);		$totalcount = $introcount + $fullcount;		$c_count = $comments;		$r_options = "";		if (isset($userinfo['umode'])) { $r_options .= "&amp;mode=".$userinfo['umode']; }		if (isset($userinfo['uorder'])) { $r_options .= "&amp;order=".$userinfo['uorder']; }		if (isset($userinfo['thold'])) { $r_options .= "&amp;thold=".$userinfo['thold']; }		$story_link = "<a href=\"modules.php?name=News&amp;file=article&amp;sid=$s_sid$r_options\">";		$morelink = "(";		if ($fullcount > 0 OR $c_count > 0 OR $articlecomm == 0 OR $acomm == 1) {			$morelink .= "$story_link<b>"._READMORE."</b></a> | ";		} else {			$morelink .= "";		}		if ($fullcount > 0) { $morelink .= "$totalcount "._BYTESMORE." | "; }		if ($articlecomm == 1 AND $acomm == 0) {			if ($c_count == 0) { $morelink .= "$story_link"._COMMENTSQ."</a>"; } elseif ($c_count == 1) { $morelink .= "$story_link$c_count "._COMMENT."</a>"; } elseif ($c_count > 1) { $morelink .= "$story_link$c_count "._COMMENTS."</a>"; }		}