|
|
Registered User Currently Offline
|
Posts: 10
Join Date: Apr 2005
|
Is it possible that something was changed in the seo_options that or other page that might somehow affect the addon?
here's the lastposts_addon.php
<?php
if(!defined('SEO-BOARD'))
{
die($lang['fatal_error']);
}
error_reporting(E_ALL);
set_magic_quotes_runtime(0);
if (!get_magic_quotes_gpc())
array_add_slashes($_COOKIE);
//LAST POSTS ADDON OPTIONS
//exclude some forums from the last posts?
//example $addon_excludeforums = array(2, 4); will exclude topics from forums with IDs 2 and 4 from being shown in last posts
$addon_excludeforums = array(8);
$addon_shownumlastposts = 5; //show how many topics/posts?
require('seo-board_options.php');
require ('./code/functions.php');
require ('./code/skinning.php');
require ("./lang/$lang.php");
@mysql_connect($dbhost, $dbuser, $dbpass) or exit;
@mysql_select_db($dbname) or exit;
$user_id = 0;
$user_name = $lang['guest'];
$user_timezone = $forumtimezone;
$user_lastsession = 0;
if (isset($_COOKIE[$cookiename]))
{
list($user_id, $user_pass_sha1) = unserialize(stripslashes($_COOKIE[$cookiename]));
if (!is_numeric($user_id))
die($lang['fatal_error']);
$result = mysql_query("SELECT user_timezone, user_lasttimereadpost, user_lastsession FROM {$dbpref}users WHERE user_id='$user_id' AND user_pass='$user_pass_sha1'");
if (mysql_num_rows($result) != 1)
$user_id = 0;
else
{
$user_row = mysql_fetch_row($result);
list($user_timezone, $user_last_time_read_post, $user_lastsession) = $user_row;
$now = time();
if (($now - $user_last_time_read_post > $visittimeout) && ($user_lastsession != $user_last_time_read_post))
{
$user_lastsession = $user_last_time_read_post;
mysql_query("UPDATE {$dbpref}users SET user_lastsession='$user_lastsession' WHERE user_id='$user_id'");
}
}
}
$cell_iterator = 0;
//exclude private to the current user forums + the ones in $addon_excludeforums
$userprivateforums = get_invisible_forums($user_id);
if (!empty($addon_excludeforums))
$userprivateforums = array_unique(array_merge($userprivateforums, $addon_excludeforums));
if (count($userprivateforums)==0)
$result = mysql_query("SELECT topic_id, topic_title, topic_poster_name, topic_poster_id, topic_lastposter_name, topic_lastposter_id, topic_created_time, topic_lastpost_time, topic_numreplies, topic_numviews, topic_sticky, topic_locked, topic_moved FROM {$dbpref}topics ORDER BY topic_lastpost_time DESC LIMIT $addon_shownumlastposts") or die(mysql_error());
else
{
$where = 'WHERE forum_id<>'.implode(' AND forum_id<>', $userprivateforums);
$result = mysql_query("SELECT topic_id, topic_title, topic_poster_name, topic_poster_id, topic_lastposter_name, topic_lastposter_id, topic_created_time, topic_lastpost_time, topic_numreplies, topic_numviews, topic_sticky, topic_locked, topic_moved FROM {$dbpref}topics $where ORDER BY topic_lastpost_time DESC LIMIT $addon_shownumlastposts") or die(mysql_error());
}
if (mysql_num_rows($result) != 0)
{
$topics_html = array();
$template_topic = get_template('addon_lastpostscell');
while($row = mysql_fetch_row($result))
{
list($id, $title, $author, $author_id, $lastposter, $lastposter_id, $createdtime, $lastposttime, $num_replies, $num_views, $sticky, $locked, $moved) = $row;
$topic_link = get_topic_link($id, $title, $num_replies+1, 'topiclink');
if (($lastposttime > $user_lastsession) && ($lastposter_id != $user_id) && ($user_id != 0))
if ($createdtime < $user_lastsession) //created before lastsession
$topic_link = '<sup>'.$lang['new'].'</sup> '.$topic_link;
else//created after lastsession
if ($author_id != $user_id)
$topic_link = '<sup>'.$lang['new'].'</sup> '.$topic_link;
$started_by = $lang['started_by'].' '.$author;
$lastpost = $lastposter.'<br>'.format_datetime($lastposttime, $user_timezone);
array_push($topics_html, eval($template_topic));
$cell_iterator = 1 - $cell_iterator;
}
$topics_html = implode('', $topics_html);
print eval(get_template('addon_lastposts'));
unset($template_topic);
}
?>
Here's all I have on the posts.php
<?php
print("Hello World");?>
<?php DEFINE ('SEO-BOARD', true); include('lastposts_addon.php');?>
|