mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
beginning of forum update. New schema is in place. Install/Uninstall working, can create forums in admin
This commit is contained in:
@@ -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_handlers/e107Url.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/e107Url.php,v $
|
||||||
| $Revision: 1.3 $
|
| $Revision: 1.4 $
|
||||||
| $Date: 2008-11-25 17:02:02 $
|
| $Date: 2008-11-26 03:24:51 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: mcfly_e107 $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -37,7 +37,7 @@ class eURL
|
|||||||
$urlItems = array($urlItems => 1);
|
$urlItems = array($urlItems => 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
$handlerId = $section . '/' . $urlType;
|
$handlerId = $section . '/' . $urlType; if (!isset($this->_link_handlers[$handlerId]))
|
||||||
if (!isset($this->_link_handlers[$handlerId]))
|
if (!isset($this->_link_handlers[$handlerId]))
|
||||||
{
|
{
|
||||||
$this->_link_handlers[$handlerId] = $this->_initHandler($section, $urlType);
|
$this->_link_handlers[$handlerId] = $this->_initHandler($section, $urlType);
|
||||||
|
File diff suppressed because it is too large
Load Diff
1117
e107_plugins/forum/forum_admin_class.php
Executable file
1117
e107_plugins/forum/forum_admin_class.php
Executable file
File diff suppressed because it is too large
Load Diff
@@ -11,9 +11,9 @@
|
|||||||
| 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.6 $
|
| $Revision: 1.7 $
|
||||||
| $Date: 2008-10-03 19:27:56 $
|
| $Date: 2008-11-26 03:24:51 $
|
||||||
| $Author: e107steved $
|
| $Author: mcfly_e107 $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
@@ -201,19 +201,19 @@ class e107forum
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
function forum_getsubs($forum_id = "")
|
function forum_getsubs($forum_id = '')
|
||||||
{
|
{
|
||||||
global $sql;
|
global $sql;
|
||||||
$where = ($forum_id != "" && $forum_id != 'bysub' ? "AND forum_sub = ".intval($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 SUBSTRING_INDEX(f.forum_lastpost_user,'.',1) = 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
|
||||||
";
|
";
|
||||||
if ($sql->db_Select_gen($qry))
|
if ($sql->db_Select_gen($qry))
|
||||||
{
|
{
|
||||||
while ($row = $sql->db_Fetch())
|
while ($row = $sql->db_Fetch(MYSQL_ASSOC))
|
||||||
{
|
{
|
||||||
if($forum_id == "")
|
if($forum_id == "")
|
||||||
{
|
{
|
||||||
@@ -230,7 +230,7 @@ class e107forum
|
|||||||
}
|
}
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,39 +1,66 @@
|
|||||||
CREATE TABLE forum (
|
CREATE TABLE forum (
|
||||||
forum_id int(10) unsigned NOT NULL auto_increment,
|
`forum_id` int(10) unsigned NOT NULL auto_increment,
|
||||||
forum_name varchar(250) NOT NULL default '',
|
`forum_name` varchar(250) NOT NULL default '',
|
||||||
forum_description text NOT NULL,
|
`forum_description` text,
|
||||||
forum_parent int(10) unsigned NOT NULL default '0',
|
`forum_parent` int(10) unsigned NOT NULL default '0',
|
||||||
forum_sub int(10) unsigned NOT NULL default '0',
|
`forum_sub` int(10) unsigned NOT NULL default '0',
|
||||||
forum_datestamp int(10) unsigned NOT NULL default '0',
|
`forum_datestamp` int(10) unsigned NOT NULL default '0',
|
||||||
forum_moderators text NOT NULL,
|
`forum_moderators` text,
|
||||||
forum_threads int(10) unsigned NOT NULL default '0',
|
`forum_threads` int(10) unsigned NOT NULL default '0',
|
||||||
forum_replies int(10) unsigned NOT NULL default '0',
|
`forum_replies` int(10) unsigned NOT NULL default '0',
|
||||||
forum_lastpost_user varchar(200) NOT NULL default '',
|
`forum_lastpost_user` int(10) unsigned default NULL,
|
||||||
forum_lastpost_info varchar(40) NOT NULL default '',
|
`forum_lastpost_info` varchar(40) default NULL,
|
||||||
forum_class varchar(100) NOT NULL default '',
|
`forum_class` varchar(100) NOT NULL default '',
|
||||||
forum_order int(10) unsigned NOT NULL default '0',
|
`forum_order` int(10) unsigned NOT NULL default '0',
|
||||||
forum_postclass tinyint(3) unsigned NOT NULL default '0',
|
`forum_postclass` text NOT NULL,
|
||||||
PRIMARY KEY (forum_id)
|
`forum_threadclass` text,
|
||||||
) TYPE=MyISAM;
|
`forum_options` text,
|
||||||
|
PRIMARY KEY (`forum_id`),
|
||||||
|
KEY `forum_parent` (`forum_parent`),
|
||||||
|
KEY `forum_sub` (`forum_sub`)
|
||||||
|
) Type=MyISAM AUTO_INCREMENT=1 ;
|
||||||
|
|
||||||
CREATE TABLE forum_t (
|
CREATE TABLE forum_thread (
|
||||||
thread_id int(10) unsigned NOT NULL auto_increment,
|
`thread_id` int(10) unsigned NOT NULL auto_increment,
|
||||||
thread_name varchar(250) NOT NULL default '',
|
`thread_name` varchar(250) NOT NULL default '',
|
||||||
thread_thread text NOT NULL,
|
`thread_thread` text NOT NULL,
|
||||||
thread_forum_id int(10) unsigned NOT NULL default '0',
|
`thread_forum_id` int(10) unsigned NOT NULL default '0',
|
||||||
thread_datestamp int(10) unsigned NOT NULL default '0',
|
`thread_views` int(10) unsigned NOT NULL default '0',
|
||||||
thread_parent int(10) unsigned NOT NULL default '0',
|
`thread_active` tinyint(3) unsigned NOT NULL default '0',
|
||||||
thread_user varchar(250) NOT NULL default '',
|
`thread_lastpost` int(10) unsigned NOT NULL default '0',
|
||||||
thread_views int(10) unsigned NOT NULL default '0',
|
`thread_s` tinyint(1) unsigned NOT NULL default '0',
|
||||||
thread_active tinyint(3) unsigned NOT NULL default '0',
|
`thread_lastuser` int(10) unsigned NOT NULL,
|
||||||
thread_lastpost int(10) unsigned NOT NULL default '0',
|
`thread_total_replies` int(10) unsigned NOT NULL default '0',
|
||||||
thread_s tinyint(1) unsigned NOT NULL default '0',
|
`thread_options` text,
|
||||||
thread_edit_datestamp int(10) unsigned NOT NULL default '0',
|
PRIMARY KEY (`thread_id`),
|
||||||
thread_lastuser varchar(30) NOT NULL default '',
|
KEY `thread_forum_id` (`thread_forum_id`),
|
||||||
thread_total_replies int(10) unsigned NOT NULL default '0',
|
KEY `thread_s` (`thread_s`),
|
||||||
PRIMARY KEY (thread_id),
|
KEY `thread_lastpost` (`thread_lastpost`)
|
||||||
KEY thread_parent (thread_parent),
|
) Type=MyISAM AUTO_INCREMENT=1 ;
|
||||||
KEY thread_datestamp (thread_datestamp),
|
|
||||||
KEY thread_forum_id (thread_forum_id)
|
CREATE TABLE forum_post (
|
||||||
) TYPE=MyISAM;
|
`post_id` int(10) unsigned NOT NULL auto_increment,
|
||||||
|
`post_entry` text NOT NULL,
|
||||||
|
`post_thread` int(10) 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',
|
||||||
|
`post_edit_user` int(10) unsigned NOT NULL,
|
||||||
|
`post_ip` varchar(45) NOT NULL,
|
||||||
|
`post_attachments` text NOT NULL,
|
||||||
|
`post_options` text,
|
||||||
|
PRIMARY KEY (`post_id`),
|
||||||
|
KEY `post_ip` (`post_ip`),
|
||||||
|
KEY `post_thread` (`post_thread`),
|
||||||
|
KEY `post_datestamp` (`post_datestamp`),
|
||||||
|
KEY `post_user` (`post_user`)
|
||||||
|
) Type=MyISAM AUTO_INCREMENT=1 ;
|
||||||
|
|
||||||
|
CREATE TABLE forum_track (
|
||||||
|
`track_userid` int(10) unsigned NOT NULL,
|
||||||
|
`track_threadid` int(10) unsigned NOT NULL,
|
||||||
|
PRIMARY KEY (`track_userid`,`track_threadid`),
|
||||||
|
KEY `track_userid` (`track_userid`),
|
||||||
|
KEY `track_threadid` (`track_threadid`)
|
||||||
|
) Type=MyISAM;
|
||||||
|
|
||||||
|
@@ -1,15 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||||
<e107Plugin>
|
<e107Plugin>
|
||||||
<name>Forum</name>
|
<name>Forum</name>
|
||||||
<version>1.2</version>
|
<version>2.0</version>
|
||||||
<author>e107dev</author>
|
<author>e107dev</author>
|
||||||
<authorUrl>http://e107.org</authorUrl>
|
<authorUrl>http://e107.org</authorUrl>
|
||||||
<description>This plugin is a fully featured Forum system</description>
|
<description>This plugin is a fully featured Forum system</description>
|
||||||
<compatibility>0.8</compatibility>
|
<compatibility>0.8</compatibility>
|
||||||
<installRequired>true</installRequired>
|
<installRequired>true</installRequired>
|
||||||
<folder>forum</folder>
|
<folder>forum</folder>
|
||||||
<commentID>forum1</commentID>
|
|
||||||
<commentID>forum2</commentID>
|
|
||||||
<administration>
|
<administration>
|
||||||
<configFile>forum_admin.php</configFile>
|
<configFile>forum_admin.php</configFile>
|
||||||
<icon>images/forums_32.png</icon>
|
<icon>images/forums_32.png</icon>
|
||||||
@@ -18,7 +16,6 @@
|
|||||||
<installDone>Your forum is now installed</installDone>
|
<installDone>Your forum is now installed</installDone>
|
||||||
</administration>
|
</administration>
|
||||||
<menuLink name="Forum" url="forum/forum.php" perm='everyone'/>
|
<menuLink name="Forum" url="forum/forum.php" perm='everyone'/>
|
||||||
<menuLink name="Forum1" url="forum/forum1.php" perm='everyone' active='false'/>
|
|
||||||
<mainPrefs>
|
<mainPrefs>
|
||||||
<pref name="forum_show_topics" value="1" />
|
<pref name="forum_show_topics" value="1" />
|
||||||
<pref name="forum_postfix" value="[more...]" />
|
<pref name="forum_postfix" value="[more...]" />
|
||||||
@@ -30,15 +27,10 @@
|
|||||||
<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_hilightsticky" value="1" />
|
<pref name="forum_hilightsticky" value="1" />
|
||||||
<pref name="forum_obsolete_pref" value="1" active="false"/>
|
|
||||||
<pref name="forum_tmp" type="array">
|
|
||||||
<key name="pref1" value="val1" active="false" />
|
|
||||||
<key name="pref2" value="val2" />
|
|
||||||
<key name="pref3" value="val3" />
|
|
||||||
</pref>
|
|
||||||
</mainPrefs>
|
</mainPrefs>
|
||||||
<userclass name="forum_moderator" description="Moderator of all forums" />
|
<userclass name="forum_moderator" description="Moderator of all forums" />
|
||||||
<userclass name="forum_moderator2" description="Moderator of all forums" />
|
<extendedField name="viewed" type='EUF_INTEGER' default='0' active="true" />
|
||||||
|
<extendedField name="posts" type='EUF_INTEGER' default='0' active="true" />
|
||||||
<management>
|
<management>
|
||||||
<install when="post" type="classFunction" file="forum_management.php" class="forum_management" function="forum_install_post" />
|
<install when="post" type="classFunction" file="forum_management.php" class="forum_management" function="forum_install_post" />
|
||||||
<uninstall type="classFunction" file="forum_management.php" class="forum_management" function="forum_uninstall" />
|
<uninstall type="classFunction" file="forum_management.php" class="forum_management" function="forum_uninstall" />
|
||||||
|
11
e107_plugins/forum/url/forum.php
Executable file
11
e107_plugins/forum/url/forum.php
Executable file
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
// $Id: forum.php,v 1.1 2008-11-26 03:24:51 mcfly_e107 Exp $
|
||||||
|
function url_forum_forum($parms)
|
||||||
|
{
|
||||||
|
switch($parms['func'])
|
||||||
|
{
|
||||||
|
case 'view':
|
||||||
|
return e_PLUGIN."forum/viewforum.php?{$parms['id']}";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
520
e107_plugins/forum/viewforum.php
Executable file
520
e107_plugins/forum/viewforum.php
Executable file
@@ -0,0 +1,520 @@
|
|||||||
|
<?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 all forums
|
||||||
|
*
|
||||||
|
* $Source: /cvs_backup/e107_0.8/e107_plugins/forum/viewforum.php,v $
|
||||||
|
* $Revision: 1.1 $
|
||||||
|
* $Date: 2008-11-26 03:24:51 $
|
||||||
|
* $Author: mcfly_e107 $
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once("../../class2.php");
|
||||||
|
$lan_file = e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_viewforum.php';
|
||||||
|
include_once(file_exists($lan_file) ? $lan_file : e_PLUGIN.'forum/languages/English/lan_forum_viewforum.php');
|
||||||
|
|
||||||
|
if (isset($_POST['fjsubmit'])) {
|
||||||
|
header("location:".e_PLUGIN."forum/forum_viewforum.php?".$_POST['forumjump']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!e_QUERY)
|
||||||
|
{
|
||||||
|
js_location(e_PLUGIN."forum/forum.php");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$tmp = explode(".", e_QUERY);
|
||||||
|
$forum_id = intval($tmp[0]);
|
||||||
|
$thread_from = (isset($tmp[1]) ? intval($tmp[1]) : 0);
|
||||||
|
}
|
||||||
|
$view = 25;
|
||||||
|
|
||||||
|
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;
|
||||||
|
$forum_info = $forum->forum_get($forum_id);
|
||||||
|
|
||||||
|
if (!check_class($forum_info['forum_class']) || !check_class($forum_info['parent_class']) || !$forum_info['forum_parent'])
|
||||||
|
{
|
||||||
|
header("Location:".e_PLUGIN."forum/forum.php");
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$FORUM_VIEW_START) {
|
||||||
|
if (file_exists(THEME."forum_viewforum_template.php"))
|
||||||
|
{
|
||||||
|
require_once(THEME."forum_viewforum_template.php");
|
||||||
|
}
|
||||||
|
else if (file_exists(THEME."forum_template.php"))
|
||||||
|
{
|
||||||
|
require_once(THEME."forum_template.php");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
require_once(e_PLUGIN."forum/templates/forum_viewforum_template.php");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$forum_info['forum_name'] = $tp->toHTML($forum_info['forum_name'], TRUE, 'no_hook, emotes_off');
|
||||||
|
$forum_info['forum_description'] = $tp->toHTML($forum_info['forum_description'], TRUE, 'no_hook');
|
||||||
|
|
||||||
|
$_forum_name = (substr($forum_info['forum_name'], 0, 1) == "*" ? substr($forum_info['forum_name'], 1) : $forum_info['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']);
|
||||||
|
$message = "";
|
||||||
|
if (MODERATOR)
|
||||||
|
{
|
||||||
|
if ($_POST)
|
||||||
|
{
|
||||||
|
require_once(e_PLUGIN."forum/forum_mod.php");
|
||||||
|
$message = forum_thread_moderate($_POST);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$member_users = $sql->db_Select("online", "*", "online_location REGEXP('forum_viewforum.php.$forum_id') AND online_user_id!='0' ");
|
||||||
|
$guest_users = $sql->db_Select("online", "*", "online_location REGEXP('forum_viewforum.php.$forum_id') AND online_user_id='0' ");
|
||||||
|
$users = $member_users+$guest_users;
|
||||||
|
|
||||||
|
require_once(HEADERF);
|
||||||
|
$text='';
|
||||||
|
if ($message)
|
||||||
|
{
|
||||||
|
$ns->tablerender("", $message, array('forum_viewforum', 'msg'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$topics = $forum->forum_get_topic_count($forum_id);
|
||||||
|
|
||||||
|
if ($topics > $view)
|
||||||
|
{
|
||||||
|
$pages = ceil($topics/$view);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$pages = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($pages)
|
||||||
|
{
|
||||||
|
if(strpos($FORUM_VIEW_START, 'THREADPAGES') !== FALSE || strpos($FORUM_VIEW_END, 'THREADPAGES') !== FALSE)
|
||||||
|
{
|
||||||
|
$parms = "{$topics},{$view},{$thread_from},".e_SELF.'?'.$forum_id.'.[FROM],off';
|
||||||
|
$THREADPAGES = $tp->parseTemplate("{NEXTPREV={$parms}}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (check_class($forum_info['forum_postclass']) && check_class($forum_info['parent_postclass']))
|
||||||
|
{
|
||||||
|
$NEWTHREADBUTTON = "<a href='".e_PLUGIN."forum/forum_post.php?nt.".$forum_id."'>".IMAGE_newthread."</a>";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(substr($forum_info['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 = $forum_info['forum_name'];
|
||||||
|
//$MODERATORS = LAN_404.": ".$forum_info['forum_moderators'];
|
||||||
|
$MODERATORS = LAN_404.": ".implode(", ", $modArray);
|
||||||
|
$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(check_class($forum_info['forum_postclass']))
|
||||||
|
{
|
||||||
|
$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;
|
||||||
|
|
||||||
|
$thread_list = $forum->forum_get_topics($forum_id, $thread_from, $view);
|
||||||
|
$sub_list = $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($thread_list) )
|
||||||
|
{
|
||||||
|
foreach($thread_list as $thread_info) {
|
||||||
|
$idArray[] = $thread_info['thread_id'];
|
||||||
|
}
|
||||||
|
$inList = '('.implode(',', $idArray).')';
|
||||||
|
foreach($thread_list 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'> </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'> </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;
|
||||||
|
$text = "";
|
||||||
|
$VIEWS = $thread_info['thread_views'];
|
||||||
|
$REPLIES = $thread_info['thread_total_replies'];
|
||||||
|
|
||||||
|
|
||||||
|
if ($REPLIES)
|
||||||
|
{
|
||||||
|
$lastpost_datestamp = $gen->convert_date($thread_info['thread_lastpost'], 'forum');
|
||||||
|
$tmp = explode(".", $thread_info['thread_lastuser'], 2);
|
||||||
|
if($thread_info['lastpost_username'])
|
||||||
|
{
|
||||||
|
$LASTPOST = "<a href='".e_BASE."user.php?id.".$tmp[0]."'>".$thread_info['lastpost_username']."</a>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if($tmp[1])
|
||||||
|
{
|
||||||
|
$LASTPOST = $tp->toHTML($tmp[1]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$LASTPOST = FORLAN_19;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$LASTPOST .= "<br />".$lastpost_datestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
$newflag = FALSE;
|
||||||
|
if (USER)
|
||||||
|
{
|
||||||
|
if ($thread_info['thread_lastpost'] > USERLV && !preg_match("#\b".$thread_info['thread_id']."\b#", USERVIEWED))
|
||||||
|
{
|
||||||
|
$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("'", "'", $thread_thread);
|
||||||
|
$title = "title='".$thread_thread."'";
|
||||||
|
} else {
|
||||||
|
$title = "";
|
||||||
|
}
|
||||||
|
$THREADNAME = "<a {$title} href='".e_PLUGIN."forum/forum_viewtopic.php?{$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." [ ".$PAGES." ]";
|
||||||
|
}
|
||||||
|
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($tmp[1])
|
||||||
|
{
|
||||||
|
$x = explode(chr(1), $tmp[1]);
|
||||||
|
$POSTER = $tp->toHTML($x[0]);
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
$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']);
|
||||||
|
$lp_thread = "<a href='".e_PLUGIN."forum/forum_viewtopic.php?{$tmp[1]}.last'>".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."' /> <a href='".e_SELF."?".$_SERVER['QUERY_STRING']."#top'>".LAN_02."</a></p></form>";
|
||||||
|
return $text;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
Reference in New Issue
Block a user