1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 12:48:26 +02:00

Finalizing schema, thread viewing pagination working, other work.

This commit is contained in:
mcfly
2008-12-15 00:29:20 +00:00
parent 8251c62606
commit 384cbbcf2c
21 changed files with 153 additions and 666 deletions

View File

@@ -0,0 +1,19 @@
<?php
/*
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id: main.php,v 1.1 2008-12-15 00:29:20 mcfly_e107 Exp $
*
* eURL configuration script
*/
function url_core_main($parms)
{
switch ($parms['action'])
{
case 'index':
return e_HTTP.'index.php';
break;
}
}
?>

View File

@@ -1,11 +1,12 @@
<?php <?php
// $Id: forum.php,v 1.3 2008-12-13 21:52:19 mcfly_e107 Exp $ // $Id: forum.php,v 1.4 2008-12-15 00:29:20 mcfly_e107 Exp $
function url_forum_forum($parms) function url_forum_forum($parms)
{ {
switch($parms['func']) switch($parms['func'])
{ {
case 'view': case 'view':
return e_PLUGIN_ABS."forum/forum_viewforum.php?id={$parms['id']}"; $page = (varset($parms['page']) ? '&p='.$parms['page'] : '');
return e_PLUGIN_ABS."forum/forum_viewforum.php?id={$parms['id']}{$page}";
break; break;
case 'track': case 'track':

View File

@@ -1,5 +1,5 @@
<?php <?php
// $Id: thread.php,v 1.7 2008-12-14 03:18:45 mcfly_e107 Exp $ // $Id: thread.php,v 1.8 2008-12-15 00:29:20 mcfly_e107 Exp $
function url_forum_thread($parms) function url_forum_thread($parms)
{ {
switch($parms['func']) switch($parms['func'])
@@ -36,7 +36,11 @@ function url_forum_thread($parms)
break; break;
case 'move': case 'move':
return e_PLUGIN_ABS."forum/forum_post.php?f=move&id={$parms['id']}"; return e_PLUGIN_ABS."forum/forum_conf.php?f=move&id={$parms['id']}";
break;
case 'split':
return e_PLUGIN_ABS."forum/forum_conf.php?f=split&id={$parms['id']}";
break; break;
case 'quote': case 'quote':

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum.php,v $
| $Revision: 1.10 $ | $Revision: 1.11 $
| $Date: 2008-12-10 21:00:48 $ | $Date: 2008-12-15 00:29:20 $
| $Author: mcfly_e107 $ | $Author: mcfly_e107 $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -212,7 +212,7 @@ require_once(HEADERF);
$parent_list = $forum->forum_getparents(); $parent_list = $forum->forum_getparents();
$forum_list = $forum->forum_getforums(); $forum_list = $forum->forum_getforums();
$sub_list = $forum->forum_getsubs(); $sub_list = $forum->forumGetSubs();
$newflag_list = $forum->forum_newflag_list(); $newflag_list = $forum->forum_newflag_list();
if (!$parent_list) if (!$parent_list)

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_admin.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_admin.php,v $
| $Revision: 1.5 $ | $Revision: 1.6 $
| $Date: 2008-12-05 01:30:56 $ | $Date: 2008-12-15 00:29:20 $
| $Author: mcfly_e107 $ | $Author: mcfly_e107 $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -233,12 +233,12 @@ if(isset($_POST['update_forum']))
$tmp['WHERE'] = 'forum_id = '.(int)$id; $tmp['WHERE'] = 'forum_id = '.(int)$id;
$tmp2['_FIELD_TYPES'] = $tmp['_FIELD_TYPES']; $tmp2['_FIELD_TYPES'] = $tmp['_FIELD_TYPES'];
$tmp2['forum_moderators'] = $tmp['forum_moderators']; $tmp2['forum_moderators'] = $tmp['forum_moderators'];
$tmp2['forum_class'] = $tmp['forum_class']; $tmp2['forum_class'] = $tmp['forum_class'];
$tmp2['forum_postclass'] = $tmp['forum_postclass']; $tmp2['forum_postclass'] = $tmp['forum_postclass'];
$tmp2['forum_threadclass'] = $tmp['forum_threadclass']; $tmp2['forum_threadclass'] = $tmp['forum_threadclass'];
$tmp2['WHERE'] = 'forum_sub = '.(int)$id; $tmp2['WHERE'] = 'forum_sub = '.(int)$id;
$sql->db_Update('forum', $tmp); $sql->db_Update('forum', $tmp);
$sql->db_Update('forum', $tmp2); $sql->db_Update('forum', $tmp2);
@@ -268,6 +268,7 @@ if (isset($_POST['updateoptions']))
$pref['forum_enclose'] = $_POST['forum_enclose']; $pref['forum_enclose'] = $_POST['forum_enclose'];
$pref['forum_title'] = $_POST['forum_title']; $pref['forum_title'] = $_POST['forum_title'];
$pref['forum_postspage'] = $_POST['forum_postspage']; $pref['forum_postspage'] = $_POST['forum_postspage'];
$pref['forum_threadspage'] = $_POST['forum_threadspage'];
$pref['html_post'] = $_POST['html_post']; $pref['html_post'] = $_POST['html_post'];
$pref['forum_attach'] = $_POST['forum_attach']; $pref['forum_attach'] = $_POST['forum_attach'];
$pref['forum_redirect'] = $_POST['forum_redirect']; $pref['forum_redirect'] = $_POST['forum_redirect'];

View File

@@ -9,8 +9,8 @@
* Forum admin functions * Forum admin functions
* *
* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_admin_class.php,v $ * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_admin_class.php,v $
* $Revision: 1.9 $ * $Revision: 1.10 $
* $Date: 2008-12-10 15:29:31 $ * $Date: 2008-12-15 00:29:20 $
* $Author: mcfly_e107 $ * $Author: mcfly_e107 $
* *
*/ */
@@ -258,7 +258,7 @@ class forumAdmin
{ {
global $e107, $for; global $e107, $for;
$subList = $for->forum_getsubs(); $subList = $for->forumGetSubs();
if (!$mode) if (!$mode)
{ {
@@ -737,6 +737,11 @@ class forumAdmin
<td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_postspage' size='3' value='".$pref['forum_postspage']."' maxlength='3' /></td> <td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_postspage' size='3' value='".$pref['forum_postspage']."' maxlength='3' /></td>
</tr> </tr>
<tr>
<td style='width:75%' class='forumheader3'>".FORLAN_186."<br /><span class='smalltext'>".FORLAN_187."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' ><input class='tbox' type='text' name='forum_threadspage' size='3' value='".$pref['forum_threadspage']."' maxlength='3' /></td>
</tr>
<tr> <tr>
<td style='width:75%' class='forumheader3'>".FORLAN_132."<br /><span class='smalltext'>".FORLAN_133."</span></td> <td style='width:75%' class='forumheader3'>".FORLAN_132."<br /><span class='smalltext'>".FORLAN_133."</span></td>
<td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_hilightsticky'] ? "<input type='checkbox' name='forum_hilightsticky' value='1' checked='checked' />" : "<input type='checkbox' name='forum_hilightsticky' value='1' />")."</td> <td style='width:25%;text-align:center' class='forumheader3' >".($pref['forum_hilightsticky'] ? "<input type='checkbox' name='forum_hilightsticky' value='1' checked='checked' />" : "<input type='checkbox' name='forum_hilightsticky' value='1' />")."</td>

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_class.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_class.php,v $
| $Revision: 1.26 $ | $Revision: 1.27 $
| $Date: 2008-12-14 03:18:45 $ | $Date: 2008-12-15 00:29:20 $
| $Author: mcfly_e107 $ | $Author: mcfly_e107 $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -39,7 +39,7 @@ class e107forum
$this->fieldTypes['forum_thread']['thread_user'] = 'int'; $this->fieldTypes['forum_thread']['thread_user'] = 'int';
$this->fieldTypes['forum_thread']['thread_lastpost'] = 'int'; $this->fieldTypes['forum_thread']['thread_lastpost'] = 'int';
$this->fieldTypes['forum_thread']['thread_lastuser'] = 'int'; $this->fieldTypes['forum_thread']['thread_lastuser'] = 'int';
$this->fieldTypes['forum_thread']['thread_s'] = 'int'; $this->fieldTypes['forum_thread']['thread_sticky'] = 'int';
$this->fieldTypes['forum_thread']['thread_forum_id'] = 'int'; $this->fieldTypes['forum_thread']['thread_forum_id'] = 'int';
$this->fieldTypes['forum_thread']['thread_active'] = 'int'; $this->fieldTypes['forum_thread']['thread_active'] = 'int';
$this->fieldTypes['forum_thread']['thread_datestamp'] = 'int'; $this->fieldTypes['forum_thread']['thread_datestamp'] = 'int';
@@ -282,9 +282,9 @@ class e107forum
{ {
//TODO: Fix query to get only forum and parent info needed, with correct naming //TODO: Fix query to get only forum and parent info needed, with correct naming
$qry = ' $qry = '
SELECT t.*, f.*, SELECT t.*, f.*,
fp.forum_id as parent_id, fp.forum_name as parent_name, fp.forum_id as parent_id, fp.forum_name as parent_name,
sp.forum_id as forum_sub, sp.forum_name as sub_parent, sp.forum_id as forum_sub, sp.forum_name as sub_parent,
tr.track_userid tr.track_userid
FROM `#forum_thread` AS t FROM `#forum_thread` AS t
LEFT JOIN `#forum` AS f ON t.thread_forum_id = f.forum_id LEFT JOIN `#forum` AS f ON t.thread_forum_id = f.forum_id
@@ -457,7 +457,7 @@ class e107forum
/** /**
* Given threadId and postId, determine which number of post in thread the postid is * Given threadId and postId, determine which number of post in thread the postid is
* *
*/ */
function postGetPostNum($threadId, $postId) function postGetPostNum($threadId, $postId)
{ {
@@ -589,13 +589,13 @@ class e107forum
function threadMarkAsRead($threadId) function threadMarkAsRead($threadId)
{ {
global $currentUser;
$e107 = e107::getInstance(); $e107 = e107::getInstance();
$threadId = (int)$threadId; $threadId = (int)$threadId;
$currentUser['user_plugin_forum_viewed'] = '4..5..6.7.8'; $_tmp = preg_split('#\,+#', $currentUser['user_plugin_forum_viewed']);
$_tmp = preg_split('#\.+#', $currentUser['user_plugin_forum_viewed']);
$_tmp[] = $threadId; $_tmp[] = $threadId;
$viewed = '.'.implode('.', $_tmp).'.'; $tmp = array_unique($tmp);
unset($_tmp); $viewed = trim(implode(',', $_tmp), ',');
return $e107->sql->db_Update('user_extended', "user_plugin_forum_viewed = '{$viewed}' WHERE user_extended_id = ".USERID); return $e107->sql->db_Update('user_extended', "user_plugin_forum_viewed = '{$viewed}' WHERE user_extended_id = ".USERID);
} }
@@ -657,13 +657,13 @@ class e107forum
return FALSE; return FALSE;
} }
function forum_getsubs($forum_id = '') function forumGetSubs($forum_id = '')
{ {
global $sql; global $sql;
$where = ($forum_id != '' && $forum_id != 'bysub' ? "AND forum_sub = ".(int)$forum_id : ''); $where = ($forum_id != '' && $forum_id != 'bysub' ? 'AND forum_sub = '.(int)$forum_id : '');
$qry = " $qry = "
SELECT f.*, u.user_name FROM #forum AS f SELECT f.*, u.user_name FROM `#forum` AS f
LEFT JOIN #user AS u ON f.forum_lastpost_user = u.user_id LEFT JOIN `#user` AS u ON f.forum_lastpost_user = u.user_id
WHERE forum_sub != 0 {$where} WHERE forum_sub != 0 {$where}
ORDER BY f.forum_order ASC ORDER BY f.forum_order ASC
"; ";
@@ -671,7 +671,7 @@ class e107forum
{ {
while ($row = $sql->db_Fetch(MYSQL_ASSOC)) while ($row = $sql->db_Fetch(MYSQL_ASSOC))
{ {
if($forum_id == "") if($forum_id == '')
{ {
$ret[$row['forum_parent']][$row['forum_sub']][] = $row; $ret[$row['forum_parent']][$row['forum_sub']][] = $row;
} }
@@ -846,7 +846,7 @@ class e107forum
LEFT JOIN `#user` AS lpu ON t.thread_lastuser = lpu.user_id LEFT JOIN `#user` AS lpu ON t.thread_lastuser = lpu.user_id
WHERE t.thread_forum_id = {$forumId} WHERE t.thread_forum_id = {$forumId}
ORDER BY ORDER BY
t.thread_s DESC, t.thread_sticky DESC,
t.thread_lastpost DESC t.thread_lastpost DESC
LIMIT ".(int)$from.','.(int)$view; LIMIT ".(int)$from.','.(int)$view;
@@ -909,7 +909,7 @@ class e107forum
WHERE thread_forum_id = $forumId WHERE thread_forum_id = $forumId
AND thread_lastpost {$dir} $lastpost AND thread_lastpost {$dir} $lastpost
ORDER BY ORDER BY
thread_s DESC, thread_sticky DESC,
thread_lastpost {$sort} thread_lastpost {$sort}
LIMIT 1"; LIMIT 1";
if ($e107->sql->db_Select_gen($qry)) if ($e107->sql->db_Select_gen($qry))
@@ -934,7 +934,7 @@ class e107forum
WHERE t.thread_forum_id = $forum_id WHERE t.thread_forum_id = $forum_id
AND t.thread_parent = 0 AND t.thread_parent = 0
ORDER BY ORDER BY
t.thread_s DESC, t.thread_sticky DESC,
t.thread_lastpost DESC, t.thread_lastpost DESC,
t.thread_datestamp DESC t.thread_datestamp DESC
LIMIT ".intval($from).",".intval($limit); LIMIT ".intval($from).",".intval($limit);
@@ -1127,7 +1127,7 @@ class e107forum
} }
} }
function thread_insert($thread_name, $thread_thread, $thread_forum_id, $thread_parent, $thread_poster, $thread_active, $thread_s, $forum_sub) function thread_insert($thread_name, $thread_thread, $thread_forum_id, $thread_parent, $thread_poster, $thread_active, $thread_sticky, $forum_sub)
{ {
$post_time = time(); $post_time = time();
global $sql, $tp, $pref, $e107; global $sql, $tp, $pref, $e107;
@@ -1147,7 +1147,7 @@ class e107forum
} }
$post_last_user = ($thread_parent ? "" : $post_user); $post_last_user = ($thread_parent ? "" : $post_user);
$vals = "'0', '{$thread_name}', '{$thread_thread}', '".intval($thread_forum_id)."', '".intval($post_time)."', '".intval($thread_parent)."', '{$thread_post_user}', '0', '".intval($thread_active)."', '$post_time', '$thread_s', '0', '{$post_last_user}', '0'"; $vals = "'0', '{$thread_name}', '{$thread_thread}', '".intval($thread_forum_id)."', '".intval($post_time)."', '".intval($thread_parent)."', '{$thread_post_user}', '0', '".intval($thread_active)."', '$post_time', '$thread_sticky', '0', '{$post_last_user}', '0'";
$newthread_id = $sql->db_Insert('forum_t', $vals); $newthread_id = $sql->db_Insert('forum_t', $vals);
if(!$newthread_id) if(!$newthread_id)
{ {
@@ -1262,7 +1262,7 @@ class e107forum
if($type == 'delete') if($type == 'delete')
{ {
//Get list of threads to prune //Get list of threads to prune
if ($sql->db_Select("forum_t", "thread_id", "thread_lastpost < $prunedate AND thread_parent=0 AND thread_s != 1 AND thread_forum_id IN ({$forumList})")) if ($sql->db_Select("forum_t", "thread_id", "thread_lastpost < $prunedate AND thread_parent=0 AND thread_sticky != 1 AND thread_forum_id IN ({$forumList})"))
{ {
$threadList = $sql->db_getList(); $threadList = $sql->db_getList();
foreach($threadList as $thread) foreach($threadList as $thread)

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_mod.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_mod.php,v $
| $Revision: 1.4 $ | $Revision: 1.5 $
| $Date: 2008-12-11 16:02:05 $ | $Date: 2008-12-15 00:29:20 $
| $Author: mcfly_e107 $ | $Author: mcfly_e107 $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -49,12 +49,12 @@ function forum_thread_moderate($p)
break; break;
case 'stick': case 'stick':
$e107->sql->db_Update('forum_thread', 'thread_s=1 WHERE thread_id='.$id); $e107->sql->db_Update('forum_thread', 'thread_sticky=1 WHERE thread_id='.$id);
return FORLAN_STICK; return FORLAN_STICK;
break; break;
case 'unstick': case 'unstick':
$e107->sql->db_Update('forum_thread', 'thread_s=0 WHERE thread_id='.$id); $e107->sql->db_Update('forum_thread', 'thread_sticky=0 WHERE thread_id='.$id);
return FORLAN_UNSTICK; return FORLAN_UNSTICK;
break; break;

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_post.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_post.php,v $
| $Revision: 1.31 $ | $Revision: 1.32 $
| $Date: 2008-12-13 21:52:18 $ | $Date: 2008-12-15 00:29:20 $
| $Author: mcfly_e107 $ | $Author: mcfly_e107 $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -269,7 +269,7 @@ if (isset($_POST['newthread']) || isset($_POST['reply']))
// New thread started. Add the thread info (with lastest post info), add the post. // New thread started. Add the thread info (with lastest post info), add the post.
// Update forum with latest post info // Update forum with latest post info
case 'nt': case 'nt':
$threadInfo['thread_s'] = (MODERATOR ? (int)$_POST['threadtype'] : 0); $threadInfo['thread_sticky'] = (MODERATOR ? (int)$_POST['threadtype'] : 0);
$threadInfo['thread_name'] = $_POST['subject']; $threadInfo['thread_name'] = $_POST['subject'];
$threadInfo['thread_forum_id'] = $forumId; $threadInfo['thread_forum_id'] = $forumId;
$threadInfo['thread_active'] = 1; $threadInfo['thread_active'] = 1;
@@ -375,9 +375,9 @@ if (isset($_POST['update_thread']))
$postVals['post_edit_datestamp'] = time(); $postVals['post_edit_datestamp'] = time();
$postVals['post_edit_user'] = USERID; $postVals['post_edit_user'] = USERID;
$postVals['post_entry'] = $_POST['post']; $postVals['post_entry'] = $_POST['post'];
$threadVals['thread_name'] = $_POST['subject']; $threadVals['thread_name'] = $_POST['subject'];
$forum->threadUpdate($postInfo['post_thread'], $threadVals); $forum->threadUpdate($postInfo['post_thread'], $threadVals);
$forum->postUpdate($postInfo['post_id'], $postVals); $forum->postUpdate($postInfo['post_id'], $postVals);
$e107cache->clear('newforumposts'); $e107cache->clear('newforumposts');
@@ -405,7 +405,7 @@ if (isset($_POST['update_reply']))
$postVals['post_edit_datestamp'] = time(); $postVals['post_edit_datestamp'] = time();
$postVals['post_edit_user'] = USERID; $postVals['post_edit_user'] = USERID;
$postVals['post_entry'] = $_POST['post']; $postVals['post_entry'] = $_POST['post'];
$forum->postUpdate($postInfo['post_id'], $postVals); $forum->postUpdate($postInfo['post_id'], $postVals);
$e107cache->clear('newforumposts'); $e107cache->clear('newforumposts');
$url = $e107->url->getUrl('forum', 'thread', "func=post&id={$postInfo['post_id']}"); $url = $e107->url->getUrl('forum', 'thread', "func=post&id={$postInfo['post_id']}");

View File

@@ -108,8 +108,8 @@ SC_BEGIN POSTTHREADAS
global $action, $thread_info; global $action, $thread_info;
if (MODERATOR && $action == "nt") if (MODERATOR && $action == "nt")
{ {
$thread_s = (isset($_POST['threadtype']) ? $_POST['threadtype'] : $thread_info['head']['thread_s']); $thread_sticky = (isset($_POST['threadtype']) ? $_POST['threadtype'] : $thread_info['head']['thread_sticky']);
return "<br /><span class='defaulttext'>".LAN_400."<input name='threadtype' type='radio' value='0' ".(!$thread_s ? "checked='checked' " : "")." />".LAN_1."&nbsp;<input name='threadtype' type='radio' value='1' ".($thread_s == 1 ? "checked='checked' " : "")." />".LAN_2."&nbsp;<input name='threadtype' type='radio' value='2' ".($thread_s == 2 ? "checked='checked' " : "")." />".LAN_3."</span>"; return "<br /><span class='defaulttext'>".LAN_400."<input name='threadtype' type='radio' value='0' ".(!$thread_sticky ? "checked='checked' " : "")." />".LAN_1."&nbsp;<input name='threadtype' type='radio' value='1' ".($thread_sticky == 1 ? "checked='checked' " : "")." />".LAN_2."&nbsp;<input name='threadtype' type='radio' value='2' ".($thread_sticky == 2 ? "checked='checked' " : "")." />".LAN_3."</span>";
} }
return ''; return '';
SC_END SC_END

View File

@@ -29,7 +29,7 @@ SC_END
SC_BEGIN POSTDELETED SC_BEGIN POSTDELETED
global $postInfo; global $postInfo;
if($postInfo['post_s']) if($postInfo['post_status'])
{ {
$info = unserialize($postInfo['post_options']); $info = unserialize($postInfo['post_options']);
return " return "

View File

@@ -28,7 +28,7 @@ CREATE TABLE forum_thread (
`thread_views` int(10) unsigned NOT NULL default '0', `thread_views` int(10) unsigned NOT NULL default '0',
`thread_active` tinyint(3) unsigned NOT NULL default '0', `thread_active` tinyint(3) unsigned NOT NULL default '0',
`thread_lastpost` int(10) unsigned NOT NULL default '0', `thread_lastpost` int(10) unsigned NOT NULL default '0',
`thread_s` tinyint(1) unsigned NOT NULL default '0', `thread_sticky` tinyint(1) unsigned NOT NULL default '0',
`thread_datestamp` int(10) unsigned default NULL, `thread_datestamp` int(10) unsigned default NULL,
`thread_user` int(10) unsigned default NULL, `thread_user` int(10) unsigned default NULL,
`thread_user_anon` varchar(30) NULL, `thread_user_anon` varchar(30) NULL,
@@ -47,7 +47,7 @@ CREATE TABLE forum_post (
`post_entry` text NOT NULL, `post_entry` text NOT NULL,
`post_thread` int(10) unsigned default NULL, `post_thread` int(10) unsigned default NULL,
`post_forum` int(10) unsigned default NULL, `post_forum` int(10) unsigned default NULL,
`post_s` tinyint(1) unsigned NOT NULL default '0', `post_status` tinyint(1) unsigned NOT NULL default '0',
`post_datestamp` int(10) unsigned NOT NULL default '0', `post_datestamp` int(10) unsigned NOT NULL default '0',
`post_user` int(10) unsigned NOT NULL, `post_user` int(10) unsigned NOT NULL,
`post_edit_datestamp` int(10) unsigned NOT NULL default '0', `post_edit_datestamp` int(10) unsigned NOT NULL default '0',

View File

@@ -9,8 +9,8 @@
* View specific forums * View specific forums
* *
* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_viewforum.php,v $ * $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_viewforum.php,v $
* $Revision: 1.9 $ * $Revision: 1.10 $
* $Date: 2008-12-14 03:18:45 $ * $Date: 2008-12-15 00:29:20 $
* $Author: mcfly_e107 $ * $Author: mcfly_e107 $
* *
*/ */
@@ -30,8 +30,12 @@ if (!e_QUERY)
exit; exit;
} }
$view = 25; //$view = 25;
$threadFrom = (isset($_REQUEST['p']) ? $_REQUEST['p'] * $view : 0); //echo "pref = {$pref['forum_threadspage']} <br />";
$view = (varset($pref['forum_threadspage']) ? $pref['forum_threadspage'] : 25);
//echo "view = $view <br />";
$page = (varset($_GET['p']) ? $_GET['p'] : 0);
$threadFrom = $page * $view;
require_once(e_PLUGIN.'forum/forum_class.php'); require_once(e_PLUGIN.'forum/forum_class.php');
$forum = new e107forum; $forum = new e107forum;
@@ -118,14 +122,12 @@ else
$pages = false; $pages = false;
} }
//echo "pages = $pages <br />";
if ($pages) if ($pages)
{ {
if(strpos($FORUM_VIEW_START, 'THREADPAGES') !== false || strpos($FORUM_VIEW_END, 'THREADPAGES') !== false) if(strpos($FORUM_VIEW_START, 'THREADPAGES') !== false || strpos($FORUM_VIEW_END, 'THREADPAGES') !== false)
{ {
$parms = "{$threadCount},{$view},{$threadFrom},".e_SELF.'?'.$forumId.'.[FROM],off'; $parms = "{$pages},1,{$page},url::forum::forum::func=view&id={$forumId}&page=[FROM], off";
$THREADPAGES = $tp->parseTemplate("{NEXTPREV={$parms}}"); $THREADPAGES = $e107->tp->parseTemplate("{NEXTPREV={$parms}}");
} }
} }
@@ -209,16 +211,15 @@ $reg_threads = 0;
$unstuck = false; $unstuck = false;
$threadList = $forum->forumGetThreads($forumId, $threadFrom, $view); $threadList = $forum->forumGetThreads($forumId, $threadFrom, $view);
$subList = $forum->forum_getsubs($forum_id); $subList = $forum->forumGetSubs($forum_id);
//print_a($sub_list);
$gen = new convert; $gen = new convert;
$SUBFORUMS = ''; $SUBFORUMS = '';
if(is_array($sub_list)) if(is_array($subList) && isset($subList[$forumInfo['forum_parent']][$forumId]))
{ {
$newflag_list = $forum->forum_newflag_list(); $newflag_list = $forum->forum_newflag_list();
$sub_info = ''; $sub_info = '';
foreach($sub_list as $sub) foreach($subList[$forumInfo['forum_parent']][$forumId] as $sub)
{ {
$sub_info .= parse_sub($sub); $sub_info .= parse_sub($sub);
} }
@@ -237,7 +238,7 @@ if (count($threadList) )
{ {
$thread_info['thread_options'] = array(); $thread_info['thread_options'] = array();
} }
if ($thread_info['thread_s']) if ($thread_info['thread_sticky'])
{ {
$sticky_threads ++; $sticky_threads ++;
} }
@@ -253,7 +254,7 @@ if (count($threadList) )
} }
$stuck = true; $stuck = true;
} }
if (!$thread_info['thread_s']) if (!$thread_info['thread_sticky'])
{ {
$reg_threads ++; $reg_threads ++;
} }
@@ -312,7 +313,7 @@ require_once(FOOTERF);
function parse_thread($thread_info) function parse_thread($thread_info)
{ {
global $forum, $tp, $FORUM_VIEW_FORUM, $FORUM_VIEW_FORUM_STICKY, $FORUM_VIEW_FORUM_ANNOUNCE, $gen, $pref, $forum_id, $menu_pref; global $forum, $FORUM_VIEW_FORUM, $FORUM_VIEW_FORUM_STICKY, $FORUM_VIEW_FORUM_ANNOUNCE, $gen, $pref, $forum_id, $menu_pref;
$e107 = e107::getInstance(); $e107 = e107::getInstance();
$text = ''; $text = '';
@@ -327,13 +328,14 @@ function parse_thread($thread_info)
$lastpost_datestamp = $gen->convert_date($thread_info['thread_lastpost'], 'forum'); $lastpost_datestamp = $gen->convert_date($thread_info['thread_lastpost'], 'forum');
if($thread_info['lastpost_username']) if($thread_info['lastpost_username'])
{ {
$LASTPOST = "<a href='".e_BASE."user.php?id.".$tmp[0]."'>".$thread_info['lastpost_username']."</a>"; $url = $e107->url->getUrl('core:user', 'main', "func=profile&id={$thread_info['thread_lastuser']}");
$LASTPOST = "<a href='{$url}'>".$thread_info['lastpost_username']."</a>";
} }
else else
{ {
if(!$thread_info['thread_lastuser']) if(!$thread_info['thread_lastuser'])
{ {
$LASTPOST = $tp->toHTML($thread_info['thread_lastuser_anon']); $LASTPOST = $e107->tp->toHTML($thread_info['thread_lastuser_anon']);
} }
else else
{ {
@@ -360,12 +362,12 @@ function parse_thread($thread_info)
} }
$THREADTYPE = ''; $THREADTYPE = '';
if ($thread_info['thread_s'] == 1) if ($thread_info['thread_sticky'] == 1)
{ {
$ICON = ($thread_info['thread_active'] ? IMAGE_sticky : IMAGE_stickyclosed); $ICON = ($thread_info['thread_active'] ? IMAGE_sticky : IMAGE_stickyclosed);
$THREADTYPE = '['.LAN_202.']<br />'; $THREADTYPE = '['.LAN_202.']<br />';
} }
elseif($thread_info['thread_s'] == 2) elseif($thread_info['thread_sticky'] == 2)
{ {
$ICON = IMAGE_announce; $ICON = IMAGE_announce;
$THREADTYPE = '['.LAN_396.']<br />'; $THREADTYPE = '['.LAN_396.']<br />';
@@ -376,7 +378,7 @@ function parse_thread($thread_info)
} }
$thread_name = strip_tags($tp->toHTML($thread_info['thread_name'], false, 'no_hook, emotes_off')); $thread_name = strip_tags($e107->tp->toHTML($thread_info['thread_name'], false, 'no_hook, emotes_off'));
if(isset($thread_info['thread_options']['poll'])) if(isset($thread_info['thread_options']['poll']))
{ {
$thread_name = '['.FORLAN_23.'] ' . $thread_name; $thread_name = '['.FORLAN_23.'] ' . $thread_name;
@@ -400,7 +402,7 @@ function parse_thread($thread_info)
{ {
$title = ''; $title = '';
} }
$THREADNAME = "<a {$title} href='".e_PLUGIN."forum/forum_viewtopic.php?id={$threadId}'>{$thread_name}</a>"; $THREADNAME = "<a {$title} href='".$e107->url->getUrl('forum', 'thread', "func=view&id={$threadId}")."'>{$thread_name}</a>";
$pages = ceil(($REPLIES+1)/$pref['forum_postspage']); $pages = ceil(($REPLIES+1)/$pref['forum_postspage']);
if ($pages > 1) if ($pages > 1)
@@ -439,25 +441,23 @@ function parse_thread($thread_info)
if (MODERATOR) if (MODERATOR)
{ {
// $thread_id = $thread_info['thread_id'];
// $e107->url->getUrl('forum', 'thread', array('func' => 'last', 'id' => $tmp[1]))
$ADMIN_ICONS = " $ADMIN_ICONS = "
<form method='post' action='".$e107->url->getUrl('forum', 'forum', "func=view&id={$thread_info['thread_forum_id']}")."' id='frmMod_{$forumId}_{$threadId}' style='margin:0;'><div> <form method='post' action='".$e107->url->getUrl('forum', 'forum', "func=view&id={$thread_info['thread_forum_id']}")."' id='frmMod_{$forumId}_{$threadId}' style='margin:0;'><div>
<input type='image' ".IMAGE_admin_delete." name='deleteThread_{$threadId}' value='thread_action' onclick=\"return confirm_({$threadId})\" /> <input type='image' ".IMAGE_admin_delete." name='deleteThread_{$threadId}' value='thread_action' onclick=\"return confirm_({$threadId})\" />
".($thread_info['thread_s'] == 1 ? "<input type='image' ".IMAGE_admin_unstick." name='unstick_{$threadId}' value='thread_action' /> " : "<input type='image' ".IMAGE_admin_stick." name='stick_{$threadId}' value='thread_action' /> ")." ".($thread_info['thread_sticky'] == 1 ? "<input type='image' ".IMAGE_admin_unstick." name='unstick_{$threadId}' value='thread_action' /> " : "<input type='image' ".IMAGE_admin_stick." name='stick_{$threadId}' value='thread_action' /> ")."
".($thread_info['thread_active'] ? "<input type='image' ".IMAGE_admin_lock." name='lock_{$threadId}' value='thread_action' /> " : "<input type='image' ".IMAGE_admin_unlock." name='unlock_{$threadId}' value='thread_action' /> "). " ".($thread_info['thread_active'] ? "<input type='image' ".IMAGE_admin_lock." name='lock_{$threadId}' value='thread_action' /> " : "<input type='image' ".IMAGE_admin_unlock." name='unlock_{$threadId}' value='thread_action' /> "). "
<a href='".e_PLUGIN."forum/forum_conf.php?move.".$thread_id."'>".IMAGE_admin_move."</a> <a href='".$e107->url->getUrl('forum', 'thread', "func=move&id={$threadId}")."'>".IMAGE_admin_move.'</a>
</div></form> </div></form>
"; ';
} }
$text .= "</td> $text .= "</td>
<td style='vertical-align:top; text-align:center; width:20%' class='forumheader3'>".$THREADDATE.'<br />'; <td style='vertical-align:top; text-align:center; width:20%' class='forumheader3'>".$THREADDATE.'<br />';
$tmp = explode('.', $thread_info['thread_user'], 2); // $tmp = explode('.', $thread_info['thread_user'], 2);
if($thread_info['user_name']) if($thread_info['user_name'])
{ {
$POSTER = "<a href='".e_BASE."user.php?id.".$tmp[0]."'>".$thread_info['user_name']."</a>"; $POSTER = "<a href='".$e107->url->getUrl('core:user', 'main', "func=profile&id={$thread_info['thread_user']}")."'>".$thread_info['user_name']."</a>";
} }
else else
{ {
@@ -471,12 +471,12 @@ function parse_thread($thread_info)
} }
} }
if ($thread_info['thread_s'] == 1 && $FORUM_VIEW_FORUM_STICKY) if ($thread_info['thread_sticky'] == 1 && $FORUM_VIEW_FORUM_STICKY)
{ {
return(preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_FORUM_STICKY)); return(preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_FORUM_STICKY));
} }
if ($thread_info['thread_s'] == 2 && $FORUM_VIEW_FORUM_ANNOUNCE) if ($thread_info['thread_sticky'] == 2 && $FORUM_VIEW_FORUM_ANNOUNCE)
{ {
return(preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_FORUM_ANNOUNCE)); return(preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_FORUM_ANNOUNCE));
} }
@@ -492,10 +492,11 @@ function parse_thread($thread_info)
function parse_sub($subInfo) function parse_sub($subInfo)
{ {
global $FORUM_VIEW_SUB, $gen, $tp, $newflag_list; global $FORUM_VIEW_SUB, $gen, $newflag_list;
$e107 = e107::getInstance(); $e107 = e107::getInstance();
$SUB_FORUMTITLE = "<a href='".e_PLUGIN."forum/forum_viewforum.php?{$subInfo['forum_id']}'>{$subInfo['forum_name']}</a>"; $forumName = $e107->tp->toHTML($subInfo['forum_name'], true);
$SUB_DESCRIPTION = $tp->toHTML($subInfo['forum_description'], false, 'no_hook'); $SUB_FORUMTITLE = "<a href='".$e107->url->getUrl('forum', 'forum', "func=view&id={$subInfo['forum_id']}")."'>{$forumName}</a>";
$SUB_DESCRIPTION = $e107->tp->toHTML($subInfo['forum_description'], false, 'no_hook');
$SUB_THREADS = $subInfo['forum_threads']; $SUB_THREADS = $subInfo['forum_threads'];
$SUB_REPLIES = $subInfo['forum_replies']; $SUB_REPLIES = $subInfo['forum_replies'];
if(USER && is_array($newflag_list) && in_array($subInfo['forum_id'], $newflag_list)) if(USER && is_array($newflag_list) && in_array($subInfo['forum_id'], $newflag_list))
@@ -510,26 +511,22 @@ function parse_sub($subInfo)
if($subInfo['forum_lastpost_info']) if($subInfo['forum_lastpost_info'])
{ {
$tmp = explode('.', $subInfo['forum_lastpost_info']); $tmp = explode('.', $subInfo['forum_lastpost_info']);
// $e107->url->getUrl('forum', 'thread', array('func' => 'last', 'id' => $tmp[1]));
$lp_thread = "<a href='".$e107->url->getUrl('forum', 'thread', array('func' => 'last', 'id' => $tmp[1]))."'>".IMAGE_post2.'</a>'; $lp_thread = "<a href='".$e107->url->getUrl('forum', 'thread', array('func' => 'last', 'id' => $tmp[1]))."'>".IMAGE_post2.'</a>';
$lp_date = $gen->convert_date($tmp[0], 'forum'); $lp_date = $gen->convert_date($tmp[0], 'forum');
$tmp = explode('.', $subInfo['forum_lastpost_user'],2);
if($subInfo['user_name']) if($subInfo['user_name'])
{ {
$lp_name = "<a href='".e_BASE."user.php?id.{$tmp[0]}'>{$subInfo['user_name']}</a>"; $lp_name = "<a href='".$e107->url->getUrl('core:user', 'main', "func=profile&id={$subInfo['forum_lastpost_user']}")."'>{$subInfo['user_name']}</a>";
} }
else else
{ {
$lp_name = $tmp[1]; $lp_name = $subInfo['forum_lastpost_user_anon'];
} }
$SUB_LASTPOST = $lp_date."<br />".$lp_name." ".$lp_thread; $SUB_LASTPOST = $lp_date.'<br />'.$lp_name.' '.$lp_thread;
} }
else else
{ {
$SUB_LASTPOST = "-"; $SUB_LASTPOST = '-';
} }
return (preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_SUB)); return (preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_SUB));
} }

View File

@@ -12,8 +12,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_viewtopic.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_viewtopic.php,v $
| $Revision: 1.15 $ | $Revision: 1.16 $
| $Date: 2008-12-14 03:18:45 $ | $Date: 2008-12-15 00:29:20 $
| $Author: mcfly_e107 $ | $Author: mcfly_e107 $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -68,7 +68,7 @@ $pm_installed = plugInstalled('pm');
//Only increment thread views if not being viewed by thread starter //Only increment thread views if not being viewed by thread starter
if (USER || USER != $threadInfo['thread_user'] || !$thread->noInc) if (USER && (USERID != $threadInfo['thread_user'] || $threadInfo['thread_total_replies'] > 0) || !$thread->noInc)
{ {
$forum->threadIncview($threadId); $forum->threadIncview($threadId);
} }
@@ -215,7 +215,7 @@ foreach ($postList as $postInfo)
$postInfo['thread_start'] = false; $postInfo['thread_start'] = false;
$alt = !$alt; $alt = !$alt;
if($postInfo['post_s']) if($postInfo['post_status'])
{ {
$_style = (isset($FORUMDELETEDSTYLE_ALT) && $alt ? $FORUMDELETEDSTYLE_ALT : $FORUMDELETEDSTYLE); $_style = (isset($FORUMDELETEDSTYLE_ALT) && $alt ? $FORUMDELETEDSTYLE_ALT : $FORUMDELETEDSTYLE);
} }
@@ -259,7 +259,8 @@ $forumstring = $forstr . $forthr . $forrep . $forend;
require_once (HEADERF); require_once (HEADERF);
//If last post came after USERLV and not yet marked as read, mark the thread id as read //If last post came after USERLV and not yet marked as read, mark the thread id as read
if ($thread->threadInfo['thread_lastpost'] > USERLV && (strpos($currentUser['user_plugin_forum_viewed'], '.' . $thread->threadId . '.') === false)) $threadsViewed = explode(',', $currentUser['user_plugin_forum_viewed']);
if ($thread->threadInfo['thread_lastpost'] > USERLV && !in_array($thread->threadId, $threadsViewed))
{ {
$tst = $forum->threadMarkAsRead($thread->threadId); $tst = $forum->threadMarkAsRead($thread->threadId);
} }
@@ -319,6 +320,11 @@ function showmodoptions()
{ {
$ret .= "<a href='" . $e107->url->getUrl('forum', 'thread', array('func' => 'move', 'id' => $postInfo['post_id']))."'>" . IMAGE_admin_move2 . "</a>"; $ret .= "<a href='" . $e107->url->getUrl('forum', 'thread', array('func' => 'move', 'id' => $postInfo['post_id']))."'>" . IMAGE_admin_move2 . "</a>";
} }
else
{
$ret .= "<a href='" . $e107->url->getUrl('forum', 'thread', array('func' => 'split', 'id' => $postInfo['post_id']))."'>" . IMAGE_admin_split . '</a>';
}
$ret .= " $ret .= "
</div> </div>
</form>"; </form>";
@@ -523,7 +529,7 @@ class e107ForumThread
// $pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10); // $pref['forum_postspage'] = ($pref['forum_postspage'] ? $pref['forum_postspage'] : 10);
// var_dump($thread); // var_dump($thread);
$pages = ceil(($thread->threadInfo['thread_total_replies'] + 1) / $thread->perPage); $pages = ceil(($thread->threadInfo['thread_total_replies'] + 1) / $thread->perPage);
echo "pages = $pages<br />"; // echo "pages = $pages<br />";
$thread->page = ($pages - 1); $thread->page = ($pages - 1);
break; break;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -4,8 +4,8 @@
| e107 website system - Language File. | e107 website system - Language File.
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/languages/English/lan_forum_admin.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/forum/languages/English/lan_forum_admin.php,v $
| $Revision: 1.5 $ | $Revision: 1.6 $
| $Date: 2008-12-10 15:29:31 $ | $Date: 2008-12-15 00:29:20 $
| $Author: mcfly_e107 $ | $Author: mcfly_e107 $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -209,4 +209,8 @@ define("FORLAN_183", "(this function is not allowed when selecting 'all forums'
define('FORLAN_184', 'Thread Creation permission'); define('FORLAN_184', 'Thread Creation permission');
define('FORLAN_185', 'Indicates who can create new threads'); define('FORLAN_185', 'Indicates who can create new threads');
define('FORLAN_186', 'Threads per page');
define('FORLAN_187', 'Number of threads displayed per page');
?> ?>

View File

@@ -4,8 +4,8 @@
| e107 website system - Language File. | e107 website system - Language File.
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/languages/English/lan_forum_viewtopic.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/forum/languages/English/lan_forum_viewtopic.php,v $
| $Revision: 1.2 $ | $Revision: 1.3 $
| $Date: 2008-12-13 21:52:19 $ | $Date: 2008-12-15 00:29:20 $
| $Author: mcfly_e107 $ | $Author: mcfly_e107 $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -85,6 +85,7 @@ define("FORLAN_101", "Email Thread");
define("FORLAN_102", "Print View"); define("FORLAN_102", "Print View");
define('FORLAN_103', '[user deleted]'); define('FORLAN_103', '[user deleted]');
define('FORLAN_104', 'Thread not found'); define('FORLAN_104', 'Thread not found');
define('FORLAN_105', 'Moderator: Split');
define('FORLAN_BY', 'by'); define('FORLAN_BY', 'by');
define("FORLAN_HIDDEN", "HIDDEN - LOGIN AND REPLY TO REVEAL"); define("FORLAN_HIDDEN", "HIDDEN - LOGIN AND REPLY TO REVEAL");
?> ?>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Id: plugin.xml,v 1.15 2008-12-10 15:29:31 mcfly_e107 Exp $ --> <!-- $Id: plugin.xml,v 1.16 2008-12-15 00:29:20 mcfly_e107 Exp $ -->
<e107Plugin name="Forum" version="2.0" compatibility="0.8" installRequired="true"> <e107Plugin name="Forum" version="2.0" compatibility="0.8" installRequired="true">
<author name="e107dev" url="http://e107.org"/> <author name="e107dev" url="http://e107.org"/>
<description>This plugin is a fully featured Forum system</description> <description>This plugin is a fully featured Forum system</description>
@@ -22,6 +22,7 @@
<pref name="forum_enclose" value="1" /> <pref name="forum_enclose" value="1" />
<pref name="forum_title" value="Forums" /> <pref name="forum_title" value="Forums" />
<pref name="forum_postspage" value="10" /> <pref name="forum_postspage" value="10" />
<pref name="forum_threadspage" value="25" />
<pref name="forum_hilightsticky" value="1" /> <pref name="forum_hilightsticky" value="1" />
</mainPrefs> </mainPrefs>
<userclass name="forum_moderator" description="Moderator of all forums" /> <userclass name="forum_moderator" description="Moderator of all forums" />

View File

@@ -11,12 +11,12 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/templates/forum_icons_template.php,v $ | $Source: /cvs_backup/e107_0.8/e107_plugins/forum/templates/forum_icons_template.php,v $
| $Revision: 1.5 $ | $Revision: 1.6 $
| $Date: 2008-12-08 02:33:34 $ | $Date: 2008-12-15 00:29:20 $
| $Author: mcfly_e107 $ | $Author: mcfly_e107 $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
if (!defined('e107_INIT')) { exit; } if (!defined('e107_INIT')) { exit; }
@include_once(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_viewforum.php'); @include_once(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_viewforum.php');
@@ -47,6 +47,7 @@ define("IMAGE_edit", "<img src='".img_path('edit.png')."' alt='".LAN_400."' titl
define("IMAGE_quote", "<img src='".img_path('quote.png')."' alt='".LAN_401."' title='".LAN_401."' style='border:0' />"); define("IMAGE_quote", "<img src='".img_path('quote.png')."' alt='".LAN_401."' title='".LAN_401."' style='border:0' />");
define("IMAGE_admin_edit", "<img src='".img_path('admin_edit.png')."' alt='".LAN_406."' title='".LAN_406."' style='border:0; vertical-align: top;' />"); define("IMAGE_admin_edit", "<img src='".img_path('admin_edit.png')."' alt='".LAN_406."' title='".LAN_406."' style='border:0; vertical-align: top;' />");
define("IMAGE_admin_move", "<img src='".img_path('admin_move.png')."' alt='".LAN_402."' title='".LAN_402."' style='border:0; vertical-align: top;' />"); define("IMAGE_admin_move", "<img src='".img_path('admin_move.png')."' alt='".LAN_402."' title='".LAN_402."' style='border:0; vertical-align: top;' />");
define("IMAGE_admin_split", "<img src='".img_path('admin_split.png')."' alt='".FORLAN_105."' title='".FORLAN_105."' style='border:0; vertical-align: top;' />");
define("IMAGE_admin_move2", "<img src='".img_path('admin_move.png')."' alt='".LAN_408."' title='".LAN_408."' style='border:0; vertical-align: top;' />"); define("IMAGE_admin_move2", "<img src='".img_path('admin_move.png')."' alt='".LAN_408."' title='".LAN_408."' style='border:0; vertical-align: top;' />");
define("IMAGE_post", "<img src='".img_path('post.png')."' alt='' title='' style='border:0' />"); define("IMAGE_post", "<img src='".img_path('post.png')."' alt='' title='' style='border:0' />");
define("IMAGE_post2", "<img src='".img_path('post2.png')."' alt='' title='' style='border:0; vertical-align:bottom' />"); define("IMAGE_post2", "<img src='".img_path('post2.png')."' alt='' title='' style='border:0; vertical-align:bottom' />");
@@ -55,21 +56,21 @@ define("IMAGE_attachment", "<img src='".img_path('attach.png')."' alt='' title='
define("IMAGE_track", "<img src='".img_path('track.png')."' alt='".LAN_392."' title='".LAN_392."' style='border:0' />"); define("IMAGE_track", "<img src='".img_path('track.png')."' alt='".LAN_392."' title='".LAN_392."' style='border:0' />");
define("IMAGE_untrack", "<img src='".img_path('untrack.png')."' alt='".LAN_391."' title='".LAN_391."' style='border:0' />"); define("IMAGE_untrack", "<img src='".img_path('untrack.png')."' alt='".LAN_391."' title='".LAN_391."' style='border:0' />");
// Admin <input> Icons // Admin <input> Icons
define("IMAGE_admin_delete", "src='".img_path('admin_delete.png')."' alt='".LAN_435."' title='".LAN_435."' style='border:0' "); define("IMAGE_admin_delete", "src='".img_path('admin_delete.png')."' alt='".LAN_435."' title='".LAN_435."' style='border:0' ");
define("IMAGE_admin_unstick", "src='".img_path('admin_unstick.png')."' alt='".LAN_398."' title='".LAN_398."' style='border:0' "); define("IMAGE_admin_unstick", "src='".img_path('admin_unstick.png')."' alt='".LAN_398."' title='".LAN_398."' style='border:0' ");
define("IMAGE_admin_stick", "src='".img_path('sticky_small.png')."' alt='".LAN_401."' title='".LAN_401."' style='border:0' "); define("IMAGE_admin_stick", "src='".img_path('sticky_small.png')."' alt='".LAN_401."' title='".LAN_401."' style='border:0' ");
define("IMAGE_admin_lock", "src='".img_path('admin_lock.png')."' alt='".LAN_399."' title='".LAN_399."' style='border:0' "); define("IMAGE_admin_lock", "src='".img_path('admin_lock.png')."' alt='".LAN_399."' title='".LAN_399."' style='border:0' ");
define("IMAGE_admin_unlock", "src='".img_path('admin_unlock.png')."' alt='".LAN_400."' title='".LAN_400."' style='border:0' "); define("IMAGE_admin_unlock", "src='".img_path('admin_unlock.png')."' alt='".LAN_400."' title='".LAN_400."' style='border:0' ");
// Multi Language Images // Multi Language Images
define("IMAGE_newthread", "<img src='".img_path('newthread.png')."' alt='".FORLAN_10."' title='".FORLAN_10."' style='border:0' />"); define("IMAGE_newthread", "<img src='".img_path('newthread.png')."' alt='".FORLAN_10."' title='".FORLAN_10."' style='border:0' />");
define("IMAGE_reply", "<img src='".img_path('reply.png')."' alt='' title='' style='border:0' />"); define("IMAGE_reply", "<img src='".img_path('reply.png')."' alt='' title='' style='border:0' />");
define("IMAGE_rank_moderator_image", "<img src='".img_path('moderator.png', '', 'rank_moderator_image')."' alt='' />"); define("IMAGE_rank_moderator_image", "<img src='".img_path('moderator.png', '', 'rank_moderator_image')."' alt='' />");
define("IMAGE_rank_main_admin_image", "<img src='".img_path('main_admin.png', '', 'rank_main_admin_image')."' alt='' />"); define("IMAGE_rank_main_admin_image", "<img src='".img_path('main_admin.png', '', 'rank_main_admin_image')."' alt='' />");
define("IMAGE_rank_admin_image", "<img src='".img_path('admin.png', '', 'rank_admin_image')."' alt='' />"); define("IMAGE_rank_admin_image", "<img src='".img_path('admin.png', '', 'rank_admin_image')."' alt='' />");
?> ?>

View File

@@ -1,553 +0,0 @@
<?php
/*
* e107 website system
*
* Copyright ( c ) 2001-2008 e107 Inc (e107.org)
* Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
*
* View specific forums
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/viewforum.php,v $
* $Revision: 1.7 $
* $Date: 2008-12-05 01:30:56 $
* $Author: mcfly_e107 $
*
*/
require_once('../../class2.php');
include_lan(e_PLUGIN.'forum/languages/English/lan_forum_viewforum.php');
if (isset($_POST['fjsubmit']))
{
header('location:'.$e107->url->getUrl('forum', 'forum', array('func' => 'view', 'id'=>$_POST['forumjump'])));
exit;
}
if (!e_QUERY)
{
header('Location:'.$e107->url->getUrl('forum', 'forum', array('func' => 'main')));
exit;
}
$view = 25;
$threadFrom = (isset($_REQUEST['p']) ? $_REQUEST['p'] * $view : 0);
/*
else
{
$tmp = explode('.', e_QUERY);
$forum_id = (int)$tmp[0];
$thread_from = (isset($tmp[1]) ? (int)$tmp[1] : 0);
}
if(is_numeric(e_MENU))
{
$thread_from = (intval(e_MENU)-1)*$view;
}
*/
require_once(e_PLUGIN.'forum/forum_class.php');
$forum = new e107forum;
$STARTERTITLE = LAN_54;
$THREADTITLE = LAN_53;
$REPLYTITLE = LAN_55;
$LASTPOSTITLE = LAN_57;
$VIEWTITLE = LAN_56;
global $forum_info, $FORUM_CRUMB;
$forumId = (int)$_REQUEST['id'];
if (!$forum->checkPerm($forumId, 'view'))
{
header('Location:'.$e107->url->getUrl('forum', 'forum', array('func' => 'main')));
exit;
}
$forumInfo = $forum->forum_get($forumId);
if (!$FORUM_VIEW_START)
{
if (file_exists(THEME.'forum_viewforum_template.php'))
{
require_once(THEME.'forum_viewforum_template.php');
}
elseif (file_exists(THEME.'forum_template.php'))
{
require_once(THEME.'forum_template.php');
}
else
{
require_once(e_PLUGIN.'forum/templates/forum_viewforum_template.php');
}
}
$forumInfo['forum_name'] = $e107->tp->toHTML($forumInfo['forum_name'], true, 'no_hook, emotes_off');
$forumInfo['forum_description'] = $e107->tp->toHTML($forumInfo['forum_description'], true, 'no_hook');
$_forum_name = (substr($forumInfo['forum_name'], 0, 1) == '*' ? substr($forumInfo['forum_name'], 1) : $forumInfo['forum_name']);
define('e_PAGETITLE', LAN_01.' / '.$_forum_name);
//define('MODERATOR', $forum_info['forum_moderators'] != '' && check_class($forum_info['forum_moderators']));
//$modArray = $forum->forum_getmods($forum_info['forum_moderators']);
$modArray = $forum->forum_getmods($thread->forum_info['forum_moderators']);
define('MODERATOR', (USER && is_array($modArray) && in_array(USERID, array_keys($modArray))));
$message = '';
if (MODERATOR)
{
if ($_POST)
{
require_once(e_PLUGIN.'forum/forum_mod.php');
$message = forum_thread_moderate($_POST);
}
}
if(varset($pref['track_online']))
{
$member_users = $sql->db_Count('online', '(*)', "WHERE online_location REGEXP('viewforum.php.id=$forumId\$') AND online_user_id != 0");
$guest_users = $sql->db_Count('online', '(*)', "WHERE online_location REGEXP('viewforum.php.id=$forumId\$') AND online_user_id = 0");
$users = $member_users+$guest_users;
}
require_once(HEADERF);
$text='';
if ($message)
{
$ns->tablerender('', $message, array('forum_viewforum', 'msg'));
}
$threadCount = $forumInfo['forum_threads'];
if ($threadCount > $view)
{
$pages = ceil($threadCount/$view);
}
else
{
$pages = false;
}
//echo "pages = $pages <br />";
if ($pages)
{
if(strpos($FORUM_VIEW_START, 'THREADPAGES') !== false || strpos($FORUM_VIEW_END, 'THREADPAGES') !== false)
{
$parms = "{$threadCount},{$view},{$threadFrom},".e_SELF.'?'.$forumId.'.[FROM],off';
$THREADPAGES = $tp->parseTemplate("{NEXTPREV={$parms}}");
}
}
if($forum->checkPerm($forumId, 'post'))
{
$NEWTHREADBUTTON = "<a href='".$e107->url->getUrl('forum', 'thread', array('func' => 'nt', 'id' => $forumId))."'>".IMAGE_newthread.'</a>';
}
if(substr($forumInfo['forum_name'], 0, 1) == '*')
{
$forum_info['forum_name'] = substr($forum_info['forum_name'], 1);
$container_only = true;
}
else
{
$container_only = false;
}
if(substr($forum_info['sub_parent'], 0, 1) == '*')
{
$forum_info['sub_parent'] = substr($forum_info['sub_parent'], 1);
}
$forum->set_crumb(); // set $BREADCRUMB (and $BACKLINK)
$FORUMTITLE = $forumInfo['forum_name'];
$MODERATORS = LAN_404.': '.implode(', ', $modArray);
$BROWSERS = '';
if(varset($pref['track_online']))
{
$BROWSERS = $users.' '.($users == 1 ? LAN_405 : LAN_406).' ('.$member_users.' '.($member_users == 1 ? LAN_407 : LAN_409).", ".$guest_users." ".($guest_users == 1 ? LAN_408 : LAN_410).')';
}
$ICONKEY = "
<table style='width:100%'>
<tr>
<td style='vertical-align:middle; text-align:center; width:2%'>".IMAGE_new_small."</td>
<td style='width:10%' class='smallblacktext'>".LAN_79."</td>
<td style='vertical-align:middle; text-align:center; width:2%'>".IMAGE_nonew_small."</td>
<td style='width:10%' class='smallblacktext'>".LAN_80."</td>
<td style='vertical-align:middle; text-align:center; width:2%'>".IMAGE_sticky_small."</td>
<td style='width:10%' class='smallblacktext'>".LAN_202."</td>
<td style='vertical-align:middle; text-align:center; width:2%'>".IMAGE_announce_small."</td>
<td style='width:10%' class='smallblacktext'>".LAN_396."</td>
</tr>
<tr>
<td style='vertical-align:middle; text-align:center; width:2%'>".IMAGE_new_popular_small."</td>
<td style='width:2%' class='smallblacktext'>".LAN_79." ".LAN_395."</td>
<td style='vertical-align:middle; text-align:center; width:2%'>".IMAGE_nonew_popular_small."</td>
<td style='width:10%' class='smallblacktext'>".LAN_80." ".LAN_395."</td>
<td style='vertical-align:middle; text-align:center; width:2%'>".IMAGE_stickyclosed_small."</td>
<td style='width:10%' class='smallblacktext'>".LAN_203."</td>
<td style='vertical-align:middle; text-align:center; width:2%'>".IMAGE_closed_small."</td>
<td style='width:10%' class='smallblacktext'>".LAN_81."</td>
</tr>
</table>";
$SEARCH = "
<form method='get' action='".e_BASE."search.php'>
<p>
<input class='tbox' type='text' name='q' size='20' value='' maxlength='50' />
<input type='hidden' name='r' value='0' />
<input type='hidden' name='ref' value='forum' />
<input class='button' type='submit' name='s' value='".LAN_180."' />
</p>
</form>";
if($forum->checkPerm($forumId, 'post'))
{
$PERMS = LAN_204.' - '.LAN_206.' - '.LAN_208;
}
else
{
$PERMS = LAN_205.' - '.LAN_207.' - '.LAN_209;
}
$sticky_threads = 0;
$stuck = false;
$reg_threads = 0;
$unstuck = false;
$threadList = $forum->forumGetThreads($forumId, $threadFrom, $view);
$subList = $forum->forum_getsubs($forum_id);
//print_a($sub_list);
$gen = new convert;
$SUBFORUMS = '';
if(is_array($sub_list))
{
$newflag_list = $forum->forum_newflag_list();
$sub_info = '';
foreach($sub_list as $sub)
{
$sub_info .= parse_sub($sub);
}
$SUBFORUMS = $FORUM_VIEW_SUB_START.$sub_info.$FORUM_VIEW_SUB_END;
}
if (count($threadList) )
{
foreach($threadList as $thread_info)
{
$idArray[] = $thread_info['thread_id'];
}
$inList = '('.implode(',', $idArray).')';
foreach($threadList as $thread_info)
{
if ($thread_info['thread_s'])
{
$sticky_threads ++;
}
if ($sticky_threads > 0 && !$stuck && $pref['forum_hilightsticky'])
{
if($FORUM_IMPORTANT_ROW)
{
$forum_view_forum .= $FORUM_IMPORTANT_ROW;
}
else
{
$forum_view_forum .= "<tr><td class='forumheader'>&nbsp;</td><td colspan='5' class='forumheader'><span class='mediumtext'><b>".LAN_411."</b></span></td></tr>";
}
$stuck = true;
}
if (!$thread_info['thread_s'])
{
$reg_threads ++;
}
if ($reg_threads == '1' && !$unstuck && $stuck)
{
if($FORUM_NORMAL_ROW)
{
$forum_view_forum .= $FORUM_NORMAL_ROW;
}
else
{
$forum_view_forum .= "<tr><td class='forumheader'>&nbsp;</td><td colspan='5' class='forumheader'><span class='mediumtext'><b>".LAN_412."</b></span></td></tr>";
}
$unstuck = true;
}
$forum_view_forum .= parse_thread($thread_info);
}
}
else
{
$forum_view_forum .= "<tr><td class='forumheader' colspan='6'>".LAN_58."</td></tr>";
}
//$sql->db_Select('forum', '*', "forum_parent !=0 AND forum_class != '255' ");
$FORUMJUMP = forumjump();
$TOPLINK = "<a href='".e_SELF.'?'.e_QUERY."#top' onclick=\"window.scrollTo(0,0);\">".LAN_02.'</a>';
if($container_only)
{
$FORUM_VIEW_START = ($FORUM_VIEW_START_CONTAINER ? $FORUM_VIEW_START_CONTAINER : $FORUM_VIEW_START);
$FORUM_VIEW_END = ($FORUM_VIEW_END_CONTAINER ? $FORUM_VIEW_END_CONTAINER : $FORUM_VIEW_END);
$forum_view_forum = '';
}
$forum_view_start = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_START);
$forum_view_end = preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_END);
if ($pref['forum_enclose'])
{
$ns->tablerender($pref['forum_title'], $forum_view_start.$forum_view_subs.$forum_view_forum.$forum_view_end, array('forum_viewforum', 'main1'));
}
else
{
echo $forum_view_start.$forum_view_forum.$forum_view_end;
}
echo "<script type=\"text/javascript\">
function confirm_(thread_id)
{
return confirm(\"".$tp->toJS(LAN_434)."\");
}
</script>";
require_once(FOOTERF);
function parse_thread($thread_info)
{
global $forum, $tp, $FORUM_VIEW_FORUM, $FORUM_VIEW_FORUM_STICKY, $FORUM_VIEW_FORUM_ANNOUNCE, $gen, $pref, $forum_id, $menu_pref;
$e107 = e107::getInstance();
$text = '';
$VIEWS = $thread_info['thread_views'];
$REPLIES = $thread_info['thread_total_replies'];
if ($REPLIES)
{
$lastpost_datestamp = $gen->convert_date($thread_info['thread_lastpost'], 'forum');
if($thread_info['lastpost_username'])
{
$LASTPOST = "<a href='".e_BASE."user.php?id.".$tmp[0]."'>".$thread_info['lastpost_username']."</a>";
}
else
{
if(!$thread_info['thread_lastuser'])
{
$LASTPOST = $tp->toHTML($thread_info['thread_lastuser_anon']);
}
else
{
$LASTPOST = FORLAN_19;
}
}
$LASTPOST .= '<br />'.$lastpost_datestamp;
}
$newflag = false;
if (USER)
{
if ($thread_info['thread_lastpost'] > USERLV && !$forum->threadViewed($thread_info['thread_id']))
{
$newflag = true;
}
}
$THREADDATE = $gen->convert_date($thread_info['thread_datestamp'], 'forum');
$ICON = ($newflag ? IMAGE_new : IMAGE_nonew);
if ($REPLIES >= $pref['forum_popular'])
{
$ICON = ($newflag ? IMAGE_new_popular : IMAGE_nonew_popular);
}
$THREADTYPE = '';
if ($thread_info['thread_s'] == 1)
{
$ICON = ($thread_info['thread_active'] ? IMAGE_sticky : IMAGE_stickyclosed);
$THREADTYPE = '['.LAN_202.']<br />';
}
elseif($thread_info['thread_s'] == 2)
{
$ICON = IMAGE_announce;
$THREADTYPE = '['.LAN_396.']<br />';
}
elseif(!$thread_info['thread_active'])
{
$ICON = IMAGE_closed;
}
$thread_name = strip_tags($tp->toHTML($thread_info['thread_name'], false, 'no_hook, emotes_off'));
if (strtoupper($THREADTYPE) == strtoupper(substr($thread_name, 0, strlen($THREADTYPE))))
{
$thread_name = substr($thread_name, strlen($THREADTYPE));
}
if ($pref['forum_tooltip'])
{
$thread_thread = strip_tags($tp->toHTML($thread_info['thread_thread'], true, 'no_hook'));
$tip_length = ($pref['forum_tiplength'] ? $pref['forum_tiplength'] : 400);
if (strlen($thread_thread) > $tip_length)
{
$thread_thread = substr($thread_thread, 0, $tip_length)." ".$menu_pref['newforumposts_postfix'];
}
$thread_thread = str_replace("'", '&#39;', $thread_thread);
$title = "title='".$thread_thread."'";
}
else
{
$title = '';
}
$THREADNAME = "<a {$title} href='".e_PLUGIN."forum/forum_viewtopic.php?id={$thread_info['thread_id']}'>{$thread_name}</a>";
$pages = ceil(($REPLIES+1)/$pref['forum_postspage']);
if ($pages > 1)
{
if($pages > 6)
{
for($a = 0; $a <= 2; $a++)
{
$PAGES .= $PAGES ? ' ' : '';
$PAGES .= "<a href='".e_PLUGIN."forum/forum_viewtopic.php?".$thread_info['thread_id'].".".($a * $pref['forum_postspage'])."'>".($a+1)."</a>";
}
$PAGES .= ' ... ';
for($a = $pages-3; $a <= $pages-1; $a++)
{
$PAGES .= $PAGES ? " " : "";
$PAGES .= "<a href='".e_PLUGIN."forum/forum_viewtopic.php?".$thread_info['thread_id'].".".($a * $pref['forum_postspage'])."'>".($a+1)."</a>";
}
}
else
{
for($a = 0; $a <= ($pages-1); $a++)
{
$PAGES .= $PAGES ? ' ' : '';
$PAGES .= "<a href='".e_PLUGIN."forum/forum_viewtopic.php?".$thread_info['thread_id'].".".($a * $pref['forum_postspage'])."'>".($a+1)."</a>";
}
}
$PAGES = LAN_316.' [&nbsp;'.$PAGES.'&nbsp;]';
}
else
{
$PAGES = '';
}
if (MODERATOR)
{
$thread_id = $thread_info['thread_id'];
$ADMIN_ICONS = "
<form method='post' action='".e_SELF."?{$forum_id}' id='frmMod_{$forum_id}_{$thread_id}' style='margin:0;'><div>
";
$ADMIN_ICONS .= "<input type='image' ".IMAGE_admin_delete." name='delete_$thread_id' value='thread_action' onclick=\"return confirm_($thread_id)\" /> \n";
$ADMIN_ICONS .= ($thread_info['thread_s'] == 1) ? "<input type='image' ".IMAGE_admin_unstick." name='unstick_{$thread_id}' value='thread_action' /> " :
"<input type='image' ".IMAGE_admin_stick." name='stick_{$thread_id}' value='thread_action' /> ";
$ADMIN_ICONS .= ($thread_info['thread_active']) ? "<input type='image' ".IMAGE_admin_lock." name='lock_{$thread_id}' value='thread_action' /> " :
"<input type='image' ".IMAGE_admin_unlock." name='unlock_{$thread_id}' value='thread_action' /> ";
$ADMIN_ICONS .= "<a href='".e_PLUGIN."forum/forum_conf.php?move.".$thread_id."'>".IMAGE_admin_move."</a>";
$ADMIN_ICONS .= "
</div></form>
";
}
$text .= "</td>
<td style='vertical-align:top; text-align:center; width:20%' class='forumheader3'>".$THREADDATE.'<br />';
$tmp = explode('.', $thread_info['thread_user'], 2);
if($thread_info['user_name'])
{
$POSTER = "<a href='".e_BASE."user.php?id.".$tmp[0]."'>".$thread_info['user_name']."</a>";
}
else
{
if($thread_info['thread_user_anon'])
{
$POSTER = $e107->tp->toHTML($thread_info['thread_user_anon']);
}
else
{
$POSTER = FORLAN_19;
}
}
if ($thread_info['thread_s'] == 1 && $FORUM_VIEW_FORUM_STICKY)
{
return(preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_FORUM_STICKY));
}
if ($thread_info['thread_s'] == 2 && $FORUM_VIEW_FORUM_ANNOUNCE)
{
return(preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_FORUM_ANNOUNCE));
}
if (!$REPLIES)
{
$REPLIES = LAN_317; // 'None'
$LASTPOST = ' - ';
}
return(preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_FORUM));
}
function parse_sub($subInfo)
{
global $FORUM_VIEW_SUB, $gen, $tp, $newflag_list;
$e107 = e107::getInstance();
$SUB_FORUMTITLE = "<a href='".e_PLUGIN."forum/forum_viewforum.php?{$subInfo['forum_id']}'>{$subInfo['forum_name']}</a>";
$SUB_DESCRIPTION = $tp->toHTML($subInfo['forum_description'], false, 'no_hook');
$SUB_THREADS = $subInfo['forum_threads'];
$SUB_REPLIES = $subInfo['forum_replies'];
if(USER && is_array($newflag_list) && in_array($subInfo['forum_id'], $newflag_list))
{
$NEWFLAG = "<a href='".e_SELF."?mfar.{$subInfo['forum_id']}'>".IMAGE_new."</a>";
}
else
{
$NEWFLAG = IMAGE_nonew;
}
if($subInfo['forum_lastpost_info'])
{
$tmp = explode('.', $subInfo['forum_lastpost_info']);
// $e107->url->getUrl('forum', 'thread', array('func' => 'last', 'id' => $tmp[1]));
$lp_thread = "<a href='".$e107->url->getUrl('forum', 'thread', array('func' => 'last', 'id' => $tmp[1]))."'>".IMAGE_post2.'</a>';
$lp_date = $gen->convert_date($tmp[0], 'forum');
$tmp = explode('.', $subInfo['forum_lastpost_user'],2);
if($subInfo['user_name'])
{
$lp_name = "<a href='".e_BASE."user.php?id.{$tmp[0]}'>{$subInfo['user_name']}</a>";
}
else
{
$lp_name = $tmp[1];
}
$SUB_LASTPOST = $lp_date."<br />".$lp_name." ".$lp_thread;
}
else
{
$SUB_LASTPOST = "-";
}
return (preg_replace("/\{(.*?)\}/e", '$\1', $FORUM_VIEW_SUB));
}
function forumjump()
{
global $forum;
$jumpList = $forum->forum_get_allowed();
$text = "<form method='post' action='".e_SELF."'><p>".LAN_403.": <select name='forumjump' class='tbox'>";
foreach($jumpList as $key => $val)
{
$text .= "\n<option value='".$key."'>".$val."</option>";
}
$text .= "</select> <input class='button' type='submit' name='fjsubmit' value='".LAN_03."' />&nbsp;&nbsp;&nbsp;&nbsp;<a href='".e_SELF."?".$_SERVER['QUERY_STRING']."#top'>".LAN_02."</a></p></form>";
return $text;
}
?>