1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-25 23:36:29 +02:00

PHP8 Compatibility and code cleanup.

This commit is contained in:
Cameron
2020-12-08 12:21:12 -08:00
parent a094a8fb73
commit afaac88003
49 changed files with 264 additions and 225 deletions

View File

@@ -177,10 +177,10 @@ if(!class_exists("_blank_setup"))
$legacyMenuPref = e107::getConfig('menu')->getPref();
if(isset($legacyMenuPref['newforumposts_caption']))
/* if(isset($legacyMenuPref['newforumposts_caption']))
{
}
}*/
return false;
}

View File

@@ -96,12 +96,12 @@ class _blank_admin implements e_admin_addon_interface
if(!empty($id) )
{
if(!empty($data['x__blank_url']))
{
// if(!empty($data['x__blank_url']))
// {
// eg. Save the data in 'blank' plugin table. .
}
// }
}

View File

@@ -43,10 +43,10 @@ class _blank_related // include plugin-folder in the name.
return $items;
}
elseif(ADMIN)
{
// elseif(ADMIN)
// {
// return array(array('title'=>$query,'url'=>''));
}
// }
}
}

View File

@@ -315,10 +315,10 @@ class ExtendedPasswordHandler extends UserHandler
{
$hash = $stored_hash;
}
if(strlen($hash) !== 32)
{
// if(strlen($hash) !== 32)
// {
//return PASSWORD_INVALID;
}
// }
$pwHash = $salt ? md5($salt.$pword) : md5($pword);
$stored_hash = $hash;

View File

@@ -274,10 +274,10 @@ class auth_login extends alt_auth_base
return AUTH_NOUSER; // Bit debateable what to return if this happens
}
}
else // Probably a bit strange if we don't get any info back - but possible
{
//else // Probably a bit strange if we don't get any info back - but possible
// {
// echo "No results!<br />";
}
// }
return AUTH_SUCCESS;
}

View File

@@ -93,9 +93,9 @@ if (strstr(e_QUERY, "fs")) {
}
// end search
if (e_QUERY ? $from = intval(e_QUERY) : $from = 0) {
;
}
//if (e_QUERY ? $from = intval(e_QUERY) : $from = 0) {
//}
$chat_total = $sql->count('chatbox');

View File

