1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-14 01:22:13 +02:00

Forum - work in progress

This commit is contained in:
Cameron 2013-03-24 18:10:58 -07:00
parent ec633d2fc2
commit 231dd00f27
5 changed files with 157 additions and 20 deletions

View File

@ -238,13 +238,13 @@ if ($query[0] == 'settings')
<tr>
<td>".SEALAN_35."</td>
<td>
".$frm->radio_multi('selector', array(2 => SEALAN_36, 1 => SEALAN_37, 0 => SEALAN_38), $search_prefs['selector'])."
".$frm->radio('selector', array(2 => SEALAN_36, 1 => SEALAN_37, 0 => SEALAN_38), $search_prefs['selector'])."
</td>
</tr>
<tr>
<td>".SEALAN_12."</td>
<td class='form-inline'>
".$frm->radio_multi('time_restrict', array(0 => LAN_DISABLED, 1 => SEALAN_13), $search_prefs['time_restrict'])."&nbsp;
".$frm->radio('time_restrict', array(0 => LAN_DISABLED, 1 => SEALAN_13), $search_prefs['time_restrict'])."&nbsp;
".$frm->text('time_secs', $tp -> toForm($search_prefs['time_secs']), 3, 'class=tbox&size=mini')."&nbsp;".SEALAN_14."
</td>
</tr>

View File

@ -82,7 +82,7 @@ if (!$forum->checkPerm($forumId, 'post'))
define('MODERATOR', USER && $forum->isModerator(USERID));
require_once(e_HANDLER.'ren_help.php');
e107::getScBatch('view', 'forum');
//e107::getScBatch('view', 'forum'); //XXX FIXME Conflicting shortcode names. Find a solution without renaming them.
e107::getScBatch('post', 'forum')->setScVar('forum', $forum)->setScVar('threadInfo', vartrue($threadInfo));
$gen = new convert;
@ -516,6 +516,7 @@ if($action == 'rp')
{
$FORUMPOST = $FORUMPOST_REPLY;
}
e107::lan('forum','English_front');
$text = $tp->parseTemplate($FORUMPOST, true);

View File

@ -212,7 +212,109 @@ define('FORLAN_442', 'My Uploads');
define('FORLAN_443', '[user deleted]');
define('FORLAN_444', 'sub-forums');
define("PAGE_NAME", "Forum");
define("LAN_01", "Forums");
define("LAN_02", "Replying to: ");
define("LAN_03", "New Thread");
define("LAN_1", "Normal");
define("LAN_2", "Sticky");
define("LAN_3", "Announcement");
define("LAN_4", "Post Poll");
define("LAN_5", "Poll Question:");
define("LAN_6", "Add another option");
define("LAN_7", "Vote option:");
define("LAN_8", "Allow votes from all");
define("LAN_9", "Allow votes from members only");
define("LAN_10", "Login");
define("LAN_11", "Remember me");
define("LAN_16", "Username: ");
define("LAN_17", "Password: ");
define("LAN_20", "Error");
define("LAN_27", "You left required field(s) blank");
define("LAN_28", "You didn't post anything ..");
define("LAN_29", "Edited");
define("LAN_45", "These forums can only be posted to by registered and logged in members, please click");
define("LAN_60", "Start New Thread");
define("LAN_61", "Your Name: ");
define("LAN_62", "Subject: ");
define("LAN_63", "Post: ");
define("LAN_64", "Submit new thread");
define("LAN_73", "Reply: ");
define("LAN_74", "Reply to thread");
define("LAN_77", "Update Thread");
define("LAN_78", "Update Reply");
define("LAN_94", "Posted by");
define("LAN_95", "Unauthorised");
define("LAN_96", "You are not authorised to edit this forum post.");
define("LAN_100", "Thread Topic");
define("LAN_101", "Latest ");
define("LAN_102", " replies");
define("LAN_103", "Review complete thread. (Will open a new window.)");
define("LAN_133", "Thank you");
define("LAN_174", "Signup");
define("LAN_175", "Login");
define("LAN_212", "Forgot password?");
define("LAN_310", "Unable to accept post as that username is registered - if it is your username please login to post.");
define("LAN_311", "Anonymous");
define("LAN_322", "Posted: ");
define("LAN_323", "Preview");
define("LAN_324", "Your message has been successfully posted.");
define("LAN_325", "Click Here to view your message");
define("LAN_326", "Click here to return to the forum");
define("LAN_327", "Review");
define("LAN_380", "Enable email tracking (email sent when reply is posted)");
define("LAN_381", "Forum reply from ");
define("LAN_382", "Post made: ");
define("LAN_383", "Please click the following link to view the full thread ...");
define("LAN_384", "Forum reply at ");
define("LAN_385", "Post: ");
define("LAN_386", "If you do not wish to add a poll to your thread leave the fields blank ");
define("LAN_387", "Go");
define("LAN_388", "Back to top");
define("LAN_389", "Duplicate post, redirecting ...");
define("LAN_390", "Attach file / image");
define("LAN_391", "Options");
define("LAN_392", "File to attach");
define("LAN_393", "<b>Please note</b><br />Allowed file types:");
define("LAN_394", "Any other file types uploaded will be instantly deleted.");
define("LAN_395", "Maximum file size");
define("LAN_396", " bytes");
define("LAN_397", "This thread is locked.");
define("LAN_398", "This forum is read only");
define("LAN_399", "You are not authorized to post to this forum.");
define("LAN_400", "post thread as");
define("LAN_401", "Jump");
define("LAN_402", "poll");
define("LAN_403", "announcement");
define("LAN_404", "sticky");
define("LAN_405", "Forums");
define("LAN_406", "Re:");
//v.616
define("LAN_407", "Redirect");
define("LAN_408", "If your browser does not support meta redirection please click");
define("LAN_409", "HERE");
define("LAN_410", "to be redirected");
define("LAN_411", "here");
define("LAN_412", "to go to the registration page.");
define("LAN_413", "Your poll has been successfully posted.");
define("LAN_414", "Click Here to view your poll");
define("LAN_415", "Your reply has been successfully posted.");
define("LAN_416", "Attach file");
define("LAN_417", "Add another attachment");
define("POLL_506", "Allow multiple choices?");
define("POLL_507", "yes");
define("POLL_508", "no");
define("LAN_FORUM_1", "Uploads disabled: ".e_FILE."public directory is not writable");
define("LAN_FORUM_2", "Duplicate post");
define('LAN_FORUMPOST_EMOTES', 'Deactivate emoticons for this post');
?>

