2006-12-02 04:36:16 +00:00
|
|
|
|
<?php
|
|
|
|
|
/*
|
|
|
|
|
+ ----------------------------------------------------------------------------+
|
|
|
|
|
| e107 website system
|
|
|
|
|
|
|
|
|
|
|
| <EFBFBD>Steve Dunstan 2001-2002
|
|
|
|
|
| http://e107.org
|
|
|
|
|
| jalist@e107.org
|
|
|
|
|
|
|
|
|
|
|
| Released under the terms and conditions of the
|
|
|
|
|
| GNU General Public License (http://gnu.org).
|
|
|
|
|
|
|
|
|
|
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/newforumposts_menu.php,v $
|
2007-10-08 21:02:52 +00:00
|
|
|
|
| $Revision: 1.5 $
|
|
|
|
|
| $Date: 2007-10-08 21:02:42 $
|
2007-05-28 16:52:49 +00:00
|
|
|
|
| $Author: e107steved $
|
2006-12-02 04:36:16 +00:00
|
|
|
|
+----------------------------------------------------------------------------+
|
|
|
|
|
*/
|
|
|
|
|
if (!defined('e107_INIT')) { exit; }
|
|
|
|
|
|
|
|
|
|
global $tp;
|
|
|
|
|
$gen = new convert;
|
|
|
|
|
|
|
|
|
|
if (file_exists(e_PLUGIN."forum/languages/".e_LANGUAGE."/lan_newforumposts_menu.php"))
|
|
|
|
|
{
|
|
|
|
|
include_once(e_PLUGIN."forum/languages/".e_LANGUAGE."/lan_newforumposts_menu.php");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
include_once(e_PLUGIN."forum/languages/English/lan_newforumposts_menu.php");
|
|
|
|
|
}
|
|
|
|
|
|
2007-07-23 21:13:34 +00:00
|
|
|
|
$max_age = varset($menu_pref['newforumposts_maxage'],0);
|
2007-10-08 21:02:52 +00:00
|
|
|
|
$max_age = $max_age == 0 ? '' : "(t.thread_datestamp > ".intval(time()-$max_age*86400).") AND ";
|
2006-12-02 04:36:16 +00:00
|
|
|
|
$query2 = "
|
2007-07-23 21:13:34 +00:00
|
|
|
|
SELECT tp.thread_name AS parent_name,
|
|
|
|
|
t.thread_datestamp , t.thread_thread, t.thread_name, t.thread_id, t.thread_user,
|
|
|
|
|
f.forum_id, f.forum_name, f.forum_class, u.user_name, fp.forum_class FROM #forum_t AS t
|
2006-12-02 04:36:16 +00:00
|
|
|
|
LEFT JOIN #user AS u ON t.thread_user = u.user_id
|
|
|
|
|
LEFT JOIN #forum_t AS tp ON t.thread_parent = tp.thread_id
|
2007-07-23 21:13:34 +00:00
|
|
|
|
LEFT JOIN #forum AS f ON (f.forum_id = t.thread_forum_id AND f.forum_class IN (".USERCLASS_LIST."))
|
2006-12-02 04:36:16 +00:00
|
|
|
|
LEFT JOIN #forum AS fp ON f.forum_parent = fp.forum_id
|
2007-07-23 21:13:34 +00:00
|
|
|
|
WHERE {$max_age} fp.forum_class IN (".USERCLASS_LIST.")
|
2006-12-02 04:36:16 +00:00
|
|
|
|
ORDER BY t.thread_datestamp DESC LIMIT 0, ".$menu_pref['newforumposts_display'];
|
|
|
|
|
|
2007-07-23 21:13:34 +00:00
|
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
|
$results = $sql->db_Select_gen($query2);
|
|
|
|
|
|
|
|
|
|
if(!$results)
|
|
|
|
|
{
|
|
|
|
|
// no posts yet ..
|
|
|
|
|
$text = NFP_2;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$text = "";
|
|
|
|
|
$forumArray = $sql->db_getList();
|
|
|
|
|
foreach($forumArray as $fi)
|
|
|
|
|
{
|
|
|
|
|
$datestamp = $gen->convert_date($fi['thread_datestamp'], "short");
|
|
|
|
|
$topic = ($fi['parent_name'] ? "Re: <i>{$fi['parent_name']}</i>" : "<i>{$fi['thread_name']}</i>");
|
|
|
|
|
$topic = strip_tags($tp->toHTML($topic, TRUE, "emotes_off, no_make_clickable, parse_bb", "", $pref['menu_wordwrap']));
|
|
|
|
|
$id = $fi['thread_id'];
|
|
|
|
|
|
|
|
|
|
if($fi['user_name'])
|
|
|
|
|
{
|
|
|
|
|
$poster = $fi['user_name'];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$x = explode(chr(1), $fi['thread_user']);
|
|
|
|
|
$tmp = explode(".", $x[0], 2);
|
|
|
|
|
if($tmp[1])
|
|
|
|
|
{
|
|
|
|
|
$poster = $tmp[1];
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
$poster = "[deleted]";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$fi['thread_thread'] = strip_tags($tp->toHTML($fi['thread_thread'], TRUE, "emotes_off, no_make_clickable", "", $pref['menu_wordwrap']));
|
|
|
|
|
|
2007-06-08 19:15:08 +00:00
|
|
|
|
$fi['thread_thread'] = $tp->text_truncate($fi['thread_thread'], $menu_pref['newforumposts_characters'], $menu_pref['newforumposts_postfix']);
|
2006-12-02 04:36:16 +00:00
|
|
|
|
|
|
|
|
|
if ($menu_pref['newforumposts_title'])
|
|
|
|
|
{
|
2007-05-28 16:52:49 +00:00
|
|
|
|
$text .= "<img src='".THEME_ABS."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' /> <a href='".e_PLUGIN."forum/forum_viewtopic.php?{$id}.post'>".$topic."</a><br />".$fi['thread_thread']."<br />".NFP_11." ".$poster."<br />".$datestamp."<br/><br />";
|
2006-12-02 04:36:16 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2007-05-28 16:52:49 +00:00
|
|
|
|
$text .= "<img src='".THEME_ABS."images/".(defined("BULLET") ? BULLET : "bullet2.gif")."' alt='' /> <a href='".e_PLUGIN."forum/forum_viewtopic.php?{$id}.post'>".NFP_11." ".$poster."</a><br />".$fi['thread_thread']."<br />".$datestamp."<br/><br />";
|
2006-12-02 04:36:16 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$ns->tablerender($menu_pref['newforumposts_caption'], $text, 'nfp_menu');
|
|
|
|
|
|
|
|
|
|
?>
|