@@ -36,9 +36,12 @@ $emessage = '';
if ((isset($_POST['chat_submit']) || e_AJAX_REQUEST) && $_POST['cmessage'] !== '') {
if ( ! USER && ! $pref['anon_post']) {
if ( ! USER && ! $pref['anon_post'])
{
// disallow post
} else {
}
else
{
$nick = trim(preg_replace("#\[.*\]#si", "", $tp->toDB($_POST['nick'])));
$cmessage = $_POST['cmessage'];

View File

@@ -23,12 +23,13 @@ e107::includeLan(e_PLUGIN.'clock_menu/languages/admin/'.e_LANGUAGE.'.php');
$frm = e107::getForm();
$mes = e107::getMessage();
$menu_pref = e107::getConfig('menu')->getPref('');
$menu_pref = e107::getConfig('menu')->getPref();
if (isset($_POST['update_menu']))
{
$temp = array();
while (list($key, $value) = each($_POST))
foreach($_POST as $key=>$value)
{
if ($key != 'update_menu')
{
@@ -39,7 +40,7 @@ if (isset($_POST['update_menu']))
{
$temp['clock_format'] = 0;
}
if ($admin_log->logArrayDiffs($temp,$menu_pref,'MISC_05'))
if (e107::getLog()->logArrayDiffs($temp,$menu_pref,'MISC_05'))
{
$menuPref = e107::getConfig('menu');
foreach ($temp as $k => $v)
@@ -50,7 +51,7 @@ if (isset($_POST['update_menu']))
}
}
$ns->tablerender($caption, $mes->render(). $text);
e107::getRender()->tablerender(null, $mes->render());
$text = "
<form method='post' action='".e_SELF."?".e_QUERY."' name='menu_conf_form'>
@@ -101,5 +102,5 @@ $text = "
</form>
";
$ns->tablerender(CLOCK_AD_L4, $text);
e107::getRender()->tablerender(CLOCK_AD_L4, $text);
require_once(e_ADMIN."footer.php");

View File

@@ -37,7 +37,7 @@ if (isset($_POST['update_menu']))
$tp = e107::getParser();
while (list($key, $value) = each($_POST))
foreach($_POST as $key=>$value)
{
if($key == "comment_caption")
{
@@ -61,7 +61,7 @@ if (isset($_POST['update_menu']))
if($menu_config->save(false))
{
$mes->addSuccess();
$mes->addSuccess(LAN_SAVED);
}
/*if ($admin_log->logArrayDiffs($old, $menu_config->getPref(), 'MISC_04'))
{
@@ -117,6 +117,6 @@ $text = "
</div>
</form>";
$ns->tablerender(CM_L8, $mes->render() . $text);
e107::getRender()->tablerender(CM_L8, $mes->render() . $text);
require_once(e_ADMIN."footer.php");

View File

@@ -11,7 +11,9 @@ e107::lan('download','download');
$log = e107::getAdminLog();
$id = FALSE;
$sql = e107::getDb();
$tp = e107::getRender();
$pref = e107::pref('core');
if (!is_numeric(e_QUERY) && empty($_GET['id']))
{
@@ -46,13 +48,13 @@ if(strstr(e_QUERY, "mirror"))
{
$row = $sql->fetch();
extract($row);
if (check_class($download_category_class) && check_class($download_class))
if (check_class($row['download_category_class']) && check_class($row['download_class']))
{
if($pref['download_limits'] && $download_active == 1)
if($pref['download_limits'] && $row['download_active'] == 1)
{
check_download_limits();
}
$mirrorList = explode(chr(1), $download_mirror);
$mirrorList = explode(chr(1), $row['download_mirror']);
$mstr = "";
foreach($mirrorList as $mirror)
{
@@ -124,7 +126,7 @@ if (preg_match("#.*\.[a-z,A-Z]{3,4}#", e_QUERY))
$log->addError("Line".__LINE__.": Couldn't find ".e_DOWNLOAD.e_QUERY);
$log->toFile('download_requests','Download Requests', true); // Create a log file and add the log messages
require_once(HEADERF);
$ns->tablerender(LAN_ERROR, "<div style='text-align:center'>".LAN_FILE_NOT_FOUND."\n<br /><br />\n<a href='javascript:history.back(1)'>".LAN_BACK."</a></div>");
e107::getRender()->tablerender(LAN_ERROR, "<div style='text-align:center'>".LAN_FILE_NOT_FOUND."\n<br /><br />\n<a href='javascript:history.back(1)'>".LAN_BACK."</a></div>");
require_once(FOOTERF);
exit();
}
@@ -146,7 +148,7 @@ if ($type == "file")
$search = array("[","]");
$replace = array("<a href='".e_HTTP."download.php'>", "</a>");
$ns->tablerender(LAN_ERROR, "<div class='alert alert-warning' style='text-align:center'>".str_replace($search, $replace, LAN_dl_78).'</div>');
e107::getRender()->tablerender(LAN_ERROR, "<div class='alert alert-warning' style='text-align:center'>".str_replace($search, $replace, LAN_dl_78).'</div>');
require_once(FOOTERF);
exit();
}
@@ -156,9 +158,9 @@ if ($type == "file")
check_download_limits();
}
extract($row);
if($download_mirror)
if($row['download_mirror'])
{
$array = explode(chr(1), $download_mirror);
$array = explode(chr(1), $row['download_mirror']);
$c = (count($array)-1);
for ($i=1; $i < $c; $i++)
{
@@ -199,46 +201,46 @@ if ($type == "file")
$ip = e107::getIPHandler()->getIP(FALSE);
$request_data = "'0', '{$user_id}', '{$ip}', '{$id}', '".time()."'";
//add request info to db
$sql->db_Insert("download_requests", $request_data, FALSE);
if (preg_match("/Binary\s(.*?)\/.*/", $download_url, $result))
$sql->insert("download_requests", $request_data, FALSE);
// if (preg_match("/Binary\s(.*?)\/.*/", $download_url, $result))
// {
// $bid = $result[1];
/// $result = @mysql_query("SELECT * FROM ".MPREFIX."rbinary WHERE binary_id = '{$bid}'");
// $binary_data = @mysql_result($result, 0, "binary_data");
// $binary_filetype = @mysql_result($result, 0, "binary_filetype");
// $binary_name = @mysql_result($result, 0, "binary_name");
// header("Content-type: {$binary_filetype}");
// header("Content-length: {$download_filesize}");
// header("Content-Disposition: attachment; filename={$binary_name}");
// header("Content-Description: PHP Generated Data");
// echo $binary_data;
// exit();
// }
if (strstr($row['download_url'], "http://") || strstr($row['download_url'], "ftp://") || strstr($row['download_url'], "https://"))
{
$bid = $result[1];
$result = @mysql_query("SELECT * FROM ".MPREFIX."rbinary WHERE binary_id = '{$bid}'");
$binary_data = @mysql_result($result, 0, "binary_data");
$binary_filetype = @mysql_result($result, 0, "binary_filetype");
$binary_name = @mysql_result($result, 0, "binary_name");
header("Content-type: {$binary_filetype}");
header("Content-length: {$download_filesize}");
header("Content-Disposition: attachment; filename={$binary_name}");
header("Content-Description: PHP Generated Data");
echo $binary_data;
exit();
}
if (strstr($download_url, "http://") || strstr($download_url, "ftp://") || strstr($download_url, "https://"))
{
$download_url = e107::getParser()->parseTemplate($download_url,true); // support for shortcode-driven dynamic URLS.
$download_url = e107::getParser()->parseTemplate($row['download_url'],true); // support for shortcode-driven dynamic URLS.
e107::redirect(decorate_download_location($download_url));
// header("Location: {$download_url}");
exit();
}
else
{
if (file_exists(e_DOWNLOAD.$download_url))
if (file_exists(e_DOWNLOAD.$row['download_url']))
{
e107::getFile()->send(e_DOWNLOAD.$download_url);
e107::getFile()->send(e_DOWNLOAD.$row['download_url']);
exit();
}
elseif(file_exists($download_url))
elseif(file_exists($row['download_url']))
{
e107::getFile()->send($download_url);
e107::getFile()->send($row['download_url']);
exit();
}
elseif(file_exists(e_UPLOAD.$download_url))
elseif(file_exists(e_UPLOAD.$row['download_url']))
{
e107::getFile()->send(e_UPLOAD.$download_url);
e107::getFile()->send(e_UPLOAD.$row['download_url']);
exit();
}
$log->addError("Couldn't find ".e_DOWNLOAD.$download_url." or ".$download_url." or ".e_UPLOAD.$download_ur);
$log->addError("Couldn't find ".e_DOWNLOAD.$row['download_url']." or ".$row['download_url']." or ".e_UPLOAD.$row['download_url']);
$log->toFile('download_requests','Download Requests', true); // Create a log file and add the log messages
}
}
@@ -266,7 +268,7 @@ if ($type == "file")
else if(strstr(e_QUERY, "pub_"))
{
/* check to see if public upload and not in download table ... */
$bid = str_replace("pub_", "", e_QUERY);
/*$bid = str_replace("pub_", "", e_QUERY);
if($result = @mysql_query("SELECT * FROM ".MPREFIX."rbinary WHERE binary_id = '$bid' "))
{
$binary_data = @mysql_result($result, 0, "binary_data");
@@ -278,14 +280,14 @@ if ($type == "file")
header("Content-Description: PHP Generated Data");
echo $binary_data;
exit();
}
}*/
}
$log->addError("Line".__LINE__.": Couldn't find ".e_DOWNLOAD.e_QUERY);
$log->toFile('download_requests','Download Requests', true); // Create a log file and add the log messages
require_once(HEADERF);
$ns -> tablerender(LAN_ERROR, "<div style='text-align:center'>".LAN_FILE_NOT_FOUND."<br /><br /><a href='javascript:history.back(1)'>".LAN_BACK."</a></div>");
e107::getRender()->tablerender(LAN_ERROR, "<div style='text-align:center'>".LAN_FILE_NOT_FOUND."<br /><br /><a href='javascript:history.back(1)'>".LAN_BACK."</a></div>");
require_once(FOOTERF);
exit();
}
@@ -293,10 +295,10 @@ if ($type == "file")
$sql->select($table, "*", "{$table}_id = '{$id}'");
$row = $sql->fetch();
extract($row);
$image = ($table == "upload" ? $upload_ss : $download_image);
if (preg_match("/Binary\s(.*?)\/.*/", $image, $result))
{
$bid = $result[1];
$image = ($table == "upload" ? $row['upload_ss'] : $row['download_image']);
//if (preg_match("/Binary\s(.*?)\/.*/", $image, $result))
//{
/* $bid = $result[1];
$result = @mysql_query("SELECT * FROM ".MPREFIX."rbinary WHERE binary_id = '{$bid}'");
$binary_data = @mysql_result($result, 0, "binary_data");
$binary_filetype = @mysql_result($result, 0, "binary_filetype");
@@ -304,11 +306,12 @@ if (preg_match("/Binary\s(.*?)\/.*/", $image, $result))
header("Content-type: {$binary_filetype}");
header("Content-Disposition: inline; filename={$binary_name}");
echo $binary_data;
exit();
}
exit();*/
//}
$image = ($table == "upload" ? $upload_ss : $download_image);
// $image = ($table == "upload" ? $upload_ss : $download_image);
if (strpos($image, "http") !== FALSE)
{
@@ -338,7 +341,7 @@ else
$disp .= "<br /><div style='text-align:center'><a href='javascript:history.back(1)'>".LAN_BACK."</a></div>";
$ns->tablerender($imagecaption, $disp);
e107::getRender()->tablerender($imagecaption, $disp);
require_once(FOOTERF);
} else
@@ -354,7 +357,7 @@ else
else
{
require_once(HEADERF);
$ns->tablerender(LAN_ERROR, "<div style='text-align:center'>".LAN_FILE_NOT_FOUND."<br /><br /><a href='javascript:history.back(1)'>".LAN_BACK."</a></div>");
e107::getRender()->tablerender(LAN_ERROR, "<div style='text-align:center'>".LAN_FILE_NOT_FOUND."<br /><br /><a href='javascript:history.back(1)'>".LAN_BACK."</a></div>");
require_once(FOOTERF);
exit;
}
@@ -366,7 +369,7 @@ else
function check_download_limits()
{
global $pref, $sql, $ns, $HEADER, $e107, $tp;
global $pref, $sql, $HEADER;
// Check download count limits
$qry = "SELECT gen_intdata, gen_chardata, (gen_intdata/gen_chardata) as count_perday FROM #generic WHERE gen_type = 'download_limit' AND gen_datestamp IN (".USERCLASS_LIST.") AND (gen_chardata >= 0 AND gen_intdata >= 0) ORDER BY count_perday DESC";
if($sql->gen($qry))

View File

@@ -245,7 +245,7 @@ function parse_forum($f, $restricted_string = '')
function parse_subs($forumList, $id ='', $lastpost_datestamp)
function parse_subs($forumList, $id, $lastpost_datestamp)
{
$tp = e107::getParser();

View File

@@ -17,7 +17,7 @@
protected $e107;
protected $defaultImgAttachSize = false;
protected $pref;
public $pref;
// $param is sent from nfp menu.
function __construct()
@@ -1264,13 +1264,6 @@
return $text;
}
if(E107_DEBUG_LEVEL > 0)
{
// echo "<div class='alert alert-info'>Thread id: ".$threadId."</div>";
// print_a($this);
}
// Preview should be reserved for the full 'Post reply' page. <input type='submit' name='fpreview' value='" . Preview . "' /> &nbsp;
}
//---- else

View File

@@ -384,8 +384,13 @@ class html_import extends base_import_class
}
function process($type='description',$source)
function process($type, $source)
{
if(empty($type))
{
$type = 'description';
}
switch ($type)
{
case 'category':

View File

@@ -183,7 +183,10 @@ class listclass
}
}
//sort array on order values set in preferences
usort($arr, create_function('$e,$f','return $e["order"]==$f["order"]?0:($e["order"]>$f["order"]?1:-1);'));
usort($arr, function($e, $f)
{
return $e["order"]==$f["order"] ? 0 : ($e["order"] > $f["order"] ? 1 : -1);
});
return $arr;
}

View File

@@ -174,7 +174,7 @@ function getBrowser($agent)
"konqueror" => array('name' => 'Konqueror', 'rule' => 'konqueror/([0-9.]{1,10})'),
"avantbrowser" => array('name' => 'Avant Browser', 'rule' => 'Avant[ ]?Browser'),
"avantgo" => array('name' => 'AvantGo', 'rule' => 'AvantGo[ /]([0-9.]{1,10})'),
"proxomitron" => array('name' => 'Proxomitron', 'rule' => 'Space[ ]?Bison/[0-9.]{1,10}'),
// "proxomitron" => array('name' => 'Proxomitron', 'rule' => 'Space[ ]?Bison/[0-9.]{1,10}'),
"lynx" => array('name' => 'Lynx', 'rule' => 'lynx/([0-9a-z.]{1,10})'),
"links" => array('name' => 'Links', 'rule' => 'Links[ /]\(([0-9.]{1,10})'),
"galeon" => array('name' => 'Galeon', 'rule' => 'galeon/([0-9.]{1,10})'),

View File

@@ -364,7 +364,7 @@ class siteStats
'Konqueror' => "konqueror",
'Avant Browser' => "avantbrowser",
'AvantGo' => "avantgo",
'Proxomitron' => "proxomitron",
// 'Proxomitron' => "proxomitron",
'Safari' => "safari",
'Lynx' => "lynx",
'Links' => "links",
@@ -1989,7 +1989,8 @@ class siteStats
function getWidthRatio ($array, $column)
{
$tmpArray = $this -> arraySort($array, $column);
$data = each($tmpArray);
// $data = each($tmpArray);
$data = key($tmpArray);
$maxValue = $data[1]['totalv'];
echo "<b>maxValue</b> ".$maxValue." <br />";
$ratio = 0;

View File

@@ -114,7 +114,7 @@ class login_menu_class
}
function parse_external_list($active=false, $order=true)
function parse_external_list($active=false, $order=true)
{
//prevent more than 1 call
if(($tmp = getcachedvars('loginbox_elist')) !== FALSE) return $tmp;
@@ -377,7 +377,10 @@ class login_menu_class
function clean_links($link_items)
{
if(empty($link_items)) return;
if(empty($link_items))
{
return array();
}
foreach($link_items as $key => $value)
{

View File

@@ -317,24 +317,42 @@ e107::getLanguage()->bcDefs($bcDefs);
function sc_lm_external_links($parm='')
{
global $menu_pref, $login_menu_shortcodes, $LOGIN_MENU_EXTERNAL_LINK;
$tp = e107::getParser();
$lmc = new login_menu_class;
if(!vartrue($menu_pref['login_menu']['external_links'])) return '';
$lbox_infos = login_menu_class::parse_external_list(true, false);
$lbox_active = $menu_pref['login_menu']['external_links'] ? explode(',', $menu_pref['login_menu']['external_links']) : array();
if(!vartrue($lbox_infos['links'])) return '';
$ret = '';
foreach ($lbox_active as $stackid) {
$lbox_items = login_menu_class::clean_links(varset($lbox_infos['links'][$stackid]));
if(!$lbox_items) continue;
foreach ($lbox_items as $num=>$lbox_item) {
$lbox_item['link_id'] = $stackid.'_'.$num;
cachevars('login_menu_linkdata', $lbox_item);
$ret .= $tp -> parseTemplate($LOGIN_MENU_EXTERNAL_LINK, false, $login_menu_shortcodes);
}
if(!vartrue($menu_pref['login_menu']['external_links']))
{
return '';
}
$lbox_infos = $lmc->parse_external_list(true, false);
$lbox_active = $menu_pref['login_menu']['external_links'] ? explode(',', $menu_pref['login_menu']['external_links']) : array();
if(!vartrue($lbox_infos['links']))
{
return '';
}
$ret = '';
foreach($lbox_active as $stackid)
{
$lbox_items = $lmc->clean_links(varset($lbox_infos['links'][$stackid]));
if(!$lbox_items)
{
continue;
}
foreach($lbox_items as $num => $lbox_item)
{
$lbox_item['link_id'] = $stackid . '_' . $num;
cachevars('login_menu_linkdata', $lbox_item);
$ret .= $tp->parseTemplate($LOGIN_MENU_EXTERNAL_LINK, false, $login_menu_shortcodes);
}
}
return $ret;
}
@@ -420,7 +438,9 @@ e107::getLanguage()->bcDefs($bcDefs);
if(!vartrue($menu_pref['login_menu']['external_stats'])) return '';
$lbox_infos = login_menu_class::parse_external_list(true, false);
$lm = new login_menu_class;
$lbox_infos = $lm->parse_external_list(true, false);
if(!vartrue($lbox_infos['stats'])) return '';

View File

@@ -548,14 +548,14 @@ class newsletter
/**
* Delete a newsletter
*
* @return none
* @return null
*/
function deleteNewsletter()
{
$sql = e107::getDb();
$mes = e107::getMessage();
$tmp = each($_POST['delete']);
$tmp = key($_POST['delete']);
if(strpos($tmp['key'], 'newsletter') === 0)
{
$id = intval(str_replace('newsletter_', '', $tmp['key']));

View File

@@ -27,14 +27,17 @@ $frm = e107::getForm();
if (isset($_POST['update_menu']))
{
$temp = array();
while (list($key, $value) = each($_POST))
foreach($_POST as $key=>$value)
{
if ($value != LAN_UPDATE)
{
$temp[$key] = $value;
}
}
if ($admin_log->logArrayDiffs($temp,$menu_pref,'MISC_02'))
$menu_pref = e107::getConfig('menu')->getPref();
if (e107::getLog()->logArrayDiffs($temp,$menu_pref,'MISC_02'))
{
$menuPref = e107::getConfig('menu');
//e107::getConfig('menu')->setPref('', $menu_pref);
@@ -47,12 +50,12 @@ if (isset($_POST['update_menu']))
$mes->addSuccess(LAN_SAVED);
}
//$ns->tablerender('', "<div style='text-align:center'><b>".LAN_UPDATED.'</b></div>');
$ns->tablerender($caption, $mes->render() . $text);
//e107::getRender()->tablerender(null, $mes->render() );
echo $mes->render();
}
$menu_pref = e107::getConfig('menu')->getPref('');
$menu_pref = e107::getConfig('menu')->getPref();
if (!isset($menu_pref['online_ls_caption']))
{ // Assume that if one isn't set, none are set
@@ -80,7 +83,7 @@ $text = "
<td colspan='2'>".LAN_ONLINE_ADMIN_1."</td></tr>
<tr>
<td>".LAN_ONLINE_ADMIN_2.":</td>
<td><input class='tbox' type='text' name='online_ls_caption' size='30' value='".$tp->toHTML($menu_pref['online_ls_caption'],"","defs")."' maxlength='200' /></td>
<td><input class='tbox' type='text' name='online_ls_caption' size='30' value='".e107::getParser()->toHTML($menu_pref['online_ls_caption'],"","defs")."' maxlength='200' /></td>
</tr>
<tr>
<td>".LAN_ONLINE_ADMIN_3.":</td>
@@ -102,7 +105,7 @@ $text = "
</tr>
<tr>
<td>".LAN_ONLINE_ADMIN_5.":</td>
<td><input class='tbox' type='text' name='online_caption' size='30' value='".$tp->toHTML($menu_pref['online_caption'],"","defs")."' maxlength='200' /></td>
<td><input class='tbox' type='text' name='online_caption' size='30' value='".e107::getParser()->toHTML($menu_pref['online_caption'],"","defs")."' maxlength='200' /></td>
</tr>
<tr>
<td>".LAN_ONLINE_ADMIN_10."</td>
@@ -124,5 +127,5 @@ $text = "
</fieldset>
</form>";
$ns->tablerender(LAN_ONLINE_ADMIN_4." - ".LAN_ONLINE_ADMIN_1, $mes->render() . $text);
e107::getRender()->tablerender(LAN_ONLINE_ADMIN_4." - ".LAN_ONLINE_ADMIN_1, $mes->render() . $text);
require_once(e_ADMIN."footer.php");

View File

@@ -257,7 +257,7 @@ class tinymce
/**
* Render Field value (listing page)
*
* @param array $key
* @param string $key
* @param array $row
* @return string
*/

View File

@@ -119,8 +119,10 @@ $config = varset($_GET['config'],false); // e_QUERY;
$gen = $wy->renderConfig($config);
define('USE_GZIP', true);
$compression_browser_support = false;
$compression_server_support = false;
if(strstr(varset($_SERVER['HTTP_ACCEPT_ENCODING'], ''), 'gzip'))
if(strstr(varset($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip'))
{
$compression_browser_support = true;
}
@@ -143,16 +145,19 @@ if(ADMIN && e_QUERY == 'debug' || !empty($_GET['debug']))
</td>
</tr></table>";
echo "<br />Browser gZip support: ".$compression_browser_support;
echo "<br />Server gZip support: ". $compression_server_support;
// echo "<br />Browser gZip support: ".$compression_browser_support;
// echo "<br />Server gZip support: ". $compression_server_support;
require_once(FOOTERF);
}
elseif((USE_GZIP === true) && $compression_browser_support && $compression_server_support)
{
while (@ob_end_clean()); // clear out anything that may have been echoed from class2.php or theme
header('Content-type: text/javascript;charset=UTF-8', true);
while (ob_get_length() !== false) // clear out anything that may have been echoed from class2.php or theme
{
ob_end_clean();
}
header('Content-type: text/javascript;charset=UTF-8');
header('Content-Encoding: gzip');
$minified = e107::minify($gen);
@@ -163,7 +168,10 @@ elseif((USE_GZIP === true) && $compression_browser_support && $compression_serve
}
else
{
while (@ob_end_clean()); // clear out anything that may have been echoed from class2.php or theme.
while (ob_get_length() !== false) // clear out anything that may have been echoed from class2.php or theme
{
ob_end_clean();
}
ob_start();
ob_implicit_flush(0);
header('Content-type: text/javascript', TRUE);
@@ -180,9 +188,9 @@ exit;
class wysiwyg
{
var $js;
var $config = array();
var $configName;
public $js;
public $config = array();
public $configName;
function renderConfig($config='')
{
@@ -199,7 +207,7 @@ class wysiwyg
},\n";
*/
$text .= $this->config; // Moc: temporary fix for BC with PHP 5.3: https://github.com/e107inc/e107/issues/614
// $text .= $this->config; // Moc: temporary fix for BC with PHP 5.3: https://github.com/e107inc/e107/issues/614
$text .= "\n});";
@@ -329,7 +337,7 @@ class wysiwyg
{
if(empty($data))
{
return;
return null;
}
$tmp = explode(" ",$data);
@@ -396,7 +404,7 @@ class wysiwyg
function getConfig($config=false)
{
$tp = e107::getParser();
$fl = e107::getFile();
// $fl = e107::getFile();
if($config !== false)
{

View File

@@ -16,7 +16,7 @@
*/
$eplug_admin = true;
require_once("../../class2.php");
$pref = e107::pref();
if (!getperms("P") || !e107::isInstalled('trackback') || !$pref['trackbackEnabled'])
{
e107::redirect();
@@ -27,37 +27,40 @@ require_once(e_ADMIN."auth.php");
if (isset($_POST['moderate']))
{
$temp = array();
$sql = e107::getDb();
if (is_array($_POST['trackback_delete']))
{
while (list ($key, $cid) = each ($_POST['trackback_delete']))
foreach($_POST['trackback_delete'] as $key=>$cid)
{
$cid = intval($cid);
if ($cid > 0)
{
$sql->db_Delete("trackback", "trackback_id=".$cid);
$sql->delete("trackback", "trackback_id=".$cid);
$temp[] = $cid;
}
}
if (count($temp))
{
e107::getLog()->add('TRACK_02',implode(', ',$temp), E_LOG_INFORMATIVE,'');
e107::getLog()->add('TRACK_02',implode(', ',$temp));
}
}
$ns->tablerender("", "<div style='text-align:center'><b>".TRACKBACK_L15."</b></div>");
$e107cache->clear("news.php");
e107::getRender()->tablerender(null, "<div style='text-align:center'><b>".LAN_DELETED."</b></div>");
e107::getCache()->clear("news.php");
}
$sql = e107::getDb();
$text = "<div style='text-align:center'>
<form method='post' action='".e_SELF."?".e_QUERY."'>
<table style='".ADMIN_WIDTH."' class='fborder'>";
if (e_QUERY=='all')
{
$res=$sql->db_Select("trackback", "*");
$res=$sql->select("trackback");
}
else
{
$res=$sql->db_Select("trackback", "*", "trackback_pid=".intval(e_QUERY));
$res=$sql->select("trackback", "*", "trackback_pid=".intval(e_QUERY));
}
if (!$res)
@@ -67,20 +70,20 @@ if (!$res)
else
{
$tbArray = $sql -> db_getList();
foreach($tbArray as $trackback)
foreach($tbArray as $row)
{
extract($trackback);
$text .= "<tr>
<td class='forumheader3' style='width: 30%;'><a href='$trackback_url' rel='external'>$trackback_title</a></td>
<td class='forumheader3' style='width: 40%;'>$trackback_excerpt</td>
<td class='forumheader3' style='width: 20%;'>$trackback_blogname</td>
<td class='forumheader3' style='width: 10%;'><input type='checkbox' name='trackback_delete[]' value='$trackback_id' /> ".TRACKBACK_L14."</td>
<td class='forumheader3' style='width: 30%;'><a href='".$row['trackback_url']."' rel='external'>".$row['trackback_title']."</a></td>
<td class='forumheader3' style='width: 40%;'>".$row['trackback_excerpt']."</td>
<td class='forumheader3' style='width: 20%;'>".$row['trackback_blogname']."</td>
<td class='forumheader3' style='width: 10%;'><input type='checkbox' name='trackback_delete[]' value='".$row['trackback_id']."' /> ".LAN_DELETE."</td>
</tr>\n";
}
$text .= "<tr><td colspan='5' class='forumheader' style='text-align:center'><input class='btn btn-default btn-secondary button' type='submit' name='moderate' value='".TRACKBACK_L13."' /></td></tr></table></form></div>";
}
$ns->tablerender(TRACKBACK_L13, $text);
e107::getRender()->tablerender(TRACKBACK_L13, $text);
require_once(e_ADMIN."footer.php");

View File

@@ -21,5 +21,5 @@ if (!e107::isInstalled('trackback'))
}
header('Content-Type: text/xml');
include(e_PLUGIN."trackback/trackbackClass.php");
$trackback = trackbackClass :: respondTrackback();
$trackback = trackbackClass::respondTrackback();

View File

@@ -20,7 +20,7 @@ if (!defined('e107_INIT')) { exit; }
class trackbackClass
{
function sendTrackback ($permLink, $pingUrl, $title, $excerpt)
static function sendTrackback ($permLink, $pingUrl, $title, $excerpt)
{
global $e107;
@@ -98,7 +98,7 @@ class trackbackClass
}
function respondTrackback ()
static function respondTrackback ()
{
global $sql, $pref, $tp, $e107cache;
$errorMessage = "";
@@ -151,7 +151,7 @@ class trackbackClass
if(!$errorMessage)
{
if(!$sql -> db_Insert("trackback", "0, {$pid}, '{$title}', '{$excerpt}', '{$permLink}', '{$blog_name}' "))
if(!$sql->insert("trackback", "0, {$pid}, '{$title}', '{$excerpt}', '{$permLink}', '{$blog_name}' "))
{
$errorMessage = "Unable to enter your trackback information into the database -> 0, {$pid}, '{$title}', '{$excerpt}', '{$permLink}', '{$blog_name}'";
}