mirror of
https://github.com/e107inc/e107.git
synced 2025-07-25 00:41:52 +02:00
Fixes #1056 - Forum rules and statistics links added back to template and reworked for bootstrap. thread_sef removed from forum_thread database table and now generated on the fly. More testing required.
This commit is contained in:
@@ -25,6 +25,18 @@ class forum_url // plugin-folder + '_url'
|
|||||||
{
|
{
|
||||||
$config = array();
|
$config = array();
|
||||||
|
|
||||||
|
$config['rules'] = array(
|
||||||
|
'regex' => '^forum/rules/?',
|
||||||
|
'sef' => 'forum/rules',
|
||||||
|
'redirect' => '{e_PLUGIN}forum/forum.php?f=rules',
|
||||||
|
);
|
||||||
|
|
||||||
|
$config['stats'] = array(
|
||||||
|
'regex' => '^forum/stats/?',
|
||||||
|
'sef' => 'forum/stats',
|
||||||
|
'redirect' => '{e_PLUGIN}forum/forum_stats.php',
|
||||||
|
);
|
||||||
|
|
||||||
$config['post'] = array(
|
$config['post'] = array(
|
||||||
'regex' => '^forum/post/?',
|
'regex' => '^forum/post/?',
|
||||||
'sef' => 'forum/post/',
|
'sef' => 'forum/post/',
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
#forum-viewtopic li.forum-viewtopic-post:nth-child(odd) { background: #F5F5F5 }
|
#forum-viewtopic li.forum-viewtopic-post:nth-child(odd) { background: #F5F5F5 }
|
||||||
#forum-viewtopic li ul.thumbnails { margin-top:15px }
|
#forum-viewtopic li ul.thumbnails { margin-top:15px }
|
||||||
#forum-viewtopic li img.user-avatar { margin-bottom:10px; display:inline-block }
|
#forum-viewtopic li img.user-avatar { margin-bottom:10px; display:inline-block }
|
||||||
|
#forum, #forum-stats, #forum-rules { min-height: 500px; }
|
||||||
|
|
||||||
.forum-attachment-file { margin-top:15px; }
|
.forum-attachment-file { margin-top:15px; }
|
||||||
.forum-user-combo { padding-bottom:5px }
|
.forum-user-combo { padding-bottom:5px }
|
@@ -53,6 +53,7 @@ if(isset($_GET['f']))
|
|||||||
|
|
||||||
case 'rules':
|
case 'rules':
|
||||||
include_once(HEADERF);
|
include_once(HEADERF);
|
||||||
|
|
||||||
forum_rules('show');
|
forum_rules('show');
|
||||||
include_once(FOOTERF);
|
include_once(FOOTERF);
|
||||||
exit;
|
exit;
|
||||||
@@ -74,6 +75,7 @@ $fVars->NEWIMAGE = IMAGE_new_small;
|
|||||||
$fVars->TRACKTITLE = LAN_FORUM_0073;
|
$fVars->TRACKTITLE = LAN_FORUM_0073;
|
||||||
|
|
||||||
$rules_text = forum_rules('check');
|
$rules_text = forum_rules('check');
|
||||||
|
|
||||||
$fVars->USERINFO = "<a href='".e_BASE."top.php?0.top.forum.10'>".LAN_FORUM_0010."</a> | <a href='".e_BASE."top.php?0.active'>".LAN_FORUM_0011."</a>";
|
$fVars->USERINFO = "<a href='".e_BASE."top.php?0.top.forum.10'>".LAN_FORUM_0010."</a> | <a href='".e_BASE."top.php?0.active'>".LAN_FORUM_0011."</a>";
|
||||||
if(USER)
|
if(USER)
|
||||||
{
|
{
|
||||||
@@ -83,10 +85,27 @@ if(USER)
|
|||||||
$fVars->USERINFO .= " | <a href='".e_PLUGIN."forum/forum_uploads.php'>".LAN_FORUM_0015."</a>";
|
$fVars->USERINFO .= " | <a href='".e_PLUGIN."forum/forum_uploads.php'>".LAN_FORUM_0015."</a>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($rules_text != '')
|
if(!empty($rules_text))
|
||||||
{
|
{
|
||||||
$fVars->USERINFO .= " | <a href='".$e107->url->create('forum/forum/rules')."'>".LAN_FORUM_0016.'</a>';
|
$fVars->USERINFO .= " | <a href='".e107::url('forum','rules')."'>".LAN_FORUM_0016.'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// v2.x --------------------
|
||||||
|
$uInfo = array();
|
||||||
|
$uInfo[0] = "<a href='".e107::url('forum','stats')."'>".LAN_FORUM_6013.'</a>';
|
||||||
|
|
||||||
|
if(!empty($rules_text))
|
||||||
|
{
|
||||||
|
$uInfo[1] = "<a href='".e107::url('forum','rules')."'>".LAN_FORUM_0016.'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$fVars->USERINFOX = implode(" | ",$uInfo);
|
||||||
|
// -----------
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$total_topics = $sql->count("forum_thread", "(*)");
|
$total_topics = $sql->count("forum_thread", "(*)");
|
||||||
$total_replies = $sql->count("forum_post", "(*)");
|
$total_replies = $sql->count("forum_post", "(*)");
|
||||||
$total_members = $sql->count("user");
|
$total_members = $sql->count("user");
|
||||||
@@ -562,7 +581,23 @@ function forum_rules($action = 'check')
|
|||||||
{
|
{
|
||||||
$rules_text = LAN_FORUM_0072;
|
$rules_text = LAN_FORUM_0072;
|
||||||
}
|
}
|
||||||
e107::getRender()->tablerender(LAN_FORUM_0016, "<div style='text-align:center'>{$rules_text}</div>", array('forum', 'forum_rules'));
|
|
||||||
|
$text = '';
|
||||||
|
|
||||||
|
if(deftrue('BOOTSTRAP'))
|
||||||
|
{
|
||||||
|
$breadarray = array(
|
||||||
|
array('text'=> e107::pref('forum','title', LAN_PLUGIN_FORUM_NAME), 'url' => e107::url('forum','index') ),
|
||||||
|
array('text'=>LAN_FORUM_0016, 'url'=>null)
|
||||||
|
);
|
||||||
|
|
||||||
|
$text = e107::getForm()->breadcrumb($breadarray);
|
||||||
|
}
|
||||||
|
|
||||||
|
$text .= "<div id='forum-rules'>".$rules_text."</div>";
|
||||||
|
$text .= "<div class='center'>".e107::getForm()->pagination(e107::url('forum','index'), LAN_BACK)."</div>";
|
||||||
|
|
||||||
|
e107::getRender()->tablerender(LAN_FORUM_0016, $text, array('forum', 'forum_rules'));
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
@@ -375,7 +375,7 @@ if(!deftrue('OLD_FORUMADMIN'))
|
|||||||
|
|
||||||
public function beforeUpdate($new_data, $old_data, $id)
|
public function beforeUpdate($new_data, $old_data, $id)
|
||||||
{
|
{
|
||||||
if(empty($new_data['forum_sef']))
|
if(empty($new_data['forum_sef']) && !empty($new_data['forum_name']))
|
||||||
{
|
{
|
||||||
$new_data['forum_sef'] = eHelper::title2sef($new_data['forum_name']);
|
$new_data['forum_sef'] = eHelper::title2sef($new_data['forum_name']);
|
||||||
}
|
}
|
||||||
|
@@ -747,7 +747,7 @@ class e107forum
|
|||||||
$info = array();
|
$info = array();
|
||||||
// $info['_FIELD_TYPES'] = $this->fieldTypes['forum_thread'];
|
// $info['_FIELD_TYPES'] = $this->fieldTypes['forum_thread'];
|
||||||
|
|
||||||
$threadInfo['thread_sef'] = eHelper::title2sef($threadInfo['thread_name']);
|
// $threadInfo['thread_sef'] = eHelper::title2sef($threadInfo['thread_name'],'dashl');
|
||||||
|
|
||||||
$info['data'] = $threadInfo;
|
$info['data'] = $threadInfo;
|
||||||
|
|
||||||
@@ -758,6 +758,8 @@ class e107forum
|
|||||||
$postInfo['post_thread'] = $newThreadId;
|
$postInfo['post_thread'] = $newThreadId;
|
||||||
$newPostId = $this->postAdd($postInfo, false);
|
$newPostId = $this->postAdd($postInfo, false);
|
||||||
$this->threadMarkAsRead($newThreadId);
|
$this->threadMarkAsRead($newThreadId);
|
||||||
|
$threadInfo['thread_sef'] = eHelper::title2sef($threadInfo['thread_name'],'dashl');
|
||||||
|
|
||||||
return array('postid' => $newPostId, 'threadid' => $newThreadId, 'threadsef'=>$threadInfo['thread_sef']);
|
return array('postid' => $newPostId, 'threadid' => $newThreadId, 'threadsef'=>$threadInfo['thread_sef']);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -783,7 +785,7 @@ class e107forum
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Replace title
|
//Replace title
|
||||||
$threadTitle = ", thread_name = '{$threadTitle}', thread_sef='".eHelper::title2sef($threadTitle,'dashl')."' ";
|
$threadTitle = ", thread_name = '{$threadTitle}' "; // , thread_sef='".eHelper::title2sef($threadTitle,'dashl')."' ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -808,7 +810,7 @@ class e107forum
|
|||||||
function threadUpdate($threadId, $threadInfo)
|
function threadUpdate($threadId, $threadInfo)
|
||||||
{
|
{
|
||||||
$info = array();
|
$info = array();
|
||||||
$threadInfo['thread_sef'] = eHelper::title2sef($threadInfo['thread_name']);
|
// $threadInfo['thread_sef'] = eHelper::title2sef($threadInfo['thread_name'],'dashl');
|
||||||
|
|
||||||
$info['data'] = $threadInfo;
|
$info['data'] = $threadInfo;
|
||||||
// $info['_FIELD_TYPES'] = $this->fieldTypes['forum_thread'];
|
// $info['_FIELD_TYPES'] = $this->fieldTypes['forum_thread'];
|
||||||
@@ -878,6 +880,9 @@ class e107forum
|
|||||||
{
|
{
|
||||||
$tmp['thread_options'] = unserialize($tmp['thread_options']);
|
$tmp['thread_options'] = unserialize($tmp['thread_options']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$tmp['thread_sef'] = eHelper::title2sef($tmp['thread_name'],'dashl');
|
||||||
|
|
||||||
return $tmp;
|
return $tmp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -898,7 +903,7 @@ class e107forum
|
|||||||
if('post' === $start)
|
if('post' === $start)
|
||||||
{
|
{
|
||||||
$qry = '
|
$qry = '
|
||||||
SELECT u.user_name, t.thread_active, t.thread_datestamp, t.thread_name, t.thread_sef, t.thread_user, t.thread_id, p.* FROM `#forum_post` AS p
|
SELECT u.user_name, t.thread_active, t.thread_datestamp, t.thread_name, t.thread_user, t.thread_id, p.* FROM `#forum_post` AS p
|
||||||
LEFT JOIN `#forum_thread` AS t ON t.thread_id = p.post_thread
|
LEFT JOIN `#forum_thread` AS t ON t.thread_id = p.post_thread
|
||||||
LEFT JOIN `#user` AS u ON u.user_id = p.post_user
|
LEFT JOIN `#user` AS u ON u.user_id = p.post_user
|
||||||
WHERE p.post_id = '.$id;
|
WHERE p.post_id = '.$id;
|
||||||
@@ -926,6 +931,7 @@ class e107forum
|
|||||||
$ret = array();
|
$ret = array();
|
||||||
while($row = $sql->fetch(MYSQL_ASSOC))
|
while($row = $sql->fetch(MYSQL_ASSOC))
|
||||||
{
|
{
|
||||||
|
$row['thread_sef'] = eHelper::title2sef($row['thread_name'],'dashl');
|
||||||
$ret[] = $row;
|
$ret[] = $row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1591,6 +1597,7 @@ class e107forum
|
|||||||
{
|
{
|
||||||
while ($row = $sql->fetch(MYSQL_ASSOC))
|
while ($row = $sql->fetch(MYSQL_ASSOC))
|
||||||
{
|
{
|
||||||
|
// $row['thread_sef'] = eHelper::title2sef($row['thread_name']);
|
||||||
$ret[] = $row;
|
$ret[] = $row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1604,7 +1611,7 @@ class e107forum
|
|||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$id = (int)$id;
|
$id = (int)$id;
|
||||||
$qry = "
|
$qry = "
|
||||||
SELECT p.post_user, p.post_id, p.post_user_anon, p.post_datestamp, p.post_thread, t.thread_sef, u.user_name FROM `#forum_post` AS p
|
SELECT p.post_user, p.post_id, p.post_user_anon, p.post_datestamp, p.post_thread, t.thread_name, u.user_name FROM `#forum_post` AS p
|
||||||
LEFT JOIN `#forum_thread` AS t ON p.post_thread = t.thread_id
|
LEFT JOIN `#forum_thread` AS t ON p.post_thread = t.thread_id
|
||||||
LEFT JOIN `#user` AS u ON u.user_id = p.post_user
|
LEFT JOIN `#user` AS u ON u.user_id = p.post_user
|
||||||
WHERE p.post_thread = {$id}
|
WHERE p.post_thread = {$id}
|
||||||
@@ -1612,7 +1619,9 @@ class e107forum
|
|||||||
";
|
";
|
||||||
if ($sql->gen($qry))
|
if ($sql->gen($qry))
|
||||||
{
|
{
|
||||||
return $sql->fetch(MYSQL_ASSOC);
|
$row = $sql->fetch(MYSQL_ASSOC);
|
||||||
|
$row['thread_sef'] = eHelper::title2sef($row['thread_name'],'dashl');
|
||||||
|
return $row;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1635,7 +1644,7 @@ class e107forum
|
|||||||
|
|
||||||
|
|
||||||
$qry = "
|
$qry = "
|
||||||
SELECT t.thread_id, t.thread_sef, f.forum_id, f.forum_sef FROM `#forum_thread` AS t
|
SELECT t.thread_id, t.thread_name, f.forum_id, f.forum_sef 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
|
||||||
WHERE t.thread_forum_id = $forumId
|
WHERE t.thread_forum_id = $forumId
|
||||||
AND t.thread_lastpost {$dir} $lastpost
|
AND t.thread_lastpost {$dir} $lastpost
|
||||||
@@ -1649,6 +1658,7 @@ class e107forum
|
|||||||
if ($sql->gen($qry))
|
if ($sql->gen($qry))
|
||||||
{
|
{
|
||||||
$row = $sql->fetch();
|
$row = $sql->fetch();
|
||||||
|
$row['thread_sef'] = eHelper::title2sef($row['thread_name'],'dashl');
|
||||||
// e107::getMessage()->addInfo(ucfirst($which).print_a($row,true));
|
// e107::getMessage()->addInfo(ucfirst($which).print_a($row,true));
|
||||||
return $row;
|
return $row;
|
||||||
// return $row['thread_id'];
|
// return $row['thread_id'];
|
||||||
|
@@ -824,7 +824,9 @@ class forum_post_handler
|
|||||||
$newThreadId = $postResult['threadid'];
|
$newThreadId = $postResult['threadid'];
|
||||||
|
|
||||||
$this->data['thread_id'] = $newThreadId;
|
$this->data['thread_id'] = $newThreadId;
|
||||||
$this->data['thread_sef'] = $postResult['threadsef'];
|
// $this->data['thread_sef'] = $postResult['threadsef'];
|
||||||
|
$this->data['thread_sef'] = eHelper::title2sef($threadInfo['thread_name'],'dashl');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($_POST['email_notify'])
|
if($_POST['email_notify'])
|
||||||
|
@@ -60,6 +60,11 @@ class forum_setup
|
|||||||
return true; // true to trigger an upgrade alert, and false to not.
|
return true; // true to trigger an upgrade alert, and false to not.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(e107::getDb()->field('forum_thread', 'thread_sef'))
|
||||||
|
{
|
||||||
|
e107::getDb()->gen("ALTER TABLE `#forum_thread` DROP `thread_sef` ");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -37,7 +37,6 @@ CREATE TABLE forum_thread (
|
|||||||
`thread_lastuser_anon` varchar(30) default NULL,
|
`thread_lastuser_anon` varchar(30) default NULL,
|
||||||
`thread_total_replies` int(10) unsigned NOT NULL default '0',
|
`thread_total_replies` int(10) unsigned NOT NULL default '0',
|
||||||
`thread_options` text,
|
`thread_options` text,
|
||||||
`thread_sef` varchar(250) default NULL,
|
|
||||||
PRIMARY KEY (`thread_id`),
|
PRIMARY KEY (`thread_id`),
|
||||||
KEY `thread_forum_id` (`thread_forum_id`),
|
KEY `thread_forum_id` (`thread_forum_id`),
|
||||||
KEY `thread_sticky` (`thread_sticky`),
|
KEY `thread_sticky` (`thread_sticky`),
|
||||||
|
@@ -8,128 +8,150 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once('../../class2.php');
|
if(!defined('e107_INIT'))
|
||||||
|
{
|
||||||
|
require_once('../../class2.php');
|
||||||
|
}
|
||||||
|
|
||||||
$e107 = e107::getInstance();
|
if (!e107::isInstalled('forum'))
|
||||||
$sql = e107::getDb();
|
|
||||||
|
|
||||||
if (!$e107->isInstalled('forum'))
|
|
||||||
{
|
{
|
||||||
header('Location: '.e_BASE.'index.php');
|
header('Location: '.e_BASE.'index.php');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Investigate the queries used here
|
|
||||||
|
|
||||||
include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_stats.php');
|
class forumStats
|
||||||
e107::lan('forum','front');
|
|
||||||
|
|
||||||
|
|
||||||
require_once(e_PLUGIN.'forum/forum_class.php');
|
|
||||||
$gen = new convert;
|
|
||||||
$forum = new e107forum;
|
|
||||||
|
|
||||||
$barl = (file_exists(THEME.'images/barl.png') ? THEME.'images/barl.png' : e_PLUGIN.'poll/images/barl.png');
|
|
||||||
$barr = (file_exists(THEME.'images/barr.png') ? THEME.'images/barr.png' : e_PLUGIN.'poll/images/barr.png');
|
|
||||||
$bar = (file_exists(THEME.'images/bar.png') ? THEME.'images/bar.png' : e_PLUGIN.'poll/images/bar.png');
|
|
||||||
|
|
||||||
require_once(HEADERF);
|
|
||||||
|
|
||||||
$total_posts = $sql->count('forum_post');
|
|
||||||
$total_topics = $sql->count('forum_thread');
|
|
||||||
$total_replies = $total_posts - $total_topics;
|
|
||||||
$total_views = 0;
|
|
||||||
$query = 'SELECT sum(thread_views) AS total FROM `#forum_thread` ';
|
|
||||||
if ($sql->gen($query))
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private $from = 0;
|
||||||
|
private $view = 20;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function __construct()
|
||||||
|
{
|
||||||
|
include_lan(e_PLUGIN.'forum/languages/'.e_LANGUAGE.'/lan_forum_stats.php');
|
||||||
|
e107::lan('forum','front');
|
||||||
|
e107::css('forum', 'forum.css');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function init()
|
||||||
|
{
|
||||||
|
|
||||||
|
$sql = e107::getDb();
|
||||||
|
$tp = e107::getParser();
|
||||||
|
$ns = e107::getRender();
|
||||||
|
$frm = e107::getForm();
|
||||||
|
|
||||||
|
|
||||||
|
require_once(e_PLUGIN.'forum/forum_class.php');
|
||||||
|
$gen = e107::getDate();
|
||||||
|
|
||||||
|
$forum = new e107forum;
|
||||||
|
|
||||||
|
$total_posts = $sql->count('forum_post');
|
||||||
|
$total_topics = $sql->count('forum_thread');
|
||||||
|
$total_replies = $total_posts - $total_topics;
|
||||||
|
$total_views = 0;
|
||||||
|
|
||||||
|
$query = 'SELECT sum(thread_views) AS total FROM `#forum_thread` ';
|
||||||
|
if ($sql->gen($query))
|
||||||
|
{
|
||||||
$row = $sql->fetch();
|
$row = $sql->fetch();
|
||||||
$total_views = $row['total'];
|
$total_views = $row['total'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$firstpost = $sql->select('forum_post', 'post_datestamp', 'post_datestamp > 0 ORDER BY post_datestamp ASC LIMIT 0,1', 'default');
|
$firstpost = $sql->select('forum_post', 'post_datestamp', 'post_datestamp > 0 ORDER BY post_datestamp ASC LIMIT 0,1', 'default');
|
||||||
$fp = $sql->fetch();
|
$fp = $sql->fetch();
|
||||||
|
|
||||||
$open_ds = $fp['post_datestamp'];
|
$open_ds = $fp['post_datestamp'];
|
||||||
$open_date = $gen->convert_date($open_ds, 'long');
|
$open_date = $gen->convert_date($open_ds, 'long');
|
||||||
$open_since = $gen -> computeLapse($open_ds);
|
$open_since = $gen -> computeLapse($open_ds);
|
||||||
$open_days = floor((time()-$open_ds) / 86400);
|
$open_days = floor((time()-$open_ds) / 86400);
|
||||||
$postsperday = ($open_days < 1 ? $total_posts : round($total_posts / $open_days));
|
$postsperday = ($open_days < 1 ? $total_posts : round($total_posts / $open_days));
|
||||||
|
|
||||||
|
global $mySQLdefaultdb;
|
||||||
|
|
||||||
$query = "SHOW TABLE STATUS FROM `{$mySQLdefaultdb}`";
|
$query = "SHOW TABLE STATUS FROM `{$mySQLdefaultdb}`";
|
||||||
$sql->gen($query);
|
$sql->gen($query);
|
||||||
$array = $sql -> db_getList();
|
$array = $sql -> db_getList();
|
||||||
foreach($array as $table)
|
foreach($array as $table)
|
||||||
{
|
{
|
||||||
if($table['Name'] == MPREFIX.'forum_post')
|
if($table['Name'] == MPREFIX.'forum_post')
|
||||||
{
|
{
|
||||||
$db_size = $e107->parseMemorySize($table['Data_length']);
|
$db_size = eHelper::parseMemorySize($table['Data_length']);
|
||||||
$avg_row_len = $e107->parseMemorySize($table['Avg_row_length']);
|
$avg_row_len = eHelper::parseMemorySize($table['Avg_row_length']);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = "
|
$query = "
|
||||||
SELECT ft.thread_id, ft.thread_user, ft.thread_name, ft.thread_total_replies, ft.thread_datestamp, f.forum_class, u.user_name, u.user_id FROM #forum_thread as ft
|
SELECT ft.thread_id, ft.thread_user, ft.thread_name, ft.thread_total_replies, ft.thread_datestamp, f.forum_sef, f.forum_class, u.user_name, u.user_id FROM #forum_thread as ft
|
||||||
LEFT JOIN #user AS u ON ft.thread_user = u.user_id
|
LEFT JOIN #user AS u ON ft.thread_user = u.user_id
|
||||||
LEFT JOIN #forum AS f ON f.forum_id = ft.thread_forum_id
|
LEFT JOIN #forum AS f ON f.forum_id = ft.thread_forum_id
|
||||||
WHERE ft.thread_active > 0
|
WHERE ft.thread_active > 0
|
||||||
AND f.forum_class IN (".USERCLASS_LIST.")
|
AND f.forum_class IN (".USERCLASS_LIST.")
|
||||||
ORDER BY ft.thread_total_replies DESC LIMIT 0,10";
|
ORDER BY ft.thread_total_replies DESC LIMIT 0,10";
|
||||||
$sql->gen($query);
|
|
||||||
$most_activeArray = $sql->db_getList();
|
|
||||||
|
|
||||||
$query = "
|
$sql->gen($query);
|
||||||
SELECT ft.*, f.forum_class, u.user_name, u.user_id FROM #forum_thread as ft
|
$most_activeArray = $sql->db_getList();
|
||||||
LEFT JOIN #user AS u ON ft.thread_user = u.user_id
|
|
||||||
LEFT JOIN #forum AS f ON f.forum_id = ft.thread_forum_id
|
|
||||||
WHERE f.forum_class IN (".USERCLASS_LIST.")
|
|
||||||
ORDER BY ft.thread_views DESC LIMIT 0,10";
|
|
||||||
|
|
||||||
$sql->gen($query);
|
$query = "
|
||||||
$most_viewedArray = $sql->db_getList();
|
SELECT ft.*, f.forum_class, f.forum_sef, u.user_name, u.user_id FROM #forum_thread as ft
|
||||||
|
LEFT JOIN #user AS u ON ft.thread_user = u.user_id
|
||||||
|
LEFT JOIN #forum AS f ON f.forum_id = ft.thread_forum_id
|
||||||
|
WHERE f.forum_class IN (".USERCLASS_LIST.")
|
||||||
|
ORDER BY ft.thread_views DESC LIMIT 0,10";
|
||||||
|
|
||||||
/*$sql->db_Select("user", "user_id, user_name, user_forums", "ORDER BY user_forums DESC LIMIT 0, 10", "no_where");
|
$sql->gen($query);
|
||||||
$posters = $sql -> db_getList();
|
$most_viewedArray = $sql->db_getList();
|
||||||
$top_posters = array();
|
|
||||||
foreach($posters as $poster)
|
/*$sql->db_Select("user", "user_id, user_name, user_forums", "ORDER BY user_forums DESC LIMIT 0, 10", "no_where");
|
||||||
{
|
$posters = $sql -> db_getList();
|
||||||
|
$top_posters = array();
|
||||||
|
foreach($posters as $poster)
|
||||||
|
{
|
||||||
$percen = round(($poster['user_forums'] / $total_posts) * 100, 2);
|
$percen = round(($poster['user_forums'] / $total_posts) * 100, 2);
|
||||||
$top_posters[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['user_forums'], "percentage" => $percen);
|
$top_posters[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['user_forums'], "percentage" => $percen);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
// get all replies
|
|
||||||
$query = "
|
|
||||||
SELECT COUNT(fp.post_id) AS post_count, u.user_name, u.user_id, fp.post_thread FROM #forum_post as fp
|
|
||||||
LEFT JOIN #user AS u ON fp.post_user = u.user_id
|
|
||||||
GROUP BY fp.post_user
|
|
||||||
ORDER BY post_count DESC LIMIT 0,10";
|
|
||||||
$sql->gen($query);
|
|
||||||
$top_repliers_data = $sql->db_getList('ALL', false, false, 'user_id');
|
|
||||||
|
|
||||||
// build top posters meanwhile
|
|
||||||
$top_posters = array();
|
// get all replies
|
||||||
foreach($top_repliers_data as $poster)
|
$query = "
|
||||||
{
|
SELECT COUNT(fp.post_id) AS post_count, u.user_name, u.user_id, fp.post_thread FROM #forum_post as fp
|
||||||
|
LEFT JOIN #user AS u ON fp.post_user = u.user_id
|
||||||
|
GROUP BY fp.post_user
|
||||||
|
ORDER BY post_count DESC LIMIT 0,10";
|
||||||
|
|
||||||
|
$sql->gen($query);
|
||||||
|
$top_repliers_data = $sql->db_getList('ALL', false, false, 'user_id');
|
||||||
|
|
||||||
|
// build top posters meanwhile
|
||||||
|
$top_posters = array();
|
||||||
|
foreach($top_repliers_data as $poster)
|
||||||
|
{
|
||||||
$percent = round(($poster['post_count'] / $total_posts) * 100, 2);
|
$percent = round(($poster['post_count'] / $total_posts) * 100, 2);
|
||||||
$top_posters[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['post_count'], "percentage" => $percent);
|
$top_posters[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['post_count'], "percentage" => $percent);
|
||||||
}
|
}
|
||||||
// end build top posters
|
// end build top posters
|
||||||
|
|
||||||
$ids = implode(',', array_keys($top_repliers_data));
|
$ids = implode(',', array_keys($top_repliers_data));
|
||||||
|
|
||||||
// find topics by top 10 users
|
// find topics by top 10 users
|
||||||
$query = "
|
$query = "
|
||||||
SELECT COUNT(ft.thread_id) AS thread_count, u.user_id FROM #forum_thread as ft
|
SELECT COUNT(ft.thread_id) AS thread_count, u.user_id FROM #forum_thread as ft
|
||||||
LEFT JOIN #user AS u ON ft.thread_user = u.user_id
|
LEFT JOIN #user AS u ON ft.thread_user = u.user_id
|
||||||
WHERE u.user_id IN ({$ids})
|
WHERE u.user_id IN ({$ids})
|
||||||
GROUP BY ft.thread_user";
|
GROUP BY ft.thread_user";
|
||||||
$sql->gen($query);
|
|
||||||
$top_repliers_data_c = $sql->db_getList('ALL', false, false, 'user_id');
|
|
||||||
|
|
||||||
$top_repliers = array();
|
$sql->gen($query);
|
||||||
foreach($top_repliers_data as $uid => $poster)
|
$top_repliers_data_c = $sql->db_getList('ALL', false, false, 'user_id');
|
||||||
{
|
|
||||||
|
$top_repliers = array();
|
||||||
|
foreach($top_repliers_data as $uid => $poster)
|
||||||
|
{
|
||||||
$poster['post_count'] = $poster['post_count'] - $top_repliers_data_c[$uid]['thread_count'];
|
$poster['post_count'] = $poster['post_count'] - $top_repliers_data_c[$uid]['thread_count'];
|
||||||
$percent = round(($poster['post_count'] / $total_replies) * 100, 2);
|
$percent = round(($poster['post_count'] / $total_replies) * 100, 2);
|
||||||
$top_repliers_sort[$uid] = $poster['post_count'];
|
$top_repliers_sort[$uid] = $poster['post_count'];
|
||||||
@@ -137,88 +159,77 @@ foreach($top_repliers_data as $uid => $poster)
|
|||||||
$top_repliers_data[$uid]['user_forums'] = $poster['post_count'];
|
$top_repliers_data[$uid]['user_forums'] = $poster['post_count'];
|
||||||
$top_repliers_data[$uid]['percentage'] = $percent;
|
$top_repliers_data[$uid]['percentage'] = $percent;
|
||||||
//$top_repliers_data[$uid] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['post_count'], "percentage" => $percent);
|
//$top_repliers_data[$uid] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['post_count'], "percentage" => $percent);
|
||||||
}
|
}
|
||||||
// sort
|
|
||||||
arsort($top_repliers_sort, SORT_NUMERIC);
|
|
||||||
// build top repliers
|
|
||||||
foreach ($top_repliers_sort as $uid => $c)
|
|
||||||
{
|
|
||||||
$top_repliers[] = $top_repliers_data[$uid];
|
|
||||||
}
|
|
||||||
|
|
||||||
// get all replies
|
// sort
|
||||||
$query = "
|
|
||||||
SELECT COUNT(ft.thread_id) AS thread_count, u.user_name, u.user_id FROM #forum_thread as ft
|
arsort($top_repliers_sort, SORT_NUMERIC);
|
||||||
LEFT JOIN #user AS u ON ft.thread_user = u.user_id
|
|
||||||
GROUP BY ft.thread_user
|
// build top repliers
|
||||||
ORDER BY thread_count DESC LIMIT 0,10";
|
foreach ($top_repliers_sort as $uid => $c)
|
||||||
$sql->gen($query);
|
{
|
||||||
$top_topic_starters_data = $sql->db_getList();
|
$top_repliers[] = $top_repliers_data[$uid];
|
||||||
$top_topic_starters = array();
|
}
|
||||||
foreach($top_topic_starters_data as $poster)
|
|
||||||
{
|
// get all replies
|
||||||
|
$query = "
|
||||||
|
SELECT COUNT(ft.thread_id) AS thread_count, u.user_name, u.user_id FROM #forum_thread as ft
|
||||||
|
LEFT JOIN #user AS u ON ft.thread_user = u.user_id
|
||||||
|
GROUP BY ft.thread_user
|
||||||
|
ORDER BY thread_count DESC LIMIT 0,10";
|
||||||
|
|
||||||
|
$sql->gen($query);
|
||||||
|
$top_topic_starters_data = $sql->db_getList();
|
||||||
|
$top_topic_starters = array();
|
||||||
|
|
||||||
|
foreach($top_topic_starters_data as $poster)
|
||||||
|
{
|
||||||
$percent = round(($poster['thread_count'] / $total_topics) * 100, 2);
|
$percent = round(($poster['thread_count'] / $total_topics) * 100, 2);
|
||||||
$top_topic_starters[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['thread_count'], "percentage" => $percent);
|
$top_topic_starters[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['thread_count'], "percentage" => $percent);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$query = "
|
$query = "
|
||||||
SELECT SUBSTRING_INDEX(thread_user,'.',1) AS t_user, COUNT(SUBSTRING_INDEX(ft.thread_user,'.',1)) AS ucount, u.user_name, u.user_id FROM #forum_t as ft
|
SELECT SUBSTRING_INDEX(thread_user,'.',1) AS t_user, COUNT(SUBSTRING_INDEX(ft.thread_user,'.',1)) AS ucount, u.user_name, u.user_id FROM #forum_t as ft
|
||||||
LEFT JOIN #user AS u ON SUBSTRING_INDEX(ft.thread_user,'.',1) = u.user_id
|
LEFT JOIN #user AS u ON SUBSTRING_INDEX(ft.thread_user,'.',1) = u.user_id
|
||||||
WHERE ft.thread_parent=0
|
WHERE ft.thread_parent=0
|
||||||
GROUP BY t_user
|
GROUP BY t_user
|
||||||
ORDER BY ucount DESC
|
ORDER BY ucount DESC
|
||||||
LIMIT 0,10";
|
LIMIT 0,10";
|
||||||
$sql -> db_Select_gen($query);
|
$sql -> db_Select_gen($query);
|
||||||
$posters = $sql -> db_getList();
|
$posters = $sql -> db_getList();
|
||||||
$top_topic_starters = array();
|
$top_topic_starters = array();
|
||||||
foreach($posters as $poster)
|
foreach($posters as $poster)
|
||||||
{
|
{
|
||||||
$percen = round(($poster['ucount'] / $total_topics) * 100, 2);
|
$percen = round(($poster['ucount'] / $total_topics) * 100, 2);
|
||||||
$top_topic_starters[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['ucount'], "percentage" => $percen);
|
$top_topic_starters[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['ucount'], "percentage" => $percen);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$query = "
|
$query = "
|
||||||
SELECT SUBSTRING_INDEX(thread_user,'.',1) AS t_user, COUNT(SUBSTRING_INDEX(ft.thread_user,'.',1)) AS ucount, u.user_name, u.user_id FROM #forum_t as ft
|
SELECT SUBSTRING_INDEX(thread_user,'.',1) AS t_user, COUNT(SUBSTRING_INDEX(ft.thread_user,'.',1)) AS ucount, u.user_name, u.user_id FROM #forum_t as ft
|
||||||
LEFT JOIN #user AS u ON SUBSTRING_INDEX(ft.thread_user,'.',1) = u.user_id
|
LEFT JOIN #user AS u ON SUBSTRING_INDEX(ft.thread_user,'.',1) = u.user_id
|
||||||
WHERE ft.thread_parent!=0
|
WHERE ft.thread_parent!=0
|
||||||
GROUP BY t_user
|
GROUP BY t_user
|
||||||
ORDER BY ucount DESC
|
ORDER BY ucount DESC
|
||||||
LIMIT 0,10";
|
LIMIT 0,10";
|
||||||
$sql -> db_Select_gen($query);
|
$sql -> db_Select_gen($query);
|
||||||
$posters = $sql -> db_getList();
|
$posters = $sql -> db_getList();
|
||||||
|
|
||||||
$top_repliers = array();
|
$top_repliers = array();
|
||||||
foreach($posters as $poster)
|
foreach($posters as $poster)
|
||||||
{
|
{
|
||||||
$percen = round(($poster['ucount'] / $total_replies) * 100, 2);
|
$percen = round(($poster['ucount'] / $total_replies) * 100, 2);
|
||||||
$top_repliers[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['ucount'], "percentage" => $percen);
|
$top_repliers[] = array("user_id" => $poster['user_id'], "user_name" => $poster['user_name'], "user_forums" => $poster['ucount'], "percentage" => $percen);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
function showBar($perc)
|
|
||||||
{
|
|
||||||
|
|
||||||
return "<div class='progress'>
|
|
||||||
<div class='bar' style='width: ".intval($perc)."%;'></div>
|
|
||||||
</div>";
|
|
||||||
|
|
||||||
// <div style='background-image: url($barl); width: 5px; height: 14px; float: left;'></div>
|
|
||||||
// <div style='background-image: url($bar); width: ".intval($percentage)."%; height: 14px; float: left;'></div>
|
|
||||||
// <div style='background-image: url($barr); width: 5px; height: 14px; float: left;'></div>
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
$text_0 = "
|
||||||
$text = "
|
<table style='width: 100%;' class='fborder table'>
|
||||||
<div class='spacer'>
|
|
||||||
<table style='width: 100%;' class='fborder table'>
|
|
||||||
<tr>
|
|
||||||
<th class='forumheader' colspan='2'>".LAN_FORUM_6000."</th>
|
|
||||||
</tr>
|
|
||||||
<tr><td style='width: 50%; text-align: right;'><b>".LAN_FORUM_6001.":</b> </td><td style='width: 50%;'>{$open_date}</td></tr>
|
<tr><td style='width: 50%; text-align: right;'><b>".LAN_FORUM_6001.":</b> </td><td style='width: 50%;'>{$open_date}</td></tr>
|
||||||
<tr><td style='width: 50%; text-align: right;'><b>".LAN_FORUM_6002.":</b> </td><td style='width: 50%;'>{$open_since}</td></tr>
|
<tr><td style='width: 50%; text-align: right;'><b>".LAN_FORUM_6002.":</b> </td><td style='width: 50%;'>{$open_since}</td></tr>
|
||||||
<tr><td style='width: 50%; text-align: right;'><b>".LAN_FORUM_6003.":</b> </td><td style='width: 50%;'>{$total_posts}</td></tr>
|
<tr><td style='width: 50%; text-align: right;'><b>".LAN_FORUM_6003.":</b> </td><td style='width: 50%;'>{$total_posts}</td></tr>
|
||||||
@@ -228,29 +239,31 @@ $text = "
|
|||||||
<tr><td style='width: 50%; text-align: right;'><b>".LAN_FORUM_6014.":</b> </td><td style='width: 50%;'>{$postsperday}</td></tr>
|
<tr><td style='width: 50%; text-align: right;'><b>".LAN_FORUM_6014.":</b> </td><td style='width: 50%;'>{$postsperday}</td></tr>
|
||||||
<tr><td style='width: 50%; text-align: right;'><b>".LAN_FORUM_6006.":</b> </td><td style='width: 50%;'>{$db_size}</td></tr>
|
<tr><td style='width: 50%; text-align: right;'><b>".LAN_FORUM_6006.":</b> </td><td style='width: 50%;'>{$db_size}</td></tr>
|
||||||
<tr><td style='width: 50%; text-align: right;'><b>".LAN_FORUM_6007.":</b> </td><td style='width: 50%;'>{$avg_row_len}</td></tr>
|
<tr><td style='width: 50%; text-align: right;'><b>".LAN_FORUM_6007.":</b> </td><td style='width: 50%;'>{$avg_row_len}</td></tr>
|
||||||
</table>
|
</table>";
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class='spacer'>
|
|
||||||
<table style='width: 100%;' class='fborder table'>
|
|
||||||
<tr>
|
|
||||||
<td class='forumheader' colspan='5'>".LAN_FORUM_0011."</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_6008."</th>
|
|
||||||
<th style='width: 40%;' class='fcaption'>".LAN_FORUM_1003."</th>
|
|
||||||
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_0003."</th>
|
|
||||||
<th style='width: 20%; text-align: center;' class='fcaption'>".LAN_FORUM_6009."</th>
|
|
||||||
<th style='width: 20%; text-align: center;' class='fcaption'>".LAN_DATE."</th>
|
|
||||||
</tr>
|
|
||||||
";
|
|
||||||
|
|
||||||
$count=1;
|
|
||||||
foreach($most_activeArray as $ma)
|
|
||||||
{
|
$text_1 = "
|
||||||
|
<table style='width: 100%;' class='fborder table'>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_6008."</th>
|
||||||
|
<th style='width: 40%;' class='fcaption'>".LAN_FORUM_1003."</th>
|
||||||
|
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_0003."</th>
|
||||||
|
<th style='width: 20%; text-align: center;' class='fcaption'>".LAN_FORUM_6009."</th>
|
||||||
|
<th style='width: 20%; text-align: center;' class='fcaption'>".LAN_DATE."</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
";
|
||||||
|
|
||||||
|
$count=1;
|
||||||
|
|
||||||
|
foreach($most_activeArray as $ma)
|
||||||
|
{
|
||||||
if($ma['user_name'])
|
if($ma['user_name'])
|
||||||
{
|
{
|
||||||
$uinfo = "<a href='".e_BASE."user.php?id.{$ma['user_id']}'>{$ma['user_name']}</a>";
|
$uinfo = "<a href='".e_BASE."user.php?id.{$ma['user_id']}'>{$ma['user_name']}</a>"; //TODO SEf Url .
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -258,40 +271,45 @@ foreach($most_activeArray as $ma)
|
|||||||
$uinfo = $tp->toHTML($tmp[0]);
|
$uinfo = $tp->toHTML($tmp[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$text .= "
|
$ma['thread_sef'] = eHelper::title2sef($ma['thread_name'],'dashl');
|
||||||
|
$url = e107::url('forum','topic', $ma);
|
||||||
|
|
||||||
|
$text_1 .= "
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width: 10%; text-align: center;' class='forumheader3'>$count</td>
|
<td style='width: 10%; text-align: center;' class='forumheader3'>$count</td>
|
||||||
<td style='width: 40%;' class='forumheader3'><a href='".e_PLUGIN."forum/forum_viewtopic.php?{$ma['thread_id']}'>{$ma['thread_name']}</a></td>
|
<td style='width: 40%;' class='forumheader3'><a href='".$url."'>{$ma['thread_name']}</a></td>
|
||||||
<td style='width: 10%; text-align: center;' class='forumheader3'>{$ma['thread_total_replies']}</td>
|
<td style='width: 10%; text-align: center;' class='forumheader3'>{$ma['thread_total_replies']}</td>
|
||||||
<td style='width: 20%; text-align: center;' class='forumheader3'>{$uinfo}</td>
|
<td style='width: 20%; text-align: center;' class='forumheader3'>{$uinfo}</td>
|
||||||
<td style='width: 20%; text-align: center;' class='forumheader3'>".$gen->convert_date($ma['thread_datestamp'], "forum")."</td>
|
<td style='width: 20%; text-align: center;' class='forumheader3'>".$gen->convert_date($ma['thread_datestamp'], "forum")."</td>
|
||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
|
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
$text .= "</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class='spacer'>
|
$text_1 .= "</table>";
|
||||||
<table style='width: 100%;' class='fborder table'>
|
|
||||||
<tr>
|
|
||||||
<td class='forumheader' colspan='5'>".LAN_FORUM_6010."</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_6008."</th>
|
|
||||||
<th style='width: 40%;' class='fcaption'>".LAN_FORUM_1003."</th>
|
|
||||||
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_1005."</th>
|
|
||||||
<th style='width: 20%; text-align: center;' class='fcaption'>".LAN_FORUM_6009."</th>
|
|
||||||
<th style='width: 20%; text-align: center;' class='fcaption'>".LAN_DATE."</th>
|
|
||||||
</tr>
|
|
||||||
";
|
|
||||||
|
|
||||||
$count=1;
|
|
||||||
foreach($most_viewedArray as $ma)
|
$text_2 = "
|
||||||
{
|
<table style='width: 100%;' class='fborder table'>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_6008."</th>
|
||||||
|
<th style='width: 40%;' class='fcaption'>".LAN_FORUM_1003."</th>
|
||||||
|
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_1005."</th>
|
||||||
|
<th style='width: 20%; text-align: center;' class='fcaption'>".LAN_FORUM_6009."</th>
|
||||||
|
<th style='width: 20%; text-align: center;' class='fcaption'>".LAN_DATE."</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
";
|
||||||
|
|
||||||
|
$count=1;
|
||||||
|
|
||||||
|
foreach($most_viewedArray as $ma)
|
||||||
|
{
|
||||||
if($ma['user_name'])
|
if($ma['user_name'])
|
||||||
{
|
{
|
||||||
$uinfo = "<a href='".e_BASE."user.php?id.{$ma['user_id']}'>{$ma['user_name']}</a>";
|
$uinfo = "<a href='".e_BASE."user.php?id.{$ma['user_id']}'>".$ma['user_name']."</a>"; //TODO SEf Url .
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -299,121 +317,359 @@ foreach($most_viewedArray as $ma)
|
|||||||
$uinfo = $tp->toHTML($tmp[0]);
|
$uinfo = $tp->toHTML($tmp[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$text .= "
|
$ma['thread_sef'] = eHelper::title2sef($ma['thread_name'],'dashl');
|
||||||
|
$url = e107::url('forum','topic', $ma);
|
||||||
|
|
||||||
|
$text_2 .= "
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width: 10%; text-align: center;' class='forumheader3'>$count</td>
|
<td style='width: 10%; text-align: center;' class='forumheader3'>$count</td>
|
||||||
<td style='width: 40%;' class='forumheader3'><a href='".e_PLUGIN."forum/forum_viewtopic.php?{$ma['thread_id']}'>{$ma['thread_name']}</a></td>
|
<td style='width: 40%;' class='forumheader3'><a href='".$url."'>".$ma['thread_name']."</a></td>
|
||||||
<td style='width: 10%; text-align: center;' class='forumheader3'>{$ma['thread_views']}</td>
|
<td style='width: 10%; text-align: center;' class='forumheader3'>".$ma['thread_views']."</td>
|
||||||
<td style='width: 20%; text-align: center;' class='forumheader3'>{$uinfo}</td>
|
<td style='width: 20%; text-align: center;' class='forumheader3'>".$uinfo."</td>
|
||||||
<td style='width: 20%; text-align: center;' class='forumheader3'>".$gen->convert_date($ma['thread_datestamp'], "forum")."</td>
|
<td style='width: 20%; text-align: center;' class='forumheader3'>".$gen->convert_date($ma['thread_datestamp'], "forum")."</td>
|
||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
$text .= "</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class='spacer'>
|
$text_2 .= "</table>";
|
||||||
<table style='width: 100%;' class='fborder table'>
|
|
||||||
<tr>
|
|
||||||
<td class='forumheader' colspan='5'>".LAN_FORUM_0010."</td>
|
|
||||||
</tr>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_6008."</th>
|
|
||||||
<th style='width: 20%;' class='fcaption'>".LAN_NAME."</th>
|
|
||||||
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_2032."</th>
|
|
||||||
<th style='width: 10%; text-align: center;' class='fcaption'>%</th>
|
|
||||||
<th style='width: 50%; text-align: center;' class='fcaption'> </th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
";
|
|
||||||
|
|
||||||
$count=1;
|
|
||||||
foreach($top_posters as $ma)
|
|
||||||
{
|
|
||||||
extract($ma);
|
$text_3 = "
|
||||||
$text .= "<tr>
|
<table style='width: 100%;' class='fborder table'>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_6008."</th>
|
||||||
|
<th style='width: 20%;' class='fcaption'>".LAN_NAME."</th>
|
||||||
|
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_2032."</th>
|
||||||
|
<th style='width: 10%; text-align: center;' class='fcaption'>%</th>
|
||||||
|
<th style='width: 50%; text-align: center;' class='fcaption'> </th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
";
|
||||||
|
|
||||||
|
$count=1;
|
||||||
|
foreach($top_posters as $ma)
|
||||||
|
{
|
||||||
|
extract($ma); // TODO Remove me.
|
||||||
|
|
||||||
|
//TODO SEf Url .
|
||||||
|
$text_3 .= "<tr>
|
||||||
<td style='width: 10%; text-align: center;' class='forumheader3'>$count</td>
|
<td style='width: 10%; text-align: center;' class='forumheader3'>$count</td>
|
||||||
<td style='width: 20%;' class='forumheader3'><a href='".e_BASE."user.php?id.$user_id'>$user_name</a></td>
|
<td style='width: 20%;' class='forumheader3'><a href='".e_BASE."user.php?id.".$ma['user_id']."'>".$ma['user_name']."</a></td>
|
||||||
<td style='width: 10%; text-align: center;' class='forumheader3'>$user_forums</td>
|
<td style='width: 10%; text-align: center;' class='forumheader3'>$user_forums</td>
|
||||||
<td style='width: 10%; text-align: center;' class='forumheader3'>$percentage%</td>
|
<td style='width: 10%; text-align: center;' class='forumheader3'>$percentage%</td>
|
||||||
<td style='width: 50%;' class='forumheader3'>".showBar($percentage)."
|
<td style='width: 50%;' class='forumheader3'>".$this->showBar($percentage)."
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
|
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
$text .= "</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class='spacer'>
|
$text_3 .= "</tbody>
|
||||||
<table style='width: 100%;' class='fborder table'>
|
</table>
|
||||||
<tr>
|
";
|
||||||
<td class='forumheader' colspan='5'>".LAN_FORUM_6011."</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_6008."</th>
|
|
||||||
<th style='width: 20%;' class='fcaption'>".LAN_NAME."</th>
|
|
||||||
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_2032."</th>
|
|
||||||
<th style='width: 10%; text-align: center;' class='fcaption'>%</th>
|
|
||||||
<th style='width: 50%; text-align: center;' class='fcaption'> </th>
|
|
||||||
</tr>
|
|
||||||
";
|
|
||||||
|
|
||||||
$count=1;
|
|
||||||
foreach($top_topic_starters as $ma)
|
$text_4 = "
|
||||||
{
|
<table style='width: 100%;' class='fborder table'>
|
||||||
extract($ma);
|
<thead>
|
||||||
$text .= "<tr>
|
<tr>
|
||||||
|
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_6008."</th>
|
||||||
|
<th style='width: 20%;' class='fcaption'>".LAN_NAME."</th>
|
||||||
|
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_2032."</th>
|
||||||
|
<th style='width: 10%; text-align: center;' class='fcaption'>%</th>
|
||||||
|
<th style='width: 50%; text-align: center;' class='fcaption'> </th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
";
|
||||||
|
|
||||||
|
$count=1;
|
||||||
|
foreach($top_topic_starters as $ma)
|
||||||
|
{
|
||||||
|
extract($ma); // TODO Remove me.
|
||||||
|
//TODO SEf Url .
|
||||||
|
|
||||||
|
|
||||||
|
$text_4 .= "<tr>
|
||||||
<td style='width: 10%; text-align: center;' class='forumheader3'>$count</td>
|
<td style='width: 10%; text-align: center;' class='forumheader3'>$count</td>
|
||||||
<td style='width: 20%;' class='forumheader3'><a href='".e_BASE."user.php?id.$user_id'>$user_name</a></td>
|
<td style='width: 20%;' class='forumheader3'><a href='".e_BASE."user.php?id.$user_id'>$user_name</a></td>
|
||||||
<td style='width: 10%; text-align: center;' class='forumheader3'>$user_forums</td>
|
<td style='width: 10%; text-align: center;' class='forumheader3'>$user_forums</td>
|
||||||
<td style='width: 10%; text-align: center;' class='forumheader3'>$percentage%</td>
|
<td style='width: 10%; text-align: center;' class='forumheader3'>$percentage%</td>
|
||||||
<td style='width: 50%; text-align: center;' class='forumheader3'>".showBar($percentage)."</td>
|
<td style='width: 50%; text-align: center;' class='forumheader3'>".$this->showBar($percentage)."</td>
|
||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
$text .= "</table>
|
|
||||||
</div>
|
$text_4 .= "</table>";
|
||||||
|
|
||||||
|
|
||||||
<div class='spacer'>
|
$text_5 = "
|
||||||
<table style='width: 100%;' class='fborder table'>
|
<table style='width: 100%;' class='fborder table'>
|
||||||
<tr>
|
<thead>
|
||||||
<td class='forumheader' colspan='5'>".LAN_FORUM_6012."</td>
|
<tr>
|
||||||
</tr>
|
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_6008."</th>
|
||||||
<tr>
|
<th style='width: 20%;' class='fcaption'>".LAN_NAME."</th>
|
||||||
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_6008."</th>
|
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_2032."</th>
|
||||||
<th style='width: 20%;' class='fcaption'>".LAN_NAME."</th>
|
<th style='width: 10%; text-align: center;' class='fcaption'>%</th>
|
||||||
<th style='width: 10%; text-align: center;' class='fcaption'>".LAN_FORUM_2032."</th>
|
<th style='width: 50%; text-align: center;' class='fcaption'> </th>
|
||||||
<th style='width: 10%; text-align: center;' class='fcaption'>%</th>
|
</tr>
|
||||||
<th style='width: 50%; text-align: center;' class='fcaption'> </th>
|
</thead>
|
||||||
</tr>
|
";
|
||||||
";
|
|
||||||
|
|
||||||
$count=1;
|
$count=1;
|
||||||
foreach($top_repliers as $ma)
|
foreach($top_repliers as $ma)
|
||||||
{
|
{
|
||||||
extract($ma);
|
extract($ma); // TODO Remove me.
|
||||||
$text .= "<tr>
|
//TODO SEf Url .
|
||||||
|
|
||||||
|
$text_5 .= "
|
||||||
|
<tr>
|
||||||
<td style='width: 10%; text-align: center;' class='forumheader3'>$count</td>
|
<td style='width: 10%; text-align: center;' class='forumheader3'>$count</td>
|
||||||
<td style='width: 20%;' class='forumheader3'><a href='".e_BASE."user.php?id.$user_id'>$user_name</a></td>
|
<td style='width: 20%;' class='forumheader3'><a href='".e_BASE."user.php?id.$user_id'>$user_name</a></td>
|
||||||
<td style='width: 10%; text-align: center;' class='forumheader3'>$user_forums</td>
|
<td style='width: 10%; text-align: center;' class='forumheader3'>$user_forums</td>
|
||||||
<td style='width: 10%; text-align: center;' class='forumheader3'>$percentage%</td>
|
<td style='width: 10%; text-align: center;' class='forumheader3'>$percentage%</td>
|
||||||
<td style='width: 50%; text-align: center;' class='forumheader3'>".showBar($percentage)."</td>
|
<td style='width: 50%; text-align: center;' class='forumheader3'>".$this->showBar($percentage)."</td>
|
||||||
</tr>
|
</tr>
|
||||||
";
|
";
|
||||||
$count++;
|
|
||||||
}
|
|
||||||
$text .= '</table>
|
|
||||||
</div>
|
|
||||||
';
|
|
||||||
|
|
||||||
$ns -> tablerender(LAN_FORUM_6013, $text);
|
$count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$text_5 .= '</table>';
|
||||||
|
|
||||||
|
|
||||||
|
if(deftrue('BOOTSTRAP'))
|
||||||
|
{
|
||||||
|
$tabs = array();
|
||||||
|
|
||||||
|
$tabs[0] = array('caption'=>LAN_FORUM_6000, 'text'=>$text_0);
|
||||||
|
$tabs[1] = array('caption'=>LAN_FORUM_0011, 'text'=>$text_1);
|
||||||
|
$tabs[2] = array('caption'=>LAN_FORUM_6010, 'text'=>$text_2);
|
||||||
|
$tabs[3] = array('caption'=>LAN_FORUM_0010, 'text'=>$text_3);
|
||||||
|
$tabs[4] = array('caption'=>LAN_FORUM_6011, 'text'=>$text_4);
|
||||||
|
$tabs[5] = array('caption'=>LAN_FORUM_6012, 'text'=>$text_5);
|
||||||
|
|
||||||
|
$frm = e107::getForm();
|
||||||
|
|
||||||
|
$breadarray = array(
|
||||||
|
array('text'=> e107::pref('forum','title', LAN_PLUGIN_FORUM_NAME), 'url' => e107::url('forum','index') ),
|
||||||
|
array('text'=>LAN_FORUM_6013, 'url'=>null)
|
||||||
|
);
|
||||||
|
|
||||||
|
$text = $frm->breadcrumb($breadarray);
|
||||||
|
|
||||||
|
|
||||||
|
$text = "<div id='forum-stats'>". $text . e107::getForm()->tabs($tabs)."</div>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$text ="
|
||||||
|
<h3>".LAN_FORUM_6000."</h3>". $text_0 .
|
||||||
|
"<h3>".LAN_FORUM_0011."</h3>". $text_1 .
|
||||||
|
"<h3>".LAN_FORUM_6010."</h3>". $text_2 .
|
||||||
|
"<h3>".LAN_FORUM_0010."</h3>".$text_3 .
|
||||||
|
"<h3>".LAN_FORUM_6011."</h3>". $text_4 .
|
||||||
|
"<h3>".LAN_FORUM_6012."</h3>". $text_5;
|
||||||
|
}
|
||||||
|
|
||||||
|
$text .= "<div class='center'>".e107::getForm()->pagination(e107::url('forum','index'), LAN_BACK)."</div>";
|
||||||
|
|
||||||
|
$ns -> tablerender(LAN_FORUM_6013, $text);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function showBar($perc)
|
||||||
|
{
|
||||||
|
return e107::getForm()->progressBar('prog',$perc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function topPosters() // from top.php - unused.
|
||||||
|
{
|
||||||
|
$pref = e107::pref('core');
|
||||||
|
$rank = e107::getRank();
|
||||||
|
$sql = e107::getDb();
|
||||||
|
$sql2 = e107::getDb('sql2');
|
||||||
|
$ns = e107::getRender();
|
||||||
|
$tp = e107::getParser();
|
||||||
|
|
||||||
|
|
||||||
|
define('IMAGE_rank_main_admin_image', ($pref['rank_main_admin_image'] && file_exists(THEME."forum/".$pref['rank_main_admin_image']) ? "<img src='".THEME_ABS."forum/".$pref['rank_main_admin_image']."' alt='' />" : "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/main_admin.png' alt='' />"));
|
||||||
|
define('IMAGE_rank_admin_image', ($pref['rank_admin_image'] && file_exists(THEME."forum/".$pref['rank_admin_image']) ? "<img src='".THEME_ABS."forum/".$pref['rank_admin_image']."' alt='' />" : "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/admin.png' alt='' />"));
|
||||||
|
define('IMAGE_rank_moderator_image', ($pref['rank_moderator_image'] && file_exists(THEME."forum/".$pref['rank_moderator_image']) ? "<img src='".THEME_ABS."forum/".$pref['rank_moderator_image']."' alt='' />" : "<img src='".e_PLUGIN_ABS."forum/images/".IMODE."/moderator.png' alt='' />"));
|
||||||
|
|
||||||
|
if ($this->subaction == 'forum' || $this->subaction == 'all')
|
||||||
|
{
|
||||||
|
require_once (e_PLUGIN.'forum/forum_class.php');
|
||||||
|
$forum = new e107forum();
|
||||||
|
|
||||||
|
$qry = "
|
||||||
|
SELECT ue.*, u.* FROM `#user_extended` AS ue
|
||||||
|
LEFT JOIN `#user` AS u ON u.user_id = ue.user_extended_id
|
||||||
|
WHERE ue.user_plugin_forum_posts > 0
|
||||||
|
ORDER BY ue.user_plugin_forum_posts DESC LIMIT {$this->from}, {$this->view}
|
||||||
|
";
|
||||||
|
|
||||||
|
// $top_forum_posters = $sql->db_Select("user", "*", "`user_forums` > 0 ORDER BY user_forums DESC LIMIT ".$from.", ".$view."");
|
||||||
|
$text = "
|
||||||
|
<div>
|
||||||
|
<table style='width:95%' class='table table-striped fborder'>
|
||||||
|
<tr>
|
||||||
|
<th style='width:10%; text-align:center' class='forumheader3'> </th>
|
||||||
|
<th style='width:50%' class='forumheader3'>".TOP_LAN_1."</th>
|
||||||
|
<th style='width:10%; text-align:center' class='forumheader3'>".TOP_LAN_2."</th>
|
||||||
|
<th style='width:30%; text-align:center' class='forumheader3'>".TOP_LAN_6."</th>
|
||||||
|
</tr>\n";
|
||||||
|
|
||||||
|
$counter = 1 + $this->from;
|
||||||
|
|
||||||
|
if ($sql2->gen($qry))
|
||||||
|
{
|
||||||
|
while ($row = $sql2->fetch())
|
||||||
|
{
|
||||||
|
//$ldata = get_level($row['user_id'], $row['user_plugin_forum_posts'], $row['user_comments'], $row['user_chats'], $row['user_visits'], $row['user_join'], $row['user_admin'], $row['user_perms'], $pref);
|
||||||
|
$ldata = $rank->getRanks($row, (USER && $forum->isModerator(USERID)));
|
||||||
|
|
||||||
|
if(vartrue($ldata['special']))
|
||||||
|
{
|
||||||
|
$r = $ldata['special'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$r = $ldata['pic'] ? $ldata['pic'] : defset($ldata['name'], $ldata['name']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$r) $r = 'n/a';
|
||||||
|
|
||||||
|
$text .= "<tr>
|
||||||
|
<td style='width:10%; text-align:center' class='forumheader3'>{$counter}</td>
|
||||||
|
<td style='width:50%' class='forumheader3'><a href='".e107::getUrl()->create('user/profile/view', 'id='.$row['user_id'].'&name='.$row['user_name'])."'>{$row['user_name']}</a></td>
|
||||||
|
<td style='width:10%; text-align:center' class='forumheader3'>{$row['user_plugin_forum_posts']}</td>
|
||||||
|
<td style='width:30%; text-align:center' class='forumheader3'>{$r}</td>
|
||||||
|
</tr>";
|
||||||
|
|
||||||
|
$counter++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$text .= "</table>\n</div>";
|
||||||
|
|
||||||
|
if ($this->subaction == 'forum')
|
||||||
|
{
|
||||||
|
$ftotal = $sql->count('user', '(*)', 'WHERE `user_forums` > 0');
|
||||||
|
$parms = "{$ftotal},{$this->view},{$this->from},".e_SELF.'?[FROM].top.forum.'.$this->view;
|
||||||
|
$text .= "<div class='nextprev'>".$tp->parseTemplate("{NEXTPREV={$parms}}").'</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$ns->tablerender(TOP_LAN_0, $text);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function mostActiveTopics() // from top.php - unused.
|
||||||
|
{
|
||||||
|
//require_once (e_HANDLER.'userclass_class.php');
|
||||||
|
|
||||||
|
$sql = e107::getDb();
|
||||||
|
$tp = e107::getParser();
|
||||||
|
$ns = e107::getRender();
|
||||||
|
|
||||||
|
require_once (e_PLUGIN.'forum/forum_class.php');
|
||||||
|
$forum = new e107forum();
|
||||||
|
|
||||||
|
$forumList = implode(',', $forum->getForumPermList('view'));
|
||||||
|
|
||||||
|
$qry = "
|
||||||
|
SELECT
|
||||||
|
t.*, u.user_name, ul.user_name AS user_last, f.forum_name
|
||||||
|
FROM `#forum_thread` as t
|
||||||
|
LEFT JOIN `#forum` AS f ON f.forum_id = t.thread_forum_id
|
||||||
|
LEFT JOIN `#user` AS u ON u.user_id = t.thread_user
|
||||||
|
LEFT JOIN `#user` AS ul ON ul.user_id = t.thread_lastuser
|
||||||
|
WHERE t.thread_forum_id IN ({$forumList})
|
||||||
|
ORDER BY t.thread_views DESC
|
||||||
|
LIMIT
|
||||||
|
{$this->from}, {$this->view}
|
||||||
|
";
|
||||||
|
|
||||||
|
if ($sql->gen($qry))
|
||||||
|
{
|
||||||
|
$text = "<div>\n<table style='width:auto' class='table fborder'>\n";
|
||||||
|
$gen = e107::getDate();
|
||||||
|
|
||||||
|
$text .= "<tr>
|
||||||
|
<th style='width:5%' class='forumheader'> </th>
|
||||||
|
<th style='width:45%' class='forumheader'>".LAN_1."</th>
|
||||||
|
<th style='width:15%; text-align:center' class='forumheader'>".LAN_2."</th>
|
||||||
|
<th style='width:5%; text-align:center' class='forumheader'>".LAN_3."</th>
|
||||||
|
<th style='width:5%; text-align:center' class='forumheader'>".LAN_4."</th>
|
||||||
|
<th style='width:25%; text-align:center' class='forumheader'>".LAN_5."</th>
|
||||||
|
</tr>\n";
|
||||||
|
|
||||||
|
while ($row = $sql->fetch(MYSQL_ASSOC))
|
||||||
|
{
|
||||||
|
if ($row['user_name'])
|
||||||
|
{
|
||||||
|
$POSTER = "<a href='".e107::getUrl()->create('user/profile/view', "name={$row['user_name']}&id={$row['thread_user']}")."'>{$row['user_name']}</a>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$POSTER = $row['thread_user_anon'];
|
||||||
|
}
|
||||||
|
|
||||||
|
$LINKTOTHREAD = e107::getUrl()->create('forum/thread/view', array('id' =>$row['thread_id'])); //$e107->url->getUrl('forum', 'thread', "func=view&id={$row['thread_id']}");
|
||||||
|
$LINKTOFORUM = e107::getUrl()->create('forum/forum/view', array('id' => $row['thread_forum_id'])); //$e107->url->getUrl('forum', 'forum', "func=view&id={$row['thread_forum_id']}");
|
||||||
|
|
||||||
|
$lastpost_datestamp = $gen->convert_date($row['thread_lastpost'], 'forum');
|
||||||
|
|
||||||
|
if ($row['user_last'])
|
||||||
|
{
|
||||||
|
$LASTPOST = "<a href='".e107::getUrl()->create('user/profile/view', "name={$row['user_last']}&id={$row['thread_lastuser']}")."'>{$row['user_last']}</a><br />".$lastpost_datestamp;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$LASTPOST = $row['thread_lastuser_anon'].'<br />'.$lastpost_datestamp;
|
||||||
|
}
|
||||||
|
|
||||||
|
$text .= "<tr>
|
||||||
|
<td style='width:5%; text-align:center' class='forumheader3'><img src='".e_PLUGIN_ABS."forum/images/".IMODE."/new_small.png' alt='' /></td>
|
||||||
|
<td style='width:45%' class='forumheader3'><b><a href='{$LINKTOTHREAD}'>{$row['thread_name']}</a></b> <span class='smalltext'>(<a href='{$LINKTOFORUM}'>{$row['forum_name']}</a>)</span></td>
|
||||||
|
<td style='width:15%; text-align:center' class='forumheader3'>{$POSTER}</td>
|
||||||
|
<td style='width:5%; text-align:center' class='forumheader3'>{$row['thread_views']}</td>
|
||||||
|
<td style='width:5%; text-align:center' class='forumheader3'>{$row['thread_total_replies']}</td>
|
||||||
|
<td style='width:25%; text-align:center' class='forumheader3'>{$LASTPOST}</td>
|
||||||
|
</tr>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$text .= "</table>\n</div>";
|
||||||
|
|
||||||
|
$ftotal = $sql->count('forum_thread', '(*)', 'WHERE `thread_parent` = 0');
|
||||||
|
$parms = "{$ftotal},{$this->view},{$this->from},".e_SELF.'?[FROM].active.forum.'.$this->view;
|
||||||
|
$text .= "<div class='nextprev'>".$tp->parseTemplate("{NEXTPREV={$parms}}").'</div>';
|
||||||
|
|
||||||
|
$ns->tablerender(LAN_7, $text, 'nfp');
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$frmStats = new forumStats;
|
||||||
|
require_once(HEADERF);
|
||||||
|
$frmStats->init();
|
||||||
|
|
||||||
require_once(FOOTERF);
|
require_once(FOOTERF);
|
||||||
?>
|
|
@@ -469,6 +469,8 @@ function parse_thread($thread_info)
|
|||||||
|
|
||||||
$tVars->LASTPOSTUSER = $thread_info['lastpost_username']; // $lastpost_name;
|
$tVars->LASTPOSTUSER = $thread_info['lastpost_username']; // $lastpost_name;
|
||||||
|
|
||||||
|
$thread_info['thread_sef'] = eHelper::title2sef($thread_info['thread_name'],'dashl');
|
||||||
|
|
||||||
$urlData = array('forum_sef'=>$thread_info['forum_sef'], 'thread_id'=>$thread_info['thread_id'],'thread_sef'=>$thread_info['thread_sef']);
|
$urlData = array('forum_sef'=>$thread_info['forum_sef'], 'thread_id'=>$thread_info['thread_id'],'thread_sef'=>$thread_info['thread_sef']);
|
||||||
$url = e107::url('forum', 'topic', $urlData);
|
$url = e107::url('forum', 'topic', $urlData);
|
||||||
$url .= (strpos($url,'?')!==false) ? '&' : '?';
|
$url .= (strpos($url,'?')!==false) ? '&' : '?';
|
||||||
@@ -534,6 +536,7 @@ function parse_thread($thread_info)
|
|||||||
|
|
||||||
// $url = e107::getUrl()->create('forum/thread/view', array('id' => $threadId, 'name' => $thread_name));
|
// $url = e107::getUrl()->create('forum/thread/view', array('id' => $threadId, 'name' => $thread_name));
|
||||||
|
|
||||||
|
$thread_info['thread_sef'] = eHelper::title2sef($thread_info['thread_name'],'dashl');
|
||||||
$url = e107::url('forum','topic', $thread_info);
|
$url = e107::url('forum','topic', $thread_info);
|
||||||
$tVars->THREADNAME = "<a {$title} href='".$url."'>{$thread_name}</a>";
|
$tVars->THREADNAME = "<a {$title} href='".$url."'>{$thread_name}</a>";
|
||||||
|
|
||||||
@@ -793,6 +796,7 @@ function fpages($thread_info, $replies)
|
|||||||
global $forum;
|
global $forum;
|
||||||
|
|
||||||
$pages = ceil(($replies)/$forum->prefs->get('postspage'));
|
$pages = ceil(($replies)/$forum->prefs->get('postspage'));
|
||||||
|
$thread_info['thread_sef'] = eHelper::title2sef($thread_info['thread_name'],'dashl');
|
||||||
$urlparms = $thread_info;
|
$urlparms = $thread_info;
|
||||||
|
|
||||||
if ($pages > 1)
|
if ($pages > 1)
|
||||||
|
@@ -86,7 +86,7 @@ $FORUM_TEMPLATE['main-start'] = "{FORUM_BREADCRUMB}
|
|||||||
{SEARCH}
|
{SEARCH}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div >
|
<div id='forum' >
|
||||||
<table class='table table-striped table-bordered table-hover'>
|
<table class='table table-striped table-bordered table-hover'>
|
||||||
<colgroup>
|
<colgroup>
|
||||||
<col style='width:3%' />
|
<col style='width:3%' />
|
||||||
@@ -115,7 +115,8 @@ $FORUM_TEMPLATE['main-forum'] = "<tr>
|
|||||||
<td class='hidden-xs'><small>{LASTPOSTUSER} {LASTPOSTDATE}</small></td>
|
<td class='hidden-xs'><small>{LASTPOSTUSER} {LASTPOSTDATE}</small></td>
|
||||||
</tr>";
|
</tr>";
|
||||||
|
|
||||||
$FORUM_TEMPLATE['main-end'] = "</table></div>";
|
$FORUM_TEMPLATE['main-end'] = "</table><div class='center'><small>{USERINFOX}</small></div></div>";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$FORUM_TEMPLATE['main-end'] .= "
|
$FORUM_TEMPLATE['main-end'] .= "
|
||||||
|
|
||||||
|
32
top.php
32
top.php
@@ -72,18 +72,18 @@ if ($action == 'active')
|
|||||||
{$from}, {$view}
|
{$from}, {$view}
|
||||||
";
|
";
|
||||||
|
|
||||||
if ($sql->db_Select_gen($qry))
|
if ($sql->gen($qry))
|
||||||
{
|
{
|
||||||
$text = "<div style='text-align:center'>\n<table style='width:auto' class='fborder'>\n";
|
$text = "<div>\n<table style='width:auto' class='table fborder'>\n";
|
||||||
$gen = e107::getDateConvert();
|
$gen = e107::gethateConvert();
|
||||||
|
|
||||||
$text .= "<tr>
|
$text .= "<tr>
|
||||||
<td style='width:5%' class='forumheader'> </td>
|
<th style='width:5%' class='forumheader'> </th>
|
||||||
<td style='width:45%' class='forumheader'>".LAN_1."</td>
|
<th style='width:45%' class='forumheader'>".LAN_1."</th>
|
||||||
<td style='width:15%; text-align:center' class='forumheader'>".LAN_2."</td>
|
<th style='width:15%; text-align:center' class='forumheader'>".LAN_2."</th>
|
||||||
<td style='width:5%; text-align:center' class='forumheader'>".LAN_3."</td>
|
<th style='width:5%; text-align:center' class='forumheader'>".LAN_3."</th>
|
||||||
<td style='width:5%; text-align:center' class='forumheader'>".LAN_4."</td>
|
<th style='width:5%; text-align:center' class='forumheader'>".LAN_4."</th>
|
||||||
<td style='width:25%; text-align:center' class='forumheader'>".LAN_5."</td>
|
<th style='width:25%; text-align:center' class='forumheader'>".LAN_5."</th>
|
||||||
</tr>\n";
|
</tr>\n";
|
||||||
|
|
||||||
while ($row = $sql->db_Fetch(MYSQL_ASSOC))
|
while ($row = $sql->db_Fetch(MYSQL_ASSOC))
|
||||||
@@ -155,17 +155,17 @@ if ($action == 'top')
|
|||||||
";
|
";
|
||||||
// $top_forum_posters = $sql->db_Select("user", "*", "`user_forums` > 0 ORDER BY user_forums DESC LIMIT ".$from.", ".$view."");
|
// $top_forum_posters = $sql->db_Select("user", "*", "`user_forums` > 0 ORDER BY user_forums DESC LIMIT ".$from.", ".$view."");
|
||||||
$text = "
|
$text = "
|
||||||
<div style='text-align:center'>
|
<div>
|
||||||
<table style='width:95%' class='fborder'>
|
<table style='width:95%' class='table table-striped fborder'>
|
||||||
<tr>
|
<tr>
|
||||||
<td style='width:10%; text-align:center' class='forumheader3'> </td>
|
<th style='width:10%; text-align:center' class='forumheader3'> </th>
|
||||||
<td style='width:50%' class='forumheader3'>".TOP_LAN_1."</td>
|
<th style='width:50%' class='forumheader3'>".TOP_LAN_1."</th>
|
||||||
<td style='width:10%; text-align:center' class='forumheader3'>".TOP_LAN_2."</td>
|
<th style='width:10%; text-align:center' class='forumheader3'>".TOP_LAN_2."</th>
|
||||||
<td style='width:30%; text-align:center' class='forumheader3'>".TOP_LAN_6."</td>
|
<th style='width:30%; text-align:center' class='forumheader3'>".TOP_LAN_6."</th>
|
||||||
</tr>\n";
|
</tr>\n";
|
||||||
$counter = 1 + $from;
|
$counter = 1 + $from;
|
||||||
$sql2 = e107::getDb('sql2');
|
$sql2 = e107::getDb('sql2');
|
||||||
if ($sql2->db_Select_gen($qry))
|
if ($sql2->gen($qry))
|
||||||
{
|
{
|
||||||
while ($row = $sql2->db_Fetch(MYSQL_ASSOC))
|
while ($row = $sql2->db_Fetch(MYSQL_ASSOC))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user