mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Forum code formatting and cleanup.
This commit is contained in:
@@ -28,34 +28,42 @@ class forum_shortcodes extends e_shortcode
|
||||
{
|
||||
return LAN_FORUM_0002;
|
||||
}
|
||||
|
||||
function sc_replytitle()
|
||||
{
|
||||
return LAN_FORUM_0003;
|
||||
}
|
||||
|
||||
function sc_lastpostitle()
|
||||
{
|
||||
return LAN_FORUM_0004;
|
||||
}
|
||||
|
||||
function sc_infotitle()
|
||||
{
|
||||
return LAN_FORUM_0009;
|
||||
}
|
||||
|
||||
function sc_newthreadtitle()
|
||||
{
|
||||
return LAN_FORUM_0075;
|
||||
}
|
||||
|
||||
function sc_postedtitle()
|
||||
{
|
||||
return LAN_FORUM_0074;
|
||||
}
|
||||
|
||||
function sc_tracktitle()
|
||||
{
|
||||
return LAN_FORUM_0073;
|
||||
}
|
||||
|
||||
function sc_statlink()
|
||||
{
|
||||
return "<a href='".e_PLUGIN."forum/forum_stats.php'>".LAN_FORUM_0017."</a>\n";
|
||||
}
|
||||
|
||||
function sc_iconkey()
|
||||
{
|
||||
return "
|
||||
@@ -74,6 +82,7 @@ class forum_shortcodes extends e_shortcode
|
||||
{
|
||||
return IMAGE_e;
|
||||
}
|
||||
|
||||
function sc_newimage()
|
||||
{
|
||||
return IMAGE_new_small;
|
||||
@@ -120,6 +129,7 @@ if(!empty($trackPref))
|
||||
{
|
||||
$uInfo[2] = "<a href='".e107::url('forum','track')."'>".LAN_FORUM_0030."</a>";
|
||||
}
|
||||
|
||||
return implode(" | ",$uInfo);
|
||||
}
|
||||
|
||||
@@ -142,6 +152,7 @@ if(!empty($trackPref))
|
||||
$c ++;
|
||||
$text .= "<a href='".e_HTTP."user.php ?id.$oid'>$oname</a>".($c == MEMBERS_ONLINE ? "." :", ");
|
||||
}
|
||||
|
||||
}
|
||||
// String candidate for USERLIST wrapper
|
||||
$text .= "<br /><a rel='external' href='".e_BASE."online.php'>".LAN_FORUM_0037."</a> ".LAN_FORUM_0038;
|
||||
@@ -151,7 +162,7 @@ if(!empty($trackPref))
|
||||
|
||||
function sc_search()
|
||||
{
|
||||
// $tp = e107::getParser();
|
||||
|
||||
if(!$srchIcon = e107::getParser()->toGlyph('fa-search'))
|
||||
{
|
||||
$srchIcon = LAN_SEARCH;
|
||||
@@ -296,9 +307,9 @@ if(!defined('e_TRACKING_DISABLED'))
|
||||
return str_replace("[x]", ($total_topics+$total_replies), LAN_FORUM_0031)." ($total_topics ".($total_topics == 1 ? LAN_FORUM_0032 : LAN_FORUM_0033).", $total_replies ".($total_replies == 1 ? LAN_FORUM_0034 : LAN_FORUM_0035).")
|
||||
".(!defined("e_TRACKING_DISABLED") ? "" : "<br />".$users." ".($users == 1 ? LAN_FORUM_0059 : LAN_FORUM_0060)." (".$member_users." ".($member_users == 1 ? LAN_FORUM_0061 : LAN_FORUM_0062).", ".$guest_users." ".($guest_users == 1 ? LAN_FORUM_0063 : LAN_FORUM_0064).")<br />".LAN_FORUM_0066." ".$total_members."<br />".LAN_FORUM_0065." <a href='".e_HTTP."user.php ?id.".$nuser_id."'>".$nuser_name."</a>.\n"); // FIXME cannot find other references to e_TRACKING_DISABLED, use pref?
|
||||
}
|
||||
// END OF $FVARS
|
||||
|
||||
// START OF $PVARS
|
||||
|
||||
|
||||
function sc_parentstatus()
|
||||
{
|
||||
//---- return $this->parentstatus;
|
||||
@@ -309,18 +320,15 @@ return str_replace("[x]", ($total_topics+$total_replies), LAN_FORUM_0031)." ($to
|
||||
}
|
||||
return vartrue($status);
|
||||
}
|
||||
|
||||
function sc_parentname()
|
||||
{
|
||||
//---- return $this->parentname;
|
||||
// return $this->fparent['forum_name'];
|
||||
return $this->var['forum_name'];
|
||||
}
|
||||
// END OF $PVARS
|
||||
|
||||
// Function to show the retrieval of parent ID, not really needed by core template
|
||||
function sc_parentid()
|
||||
{
|
||||
//---- return $this->parentname;
|
||||
// return $this->fparent['forum_id'];
|
||||
return $this->var['forum_id'];
|
||||
}
|
||||
|
||||
@@ -329,7 +337,7 @@ return str_replace("[x]", ($total_topics+$total_replies), LAN_FORUM_0031)." ($to
|
||||
function sc_newflag()
|
||||
{
|
||||
global $newflag_list;
|
||||
// $e107 = e107::getInstance();
|
||||
|
||||
|
||||
if(USER && is_array($newflag_list) && in_array($this->var['forum_id'], $newflag_list))
|
||||
{
|
||||
@@ -340,11 +348,11 @@ return str_replace("[x]", ($total_topics+$total_replies), LAN_FORUM_0031)." ($to
|
||||
{
|
||||
return IMAGE_noreplies;
|
||||
}
|
||||
//---- else
|
||||
//---- {
|
||||
|
||||
return IMAGE_nonew;
|
||||
//---- }
|
||||
|
||||
}
|
||||
|
||||
function sc_forumname()
|
||||
{
|
||||
// global $f;
|
||||
@@ -357,7 +365,9 @@ return str_replace("[x]", ($total_topics+$total_replies), LAN_FORUM_0031)." ($to
|
||||
|
||||
$url = e107::url('forum', 'forum', $this->var);
|
||||
return "<a href='".$url."'>{$this->var['forum_name']}</a>";
|
||||
|
||||
}
|
||||
|
||||
function sc_forumdescription()
|
||||
{
|
||||
// global $f, $restricted_string;
|
||||
@@ -366,32 +376,38 @@ return str_replace("[x]", ($total_topics+$total_replies), LAN_FORUM_0031)." ($to
|
||||
$this->var['forum_description'] = e107::getParser()->toHTML($this->var['forum_description'], true, 'no_hook');
|
||||
return $this->var['forum_description'].($restricted_string ? "<br /><span class='smalltext'><i>$restricted_string</i></span>" : "");
|
||||
}
|
||||
|
||||
function sc_threads()
|
||||
{
|
||||
return $this->var['forum_threads'];
|
||||
}
|
||||
|
||||
function sc_replies()
|
||||
{
|
||||
return $this->var['forum_replies'];
|
||||
}
|
||||
|
||||
function sc_threadsx()
|
||||
{
|
||||
// global $f;
|
||||
// return "<span class='badge ".(($f['forum_threads']) ? "badge-info" : "")."'>".$f['forum_threads']."</span>";
|
||||
return "<span class='badge ".(($this->var['forum_threads']) ? "badge-info" : "")."'>".$this->var['forum_threads']."</span>";
|
||||
}
|
||||
|
||||
function sc_repliesx()
|
||||
{
|
||||
// global $f;
|
||||
// return "<span class='badge ".(($f['forum_replies']) ? "badge-info" : "")."'>".$f['forum_replies']."</span>";
|
||||
return "<span class='badge ".(($this->var['forum_replies']) ? "badge-info" : "")."'>".$this->var['forum_replies']."</span>";
|
||||
}
|
||||
|
||||
function sc_forumsubforums()
|
||||
{
|
||||
// VAR_DUMP ($this->ret);
|
||||
// return ($this->ret)?"<br /><div class='smalltext'>".LAN_FORUM_0069.": {$this->ret['text']}</div>":"";
|
||||
return ($this->var['text'])?"<br /><div class='smalltext'>".LAN_FORUM_0069.": {$this->var['text']}</div>":"";
|
||||
}
|
||||
|
||||
function sc_lastpostuser()
|
||||
{
|
||||
// global $f;
|
||||
@@ -411,7 +427,7 @@ return str_replace("[x]", ($total_topics+$total_replies), LAN_FORUM_0031)." ($to
|
||||
{
|
||||
|
||||
// $lastpost_name = "<a href='".$e107->url->create('user/profile/view', array('name' => $f['user_name'], 'id' => $f['forum_lastpost_user']))."'>{$f['user_name']}</a>";
|
||||
$lastpost_name = "<a href='".e107::getInstance()->url->create('user/profile/view', array('name' => $this->var['user_name'], 'id' => $this->var['forum_lastpost_user']))."'>{$this->var['user_name']}</a>";
|
||||
$lastpost_name = "<a href='".e107::getUrl()->create('user/profile/view', array('name' => $this->var['user_name'], 'id' => $this->var['forum_lastpost_user']))."'>{$this->var['user_name']}</a>";
|
||||
}
|
||||
//---- else
|
||||
//---- {
|
||||
@@ -482,9 +498,8 @@ $gen = new convert;
|
||||
}
|
||||
function sc_lastpost()
|
||||
{
|
||||
// global $f;
|
||||
|
||||
$e107 = e107::getInstance();
|
||||
// $tp = e107::getParser();
|
||||
$gen = new convert;
|
||||
|
||||
// if ($f['forum_lastpost_info'])
|
||||
@@ -496,11 +511,11 @@ $gen = new convert;
|
||||
// $lastpost_name = e107::getParser()->toHTML($f['forum_lastpost_user_anon']);
|
||||
// if ($f['user_name'])
|
||||
$lastpost_name = e107::getParser()->toHTML($this->var['forum_lastpost_user_anon']);
|
||||
|
||||
if ($this->var['user_name'])
|
||||
{
|
||||
|
||||
// $lastpost_name = "<a href='".$e107->url->create('user/profile/view', array('name' => $f['user_name'], 'id' => $f['forum_lastpost_user']))."'>{$f['user_name']}</a>";
|
||||
$lastpost_name = "<a href='".$e107->url->create('user/profile/view', array('name' => $this->var['user_name'], 'id' => $this->var['forum_lastpost_user']))."'>{$this->var['user_name']}</a>";
|
||||
$lastpost_name = "<a href='".e107::getUrl()->create('user/profile/view', array('name' => $this->var['user_name'], 'id' => $this->var['forum_lastpost_user']))."'>{$this->var['user_name']}</a>";
|
||||
}
|
||||
//---- else
|
||||
//---- {
|
||||
@@ -526,9 +541,8 @@ $gen = new convert;
|
||||
return '-';
|
||||
//---- }
|
||||
}
|
||||
// END OF parse_forum function $FVARS
|
||||
|
||||
// START OF $NVARS
|
||||
|
||||
function sc_startertitle()
|
||||
{
|
||||
// global $thread;
|
||||
@@ -548,9 +562,10 @@ $gen = new convert;
|
||||
//---- {
|
||||
// $e107 = e107::getInstance();
|
||||
// return "<a href='".$e107->url->create('user/profile/view', array('id' => $thread['thread_lastuser'], 'name' => $sc->author_name))."'>{$sc->author_name}</a><br />".$sc->datestamp;
|
||||
return "<a href='".e107::getInstance()->url->create('user/profile/view', array('id' => $this->var['thread_lastuser'], 'name' => $author_name))."'>{$author_name}</a><br />".$datestamp;
|
||||
return "<a href='".e107::getUrl()->create('user/profile/view', array('id' => $this->var['thread_lastuser'], 'name' => $author_name))."'>{$author_name}</a><br />".$datestamp;
|
||||
//---- }
|
||||
}
|
||||
|
||||
function sc_newspostname()
|
||||
{
|
||||
// global $thread;
|
||||
@@ -559,7 +574,7 @@ $gen = new convert;
|
||||
|
||||
// return empty($thread)?LAN_FORUM_0029:"<a href='".$e107->url->create('forum/thread/last', $thread)."'>".$tp->toHTML($thread['thread_name'], TRUE, 'no_make_clickable, no_hook').'</a>';
|
||||
// Only $this->var???'
|
||||
return empty($this->var)?LAN_FORUM_0029:"<a href='".e107::getInstance()->url->create('forum/thread/last', $this->var)."'>".e107::getParser()->toHTML($this->var['thread_name'], TRUE, 'no_make_clickable, no_hook').'</a>';
|
||||
return empty($this->var)?LAN_FORUM_0029:"<a href='".e107::getUrl()->create('forum/thread/last', $this->var)."'>".e107::getParser()->toHTML($this->var['thread_name'], TRUE, 'no_make_clickable, no_hook').'</a>';
|
||||
}
|
||||
// END OF $NVARS
|
||||
|
||||
@@ -572,4 +587,3 @@ return $frm->breadcrumb($breadarray);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user