mirror of
https://github.com/e107inc/e107.git
synced 2025-08-13 01:54:12 +02:00
#220 - First batch of forum LAN rewrite: forum, viewforum, viewtopic and post are done. Work in progress! (#6)
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Forum plugin - post shortcodess
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
class plugin_forum_post_shortcodes extends e_shortcode
|
||||
@@ -71,7 +78,7 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
||||
function sc_posttype()
|
||||
{
|
||||
global $action;
|
||||
return ($action == 'nt' ? LAN_63 : LAN_73);
|
||||
return ($action == 'nt' ? LAN_FORUM_2015 : LAN_FORUM_2006);
|
||||
}
|
||||
|
||||
function sc_postbox()
|
||||
@@ -92,14 +99,14 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
||||
function sc_buttons()
|
||||
{
|
||||
global $action, $eaction;
|
||||
$ret = "<input class='btn button' type='submit' name='fpreview' value='".LAN_323."' /> ";
|
||||
$ret = "<input class='btn button' type='submit' name='fpreview' value='".LAN_FORUM_3005."' /> ";
|
||||
if ($action != 'nt')
|
||||
{
|
||||
$ret .= ($eaction ? "<input class='btn btn-primary button' type='submit' name='update_reply' value='".LAN_78."' />" : "<input class='btn btn-primary button' type='submit' name='reply' value='".LAN_74."' />");
|
||||
$ret .= ($eaction ? "<input class='btn btn-primary button' type='submit' name='update_reply' value='".LAN_FORUM_3024."' />" : "<input class='btn btn-primary button' type='submit' name='reply' value='".LAN_FORUM_2006."' />");
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret .= ($eaction ? "<input class='btn button btn-primary' type='submit' name='update_thread' value='".LAN_77."' />" : "<input class='btn btn-primary button' type='submit' name='newthread' value='".LAN_64."' />");
|
||||
$ret .= ($eaction ? "<input class='btn button btn-primary' type='submit' name='update_thread' value='".LAN_FORUM_3023."' />" : "<input class='btn btn-primary button' type='submit' name='newthread' value='".LAN_FORUM_2005."' />");
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
@@ -121,7 +128,7 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
||||
{
|
||||
if(!$fileattach_alert)
|
||||
{
|
||||
$fileattach_alert = "<tr><td colspan='2' class='nforumcaption2'>".(e107::getPref('image_post') ? LAN_390 : LAN_416)."</td></tr><tr><td colspan='2' class='forumheader3'>".LAN_FORUM_1."</td></tr>\n";
|
||||
$fileattach_alert = "<tr><td colspan='2' class='nforumcaption2'>".(e107::getPref('image_post') ? LAN_FORUM_3012 : LAN_FORUM_3013)."</td></tr><tr><td colspan='2' class='forumheader3'>".str_replace('[x]', e_FILE."public", LAN_FORUM_3021)."</td></tr>\n";
|
||||
}
|
||||
return $fileattach_alert;
|
||||
}
|
||||
@@ -137,19 +144,17 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
||||
|
||||
//. <div>".($pref['image_post'] ? "Attach file / image" : "Attach file")."</div>
|
||||
|
||||
$tooltip = "Allowed file types | ".vartrue($allowed_filetypes).". Any other file type will be deleted instantly.
|
||||
Maximum file size: ".(vartrue($max_upload_size) ? $max_upload_size."bytes" : ini_get('upload_max_filesize'));
|
||||
|
||||
//$tooltip = "Allowed file types | ".vartrue($allowed_filetypes).". Any other file type will be deleted instantly. Maximum file size: ".(vartrue($max_upload_size) ? $max_upload_size."bytes" : ini_get('upload_max_filesize'));
|
||||
$tooltip = LAN_FORUM_3016.": ".vartrue($allowed_filetypes)." <br />".LAN_FORUM_3017."<br />".LAN_FORUM_3018.": ".(vartrue($max_upload_size) ? $max_upload_size." ".LAN_FORUM_3019 : ini_get('upload_max_filesize')); // FIXME <br /> in tooltip, no value $allowed_filetypes on v2/bootstrap
|
||||
|
||||
$fileattach = "
|
||||
|
||||
|
||||
<div>
|
||||
<div id='fiupsection'>
|
||||
<span id='fiupopt'>
|
||||
<input class='tbox e-tip' title=\"".$tooltip."\" name='file_userfile[]' type='file' size='47' />
|
||||
</span>
|
||||
</div>
|
||||
<input class='btn button' type='button' name='addoption' value=\"Add Another\" onclick=\"duplicateHTML('fiupopt','fiupsection')\" />
|
||||
<input class='btn button' type='button' name='addoption' value=".LAN_FORUM_3020." onclick=\"duplicateHTML('fiupopt','fiupsection')\" />
|
||||
</div>
|
||||
|
||||
";
|
||||
@@ -169,17 +174,17 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
||||
|
||||
$text = "
|
||||
<ul class='nav nav-tabs'>
|
||||
<li class='active'><a href='#type' data-toggle='tab'>Type</a></li>";
|
||||
<li class='active'><a href='#type' data-toggle='tab'>".LAN_FORUM_3025."</a></li>";
|
||||
|
||||
$text .= ($poll) ? "<li><a href='#poll' data-toggle='tab'>Poll</a></li>\n" : "";
|
||||
$text .= ($attach) ? "<li><a href='#attach' data-toggle='tab'>Attachment</a></li>\n" : "";
|
||||
$text .= ($poll) ? "<li><a href='#poll' data-toggle='tab'>".LAN_FORUM_1016."</a></li>\n" : "";
|
||||
$text .= ($attach) ? "<li><a href='#attach' data-toggle='tab'>".LAN_FORUM_3012."</a></li>\n" : "";
|
||||
|
||||
$text .= "
|
||||
</ul>
|
||||
<div class='tab-content text-left'>
|
||||
<div class='tab-pane active' id='type'>
|
||||
<div class='control-group'>
|
||||
<label class='control-label'>Post thread as:</label>
|
||||
<label class='control-label'>".LAN_FORUM_3026."</label>
|
||||
<div class='controls'>
|
||||
".$type."
|
||||
</div>
|
||||
@@ -236,7 +241,7 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
|
||||
return "<tr><td><a href='#pollform' class='e-expandit'>Add Poll</a></td><td>
|
||||
return "<tr><td><a href='#pollform' class='e-expandit'>".LAN_FORUM_3028."</a></td><td>
|
||||
<div id='pollform' style='display:none'>
|
||||
<table class='table table-striped'>".$poll_form."</table></div></td></tr>";
|
||||
}
|
||||
@@ -252,7 +257,7 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
||||
{
|
||||
$thread_sticky = (isset($_POST['threadtype']) ? $_POST['threadtype'] : vartrue($threadInfo['thread_sticky'],0)); // no reference of 'head' $threadInfo['head']['thread_sticky']
|
||||
|
||||
$opts = array(0 => "Normal", 1 => "Sticky", 2 => "Announcement");
|
||||
$opts = array(0 => LAN_FORUM_3038, 1 => LAN_FORUM_3039, 2 => LAN_FORUM_3038);
|
||||
|
||||
return e107::getForm()->radio('threadtype',$opts, $thread_sticky);
|
||||
|
||||
@@ -267,14 +272,14 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
||||
global $forum, $threadInfo, $eaction, $action;
|
||||
$_tmp = new e_vars();
|
||||
// no reference of 'head' $threadInfo['head']['thread_name']
|
||||
$forum->set_crumb(true, ($action == 'nt' ? ($eaction ? LAN_77 : LAN_60) : ($eaction ? LAN_78 : LAN_406.' '.$threadInfo['thread_name'])), $_tmp);
|
||||
$forum->set_crumb(true, ($action == 'nt' ? ($eaction ? LAN_FORUM_3023 : LAN_FORUM_1018) : ($eaction ? LAN_FORUM_3024 : $threadInfo['thread_name'])), $_tmp);
|
||||
return $_tmp->BREADCRUMB;
|
||||
}
|
||||
|
||||
function sc_noemotes()
|
||||
{
|
||||
if(vartrue($eaction) == true) { return ; }
|
||||
return "<input type='checkbox' name='no_emote' value='1' /> <span class='defaulttext'>".LAN_FORUMPOST_EMOTES.'</span>';
|
||||
return "<input type='checkbox' name='no_emote' value='1' /> <span class='defaulttext'>".LAN_FORUM_3041.'</span>';
|
||||
}
|
||||
|
||||
function sc_emailnotify()
|
||||
@@ -304,7 +309,7 @@ class plugin_forum_post_shortcodes extends e_shortcode
|
||||
$chk = ($pref['notify_on'] ? "checked='checked'" : '');
|
||||
}
|
||||
}
|
||||
return "<br /><input type='checkbox' name='notify' value='1' {$chk} /> <span class='defaulttext'>".LAN_380."</span>";
|
||||
return "<br /><input type='checkbox' name='notify' value='1' {$chk} /> <span class='defaulttext'>".LAN_FORUM_3042."</span>";
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* Forum plugin - view shortcodess
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
class plugin_forum_view_shortcodes extends e_shortcode
|
||||
@@ -14,7 +21,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
|
||||
function sc_top($parm='')
|
||||
{
|
||||
$text = ($parm == 'caret') ? "<span class='caret'></span>" : LAN_10;
|
||||
$text = ($parm == 'caret') ? "<span class='caret'></span>" : LAN_FORUM_2030;
|
||||
|
||||
return "<a href='".e_SELF.'?'.e_QUERY."#top' onclick=\"window.scrollTo(0,0);\">".$text.'</a>';
|
||||
}
|
||||
@@ -25,7 +32,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
$gen = e107::getDate();
|
||||
if ($this->postInfo['post_user'])
|
||||
{
|
||||
return LAN_06.': '.$gen->convert_date($this->postInfo['user_join'], 'forum').'<br />';
|
||||
return LAN_FORUM_2031.': '.$gen->convert_date($this->postInfo['user_join'], 'forum').'<br />';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,8 +80,8 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
{
|
||||
$info = unserialize($this->postInfo['post_options']);
|
||||
return "
|
||||
Post delete on: {$info['deldate']}<br />
|
||||
reason: {$info['delreason']}
|
||||
".LAN_FORUM_2037.": {$info['deldate']}<br />
|
||||
".LAN_FORUM_2038.": {$info['delreason']}
|
||||
";
|
||||
$ret = '<pre>'.print_r($info, true).'</pre>';
|
||||
}
|
||||
@@ -206,7 +213,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
{
|
||||
if($this->postInfo['thread_start'])
|
||||
{
|
||||
return e107::getParser()->parseTemplate("{EMAIL_ITEM=".FORLAN_101."^plugin:forum.{$this->postInfo['post_thread']}}");
|
||||
return e107::getParser()->parseTemplate("{EMAIL_ITEM=".LAN_FORUM_2044."^plugin:forum.{$this->postInfo['post_thread']}}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,7 +221,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
{
|
||||
if($this->postInfo['thread_start'])
|
||||
{
|
||||
return e107::getParser()->parseTemplate("{PRINT_ITEM=".FORLAN_102."^plugin:forum.{$this->postInfo['post_thread']}}");
|
||||
return e107::getParser()->parseTemplate("{PRINT_ITEM=".LAN_FORUM_2045."^plugin:forum.{$this->postInfo['post_thread']}}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,7 +259,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
{
|
||||
if ($this->postInfo['post_user'])
|
||||
{
|
||||
return LAN_67.': '.(int)$this->postInfo['user_plugin_forum_posts'].'<br />';
|
||||
return LAN_FORUM_2032.': '.(int)$this->postInfo['user_plugin_forum_posts'].'<br />';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -260,7 +267,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
{
|
||||
if ($this->postInfo['user_name'])
|
||||
{
|
||||
return LAN_09.': '.$this->postInfo['user_visits'].'<br />';
|
||||
return LAN_FORUM_2033.': '.$this->postInfo['user_visits'].'<br />';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -275,7 +282,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
function sc_website()
|
||||
{
|
||||
if ($this->postInfo['user_homepage']) {
|
||||
return LAN_08.': '.$this->postInfo['user_homepage'].'<br />';
|
||||
return LAN_FORUM_2034.': '.$this->postInfo['user_homepage'].'<br />';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,7 +326,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
function sc_memberid()
|
||||
{
|
||||
if (!$this->postInfo['post_user']) { return FALSE; }
|
||||
return "<span class='smalltext'>".LAN_195.' #'.$this->postInfo['post_user'].'</span>';
|
||||
return "<span class='smalltext'>".LAN_FORUM_2035.' #'.$this->postInfo['post_user'].'</span>';
|
||||
}
|
||||
|
||||
function sc_level($parm)
|
||||
@@ -436,7 +443,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
|
||||
if(plugInstalled('pm') && ($this->postInfo['post_user'] > 0))
|
||||
{
|
||||
$text .= "<li><a href='".e_PLUGIN_ABS."pm/pm.php?send.{$this->postInfo['post_user']}'>Send Private Message</a></li>";
|
||||
$text .= "<li><a href='".e_PLUGIN_ABS."pm/pm.php?send.{$this->postInfo['post_user']}'>".LAN_FORUM_2036."</a></li>";
|
||||
}
|
||||
|
||||
if($website = $this->sc_website())
|
||||
@@ -468,24 +475,24 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
<ul class="dropdown-menu pull-right">';
|
||||
|
||||
|
||||
$text .= "<li><a href='".e_HTTP."email.php?plugin:forum.".$this->postInfo['post_thread']."'>".FORLAN_101." <i class='icon-envelope'></i></a></li>";
|
||||
$text .= "<li><a href='".e_HTTP."print.php?plugin:forum.".$this->postInfo['post_thread']."'>Print <i class='icon-print'></i></a></li>";
|
||||
$text .= "<li><a href='".e_HTTP."email.php?plugin:forum.".$this->postInfo['post_thread']."'>".LAN_FORUM_2044." <i class='icon-envelope'></i></a></li>";
|
||||
$text .= "<li><a href='".e_HTTP."print.php?plugin:forum.".$this->postInfo['post_thread']."'>".LAN_FORUM_2045." <i class='icon-print'></i></a></li>"; // FIXME
|
||||
|
||||
if (USER) // Report
|
||||
{
|
||||
$text .= "<li><a href='".$this->e107->url->create('forum/thread/report', "id={$this->postInfo['post_thread']}&post={$this->postInfo['post_id']}")."'>Report <i class='icon-flag'></i></a></li>";
|
||||
$text .= "<li><a href='".$this->e107->url->create('forum/thread/report', "id={$this->postInfo['post_thread']}&post={$this->postInfo['post_id']}")."'>".LAN_FORUM_2046." <i class='icon-flag'></i></a></li>";
|
||||
}
|
||||
|
||||
// Edit
|
||||
if ( (USER && $this->postInfo['post_user'] == USERID && $this->thread->threadInfo['thread_active']))
|
||||
{
|
||||
$text .= "<li><a href='".e107::getUrl()->create('forum/thread/edit', array('id' => $this->postInfo['post_id']))."'>Edit <i class='icon-edit'></i></a></li>";
|
||||
$text .= "<li><a href='".e107::getUrl()->create('forum/thread/edit', array('id' => $this->postInfo['post_id']))."'>".LAN_FORUM_2039." <i class='icon-edit'></i></a></li>";
|
||||
|
||||
}
|
||||
|
||||
if($this->forum->checkperm($this->postInfo['post_forum'], 'post'))
|
||||
{
|
||||
$text .= "<li><a href='".e107::getUrl()->create('forum/thread/quote', array('id' => $this->postInfo['post_id']))."'>Quote <i class='icon-share-alt'></i></a></li>";
|
||||
$text .= "<li><a href='".e107::getUrl()->create('forum/thread/quote', array('id' => $this->postInfo['post_id']))."'>".LAN_FORUM_2041." <i class='icon-share-alt'></i></a></li>";
|
||||
}
|
||||
|
||||
|
||||
@@ -496,18 +503,18 @@ class plugin_forum_view_shortcodes extends e_shortcode
|
||||
|
||||
if ((USER && $this->postInfo['post_user'] != USERID && $this->thread->threadInfo['thread_active']))
|
||||
{
|
||||
$text .= "<li><a href='".e107::getUrl()->create('forum/thread/edit', array('id' => $this->postInfo['post_id']))."'>Edit <i class='icon-edit'></i></a></li>";
|
||||
$text .= "<li><a href='".e107::getUrl()->create('forum/thread/edit', array('id' => $this->postInfo['post_id']))."'>".LAN_FORUM_2039." <i class='icon-edit'></i></a></li>";
|
||||
}
|
||||
|
||||
$text .= "<li><a href='".e_REQUEST_URI."' data-forum-action='deletepost' data-forum-post='".$this->postInfo['post_id']."'>Delete (fixme) <i class='icon-trash'></i></a></li>";
|
||||
$text .= "<li><a href='".e_REQUEST_URI."' data-forum-action='deletepost' data-forum-post='".$this->postInfo['post_id']."'>".LAN_FORUM_2040." (fixme) <i class='icon-trash'></i></a></li>"; // FIXME
|
||||
|
||||
if ($type == 'thread')
|
||||
{
|
||||
$text .= "<li><a href='" . e107::getUrl()->create('forum/thread/move', array('id' => $this->postInfo['post_id']))."'>Move <i class='icon-move'></i></a></a></li>";
|
||||
$text .= "<li><a href='" . e107::getUrl()->create('forum/thread/move', array('id' => $this->postInfo['post_id']))."'>".LAN_FORUM_2042." <i class='icon-move'></i></a></a></li>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$text .= "<li><a href='" . e107::getUrl()->create('forum/thread/split', array('id' => $this->postInfo['post_id']))."'>Split</a></li>";
|
||||
$text .= "<li><a href='" . e107::getUrl()->create('forum/thread/split', array('id' => $this->postInfo['post_id']))."'>".LAN_FORUM_2043."</a></li>";
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user