Witam , mam problem robię filtrację pewnego kawalku kodu no i zamiast wyświetlić mi kod przefiltrowany pokazuje mi Array. Dlaczego ?
Plik robiący filtracje
<?php
class show
{
function show()
{
$this->emot = &$GLOBALS['table']['emot'];
}
function emot()
{
$res = mysql_query(\"SELECT * FROM { $this->emot}\"); if($re['emot'] == '-') return false;
if($re['emot'] == '+') return true;
}
function k_news($ret, $r, $kom, $text)
{
#if(show::emot() == true) show::str_emot($r);
$ret = str_replace('{news:pirint}', '<a href=\"print.php?a=news&id='.$r['id'].'\"><img src=\"theme/news/gxf/print.gif\" alt=\"\" border=\"0\" /></a>', $ret); $ret = str_replace('{news:kom}', '<a href=\"news.php?a=kom&id='.$r['id'].'\">'.$text['kom'].' ('.$kom.')</a>', $ret); if($r['dtext'] != '')
{
$ret = str_replace('{news:stext}', '<a href=\"news.php?a=show&id='.$r['id'].'\">'.$text['more'].'', $ret);
} // if
return $ret;
} // function
} // class
?>
Plik który ma być przefiltorwany
<div class="tyt"><p>{news:titile}{news:data}
</p></div> <div class="news"><p>{news:ktext}
</p></div> <div class="newsd">{news:more}{news:print}{news:kom}
<p></p></div>
Natomiast Plik wyświetlający:
<?php
class news
{
function news()
{
$this->news = &$GLOBALS['table']['news'];
$this->limit = &$GLOBALS['table']['limit'];
$this->kom = &$GLOBALS['table']['kom'];
} // function
function limit()
{
$res = mysql_query(\"SELECT * FROM {$this->limit} WHERE co='news'\"); $limit = $rr['ile'];
return $limit;
} // function
function show()
{
$limit = news::limit();
include_once('news_lib/news_str.lib.php');
$resul = mysql_query(\"SELECT * FROM {$this->news} WHERE act='1' ORDER BY id DESC\"); $pages = ceil($numer/$limit); $page = intval($_GET['page'] ); if ($page < 1 || $page > $pages)
{
$page = 1;
} // if
$ret = file('theme/news/news.th.php'); $text = file('news_lib/teksty.lib.php'); $result = mysql_query(\"SELECT * FROM {$this->news} WHERE act='1' ORDER BY id DESC LIMIT {$limit} OFFSET \".(($page-1)*$limit)); {
$komm = mysql_query(\"SELECT * FROM {$this->kom} WHERE news='{$r['id']}'\"); echo show
::k_news($ret, $r, $kom, $text);
}
} // function
} // class
?>
Ten post edytował Hpsi+ 15.03.2005, 15:41:20