kamalrun
11-07-2006, 07:35 PM
hello guys i edit at HTML_function.php file to show text and image
its working but its also showing pending news.
please guys help me on this .....
also one more Q?
i want to show new Articles # from 5 to 12 news . where i have to edit
please ....
function short_text($text)
{
$text=strip_tags($text);
$words=explode(' ',$text);
$word_number=20;
for ($i = 0; $i < $word_number; $i++) {
$short_text .= $words[$i]. " "; }
if ($i<sizeof($words)) $short_text .="...";
return $short_text;
}
function HTML_Box_Most_Popular()
{
global $url, $tpl_folder, $lang, $cur_date;
$sql = "SELECT * FROM tblArticles WHERE category_id =25 ORDER BY created DESC LIMIT 4";
$result=mysql_query($sql) or die ("Bad query show most <br/>".$sql);
while ($row=mysql_fetch_array($result)) {
$id=HTML_show_friendly_url($row['id'],"");
$most_reading_articles.="<tr><td valign=\"top\" class=\"plainTxt\"><a href=\"{$url}{$id}\">{$row['title']}</a><br><img src=\"{$url}files/{$row['image']}\" width=\"65\" align=left border=1 style=\"padding-right: 2px;\">"; //";
$most_reading_articles.= short_text($row['body']);
$most_reading_articles.= "<span class=\"sxjh\"><a href=\"{$url}{$id}\">(more;) </a></span><p></td></tr>";
}
$filename="$tpl_folder/box_cat.tpl";
$subject=file_get_contents($filename);
$pattern=array(
'/{ROOT}/',
'/{MOST_headline_news}/',
);
$replacement=array(
$url,
$most_reading_articles,
);
$subject=preg_replace($pattern, $replacement, $subject);
return $subject;
}
its working but its also showing pending news.
please guys help me on this .....
also one more Q?
i want to show new Articles # from 5 to 12 news . where i have to edit
please ....
function short_text($text)
{
$text=strip_tags($text);
$words=explode(' ',$text);
$word_number=20;
for ($i = 0; $i < $word_number; $i++) {
$short_text .= $words[$i]. " "; }
if ($i<sizeof($words)) $short_text .="...";
return $short_text;
}
function HTML_Box_Most_Popular()
{
global $url, $tpl_folder, $lang, $cur_date;
$sql = "SELECT * FROM tblArticles WHERE category_id =25 ORDER BY created DESC LIMIT 4";
$result=mysql_query($sql) or die ("Bad query show most <br/>".$sql);
while ($row=mysql_fetch_array($result)) {
$id=HTML_show_friendly_url($row['id'],"");
$most_reading_articles.="<tr><td valign=\"top\" class=\"plainTxt\"><a href=\"{$url}{$id}\">{$row['title']}</a><br><img src=\"{$url}files/{$row['image']}\" width=\"65\" align=left border=1 style=\"padding-right: 2px;\">"; //";
$most_reading_articles.= short_text($row['body']);
$most_reading_articles.= "<span class=\"sxjh\"><a href=\"{$url}{$id}\">(more;) </a></span><p></td></tr>";
}
$filename="$tpl_folder/box_cat.tpl";
$subject=file_get_contents($filename);
$pattern=array(
'/{ROOT}/',
'/{MOST_headline_news}/',
);
$replacement=array(
$url,
$most_reading_articles,
);
$subject=preg_replace($pattern, $replacement, $subject);
return $subject;
}