diff --git a/e107_files/e_url/core/core/main.php b/e107_files/e_url/core/core/main.php
new file mode 100644
index 000000000..9fabe34cc
--- /dev/null
+++ b/e107_files/e_url/core/core/main.php
@@ -0,0 +1,19 @@
+
\ No newline at end of file
diff --git a/e107_plugins/forum/e_url/forum.php b/e107_plugins/forum/e_url/forum.php
index 28e8861f6..be379aa7a 100644
--- a/e107_plugins/forum/e_url/forum.php
+++ b/e107_plugins/forum/e_url/forum.php
@@ -1,11 +1,12 @@
forum_getparents();
$forum_list = $forum->forum_getforums();
-$sub_list = $forum->forum_getsubs();
+$sub_list = $forum->forumGetSubs();
$newflag_list = $forum->forum_newflag_list();
if (!$parent_list)
diff --git a/e107_plugins/forum/forum_admin.php b/e107_plugins/forum/forum_admin.php
index c2e0ea03f..86fc60c7f 100644
--- a/e107_plugins/forum/forum_admin.php
+++ b/e107_plugins/forum/forum_admin.php
@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_admin.php,v $
-| $Revision: 1.5 $
-| $Date: 2008-12-05 01:30:56 $
+| $Revision: 1.6 $
+| $Date: 2008-12-15 00:29:20 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
@@ -233,12 +233,12 @@ if(isset($_POST['update_forum']))
$tmp['WHERE'] = 'forum_id = '.(int)$id;
$tmp2['_FIELD_TYPES'] = $tmp['_FIELD_TYPES'];
- $tmp2['forum_moderators'] = $tmp['forum_moderators'];
- $tmp2['forum_class'] = $tmp['forum_class'];
- $tmp2['forum_postclass'] = $tmp['forum_postclass'];
- $tmp2['forum_threadclass'] = $tmp['forum_threadclass'];
+ $tmp2['forum_moderators'] = $tmp['forum_moderators'];
+ $tmp2['forum_class'] = $tmp['forum_class'];
+ $tmp2['forum_postclass'] = $tmp['forum_postclass'];
+ $tmp2['forum_threadclass'] = $tmp['forum_threadclass'];
$tmp2['WHERE'] = 'forum_sub = '.(int)$id;
-
+
$sql->db_Update('forum', $tmp);
$sql->db_Update('forum', $tmp2);
@@ -268,6 +268,7 @@ if (isset($_POST['updateoptions']))
$pref['forum_enclose'] = $_POST['forum_enclose'];
$pref['forum_title'] = $_POST['forum_title'];
$pref['forum_postspage'] = $_POST['forum_postspage'];
+ $pref['forum_threadspage'] = $_POST['forum_threadspage'];
$pref['html_post'] = $_POST['html_post'];
$pref['forum_attach'] = $_POST['forum_attach'];
$pref['forum_redirect'] = $_POST['forum_redirect'];
diff --git a/e107_plugins/forum/forum_admin_class.php b/e107_plugins/forum/forum_admin_class.php
index 57f260797..1ded86765 100755
--- a/e107_plugins/forum/forum_admin_class.php
+++ b/e107_plugins/forum/forum_admin_class.php
@@ -9,8 +9,8 @@
* Forum admin functions
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_admin_class.php,v $
-* $Revision: 1.9 $
-* $Date: 2008-12-10 15:29:31 $
+* $Revision: 1.10 $
+* $Date: 2008-12-15 00:29:20 $
* $Author: mcfly_e107 $
*
*/
@@ -258,7 +258,7 @@ class forumAdmin
{
global $e107, $for;
- $subList = $for->forum_getsubs();
+ $subList = $for->forumGetSubs();
if (!$mode)
{
@@ -737,6 +737,11 @@ class forumAdmin
+
+
+
+
+
diff --git a/e107_plugins/forum/forum_class.php b/e107_plugins/forum/forum_class.php
index bd4e28b1a..84f16ac06 100644
--- a/e107_plugins/forum/forum_class.php
+++ b/e107_plugins/forum/forum_class.php
@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_class.php,v $
-| $Revision: 1.26 $
-| $Date: 2008-12-14 03:18:45 $
+| $Revision: 1.27 $
+| $Date: 2008-12-15 00:29:20 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
@@ -39,7 +39,7 @@ class e107forum
$this->fieldTypes['forum_thread']['thread_user'] = 'int';
$this->fieldTypes['forum_thread']['thread_lastpost'] = '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_active'] = '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
$qry = '
- SELECT t.*, f.*,
+ SELECT t.*, f.*,
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
FROM `#forum_thread` AS t
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
- *
+ *
*/
function postGetPostNum($threadId, $postId)
{
@@ -589,13 +589,13 @@ class e107forum
function threadMarkAsRead($threadId)
{
+ global $currentUser;
$e107 = e107::getInstance();
$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;
- $viewed = '.'.implode('.', $_tmp).'.';
- unset($_tmp);
+ $tmp = array_unique($tmp);
+ $viewed = trim(implode(',', $_tmp), ',');
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;
}
- function forum_getsubs($forum_id = '')
+ function forumGetSubs($forum_id = '')
{
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 = "
- SELECT f.*, u.user_name FROM #forum AS f
- LEFT JOIN #user AS u ON f.forum_lastpost_user = u.user_id
+ SELECT f.*, u.user_name FROM `#forum` AS f
+ LEFT JOIN `#user` AS u ON f.forum_lastpost_user = u.user_id
WHERE forum_sub != 0 {$where}
ORDER BY f.forum_order ASC
";
@@ -671,7 +671,7 @@ class e107forum
{
while ($row = $sql->db_Fetch(MYSQL_ASSOC))
{
- if($forum_id == "")
+ if($forum_id == '')
{
$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
WHERE t.thread_forum_id = {$forumId}
ORDER BY
- t.thread_s DESC,
+ t.thread_sticky DESC,
t.thread_lastpost DESC
LIMIT ".(int)$from.','.(int)$view;
@@ -909,7 +909,7 @@ class e107forum
WHERE thread_forum_id = $forumId
AND thread_lastpost {$dir} $lastpost
ORDER BY
- thread_s DESC,
+ thread_sticky DESC,
thread_lastpost {$sort}
LIMIT 1";
if ($e107->sql->db_Select_gen($qry))
@@ -934,7 +934,7 @@ class e107forum
WHERE t.thread_forum_id = $forum_id
AND t.thread_parent = 0
ORDER BY
- t.thread_s DESC,
+ t.thread_sticky DESC,
t.thread_lastpost DESC,
t.thread_datestamp DESC
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();
global $sql, $tp, $pref, $e107;
@@ -1147,7 +1147,7 @@ class e107forum
}
$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);
if(!$newthread_id)
{
@@ -1262,7 +1262,7 @@ class e107forum
if($type == 'delete')
{
//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();
foreach($threadList as $thread)
diff --git a/e107_plugins/forum/forum_mod.php b/e107_plugins/forum/forum_mod.php
index 1847fff1b..d15a25ea7 100644
--- a/e107_plugins/forum/forum_mod.php
+++ b/e107_plugins/forum/forum_mod.php
@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_mod.php,v $
-| $Revision: 1.4 $
-| $Date: 2008-12-11 16:02:05 $
+| $Revision: 1.5 $
+| $Date: 2008-12-15 00:29:20 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/
@@ -49,12 +49,12 @@ function forum_thread_moderate($p)
break;
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;
break;
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;
break;
diff --git a/e107_plugins/forum/forum_post.php b/e107_plugins/forum/forum_post.php
index 115796b49..baa841230 100644
--- a/e107_plugins/forum/forum_post.php
+++ b/e107_plugins/forum/forum_post.php
@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_post.php,v $
-| $Revision: 1.31 $
-| $Date: 2008-12-13 21:52:18 $
+| $Revision: 1.32 $
+| $Date: 2008-12-15 00:29:20 $
| $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.
// Update forum with latest post info
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_forum_id'] = $forumId;
$threadInfo['thread_active'] = 1;
@@ -375,9 +375,9 @@ if (isset($_POST['update_thread']))
$postVals['post_edit_datestamp'] = time();
$postVals['post_edit_user'] = USERID;
$postVals['post_entry'] = $_POST['post'];
-
+
$threadVals['thread_name'] = $_POST['subject'];
-
+
$forum->threadUpdate($postInfo['post_thread'], $threadVals);
$forum->postUpdate($postInfo['post_id'], $postVals);
$e107cache->clear('newforumposts');
@@ -405,7 +405,7 @@ if (isset($_POST['update_reply']))
$postVals['post_edit_datestamp'] = time();
$postVals['post_edit_user'] = USERID;
$postVals['post_entry'] = $_POST['post'];
-
+
$forum->postUpdate($postInfo['post_id'], $postVals);
$e107cache->clear('newforumposts');
$url = $e107->url->getUrl('forum', 'thread', "func=post&id={$postInfo['post_id']}");
diff --git a/e107_plugins/forum/forum_post_shortcodes.php b/e107_plugins/forum/forum_post_shortcodes.php
index 2586884fb..e51ee377e 100644
--- a/e107_plugins/forum/forum_post_shortcodes.php
+++ b/e107_plugins/forum/forum_post_shortcodes.php
@@ -108,8 +108,8 @@ SC_BEGIN POSTTHREADAS
global $action, $thread_info;
if (MODERATOR && $action == "nt")
{
- $thread_s = (isset($_POST['threadtype']) ? $_POST['threadtype'] : $thread_info['head']['thread_s']);
- return "
".LAN_400."".LAN_1." ".LAN_2." ".LAN_3."";
+ $thread_sticky = (isset($_POST['threadtype']) ? $_POST['threadtype'] : $thread_info['head']['thread_sticky']);
+ return "
".LAN_400."".LAN_1." ".LAN_2." ".LAN_3."";
}
return '';
SC_END
diff --git a/e107_plugins/forum/forum_shortcodes.php b/e107_plugins/forum/forum_shortcodes.php
index 915db975b..d06fcd8d2 100644
--- a/e107_plugins/forum/forum_shortcodes.php
+++ b/e107_plugins/forum/forum_shortcodes.php
@@ -29,7 +29,7 @@ SC_END
SC_BEGIN POSTDELETED
global $postInfo;
-if($postInfo['post_s'])
+if($postInfo['post_status'])
{
$info = unserialize($postInfo['post_options']);
return "
diff --git a/e107_plugins/forum/forum_sql.php b/e107_plugins/forum/forum_sql.php
index 176c2e125..7097b5ced 100644
--- a/e107_plugins/forum/forum_sql.php
+++ b/e107_plugins/forum/forum_sql.php
@@ -28,7 +28,7 @@ CREATE TABLE forum_thread (
`thread_views` int(10) unsigned NOT NULL default '0',
`thread_active` tinyint(3) 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_user` int(10) unsigned default NULL,
`thread_user_anon` varchar(30) NULL,
@@ -47,7 +47,7 @@ CREATE TABLE forum_post (
`post_entry` text NOT NULL,
`post_thread` 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_user` int(10) unsigned NOT NULL,
`post_edit_datestamp` int(10) unsigned NOT NULL default '0',
diff --git a/e107_plugins/forum/forum_viewforum.php b/e107_plugins/forum/forum_viewforum.php
index 70050ff20..37ecedd04 100644
--- a/e107_plugins/forum/forum_viewforum.php
+++ b/e107_plugins/forum/forum_viewforum.php
@@ -9,8 +9,8 @@
* View specific forums
*
* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/forum_viewforum.php,v $
-* $Revision: 1.9 $
-* $Date: 2008-12-14 03:18:45 $
+* $Revision: 1.10 $
+* $Date: 2008-12-15 00:29:20 $
* $Author: mcfly_e107 $
*
*/
@@ -30,8 +30,12 @@ if (!e_QUERY)
exit;
}
-$view = 25;
-$threadFrom = (isset($_REQUEST['p']) ? $_REQUEST['p'] * $view : 0);
+//$view = 25;
+//echo "pref = {$pref['forum_threadspage']}
";
+$view = (varset($pref['forum_threadspage']) ? $pref['forum_threadspage'] : 25);
+//echo "view = $view
";
+$page = (varset($_GET['p']) ? $_GET['p'] : 0);
+$threadFrom = $page * $view;
require_once(e_PLUGIN.'forum/forum_class.php');
$forum = new e107forum;
@@ -118,14 +122,12 @@ else
$pages = false;
}
-//echo "pages = $pages
";
-
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}}");
+ $parms = "{$pages},1,{$page},url::forum::forum::func=view&id={$forumId}&page=[FROM], off";
+ $THREADPAGES = $e107->tp->parseTemplate("{NEXTPREV={$parms}}");
}
}
@@ -209,16 +211,15 @@ $reg_threads = 0;
$unstuck = false;
$threadList = $forum->forumGetThreads($forumId, $threadFrom, $view);
-$subList = $forum->forum_getsubs($forum_id);
-//print_a($sub_list);
+$subList = $forum->forumGetSubs($forum_id);
$gen = new convert;
$SUBFORUMS = '';
-if(is_array($sub_list))
+if(is_array($subList) && isset($subList[$forumInfo['forum_parent']][$forumId]))
{
$newflag_list = $forum->forum_newflag_list();
$sub_info = '';
- foreach($sub_list as $sub)
+ foreach($subList[$forumInfo['forum_parent']][$forumId] as $sub)
{
$sub_info .= parse_sub($sub);
}
@@ -237,7 +238,7 @@ if (count($threadList) )
{
$thread_info['thread_options'] = array();
}
- if ($thread_info['thread_s'])
+ if ($thread_info['thread_sticky'])
{
$sticky_threads ++;
}
@@ -253,7 +254,7 @@ if (count($threadList) )
}
$stuck = true;
}
- if (!$thread_info['thread_s'])
+ if (!$thread_info['thread_sticky'])
{
$reg_threads ++;
}
@@ -312,7 +313,7 @@ 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;
+ global $forum, $FORUM_VIEW_FORUM, $FORUM_VIEW_FORUM_STICKY, $FORUM_VIEW_FORUM_ANNOUNCE, $gen, $pref, $forum_id, $menu_pref;
$e107 = e107::getInstance();
$text = '';
@@ -327,13 +328,14 @@ function parse_thread($thread_info)
$lastpost_datestamp = $gen->convert_date($thread_info['thread_lastpost'], 'forum');
if($thread_info['lastpost_username'])
{
- $LASTPOST = "".$thread_info['lastpost_username']."";
+ $url = $e107->url->getUrl('core:user', 'main', "func=profile&id={$thread_info['thread_lastuser']}");
+ $LASTPOST = "".$thread_info['lastpost_username']."";
}
else
{
if(!$thread_info['thread_lastuser'])
{
- $LASTPOST = $tp->toHTML($thread_info['thread_lastuser_anon']);
+ $LASTPOST = $e107->tp->toHTML($thread_info['thread_lastuser_anon']);
}
else
{
@@ -360,12 +362,12 @@ function parse_thread($thread_info)
}
$THREADTYPE = '';
- if ($thread_info['thread_s'] == 1)
+ if ($thread_info['thread_sticky'] == 1)
{
$ICON = ($thread_info['thread_active'] ? IMAGE_sticky : IMAGE_stickyclosed);
$THREADTYPE = '['.LAN_202.']
';
}
- elseif($thread_info['thread_s'] == 2)
+ elseif($thread_info['thread_sticky'] == 2)
{
$ICON = IMAGE_announce;
$THREADTYPE = '['.LAN_396.']
';
@@ -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']))
{
$thread_name = '['.FORLAN_23.'] ' . $thread_name;
@@ -400,7 +402,7 @@ function parse_thread($thread_info)
{
$title = '';
}
- $THREADNAME = "{$thread_name}";
+ $THREADNAME = "{$thread_name}";
$pages = ceil(($REPLIES+1)/$pref['forum_postspage']);
if ($pages > 1)
@@ -439,25 +441,23 @@ function parse_thread($thread_info)
if (MODERATOR)
{
-// $thread_id = $thread_info['thread_id'];
-// $e107->url->getUrl('forum', 'thread', array('func' => 'last', 'id' => $tmp[1]))
$ADMIN_ICONS = "
- ";
+ ';
}
$text .= "
-