View File

@ -76,11 +76,14 @@ class plugin_forum_post_shortcodes extends e_shortcode
function sc_postbox()
{
global $post;
return e107::getForm()->bbarea('post',$post,'forum');
$rows = (e_WYSIWYG) ? 15 : 10;
$ret = "<textarea class='e-wysiwyg tbox' id='post' name='post' cols='70' rows='{$rows}' style='width:95%' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>$post</textarea>\n<br />\n";
if(!e_WYSIWYG)
// if(!e_WYSIWYG)
{
$ret .= display_help('helpb', 'forum');
// $ret .= display_help('helpb', 'forum');
}
return $ret;
}
@ -124,14 +127,47 @@ class plugin_forum_post_shortcodes extends e_shortcode
}
}
}
function sc_poll($parm='')
{
global $forum, $poll_form, $action;
if(!$poll_form)
{
if(is_readable(e_PLUGIN."poll/poll_class.php"))
{
require_once(e_PLUGIN."poll/poll_class.php");
$pollo = new poll;
$poll_form = $pollo -> renderPollForm("forum");
}
}
if ($action == 'nt' && check_class($forum->prefs->get('poll')) && strpos(e_QUERY, 'edit') === false)
{
return "<tr><td><a href='#pollform' class='e-expandit'>Add Poll</a></td><td>
<div id='pollform' style='display:none'>
<table class='table table-striped'>".$poll_form."</table></div></td></tr>";
}
return '';
}
function sc_postthreadas()
{
global $action, $threadInfo;
if (MODERATOR && $action == "nt")
{
$thread_sticky = (isset($_POST['threadtype']) ? $_POST['threadtype'] : vartrue($threadInfo['thread_sticky'])); // no reference of 'head' $threadInfo['head']['thread_sticky']
return "<br /><span class='defaulttext'>".LAN_400."<input name='threadtype' type='radio' value='0' ".(!$thread_sticky ? "checked='checked' " : "")." />".LAN_1."&nbsp;<input name='threadtype' type='radio' value='1' ".($thread_sticky == 1 ? "checked='checked' " : "")." />".LAN_2."&nbsp;<input name='threadtype' type='radio' value='2' ".($thread_sticky == 2 ? "checked='checked' " : "")." />".LAN_3."</span>";
$opts = array(0 => "Normal", 1 => "Sticky", 2 => "Announcement");
return e107::getForm()->radio('threadtype',$opts, $thread_sticky);
return "<br /><span class='defaulttext'>post thread as
<input name='threadtype' type='radio' value='0' ".(!$thread_sticky ? "checked='checked' " : "")." />".LAN_1."&nbsp;<input name='threadtype' type='radio' value='1' ".($thread_sticky == 1 ? "checked='checked' " : "")." />".LAN_2."&nbsp;<input name='threadtype' type='radio' value='2' ".($thread_sticky == 2 ? "checked='checked' " : "")." />".LAN_3."</span>";
}
return '';
}
@ -153,6 +189,8 @@ class plugin_forum_post_shortcodes extends e_shortcode
function sc_emailnotify()
{
global $threadInfo, $action, $eaction;
$pref = e107::getPlugPref('forum');
@ -181,15 +219,7 @@ class plugin_forum_post_shortcodes extends e_shortcode
return '';
}
function sc_poll()
{
global $forum, $poll_form, $action;
if ($action == 'nt' && check_class($forum->prefs->get('poll')) && strpos(e_QUERY, 'edit') === false)
{
return $poll_form;
}
return '';
}
}
?>

View File

@ -239,14 +239,18 @@ $FORUMPOST_TEMPLATE['form'] = "
{USERBOX}
{SUBJECTBOX}
<tr>
<td style='width:20%'>{POSTTYPE}</td>
<td style='width:20%'>{POSTTYPE} </td>
<td style='width:80%'>
{POSTBOX}<br />
{EMAILNOTIFY}<br />
{NOEMOTES}<br />
{POSTTHREADAS}
{POSTBOX}
{EMAILNOTIFY}
</td>
</tr>
<td style='width:20%'>Post thread as</td>
<td style='width:80%'>
{POSTTHREADAS}
</td></tr>
{POLL}
{FILEATTACH}