Просмотр файла wap4mambo/onews/cat.php

Размер файла: 3.2Kb
<?php
/*******************************************************************\
*   File Name onews/cat.php                                         *
*   Date 02-10-2003                                                 *
*   For Mambo WAP Site Builder                                      *
*   Writen By Tony Skilton [email protected]              *
*   Version 2.00                                                    *
*   Copyright (C) 2003 Media Finder http://mediafinder.sytes.net    *
*	Distributed under the terms of the GNU General Public License   *
*   Please do not remove any of the information above               *
\*******************************************************************/
header("Content-Type: text/vnd.wap.wml");
echo"<?xml version=\"1.0\"?>"; ?> 
  <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
			"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<?php include("../config.php"); ?>
<card id="news1" title="<? echo $wap_title ?>">
<do type="prev" label="Back"><prev/></do>
<p><small>
<?
DB_connect($dbn,$host,$user,$pass);
$count = mysql_query("SELECT * FROM ".$dbpre."_stories WHERE catid=$id and published=1 and frontpage=0 ORDER BY time DESC");  
 while ($row1 = mysql_fetch_object($count)) {
$countcat[$i] = $row1->catid;
$i++;}
mysql_free_result($count);
DB_connect($dbn,$host,$user,$pass);
$result = mysql_query("SELECT * FROM ".$dbpre."_stories WHERE catid=$id and published=1 and frontpage=0 ORDER BY time DESC LIMIT $from, $no_list");  
 while ($row = mysql_fetch_object($result)) {
$catid[$t] = $row->catid;
$sid = $row->sid;
$title = $row->title;
$t++; 
$title=eregi_replace("&","&amp;",$title); 
$title=eregi_replace("<br>","<br />",$title);
$title=eregi_replace("<strong>","<b>",$title);
$title=eregi_replace("</strong>","</b>",$title);
$title=eregi_replace("<B>","<b>",$title);
$title=eregi_replace("</B>","</b>",$title);
$title=eregi_replace("&nbsp;"," ",$title);
$atags = "<b><br />";
$title = strip_tags($title, $atags); ?>
<a href="link.php?id=<? echo "$sid" ?>">:<? echo " $title" ?></a><br/>
<? }
mysql_free_result($result); 
if ($i < $no_list){echo "";
}else{ $card = ($card+1);
$com = "<a href=\"#news$card\">more</a>";?>
</small></p>
<p><? echo "<br />$com";?></p>
</card> 
<card id="news<? echo $card ?>" title="<? echo $wap_title ?>">
<do type="prev" label="Back"><prev/></do>
<p> <small>
<?
$from = ($from+$t);
DB_connect($dbn,$host,$user,$pass);
$result = mysql_query("SELECT * FROM ".$dbpre."_stories WHERE catid=$id and published=1 and frontpage=0 ORDER BY time DESC LIMIT $from, $no_list");  
 while ($row = mysql_fetch_object($result)) {
$catid[$t] = $row->catid;
$sid = $row->sid;
$title = $row->title;
$t++; 
$title=eregi_replace("&","&amp;",$title); 
$title=eregi_replace("<br>","<br />",$title);
$title=eregi_replace("<strong>","<b>",$title);
$title=eregi_replace("</strong>","</b>",$title);
$title=eregi_replace("<B>","<b>",$title);
$title=eregi_replace("</B>","</b>",$title);
$title=eregi_replace("&nbsp;"," ",$title);
$atags = "<b><br />";
$title = strip_tags($title, $atags); ?>
<a href="link.php?id=<? echo "$sid" ?>">:<? echo " $title" ?></a><br/>
<?  }
mysql_free_result($result); }
?>
</small> </p>
</card>
</wml>