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

Merge pull request #10 from e107inc/master

"Rebase" from head e107
This commit is contained in:
rica-carv 2016-04-28 11:18:39 +01:00
commit 2fda760e02
10 changed files with 530 additions and 293 deletions

View File

@ -575,7 +575,7 @@ function update_706_to_800($type='')
);
// List of DB tables not required (includes a few from 0.6xx)
$obs_tables = array('flood', 'headlines', 'stat_info', 'stat_counter', 'stat_last', 'session', 'preset', 'tinymce');
$obs_tables = array('flood', 'stat_info', 'stat_counter', 'stat_last', 'session', 'preset', 'tinymce');
// List of DB tables newly required (defined in core_sql.php) (The existing dblog table gets renamed)

View File

@ -28,6 +28,8 @@ class db_verify
var $results = array();
var $indices = array(); // array(0) - Issue?
var $fixList = array();
private $currentTable = null;
private $internalError = false;
var $fieldTypes = array('time','timestamp','datetime','year','tinyblob','blob',
'mediumblob','longblob','tinytext','mediumtext','longtext','text','date');
@ -50,11 +52,9 @@ class db_verify
function __construct()
{
$ns = e107::getRender();
$pref = e107::getPref();
$mes = e107::getMessage();
$frm = e107::getForm();
$this->backUrl = e_SELF;
$core_data = file_get_contents(e_CORE.'sql/core_sql.php');
@ -70,6 +70,7 @@ class db_verify
{
$id = str_replace('_sql','',$file);
$data = file_get_contents($filename);
$this->currentTable = $id;
$this->tables[$id] = $this->getTables($data);
unset($data);
}
@ -112,11 +113,8 @@ class db_verify
function runComparison($fileArray)
{
$ns = e107::getRender();
$mes = e107::getMessage();
$frm = e107::getForm();
foreach($fileArray as $tab)
{
$this->compare($tab);
@ -134,12 +132,18 @@ class db_verify
}
else
{
$mes->addSuccess(DBLAN_111);
$mes->addSuccess("<a class='btn btn-primary' href='".$this->backUrl."'>".LAN_BACK."</a>");
if($this->internalError === false)
{
$mes->addSuccess(DBLAN_111);
$mes->addSuccess("<a class='btn btn-primary' href='".$this->backUrl."'>".LAN_BACK."</a>");
}
//$debug = "<pre>".print_r($this->results,TRUE)."</pre>";
//$mes->add($debug,E_MESSAGE_DEBUG);
//$text .= "<div class='buttons-bar center'>".$frm->admin_button('back', DBVLAN_17, 'back')."</div>";
$ns->tablerender("Okay",$mes->render().$text);
echo $mes->render();
// $ns->tablerender("Okay",$mes->render().$text);
}
}
@ -194,10 +198,14 @@ class db_verify
function compare($selection,$language='')
{
$this->currentTable = $selection;
if(empty($this->tables[$selection]['tables']))
{
return;
//$this->internalError = true;
e107::getMessage()->addDebug("Couldn't read table data for ".$selection);
return false;
}
foreach($this->tables[$selection]['tables'] as $key=>$tbl)
@ -207,8 +215,8 @@ class db_verify
$rawSqlData = $this->getSqlData($tbl,$language);
if($rawSqlData === FALSE)
if($rawSqlData === false)
{
if($language) continue;
@ -222,6 +230,7 @@ class db_verify
// echo "<h4>RAW</h4>";
// print_a($rawSqlData);
// $this->currentTable = $tbl;v
$sqlDataArr = $this->getTables($rawSqlData);
// echo "<h4>PARSED</h4>";
@ -736,7 +745,8 @@ class db_verify
{
if(!$sql_data)
{
return;
e107::getMessage()->addError("No SQL Data found in file");
return false;
}
$ret = array();
@ -770,7 +780,11 @@ class db_verify
$ret['data'] = $match[2];
$ret['engine'] = $match[4];
if(empty($ret['tables']))
{
e107::getMessage()->addDebug("Unable to parse ".$this->currentTable."_sql.php file data. Possibly missing a ';' at the end?");
e107::getMessage()->addDebug(print_a($regex,true));
}
return $ret;
}
@ -927,6 +941,7 @@ class db_verify
else
{
$mes->addDebug('Failed: '.$qry);
$this->internalError = true;
return FALSE;
}

View File

@ -426,14 +426,11 @@ class e_parse_shortcode
}
elseif(E107_DBG_BBSC || E107_DBG_SC)
{
echo "<h3>Couldn't Find Class '".$className."' in <b>".$path."</b></h3>";
// echo "<h3>Couldn't Find Class '".$className."' in <b>".$path."</b></h3>";
echo "<div class='alert alert-danger'>Couldn't Load: <b>".$path."</b> with class-name:<b> {$className}</b> and pluginName <b>{$pluginName}</b></div>";
}
}
elseif(E107_DBG_BBSC || E107_DBG_SC)
{
echo "<div class='alert alert-danger'>Couldn't Load: <b>".$path."</b> with class-name:<b> {$className}</b> and pluginName <b>{$pluginName}</b></div>";
}
// TODO - throw exception?
return null;

View File

@ -353,6 +353,7 @@ class forum_post_handler
*/
function getTemplate($type = 'post')
{
$pref = e107::pref('core');
global $FORUMPOST, $subjectbox, $userbox, $poll_form, $fileattach, $fileattach_alert; // needed for BC.
@ -380,9 +381,217 @@ class forum_post_handler
}
}
// ----------------- Legacy -------------------------
if(!defined("USER_WIDTH")){ define("USER_WIDTH","width:95%"); }
if(empty($userbox))
{
$userbox = "<tr>
<td class='forumheader2' style='width:20%'>".LAN_FORUM_3010."</td>
<td class='forumheader2' style='width:80%'>
<input class='tbox form-control' type='text' name='anonname' size='71' value='".vartrue($anonname)."' maxlength='20' style='width:95%' />
</td>
</tr>";
}
if(empty($subjectbox))
{
$subjectbox = "<tr>
<td class='forumheader2' style='width:20%'>".LAN_FORUM_3011."</td>
<td class='forumheader2' style='width:80%'>
<input class='tbox form-control' type='text' name='subject' size='71' value='".vartrue($subject)."' maxlength='100' style='width:95%' />
</td>
</tr>";
}
if(empty($fileattach))
{
$fileattach = "
<tr>
<td colspan='2' class='nforumcaption2 fcaption'>".($pref['image_post'] ? LAN_FORUM_3012 : LAN_FORUM_3013)."</td>
</tr>
<tr>
<td style='width:20%' class='forumheader3'>".LAN_FORUM_3014."</td>
<td style='width:80%' class='forumheader3'>".str_replace(array('[', ']'), array('<b>', '</b>'), LAN_FORUM_3015)."<br>".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'))."
<br />
<div id='fiupsection'>
<span id='fiupopt'>
<input class='tbox' name='file_userfile[]' type='file' size='47' />
</span>
</div>
<input class='btn btn-default button' type='button' name='addoption' value='".LAN_FORUM_3020."' onclick=\"duplicateHTML('fiupopt','fiupsection')\" />
</td>
</tr>
";
}
// If the upload directory is not writable, we need to alert the user about this.
if(empty($fileattach_alert))
{
$fileattach_alert = "
<tr>
<td colspan='2' class='nforumcaption2'>".($pref['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";
}
// ------------
if(empty($FORUMPOST))
{
$FORUMPOST = "
<div style='text-align:center'>
<div class='spacer'>
{FORMSTART}
<table style='".USER_WIDTH."' class='fborder table'>
<tr>
<td colspan='2' class='fcaption'>{BACKLINK}
</td>
</tr>
{USERBOX}
{SUBJECTBOX}
<tr>
<td class='forumheader2' style='width:20%'>{POSTTYPE}</td>
<td class='forumheader2' style='width:80%'>
{POSTBOX}<br />
{EMAILNOTIFY}<br />
{NOEMOTES}<br />
{POSTTHREADAS}
</td>
</tr>
{POLL}
{FILEATTACH}
<tr style='vertical-align:top'>
<td colspan='2' class='forumheader' style='text-align:center'>
{BUTTONS}
</td>
</tr>
</table>
{FORMEND}
<table style='".USER_WIDTH."'>
<tr>
<td>
{FORUMJUMP}
</td>
</tr>
</table>
</div></div>
";
}
if(empty($FORUMPOST_REPLY))
{
$FORUMPOST_REPLY = "
<div style='text-align:center'>
<div class='spacer'>
{FORMSTART}
<table style='".USER_WIDTH."' class='fborder table'>
<tr>
<td colspan='2' class='fcaption'>{BACKLINK}
</td>
</tr>
{USERBOX}
{SUBJECTBOX}
<tr>
<td class='forumheader2' style='width:20%'>{POSTTYPE}</td>
<td class='forumheader2' style='width:80%'>
{POSTBOX}<br />
{EMAILNOTIFY}<br />
{NOEMOTES}<br />
{POSTTHREADAS}
</td>
</tr>
{POLL}
{FILEATTACH}
<tr style='vertical-align:top'>
<td colspan='2' class='forumheader' style='text-align:center'>
{BUTTONS}
</td>
</tr>
</table>
{FORMEND}
<table style='".USER_WIDTH."'>
<tr>
<td>
{FORUMJUMP}
</td>
</tr>
</table>
</div></div>
<div style='text-align:center'>
{THREADTOPIC}
{LATESTPOSTS}
</div>
";
}
if(empty($LATESTPOSTS_START))
{
$LATESTPOSTS_START = "
<table style='".USER_WIDTH."' class='fborder table'>
<tr>
<td colspan='2' class='fcaption' style='vertical-align:top'>".str_replace('[y]', "{LATESTPOSTSCOUNT}", LAN_FORUM_3022)."</td>
</tr>";
}
if(empty($LATESTPOSTS_POST))
{
$LATESTPOSTS_POST = "
<tr>
<td class='forumheader3' style='width:20%;vertical-align:top'><b>{POSTER}</b></td>
<td class='forumheader3' style='width:80%'>
<div class='smallblacktext' style='text-align:right'>".IMAGE_post2." {THREADDATESTAMP}</div>
{POST}
</td>
</tr>
";
}
if(empty($LATESTPOSTS_END))
{
$LATESTPOSTS_END = "
</table>
";
}
if(empty($THREADTOPIC_REPLY))
{
$THREADTOPIC_REPLY = "
<table style='".USER_WIDTH."' class='fborder table'>
<tr>
<td colspan='2' class='fcaption' style='vertical-align:top'>".LAN_FORUM_1003."</td>
</tr>
<tr>
<td class='forumheader3' style='width:20%;vertical-align:top'><b>{POSTER}</b></td>
<td class='forumheader3' style='width:80%'>
<div class='smallblacktext' style='text-align:right'>".IMAGE_post2." {THREADDATESTAMP}</div>
{POST}
</td>
</tr>
</table>
";
}
// -------------------------------- End Legacy Code ----------------------------------//
if($type == 'post')
{
return (deftrue('BOOTSTRAP')) ? $FORUM_POST_TEMPLATE : array('form'=>$FORUMPOST);
$template= (deftrue('BOOTSTRAP')) ? $FORUM_POST_TEMPLATE : array('form'=>$FORUMPOST);
// print_a($template);
return $this->upgradeTemplate($template);
}
else
{
@ -408,6 +617,39 @@ class forum_post_handler
}
private function upgradeTemplate($template)
{
$arr = array(
'POSTOPTIONS' => "FORUM_POST_OPTIONS",
'POSTOPTIONS_LABEL' => "FORUM_POST_OPTIONS_LABEL",
'POLL' => 'FORUM_POST_POLL',
'FORUM_AUTHOR' => 'FORUM_POST_AUTHOR',
'FORUM_SUBJECT' => 'FORUM_POST_SUBJECT',
'BUTTONS' => 'FORUM_POST_BUTTONS',
'FORMSTART' => 'FORUM_POST_FORM_START',
'FORMEND' => 'FORUM_POST_FORM_END',
'POSTBOX' => 'FORUM_POST_TEXTAREA',
'EMAILNOTIFY' => 'FORUM_POST_EMAIL_NOTIFY',
'BACKLINK' => 'FORUM_POST_BREADCRUMB',
'POSTTYPE' => 'FORUM_POST_TEXTAREA_LABEL'
);
foreach($arr as $old => $new)
{
//$template = str_replace("{".$old."}", "{".$new."}", $template);
$reg = '/\{'.$old.'((?:=|:)?[^\}]*)\}/'; // handle variations.
$repl = '{'.$new.'$1}';
$template = preg_replace($reg,$repl, $template);
}
// print_a($template);
return $template;
}
function renderFormMove()
{
if(!deftrue('MODERATOR'))

View File

@ -18,7 +18,7 @@ class plugin_forum_post_shortcodes extends e_shortcode
$this->e107 = e107::getInstance();
}
function sc_latestposts($parm)
function sc_latestposts($parm) //TODO move elsewhere?
{
$parm = ($parm ? $parm : 10);
global $LATESTPOSTS_START, $LATESTPOSTS_END, $LATESTPOSTS_POST;
@ -48,12 +48,12 @@ class plugin_forum_post_shortcodes extends e_shortcode
return e107::getParser()->parseTemplate($THREADTOPIC_REPLY, true);
}
function sc_formstart()
function sc_forum_post_form_start()
{
return "<form class='form-horizontal' enctype='multipart/form-data' method='post' action='".e_REQUEST_URL."' id='dataform'>";
}
function sc_formend()
function sc_forum_post_form_end()
{
$frm = e107::getForm();
return $frm->hidden('action',$this->var['action']).$frm->close();
@ -81,7 +81,7 @@ class plugin_forum_post_shortcodes extends e_shortcode
return (USER == false ? $userbox : '');
}
function sc_forum_author()
function sc_forum_post_author()
{
$opts = array('size' => 'xlarge');
$tp = e107::getParser();
@ -110,7 +110,7 @@ class plugin_forum_post_shortcodes extends e_shortcode
return ($this->var['action'] == 'nt' ? $subjectbox : '');
}
function sc_forum_subject()
function sc_forum_post_subject()
{
$opts = array('size' => 'xlarge');
@ -144,12 +144,12 @@ class plugin_forum_post_shortcodes extends e_shortcode
}
function sc_posttype()
function sc_forum_post_textarea_label()
{
return ($this->var['action'] == 'nt' ? LAN_FORUM_2015 : LAN_FORUM_2006);
}
function sc_postbox()
function sc_forum_post_textarea()
{
$tp = e107::getParser();
@ -181,7 +181,7 @@ class plugin_forum_post_shortcodes extends e_shortcode
}
function sc_buttons()
function sc_forum_post_buttons()
{
$ret = "<input class='btn btn-default button' type='submit' name='fpreview' value='".LAN_FORUM_3005."' /> ";
@ -272,10 +272,10 @@ class plugin_forum_post_shortcodes extends e_shortcode
}
function sc_postoptions_label()
function sc_forum_post_options_label()
{
$type = $this->sc_postthreadas();
$poll = $this->sc_poll('front');
$poll = $this->sc_forum_post_poll('front');
$attach = $this->sc_forumattachment();
if(empty($type) && empty($poll) && empty($attach))
@ -288,10 +288,10 @@ class plugin_forum_post_shortcodes extends e_shortcode
function sc_postoptions($parm='')
function sc_forum_post_options($parm='')
{
$type = $this->sc_postthreadas();
$poll = $this->sc_poll('front');
$poll = $this->sc_forum_post_poll('front');
$attach = $this->sc_forumattachment();
$tabs = array();
@ -369,7 +369,7 @@ class plugin_forum_post_shortcodes extends e_shortcode
}
function sc_poll($parm='')
function sc_forum_post_poll($parm=null)
{
if(!e107::isInstalled('poll'))
@ -390,11 +390,13 @@ class plugin_forum_post_shortcodes extends e_shortcode
return $poll_form;
}
return "<tr><td><a href='#pollform' class='e-expandit'>".LAN_FORUM_3028."</a></td><td>
//BC Code below.
return "<tr><td class='forumheader3' style='vertical-align:top'><a href='#pollform' class='e-expandit' >".LAN_FORUM_3028."</a></td>
<td class='forumheader3'>
<div id='pollform' style='display:none'>
<table class='table table-striped'>".$poll_form."</table></div></td></tr>";
<table class='table table-striped' style='margin-left:0'>".$poll_form."</table></div></td></tr>";
}
return '';
}
@ -416,7 +418,7 @@ class plugin_forum_post_shortcodes extends e_shortcode
return '';
}
function sc_backlink()
function sc_forum_post_breadcrumb()
{
global $forum, $threadInfo, $eaction, $action,$forumInfo;
@ -432,11 +434,11 @@ class plugin_forum_post_shortcodes extends e_shortcode
function sc_noemotes()
{
if(vartrue($eaction) == true) { return ; }
if(vartrue($eaction) == true) { return null; }
return "<input type='checkbox' name='no_emote' value='1' />&nbsp;<span class='defaulttext'>".LAN_FORUM_3039.'</span>';
}
function sc_emailnotify()
function sc_forum_post_email_notify()
{

View File

@ -9,264 +9,47 @@
*/
if (!defined('e107_INIT')) { exit; }
if(!defined("USER_WIDTH")){ define("USER_WIDTH","width:95%"); }
// the user box and subject box are not always displayed, therefore we need to define them /in case/ they are, if not they'll be ignored.
if(!vartrue($userbox))
{
$userbox = "<tr>
<td class='forumheader2' style='width:20%'>".LAN_FORUM_3010."</td>
<td class='forumheader2' style='width:80%'>
<input class='tbox form-control' type='text' name='anonname' size='71' value='".vartrue($anonname)."' maxlength='20' style='width:95%' />
</td>
</tr>";
}
if(!vartrue($subjectbox))
{
$subjectbox = "<tr>
<td class='forumheader2' style='width:20%'>".LAN_FORUM_3011."</td>
<td class='forumheader2' style='width:80%'>
<input class='tbox form-control' type='text' name='subject' size='71' value='".vartrue($subject)."' maxlength='100' style='width:95%' />
</td>
</tr>";
}
// the poll is optional, be careful when changing the values here, only change if you know what you're doing ...
if(!vartrue($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');
}
}
// finally, file attach is optional, again only change this if you know what you're doing ...
if(!vartrue($fileattach))
{
$fileattach = "
<tr>
<td colspan='2' class='nforumcaption2'>".($pref['image_post'] ? LAN_FORUM_3012 : LAN_FORUM_3013)."</td>
</tr>
<tr>
<td style='width:20%' class='forumheader3'>".LAN_FORUM_3014."</td>
<td style='width:80%' class='forumheader3'>".str_replace(array('[', ']'), array('<b>', '</b>'), LAN_FORUM_3015)."<br>".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'))."
<br />
<div id='fiupsection'>
<span id='fiupopt'>
<input class='tbox' name='file_userfile[]' type='file' size='47' />
</span>
</div>
<input class='btn btn-default button' type='button' name='addoption' value='".LAN_FORUM_3020."' onclick=\"duplicateHTML('fiupopt','fiupsection')\" />
</td>
</tr>
";
//</td>
//</tr>
}
// If the upload directory is not writable, we need to alert the user about this.
if(!vartrue($fileattach_alert))
{
$fileattach_alert = "
<tr>
<td colspan='2' class='nforumcaption2'>".($pref['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";
}
// ------------
if(!$FORUMPOST)
{
$FORUMPOST = "
<div style='text-align:center'>
<div class='spacer'>
{FORMSTART}
<table style='".USER_WIDTH."' class='fborder table'>
<tr>
<td colspan='2' class='fcaption'>{BACKLINK}
</td>
</tr>
{USERBOX}
{SUBJECTBOX}
<tr>
<td class='forumheader2' style='width:20%'>{POSTTYPE}</td>
<td class='forumheader2' style='width:80%'>
{POSTBOX}<br />
{EMAILNOTIFY}<br />
{NOEMOTES}<br />
{POSTTHREADAS}
</td>
</tr>
{POLL}
{FILEATTACH}
<tr style='vertical-align:top'>
<td colspan='2' class='forumheader' style='text-align:center'>
{BUTTONS}
</td>
</tr>
</table>
{FORMEND}
<table style='".USER_WIDTH."'>
<tr>
<td>
{FORUMJUMP}
</td>
</tr>
</table>
</div></div>
";
}
if(!vartrue($FORUMPOST_REPLY))
{
$FORUMPOST_REPLY = "
<div style='text-align:center'>
<div class='spacer'>
{FORMSTART}
<table style='".USER_WIDTH."' class='fborder table'>
<tr>
<td colspan='2' class='fcaption'>{BACKLINK}
</td>
</tr>
{USERBOX}
{SUBJECTBOX}
<tr>
<td class='forumheader2' style='width:20%'>{POSTTYPE}</td>
<td class='forumheader2' style='width:80%'>
{POSTBOX}<br />
{EMAILNOTIFY}<br />
{NOEMOTES}<br />
{POSTTHREADAS}
</td>
</tr>
{POLL}
{FILEATTACH}
<tr style='vertical-align:top'>
<td colspan='2' class='forumheader' style='text-align:center'>
{BUTTONS}
</td>
</tr>
</table>
{FORMEND}
<table style='".USER_WIDTH."'>
<tr>
<td>
{FORUMJUMP}
</td>
</tr>
</table>
</div></div>
<div style='text-align:center'>
{THREADTOPIC}
{LATESTPOSTS}
</div>
";
}
if(!vartrue($LATESTPOSTS_START))
{
$LATESTPOSTS_START = "
<table style='".USER_WIDTH."' class='fborder table'>
<tr>
<td colspan='2' class='fcaption' style='vertical-align:top'>".str_replace('[y]', "{LATESTPOSTSCOUNT}", LAN_FORUM_3022)."</td>
</tr>";
}
if(!vartrue($LATESTPOSTS_POST))
{
$LATESTPOSTS_POST = "
<tr>
<td class='forumheader3' style='width:20%;vertical-align:top'><b>{POSTER}</b></td>
<td class='forumheader3' style='width:80%'>
<div class='smallblacktext' style='text-align:right'>".IMAGE_post2." {THREADDATESTAMP}</div>
{POST}
</td>
</tr>
";
}
if(!vartrue($LATESTPOSTS_END))
{
$LATESTPOSTS_END = "
</table>
";
}
if(!vartrue($THREADTOPIC_REPLY))
{
$THREADTOPIC_REPLY = "
<table style='".USER_WIDTH."' class='fborder table'>
<tr>
<td colspan='2' class='fcaption' style='vertical-align:top'>".LAN_FORUM_1003."</td>
</tr>
<tr>
<td class='forumheader3' style='width:20%;vertical-align:top'><b>{POSTER}</b></td>
<td class='forumheader3' style='width:80%'>
<div class='smallblacktext' style='text-align:right'>".IMAGE_post2." {THREADDATESTAMP}</div>
{POST}
</td>
</tr>
</table>
";
}
// New in v2.x - requires a bootstrap theme be loaded.
$FORUM_POST_TEMPLATE['form'] = "
{FORMSTART}
$FORUM_POST_TEMPLATE['form'] = "
{FORUM_POST_FORM_START}
<div class='row-fluid'>
<div>{BACKLINK}</div>
<div>{FORUM_POST_BREADCRUMB}</div>
</div>
<div class='form-group'>
<label for='name' class='col-sm-3 control-label'>".LAN_FORUM_3010."</label>
<div class='col-sm-9'>{FORUM_AUTHOR}</div>
<div class='col-sm-9'>{FORUM_POST_AUTHOR}</div>
</div>
<div class='form-group'>
<label for='subject' class='col-sm-3 control-label'>".LAN_FORUM_3011."</label>
<div class='col-sm-9'>{FORUM_SUBJECT}</div>
<div class='col-sm-9'>{FORUM_POST_SUBJECT}</div>
</div>
<div class='form-group'>
<label class='col-sm-3 control-label'>{POSTTYPE}</label>
<label class='col-sm-3 control-label'>{FORUM_POST_TEXTAREA_LABEL}</label>
<div class='col-sm-9'>
{POSTBOX}
{EMAILNOTIFY}
{FORUM_POST_TEXTAREA}
{FORUM_POST_EMAIL_NOTIFY}
</div>
</div>
<div class='form-group'>
<label class='col-sm-3 control-label'>{POSTOPTIONS_LABEL}</label>
<div class='col-sm-9'>{POSTOPTIONS}</div>
<label class='col-sm-3 control-label'>{FORUM_POST_OPTIONS_LABEL}</label>
<div class='col-sm-9'>{FORUM_POST_OPTIONS}</div>
</div>
<div class='form-group text-center'>
{BUTTONS}
{FORUM_POST_BUTTONS}
</div>
{FORMEND}
{FORUM_POST_FORM_END}
";
$js = <<<TMPL
// javascript here.
TMPL;
e107::js('footer-inline', $js);
$FORUM_POST_TEMPLATE['reply'] = "";
@ -289,4 +72,3 @@ $FORUM_CRUMB['forum']['sep'] = " :: ";
$FORUM_CRUMB['thread']['value'] = "<a class='forumlink' href='{THREAD_HREF}'>{THREAD_TITLE}</a>";
?>

View File

@ -384,31 +384,47 @@ e107::getLanguage()->bcDefs($bcDefs);
function sc_lm_plugin_stats($parm='')
{
global $tp, $menu_pref, $new_total, $LOGIN_MENU_STATITEM, $LM_STATITEM_SEPARATOR;
if(!vartrue($menu_pref['login_menu']['external_stats'])) return '';
$lbox_infos = login_menu_class::parse_external_list(true, false);
if(!vartrue($lbox_infos['stats'])) return '';
$lbox_active_sorted = $menu_pref['login_menu']['external_stats'] ? explode(',', $menu_pref['login_menu']['external_stats']) : array();
$ret = array();
$sep = varset($LM_STATITEM_SEPARATOR, '<br />');
foreach ($lbox_active_sorted as $stackid) {
foreach ($lbox_active_sorted as $stackid)
{
if(!varset($lbox_infos['stats'][$stackid])) continue;
foreach ($lbox_infos['stats'][$stackid] as $lbox_item) {
foreach ($lbox_infos['stats'][$stackid] as $lbox_item)
{
$tmp = array();
if($lbox_item['stat_new']){
$tmp['LM_STAT_NEW'] = "return '{$lbox_item['stat_new']}';";
$tmp['LM_STAT_LABEL'] = $lbox_item["stat_new"] == 1 ? "return '{$lbox_item['stat_item']}';" : "return '{$lbox_item['stat_items']}';";
if($lbox_item['stat_new'])
{
$tmp['LM_STAT_NEW'] = $lbox_item['stat_new'];
$tmp['LM_STAT_LABEL'] = $lbox_item["stat_new"] == 1 ? $lbox_item['stat_item'] : $lbox_item['stat_items'];
$tmp['LM_STAT_EMPTY'] = '';
$new_total += $lbox_item['stat_new'];
} else {
}
else
{
//if(empty($lbox_item['stat_nonew'])) continue;
$tmp['LM_STAT_NEW'] = '';
$tmp['LM_STAT_LABEL'] = '';
$tmp['LM_STAT_EMPTY'] = "return '{$lbox_item['stat_nonew']}';";
$tmp['LM_STAT_EMPTY'] = $lbox_item['stat_nonew'];
}
$ret[] = $tp -> parseTemplate($LOGIN_MENU_STATITEM, false, $tmp);
$ret[] = $tp->parseTemplate($LOGIN_MENU_STATITEM, false, $tmp);
}
}
return $ret ? implode($sep, $ret) : '';
}

View File

@ -626,6 +626,8 @@ class poll
//XXX New v2.x default for front-end. Currently used by forum-post in bootstrap mode.
// TODO LAN - Needs a more generic LAN rewrite when used on another area than forum
if ($mode == 'front')
{
@ -722,22 +724,22 @@ class poll
//TODO Hardcoded FORUM code needs to be moved somewhere.
if ($mode == 'forum')
if ($mode == 'forum') // legacy code.
{
$text = "
<tr>
<td colspan='2'><span class='smalltext'>".LAN_FORUM_3029."</span></td>
<td class='forumheader3' colspan='2'><span class='smalltext'>".LAN_FORUM_3029."</span></td>
</tr>
<tr>
<td style='width:20%'><div class='normaltext'>".LAN_FORUM_3030.": </div></td>
<td style='width:80%'class='forumheader3'><input class='tbox' type='text' name='poll_title' size='70' value='".$tp->post_toForm(vartrue($_POST['poll_title']))."' maxlength='200' /></td>
<td class='forumheader3' style='width:20%'><div class='normaltext'>".LAN_FORUM_3030.": </div></td>
<td class='forumheader3' style='width:80%' class='forumheader3'><input class='tbox' type='text' name='poll_title' size='70' value='".$tp->post_toForm(vartrue($_POST['poll_title']))."' maxlength='200' /></td>
</tr>";
$option_count = (count(vartrue($_POST['poll_option'])) ? count($_POST['poll_option']) : 1);
$text .= "
<tr>
<td style='width:20%'>".LAN_FORUM_3031."</td>
<td style='width:80%'>
<td class='forumheader3' style='width:20%'>".LAN_FORUM_3031."</td>
<td class='forumheader3' style='width:80%'>
<div id='pollsection'>";
for($count = 1; $count <= $option_count; $count++)
@ -758,15 +760,15 @@ class poll
</td>
</tr>
<tr>
<td style='width:20%'>".LAN_FORUM_3033."</td>
<td style='width:80%'>
<td class='forumheader3' style='width:20%'>".LAN_FORUM_3033."</td>
<td class='forumheader3' style='width:80%'>
<input type='radio' name='multipleChoice' value='1'".(vartrue($_POST['multipleChoice']) ? " checked='checked'" : "")." /> ".LAN_YES."&nbsp;&nbsp;
<input type='radio' name='multipleChoice' value='0'".(!$_POST['multipleChoice'] ? " checked='checked'" : "")." /> ".LAN_NO."
</td>
</tr>
<tr>
<td style='width:30%'>".LAN_FORUM_3034."</td>
<td>
<td class='forumheader3'style='width:30%'>".LAN_FORUM_3034."</td>
<td class='forumheader3'>
<input type='radio' name='storageMethod' value='0'".(!vartrue($_POST['storageMethod']) ? " checked='checked'" : "")." /> ".LAN_FORUM_3035."<br />
<input type='radio' name='storageMethod' value='1'".($_POST['storageMethod'] == 1 ? " checked='checked'" : "")." /> ".LAN_FORUM_3036."<br />
<input type='radio' name='storageMethod' value='2'".($_POST['storageMethod'] ==2 ? " checked='checked'" : "")." /> ".LAN_FORUM_3037."

View File

@ -0,0 +1,179 @@
tinymce.addI18n('en_GB',{
"Cut": "Cut",
"Header 2": "Header 2",
"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.",
"Div": "Div",
"Paste": "Paste",
"Close": "Close",
"Font Family": "Font Family",
"Pre": "Pre",
"Align right": "Align right",
"New document": "New document",
"Blockquote": "Blockquote",
"Numbered list": "Numbered list",
"Increase indent": "Increase indent",
"Formats": "Formats",
"Headers": "Headers",
"Select all": "Select all",
"Header 3": "Header 3",
"Blocks": "Blocks",
"Undo": "Undo",
"Strikethrough": "Strike-through",
"Bullet list": "Bullet list",
"Header 1": "Header 1",
"Superscript": "Superscript",
"Clear formatting": "Clear formatting",
"Font Sizes": "Font Sizes",
"Subscript": "Subscript",
"Header 6": "Header 6",
"Redo": "Redo",
"Paragraph": "Paragraph",
"Ok": "Ok",
"Bold": "Bold",
"Code": "Code",
"Italic": "Italic",
"Align center": "Align centre",
"Header 5": "Header 5",
"Decrease indent": "Decrease indent",
"Header 4": "Header 4",
"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.",
"Underline": "Underline",
"Cancel": "Cancel",
"Justify": "Justify",
"Inline": "Inline",
"Copy": "Copy",
"Align left": "Align left",
"Visual aids": "Visual aids",
"Lower Greek": "Lower Greek",
"Square": "Square",
"Default": "Default",
"Lower Alpha": "Lower Alpha",
"Circle": "Circle",
"Disc": "Disc",
"Upper Alpha": "Upper Alpha",
"Upper Roman": "Upper Roman",
"Lower Roman": "Lower Roman",
"Name": "Name",
"Anchor": "Anchor",
"You have unsaved changes are you sure you want to navigate away?": "You have unsaved changes are you sure you want to navigate away?",
"Restore last draft": "Restore last draft",
"Special character": "Special character",
"Source code": "Source code",
"Right to left": "Right to left",
"Left to right": "Left to right",
"Emoticons": "Emoticons",
"Robots": "Robots",
"Document properties": "Document properties",
"Title": "Title",
"Keywords": "Keywords",
"Encoding": "Encoding",
"Description": "Description",
"Author": "Author",
"Fullscreen": "Full-screen",
"Horizontal line": "Horizontal line",
"Horizontal space": "Horizontal space",
"Insert\/edit image": "Insert\/edit image",
"General": "General",
"Advanced": "Advanced",
"Source": "Source",
"Border": "Border",
"Constrain proportions": "Constrain proportions",
"Vertical space": "Vertical space",
"Image description": "Image description",
"Style": "Style",
"Dimensions": "Dimensions",
"Insert image": "Insert image",
"Insert date\/time": "Insert date\/time",
"Remove link": "Remove link",
"Url": "URL",
"Text to display": "Text to display",
"Anchors": "Anchors",
"Insert link": "Insert link",
"New window": "New window",
"None": "None",
"The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?",
"Target": "Target",
"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",
"Insert\/edit link": "Insert\/edit link",
"Insert\/edit video": "Insert\/edit video",
"Poster": "Poster",
"Alternative source": "Alternative source",
"Paste your embed code below:": "Paste your embed code below:",
"Insert video": "Insert video",
"Embed": "Embed",
"Nonbreaking space": "Non-breaking space",
"Page break": "Page break",
"Paste as text": "Paste as text",
"Preview": "Preview",
"Print": "Print",
"Save": "Save",
"Could not find the specified string.": "Could not find the specified string.",
"Replace": "Replace",
"Next": "Next",
"Whole words": "Whole words",
"Find and replace": "Find and replace",
"Replace with": "Replace with",
"Find": "Find",
"Replace all": "Replace all",
"Match case": "Match case",
"Prev": "Prev",
"Spellcheck": "Spell-check",
"Finish": "Finish",
"Ignore all": "Ignore all",
"Ignore": "Ignore",
"Insert row before": "Insert row before",
"Rows": "Rows",
"Height": "Height",
"Paste row after": "Paste row after",
"Alignment": "Alignment",
"Column group": "Column group",
"Row": "Row",
"Insert column before": "Insert column before",
"Split cell": "Split cell",
"Cell padding": "Cell padding",
"Cell spacing": "Cell spacing",
"Row type": "Row type",
"Insert table": "Insert table",
"Body": "Body",
"Caption": "Caption",
"Footer": "Footer",
"Delete row": "Delete row",
"Paste row before": "Paste row before",
"Scope": "Scope",
"Delete table": "Delete table",
"Header cell": "Header cell",
"Column": "Column",
"Cell": "Cell",
"Header": "Header",
"Cell type": "Cell type",
"Copy row": "Copy row",
"Row properties": "Row properties",
"Table properties": "Table properties",
"Row group": "Row group",
"Right": "Right",
"Insert column after": "Insert column after",
"Cols": "Cols",
"Insert row after": "Insert row after",
"Width": "Width",
"Cell properties": "Cell properties",
"Left": "Left",
"Cut row": "Cut row",
"Delete column": "Delete column",
"Center": "Centre",
"Merge cells": "Merge cells",
"Insert template": "Insert template",
"Templates": "Templates",
"Background color": "Background colour",
"Text color": "Text colour",
"Show blocks": "Show blocks",
"Show invisible characters": "Show invisible characters",
"Words: {0}": "Words: {0}",
"Insert": "Insert",
"File": "File",
"Edit": "Edit",
"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help",
"Tools": "Tools",
"View": "View",
"Table": "Table",
"Format": "Format"
});

View File

@ -363,13 +363,15 @@ class wysiwyg
$this->configName = $config['@attributes']['name'];
$tinyMceLanguage = $this->tinymce_lang();
unset($config['@attributes']);
$ret = array(
'selector' => '.e-wysiwyg',
// 'editor_selector' => 'advancedEditor',
'language' => $this->tinymce_lang()
'language' => $tinyMceLanguage,
'language_url' => SITEURLBASE.e_PLUGIN_ABS."tinymce4/langs/" . $tinyMceLanguage . ".js"
);
// if(e_ADMIN_AREA)