mirror of
https://github.com/e107inc/e107.git
synced 2025-08-11 17:14:42 +02:00
Merge branch 'e107inc:master' into rica-carv-forumtrack_new_shortcodes
This commit is contained in:
@@ -57,5 +57,7 @@ CREATE TABLE blank (
|
||||
`blank_url` varchar(255) NOT NULL,
|
||||
`blank_media` json DEFAULT NULL,
|
||||
`blank_class` int(10) NOT NULL,
|
||||
PRIMARY KEY (`blank_id`)
|
||||
PRIMARY KEY (`blank_id`),
|
||||
FULLTEXT (`blank_name`),
|
||||
FULLTEXT (`blank_folder`)
|
||||
) ENGINE=MyISAM;
|
||||
|
@@ -29,8 +29,8 @@ class _blank_search extends e_search // include plugin-folder in the name.
|
||||
'author'=> array('type' => 'author', 'text' => LAN_SEARCH_61)
|
||||
),
|
||||
|
||||
'return_fields' => array('blank_id', 'blank_nick', 'blank_message', 'blank_datestamp'),
|
||||
'search_fields' => array('blank_nick' => '1', 'blank_message' => '1'), // fields and weights.
|
||||
'return_fields' => array('blank_id', 'blank_name', 'blank_folder', 'blank_datestamp'),
|
||||
'search_fields' => array('blank_name' => '1', 'blank_folder' => '1'), // fields and weights.
|
||||
|
||||
'order' => array('blank_datestamp' => 'DESC'),
|
||||
'refpage' => 'chat.php'
|
||||
|
@@ -5,5 +5,7 @@ CREATE TABLE chatbox (
|
||||
cb_datestamp int(10) unsigned NOT NULL default '0',
|
||||
cb_blocked tinyint(3) unsigned NOT NULL default '0',
|
||||
cb_ip varchar(45) NOT NULL default '',
|
||||
FULLTEXT (cb_nick),
|
||||
FULLTEXT (cb_message),
|
||||
PRIMARY KEY (cb_id)
|
||||
) ENGINE=MyISAM;
|
@@ -25,7 +25,11 @@ CREATE TABLE download (
|
||||
download_visible varchar(255) NOT NULL default '0',
|
||||
PRIMARY KEY (download_id),
|
||||
UNIQUE KEY download_name (download_name),
|
||||
KEY download_category (download_category)
|
||||
KEY download_category (download_category),
|
||||
FULLTEXT (download_url),
|
||||
FULLTEXT (download_description),
|
||||
FULLTEXT (download_author),
|
||||
FULLTEXT (download_author_website)
|
||||
) ENGINE=MyISAM;
|
||||
# --------------------------------------------------------
|
||||
|
||||
|
@@ -9,7 +9,10 @@ CREATE TABLE faqs (
|
||||
faq_author_ip varchar(45) NOT NULL default '',
|
||||
faq_tags varchar(255) NOT NULL default '',
|
||||
faq_order int(6) unsigned NOT NULL default '0',
|
||||
PRIMARY KEY (faq_id)
|
||||
PRIMARY KEY (faq_id),
|
||||
FULLTEXT (faq_question),
|
||||
FULLTEXT (faq_answer),
|
||||
FULLTEXT (faq_tags)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE TABLE faqs_info (
|
||||
@@ -23,6 +26,7 @@ CREATE TABLE faqs_info (
|
||||
faq_info_metad varchar(255) NOT NULL default '',
|
||||
faq_info_metak varchar(255) NOT NULL default '',
|
||||
faq_info_sef varchar(255) NOT NULL default '',
|
||||
PRIMARY KEY (faq_info_id)
|
||||
PRIMARY KEY (faq_info_id),
|
||||
FULLTEXT (faq_info_title)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
|
@@ -43,7 +43,8 @@ CREATE TABLE forum_thread (
|
||||
PRIMARY KEY (`thread_id`),
|
||||
KEY `thread_forum_id` (`thread_forum_id`),
|
||||
KEY `thread_sticky` (`thread_sticky`),
|
||||
KEY `thread_lastpost` (`thread_lastpost`)
|
||||
KEY `thread_lastpost` (`thread_lastpost`),
|
||||
FULLTEXT (`thread_name`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE forum_post (
|
||||
@@ -65,7 +66,8 @@ CREATE TABLE forum_post (
|
||||
KEY `post_thread` (`post_thread`),
|
||||
KEY `post_forum` (`post_forum`),
|
||||
KEY `post_datestamp` (`post_datestamp`),
|
||||
KEY `post_user` (`post_user`)
|
||||
KEY `post_user` (`post_user`),
|
||||
FULLTEXT (`post_entry`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE forum_track (
|
||||
|
@@ -14,8 +14,6 @@ e107::lan('forum','menu',true); // English_menu.php or {LANGUAGE}_menu.php
|
||||
|
||||
include_once(e_PLUGIN.'forum/forum_class.php');
|
||||
|
||||
|
||||
|
||||
if(!class_exists('forum_newforumposts_menu'))
|
||||
{
|
||||
class forum_newforumposts_menu // plugin folder + menu name (without the .php)
|
||||
@@ -31,8 +29,21 @@ if(!class_exists('forum_newforumposts_menu'))
|
||||
function __construct()
|
||||
{
|
||||
$this->plugPref = e107::pref('forum'); // general forum preferences.
|
||||
$this->menuPref = e107::getMenu()->pref();// ie. popup config details from within menu-manager.
|
||||
$this->forumObj = new e107forum;
|
||||
// $this->menuPref = e107::getMenu()->pref();// ie. popup config details from within menu-manager.
|
||||
$menuPrefs = e107::getMenu()->pref();// ie. popup config details from within menu-manager.
|
||||
$this->forumObj = new e107forum;
|
||||
|
||||
if(is_string($menuPrefs))
|
||||
{
|
||||
parse_str($menuPrefs, $this->menuPref);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->menuPref = $menuPrefs;
|
||||
}
|
||||
|
||||
// echo "<hr><hr><hr>";
|
||||
// var_dump($this->menuPref);
|
||||
|
||||
// Set some defaults ...
|
||||
if (!isset($this->menuPref['title'])) $this->menuPref['title'] = "";
|
||||
@@ -43,8 +54,10 @@ if(!class_exists('forum_newforumposts_menu'))
|
||||
if (!isset($this->menuPref['scroll'])) $this->menuPref['scroll'] = "";
|
||||
if (empty($this->menuPref['layout'])) $this->menuPref['layout'] = 'default';
|
||||
|
||||
$this->cacheTag .= "_".$this->menuPref['layout'];
|
||||
// echo "<hr><hr><hr>";
|
||||
// var_dump($this->menuPref);
|
||||
|
||||
$this->cacheTag .= "_".$this->menuPref['layout'];
|
||||
|
||||
if($text = e107::getCache()->retrieve($this->cacheTag, $this->cacheTime, true))
|
||||
{
|
||||
@@ -54,6 +67,7 @@ if(!class_exists('forum_newforumposts_menu'))
|
||||
return null;
|
||||
}
|
||||
|
||||
/*
|
||||
$sql = e107::getDb();
|
||||
|
||||
$this->total['topics'] = $sql->count("forum_thread");
|
||||
@@ -64,14 +78,11 @@ if(!class_exists('forum_newforumposts_menu'))
|
||||
$tmp = $sql->fetch();
|
||||
$this->total['views'] = intval($tmp["sum"]);
|
||||
}
|
||||
|
||||
*/
|
||||
$this->render();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private function getQuery()
|
||||
{
|
||||
$max_age = vartrue($this->menuPref['maxage'], 0);
|
||||
@@ -86,7 +97,6 @@ if(!class_exists('forum_newforumposts_menu'))
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$this->menuPref['layout'] = vartrue($this->menuPref['layout'], 'default');
|
||||
switch($this->menuPref['layout'])
|
||||
{
|
||||
@@ -132,11 +142,9 @@ if(!class_exists('forum_newforumposts_menu'))
|
||||
ORDER BY t.thread_lastpost DESC LIMIT 0, ".vartrue($this->menuPref['display'],10);
|
||||
}
|
||||
|
||||
|
||||
return $qry;
|
||||
}
|
||||
|
||||
|
||||
private function render()
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
@@ -164,9 +172,6 @@ if(!class_exists('forum_newforumposts_menu'))
|
||||
|
||||
$template = e107::getTemplate('forum','newforumposts_menu',$layout);
|
||||
|
||||
|
||||
|
||||
|
||||
$param = array();
|
||||
|
||||
foreach($this->menuPref as $k=>$v)
|
||||
@@ -174,7 +179,6 @@ if(!class_exists('forum_newforumposts_menu'))
|
||||
$param['nfp_'.$k] = $v;
|
||||
}
|
||||
|
||||
|
||||
if($qry)
|
||||
{
|
||||
if($results = $sql->gen($qry))
|
||||
@@ -186,22 +190,34 @@ if(!class_exists('forum_newforumposts_menu'))
|
||||
|
||||
$sc = e107::getScBatch('view', 'forum')->setScVar('param',$param);
|
||||
|
||||
$list = $tp->parseTemplate($template['start'], true);
|
||||
// $list = $tp->parseTemplate($template['start'], true);
|
||||
$text = $tp->parseTemplate($template['start'], true);
|
||||
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
// var_dump ($row);
|
||||
// echo "<hr>";
|
||||
|
||||
$row['thread_sef'] = $this->forumObj->getThreadSef($row);
|
||||
|
||||
$sc->setScVar('postInfo', $row);
|
||||
$sc->setVars($row);
|
||||
$list .= $tp->parseTemplate($template['item'], true, $sc);
|
||||
// $list .= $tp->parseTemplate($template['item'], true, $sc);
|
||||
$text .= $tp->parseTemplate($template['item'], true, $sc);
|
||||
|
||||
++$total_topics;
|
||||
$total_views += $row['thread_views'];
|
||||
$total_replies += $row['thread_total_replies'];
|
||||
|
||||
}
|
||||
|
||||
$TOTALS = array('TOTAL_TOPICS'=>$this->total['topics'], 'TOTAL_VIEWS'=>$this->total['views'], 'TOTAL_REPLIES'=>$this->total['replies']);
|
||||
// $TOTALS = array('TOTAL_TOPICS'=>$this->total['topics'], 'TOTAL_VIEWS'=>$this->total['views'], 'TOTAL_REPLIES'=>$this->total['replies']);
|
||||
$TOTALS = array('TOTAL_TOPICS'=>$total_topics, 'TOTAL_VIEWS'=>$total_views, 'TOTAL_REPLIES'=>$total_replies);
|
||||
|
||||
$list .= $tp->parseTemplate($template['end'], true, $TOTALS);
|
||||
|
||||
$text = $list;
|
||||
// $list .= $tp->parseTemplate($template['end'], true, $TOTALS);
|
||||
$text .= $tp->parseTemplate($template['end'], true, $TOTALS);
|
||||
//
|
||||
// $text = $list;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -212,7 +228,7 @@ if(!class_exists('forum_newforumposts_menu'))
|
||||
{
|
||||
$text = LAN_FORUM_MENU_016;
|
||||
}
|
||||
|
||||
//var_dump ($text);
|
||||
$caption = $this->getCaption();
|
||||
|
||||
if(!empty($this->menuPref['scroll']))
|
||||
@@ -221,7 +237,6 @@ if(!class_exists('forum_newforumposts_menu'))
|
||||
}
|
||||
// e107::debug('menuPref', $this->menuPref);
|
||||
|
||||
|
||||
e107::getCache()->set($this->cacheTag, $text, true);
|
||||
|
||||
$ns->tablerender($caption, $text, 'nfp_menu');
|
||||
@@ -252,7 +267,6 @@ if(!class_exists('forum_newforumposts_menu'))
|
||||
//$caption = !empty($this->menuPref['caption'][e_LANGUAGE]) ? $this->menuPref['caption'][e_LANGUAGE] : $this->menuPref['caption'];
|
||||
}
|
||||
|
||||
|
||||
if (empty($caption))
|
||||
{
|
||||
$caption = LAN_PLUGIN_FORUM_LATESTPOSTS;
|
||||
@@ -261,14 +275,8 @@ if(!class_exists('forum_newforumposts_menu'))
|
||||
return $caption;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
new forum_newforumposts_menu;
|
||||
|
||||
|
||||
|
||||
new forum_newforumposts_menu;
|
@@ -185,7 +185,7 @@ class forum_shortcodes extends e_shortcode
|
||||
|
||||
}
|
||||
// String candidate for USERLIST wrapper
|
||||
$text .= "<br /><a rel='external' href='".e_BASE."online.php'>".LAN_FORUM_0037."</a> ".LAN_FORUM_0038;
|
||||
$text .= "<br /><a rel='external' href='".e_HTTP."online.php'>".LAN_FORUM_0037."</a> ".LAN_FORUM_0038;
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
@@ -154,18 +154,26 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
|
||||
function sc_topic_views($parm = null)
|
||||
{
|
||||
|
||||
$val = ($this->var['thread_views']) ? $this->var['thread_views'] : '0';
|
||||
|
||||
|
||||
if(!empty($parm['raw']))
|
||||
{
|
||||
return $val;
|
||||
}
|
||||
|
||||
return e107::getParser()->toBadge($val);
|
||||
}
|
||||
|
||||
|
||||
function sc_topic_replies($parm = null)
|
||||
{
|
||||
|
||||
$val = ($this->var['thread_total_replies']) ? $this->var['thread_total_replies'] : '0';
|
||||
|
||||
if(!empty($parm['raw']))
|
||||
{
|
||||
return $val;
|
||||
}
|
||||
|
||||
return e107::getParser()->toBadge($val);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user