function storiescat()
{
global $limit, $prefix, $i, $item, $keywords;
if (!google_allowed("News"))
return;
$result = sql_query("SELECT DISTINCT c.catid, c.title, MAX( UNIX_TIMESTAMP(s.time) ) AS sTime
FROM `{$prefix}_stories_cat` AS c
LEFT JOIN {$prefix}_stories AS s ON ( c.catid = s.catid )
WHERE s.catid IS NOT NULL AND `time` <= now()
GROUP BY c.catid
LIMIT " . $limit);
if ($result) {
while ($row = sql_fetch_object($result)) {
$i++;
$item[$i]['link'] = PMX_HOME_URL . "/modules.php?name=News&file=categories&catid=" . $row->catid;
if (preg_match('#(' . $keywords . ')#i', $row->title))
$row->sTime = time();
$item[$i]['date'] = intval($row->sTime);
}
}
}
function topics()
{
global $limit, $prefix, $i, $item, $keywords;
if (!google_allowed("News") || !google_allowed("Topics"))
return;
$result = sql_query("SELECT DISTINCT t.topicid, t.topicname, MAX( UNIX_TIMESTAMP(s.time) ) AS sTime
FROM `{$prefix}_topics` AS t
LEFT JOIN {$prefix}_stories AS s ON ( t.topicid = s.topic )
WHERE s.topic IS NOT NULL AND `time` <= now()
GROUP BY t.topicid
LIMIT " . $limit);
if ($result) {
while ($row = sql_fetch_object($result)) {
$i++;
$item[$i]['link'] = PMX_HOME_URL . "/modules.php?name=News&new_topic=" . $row->topicid;
if (preg_match('#(' . $keywords . ')#i', $row->topicname))
$row->sTime = time();
$item[$i]['date'] = intval($row->sTime);
}
}
}
function stories()
{
global $limit, $prefix, $i, $item, $keywords;
if (!google_allowed("News"))
return;
$result = sql_query("SELECT sid, title, hometext, UNIX_TIMESTAMP(time)AS date FROM " . $prefix . "_stories WHERE `time` <= now() ORDER BY `time` DESC, sid DESC limit " . $limit);
if ($result) {
while ($row = sql_fetch_object($result)) {
$i++;
$item[$i]['link'] = PMX_HOME_URL . "/modules.php?name=News&file=article&sid=" . $row->sid;
if (preg_match('#(' . $keywords . ')#i', $row->title . $row->hometext))
$row->date = time();
$item[$i]['date'] = intval($row->date);
}
}
}
Bu Cod News Modulu için Acaba Gallery içinde Aynısı Varmı?
Yapabilirmek için Bir Fikir Yada Kaynak varmı?
Saygılarımla..