mirror of
https://github.com/e107inc/e107.git
synced 2025-01-16 20:28:28 +01:00
Code cleanup
This commit is contained in:
parent
2b8a3cff60
commit
5b82c292b1
@ -146,7 +146,7 @@ if(e_AJAX_REQUEST) // TODO improve security
|
||||
* Fix for issue e107inc/e107#3154 (Comments not refreshing on submission)
|
||||
* Missing 6th argument ($subject) caused an exception
|
||||
*/
|
||||
$ret['html'] .= e107::getComment()->render_comment($row,'comments','comment',intval($_POST['itemid']),$width, $tp->toDB($clean_subject));
|
||||
$ret['html'] .= e107::getComment()->render_comment($row,'comments','comment', (int) $_POST['itemid'], $width, $tp->toDB($clean_subject));
|
||||
$ret['html'] .= "</li>\n<!-- end Appended -->\n";
|
||||
|
||||
$ret['error'] = false;
|
||||
|
@ -357,17 +357,18 @@ class page_chapters_form_ui extends e_admin_form_ui
|
||||
{
|
||||
$fieldAmount = (deftrue('e_DEBUG')) ? 20 :10;
|
||||
|
||||
|
||||
/*
|
||||
if($mode == 'read')
|
||||
{
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
if($mode == 'write')
|
||||
{
|
||||
return e107::getCustomFields()->loadConfig($curVal)->renderConfigForm('chapter_fields');
|
||||
}
|
||||
|
||||
/*
|
||||
if($mode == 'filter')
|
||||
{
|
||||
return;
|
||||
@ -376,6 +377,8 @@ class page_chapters_form_ui extends e_admin_form_ui
|
||||
{
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -834,13 +837,13 @@ class page_admin_ui extends e_admin_ui
|
||||
{
|
||||
$this->fields['page_chapter']['writeParms']['ajax'] = array('src'=>e_SELF."?mode=page&action=chapter-change",'target'=>'tabadditional');
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
if(e_AJAX_REQUEST)
|
||||
{
|
||||
// @todo insert placeholder examples in params input when 'type' dropdown value is changed
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@ -1008,13 +1011,13 @@ class page_admin_ui extends e_admin_ui
|
||||
}
|
||||
}
|
||||
|
||||
function afterCreate($newdata,$olddata, $id)
|
||||
function afterCreate($new_data, $old_data, $id)
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
$sql = e107::getDb();
|
||||
$mes = e107::getMessage();
|
||||
|
||||
$menu_name = $tp->toDB($newdata['menu_name']); // not to be confused with menu-caption.
|
||||
$menu_name = $tp->toDB($new_data['menu_name']); // not to be confused with menu-caption.
|
||||
$menu_path = intval($id);
|
||||
|
||||
if (!$sql->select('menus', 'menu_name', "`menu_path` = ".$menu_path." LIMIT 1"))
|
||||
@ -1028,41 +1031,41 @@ class page_admin_ui extends e_admin_ui
|
||||
}
|
||||
}
|
||||
|
||||
return $newdata;
|
||||
return $new_data;
|
||||
|
||||
}
|
||||
|
||||
function beforeCreate($newdata,$olddata)
|
||||
function beforeCreate($new_data, $old_data)
|
||||
{
|
||||
|
||||
$newdata = e107::getCustomFields()->processDataPost('page_fields',$newdata);
|
||||
$new_data = e107::getCustomFields()->processDataPost('page_fields',$new_data);
|
||||
|
||||
$newdata['menu_name'] = preg_replace('/[^\w\-*]/','-',$newdata['menu_name']);
|
||||
$new_data['menu_name'] = preg_replace('/[^\w\-*]/','-',$new_data['menu_name']);
|
||||
|
||||
if(empty($newdata['page_sef']))
|
||||
if(empty($new_data['page_sef']))
|
||||
{
|
||||
if(!empty($newdata['page_title']))
|
||||
if(!empty($new_data['page_title']))
|
||||
{
|
||||
$newdata['page_sef'] = eHelper::title2sef($newdata['page_title']);
|
||||
$new_data['page_sef'] = eHelper::title2sef($new_data['page_title']);
|
||||
}
|
||||
elseif(!empty($newdata['menu_name']))
|
||||
elseif(!empty($new_data['menu_name']))
|
||||
{
|
||||
$newdata['page_sef'] = eHelper::title2sef($newdata['menu_name']);
|
||||
$new_data['page_sef'] = eHelper::title2sef($new_data['menu_name']);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$newdata['page_sef'] = eHelper::secureSef($newdata['page_sef']);
|
||||
$new_data['page_sef'] = eHelper::secureSef($new_data['page_sef']);
|
||||
}
|
||||
|
||||
|
||||
// $newdata = $this->processCustomFieldData($newdata);
|
||||
// $new_data = $this->processCustomFieldData($new_data);
|
||||
|
||||
|
||||
$sef = e107::getParser()->toDB($newdata['page_sef']);
|
||||
$sef = e107::getParser()->toDB($new_data['page_sef']);
|
||||
|
||||
if(isset($newdata['page_title']) && isset($newdata['menu_name']) && empty($newdata['page_title']) && empty($newdata['menu_name']))
|
||||
if(isset($new_data['page_title']) && isset($new_data['menu_name']) && empty($new_data['page_title']) && empty($new_data['menu_name']))
|
||||
{
|
||||
e107::getMessage()->addError(CUSLAN_79);
|
||||
return false;
|
||||
@ -1075,43 +1078,41 @@ class page_admin_ui extends e_admin_ui
|
||||
}
|
||||
|
||||
|
||||
return $newdata;
|
||||
return $new_data;
|
||||
}
|
||||
|
||||
function beforeUpdate($newdata,$olddata, $id)
|
||||
function beforeUpdate($new_data,$old_data, $id)
|
||||
{
|
||||
|
||||
if(isset($newdata['page_title']) && isset($newdata['menu_name']) && empty($newdata['page_title']) && empty($newdata['menu_name']))
|
||||
if(isset($new_data['page_title']) && isset($new_data['menu_name']) && empty($new_data['page_title']) && empty($new_data['menu_name']))
|
||||
{
|
||||
e107::getMessage()->addError(CUSLAN_79);
|
||||
return false;
|
||||
}
|
||||
$newdata = e107::getCustomFields()->processDataPost('page_fields',$newdata);
|
||||
$new_data = e107::getCustomFields()->processDataPost('page_fields',$new_data);
|
||||
|
||||
if(isset($newdata['menu_name']))
|
||||
if(isset($new_data['menu_name']))
|
||||
{
|
||||
$newdata['menu_name'] = preg_replace('/[^\w\-*]/','',$newdata['menu_name']);
|
||||
$new_data['menu_name'] = preg_replace('/[^\w\-*]/','',$new_data['menu_name']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return $newdata;
|
||||
return $new_data;
|
||||
}
|
||||
|
||||
// Update Menu in Menu Table
|
||||
function afterUpdate($newdata,$olddata,$id)
|
||||
function afterUpdate($new_data, $old_data, $id)
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
$sql = e107::getDb();
|
||||
$mes = e107::getMessage();
|
||||
|
||||
if(!isset($newdata['menu_name']))
|
||||
if(!isset($new_data['menu_name']))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
$menu_name = $tp->toDB($newdata['menu_name']); // not to be confused with menu-caption.
|
||||
$menu_name = $tp->toDB($new_data['menu_name']); // not to be confused with menu-caption.
|
||||
|
||||
if ($sql->select('menus', 'menu_name', "`menu_path` = ".$id." LIMIT 1"))
|
||||
{
|
||||
@ -1124,7 +1125,7 @@ class page_admin_ui extends e_admin_ui
|
||||
else // missing menu record so create it.
|
||||
{
|
||||
$mes->addDebug(CUSLAN_75." ".$id);
|
||||
return $this->afterCreate($newdata,$olddata,$id);
|
||||
return $this->afterCreate($new_data,$old_data,$id);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -80,7 +80,10 @@ if(e_AJAX_REQUEST )
|
||||
{
|
||||
|
||||
session_write_close();
|
||||
while (@ob_end_clean());
|
||||
while (ob_get_length() !== false) // destroy all ouput buffering
|
||||
{
|
||||
ob_end_clean();
|
||||
}
|
||||
|
||||
if(varset($_GET['mode']) == 'backup') //FIXME - not displaying progress until complete. Use e-progress?
|
||||
{
|
||||
@ -541,10 +544,11 @@ class system_tools
|
||||
$mes->addError($sql->getLastErrorText());
|
||||
return false;
|
||||
}
|
||||
else
|
||||
/* else
|
||||
{
|
||||
// $mes->addDebug($sql_table);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -700,7 +700,7 @@ class eurl_admin_ui extends e_admin_controller_ui
|
||||
|
||||
/**
|
||||
* Set extended (UI) Form instance
|
||||
* @return e_admin_ui
|
||||
* @return eurl_admin_ui
|
||||
*/
|
||||
public function _setUI()
|
||||
{
|
||||
@ -712,7 +712,7 @@ class eurl_admin_ui extends e_admin_controller_ui
|
||||
|
||||
/**
|
||||
* Set Config object
|
||||
* @return e_admin_ui
|
||||
* @return eurl_admin_ui
|
||||
*/
|
||||
protected function _setConfig()
|
||||
{
|
||||
@ -875,12 +875,12 @@ class eurl_admin_form_ui extends e_admin_form_ui
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if(strpos($path,'noid')!==false)
|
||||
{
|
||||
// $exampleUrl .= " ‡"; //XXX Add footer - denotes more CPU required. ?
|
||||
$exampleUrl .= " ‡"; //XXX Add footer - denotes more CPU required. ?
|
||||
}
|
||||
|
||||
*/
|
||||
$selected = varset($obj->current[$module]) == $location ? "selected='selected'" : '';
|
||||
$opt .= "<option value='{$location}' {$selected} >".$diz.": ".$exampleUrl[0]."</option>";
|
||||
|
||||
|
@ -57,10 +57,7 @@ if(isset($_POST['submit_cancel_show']))
|
||||
|
||||
e107::coreLan('image', true);
|
||||
|
||||
if($_GET['action'] == 'dialog')
|
||||
{
|
||||
// e107::css('inline', "body { background-color: #373737 } ");
|
||||
}
|
||||
|
||||
|
||||
if(vartrue($_GET['action']) == 'nav' && e_AJAX_REQUEST) //XXX Doesn't work correctly inside the class for some reason
|
||||
{
|
||||
@ -335,7 +332,7 @@ class media_cat_form_ui extends e_admin_form_ui
|
||||
$owner = $this->getController()->getListModel()->get('media_cat_owner');
|
||||
if(!in_array($owner,$this->restrictedOwners))
|
||||
{
|
||||
return $this->renderValue('options',$value,'',$id);
|
||||
return $this->renderValue('options',$value,null,$id);
|
||||
}
|
||||
|
||||
|
||||
@ -688,7 +685,7 @@ class media_form_ui extends e_admin_form_ui
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = $this->renderValue('options',$value,'',$id);
|
||||
$text = $this->renderValue('options',$value,null,$id);
|
||||
}
|
||||
|
||||
return "<div class='nowrap'>".$text."</div>";
|
||||
@ -1083,14 +1080,15 @@ class media_admin_ui extends e_admin_ui
|
||||
exit;
|
||||
}
|
||||
*/
|
||||
/*
|
||||
if($this->getAction() == 'nav' )
|
||||
{
|
||||
//echo $this->navPage();\
|
||||
// $this->getResponse()->setIframeMod(); // disable header/footer menus etc.
|
||||
// print_a($_GET);
|
||||
echo $this->navPage();\
|
||||
$this->getResponse()->setIframeMod(); // disable header/footer menus etc.
|
||||
print_a($_GET);
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
if(varset($_POST['batch_import_selected']))
|
||||
@ -1440,11 +1438,6 @@ class media_admin_ui extends e_admin_ui
|
||||
return $frm->tabs($tabs, array('class'=>'media-manager'));
|
||||
}
|
||||
|
||||
if(deftrue('e_DEBUG_MEDIAPICKER'))
|
||||
{
|
||||
// return $this->mediaManagerTabs();
|
||||
}
|
||||
|
||||
|
||||
$youtubeActive = 'inactive';
|
||||
|
||||
@ -3393,10 +3386,10 @@ class media_admin_ui extends e_admin_ui
|
||||
|
||||
|
||||
// Resize on Import Routine ------------------------
|
||||
if(vartrue($img_import_w) && vartrue($img_import_h))
|
||||
{
|
||||
// if(vartrue($img_import_w) && vartrue($img_import_h))
|
||||
// {
|
||||
// $this->resizeImage($file,$img_import_w,$img_import_h);
|
||||
}
|
||||
// }
|
||||
// End Resize routine. ---------------------
|
||||
|
||||
$f = $fl->getFileInfo($oldpath);
|
||||
|
@ -517,10 +517,10 @@ class adminstyle_infopanel
|
||||
$sql = e107::getDb();
|
||||
$tp = e107::getParser();
|
||||
|
||||
if(!check_class('B')) // XXX problems?
|
||||
{
|
||||
//if(!check_class('B')) // XXX problems?
|
||||
// {
|
||||
// return;
|
||||
}
|
||||
// }
|
||||
|
||||
if(!$rows = $sql->retrieve('comments','*','comment_blocked=2 ORDER BY comment_id DESC LIMIT 25',true) )
|
||||
{
|
||||
|
@ -1770,10 +1770,10 @@ class lanDeveloper
|
||||
$label .= " <span class='label label-inverse'>".LAN_DISABLED."</span>";
|
||||
}
|
||||
|
||||
if(empty($found) && $disabled === true)
|
||||
{
|
||||
// if(empty($found) && $disabled === true)
|
||||
// {
|
||||
// $needle = "<span class='e-tip' style='cursor:help' title=\"".$value."\">".$needle."</span>";
|
||||
}
|
||||
// }
|
||||
|
||||
return "<tr><td class='".$class."' style='width:15%;$color'>".$needle ."</td><td>".$label. "</td>
|
||||
<td class='".$class."'>".print_r($value,true)."</td>
|
||||
@ -1786,11 +1786,11 @@ class lanDeveloper
|
||||
|
||||
/**
|
||||
* Compare Language File against script and find unused LANs
|
||||
* @param object $lanfile
|
||||
* @param object $script
|
||||
* @return string|boolean FALSE on error
|
||||
* @param array|string $lanfile
|
||||
* @param array|string $script
|
||||
* @return array|bool|string
|
||||
*/
|
||||
function unused($lanfile,$script,$reverse=false)
|
||||
function unused($lanfile, $script, $reverse=false)
|
||||
{
|
||||
|
||||
$mes = e107::getMessage();
|
||||
@ -1976,7 +1976,7 @@ class lanDeveloper
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -103,12 +103,12 @@ class links_admin_ui extends e_admin_ui
|
||||
protected $_link_array = null;
|
||||
|
||||
|
||||
function afterCreate($newdata,$olddata, $id) //FIXME needs to work after inline editing too.
|
||||
function afterCreate($new_data, $old_data, $id) //FIXME needs to work after inline editing too.
|
||||
{
|
||||
e107::getCache()->clearAll('content');
|
||||
}
|
||||
|
||||
function afterUpdate($newdata,$olddata, $id) //FIXME needs to work after inline editing too.
|
||||
function afterUpdate($new_data, $old_data, $id) //FIXME needs to work after inline editing too.
|
||||
{
|
||||
e107::getCache()->clearAll('content');
|
||||
}
|
||||
@ -342,11 +342,11 @@ class links_admin_ui extends e_admin_ui
|
||||
$pid = intval($this->getPosted('link_parent'));
|
||||
$sublink = $this->sublink_data($subtype);
|
||||
|
||||
if(!$pid)
|
||||
{
|
||||
// if(!$pid)
|
||||
// {
|
||||
// $mes->addWarning(LCLAN_109);
|
||||
// return;
|
||||
}
|
||||
// }
|
||||
if(!$subtype)
|
||||
{
|
||||
$mes->addWarning(LCLAN_110);
|
||||
@ -456,15 +456,12 @@ class links_admin_ui extends e_admin_ui
|
||||
}
|
||||
}
|
||||
|
||||
if($message) // TODO admin log
|
||||
{
|
||||
// sitelinks_adminlog('01', $message); // 'Sublinks generated'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Product tree model
|
||||
* @return links_model_admin_tree
|
||||
* @return links_admin_ui|links_model_admin_tree
|
||||
*/
|
||||
public function _setTreeModel()
|
||||
{
|
||||
|
@ -141,13 +141,6 @@ if(e_AJAX_REQUEST)
|
||||
|
||||
|
||||
|
||||
if(vartrue($_GET['mode']) == "progress")
|
||||
{
|
||||
// session_write_close();
|
||||
// sendProgress();
|
||||
// exit;
|
||||
}
|
||||
|
||||
|
||||
$mes = e107::getMessage();
|
||||
$tp = e107::getParser();
|
||||
@ -373,7 +366,7 @@ class mailout_main_ui extends e_admin_ui
|
||||
);
|
||||
|
||||
|
||||
function afterDelete($del_data,$id, $deleted_check)
|
||||
function afterDelete($deleted_data, $id, $deleted_check)
|
||||
{
|
||||
$result = e107::getDb()->delete('mail_recipients', 'mail_detail_id = '.intval($id));
|
||||
// $this->getModel()->addMessageDebug("Deleted ".$result." recipients from the deleted email #".$id);
|
||||
@ -656,17 +649,17 @@ class mailout_main_ui extends e_admin_ui
|
||||
}
|
||||
|
||||
|
||||
function afterCopy($firstInsert, $copied)
|
||||
function afterCopy($result, $copied)
|
||||
{
|
||||
$num = array();
|
||||
$count = 0;
|
||||
foreach($copied as $tmp)
|
||||
{
|
||||
$num[] = ($firstInsert + $count);
|
||||
$num[] = ($result + $count);
|
||||
$count ++;
|
||||
}
|
||||
|
||||
if(!empty($firstInsert))
|
||||
if(!empty($result))
|
||||
{
|
||||
$update = array(
|
||||
'mail_content_status' => MAIL_STATUS_TEMP,
|
||||
@ -1359,10 +1352,7 @@ class mailout_main_ui extends e_admin_ui
|
||||
{
|
||||
$status = LAN_MAILOUT_162;
|
||||
}
|
||||
else
|
||||
{
|
||||
// $text .= " ".ADMIN_TRUE_ICON;
|
||||
}
|
||||
|
||||
|
||||
if(!empty($status))
|
||||
{
|
||||
@ -1821,15 +1811,15 @@ class mailout_recipients_ui extends e_admin_ui
|
||||
/**
|
||||
* Fix Total counts after recipient deletion.
|
||||
*/
|
||||
public function afterDelete($data, $id, $deleted_check)
|
||||
public function afterDelete($deleted_data, $id, $deleted_check)
|
||||
{
|
||||
|
||||
if($data['mail_status'] < MAIL_STATUS_PENDING)
|
||||
if($deleted_data['mail_status'] < MAIL_STATUS_PENDING)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$query = "mail_total_count = mail_total_count - 1, mail_togo_count = mail_togo_count - 1 WHERE mail_source_id = ".intval($data['mail_detail_id'])." LIMIT 1";
|
||||
$query = "mail_total_count = mail_total_count - 1, mail_togo_count = mail_togo_count - 1 WHERE mail_source_id = ".intval($deleted_data['mail_detail_id'])." LIMIT 1";
|
||||
|
||||
if(!e107::getDb()->update('mail_content',$query))
|
||||
{
|
||||
@ -1955,11 +1945,11 @@ $targetId = intval(varset($_GET['t'],0));
|
||||
// Create mail admin object, load all mail handlers
|
||||
$mailAdmin = new mailoutAdminClass($action); // This decodes parts of the query using $_GET syntax
|
||||
e107::setRegistry('_mailout_admin', $mailAdmin);
|
||||
if ($mailAdmin->loadMailHandlers() == 0)
|
||||
{ // No mail handlers loaded
|
||||
//if ($mailAdmin->loadMailHandlers() == 0)
|
||||
//{ // No mail handlers loaded
|
||||
// echo 'No mail handlers loaded!!';
|
||||
//exit;
|
||||
}
|
||||
//}
|
||||
|
||||
require_once(e_ADMIN.'auth.php');
|
||||
|
||||
@ -2239,6 +2229,7 @@ switch ($action)
|
||||
case 'mailshowtemplate' :
|
||||
if (isset($_POST['etrigger_ecolumns']))
|
||||
{
|
||||
$nothing='';
|
||||
// $mailAdmin->mailbodySaveColumnPref($action);
|
||||
}
|
||||
break;
|
||||
@ -2336,10 +2327,7 @@ switch ($midAction)
|
||||
break;
|
||||
}
|
||||
|
||||
if(isset($_POST['email_sendnow']))
|
||||
{
|
||||
// sendImmediately($mailId);
|
||||
}
|
||||
|
||||
|
||||
// --------------------- Display errors and results ------------------------
|
||||
if (is_array($errors) && (count($errors) > 0))
|
||||
|
@ -558,10 +558,10 @@ TEMPL;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
else
|
||||
{
|
||||
/*
|
||||
|
||||
|
||||
e107::js('footer-inline', "
|
||||
|
||||
@ -602,13 +602,13 @@ else
|
||||
");
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -398,10 +398,7 @@ class news_sub_form_ui extends e_admin_form_ui
|
||||
$text .= "<a class='btn btn-default btn-secondary btn-large' title=\"".LAN_NEWS_96."\" href='".e_SELF."?mode=main&action=create&sub={$id}'>".ADMIN_EXECUTE_ICON."</a>";
|
||||
// NWSLAN_103;
|
||||
}
|
||||
else // Already submitted;
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
$text .= $this->submit_image('etrigger_delete['.$id.']', $id, 'delete', LAN_DELETE.' [ ID: '.$id.' ]', array('class' => 'btn btn-default btn-secondary btn-large action delete'));
|
||||
$text .= "</div>";
|
||||
@ -1582,13 +1579,6 @@ class news_form_ui extends e_admin_form_ui
|
||||
// $text .= $frm->imagepicker('news_thumbnail[0]', $curval ,'','media=news&video=1');
|
||||
$thumbTmp = explode(",",$curval);
|
||||
|
||||
foreach($thumbTmp as $key=>$path)
|
||||
{
|
||||
if(!empty($path) && (strpos($path, ",") == false) && $path[0] != "{" && $tp->isVideo($path) === false )//BC compat
|
||||
{
|
||||
// $thumbTmp[$key] = "{e_IMAGE}newspost_images/".$path;
|
||||
}
|
||||
}
|
||||
|
||||
$text = "<div class='mediaselector-multi'>";
|
||||
$text .= $frm->imagepicker('news_thumbnail[0]', varset($thumbTmp[0]), varset($paths[0]), array('media' => 'news+', 'video' => 1, 'legacyPath' => '{e_IMAGE}newspost_images'));
|
||||
|
@ -103,15 +103,10 @@ class plugin_notify_admin_ui extends e_admin_ui
|
||||
|
||||
if(!empty($_POST['update']))
|
||||
{
|
||||
if($this-> update())
|
||||
if(!$this-> update())
|
||||
{
|
||||
// e107::getMessage()->addSuccess(LAN_UPDATED);
|
||||
e107::getMessage()->addError(LAN_UPDATED_FAILED);
|
||||
}
|
||||
else
|
||||
{
|
||||
e107::getMessage()->addError(LAN_UPDATED_FAILED);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -172,12 +167,12 @@ class plugin_notify_admin_ui extends e_admin_ui
|
||||
|
||||
// print_a($this->pluginConfig);
|
||||
|
||||
if ($recalibrate)
|
||||
{
|
||||
// if ($recalibrate)
|
||||
// {
|
||||
// $s_prefs = $tp -> toDB($this -> notify_prefs);
|
||||
// $s_prefs = $eArrayStorage -> WriteArray($s_prefs);
|
||||
// $sql -> db_Update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs'");
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@ -536,18 +531,11 @@ if(!empty($_GET['iframe']))
|
||||
|
||||
if (isset($_POST['update']))
|
||||
{
|
||||
if($nc -> update())
|
||||
if(!$nc -> update())
|
||||
{
|
||||
//$message = LAN_UPDATED;
|
||||
//$style = E_MESSAGE_SUCCESS;
|
||||
//$mes->addSuccess(LAN_UPDATED);
|
||||
}
|
||||
else
|
||||
{
|
||||
//$message = LAN_UPDATED_FAILED;
|
||||
//$style = E_MESSAGE_FAILED;
|
||||
$mes->addError(LAN_UPDATED_FAILED);
|
||||
}
|
||||
|
||||
//$emessage->add($message, $style);
|
||||
|
||||
// $ns -> tablerender($message,"<div style='text-align:center'>".$message."</div>");
|
||||
@ -621,12 +609,12 @@ class notify_config
|
||||
|
||||
// print_a($this->pluginConfig);
|
||||
|
||||
if ($recalibrate)
|
||||
{
|
||||
//if ($recalibrate)
|
||||
//{
|
||||
// $s_prefs = $tp -> toDB($this -> notify_prefs);
|
||||
// $s_prefs = $eArrayStorage -> WriteArray($s_prefs);
|
||||
// $sql -> db_Update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs'");
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
function prefCleanup()
|
||||
|
@ -976,9 +976,9 @@ class plugin_form_ui extends e_admin_form_ui
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if($var['menuName'])
|
||||
// else
|
||||
// {
|
||||
/* if($var['menuName'])
|
||||
{
|
||||
// $text .= EPL_NOINSTALL . str_replace("..", "", e_PLUGIN . $var['plugin_path']) . "/ " . EPL_DIRECTORY;
|
||||
}
|
||||
@ -989,8 +989,8 @@ class plugin_form_ui extends e_admin_form_ui
|
||||
{
|
||||
// e107::getDb()->delete('plugin', "plugin_installflag=0 AND (plugin_path='{$var['plugin_path']}' OR plugin_path='{$var['plugin_path']}/' ) ");
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
// }
|
||||
|
||||
if($var['plugin_version'] != $var['plugin_version_file'] && $var['plugin_installflag'])
|
||||
{
|
||||
@ -1965,16 +1965,17 @@ class pluginLanguage extends e_admin_ui
|
||||
foreach($lines as $ln=>$row)
|
||||
{
|
||||
$row = trim($row);
|
||||
if(substr($row,0,2) == '/*')
|
||||
{
|
||||
|
||||
// if(substr($row,0,2) == '/*')
|
||||
// {
|
||||
// $skip =true; ;
|
||||
|
||||
}
|
||||
if(substr($row,0,2) == '*/')
|
||||
{
|
||||
// }
|
||||
// if(substr($row,0,2) == '*/')
|
||||
// {
|
||||
// $skip =false;
|
||||
// continue;
|
||||
}
|
||||
// }
|
||||
|
||||
if(empty($row) /*|| $skip == true*/ || substr($row,0,5) == '<?php' || substr($row,0,2) == '?>' || substr($row,0,2)=='//')
|
||||
{
|
||||
@ -4035,10 +4036,7 @@ $content .= '}';
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//$mes->addError("Addon source-file was empty: ".$addon);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -60,11 +60,7 @@ if(isset($_POST['updatesettings']))
|
||||
|
||||
$pref = e107::getConfig('core', true, true)->getPref();
|
||||
|
||||
if(!e_AJAX_REQUEST)
|
||||
{
|
||||
// header("location:".e_SELF);
|
||||
// exit();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
require_once("auth.php");
|
||||
|
@ -1223,10 +1223,10 @@ function update_706_to_800($type='')
|
||||
// catch_error($sql);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// else
|
||||
// {
|
||||
// Got a strange error here
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@ -1650,10 +1650,10 @@ function update_706_to_800($type='')
|
||||
$med->import('page',e_IMAGE.'custom');
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// else
|
||||
// {
|
||||
// $log->addDebug("Media COUNT was ".$count. " LINE: ".__LINE__);
|
||||
}
|
||||
// }
|
||||
|
||||
// Check for Legacy Download Images.
|
||||
|
||||
@ -1735,12 +1735,14 @@ function update_706_to_800($type='')
|
||||
(0, '_icon', '_icon_48', 'Icons 48px', 'Available where icons are used in admin. ', 253, '', 0),
|
||||
(0, '_icon', '_icon_64', 'Icons 64px', 'Available where icons are used in admin. ', 253, '', 0);
|
||||
";
|
||||
|
||||
if(!$sql->gen($query))
|
||||
{
|
||||
|
||||
$sql->gen($query);
|
||||
|
||||
// if(!$sql->gen($query))
|
||||
// {
|
||||
// echo "mysyql error";
|
||||
// error or already exists.
|
||||
}
|
||||
// }
|
||||
|
||||
$med->importIcons(e_PLUGIN);
|
||||
$med->importIcons(e_IMAGE."icons/");
|
||||
|
@ -172,7 +172,7 @@ e107::coreLan('userclass2', true);
|
||||
e107::getUserClass()->clearCache();
|
||||
}
|
||||
|
||||
public function afterDelete($data,$id, $check = false)
|
||||
public function afterDelete($deleted_data,$id, $deleted_check = false)
|
||||
{
|
||||
e107::getUserClass()->clearCache();
|
||||
}
|
||||
@ -365,16 +365,11 @@ e107::coreLan('userclass2', true);
|
||||
<table class='table table-bordered adminform'>
|
||||
<tr><td>".UCSLAN_43."</td><td>";
|
||||
|
||||
if (count($icn) > 0)
|
||||
{
|
||||
// $text .= implode(', ',$icn);
|
||||
}
|
||||
else
|
||||
if (count($icn) < 1)
|
||||
{
|
||||
$text .= LAN_NONE;
|
||||
}
|
||||
|
||||
|
||||
if ($class_text)
|
||||
{
|
||||
$text .= $class_text."</td></tr><tr><td>";
|
||||
@ -488,11 +483,12 @@ e107::coreLan('userclass2', true);
|
||||
|
||||
function userclass_perms($curVal,$mode)
|
||||
{
|
||||
if($mode == 'read')
|
||||
{
|
||||
// if($mode == 'read')
|
||||
// {
|
||||
// $uid = $this->getController()->getModel()->get('user_id');
|
||||
// return e107::getUserPerms()->renderPerms($curVal,$uid);
|
||||
}
|
||||
// }
|
||||
|
||||
if($mode == 'write')
|
||||
{
|
||||
$prm = e107::getUserPerms();
|
||||
@ -500,7 +496,7 @@ e107::coreLan('userclass2', true);
|
||||
|
||||
}
|
||||
|
||||
return '';
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -466,7 +466,7 @@ class users_admin_ui extends e_admin_ui
|
||||
}
|
||||
|
||||
|
||||
public function afterDelete($deletedData, $id, $deleted_check)
|
||||
public function afterDelete($deleted_data, $id, $deleted_check)
|
||||
{
|
||||
if(!empty($id))
|
||||
{
|
||||
@ -477,7 +477,7 @@ class users_admin_ui extends e_admin_ui
|
||||
e107::getCache()->clear('online_menu_member_total');
|
||||
|
||||
// Trigger admin_user_delete
|
||||
e107::getEvent()->trigger('admin_user_delete', $deletedData);
|
||||
e107::getEvent()->trigger('admin_user_delete', $deleted_data);
|
||||
}
|
||||
|
||||
}
|
||||
@ -2880,7 +2880,7 @@ class users_admin_form_ui extends e_admin_form_ui
|
||||
// natsort($imageList);
|
||||
}
|
||||
|
||||
public function afterDelete($data, $id, $deleted_check)
|
||||
public function afterDelete($deleted_data, $id, $deleted_check)
|
||||
{
|
||||
e107::getCache()->clear_sys('nomd5_user_ranks');
|
||||
}
|
||||
|
@ -620,14 +620,12 @@ e107::js('footer-inline', js());
|
||||
|
||||
if ($tmp[$f]['type']=="db field")
|
||||
{
|
||||
if (is_readable(e_CORE.'sql/extended_'.$f.'.php'))
|
||||
{
|
||||
// $ret .= ($this->process_sql($f)) ? LAN_CREATED." user_extended_{$f}<br />" : LAN_CREATED_FAILED." user_extended_{$f}<br />";
|
||||
}
|
||||
else
|
||||
if (!is_readable(e_CORE.'sql/extended_'.$f.'.php'))
|
||||
{
|
||||
$ret .= str_replace('[x]',e_CORE.'sql/extended_'.$f.'.php',EXTLAN_78);
|
||||
// $ret .= ($this->process_sql($f)) ? LAN_CREATED." user_extended_{$f}<br />" : LAN_CREATED_FAILED." user_extended_{$f}<br />";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -444,8 +444,9 @@ class e_admin_log
|
||||
* USER AUDIT ENTRY
|
||||
*--------------------------------------
|
||||
* Log user-related events
|
||||
* @param int $event_code is a defined constant (see above) which specifies the event
|
||||
* @param array $event_data is an array of data fields whose keys and values are logged (usually user data, but doesn't have to be - can add messages here)
|
||||
*@param string $event_type
|
||||
* @param int $event_code is a defined constant (see above) which specifies the event
|
||||
* @param array|string $event_data is an array of data fields whose keys and values are logged (usually user data, but doesn't have to be - can add messages here)
|
||||
* @param int $id
|
||||
* @param string $u_name
|
||||
* both $id and $u_name are left blank except for admin edits and user login, where they specify the id and login name of the 'target' user
|
||||
|
@ -3694,7 +3694,7 @@ class eRequest
|
||||
/**
|
||||
* Set current route
|
||||
* @param string $route module/controller/action
|
||||
* @return eRequest
|
||||
* @return array|eRequest
|
||||
*/
|
||||
public function setRoute($route)
|
||||
{
|
||||
@ -3762,7 +3762,7 @@ class eRequest
|
||||
/**
|
||||
* Populate module, controller and action from route string
|
||||
* @param string $route
|
||||
* @return array route data
|
||||
* @return array|eRequest
|
||||
*/
|
||||
public function initFromRoute($route)
|
||||
{
|
||||
|
@ -49,7 +49,7 @@ class e_benchmark
|
||||
|
||||
/**
|
||||
* Start timer
|
||||
* @return benchmark
|
||||
* @return e_benchmark
|
||||
*/
|
||||
public function start()
|
||||
{
|
||||
@ -59,7 +59,7 @@ class e_benchmark
|
||||
|
||||
/**
|
||||
* Stop timer
|
||||
* @return benchmark
|
||||
* @return e_benchmark
|
||||
*/
|
||||
public function end()
|
||||
{
|
||||
@ -81,7 +81,7 @@ class e_benchmark
|
||||
* @param string $id identifier of the current benchmark event e.g. 'thumbnail.create'
|
||||
* @param string $heading additional data to be shown in the log (header) e.g. '[Some Event]'
|
||||
* @param boolean $append overwrite or append to the log file
|
||||
* @return benchmark
|
||||
* @return e_benchmark
|
||||
*/
|
||||
public function logResult($id, $heading = '', $append = true)
|
||||
{
|
||||
|
@ -151,14 +151,14 @@ class comment
|
||||
/**
|
||||
* Display the comment editing form
|
||||
*
|
||||
* @param unknown_type $action
|
||||
* @param unknown_type $table
|
||||
* @param unknown_type $id
|
||||
* @param unknown_type $subject
|
||||
* @param unknown_type $content_type
|
||||
* @param unknown_type $return
|
||||
* @param unknown_type $rating
|
||||
* @return unknown
|
||||
* @param string $action
|
||||
* @param string $table
|
||||
* @param int $id
|
||||
* @param string $subject
|
||||
* @param mixed $content_type
|
||||
* @param bool $return
|
||||
* @param bool $rating
|
||||
* @return string
|
||||
*/
|
||||
function form_comment($action, $table, $id, $subject, $content_type, $return = FALSE, $rating = FALSE, $tablerender = TRUE,$pid = false)
|
||||
{
|
||||
@ -387,10 +387,10 @@ class comment
|
||||
* @param string $table
|
||||
* @param string $action
|
||||
* @param integer $id
|
||||
* @param interger $width
|
||||
* @param integer $width
|
||||
* @param string $subject
|
||||
* @param integer $addrating
|
||||
* @return html
|
||||
* @return string|null html
|
||||
*/
|
||||
function render_comment($row, $table, $action, $id, $width, $subject, $addrating = FALSE)
|
||||
{
|
||||
@ -412,9 +412,9 @@ class comment
|
||||
$sql = e107::getDb();
|
||||
$pref = e107::getPref();
|
||||
|
||||
if (vartrue($pref['comments_disabled']))
|
||||
if (!empty($pref['comments_disabled']))
|
||||
{
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
global $NEWIMAGE, $USERNAME, $RATING, $datestamp;
|
||||
@ -981,7 +981,7 @@ class comment
|
||||
*
|
||||
* @param unknown_type $table
|
||||
* @param unknown_type $id
|
||||
* @return unknown
|
||||
* @return int
|
||||
*/
|
||||
function count_comments($table, $id)
|
||||
{
|
||||
@ -990,7 +990,8 @@ class comment
|
||||
|
||||
$type = $this->getCommentType($table);
|
||||
$count_comments = $sql->count("comments", "(*)", "WHERE comment_item_id='".intval($id)."' AND comment_type='".$tp->toDB($type, true)."' ");
|
||||
return $count_comments;
|
||||
|
||||
return (int) $count_comments;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -555,10 +555,10 @@
|
||||
|
||||
$tMem = ($tMarker['Memory']);
|
||||
|
||||
if($tMem < 0) // Quick Fix for negative numbers.
|
||||
{
|
||||
// if($tMem < 0) // Quick Fix for negative numbers.
|
||||
// {
|
||||
// $tMem = 0.0000000001;
|
||||
}
|
||||
// }
|
||||
|
||||
$tMarker['Memory'] = ($tMem ? number_format($tMem / 1024.0, 1) : '?'); // display if known
|
||||
|
||||
|
@ -683,7 +683,7 @@ class db_table_admin
|
||||
}
|
||||
if ($ret === FALSE)
|
||||
{
|
||||
return $sql->dbError();
|
||||
return $sql->dbError(__METHOD__);
|
||||
}
|
||||
}
|
||||
return TRUE; // Success even if no changes required
|
||||
|
@ -973,13 +973,6 @@ class db_verify
|
||||
// $regex = "/`?([\w]*)`?\s*?(".implode("|",$this->fieldTypes)."|".implode("|",$this->fieldTypeNum).")\s?(?:\([\s]?([0-9,]*)[\s]?\))?[\s]?(unsigned)?[\s]?.*?(?:(NOT NULL|NULL))?[\s]*(auto_increment|default .*)?[\s]?(?:PRIMARY KEY)?[\s]*?,?\s*?\n/im";
|
||||
$regex = "/^\s*?`?([\w]*)`?\s*?(".implode("|",$this->fieldTypes)."|".implode("|",$this->fieldTypeNum).")\s?(?:\([\s]?([0-9,]*)[\s]?\))?[\s]?(unsigned)?[\s]?.*?(?:(NOT NULL|NULL))?[\s]*(auto_increment|default|AUTO_INCREMENT|DEFAULT [\w'\s.\(:\)-]*)?[\s]?(comment [\w\s'.-]*)?[\s]?(?:PRIMARY KEY)?[\s]*?,?\s*?\n/im";
|
||||
|
||||
if(e_DEBUG)
|
||||
{
|
||||
// e107::getMessage()->addDebug("Regex: ".print_a($data,true));
|
||||
// echo $regex;
|
||||
// e107::getMessage()->addDebug("Regex: ".$regex);
|
||||
|
||||
}
|
||||
|
||||
// echo $regex."<br /><br />";
|
||||
|
||||
|
@ -1363,7 +1363,7 @@ class e107
|
||||
* $instance_id
|
||||
*
|
||||
* @param string $instance_id
|
||||
* @return e_db
|
||||
* @return mixed|e_db
|
||||
*/
|
||||
public static function getDb($instance_id = '')
|
||||
{
|
||||
|
@ -534,10 +534,10 @@
|
||||
|
||||
}
|
||||
|
||||
if(empty($new_data[$fieldname]))
|
||||
{
|
||||
// if(empty($new_data[$fieldname]))
|
||||
// {
|
||||
// $new_data[$fieldname] = array();
|
||||
}
|
||||
// }
|
||||
|
||||
return $new_data;
|
||||
|
||||
|
@ -1086,7 +1086,7 @@ class eAuth
|
||||
/**
|
||||
* Load credentials stored in a system file
|
||||
* @param boolean $force
|
||||
* @return e_marketplace_adapter_abstract adapter instance
|
||||
* @return e_marketplace_adapter_abstract|eAuth
|
||||
*/
|
||||
public function loadSysCredentials($force = false)
|
||||
{
|
||||
|
@ -3281,7 +3281,7 @@ class e_parse extends e_parser
|
||||
* "" (default) = URL's get relative path e.g. ../e107_plugins/etc
|
||||
* @param mixed $all [optional] if TRUE, then when $mode is "full" or TRUE, USERID is also replaced...
|
||||
* when $mode is "" (default), ALL other e107 constants are replaced
|
||||
* @return array|string
|
||||
* @return string|array
|
||||
*/
|
||||
public function replaceConstants($text, $mode = '', $all = FALSE)
|
||||
{
|
||||
|
@ -2418,15 +2418,11 @@ class e_form
|
||||
{
|
||||
parse_str($options, $options);
|
||||
}
|
||||
elseif(is_array($options))
|
||||
{
|
||||
// do nothing.
|
||||
}
|
||||
else // Assume it's a label.
|
||||
elseif(is_string($options))
|
||||
{
|
||||
$options = array('label'=>$options);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$labelClass = (!empty($options['inline'])) ? 'checkbox-inline' : 'checkbox form-check';
|
||||
@ -2678,9 +2674,9 @@ class e_form
|
||||
*
|
||||
* @return string $text
|
||||
*/
|
||||
function radio_switch($name, $checked_enabled = false, $label_enabled = '', $label_disabled = '', $options = array())
|
||||
function radio_switch($name, $checked_enabled = false, $label_enabled = '', $label_disabled = '', $options = null)
|
||||
{
|
||||
if(!is_array($options))
|
||||
if(is_string($options))
|
||||
{
|
||||
parse_str($options, $options);
|
||||
}
|
||||
@ -2935,7 +2931,7 @@ class e_form
|
||||
/**
|
||||
*
|
||||
* @param string $name
|
||||
* @param array $option_array
|
||||
* @param array|string $option_array
|
||||
* @param boolean $selected [optional]
|
||||
* @param string|array $options [optional]
|
||||
* @param bool $options['useValues'] when true uses array values as the key.
|
||||
@ -4862,12 +4858,12 @@ var_dump($select_options);*/
|
||||
case 'dropdown':
|
||||
// XXX - should we use readParams at all here? see writeParms check below
|
||||
|
||||
if($parms && is_array($parms)) // FIXME - add support for multi-level arrays (option groups)
|
||||
{
|
||||
// if($parms && is_array($parms)) // FIXME - add support for multi-level arrays (option groups)
|
||||
// {
|
||||
//FIXME return no value at all when 'editable=1' is a readParm. See FAQs templates.
|
||||
// $value = vartrue($parms['pre']).vartrue($parms[$value]).vartrue($parms['post']);
|
||||
// break;
|
||||
}
|
||||
// }
|
||||
|
||||
// NEW - multiple (array values) support
|
||||
// FIXME - add support for multi-level arrays (option groups)
|
||||
|
@ -182,9 +182,9 @@ class eIPHandler
|
||||
$this->logBanItem($ipStatus, 'result --> '.$ipStatus); // only log blacklist
|
||||
$this->banAction($ipStatus); // This will abort if appropriate
|
||||
}
|
||||
elseif ($ipStatus > 0)
|
||||
{ // Whitelisted - we may want to set a specific indicator
|
||||
}
|
||||
//elseif ($ipStatus > 0)
|
||||
// { // Whitelisted - we may want to set a specific indicator
|
||||
// }
|
||||
}
|
||||
// Continue here - user not banned (so far)
|
||||
}
|
||||
@ -1182,9 +1182,9 @@ class eIPHandler
|
||||
$msg = $name.': Insufficient permissions. Required: '.$this->permsToString($reqPerms).' Actual: '.$this->permsToString($realPerms);
|
||||
}
|
||||
}
|
||||
if ($message && $msg)
|
||||
{ // Do something with the error message
|
||||
}
|
||||
//if ($message && $msg)
|
||||
// { // Do something with the error message
|
||||
// }
|
||||
return $result;
|
||||
}
|
||||
|
||||
@ -1243,9 +1243,9 @@ class eIPHandler
|
||||
$bestRow = $row;
|
||||
$gotBrowser = TRUE;
|
||||
}
|
||||
else
|
||||
{ // Problem - two or more rows with same browser token. What to do?
|
||||
}
|
||||
// else
|
||||
// { // Problem - two or more rows with same browser token. What to do?
|
||||
// }
|
||||
}
|
||||
elseif ($row['user_ip'] == $ip)
|
||||
{ // Just IP match here
|
||||
@ -1254,9 +1254,9 @@ class eIPHandler
|
||||
$bestRow = $row;
|
||||
$gotIP = TRUE;
|
||||
}
|
||||
else
|
||||
{ // Problem - two or more rows with same IP address. Hopefully better offer later!
|
||||
}
|
||||
//else
|
||||
//{ // Problem - two or more rows with same IP address. Hopefully better offer later!
|
||||
//}
|
||||
}
|
||||
}
|
||||
return $bestRow;
|
||||
|
@ -948,11 +948,11 @@ class e_jsmanager
|
||||
return $this;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//else
|
||||
//{
|
||||
// echo $this->_dependence." :: ENABLED<br />";
|
||||
// echo $this->_dependence."::".$file_path." : DISABLED<br />";
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
@ -519,6 +519,7 @@ class language{
|
||||
|
||||
if(defined('e_PAGE_LANGUAGE') && ($detect_language = $this->isValid(e_PAGE_LANGUAGE))) // page specific override.
|
||||
{
|
||||
$doNothing = '';
|
||||
// Do nothing as $detect_language is set.
|
||||
}
|
||||
elseif(vartrue($pref['multilanguage_subdomain']) && $this->isLangDomain(e_DOMAIN) && (defset('MULTILANG_SUBDOMAIN') !== false))
|
||||
@ -541,16 +542,16 @@ class language{
|
||||
}
|
||||
elseif(isset($_GET['elan']) && ($detect_language = $this->isValid($_GET['elan']))) // eg: /index.php?elan=Spanish
|
||||
{
|
||||
// Do nothing
|
||||
$doNothing = '';// Do nothing
|
||||
}
|
||||
elseif(isset($_POST['setlanguage']) && ($detect_language = $this->isValid($_POST['sitelanguage'])))
|
||||
{
|
||||
// Do nothing
|
||||
$doNothing = '';// Do nothing
|
||||
}
|
||||
|
||||
elseif(isset($GLOBALS['elan']) && ($detect_language = $this->isValid($GLOBALS['elan'])))
|
||||
{
|
||||
// Do nothing
|
||||
$doNothing = '';// Do nothing
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1730,11 +1730,11 @@ class e_library_manager
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//else
|
||||
// {
|
||||
// TODO: Provide the ability to use third-party callbacks (are defined in e_library.php files) for groups:
|
||||
// 'info', 'pre_detect', 'post_detect', 'pre_dependencies_load', 'pre_load', 'post_load'
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -510,7 +510,7 @@ class e107Email extends PHPMailer
|
||||
* @param string $addresses - comma separated
|
||||
* @param string $names - either a single name (used for all addresses) or a comma-separated list corresponding to the address list
|
||||
* If the name field for an entry is blank, or there are not enough entries, the address is substituted
|
||||
* @return true if list accepted, false if invalid list name
|
||||
* @return bool true if list accepted, false if invalid list name
|
||||
*/
|
||||
public function AddAddressList($list = 'to',$addresses='',$names = '')
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -80,7 +80,7 @@ class e107MailTemplate
|
||||
* @param string $extraFile - optional path to additional template file (intended for plugins)
|
||||
* (This is read between the theme-specific file and the defaults)
|
||||
*
|
||||
* @return boolean TRUE - template found and loaded. FALSE if not found.
|
||||
* @return boolean|array TRUE - template found and loaded. FALSE if not found.
|
||||
* If successful, we store an array in $lastTemplateData, with exactly six elements:
|
||||
* 'template_name'
|
||||
* 'email_overrides' - any override information (often an empty array)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -12,7 +12,8 @@ if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
$frm = e107::getForm();
|
||||
|
||||
class e_menuManager {
|
||||
class e_menuManager
|
||||
{
|
||||
|
||||
var $menu_areas = array();
|
||||
var $curLayout;
|
||||
@ -24,6 +25,8 @@ class e_menuManager {
|
||||
var $debug;
|
||||
var $menuMessage;
|
||||
var $style = 'default';
|
||||
|
||||
public $dbLayout = '';
|
||||
private $menuData = array();
|
||||
|
||||
function __construct($dragdrop=FALSE)
|
||||
@ -260,7 +263,7 @@ class e_menuManager {
|
||||
$FOOTER = ($CUSTOMFOOTER) ? $CUSTOMFOOTER : $FOOTER;
|
||||
}
|
||||
}
|
||||
elseif($this->curLayout && $this->curLayout !== "legacyCustom" && (isset($CUSTOMHEADER[$this->curLayout]) || isset($CUSTOMFOOTER[$this->curLayout]))) // 0.7 themes
|
||||
elseif($this->curLayout && $this->curLayout !== "legacyCustom" && (isset($CUSTOMHEADER[$this->curLayout]) || (is_array($CUSTOMFOOTER) && isset($CUSTOMFOOTER[$this->curLayout])))) // 0.7 themes
|
||||
{
|
||||
// echo " MODE 0.7 ".$this->curLayout;
|
||||
$HEADER = isset($CUSTOMHEADER[$this->curLayout]) ? $CUSTOMHEADER[$this->curLayout] : $HEADER;
|
||||
@ -945,11 +948,7 @@ class e_menuManager {
|
||||
}
|
||||
}
|
||||
|
||||
if(E107_DEBUG_LEVEL > 0)
|
||||
{
|
||||
// e107::getMessage()->addDebug(print_a($menuArea,true));
|
||||
}
|
||||
|
||||
|
||||
|
||||
return varset($menuArea, array());
|
||||
|
||||
@ -1250,10 +1249,10 @@ class e_menuManager {
|
||||
<tbody>\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//else
|
||||
//{
|
||||
// $text .= "<div class='column' id='remove' style='border:1px solid silver'>\n";
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
$pageMenu = array();
|
||||
@ -1405,10 +1404,10 @@ class e_menuManager {
|
||||
|
||||
// $tmp = explode("\n", $LAYOUT);
|
||||
|
||||
if(strpos($LAYOUT,'<body ') !== false) // FIXME Find a way to remove the <body> tag from the admin header when menu-manager is active.
|
||||
{
|
||||
// if(strpos($LAYOUT,'<body ') !== false) // FIXME Find a way to remove the <body> tag from the admin header when menu-manager is active.
|
||||
// {
|
||||
// $LAYOUT = preg_replace('/<body[^>]*>/','', $LAYOUT);
|
||||
}
|
||||
// }
|
||||
|
||||
// Split up using the same function as the shortcode handler
|
||||
$tmp = preg_split('#(\{\S[^\x02]*?\S\})#', $LAYOUT, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
|
||||
@ -1551,6 +1550,7 @@ class e_menuManager {
|
||||
}
|
||||
elseif(strstr($str, "ALERT"))
|
||||
{
|
||||
echo '';
|
||||
//echo "[Navigation Area]";
|
||||
}
|
||||
elseif(strstr($str, "LANGUAGELINKS"))
|
||||
@ -1769,10 +1769,10 @@ class e_menuManager {
|
||||
$text .= $rs->form_option(MENLAN_25, TRUE, " ");
|
||||
// $text .= $rs->form_option(MENLAN_15, "", "deac.{$menu_info}");
|
||||
|
||||
if ($conf)
|
||||
{
|
||||
// if ($conf)
|
||||
// {
|
||||
// $text .= $rs->form_option("Configure", "", $conf); // TODO Check LAN availability
|
||||
}
|
||||
// }
|
||||
|
||||
if ($menu_order != 1)
|
||||
{
|
||||
|
@ -2532,7 +2532,7 @@ class e_db_mysql implements e_db
|
||||
|
||||
if (false === file_put_contents(e_CACHE_DB.$tableName.'.php', $fileData))
|
||||
{ // Could do something with error - but mustn't return FALSE - would trigger auto-generated structure
|
||||
|
||||
$result = false;
|
||||
}
|
||||
|
||||
$result = true;
|
||||
|
@ -108,13 +108,13 @@ class e_pref extends e_front_model
|
||||
* Simple getter - $pref_name is not parsed (no multidimensional arrays support), alias of {@link e_model::get()}
|
||||
* This is the prefered (performance wise) method when simple preference is retrieved
|
||||
*
|
||||
* @param string $pref_name
|
||||
* @param string $key (pref name)
|
||||
* @param mixed $default
|
||||
* @return mixed
|
||||
*/
|
||||
public function get($pref_name, $default = null)
|
||||
public function get($key, $default = null)
|
||||
{
|
||||
return parent::get((string) $pref_name, $default);
|
||||
return parent::get((string) $key, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -202,20 +202,20 @@ class e_pref extends e_front_model
|
||||
* Simple setter - $pref_name is not parsed (no multidimensional arrays support)
|
||||
* Adding new pref is allowed
|
||||
*
|
||||
* @param string $pref_name
|
||||
* @param string $key (pref name)
|
||||
* @param mixed $value
|
||||
* @return e_pref
|
||||
*/
|
||||
public function set($pref_name, $value=null, $strict = false)
|
||||
public function set($key, $value=null, $strict = false)
|
||||
{
|
||||
global $pref;
|
||||
if(empty($pref_name) || !is_string($pref_name))
|
||||
if(empty($key) || !is_string($key))
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
if(!isset($this->_data[$pref_name]) || $this->_data[$pref_name] != $value) $this->data_has_changed = true;
|
||||
$this->_data[$pref_name] = $value;
|
||||
if(!isset($this->_data[$key]) || $this->_data[$key] != $value) $this->data_has_changed = true;
|
||||
$this->_data[$key] = $value;
|
||||
|
||||
//BC
|
||||
if($this->alias === 'core')
|
||||
@ -302,14 +302,14 @@ class e_pref extends e_front_model
|
||||
* Remove single preference
|
||||
* $pref_name is not parsed as a path
|
||||
*
|
||||
* @see e_model::remove()
|
||||
* @param string $pref_name
|
||||
* @param string $key (pref name)
|
||||
* @return e_pref
|
||||
*@see e_model::remove()
|
||||
*/
|
||||
public function remove($pref_name)
|
||||
public function remove($key)
|
||||
{
|
||||
global $pref;
|
||||
parent::remove((string) $pref_name);
|
||||
parent::remove((string) $key);
|
||||
|
||||
//BC
|
||||
if($this->alias === 'core')
|
||||
@ -337,15 +337,15 @@ class e_pref extends e_front_model
|
||||
* Disallow public use of e_model::addData()
|
||||
* Disallow preference override
|
||||
*
|
||||
* @param string|array $pref_name
|
||||
* @param string|array $key (pref name or array)
|
||||
* @param mixed value
|
||||
* @param boolean $strict
|
||||
* @return $this|\e_model
|
||||
*/
|
||||
final public function addData($pref_name, $value = null, $override = true)
|
||||
final public function addData($key, $value = null, $override = true)
|
||||
{
|
||||
global $pref;
|
||||
parent::addData($pref_name, $value, false);
|
||||
parent::addData($key, $value, false);
|
||||
//BC
|
||||
if($this->alias === 'core')
|
||||
{
|
||||
@ -358,26 +358,26 @@ class e_pref extends e_front_model
|
||||
* Disallow public use of e_model::setData()
|
||||
* Only data merge possible
|
||||
*
|
||||
* @param string|array $pref_name
|
||||
* @param string|array $key
|
||||
* @param mixed $value
|
||||
* @return e_pref
|
||||
*/
|
||||
final public function setData($pref_name, $value = null, $strict = false)
|
||||
final public function setData($key, $value = null, $strict = false)
|
||||
{
|
||||
global $pref;
|
||||
if(empty($pref_name))
|
||||
if(empty($key))
|
||||
{
|
||||
return $this;
|
||||
}
|
||||
|
||||
//Merge only allowed
|
||||
if(is_array($pref_name))
|
||||
if(is_array($key))
|
||||
{
|
||||
$this->mergeData($pref_name, false, false, false);
|
||||
$this->mergeData($key, false, false, false);
|
||||
return $this;
|
||||
}
|
||||
|
||||
parent::setData($pref_name, $value, false);
|
||||
parent::setData($key, $value, false);
|
||||
|
||||
//BC
|
||||
if($this->alias === 'core')
|
||||
@ -391,13 +391,13 @@ class e_pref extends e_front_model
|
||||
* Disallow public use of e_model::removeData()
|
||||
* Object data reseting is not allowed
|
||||
*
|
||||
* @param string $pref_name
|
||||
* @param string $key (pref name)
|
||||
* @return e_pref
|
||||
*/
|
||||
final public function removeData($pref_name=null)
|
||||
final public function removeData($key=null)
|
||||
{
|
||||
global $pref;
|
||||
parent::removeData((string) $pref_name);
|
||||
parent::removeData((string) $key);
|
||||
|
||||
//BC
|
||||
if($this->alias === 'core')
|
||||
|
@ -1372,10 +1372,10 @@ class e_parse_shortcode
|
||||
}
|
||||
|
||||
|
||||
if (E107_DBG_SC || E107_DBG_TIMEDETAILS)
|
||||
{
|
||||
//if (E107_DBG_SC || E107_DBG_TIMEDETAILS)
|
||||
//{
|
||||
// $sql->db_Mark_Time("(After SC {$code})");
|
||||
}
|
||||
//}
|
||||
|
||||
if (($noDebugLog != true) && (E107_DBG_BBSC || E107_DBG_SC || E107_DBG_TIMEDETAILS))
|
||||
{
|
||||
|
@ -1591,10 +1591,10 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
|
||||
$td++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//else
|
||||
//{
|
||||
// echo "no Perms";
|
||||
}
|
||||
//}
|
||||
|
||||
return $text;
|
||||
}
|
||||
@ -1796,7 +1796,7 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
|
||||
|
||||
if(!file_exists(e_PLUGIN.$path."/e_sitelink.php"))
|
||||
{
|
||||
|
||||
return array();
|
||||
}
|
||||
|
||||
|
||||
@ -1863,10 +1863,10 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
|
||||
$dbLink = e107::url($data['link_owner'],$data['link_sefurl']);
|
||||
}
|
||||
|
||||
if(E107_DBG_PATH)
|
||||
{
|
||||
//if(E107_DBG_PATH)
|
||||
//{
|
||||
// e107::getDebug()->log("db=".$dbLink."<br />url=".e_REQUEST_URI."<br /><br />");
|
||||
}
|
||||
// }
|
||||
|
||||
if($exactMatch)
|
||||
{
|
||||
|
@ -642,10 +642,10 @@ class e_theme
|
||||
$themeArray[$file]['css'][] = array("name"=>$file2, "info"=>$match[1], "scope"=>$scope, "nonadmin"=>$nonadmin);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//else
|
||||
//{
|
||||
// $mes->addDebug("Couldn't read file: ".e_THEME.$file."/".$file2);
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@ -823,12 +823,12 @@ class e_theme
|
||||
// $oldvars =
|
||||
$vars = $xml->loadXMLfile(e_THEME.$path.'/theme.xml', 'advanced', true); // must be 'advanced'
|
||||
|
||||
if($path == "bootstrap3" )
|
||||
{
|
||||
//if($path == "bootstrap3" )
|
||||
// {
|
||||
// echo "<table class='table table-bordered'>
|
||||
// <tr><th>old</th><th>new parser</th></tr>
|
||||
// <tr><td>".print_a($oldvars,true)."</td><td>".print_a($vars,true)."</td></tr></table>";
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
$vars['name'] = varset($vars['@attributes']['name']);
|
||||
@ -978,13 +978,13 @@ class e_theme
|
||||
}
|
||||
|
||||
|
||||
if($path == "bootstrap3" )
|
||||
{
|
||||
//if($path == "bootstrap3" )
|
||||
// {
|
||||
// e107::getMessage()->addDebug("<h2>".$path."</h2>");
|
||||
// e107::getMessage()->addDebug(print_a($vars,true));
|
||||
// print_a($vars);
|
||||
// echo "<table class='table'><tr><td>".print_a($vars,true)."</td><td>".print_a($adv,true)."</td></tr></table>";
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
return $vars;
|
||||
@ -1324,10 +1324,10 @@ class themeHandler
|
||||
$themeArray[$file]['css'][] = array("name"=>$file2, "info"=>$match[1], "scope"=>$scope, "nonadmin"=>$nonadmin);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//else
|
||||
// {
|
||||
// $mes->addDebug("Couldn't read file: ".e_THEME.$file."/".$file2);
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@ -2016,10 +2016,10 @@ class themeHandler
|
||||
|
||||
// $text .= "<div class='right'><a href='#themeInfo_".$theme['id']."' class='e-expandit'>Close</a></div>";
|
||||
|
||||
if(E107_DEBUG_LEVEL > 0)
|
||||
{
|
||||
//if(E107_DEBUG_LEVEL > 0)
|
||||
// {
|
||||
// $text .= print_a($theme, true);
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
return $text;
|
||||
@ -2301,10 +2301,10 @@ class themeHandler
|
||||
$admin_icon = "";
|
||||
}
|
||||
|
||||
if($theme['name'] == 'bootstrap')
|
||||
{
|
||||
//if($theme['name'] == 'bootstrap')
|
||||
//{
|
||||
// print_a($theme);
|
||||
}
|
||||
// }
|
||||
//
|
||||
// $thumbPath = (substr($theme['thumbnail'],0,4) == 'http') ? $theme['thumbnail'] : e_THEME.$theme['path'] ."/".$theme['preview'][0];
|
||||
// $thumbnail = "<a href='".e_BASE."news.php?themepreview.".$theme['id']."' title='".TPVLAN_9."' >";
|
||||
|
@ -44,8 +44,8 @@ class e107_traffic
|
||||
|
||||
/**
|
||||
* @return float Time difference
|
||||
* @param time $tStart Start time - unexploded microtime result
|
||||
* @param time $tStop Finish time - unexploded microtime result
|
||||
* @param string time $tStart Start time - unexploded microtime result
|
||||
* @param string time $tStop Finish time - unexploded microtime result
|
||||
* @desc Calculate time difference between to microtimes
|
||||
* @access public
|
||||
*/
|
||||
|
@ -1765,7 +1765,7 @@ class e_user_provider
|
||||
}
|
||||
|
||||
unset($user['user_password']);
|
||||
e107::getLog()->user_audit(USER_AUDIT_LOGIN, '', $user['user_id'], $user['user_name']);
|
||||
e107::getLog()->user_audit(USER_AUDIT_LOGIN, null, $user['user_id'], $user['user_name']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1162,22 +1162,22 @@ class validatorClass
|
||||
}
|
||||
$img = varset($img,$value);
|
||||
//XXX There should be no size limits - as image sizes are handled by thumb.php
|
||||
if ($size = getimagesize($img))
|
||||
{
|
||||
// if ($size = getimagesize($img))
|
||||
// {
|
||||
// echo "Image {$img} size: {$size[0]} x {$size[1]}<br />";
|
||||
if (isset($defs['maxWidth']) && $size[0] > $defs['maxWidth'])
|
||||
{ // Image too wide
|
||||
// if (isset($defs['maxWidth']) && $size[0] > $defs['maxWidth'])
|
||||
// { // Image too wide
|
||||
// $errNum = ERR_IMAGE_TOO_WIDE;
|
||||
}
|
||||
if (isset($defs['maxHeight']) && $size[1] > $defs['maxHeight'])
|
||||
{ // Image too high
|
||||
// }
|
||||
// if (isset($defs['maxHeight']) && $size[1] > $defs['maxHeight'])
|
||||
// { // Image too high
|
||||
// $errNum = ERR_IMAGE_TOO_HIGH;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// echo "Image {$img} not found or cannot size - original value {$value}<br />";
|
||||
}
|
||||
// }
|
||||
unset($img);
|
||||
break;
|
||||
default :
|
||||
|
@ -92,20 +92,19 @@ class _blank_admin implements e_admin_addon_interface
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
if(!empty($id) )
|
||||
{
|
||||
|
||||
// if(!empty($data['x__blank_url']))
|
||||
// {
|
||||
if(!empty($data['x__blank_url']))
|
||||
{
|
||||
|
||||
// eg. Save the data in 'blank' plugin table. .
|
||||
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ class ExtendedPasswordHandler extends UserHandler
|
||||
*/
|
||||
private function get_random_bytes($count)
|
||||
{
|
||||
$this->random_state = md5($this->random_state.microtime().mt_rand(0,10000)); // This will 'auto seed'
|
||||
$this->random_state = md5($this->random_state.microtime().random_int(0,10000)); // This will 'auto seed'
|
||||
|
||||
$output = '';
|
||||
for ($i = 0; $i < $count; $i += 16)
|
||||
@ -211,10 +211,10 @@ class ExtendedPasswordHandler extends UserHandler
|
||||
*/
|
||||
public function getPasswordTypes($includeExtended = TRUE)
|
||||
{
|
||||
$vals = array();
|
||||
$vals = array(
|
||||
'md5' => IMPORTDB_LAN_7,
|
||||
'e107_salt' => IMPORTDB_LAN_8); // Methods supported in core
|
||||
$vals = array( // Methods supported in core
|
||||
'md5' => IMPORTDB_LAN_7,
|
||||
'e107_salt' => IMPORTDB_LAN_8
|
||||
);
|
||||
|
||||
if ($includeExtended)
|
||||
{
|
||||
@ -266,7 +266,7 @@ class ExtendedPasswordHandler extends UserHandler
|
||||
/**
|
||||
* Extension of password validation to handle more types
|
||||
*
|
||||
* @param string $pword - plaintext password as entered by user
|
||||
* @param string $password - plaintext password as entered by user
|
||||
* @param string $login_name - string used to log in (could actually be email address)
|
||||
* @param string $stored_hash - required value for password to match
|
||||
* @param integer $password_type - constant specifying the type of password to check against
|
||||
@ -276,19 +276,19 @@ class ExtendedPasswordHandler extends UserHandler
|
||||
* PASSWORD_VALID if valid password
|
||||
* Return a new hash to store if valid password but non-preferred encoding
|
||||
*/
|
||||
public function CheckPassword($pword, $login_name, $stored_hash, $password_type = PASSWORD_DEFAULT_TYPE)
|
||||
public function CheckPassword($password, $login_name, $stored_hash, $password_type = PASSWORD_DEFAULT_TYPE)
|
||||
{
|
||||
switch ($password_type)
|
||||
{
|
||||
case self::PASSWORD_GENERAL_MD5 :
|
||||
case self::PASSWORD_E107_MD5 :
|
||||
$pwHash = md5($pword);
|
||||
$pwHash = md5($password);
|
||||
|
||||
break;
|
||||
|
||||
case self::PASSWORD_GENERAL_SHA1 :
|
||||
if (strlen($stored_hash) != 40) return PASSWORD_INVALID;
|
||||
$pwHash = sha1($pword);
|
||||
$pwHash = sha1($password);
|
||||
break;
|
||||
|
||||
case self::PASSWORD_JOOMLA_SALT :
|
||||
@ -298,8 +298,8 @@ class ExtendedPasswordHandler extends UserHandler
|
||||
return PASSWORD_INVALID;
|
||||
}
|
||||
// Mambo/Joomla salted hash - should be 32-character md5 hash, ':', 16-character salt (but could be 8-char salt, maybe)
|
||||
list($hash, $salt) = explode(':', $stored_hash);
|
||||
$pwHash = md5($pword.$salt);
|
||||
list($hash, $salt) = explode(':', $stored_hash);
|
||||
$pwHash = md5($password.$salt);
|
||||
$stored_hash = $hash;
|
||||
break;
|
||||
|
||||
@ -320,20 +320,20 @@ class ExtendedPasswordHandler extends UserHandler
|
||||
//return PASSWORD_INVALID;
|
||||
// }
|
||||
|
||||
$pwHash = $salt ? md5($salt.$pword) : md5($pword);
|
||||
$pwHash = $salt ? md5($salt.$password) : md5($password);
|
||||
$stored_hash = $hash;
|
||||
break;
|
||||
|
||||
case self::PASSWORD_E107_SALT :
|
||||
//return e107::getUserSession()->CheckPassword($password, $login_name, $stored_hash);
|
||||
return parent::CheckPassword($pword, $login_name, $stored_hash);
|
||||
return parent::CheckPassword($password, $login_name, $stored_hash);
|
||||
break;
|
||||
|
||||
case self::PASSWORD_PHPBB_SALT :
|
||||
case self::PASSWORD_WORDPRESS_SALT :
|
||||
if (strlen($stored_hash) != 34) return PASSWORD_INVALID;
|
||||
$pwHash = $this->crypt_private($pword, $stored_hash, $password_type);
|
||||
if ($pwHash[0] == '*')
|
||||
$pwHash = $this->crypt_private($password, $stored_hash, $password_type);
|
||||
if ($pwHash[0] === '*')
|
||||
{
|
||||
return PASSWORD_INVALID;
|
||||
}
|
||||
@ -346,19 +346,19 @@ class ExtendedPasswordHandler extends UserHandler
|
||||
|
||||
if (strlen($hash) !== 32)
|
||||
{
|
||||
$pwHash = hash_hmac('sha256',$pword, $salt);
|
||||
$pwHash = hash_hmac('sha256',$password, $salt);
|
||||
}
|
||||
else
|
||||
{
|
||||
e107::getMessage()->addDebug("PHPFusion Md5 Hash Detected ");
|
||||
$pwHash = md5(md5($pword));
|
||||
$pwHash = md5(md5($password));
|
||||
}
|
||||
|
||||
$stored_hash = $hash;
|
||||
break;
|
||||
|
||||
case self::PASSWORD_PLAINTEXT :
|
||||
$pwHash = $pword;
|
||||
$pwHash = $password;
|
||||
break;
|
||||
|
||||
|
||||
@ -379,7 +379,7 @@ class ExtendedPasswordHandler extends UserHandler
|
||||
password = SHA1(CONCAT(salt, SHA1(CONCAT(salt, SHA1('".$this->db->escape($password)."')))
|
||||
*/
|
||||
//$pwHash = $salt ? md5($salt.$pword) : md5($pword);
|
||||
$pwHash = sha1($salt.sha1($salt.sha1($pword)));
|
||||
$pwHash = sha1($salt.sha1($salt.sha1($password)));
|
||||
$stored_hash = $hash;
|
||||
break;
|
||||
|
||||
|
@ -10,9 +10,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
if (isset($_POST['chatbox_ajax'])) {
|
||||
if (isset($_POST['chatbox_ajax']))
|
||||
{
|
||||
define('e_MINIMAL', true);
|
||||
if ( ! defined('e107_INIT')) {
|
||||
if (!defined('e107_INIT'))
|
||||
{
|
||||
require_once('../../class2.php');
|
||||
}
|
||||
}
|
||||
@ -22,27 +24,27 @@ global $e107cache, $e_event, $e107;
|
||||
$tp = e107::getParser();
|
||||
$pref = e107::getPref();
|
||||
|
||||
if ( ! e107::isInstalled('chatbox_menu')) {
|
||||
if (!e107::isInstalled('chatbox_menu'))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
e107::lan('chatbox_menu', e_LANGUAGE);
|
||||
|
||||
|
||||
|
||||
$emessage = '';
|
||||
|
||||
|
||||
if ((isset($_POST['chat_submit']) || e_AJAX_REQUEST) && $_POST['cmessage'] !== '')
|
||||
{
|
||||
|
||||
if ((isset($_POST['chat_submit']) || e_AJAX_REQUEST) && $_POST['cmessage'] !== '') {
|
||||
|
||||
if ( ! USER && ! $pref['anon_post'])
|
||||
if (!USER && !$pref['anon_post'])
|
||||
{
|
||||
// disallow post
|
||||
$cmessage = ''; // disallow post
|
||||
}
|
||||
else
|
||||
{
|
||||
$nick = trim(preg_replace("#\[.*\]#si", "", $tp->toDB($_POST['nick'])));
|
||||
$nick = trim(preg_replace("#\[.*\]#s", '', $tp->toDB($_POST['nick'])));
|
||||
|
||||
$cmessage = $_POST['cmessage'];
|
||||
$cmessage = preg_replace("#\[.*?\](.*?)\[/.*?\]#s", "\\1", $cmessage);
|
||||
@ -50,50 +52,65 @@ if ((isset($_POST['chat_submit']) || e_AJAX_REQUEST) && $_POST['cmessage'] !== '
|
||||
|
||||
$fp = new floodprotect;
|
||||
|
||||
if ($fp->flood('chatbox', 'cb_datestamp')) {
|
||||
if ((strlen(trim($cmessage)) < 1000) && trim($cmessage) !== '') {
|
||||
if ($fp->flood('chatbox', 'cb_datestamp'))
|
||||
{
|
||||
if (trim($cmessage) !== '' && (strlen(trim($cmessage)) < 1000))
|
||||
{
|
||||
|
||||
$cmessage = $tp->toDB($cmessage);
|
||||
|
||||
if ($sql->select('chatbox', '*',
|
||||
"cb_message='{$cmessage}' AND cb_datestamp+84600>" . time())) {
|
||||
"cb_message='{$cmessage}' AND cb_datestamp+84600>" . time()))
|
||||
{
|
||||
|
||||
$emessage = CHATBOX_L17;
|
||||
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$datestamp = time();
|
||||
$ip = e107::getIPHandler()->getIP(false);
|
||||
|
||||
if (USER) {
|
||||
if (USER)
|
||||
{
|
||||
|
||||
$nick = USERID . "." . USERNAME;
|
||||
$nick = USERID . '.' . USERNAME;
|
||||
|
||||
$postTime = time();
|
||||
$sql->update('user', "user_chats = user_chats + 1, user_lastpost = {$postTime} WHERE user_id = " . USERID);
|
||||
|
||||
} else if ( ! $nick) {
|
||||
}
|
||||
elseif (!$nick)
|
||||
{
|
||||
|
||||
$nick = '0.Anonymous';
|
||||
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if ($sql->select('user', '*', "user_name='$nick' ")) {
|
||||
if ($sql->select('user', '*', "user_name='$nick' "))
|
||||
{
|
||||
|
||||
$emessage = CHATBOX_L1;
|
||||
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$nick = "0." . $nick;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if ( ! $emessage) {
|
||||
if (!$emessage)
|
||||
{
|
||||
$insertId = $sql->insert('chatbox',
|
||||
"0, '{$nick}', '{$cmessage}', '{$datestamp}', 0, '{$ip}' ");
|
||||
|
||||
if ($insertId) {
|
||||
if ($insertId)
|
||||
{
|
||||
|
||||
$edata_cb = [
|
||||
'id' => $insertId,
|
||||
@ -103,7 +120,7 @@ if ((isset($_POST['chat_submit']) || e_AJAX_REQUEST) && $_POST['cmessage'] !== '
|
||||
'ip' => $ip,
|
||||
];
|
||||
|
||||
$e_event->trigger("cboxpost", $edata_cb); // deprecated
|
||||
$e_event->trigger('cboxpost', $edata_cb); // deprecated
|
||||
|
||||
e107::getEvent()->trigger('user_chatbox_post_created', $edata_cb);
|
||||
$e107cache->clear('nq_chatbox');
|
||||
@ -111,70 +128,86 @@ if ((isset($_POST['chat_submit']) || e_AJAX_REQUEST) && $_POST['cmessage'] !== '
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$emessage = CHATBOX_L15;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$emessage = $tp->lanVars(CHATBOX_L19, FLOODPROTECT ?: 'n/a');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( ! USER && ! $pref['anon_post']) {
|
||||
if (!USER && !$pref['anon_post'])
|
||||
{
|
||||
|
||||
if ($pref['user_reg']) {
|
||||
if ($pref['user_reg'])
|
||||
{
|
||||
|
||||
$text1 = str_replace(['[', ']'], ["<a href='" . e_LOGIN . "'>", "</a>"],
|
||||
$text1 = str_replace(['[', ']'], ["<a href='" . e_LOGIN . "'>", '</a>'],
|
||||
CHATBOX_L3);
|
||||
|
||||
if ($pref['user_reg'] === 1) {
|
||||
if ($pref['user_reg'] === 1)
|
||||
{
|
||||
$text1 .= str_replace(['[', ']'],
|
||||
["<a href='" . e_SIGNUP . "'>", "</a>"], CHATBOX_L3b);
|
||||
["<a href='" . e_SIGNUP . "'>", '</a>'], CHATBOX_L3b);
|
||||
}
|
||||
|
||||
$texta =
|
||||
"<div style='text-align:center'>" . $text1 . "</div><br /><br />";
|
||||
"<div style='text-align:center'>" . $text1 . '</div><br /><br />';
|
||||
}
|
||||
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$cb_width = (defined('CBWIDTH') ? CBWIDTH : '');
|
||||
|
||||
if ($pref['cb_layer'] === 2) {
|
||||
if ($pref['cb_layer'] === 2)
|
||||
{
|
||||
|
||||
$texta = "\n<form id='chatbox' action='" . e_SELF . "?" . e_QUERY . "' method='post' onsubmit='return(false);'>
|
||||
$texta = "\n<form id='chatbox' action='" . e_SELF . '?' . e_QUERY . "' method='post' onsubmit='return(false);'>
|
||||
<div>
|
||||
<input type='hidden' name='chatbox_ajax' id='chatbox_ajax' value='1' />
|
||||
</div>";
|
||||
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$texta = (e_QUERY
|
||||
? "\n<form id='chatbox' method='post' action='" . e_SELF . "?" . e_QUERY . "'>"
|
||||
? "\n<form id='chatbox' method='post' action='" . e_SELF . '?' . e_QUERY . "'>"
|
||||
: "\n<form id='chatbox' method='post' action='" . e_SELF . "'>");
|
||||
}
|
||||
|
||||
$texta .= "<div class='control-group form-group' id='chatbox-input-block'>";
|
||||
|
||||
if (($pref['anon_post'] == "1" && USER === false)) {
|
||||
if (($pref['anon_post'] == '1' && USER === false))
|
||||
{
|
||||
$texta .= "\n<input class='tbox chatbox' type='text' id='nick' name='nick' value='' maxlength='50' " . ($cb_width
|
||||
? "style='width: " . $cb_width . ";'" : '') . " /><br />";
|
||||
? "style='width: " . $cb_width . ";'" : '') . ' /><br />';
|
||||
}
|
||||
|
||||
if ($pref['cb_layer'] === 2) {
|
||||
if ($pref['cb_layer'] === 2)
|
||||
{
|
||||
|
||||
$oc =
|
||||
"onclick=\"javascript:sendInfo('" . SITEURLBASE . e_PLUGIN_ABS . "chatbox_menu/chatbox_menu.php', 'chatbox_posts', this.form);\"";
|
||||
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$oc = '';
|
||||
|
||||
}
|
||||
|
||||
$texta .= "
|
||||
<textarea placeholder=\"" . LAN_CHATBOX_100 . "\" required class='tbox chatbox form-control input-xlarge' id='cmessage' name='cmessage' cols='20' rows='5' style='max-width:97%; " . ($cb_width
|
||||
? "width:" . $cb_width . ";" : '') . " overflow: auto' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'></textarea>
|
||||
$texta .= '
|
||||
<textarea placeholder="' . LAN_CHATBOX_100 . "\" required class='tbox chatbox form-control input-xlarge' id='cmessage' name='cmessage' cols='20' rows='5' style='max-width:97%; " . ($cb_width
|
||||
? 'width:' . $cb_width . ';' : '') . " overflow: auto' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'></textarea>
|
||||
<br />
|
||||
<input class='btn btn-default btn-secondary button' type='submit' id='chat_submit' name='chat_submit' value='" . CHATBOX_L4 . "' {$oc}/>";
|
||||
|
||||
@ -182,7 +215,8 @@ if ( ! USER && ! $pref['anon_post']) {
|
||||
// $texta .= "<input type='reset' name='reset' value='".CHATBOX_L5."' />"; // How often do we see these lately? ;-)
|
||||
|
||||
|
||||
if ($pref['cb_emote'] && $pref['smiley_activate']) {
|
||||
if ($pref['cb_emote'] && $pref['smiley_activate'])
|
||||
{
|
||||
$texta .= "
|
||||
<input class='btn btn-default btn-secondary button' type='button' style='cursor:pointer' size='30' value='" . CHATBOX_L14 . "' onclick=\"expandit('emote')\" />
|
||||
<div class='well' style='display:none' id='emote'>" . r_emote() . "</div>\n";
|
||||
@ -192,12 +226,14 @@ if ( ! USER && ! $pref['anon_post']) {
|
||||
}
|
||||
|
||||
|
||||
if ($emessage !== '') {
|
||||
$texta .= "<div style='text-align:center'><b>" . $emessage . "</b></div>";
|
||||
if ($emessage !== '')
|
||||
{
|
||||
$texta .= "<div style='text-align:center'><b>" . $emessage . '</b></div>';
|
||||
}
|
||||
|
||||
|
||||
if ( ! $text = $e107cache->retrieve("nq_chatbox")) {
|
||||
if (!$text = $e107cache->retrieve('nq_chatbox'))
|
||||
{
|
||||
|
||||
global $pref, $tp;
|
||||
|
||||
@ -206,34 +242,36 @@ if ( ! $text = $e107cache->retrieve("nq_chatbox")) {
|
||||
|
||||
$chatbox_posts = $pref['chatbox_posts'];
|
||||
|
||||
if ( ! isset($pref['cb_mod'])) {
|
||||
if (!isset($pref['cb_mod']))
|
||||
{
|
||||
$pref['cb_mod'] = e_UC_ADMIN;
|
||||
}
|
||||
|
||||
if ( ! defined('CB_MOD')) {
|
||||
define("CB_MOD", check_class($pref['cb_mod']));
|
||||
if (!defined('CB_MOD'))
|
||||
{
|
||||
define('CB_MOD', check_class($pref['cb_mod']));
|
||||
}
|
||||
|
||||
$qry = "SELECT c.*, u.user_name, u.user_image FROM #chatbox AS c
|
||||
LEFT JOIN #user AS u ON SUBSTRING_INDEX(c.cb_nick, '.', 1) = u.user_id
|
||||
ORDER BY c.cb_datestamp DESC LIMIT 0, " . (int)$chatbox_posts;
|
||||
ORDER BY c.cb_datestamp DESC LIMIT 0, " . (int) $chatbox_posts;
|
||||
|
||||
global $CHATBOXSTYLE;
|
||||
|
||||
if($CHATBOXSTYLE) // legacy chatbox style
|
||||
if ($CHATBOXSTYLE) // legacy chatbox style
|
||||
{
|
||||
$legacyIconSrc = e_IMAGE_ABS . 'admin_images/chatbox_16.png';
|
||||
$currentIconSrc = e_PLUGIN . 'chatbox_menu/images/chatbox_16.png';
|
||||
|
||||
$legacySrch = array($legacyIconSrc, '{USERNAME}', '{MESSAGE}', '{TIMEDATE}');
|
||||
$legacyRepl = array($currentIconSrc, '{CB_USERNAME}','{CB_MESSAGE}','{CB_TIMEDATE}');
|
||||
$legacyRepl = array($currentIconSrc, '{CB_USERNAME}', '{CB_MESSAGE}', '{CB_TIMEDATE}');
|
||||
|
||||
|
||||
$CHATBOX_TEMPLATE['start'] = '';
|
||||
$CHATBOX_TEMPLATE['item'] = str_replace($legacySrch, $legacyRepl, $CHATBOXSTYLE);
|
||||
$CHATBOX_TEMPLATE['end'] = '';
|
||||
}
|
||||
else // default chatbox style
|
||||
else // default chatbox style
|
||||
{
|
||||
$CHATBOX_TEMPLATE = e107::getTemplate('chatbox_menu', null, 'menu');
|
||||
}
|
||||
@ -246,7 +284,8 @@ if ( ! $text = $e107cache->retrieve("nq_chatbox")) {
|
||||
|
||||
$sc = e107::getScBatch('chatbox_menu', true);
|
||||
|
||||
if ($sql->gen($qry)) {
|
||||
if ($sql->gen($qry))
|
||||
{
|
||||
|
||||
$cbpost = $sql->rows();
|
||||
|
||||
@ -254,55 +293,65 @@ if ( ! $text = $e107cache->retrieve("nq_chatbox")) {
|
||||
|
||||
$text .= $tp->parseTemplate($CHATBOX_TEMPLATE['start'], false, $sc);
|
||||
|
||||
foreach ($cbpost as $cb) {
|
||||
foreach ($cbpost as $cb)
|
||||
{
|
||||
$sc->setVars($cb);
|
||||
$text .= $tp->parseTemplate($CHATBOX_TEMPLATE['item'], false, $sc);
|
||||
}
|
||||
|
||||
$text .= $tp->parseTemplate($CHATBOX_TEMPLATE['end'], false, $sc);
|
||||
|
||||
$text .= "</div>";
|
||||
$text .= '</div>';
|
||||
|
||||
} else {
|
||||
$text .= "<span class='mediumtext'>" . CHATBOX_L11 . "</span>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$text .= "<span class='mediumtext'>" . CHATBOX_L11 . '</span>';
|
||||
}
|
||||
|
||||
$total_chats = $sql->count("chatbox");
|
||||
$total_chats = $sql->count('chatbox');
|
||||
|
||||
if ($total_chats > $chatbox_posts || CB_MOD) {
|
||||
if ($total_chats > $chatbox_posts || CB_MOD)
|
||||
{
|
||||
$text .= "<br /><div style='text-align:center'><a href='" . e_PLUGIN_ABS . "chatbox_menu/chat.php'>" . (CB_MOD
|
||||
? CHATBOX_L13
|
||||
: CHATBOX_L12) . "</a> (" . $total_chats . ")</div>";
|
||||
: CHATBOX_L12) . '</a> (' . $total_chats . ')</div>';
|
||||
}
|
||||
|
||||
$e107cache->set("nq_chatbox", $text);
|
||||
$e107cache->set('nq_chatbox', $text);
|
||||
}
|
||||
|
||||
|
||||
$caption = (file_exists(THEME . "images/chatbox_menu.png")
|
||||
$caption = (file_exists(THEME . 'images/chatbox_menu.png')
|
||||
? "<img src='" . THEME_ABS . "images/chatbox_menu.png' alt='' /> " . LAN_PLUGIN_CHATBOX_MENU_NAME
|
||||
: LAN_PLUGIN_CHATBOX_MENU_NAME);
|
||||
|
||||
|
||||
if ($pref['cb_layer'] === 1) {
|
||||
if ($pref['cb_layer'] === 1)
|
||||
{
|
||||
|
||||
$text =
|
||||
$texta . "<div style='border : 0; padding : 4px; width : auto; height : " . $pref['cb_layer_height'] . "px; overflow : auto; '>" . $text . "</div>";
|
||||
$texta . "<div style='border : 0; padding : 4px; width : auto; height : " . $pref['cb_layer_height'] . "px; overflow : auto; '>" . $text . '</div>';
|
||||
|
||||
$ns->tablerender($caption, $text, 'chatbox');
|
||||
|
||||
} elseif ($pref['cb_layer'] === 2 && e_AJAX_REQUEST) {
|
||||
}
|
||||
elseif ($pref['cb_layer'] === 2 && e_AJAX_REQUEST)
|
||||
{
|
||||
|
||||
$text = $texta . $text;
|
||||
$text = str_replace(e_IMAGE, e_IMAGE_ABS, $text);
|
||||
echo $text;
|
||||
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$text = $texta . $text;
|
||||
|
||||
if ($pref['cb_layer'] === 2) {
|
||||
$text = "<div id='chatbox_posts'>" . $text . "</div>";
|
||||
if ($pref['cb_layer'] === 2)
|
||||
{
|
||||
$text = "<div id='chatbox_posts'>" . $text . '</div>';
|
||||
}
|
||||
|
||||
$ns->tablerender($caption, $text, 'chatbox');
|
||||
|
@ -39,11 +39,11 @@ if (isset($_POST['update_menu']))
|
||||
$tp = e107::getParser();
|
||||
foreach($_POST as $key=>$value)
|
||||
{
|
||||
if($key == "comment_caption")
|
||||
{
|
||||
//if($key == "comment_caption")
|
||||
// {
|
||||
// $temp['comment_caption'][e_LANGUAGE] = $tp->toDB($value);
|
||||
// continue;
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
if ($value != LAN_UPDATE)
|
||||
|
@ -84,10 +84,10 @@ class adminDownload extends download
|
||||
// {
|
||||
// $this->_observe_newsCommentsRecalc();
|
||||
// }
|
||||
if(isset($_POST['etrigger_ecolumns']))
|
||||
{
|
||||
//if(isset($_POST['etrigger_ecolumns']))
|
||||
//{
|
||||
// $this->_observe_saveColumns();
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
@ -166,10 +166,10 @@ class download
|
||||
|
||||
|
||||
|
||||
if($this->qry['action'] == 'maincats')
|
||||
{
|
||||
//if($this->qry['action'] == 'maincats')
|
||||
// {
|
||||
//
|
||||
}
|
||||
// }
|
||||
|
||||
if($this->qry['action'] == 'list')
|
||||
{
|
||||
@ -186,15 +186,15 @@ class download
|
||||
$this->loadReport();
|
||||
}
|
||||
|
||||
if($this->qry['action'] == 'mirror')
|
||||
{
|
||||
//if($this->qry['action'] == 'mirror')
|
||||
// {
|
||||
//
|
||||
}
|
||||
// }
|
||||
|
||||
if($this->qry['action'] == 'error')
|
||||
{
|
||||
// if($this->qry['action'] == 'error')
|
||||
// {
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@ -720,11 +720,11 @@ class download
|
||||
return $ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, "<div class='alert alert-info' style='text-align:center'>".LAN_NO_RECORDS_FOUND."</div>",'download-list',true);
|
||||
}
|
||||
|
||||
if ($dlrow['download_category_parent'] == 0) // It's a main category - change the listing type required
|
||||
{
|
||||
//if ($dlrow['download_category_parent'] == 0) // It's a main category - change the listing type required
|
||||
// {
|
||||
// $action = 'maincats';
|
||||
// $maincatval = $id;
|
||||
}
|
||||
// }
|
||||
|
||||
$dl_text = $tp->parseTemplate($this->templateHeader, TRUE, $sc);
|
||||
|
||||
|
@ -1321,10 +1321,10 @@ $columnInfo = array(
|
||||
$etext = "";
|
||||
}
|
||||
|
||||
if (!$found && $download_url)
|
||||
{
|
||||
//if (!$found && $download_url)
|
||||
// {
|
||||
// $text .= "<option value='".$download_url."' selected='selected'>".$download_url.$etext."</option>\n";
|
||||
}
|
||||
// }
|
||||
|
||||
// $text .= " </select>";
|
||||
|
||||
|
@ -265,8 +265,8 @@ if ($type == "file")
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(strstr(e_QUERY, "pub_"))
|
||||
{
|
||||
//else if(strstr(e_QUERY, "pub_"))
|
||||
// {
|
||||
/* check to see if public upload and not in download table ... */
|
||||
/*$bid = str_replace("pub_", "", e_QUERY);
|
||||
if($result = @mysql_query("SELECT * FROM ".MPREFIX."rbinary WHERE binary_id = '$bid' "))
|
||||
@ -281,7 +281,7 @@ if ($type == "file")
|
||||
echo $binary_data;
|
||||
exit();
|
||||
}*/
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
$log->addError("Line".__LINE__.": Couldn't find ".e_DOWNLOAD.e_QUERY);
|
||||
|
@ -65,10 +65,7 @@ if (!vartrue($_GET['elan']) && empty($_GET))
|
||||
$id = $qs[1];
|
||||
$idx = $qs[2];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -192,11 +192,11 @@ class faqs_shortcodes extends e_shortcode
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
$faqpref = e107::getPlugConfig('faqs')->getPref();
|
||||
if(($faqpref['add_faq'] && $this->var['faq_author'] == USERID) || ADMIN )
|
||||
{
|
||||
//if(($faqpref['add_faq'] && $this->var['faq_author'] == USERID) || ADMIN )
|
||||
// {
|
||||
// UNDER CONSTRUCTION
|
||||
//return "[ <a href='faqs.php?edit.".$this->var['faq_parent'].".".$this->var['faq_id']."'>Edit</a> ]";
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
/* {FAQ_CATEGORY_ID} */
|
||||
|
@ -119,10 +119,10 @@ class list_forum
|
||||
{
|
||||
$LASTPOST = substr($thread_lastuser, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
//else
|
||||
// {
|
||||
//$LASTPOST = NFPM_L16;
|
||||
}
|
||||
// }
|
||||
}
|
||||
$LASTPOST .= " ".LIST_FORUM_6." <span class='smalltext'>$r_datestamp</span>";
|
||||
}
|
||||
|
@ -286,10 +286,10 @@ function parse_subs($forumList, $id, $lastpost_datestamp)
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if (e_QUERY == 'track')
|
||||
{
|
||||
//if (e_QUERY == 'track')
|
||||
//{
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
if (e_QUERY == 'new')
|
||||
{
|
||||
|
@ -704,12 +704,12 @@ class e107forum
|
||||
$tmp[$row['forum_parent']] = 1;
|
||||
}
|
||||
ksort($tmp);
|
||||
if($key == 'post')
|
||||
{
|
||||
//if($key == 'post')
|
||||
// {
|
||||
//echo "<h3>Raw Perms</h3>";
|
||||
// echo "Qry: ".$qryList['post'];
|
||||
// print_a($tmp);
|
||||
}
|
||||
// }
|
||||
$this->permList[$key] = array_keys($tmp);
|
||||
$this->permList[$key.'_list'] = implode(',', array_keys($tmp));
|
||||
}
|
||||
@ -2068,10 +2068,10 @@ class e107forum
|
||||
// return $row['thread_id'];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//else
|
||||
// {
|
||||
// e107::getMessage()->addDebug(ucfirst($which)." Thread Qry Returned Nothing: ".$qry);
|
||||
}
|
||||
// }
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -1710,11 +1710,11 @@ class forum_post_handler
|
||||
|
||||
return $ret;
|
||||
}
|
||||
else
|
||||
{
|
||||
//else
|
||||
// {
|
||||
// e107::getMessage()->addError('There was a problem with the attachment.');
|
||||
// e107::getMessage()->addDebug(print_a($_FILES['file_userfile'],true));
|
||||
}
|
||||
// }
|
||||
}
|
||||
/* no file uploaded at all, proceed with creating the topic or reply
|
||||
// TODO don't call process_upload() when no attachments are uploaded.. (check user input first, then call if needed)
|
||||
|
@ -66,10 +66,10 @@ class forum_setup
|
||||
}
|
||||
|
||||
$legacyMenuPref = e107::getConfig('menu')->getPref();
|
||||
if(isset($legacyMenuPref['newforumposts_caption']))
|
||||
{
|
||||
//if(isset($legacyMenuPref['newforumposts_caption']))
|
||||
//{
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -503,11 +503,7 @@ function step5()
|
||||
$sefs[$forum_sef] = true;
|
||||
|
||||
// $tmp['_FIELD_TYPES'] = $ftypes['_FIELD_TYPES'];
|
||||
if ($sql -> insert('forum_new', $tmp))
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
if (!$sql -> insert('forum_new', $tmp))
|
||||
{
|
||||
$mes->addDebug("Insert failed on " . print_a($tmp, true));
|
||||
$mes->addError($sql->getLastErrorText());
|
||||
@ -1687,21 +1683,21 @@ class forumUpgrade
|
||||
//Copy was successful, let's delete the original files now.
|
||||
// $r = true;
|
||||
// $r = unlink($old);
|
||||
if (!$r)
|
||||
{
|
||||
//if (!$r)
|
||||
// {
|
||||
// $error = 'Was unable to delete old attachment: '.$old;
|
||||
// return false;
|
||||
}
|
||||
if ($oldThumb)
|
||||
{
|
||||
// }
|
||||
// if ($oldThumb)
|
||||
// {
|
||||
// $r = true;
|
||||
// $r = unlink($oldThumb);
|
||||
if (!$r)
|
||||
{
|
||||
//if (!$r)
|
||||
// {
|
||||
// $error = 'Was unable to delete old thumb: '.$oldThumb;
|
||||
// return false;
|
||||
}
|
||||
}
|
||||
// }
|
||||
// }
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -362,7 +362,7 @@
|
||||
{
|
||||
if(THEME_LEGACY === true && ($stuck === false || $unstuck === true))
|
||||
{
|
||||
// do nothing.
|
||||
$doNothing; // do nothing.
|
||||
}
|
||||
elseif(!empty($FORUM_NORMAL_ROW))
|
||||
{
|
||||
@ -521,11 +521,11 @@
|
||||
|
||||
$text .= "<li class='text-right'><a class='dropdown-item' href='{$moveUrl}'>" . LAN_FORUM_2042 . " " . $tp->toGlyph('move') . "</a></li>";
|
||||
|
||||
if(e_DEVELOPER)
|
||||
{
|
||||
//if(e_DEVELOPER)
|
||||
// {
|
||||
// $text .= "<li class='text-right'><a href='{$splitUrl}'>Split ".$tp->toGlyph('scissors')."</i></a></li>";
|
||||
// print_a($thread_info);
|
||||
}
|
||||
// }
|
||||
|
||||
/*
|
||||
$text .= "<li><input type='image' ".IMAGE_admin_delete." name='deleteThread_{$threadId}' value='thread_action' onclick=\"return confirm_({$threadId})\" /> Delete</li>";
|
||||
|
@ -202,11 +202,11 @@ class user_import
|
||||
return 3;
|
||||
}
|
||||
|
||||
if (strlen($userRecord[$k]) < 3)
|
||||
{
|
||||
//if (strlen($userRecord[$k]) < 3)
|
||||
// {
|
||||
// e107::getMessage()->addDebug("Failed userMandatory length on {$k}");
|
||||
// return 3;
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
if (!isset($userRecord['user_join'])) $userRecord['user_join'] = time();
|
||||
|
@ -186,7 +186,8 @@ class phpbb3_import extends base_import_class
|
||||
*
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
function convertUserBan($data)
|
||||
{
|
||||
if($data == 3) // founder in phpbb3, but 'bounced' in e107.
|
||||
|
@ -564,19 +564,17 @@ class listclass
|
||||
{
|
||||
$name = "list_".$file;
|
||||
|
||||
$listArray = '';
|
||||
$listArray = array();
|
||||
|
||||
//instantiate the class with this as parm
|
||||
if(!class_exists($name))
|
||||
{
|
||||
//echo "class $name doesn't exist<br />";
|
||||
}
|
||||
else
|
||||
|
||||
if(class_exists($name))
|
||||
{
|
||||
$class = new $name($this);
|
||||
//call method
|
||||
if(!method_exists($class, 'getListData'))
|
||||
{
|
||||
return $listArray;
|
||||
//echo "method getListData doesn't exist in class $class<br />";
|
||||
}
|
||||
else
|
||||
@ -600,6 +598,7 @@ class listclass
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $listArray;
|
||||
}
|
||||
|
||||
|
@ -45,10 +45,10 @@ class news_related // include plugin-folder in the name.
|
||||
|
||||
return $items;
|
||||
}
|
||||
elseif(ADMIN)
|
||||
{
|
||||
//elseif(ADMIN)
|
||||
//{
|
||||
// return array(array('title'=>$query,'url'=>''));
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1495,8 +1495,8 @@ class news_front
|
||||
{
|
||||
|
||||
|
||||
if(!$this->action)
|
||||
{
|
||||
//if(!$this->action)
|
||||
// {
|
||||
// Removed, themes should use {FEATUREBOX} shortcode instead
|
||||
// if (isset($this->pref['fb_active']))
|
||||
// {
|
||||
@ -1508,7 +1508,7 @@ class news_front
|
||||
// require_once(e_PLUGIN."newforumposts_main/newforumposts_main.php");
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
//news archive
|
||||
if ($this->action != "item" && $this->action != 'list' && $this->pref['newsposts_archive'])
|
||||
@ -1524,10 +1524,10 @@ class news_front
|
||||
{
|
||||
$newsCachedPage = $newsCachedPage.$newsarchive;
|
||||
}
|
||||
else
|
||||
{
|
||||
//else
|
||||
// {
|
||||
// $this->show_newsarchive($newsAr,$interval);
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@ -1567,8 +1567,8 @@ class news_front
|
||||
|
||||
$action = $currentNewsAction;
|
||||
|
||||
if(!$action)
|
||||
{
|
||||
//if(!$action)
|
||||
// {
|
||||
// Removed, themes should use {FEATUREBOX} shortcode instead
|
||||
// if (isset($this->pref['fb_active'])){ // --->feature box
|
||||
// require_once(e_PLUGIN."featurebox/featurebox.php");
|
||||
@ -1578,7 +1578,7 @@ class news_front
|
||||
// if (isset($this->pref['nfp_display']) && $this->pref['nfp_display'] == 1){
|
||||
// require_once(e_PLUGIN."newforumposts_main/newforumposts_main.php");
|
||||
// }
|
||||
}
|
||||
// }
|
||||
|
||||
/**
|
||||
* @deprecated - for BC only. May be removed in future without further notice.
|
||||
|
@ -467,10 +467,10 @@ class newsletter
|
||||
{
|
||||
$mailMainID = $mailData['mail_source_id'] = $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
//else
|
||||
//{
|
||||
// TODO: Handle error
|
||||
}
|
||||
//}
|
||||
|
||||
|
||||
$mailer->mailInitCounters($mailMainID); // Initialise counters for emails added
|
||||
|
@ -245,14 +245,14 @@ class newsletter_mailout
|
||||
*/
|
||||
public function sent($data) // trigerred when email sent from queue.
|
||||
{
|
||||
if($data['status'] == 1) // Successfully sent
|
||||
{
|
||||
// if($data['status'] == 1) // Successfully sent
|
||||
// {
|
||||
// e107::getLog()->add('Newsletter Sent', $data, E_LOG_INFORMATIVE, 'SENT');
|
||||
}
|
||||
else // Failed
|
||||
{
|
||||
// }
|
||||
// else // Failed
|
||||
// {
|
||||
// e107::getLog()->add('Newsletter Sent', $data, E_LOG_FATAL, 'SENT');
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -79,10 +79,10 @@ class page_related // replace 'e_' with 'plugin-folder_'
|
||||
|
||||
return $items;
|
||||
}
|
||||
else
|
||||
{
|
||||
//else
|
||||
//{
|
||||
// return array(array('title'=>$query,'url'=>''));
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -179,10 +179,10 @@ class page_sitelink // include plugin-folder in the name.
|
||||
|
||||
$row['chapter_sef'] = $this->getSef($row['page_chapter']);
|
||||
|
||||
if(!vartrue($row['chapter_sef']))
|
||||
{
|
||||
//if(!vartrue($row['chapter_sef']))
|
||||
//{
|
||||
// $row['chapter_sef'] = '--sef-not-assigned--';
|
||||
}
|
||||
// }
|
||||
|
||||
$arr[] = $this->pageArray($row);
|
||||
|
||||
|
@ -851,7 +851,11 @@ class private_message
|
||||
|
||||
@set_time_limit(10 * 60);
|
||||
@ini_set("max_execution_time", 10 * 60);
|
||||
while (@ob_end_clean()); // kill all output buffering else it eats server resources
|
||||
while (ob_get_length() !== false) // destroy all ouput buffering
|
||||
{
|
||||
ob_end_clean();
|
||||
}
|
||||
|
||||
if (connection_status() == 0)
|
||||
{
|
||||
if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
|
||||
|
@ -12,10 +12,10 @@ if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
global $e107;
|
||||
|
||||
if(defined("POLLRENDERED"))
|
||||
{
|
||||
//if(defined("POLLRENDERED"))
|
||||
//{
|
||||
// return;
|
||||
}
|
||||
//}
|
||||
|
||||
if (!e107::isInstalled('poll'))
|
||||
{
|
||||
|
@ -109,7 +109,10 @@ if (empty($rss_type))
|
||||
}
|
||||
|
||||
|
||||
while (@ob_end_clean());
|
||||
while (ob_get_length() !== false) // destroy all ouput buffering
|
||||
{
|
||||
ob_end_clean();
|
||||
}
|
||||
|
||||
// Returning feeds here
|
||||
// Conversion table for old urls -------
|
||||
|
@ -82,7 +82,10 @@ function e_jslib_cache_out()
|
||||
if ($cacheFile)
|
||||
{
|
||||
//kill any output buffering - better performance and 304 not modified requirement
|
||||
while (@ob_end_clean());
|
||||
while (ob_get_length() !== false) // destroy all ouput buffering
|
||||
{
|
||||
ob_end_clean();
|
||||
}
|
||||
|
||||
/* IT CAUSES GREAT TROUBLES ON SOME BROWSERS!
|
||||
if (function_exists('date_default_timezone_set'))
|
||||
|
@ -115,10 +115,10 @@ if (isset($_POST['emailsubmit']))
|
||||
$message .= "\n\n".LAN_EMAIL_1." ".$author;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//else
|
||||
// {
|
||||
// $message .= $comments."\n"; // Added to message later on
|
||||
}
|
||||
// }
|
||||
$ip = e107::getIPHandler()->getIP(FALSE);
|
||||
$message .= "\n\n".LAN_EMAIL_2." ".$ip."\n\n";
|
||||
|
||||
|
@ -160,10 +160,10 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
else // Existing User.
|
||||
{
|
||||
//else // Existing User.
|
||||
//{
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
30
search.php
30
search.php
@ -638,10 +638,10 @@ class search extends e_shortcode
|
||||
$search_info = $this->array_sort($search_info, 'listorder', SORT_ASC);
|
||||
$this->search_info = $search_info;
|
||||
|
||||
if(e_DEBUG)
|
||||
{
|
||||
//if(e_DEBUG)
|
||||
// {
|
||||
// echo e107::getMessage()->addDebug(print_a($this->search_info,true))->render();
|
||||
}
|
||||
// }
|
||||
|
||||
return $search_info;
|
||||
}
|
||||
@ -808,11 +808,11 @@ class search extends e_shortcode
|
||||
|
||||
$ps = $obj->parsesearch($this->search_info[$key]['table'], $this->search_info[$key]['return_fields'], $this->search_info[$key]['search_fields'], $this->search_info[$key]['weights'], 'self', varset($this->search_info[$key]['no_results'],"<div class='alert alert-danger'>".LAN_198."</div>"), $where , $this->search_info[$key]['order']);
|
||||
|
||||
if(e_DEBUG)
|
||||
{
|
||||
//if(e_DEBUG)
|
||||
// {
|
||||
// echo e107::getMessage()->addDebug(print_a($this->search_info,true))->render();// "DEBUG: Order is missing";
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
// print_a($ps);
|
||||
|
||||
@ -842,10 +842,10 @@ class search extends e_shortcode
|
||||
{
|
||||
$temp = preg_replace('/[^\w_]/i','',$pparm_key);
|
||||
$temp1 = preg_replace('/[^\w_ +]/i','',$pparm_value); // Filter 'non-word' charcters in search term
|
||||
if (($temp == $pparm_key) && !isset($core_parms[$pparm_key]))
|
||||
{
|
||||
//if (($temp == $pparm_key) && !isset($core_parms[$pparm_key]))
|
||||
// {
|
||||
// $parms .= "&".$pparm_key."=".$temp1; //FIXME Unused
|
||||
}
|
||||
// }
|
||||
}
|
||||
if ($results > $search_res)
|
||||
{
|
||||
@ -1053,13 +1053,13 @@ $SEARCH_VARS->ENHANCED_DISPLAY = $enhanced ? "" : "style='display: none'";
|
||||
// advanced search config
|
||||
if (!vartrue($_GET['adv']) || $_GET['t'] == 'all')
|
||||
{
|
||||
foreach ($_GET as $gk => $gv)
|
||||
{
|
||||
if ($gk != 't' && $gk != 'q' && $gk != 'r' && $gk != 'in' && $gk != 'ex' && $gk != 'ep' && $gk != 'be' && $gk != 'adv')
|
||||
{
|
||||
//foreach ($_GET as $gk => $gv)
|
||||
// {
|
||||
//if ($gk != 't' && $gk != 'q' && $gk != 'r' && $gk != 'in' && $gk != 'ex' && $gk != 'ep' && $gk != 'be' && $gk != 'adv')
|
||||
//{
|
||||
// unset($_GET[$gk]);
|
||||
}
|
||||
}
|
||||
//}
|
||||
// }
|
||||
}
|
||||
|
||||
//$SEARCH_VARS->SEARCH_TYPE_SEL = "<input type='radio' name='adv' value='0' ".(varsettrue($_GET['adv']) ? "" : "checked='checked'")." /> ".LAN_SEARCH_29."
|
||||
|
Loading…
x
Reference in New Issue
Block a user