mirror of
https://github.com/e107inc/e107.git
synced 2025-08-12 09:34:54 +02:00
Merge branch 'master' of github.com:e107inc/e107
This commit is contained in:
@@ -724,6 +724,11 @@ else
|
||||
define('XURL_VIMEO', false);
|
||||
}
|
||||
|
||||
if(!defined('MAIL_IDENTIFIER'))
|
||||
{
|
||||
define('MAIL_IDENTIFIER', 'X-e107-id');
|
||||
}
|
||||
|
||||
/* Withdrawn 0.8
|
||||
// legacy module.php file loading.
|
||||
if (isset($pref['modules']) && $pref['modules']) {
|
||||
|
11
cron.php
11
cron.php
@@ -32,6 +32,11 @@ require_once(realpath(dirname(__FILE__)."/class2.php"));
|
||||
|
||||
$pwd = ($_E107['debug'] && $_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : trim($_SERVER['argv'][1]);
|
||||
|
||||
if(empty($pwd) && !empty($_GET['token']))
|
||||
{
|
||||
$pwd = $_GET['token'];
|
||||
}
|
||||
|
||||
if($pref['e_cron_pwd'] != $pwd)
|
||||
{
|
||||
require_once(e_HANDLER."mail.php");
|
||||
@@ -43,10 +48,16 @@ require_once(realpath(dirname(__FILE__)."/class2.php"));
|
||||
You should regenerate the cron command in admin and enter it again in your server configuration.
|
||||
";
|
||||
|
||||
$message .= "<h4>Debug Info</h4>";
|
||||
$message .= print_a($_SERVER,true);
|
||||
$message .= print_a($_ENV,true);
|
||||
$message .= print_a($_GET,true);
|
||||
|
||||
sendemail($pref['siteadminemail'], "e107 - Cron Schedule Misconfigured.", $message, $pref['siteadmin'],$pref['siteadminemail'], $pref['siteadmin']);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
e107::getCache()->CachePageMD5 = '_';
|
||||
e107::getCache()->set('cronLastLoad',time(),TRUE,FALSE,TRUE);
|
||||
|
||||
|
@@ -123,7 +123,7 @@ class admin_log_ui extends e_admin_ui
|
||||
{
|
||||
|
||||
protected $pluginTitle = ADLAN_155;
|
||||
protected $pluginName = 'adminlog';
|
||||
protected $pluginName = 'core';
|
||||
protected $table = 'admin_log';
|
||||
protected $pid = 'dblog_id';
|
||||
protected $perPage = 10;
|
||||
@@ -159,7 +159,7 @@ class admin_log_ui extends e_admin_ui
|
||||
'user_audit_class' => array('title'=> RL_LAN_123, 'type'=>'userclass', 'data' => 'int','help'=>''),
|
||||
'user_audit_opts' => array('title'=> RL_LAN_031, 'type'=>'method', 'data' => 'array','help'=>''),
|
||||
'roll_log_active' => array('title'=> RL_LAN_008, 'type'=>'boolean', 'data' => 'int','help'=>''),
|
||||
'roll_log_days' => array('title'=> RL_LAN_009, 'type'=>'text', 'data' => 'string','help'=>''),
|
||||
'roll_log_days' => array('title'=> RL_LAN_009, 'type'=>'number', 'data' => 'string','help'=>''),
|
||||
// 'Delete admin log events older than ' => array('title'=> RL_LAN_045, 'type'=>'method', 'data' => 'string','help'=>'Help Text goes here'),
|
||||
// 'Delete user audit trail log events older' => array('title'=> 'Delete user audit trail log events older', 'type'=>'method', 'data' => 'string','help'=>'Help Text goes here'),
|
||||
);
|
||||
@@ -184,7 +184,10 @@ class admin_log_ui extends e_admin_ui
|
||||
// optional
|
||||
public function init()
|
||||
{
|
||||
$this->prefs['sys_log_perpage']['writeParms'] = array(10, 20, 30, 40, 50);
|
||||
$perPage = e107::getConfig()->get('sys_log_perpage');
|
||||
$this->perPage = vartrue($perPage,10);
|
||||
|
||||
$this->prefs['sys_log_perpage']['writeParms'] = array(10=>10, 20=>20, 30=>30, 40=>40, 50=>50);
|
||||
|
||||
|
||||
$sql = e107::getDb();
|
||||
@@ -382,7 +385,7 @@ class admin_log_form_ui extends e_admin_form_ui
|
||||
|
||||
function user_audit_opts($curVal,$mode)
|
||||
{
|
||||
$pref = e107::getPref();
|
||||
|
||||
$frm = e107::getForm();
|
||||
|
||||
// User Audit log options (for info)
|
||||
@@ -407,15 +410,14 @@ class admin_log_form_ui extends e_admin_form_ui
|
||||
USER_AUDIT_ADD_ADMIN => RL_LAN_080, USER_AUDIT_MAIL_BOUNCE => RL_LAN_081, USER_AUDIT_BANNED => RL_LAN_082, USER_AUDIT_BOUNCE_RESET => RL_LAN_083,
|
||||
USER_AUDIT_TEMP_ACCOUNT => RL_LAN_084);
|
||||
|
||||
|
||||
$user_signup_opts = array_flip(explode(',', varset($pref['user_audit_opts'], '')));
|
||||
$userAuditOpts = e107::getConfig()->get('user_audit_opts');
|
||||
|
||||
$text = "";
|
||||
|
||||
foreach($audit_checkboxes as $k => $t)
|
||||
{
|
||||
$checked = isset($user_signup_opts[$k]) ? true : false;
|
||||
$text .= $frm->checkbox('user_audit_opts[]',$k, $checked, array('label'=>$t));
|
||||
$checked = isset($userAuditOpts[$k]) ? true : false;
|
||||
$text .= $frm->checkbox('user_audit_opts['.$k.']',$k, $checked, array('label'=>$t));
|
||||
}
|
||||
|
||||
$text .= $frm->admin_button('check_all', 'jstarget:user_audit_opts', 'checkall', LAN_CHECKALL).$frm->admin_button('uncheck_all', 'jstarget:user_audit_opts', 'checkall', LAN_UNCHECKALL);
|
||||
@@ -477,6 +479,13 @@ class admin_log_form_ui extends e_admin_form_ui
|
||||
// Custom Method/Function
|
||||
function dblog_type($curVal,$mode)
|
||||
{
|
||||
/*
|
||||
define("E_LOG_INFORMATIVE", 0); // Minimal Log Level, including really minor stuff
|
||||
define("E_LOG_NOTICE", 1); // More important than informative, but less important than notice
|
||||
define("E_LOG_WARNING", 2); // Not anything serious, but important information
|
||||
define("E_LOG_FATAL", 3); // An event so bad your site ceased execution.
|
||||
define("E_LOG_PLUGIN", 4); // Plugin information
|
||||
*/
|
||||
|
||||
$array = array(
|
||||
' ', // Minimal Log Level, including really minor stuff
|
||||
@@ -492,12 +501,12 @@ class admin_log_form_ui extends e_admin_form_ui
|
||||
switch($mode)
|
||||
{
|
||||
case 'read': // List Page
|
||||
return varset($array[$curVal], $curval);
|
||||
return varset($array[$curVal], $curVal);
|
||||
break;
|
||||
|
||||
case 'filter':
|
||||
case 'batch':
|
||||
return $array;
|
||||
return array('Informative','Notice','Warning','Fatal');
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -681,21 +690,22 @@ class dblog_ui extends e_admin_ui
|
||||
protected $pluginName = 'adminlog';
|
||||
protected $table = 'dblog';
|
||||
protected $pid = 'dblog_id';
|
||||
protected $perPage = 10;
|
||||
protected $perPage = 15;
|
||||
protected $listOrder = 'dblog_id desc';
|
||||
|
||||
protected $fields = array (
|
||||
// 'checkboxes' => array ( 'title' => '', 'type' => null, 'data' => null, 'width' => '5%', 'thclass' => 'center', 'forced' => '1', 'class' => 'center', 'toggle' => 'e-multiselect', ),
|
||||
'dblog_id' => array ( 'title' => LAN_ID, 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'dblog_datestamp' => array ( 'title' => LAN_DATESTAMP, 'type' => 'method', 'data' => 'int', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'dblog_datestamp' => array ( 'title' => LAN_DATESTAMP, 'type' => 'datestamp', 'data' => 'int', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'dblog_microtime' => array ( 'title' => 'Microtime', 'type' => 'method', 'data' => 'int', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
|
||||
'dblog_type' => array ( 'title' => LAN_TYPE, 'type' => 'method', 'data' => 'int', 'width' => 'auto', 'batch' => true, 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'dblog_eventcode' => array ( 'title' => 'Eventcode', 'type' => 'method', 'data' => 'str', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
|
||||
'dblog_user_id' => array ( 'title' => LAN_ID, 'type' => 'user', 'data' => 'int', 'width' => '5%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'dblog_user_name' => array ( 'title' => LAN_USER, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'dblog_ip' => array ( 'title' => LAN_IP, 'type' => 'text', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
|
||||
'dblog_ip' => array ( 'title' => LAN_IP, 'type' => 'ip', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
|
||||
'dblog_caller' => array ( 'title' => 'Caller', 'type' => 'method', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
|
||||
'dblog_title' => array ( 'title' => LAN_TITLE, 'type' => 'method', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'dblog_remarks' => array ( 'title' => 'Remarks', 'type' => 'method', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
|
||||
'dblog_remarks' => array ( 'title' => 'Remarks', 'type' => 'method', 'data' => 'str', 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
|
||||
'options' => array ( 'title' => 'Options', 'type' => null, 'nolist'=>true, 'data' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center last', 'forced' => '1', ),
|
||||
);
|
||||
|
||||
@@ -807,7 +817,7 @@ $mes = e107::getMessage();
|
||||
$frm = e107::getForm();
|
||||
|
||||
define('AL_DATE_TIME_FORMAT', 'y-m-d H:i:s');
|
||||
|
||||
/*
|
||||
if(isset($_POST['setoptions']))
|
||||
{
|
||||
unset($temp);
|
||||
@@ -839,6 +849,7 @@ if(isset($_POST['setoptions']))
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
$ns->tablerender($caption, $mes->render() . $text);
|
||||
|
||||
@@ -863,7 +874,7 @@ if(isset($_POST['deleteitems']) && ($action == 'comments'))
|
||||
{
|
||||
//$text = str_replace('--NUMBER--', $count,RL_LAN_112);
|
||||
$emessage->add(str_replace('--NUMBER--', $count, RL_LAN_112), E_MESSAGE_SUCCESS);
|
||||
$admin_log->log_event('COMMENT_01', 'ID: '.implode(',', $_POST['del_item']), E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('COMMENT_01', 'ID: '.implode(',', $_POST['del_item']), E_LOG_INFORMATIVE, '');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -941,7 +952,7 @@ if(($action == "backdel") && isset($_POST['backdeltype']))
|
||||
// Add in a log event
|
||||
$message = $db_name.str_replace(array('--OLD--', '--NUM--'), array($old_string, $del_count), RL_LAN_057);
|
||||
$mes->addSuccess($message);
|
||||
$admin_log->log_event($db_msg, "db_Delete - earlier than {$old_string} (past {$qs[2]} days)[!br!]".$message.'[!br!]'.$db_table.' '.$qry, E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add($db_msg, "db_Delete - earlier than {$old_string} (past {$qs[2]} days)[!br!]".$message.'[!br!]'.$db_table.' '.$qry, E_LOG_INFORMATIVE, '');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1104,7 +1115,7 @@ if(! defined("USER_WIDTH"))
|
||||
// CONFIGURATION OPTIONS MENU
|
||||
//====================================================================
|
||||
|
||||
|
||||
/*
|
||||
if($action == "config")
|
||||
{
|
||||
// User Audit log options (for info)
|
||||
@@ -1243,6 +1254,7 @@ if($action == "config")
|
||||
|
||||
$ns->tablerender(ADLAN_155.SEP.LAN_OPTIONS, $mes->render().$text);
|
||||
}
|
||||
*/
|
||||
|
||||
//====================================================================
|
||||
// LOG VIEW MENU
|
||||
|
@@ -94,7 +94,7 @@ if (isset($_POST['del_admin']) && count($_POST['del_admin']))
|
||||
|
||||
$mes->addAuto($sql -> db_Update("user", "user_admin=0, user_perms='' WHERE user_id= ".$aID), 'update', ADMSLAN_61, LAN_DELETED_FAILED, false);
|
||||
$logMsg = str_replace(array('--ID--', '--NAME--'),array($aID, $row['user_name']),ADMSLAN_73);
|
||||
$admin_log->log_event('ADMIN_02',$logMsg,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('ADMIN_02',$logMsg,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
|
||||
|
||||
|
@@ -151,7 +151,8 @@ else
|
||||
$class_list[] = e_UC_MEMBER;
|
||||
$class_list[] = e_UC_PUBLIC;
|
||||
|
||||
$user_logging_opts = array_flip(explode(',', varset($pref['user_audit_opts'], '')));
|
||||
|
||||
$user_logging_opts = e107::getConfig()->get('user_audit_opts');
|
||||
if (isset($user_logging_opts[USER_AUDIT_LOGIN]) && in_array(varset($pref['user_audit_class'], ''), $class_list))
|
||||
{ // Need to note in user audit trail
|
||||
e107::getAdminLog()->user_audit(USER_AUDIT_LOGIN, '', $user_id, $user_name);
|
||||
|
@@ -383,7 +383,7 @@ class cron_admin_ui extends e_admin_ui
|
||||
elseif (!$active) // show instructions
|
||||
{
|
||||
$setpwd_message = $frm->open("generate")."<small>"
|
||||
.LAN_CRON_15.":</small><br /><pre style='color:black'>".rtrim($_SERVER['DOCUMENT_ROOT'], '/').e_HTTP."cron.php ".$pref['e_cron_pwd'];
|
||||
.LAN_CRON_15.":</small><br /><pre style='color:black'>".rtrim($_SERVER['DOCUMENT_ROOT'], '/').e_HTTP."cron.php token=".$pref['e_cron_pwd'].' >/dev/null 2>&1';
|
||||
|
||||
$setpwd_message .= "</pre><small>". LAN_CRON_16."</small>";
|
||||
if(e_DOMAIN && file_exists("/usr/local/cpanel/version"))
|
||||
|
@@ -40,7 +40,7 @@ if (isset($_POST['active']))
|
||||
if ($pref['smiley_activate'] != $_POST['smiley_activate'])
|
||||
{
|
||||
$pref['smiley_activate'] = $_POST['smiley_activate'];
|
||||
$admin_log->log_event($pref['smiley_activate'] ? 'EMOTE_02' : 'EMOTE_03', $pref['emotepack'], E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add($pref['smiley_activate'] ? 'EMOTE_02' : 'EMOTE_03', $pref['emotepack'], E_LOG_INFORMATIVE, '');
|
||||
save_prefs();
|
||||
$update = true;
|
||||
}
|
||||
@@ -88,7 +88,7 @@ foreach($_POST as $key => $value)
|
||||
{
|
||||
$mes->addInfo(LAN_NO_CHANGE);
|
||||
}
|
||||
$admin_log->log_event('EMOTE_01', $pref['emotepack'], E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('EMOTE_01', $pref['emotepack'], E_LOG_INFORMATIVE, '');
|
||||
break;
|
||||
}
|
||||
|
||||
|
@@ -114,11 +114,11 @@ if (isset($_POST['deleteconfirm']))
|
||||
}
|
||||
if (count($deleteList))
|
||||
{
|
||||
$admin_log->log_event('FILEMAN_01',implode('[!br!]',$deleteList),E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('FILEMAN_01',implode('[!br!]',$deleteList),E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
if (count($moveList))
|
||||
{
|
||||
$admin_log->log_event('FILEMAN_02',implode('[!br!]',$moveList),E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('FILEMAN_02',implode('[!br!]',$moveList),E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ if (isset($_POST['upload']))
|
||||
}
|
||||
if (count($uploadList))
|
||||
{
|
||||
$admin_log->log_event('FILEMAN_03',implode('[!br!]',$uploadList),E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('FILEMAN_03',implode('[!br!]',$uploadList),E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -168,9 +168,9 @@ class media_cat_ui extends e_admin_ui
|
||||
'media_cat_image' => array('title'=> LAN_IMAGE, 'type' => 'image', 'data' => 'str', 'width' => '100px', 'thclass' => 'center', 'class'=>'center', 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','readonly'=>FALSE, 'batch' => FALSE, 'filter'=>FALSE),
|
||||
'media_cat_owner' => array('title'=> LAN_OWNER, 'type' => 'dropdown', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),
|
||||
|
||||
'media_cat_type' => array('title'=> LAN_TYPE, 'type' => 'radio', 'data'=>false, 'width' => 'auto', 'thclass' => 'left', 'validate' => true, 'nolist'=>true),
|
||||
'media_cat_type' => array('title'=> LAN_TYPE, 'type' => 'radio', 'data'=>false, 'width' => 'auto', 'thclass' => 'left', 'validate' => true, 'nolist'=>true),
|
||||
|
||||
'media_cat_category' => array('title'=> LAN_CATEGORY, 'type' => 'text', 'data'=>'str', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>TRUE),
|
||||
'media_cat_category' => array('title'=> LAN_CATEGORY, 'type' => 'text', 'data'=>'str', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>TRUE),
|
||||
'media_cat_title' => array('title'=> LAN_TITLE, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE, 'validate' => true),
|
||||
'media_cat_sef' => array('title'=> LAN_SEFURL, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),
|
||||
'media_cat_diz' => array('title'=> LAN_DESCRIPTION, 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=150&bb=1','readonly'=>FALSE), // Display name
|
||||
@@ -210,25 +210,31 @@ class media_cat_ui extends e_admin_ui
|
||||
$sql = e107::getDb();
|
||||
|
||||
|
||||
if($sql->db_Select_gen("SELECT media_cat_owner, count(media_cat_id) as number FROM `#core_media_cat` GROUP BY media_cat_owner"))
|
||||
if($sql->gen("SELECT media_cat_owner, MAX(CAST(SUBSTRING_INDEX(media_cat_category, '_', -1 ) AS UNSIGNED)) as maxnum, count(media_cat_id) as number FROM `#core_media_cat` GROUP BY media_cat_owner"))
|
||||
{
|
||||
while($row = $sql->db_Fetch())
|
||||
while($row = $sql->fetch())
|
||||
{
|
||||
$this->ownerCount[$row['media_cat_owner']] = $row['number'];
|
||||
$own = $row['media_cat_owner'];
|
||||
if(!in_array($own,$restricted))
|
||||
{
|
||||
|
||||
$this->fields['media_cat_owner']['writeParms'][$own] = $own;
|
||||
|
||||
if($row['maxnum'] > 0)
|
||||
{
|
||||
$this->ownerCount[$row['media_cat_owner']] = $row['maxnum']; // $maxnum;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
e107::getMessage()->addDebug("Max value for category names: ".print_a($this->ownerCount,true));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public function createPage()
|
||||
{
|
||||
if(!count($this->fields['media_cat_owner']['writeParms']))
|
||||
@@ -723,6 +729,7 @@ class media_admin_ui extends e_admin_ui
|
||||
'youtube_showinfo' => array('title'=> "Show Video Info", 'tab'=>2, 'type' => 'boolean', 'data'=>'int', 'help'=>''),
|
||||
'youtube_cc_load_policy' => array('title'=> "Show Closed-Captions by default", 'tab'=>2, 'type' => 'boolean', 'data'=>'int', 'help'=>''),
|
||||
'youtube_modestbranding' => array('title'=> "Use Modest Branding", 'tab'=>2, 'type' => 'boolean', 'data'=>'int', 'help'=>''),
|
||||
'youtube_bbcode_responsive' => array('title'=> "Make the YouTube bbcode responsive", 'tab'=>2, 'type' => 'boolean', 'data'=>'int', 'help'=>''),
|
||||
|
||||
//
|
||||
|
||||
@@ -2301,7 +2308,7 @@ if (isset($_POST['submit_show_delete_multi']))
|
||||
//Format system message
|
||||
if(!empty($message))
|
||||
{
|
||||
$admin_log->log_event('IMALAN_01', implode('[!br!]', $message), E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('IMALAN_01', implode('[!br!]', $message), E_LOG_INFORMATIVE, '');
|
||||
$mes->addSuccess(implode(', ', $message).' '.IMALAN_28);
|
||||
}
|
||||
}
|
||||
@@ -2339,7 +2346,7 @@ if (isset($_POST['submit_show_deleteall']))
|
||||
|
||||
$message = $count." ".IMALAN_26;
|
||||
$mes->addSuccess($message);
|
||||
$admin_log->log_event('IMALAN_02', $message.$imgList,E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('IMALAN_02', $message.$imgList,E_LOG_INFORMATIVE, '');
|
||||
unset($imgList);
|
||||
}
|
||||
}
|
||||
@@ -2384,7 +2391,7 @@ if (isset($_POST['submit_avdelete_multi']))
|
||||
}
|
||||
|
||||
$mes->addSuccess(IMALAN_51.'<strong>'.implode(', ', $tmp).'</strong> '.IMALAN_28);
|
||||
$admin_log->log_event('IMALAN_03', implode('[!br!]', $avList), E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('IMALAN_03', implode('[!br!]', $avList), E_LOG_INFORMATIVE, '');
|
||||
|
||||
unset($search_users);
|
||||
}
|
||||
|
@@ -92,7 +92,7 @@ if (isset($_POST['del_existing']) && $_POST['lang_choices'] && getperms('0'))
|
||||
}
|
||||
}
|
||||
}
|
||||
$admin_log->log_event('LANG_02', $message.'[!br!]', E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('LANG_02', $message.'[!br!]', E_LOG_INFORMATIVE, '');
|
||||
$sql->db_ResetTableList();
|
||||
|
||||
if ($action == 'modify')
|
||||
@@ -158,7 +158,7 @@ if (isset($_POST['create_tables']) && $_POST['language'])
|
||||
}
|
||||
}
|
||||
}
|
||||
$admin_log->log_event('LANG_03', $message, E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('LANG_03', $message, E_LOG_INFORMATIVE, '');
|
||||
$sql->db_ResetTableList();
|
||||
}
|
||||
/*
|
||||
@@ -194,7 +194,7 @@ if (varset($_POST['ziplang']) && varset($_POST['language']))
|
||||
if(varset($pref['lancheck'][$_POST['language']]) == 1)
|
||||
{
|
||||
$text = zip_up_lang($_POST['language']);
|
||||
$admin_log->log_event('LANG_04', $_POST['language'], E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('LANG_04', $_POST['language'], E_LOG_INFORMATIVE, '');
|
||||
$mes->addInfo(LANG_LAN_25.': '.$text);
|
||||
}
|
||||
else
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -56,7 +56,7 @@ if (isset($_POST['metasubmit']))
|
||||
unset($meta_tag[e_LANGUAGE]);
|
||||
}*/
|
||||
|
||||
$admin_log->log_event('META_01', 'meta_news_summary=>'.$pref['meta_news_summary'].'[!br!]'.e_LANGUAGE, E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('META_01', 'meta_news_summary=>'.$pref['meta_news_summary'].'[!br!]'.e_LANGUAGE, E_LOG_INFORMATIVE, '');
|
||||
save_prefs();
|
||||
}
|
||||
|
||||
|
@@ -1287,7 +1287,7 @@ class admin_newspost
|
||||
e107::getEvent()->trigger("newsdel", $del_id);
|
||||
if($sql->delete("news", "news_id={$del_id}"))
|
||||
{
|
||||
$admin_log->log_event('NEWS_01',$del_id,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('NEWS_01',$del_id,E_LOG_INFORMATIVE,'');
|
||||
$this->show_message(NWSLAN_31." #".$del_id." ".NWSLAN_32, E_MESSAGE_SUCCESS);
|
||||
$this->clear_cache();
|
||||
|
||||
@@ -1314,7 +1314,7 @@ class admin_newspost
|
||||
e107::getEvent()->trigger("newscatdel", $del_id);
|
||||
if ($sql->delete("news_category", "category_id={$del_id}"))
|
||||
{
|
||||
$admin_log->log_event('NEWS_02',$del_id,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('NEWS_02',$del_id,E_LOG_INFORMATIVE,'');
|
||||
$this->show_message(NWSLAN_33." #".$del_id." ".NWSLAN_32, E_MESSAGE_SUCCESS);
|
||||
$this->clear_cache();
|
||||
}
|
||||
@@ -1324,7 +1324,7 @@ class admin_newspost
|
||||
case 'sn':
|
||||
if ($sql->delete("submitnews", "submitnews_id={$del_id}"))
|
||||
{
|
||||
$admin_log->log_event('NEWS_03',$del_id,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('NEWS_03',$del_id,E_LOG_INFORMATIVE,'');
|
||||
$this->show_message(NWSLAN_34." #".$del_id." ".NWSLAN_32);
|
||||
$this->clear_cache();
|
||||
}
|
||||
|
@@ -695,7 +695,7 @@ class pluginManager{
|
||||
}
|
||||
|
||||
$logInfo = deftrue($plug['plugin_name'],$plug['plugin_name']). " v".$plug['plugin_version']." ({e_PLUGIN}".$plug['plugin_path'].")";
|
||||
$admin_log->log_event('PLUGMAN_03', $logInfo, E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('PLUGMAN_03', $logInfo, E_LOG_INFORMATIVE, '');
|
||||
}
|
||||
|
||||
if($_POST['delete_files'])
|
||||
@@ -930,7 +930,7 @@ class pluginManager{
|
||||
|
||||
$name = deftrue($info['plugin_name'],$info['plugin_name']). " v".$eplug_version. "({e_PLUGIN}".$info['plugin_path'].")";
|
||||
|
||||
$admin_log->log_event('PLUGMAN_02', $name, E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('PLUGMAN_02', $name, E_LOG_INFORMATIVE, '');
|
||||
$text .= (isset($eplug_upgrade_done)) ? '<br />'.$eplug_upgrade_done : "<br />".LAN_UPGRADE_SUCCESSFUL;
|
||||
$sql->update('plugin', "plugin_version ='{$eplug_version}', plugin_addons='{$eplug_addons}' WHERE plugin_id='$this->id' ");
|
||||
$pref['plug_installed'][$plug['plugin_path']] = $eplug_version; // Update the version
|
||||
@@ -959,7 +959,7 @@ class pluginManager{
|
||||
if(file_exists($_path.'plugin.xml'))
|
||||
{
|
||||
$text .= $plugin->install_plugin_xml($this->id, 'refresh');
|
||||
$admin_log->log_event('PLUGMAN_04', $this->id.':'.$plug['plugin_path'], E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('PLUGMAN_04', $this->id.':'.$plug['plugin_path'], E_LOG_INFORMATIVE, '');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -81,7 +81,7 @@ if (vartrue($save_search))
|
||||
// $sql -> db_Update("core", "e107_value='".$serialpref."' WHERE e107_name='search_prefs'");
|
||||
e107::getConfig('search')->setPref($search_prefs)->save(false,true,false);
|
||||
|
||||
$admin_log->log_event('SEARCH_03','',E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('SEARCH_03','',E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ if (isset($_POST['update_handler']))
|
||||
if($check)
|
||||
{
|
||||
$mes->addSuccess(LAN_UPDATED);
|
||||
$admin_log->log_event('SEARCH_05', $handler_type.', '.$query[2], E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('SEARCH_05', $handler_type.', '.$query[2], E_LOG_INFORMATIVE, '');
|
||||
}
|
||||
elseif(0 === $check) $mes->addInfo(LAN_NO_CHANGE);
|
||||
else
|
||||
@@ -174,7 +174,7 @@ if (isset($_POST['update_prefs']))
|
||||
if($check)
|
||||
{
|
||||
$mes->addSuccess(LAN_UPDATED);
|
||||
$admin_log->log_event('SEARCH_05', $handler_type.', '.$query[2], E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('SEARCH_05', $handler_type.', '.$query[2], E_LOG_INFORMATIVE, '');
|
||||
}
|
||||
else //it's an error
|
||||
{
|
||||
|
@@ -48,7 +48,7 @@ if(isset($_POST['updatesettings']))
|
||||
|
||||
if($changed)
|
||||
{
|
||||
$admin_log->log_event(($pref['maintainance_flag'] == 0) ? 'MAINT_02' : 'MAINT_01', $pref['maintainance_text'], E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add(($pref['maintainance_flag'] == 0) ? 'MAINT_02' : 'MAINT_01', $pref['maintainance_text'], E_LOG_INFORMATIVE, '');
|
||||
save_prefs();
|
||||
$mes->addSuccess(UGFLAN_1);
|
||||
}
|
||||
|
@@ -444,7 +444,7 @@ function update_core_prefs($type='')
|
||||
e107::getConfig('core')->setPref($pref)->save();
|
||||
$admin_log->logMessage(LAN_UPDATE_14.$e107info['e107_version'], E_MESSAGE_NODISPLAY, E_MESSAGE_INFO);
|
||||
$admin_log->flushMessages('UPDATE_03',E_LOG_INFORMATIVE);
|
||||
//$admin_log->log_event('UPDATE_03',LAN_UPDATE_14.$e107info['e107_version'].'[!br!]'.implode(', ',$accum),E_LOG_INFORMATIVE,''); // Log result of actual update
|
||||
//e107::getLog()->add('UPDATE_03',LAN_UPDATE_14.$e107info['e107_version'].'[!br!]'.implode(', ',$accum),E_LOG_INFORMATIVE,''); // Log result of actual update
|
||||
}
|
||||
return $just_check;
|
||||
}
|
||||
@@ -1638,7 +1638,7 @@ function update_706_to_800($type='')
|
||||
|
||||
|
||||
|
||||
//$admin_log->log_event('UPDATE_01',LAN_UPDATE_14.$e107info['e107_version'].'[!br!]'.implode('[!br!]',$updateMessages),E_LOG_INFORMATIVE,''); // Log result of actual update
|
||||
//e107::getLog()->add('UPDATE_01',LAN_UPDATE_14.$e107info['e107_version'].'[!br!]'.implode('[!br!]',$updateMessages),E_LOG_INFORMATIVE,''); // Log result of actual update
|
||||
return $just_check;
|
||||
}
|
||||
|
||||
@@ -1773,7 +1773,7 @@ function update_70x_to_706($type='')
|
||||
|
||||
// If we get to here, in checking mode no updates are required. In update mode, all done.
|
||||
if ($just_check) return TRUE;
|
||||
$admin_log->log_event('UPDATE_02',LAN_UPDATE_14.$e107info['e107_version'],E_LOG_INFORMATIVE,''); // Log result of actual update
|
||||
e107::getLog()->add('UPDATE_02',LAN_UPDATE_14.$e107info['e107_version'],E_LOG_INFORMATIVE,''); // Log result of actual update
|
||||
return $just_check; // TRUE if no updates needed, FALSE if updates needed and completed
|
||||
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ if (isset($_POST['update_settings']))
|
||||
$check = $sql -> db_Update('user',$userData);
|
||||
if ($check)
|
||||
{
|
||||
$admin_log->log_event('ADMINPW_01', '', E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('ADMINPW_01', '', E_LOG_INFORMATIVE, '');
|
||||
$userMethods->makeUserCookie(array('user_id' => USERID,'user_password' => $userData['data']['user_password']), FALSE); // Can't handle autologin ATM
|
||||
$mes->addSuccess(UDALAN_3." ".ADMINNAME);
|
||||
$e_event -> trigger('adpword');
|
||||
|
@@ -199,7 +199,7 @@ if ($action == "dis" && isset($_POST['updelete']['upload_'.$id]) )
|
||||
unlink(e_UPLOAD.$row['upload_ss']);
|
||||
}
|
||||
$message = ($sql->db_Delete("upload", "upload_id='".intval($id)."'")) ? UPLLAN_1 : LAN_DELETED_FAILED;
|
||||
$admin_log->log_event('UPLOAD_01',$row['upload_file'],E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('UPLOAD_01',$row['upload_file'],E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
|
||||
if ($action == "dlm")
|
||||
|
@@ -454,7 +454,7 @@ class users_admin_ui extends e_admin_ui
|
||||
{
|
||||
if ($sql->update("user","user_ban='1' WHERE user_id='".$userid."' "))
|
||||
{
|
||||
$admin_log->log_event('USET_05', str_replace(array('--UID--','--NAME--'), array($row['user_id'], $row['user_name']), USRLAN_161), E_LOG_INFORMATIVE);
|
||||
e107::getLog()->add('USET_05', str_replace(array('--UID--','--NAME--'), array($row['user_id'], $row['user_name']), USRLAN_161), E_LOG_INFORMATIVE);
|
||||
$mes->addSuccess("(".$userid.".".$row['user_name']." - {$row['user_email']}) ".USRLAN_8);
|
||||
}
|
||||
if (trim($row['user_ip']) == "")
|
||||
@@ -513,7 +513,7 @@ class users_admin_ui extends e_admin_ui
|
||||
$userMethods->addNonDefaulted($row);
|
||||
$sysuser->setData($row)->save();
|
||||
|
||||
$admin_log->log_event('USET_10', str_replace(array('--UID--', '--NAME--', '--EMAIL--'), array($sysuser->getId(), $sysuser->getName(), $sysuser->getValue('email')), USRLAN_166), E_LOG_INFORMATIVE);
|
||||
e107::getLog()->add('USET_10', str_replace(array('--UID--', '--NAME--', '--EMAIL--'), array($sysuser->getId(), $sysuser->getName(), $sysuser->getValue('email')), USRLAN_166), E_LOG_INFORMATIVE);
|
||||
$e_event->trigger('userfull', $row);
|
||||
$mes->addSuccess(USRLAN_86." (#".$sysuser->getId()." : ".$sysuser->getName().' - '.$sysuser->getValue('email').")");
|
||||
|
||||
@@ -683,7 +683,7 @@ class users_admin_ui extends e_admin_ui
|
||||
$search = array('--UID--', '--NAME--', '--EMAIL--', '--ADMIN_UID--', '--ADMIN_NAME--', '--ADMIN_EMAIL--');
|
||||
$replace = array($sysuser->getId(), $sysuser->getName(), $sysuser->getValue('email'), $user->getId(), $user->getName(), $user->getValue('email'));
|
||||
|
||||
$admin_log->log_event('USET_08', str_replace($search, $replace, $lan), E_LOG_INFORMATIVE);
|
||||
e107::getLog()->add('USET_08', str_replace($search, $replace, $lan), E_LOG_INFORMATIVE);
|
||||
|
||||
$this->redirect('list', 'main', true);
|
||||
}
|
||||
@@ -699,7 +699,7 @@ class users_admin_ui extends e_admin_ui
|
||||
{
|
||||
$sysuser->set('user_admin', 1)->save(); //"user","user_admin='1' WHERE user_id={$userid}"
|
||||
$lan = str_replace(array('--UID--', '--NAME--', '--EMAIL--'), array($sysuser->getId(), $sysuser->getName(), $sysuser->getValue('email')), USRLAN_164);
|
||||
$admin_log->log_event('USET_08', $lan, E_LOG_INFORMATIVE);
|
||||
e107::getLog()->add('USET_08', $lan, E_LOG_INFORMATIVE);
|
||||
$mes->addSuccess($lan);
|
||||
}
|
||||
|
||||
@@ -825,7 +825,7 @@ class users_admin_ui extends e_admin_ui
|
||||
$sysuser->email('email', $options);
|
||||
//sendemail($send_to,$subject,$message);
|
||||
}
|
||||
$admin_log->log_event('USET_14', str_replace(array('--UID--','--CLASSES--'), array($id, $svar), UCSLAN_11), E_LOG_INFORMATIVE);
|
||||
e107::getLog()->add('USET_14', str_replace(array('--UID--','--CLASSES--'), array($id, $svar), UCSLAN_11), E_LOG_INFORMATIVE);
|
||||
|
||||
$mes->addSuccess(nl2br($message));
|
||||
}
|
||||
@@ -970,6 +970,7 @@ class users_admin_ui extends e_admin_ui
|
||||
// custom header now auto-added in email() method
|
||||
//$mailheader_e107id = $id;
|
||||
|
||||
|
||||
$check = $sysuser->email('email', array(
|
||||
'mail_subject' => LAN_SIGNUP_96." ".SITENAME,
|
||||
'mail_body' => nl2br($message),
|
||||
@@ -977,7 +978,7 @@ class users_admin_ui extends e_admin_ui
|
||||
|
||||
if ($check)
|
||||
{
|
||||
$admin_log->log_event('USET_11', str_replace(array('--ID--','--NAME--','--EMAIL--'), array($sysuser->getId(), $sysuser->getName(), $sysuser->getValue('email')), USRLAN_167), E_LOG_INFORMATIVE);
|
||||
e107::getLog()->add('USET_11', str_replace(array('--ID--','--NAME--','--EMAIL--'), array($sysuser->getId(), $sysuser->getName(), $sysuser->getValue('email')), USRLAN_167), E_LOG_INFORMATIVE);
|
||||
$mes->addSuccess(USRLAN_140.": <a href='mailto:".$sysuser->getValue('email')."?body=".$return_address."' title=\"".LAN_USER_08."\" >".$sysuser->getName()." (".$sysuser->getValue('email').")</a> ({$lan}) ");
|
||||
}
|
||||
else
|
||||
@@ -1237,7 +1238,7 @@ class users_admin_ui extends e_admin_ui
|
||||
$user_data['user_id'] = $userid;
|
||||
|
||||
// Add to admin log
|
||||
$admin_log->log_event('USET_02',"UName: {$user_data['user_name']}; Email: {$user_data['user_email']}", E_LOG_INFORMATIVE);
|
||||
e107::getLog()->add('USET_02',"UName: {$user_data['user_name']}; Email: {$user_data['user_email']}", E_LOG_INFORMATIVE);
|
||||
|
||||
// Add to user audit trail
|
||||
$admin_log->user_audit(USER_AUDIT_ADD_ADMIN, $user_data, 0, $user_data['user_loginname']);
|
||||
@@ -1260,7 +1261,7 @@ class users_admin_ui extends e_admin_ui
|
||||
// activate and send password
|
||||
$check = $sysuser->email('quickadd', array(
|
||||
'user_password' => $savePassword,
|
||||
'email_subject' => USRLAN_187.SITENAME,
|
||||
'mail_subject' => USRLAN_187.SITENAME,
|
||||
// TODO lan
|
||||
'activation_url' => 'Your current status is <strong>Active</strong>',
|
||||
));
|
||||
@@ -1274,7 +1275,7 @@ class users_admin_ui extends e_admin_ui
|
||||
|
||||
$check = $sysuser->email('quickadd', array(
|
||||
'user_password' => $savePassword,
|
||||
'email_subject' => USRLAN_187.SITENAME,
|
||||
'mail_subject' => USRLAN_187.SITENAME,
|
||||
'activation_url' => SITEURL."signup.php?activate.".$sysuser->getId().".".$sysuser->getValue('sess'),
|
||||
));
|
||||
break;
|
||||
@@ -1751,7 +1752,7 @@ class users_admin_ui extends e_admin_ui
|
||||
}
|
||||
if ($count)
|
||||
{
|
||||
$admin_log->log_event('USET_12',str_replace('--COUNT--',$count,USRLAN_168),E_LOG_INFORMATIVE);
|
||||
e107::getLog()->add('USET_12',str_replace('--COUNT--',$count,USRLAN_168),E_LOG_INFORMATIVE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1858,13 +1859,16 @@ class users_admin_ui extends e_admin_ui
|
||||
$DEL = ($pref['mail_bounce_delete']) ? true : false;
|
||||
$text = "<br /><div><form method='post' action='".e_SELF.$qry."'><table>
|
||||
<tr><td style='width:5%'>#</td><td>e107-id</td><td>email</td><td>Subject</td><td>Bounce</td></tr>\n";
|
||||
|
||||
$identifier = deftrue('MAIL_IDENTIFIER', 'X-e107-id');
|
||||
|
||||
for ($i = 1; $i <= $tot; $i++)
|
||||
{
|
||||
$head = $obj->getHeaders($i);
|
||||
if ($head['bounce'])
|
||||
{
|
||||
// Its a 'bounce' email
|
||||
if (preg_match('/.*X-e107-id:(.*)MIME/',$obj->getBody($i),$result))
|
||||
if (preg_match('/.*'.$identifier.':(.*)MIME/',$obj->getBody($i),$result))
|
||||
{
|
||||
if ($result[1])
|
||||
{
|
||||
@@ -1913,7 +1917,7 @@ class users_admin_ui extends e_admin_ui
|
||||
}
|
||||
if ($del_count)
|
||||
{
|
||||
$admin_log->log_event('USET_13',str_replace('--COUNT--',$del_count,USRLAN_169),E_LOG_INFORMATIVE);
|
||||
e107::getLog()->add('USET_13',str_replace('--COUNT--',$del_count,USRLAN_169),E_LOG_INFORMATIVE);
|
||||
}
|
||||
if ($tot)
|
||||
{
|
||||
@@ -1965,7 +1969,7 @@ class users_admin_ui extends e_admin_ui
|
||||
// $sql->db_Delete("user","user_id='{$u['user_id']}' ");
|
||||
// $sql->db_Delete("user_extended","user_extended_id='{$u['user_id']}' ");
|
||||
// }
|
||||
// $admin_log->log_event('USET_04',str_replace(array('--COUNT--','--TYPE--'),array(count($uList),$bantype),USRLAN_160),E_LOG_INFORMATIVE);
|
||||
// e107::getLog()->add('USET_04',str_replace(array('--COUNT--','--TYPE--'),array(count($uList),$bantype),USRLAN_160),E_LOG_INFORMATIVE);
|
||||
// }
|
||||
// $ns->tablerender(USRLAN_57,"<div style='text-align:center'><b>".$text."</b></div>");
|
||||
// unset ($text);
|
||||
|
@@ -67,7 +67,7 @@ if ($tmp)
|
||||
{
|
||||
$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order+1 WHERE user_extended_struct_type > 0 AND user_extended_struct_parent = {$_parent} AND user_extended_struct_order ='".($_order-1)."'");
|
||||
$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order-1 WHERE user_extended_struct_type > 0 AND user_extended_struct_parent = {$_parent} AND user_extended_struct_id='".$_id."'");
|
||||
$admin_log->log_event('EUF_01',$_id.', '.$_order.', '.$_parent,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('EUF_01',$_id.', '.$_order.', '.$_parent,E_LOG_INFORMATIVE,'');
|
||||
e107::getCache()->clear_sys('user_extended_struct', true);
|
||||
}
|
||||
}
|
||||
@@ -85,7 +85,7 @@ if ($tmp)
|
||||
{
|
||||
$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order-1 WHERE user_extended_struct_type > 0 AND user_extended_struct_parent = {$_parent} AND user_extended_struct_order='".($_order+1)."'");
|
||||
$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order+1 WHERE user_extended_struct_type > 0 AND user_extended_struct_parent = {$_parent} AND user_extended_struct_id='".$_id."'");
|
||||
$admin_log->log_event('EUF_02',$_id.', '.$_order.', '.$_parent,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('EUF_02',$_id.', '.$_order.', '.$_parent,E_LOG_INFORMATIVE,'');
|
||||
e107::getCache()->clear_sys('user_extended_struct', true);
|
||||
}
|
||||
}
|
||||
@@ -100,7 +100,7 @@ if (isset($_POST['catup_x']) || isset($_POST['catup']))
|
||||
{
|
||||
$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order+1 WHERE user_extended_struct_type = 0 AND user_extended_struct_order='".($_order-1)."'");
|
||||
$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order-1 WHERE user_extended_struct_type = 0 AND user_extended_struct_id='".$_id."'");
|
||||
$admin_log->log_event('EUF_03',$_id.', '.$_order,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('EUF_03',$_id.', '.$_order,E_LOG_INFORMATIVE,'');
|
||||
e107::getCache()->clear_sys('user_extended_struct', true);
|
||||
}
|
||||
}
|
||||
@@ -115,7 +115,7 @@ if (isset($_POST['catdown_x']) || isset($_POST['catdown']))
|
||||
{
|
||||
$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order-1 WHERE user_extended_struct_type = 0 AND user_extended_struct_order='".($_order+1)."'");
|
||||
$sql->db_Update("user_extended_struct", "user_extended_struct_order=user_extended_struct_order+1 WHERE user_extended_struct_type = 0 AND user_extended_struct_id='".$_id."'");
|
||||
$admin_log->log_event('EUF_04',$_id.', '.$_order,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('EUF_04',$_id.', '.$_order,E_LOG_INFORMATIVE,'');
|
||||
e107::getCache()->clear_sys('user_extended_struct', true);
|
||||
}
|
||||
}
|
||||
@@ -153,7 +153,7 @@ if (isset($_POST['add_field']))
|
||||
}
|
||||
else
|
||||
{
|
||||
$admin_log->log_event('EUF_05',$ue_field_name.'[!br!]'.$tp->toDB($_POST['user_text']).'[!br!]'.intval($_POST['user_type']),E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('EUF_05',$ue_field_name.'[!br!]'.$tp->toDB($_POST['user_text']).'[!br!]'.intval($_POST['user_type']),E_LOG_INFORMATIVE,'');
|
||||
e107::getCache()->clear_sys('user_extended_struct', true);
|
||||
}
|
||||
}
|
||||
@@ -177,7 +177,7 @@ if (isset($_POST['update_field']))
|
||||
$result = $mes->addAuto($ue->user_extended_modify($sub_action, $tp->toDB($_POST['user_field']), $tp->toDB($_POST['user_text']), intval($_POST['user_type']), $upd_parms, $upd_values, $tp->toDB($_POST['user_default']), intval($_POST['user_required']), intval($_POST['user_read']), intval($_POST['user_write']), intval($_POST['user_applicable']), intval($_POST['user_parent'])), 'update', EXTLAN_29, false, false);
|
||||
if($result)
|
||||
{
|
||||
$admin_log->log_event('EUF_06',$tp->toDB($_POST['user_field']).'[!br!]'.$tp->toDB($_POST['user_text']).'[!br!]'.intval($_POST['user_type']),E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('EUF_06',$tp->toDB($_POST['user_field']).'[!br!]'.$tp->toDB($_POST['user_text']).'[!br!]'.intval($_POST['user_type']),E_LOG_INFORMATIVE,'');
|
||||
e107::getCache()->clear_sys('user_extended_struct', true);
|
||||
}
|
||||
}
|
||||
@@ -199,7 +199,7 @@ if (isset($_POST['update_category']))
|
||||
);
|
||||
if($result)
|
||||
{
|
||||
$admin_log->log_event('EUF_09',$name,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('EUF_09',$name,E_LOG_INFORMATIVE,'');
|
||||
e107::getCache()->clear_sys('user_extended_struct', true);
|
||||
}
|
||||
}
|
||||
@@ -219,7 +219,7 @@ if (isset($_POST['add_category']))
|
||||
$result = $mes->addAuto($sql->db_Insert("user_extended_struct","'0', '{$name}', '".$tp->toDB($_POST['user_text'])."', 0, '', '', '', '".intval($_POST['user_read'])."', '".intval($_POST['user_write'])."', '0', '0', '".intval($_POST['user_applicable'])."', '0', '0'"), 'insert', EXTLAN_40, false, false);
|
||||
if($result)
|
||||
{
|
||||
$admin_log->log_event('EUF_08',$name,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('EUF_08',$name,E_LOG_INFORMATIVE,'');
|
||||
e107::getCache()->clear_sys('user_extended_struct', true);
|
||||
}
|
||||
}
|
||||
@@ -242,7 +242,7 @@ if (varset($_POST['eu_action'],'') == "delcat")
|
||||
}
|
||||
elseif($ue->user_extended_remove($_id, $_name))
|
||||
{
|
||||
$admin_log->log_event('EUF_10',$_id.', '.$_name,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('EUF_10',$_id.', '.$_name,E_LOG_INFORMATIVE,'');
|
||||
$message = EXTLAN_41;
|
||||
e107::getCache()->clear_sys('user_extended_struct', true);
|
||||
}
|
||||
@@ -1182,7 +1182,7 @@ class users_ext
|
||||
$ret .= EXTLAN_70." $f ".EXTLAN_71."<br />";
|
||||
}
|
||||
}
|
||||
$admin_log->log_event('EUF_11',implode(', ',$_POST['activate']),E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('EUF_11',implode(', ',$_POST['activate']),E_LOG_INFORMATIVE,'');
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@@ -1205,7 +1205,7 @@ class users_ext
|
||||
$ret .= EXTLAN_70." $f ".EXTLAN_73."<br />";
|
||||
}
|
||||
}
|
||||
$admin_log->log_event('EUF_12',implode(', ',$_POST['deactivate']),E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('EUF_12',implode(', ',$_POST['deactivate']),E_LOG_INFORMATIVE,'');
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
@@ -308,6 +308,6 @@ function welcome_adminlog($msg_num='00', $id=0, $woffle='')
|
||||
if ($msg) $msg .= '[!br!]';
|
||||
$msg .= $woffle;
|
||||
}
|
||||
$admin_log->log_event('WELCOME_'.$msg_num,$msg,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('WELCOME_'.$msg_num,$msg,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
?>
|
@@ -333,17 +333,27 @@ class bb_youtube extends e_bb_base
|
||||
$class = "bbcode ".e107::getBB()->getClass('youtube'); // consistent classes across all themes.
|
||||
|
||||
$ret = "<!-- Start YouTube-".$dimensions."-".$yID." -->\n"; // <-- DO NOT MODIFY - used for detection by bbcode handler.
|
||||
$ret .= '<object class="'.$class.'" width="'.$params['w'].'" height="'.$params['h'].'" >
|
||||
<param name="movie" value="'.$url.'" />
|
||||
<param name="allowFullScreen" value="'.$fscr.'" />
|
||||
<param name="allowscriptaccess" value="always" />
|
||||
<param name="wmode" value="transparent" />
|
||||
';
|
||||
|
||||
// Not XHTML - but needed for compatibility.
|
||||
$ret .= '<embed class="'.$class.'" src="'.$url.'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="'.$fscr.'" wmode="transparent" width="'.$params['w'].'" height="'.$params['h'].'" />';
|
||||
|
||||
$ret .= '</object>';
|
||||
if(e107::getConfig()->get('youtube_bbcode_responsive') == 1) // Responsive Mode.
|
||||
{
|
||||
$ret .= e107::getParser()->toVideo($yID.".youtube");
|
||||
}
|
||||
else // Legacy Mode.
|
||||
{
|
||||
$ret .= '<object class="'.$class.'" width="'.$params['w'].'" height="'.$params['h'].'" >
|
||||
<param name="movie" value="'.$url.'" />
|
||||
<param name="allowFullScreen" value="'.$fscr.'" />
|
||||
<param name="allowscriptaccess" value="always" />
|
||||
<param name="wmode" value="transparent" />
|
||||
';
|
||||
|
||||
// Not XHTML - but needed for compatibility.
|
||||
$ret .= '<embed class="'.$class.'" src="'.$url.'" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="'.$fscr.'" wmode="transparent" width="'.$params['w'].'" height="'.$params['h'].'" />';
|
||||
|
||||
$ret .= '</object>';
|
||||
}
|
||||
|
||||
$ret .= "<!-- End YouTube -->"; // <-- DO NOT MODIFY.
|
||||
|
||||
|
||||
|
@@ -60,7 +60,7 @@ class user_shortcodes extends e_shortcode
|
||||
|
||||
function sc_user_commentposts($parm)
|
||||
{
|
||||
return $this->var['user_comments'];
|
||||
return "<a href='".e_HTTP."userposts.php?0.comments.".$this->var['user_id']."'>".$this->var['user_comments']."</a>";
|
||||
}
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ class user_shortcodes extends e_shortcode
|
||||
$commentposts = intval($sql->count("comments"));
|
||||
e107::setRegistry('total_commentposts', $commentposts);
|
||||
}
|
||||
return ($commentposts > 0) ? round(($this->var['user_comments']/$commentposts) * 100, 2) : 0;
|
||||
return ($commentposts > 0) ? "<a href='".e_HTTP."userposts.php?0.comments.".$this->var['user_id']."'>".round(($this->var['user_comments']/$commentposts) * 100, 2)."</a>" : 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -505,11 +505,11 @@ class user_shortcodes extends e_shortcode
|
||||
if (USERID == $this->var['user_id'])
|
||||
{
|
||||
//return "<a href='".$url->create('user/myprofile/edit')."'>".LAN_USER_38."</a>";
|
||||
return "<a href='".e_HTTP."usersettings.php'>".LAN_USER_38."</a>"; // TODO: repair dirty fix for usersettings
|
||||
return "<a class='btn btn-default' href='".e_HTTP."usersettings.php'>".LAN_USER_38."</a>"; // TODO: repair dirty fix for usersettings
|
||||
}
|
||||
else if(ADMIN && getperms("4") && !$this->var['user_admin'])
|
||||
{
|
||||
return "<a href='".$url->create('user/profile/edit', array('id' => $this->var['user_id'], 'name' => $this->var['user_name']))."'>".LAN_USER_39."</a>";
|
||||
return "<a class='btn btn-default' href='".$url->create('user/profile/edit', array('id' => $this->var['user_id'], 'name' => $this->var['user_name']))."'>".LAN_USER_39."</a>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -519,6 +519,8 @@ class user_shortcodes extends e_shortcode
|
||||
{
|
||||
global $full_perms;
|
||||
$sql = e107::getDb();
|
||||
$tp = e107::getParser();
|
||||
|
||||
if (!$full_perms) return;
|
||||
$url = e107::getUrl();
|
||||
if(!$userjump = e107::getRegistry('userjump'))
|
||||
@@ -539,13 +541,23 @@ class user_shortcodes extends e_shortcode
|
||||
}
|
||||
e107::setRegistry('userjump', $userjump);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($parm == 'prev')
|
||||
{
|
||||
return isset($userjump['prev']['id']) ? "<< ".LAN_USER_40." [ <a href='".$url->create('user/profile/view', $userjump['prev'])."'>".$userjump['prev']['name']."</a> ]" : " ";
|
||||
|
||||
$icon = (deftrue('BOOTSTRAP')) ? $tp->toGlyph('chevron-left') : '<<';
|
||||
return isset($userjump['prev']['id']) ? "<a class='e-tip' href='".$url->create('user/profile/view', $userjump['prev']) ."' title=\"".$userjump['prev']['name']."\">".$icon." ".LAN_USER_40."</a>\n" : " ";
|
||||
|
||||
// return isset($userjump['prev']['id']) ? "<< ".LAN_USER_40." [ <a href='".$url->create('user/profile/view', $userjump['prev'])."'>".$userjump['prev']['name']."</a> ]" : " ";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return isset($userjump['next']['id']) ? "[ <a href='".$url->create('user/profile/view', $userjump['next'])."'>".$userjump['next']['name']."</a> ] ".LAN_USER_41." >>" : " ";
|
||||
$icon = (deftrue('BOOTSTRAP')) ? $tp->toGlyph('chevron-right') : '>>';
|
||||
return isset($userjump['next']['id']) ? "<a class='e-tip' href='".$url->create('user/profile/view', $userjump['next'])."' title=\"".$userjump['next']['name']."\">".LAN_USER_41." ".$icon."</a>\n" : " ";
|
||||
// return isset($userjump['next']['id']) ? "[ <a href='".$url->create('user/profile/view', $userjump['next'])."'>".$userjump['next']['name']."</a> ] ".LAN_USER_41." >>" : " ";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -599,7 +611,13 @@ class user_shortcodes extends e_shortcode
|
||||
$sql = e107::getDb();
|
||||
$tp = e107::getParser();
|
||||
|
||||
global $EXTENDED_CATEGORY_START, $EXTENDED_CATEGORY_END, $EXTENDED_CATEGORY_TABLE;
|
||||
$template = e107::getCoreTemplate('user','extended');
|
||||
|
||||
|
||||
$EXTENDED_CATEGORY_START = $template['start'];
|
||||
$EXTENDED_CATEGORY_END = $template['end'];
|
||||
$EXTENDED_CATEGORY_TABLE = $template['item'];;
|
||||
|
||||
$qry = "SELECT f.*, c.user_extended_struct_name AS category_name, c.user_extended_struct_id AS category_id FROM #user_extended_struct as f
|
||||
LEFT JOIN #user_extended_struct as c ON f.user_extended_struct_parent = c.user_extended_struct_id
|
||||
ORDER BY c.user_extended_struct_order ASC, f.user_extended_struct_order ASC
|
||||
@@ -607,23 +625,37 @@ class user_shortcodes extends e_shortcode
|
||||
|
||||
|
||||
|
||||
|
||||
require_once(e_HANDLER."user_extended_class.php");
|
||||
|
||||
$ue = new e107_user_extended;
|
||||
$ueCatList = $ue->user_extended_get_categories();
|
||||
$ueFieldList = $ue->user_extended_get_fields();
|
||||
|
||||
|
||||
|
||||
$ueCatList[0][0] = array('user_extended_struct_name' => LAN_USER_44, 'user_extended_struct_text' => '');
|
||||
|
||||
// print_a($ueFieldList);
|
||||
|
||||
$ret = "";
|
||||
foreach($ueCatList as $catnum => $cat)
|
||||
{
|
||||
|
||||
|
||||
|
||||
$key = $cat[0]['user_extended_struct_text'] ? $cat[0]['user_extended_struct_text'] : $cat[0]['user_extended_struct_name'];
|
||||
$cat_name = $tp->parseTemplate("{USER_EXTENDED={$key}.text.{$this->var['user_id']}}", TRUE);
|
||||
$cat_name = $tp->parseTemplate("{USER_EXTENDED={$key}.text.{$this->var['user_id']}}", TRUE); //XXX FIXME Fails
|
||||
|
||||
$cat_name = true; //XXX TEMP Fix.
|
||||
|
||||
if($cat_name != FALSE && count($ueFieldList[$catnum]))
|
||||
{
|
||||
|
||||
$ret .= str_replace("{EXTENDED_NAME}", $key, $EXTENDED_CATEGORY_START);
|
||||
foreach($ueFieldList[$catnum] as $f)
|
||||
{
|
||||
|
||||
$key = $f['user_extended_struct_name'];
|
||||
if($ue_name = $tp->parseTemplate("{USER_EXTENDED={$key}.text.{$this->var['user_id']}}", TRUE))
|
||||
{
|
||||
@@ -739,11 +771,49 @@ class user_shortcodes extends e_shortcode
|
||||
}
|
||||
|
||||
|
||||
|
||||
function sc_user_embed_userprofile($parm)
|
||||
function sc_user_addons($parm='')
|
||||
{
|
||||
global $pref, $USER_EMBED_USERPROFILE_TEMPLATE, $embed_already_rendered;
|
||||
$template = e107::getCoreTemplate('user','addon');
|
||||
$tp = e107::getParser();
|
||||
$data = e107::getAddonConfig('e_user',null,'profile',$this->var);
|
||||
|
||||
if(empty($data))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$text = '';
|
||||
|
||||
foreach($data as $plugin=>$val)
|
||||
{
|
||||
foreach($val as $v)
|
||||
{
|
||||
$value = vartrue($v['url']) ? "<a href=\"".$v['url']."\">".$v['text']."</a>" : $v['text'];
|
||||
|
||||
$array = array(
|
||||
'USER_ADDON_LABEL' => $v['label'],
|
||||
'USER_ADDON_TEXT' => $value
|
||||
);
|
||||
|
||||
$text .= $tp->parseTemplate($template, true, $array);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $text;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @Deprecated Use {USER_ADDONS} instead.
|
||||
*/
|
||||
function sc_user_embed_userprofile($parm='')
|
||||
{
|
||||
|
||||
return $this->sc_user_addons($parm);
|
||||
//if no parm, it means we render ALL embedded contents
|
||||
//so we're preloading all registerd e_userprofile files
|
||||
$key = varset($pref['e_userprofile_list']);
|
||||
|
@@ -17,6 +17,7 @@ if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
class usersettings_shortcodes extends e_shortcode
|
||||
{
|
||||
private $extendedTabs = false;
|
||||
|
||||
function sc_username($parm) // This is the 'display name'
|
||||
{
|
||||
@@ -262,10 +263,12 @@ class usersettings_shortcodes extends e_shortcode
|
||||
|
||||
|
||||
|
||||
function sc_userextended_all($parm)
|
||||
function sc_userextended_all($parm='')
|
||||
{
|
||||
$sql = e107::getDb();
|
||||
$tp = e107::getParser();
|
||||
$frm = e107::getForm();
|
||||
|
||||
|
||||
$qry = "
|
||||
SELECT * FROM #user_extended_struct
|
||||
@@ -276,28 +279,60 @@ class usersettings_shortcodes extends e_shortcode
|
||||
|
||||
$ret="";
|
||||
|
||||
if($sql->db_Select_gen($qry))
|
||||
if($sql->gen($qry))
|
||||
{
|
||||
$catList = $sql->db_getList();
|
||||
}
|
||||
else
|
||||
{
|
||||
e107::getMessage()->addDebug("No extended fields found");
|
||||
}
|
||||
|
||||
$catList[] = array("user_extended_struct_id" => 0, "user_extended_struct_name" => LAN_USET_7);
|
||||
|
||||
$tabs = array();
|
||||
|
||||
if($parm == 'tabs' && deftrue('BOOTSTRAP'))
|
||||
{
|
||||
$this->extendedTabs = true;
|
||||
}
|
||||
|
||||
|
||||
foreach($catList as $cat)
|
||||
{
|
||||
cachevars("extendedcat_{$cat['user_extended_struct_id']}", $cat);
|
||||
$ret .= $this->sc_userextended_cat($cat['user_extended_struct_id']);
|
||||
// $ret .= $tp->parseTemplate("{USEREXTENDED_CAT={$cat['user_extended_struct_id']}}", TRUE, $usersettings_shortcodes);
|
||||
$text = $this->sc_userextended_cat($cat['user_extended_struct_id']);
|
||||
$ret .= $text;
|
||||
$catName = vartrue($cat['user_extended_struct_text'], $cat['user_extended_struct_name']);
|
||||
$tabs[] = array('caption'=>$catName, 'text'=>$text);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if($parm == 'tabs' && deftrue('BOOTSTRAP')===3)
|
||||
{
|
||||
return e107::getForm()->tabs($tabs);
|
||||
}
|
||||
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function sc_userextended_cat($parm)
|
||||
function sc_userextended_cat($parm='')
|
||||
{
|
||||
global $sql, $tp, $usersettings_shortcodes, $USER_EXTENDED_CAT, $extended_showed;
|
||||
global $usersettings_shortcodes, $USER_EXTENDED_CAT, $extended_showed;
|
||||
|
||||
if(deftrue('BOOTSTRAP')===3)
|
||||
{
|
||||
$USER_EXTENDED_CAT = e107::getCoreTemplate('usersettings','extended-category');
|
||||
}
|
||||
|
||||
|
||||
$sql = e107::getDb();
|
||||
$tp = e107::getParser();
|
||||
|
||||
if(isset($extended_showed['cat'][$parm]))
|
||||
{
|
||||
return "";
|
||||
@@ -312,9 +347,9 @@ class usersettings_shortcodes extends e_shortcode
|
||||
AND user_extended_struct_write IN (".USERCLASS_LIST.")
|
||||
AND user_extended_struct_id = ".intval($parm)."
|
||||
";
|
||||
if($sql->db_Select_gen($qry))
|
||||
if($sql->gen($qry))
|
||||
{
|
||||
$catInfo = $sql->db_Fetch();
|
||||
$catInfo = $sql->fetch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -328,19 +363,20 @@ class usersettings_shortcodes extends e_shortcode
|
||||
AND user_extended_struct_type != 0
|
||||
ORDER BY user_extended_struct_order ASC
|
||||
";
|
||||
if($sql->db_Select_gen($qry))
|
||||
if($sql->gen($qry))
|
||||
{
|
||||
$fieldList = $sql->db_getList();
|
||||
foreach($fieldList as $field)
|
||||
{
|
||||
cachevars("extendedfield_{$cat['user_extended_struct_name']}", $field);
|
||||
//TODO use $this instead of parseTemplate();
|
||||
$ret .= $tp->parseTemplate("{USEREXTENDED_FIELD={$field['user_extended_struct_name']}}", TRUE, $usersettings_shortcodes);
|
||||
$ret .= $this->sc_userextended_field($field['user_extended_struct_name']);
|
||||
// $ret .= $tp->parseTemplate("{USEREXTENDED_FIELD={$field['user_extended_struct_name']}}", TRUE, $usersettings_shortcodes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($ret)
|
||||
if($ret && $this->extendedTabs == false)
|
||||
{
|
||||
$catName = $catInfo['user_extended_struct_text'] ? $catInfo['user_extended_struct_text'] : $catInfo['user_extended_struct_name'];
|
||||
if(defined($catName)) $catName = constant($catName);
|
||||
@@ -353,13 +389,25 @@ class usersettings_shortcodes extends e_shortcode
|
||||
|
||||
|
||||
|
||||
function sc_userextended_field($parm)
|
||||
function sc_userextended_field($parm='')
|
||||
{
|
||||
global $sql, $tp, $usersettings_shortcodes, $extended_showed, $ue, $USEREXTENDED_FIELD, $REQUIRED_FIELD;
|
||||
global $usersettings_shortcodes, $extended_showed, $ue, $USEREXTENDED_FIELD, $REQUIRED_FIELD;
|
||||
|
||||
if(deftrue('BOOTSTRAP')===3)
|
||||
{
|
||||
$USEREXTENDED_FIELD = e107::getCoreTemplate('usersettings','extended-field');
|
||||
}
|
||||
|
||||
|
||||
if(isset($extended_showed['field'][$parm]))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
$sql = e107::getDb();
|
||||
$tp = e107::getParser();
|
||||
|
||||
|
||||
$ret = "";
|
||||
|
||||
$fInfo = getcachedvars("extendeddata_{$parm}");
|
||||
@@ -371,9 +419,9 @@ class usersettings_shortcodes extends e_shortcode
|
||||
AND user_extended_struct_write IN (".USERCLASS_LIST.")
|
||||
AND user_extended_struct_name = '".$tp -> toDB($parm, true)."'
|
||||
";
|
||||
if($sql->db_Select_gen($qry))
|
||||
if($sql->gen($qry))
|
||||
{
|
||||
$fInfo = $sql->db_Fetch();
|
||||
$fInfo = $sql->fetch();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -383,7 +431,7 @@ class usersettings_shortcodes extends e_shortcode
|
||||
if(defined($fname)) $fname = constant($fname);
|
||||
$fname = $tp->toHTML($fname, "", "emotes_off, defs");
|
||||
|
||||
if($fInfo['user_extended_struct_required'] == 1)
|
||||
if($fInfo['user_extended_struct_required'] == 1 && !deftrue('BOOTSTRAP'))
|
||||
{
|
||||
$fname = str_replace("{FIELDNAME}", $fname, $REQUIRED_FIELD);
|
||||
}
|
||||
|
@@ -255,6 +255,7 @@ CREATE TABLE mail_recipients (
|
||||
CREATE TABLE mail_content (
|
||||
mail_source_id int(10) unsigned NOT NULL auto_increment,
|
||||
mail_content_status tinyint(1) unsigned NOT NULL default '0',
|
||||
mail_total_count int(10) unsigned NOT NULL default '0',
|
||||
mail_togo_count int(10) unsigned NOT NULL default '0',
|
||||
mail_sent_count int(10) unsigned NOT NULL default '0',
|
||||
mail_fail_count int(10) unsigned NOT NULL default '0',
|
||||
@@ -272,6 +273,7 @@ CREATE TABLE mail_content (
|
||||
mail_body text,
|
||||
mail_body_templated text,
|
||||
mail_other text,
|
||||
mail_media text,
|
||||
PRIMARY KEY (mail_source_id),
|
||||
KEY mail_content_status (mail_content_status)
|
||||
) ENGINE=MyISAM;
|
||||
|
@@ -65,10 +65,10 @@ $CONTACT_TEMPLATE['menu'] = '
|
||||
$CONTACT_WRAPPER['form']['CONTACT_EMAIL_COPY'] = "<tr><td>{---}".LANCONTACT_07."</td></tr>";
|
||||
$CONTACT_WRAPPER['form']['CONTACT_PERSON'] = "<tr><td>".LANCONTACT_14."<br />{---}</td></tr>";
|
||||
|
||||
|
||||
//FIXME Upgrade to bootstrap3 non-table format for phone/tablet compatibility.
|
||||
$CONTACT_TEMPLATE['form'] = "
|
||||
<form action='".e_SELF."' method='post' id='contactForm' >
|
||||
<table class='table' style='".USER_WIDTH."' cellpadding='1' cellspacing='7'>
|
||||
<table class='table'>
|
||||
{CONTACT_PERSON}
|
||||
<tr><td>".LANCONTACT_03."<br />
|
||||
{CONTACT_NAME}
|
||||
|
@@ -10,44 +10,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* This file defines the default templates for each type of email which may be sent.
|
||||
* In general it is assumed that HTML emails are being sent (with a plain text alternate part), although simple plain text emails are also possible.
|
||||
*
|
||||
* Default values are defined for the key elements of an email:
|
||||
*
|
||||
* $EMAIL_HEADER - the first part of the email, usually defining the headers, and everything up to and including <body>
|
||||
* $EMAIL_FOOTER - the last part of the email - it may include a displayed footer, as well as </body> and other 'closing' tags
|
||||
*
|
||||
* Taken as a pair, $EMAIL_HEADER.$EMAIL_FOOTER must generate standards-compliant XHTML
|
||||
*
|
||||
* $EMAIL_BODY - the body text of the email - essentially, the message. It gets sandwiched between $EMAIL_HEADER and $EMAIL_FOOTER
|
||||
* This must generate standards-compliant XHTML in its own right, when taken with an appropriate header and footer section.
|
||||
* Within the template definition, insert the shortcode '{BODY}' to indicate where the passed text of the email is to be stored.
|
||||
*
|
||||
* $EMAIL_OVERRIDES may optionally be defined, in which case it can override default mailout settings (see later). Only define this variable
|
||||
* if you explicitly want overrides - a defined, but empty, variable may have unexpected consequences!
|
||||
*
|
||||
* $EMAIL_PLAINTEXT - an alternative template for the alternative text part of HTML emails. Set to empty string if hard-coded default to be used
|
||||
*
|
||||
*
|
||||
* Templates may be defined for specific purposes
|
||||
* Each template is given a name, which is the name of the variable.
|
||||
* This variable may be a simple string, in which case it defines the email body, and is only available via code.
|
||||
* Alternatively the variable may be an array, in which case each element of the array defines a different aspect of the email:
|
||||
*
|
||||
* $NAME['template_name'] is a user-friendly name shown in the mass mailer
|
||||
* $NAME['template_type'] takes values (user|system|all) to define its purpose - only 'user' and 'all' templates are shown in the mass mailer
|
||||
* $NAME['email_header'] defines the header - optional
|
||||
* $NAME['email_footer'] defines the footer - optional
|
||||
* $NAME['email_body'] defines the body text
|
||||
* $NAME['email_overrides'] defines any mailout settings which are to be overridden (see later) - optional
|
||||
*
|
||||
* The format and functionality of these four main array elements correspond exactly to those of the defaults already described.
|
||||
*
|
||||
* The template need only define those variables which are to be overridden, in which case the default definitions will be used for the others.
|
||||
*
|
||||
*
|
||||
* For templated HTML emails, a style sheet MUST be specified in the header field (if its required), in one of the following forms:
|
||||
*
|
||||
@@ -71,11 +37,9 @@ See e_HANDLER.mail.php for more information
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
|
||||
// @TODO: Move signup email into templated form
|
||||
$includeSiteButton = e107::getPref('sitebutton');
|
||||
|
||||
|
||||
/*
|
||||
$SIGNUPEMAIL_SUBJECT = LAN_SIGNUP_96.' {SITENAME}';
|
||||
$SIGNUPEMAIL_USETHEME = 1; // Use CSS STYLE from THEME: 0 = Off, 1 = external, 2 = embedded
|
||||
$SIGNUPEMAIL_LINKSTYLE = ''; // css to use on links eg. color:red;
|
||||
@@ -84,7 +48,7 @@ $SIGNUPEMAIL_CC = ""; // comma separated email addresses to put in CC of th
|
||||
$SIGNUPEMAIL_BCC = ""; // comma separated email addresses to put in BCC of the signup email.
|
||||
$SIGNUPEMAIL_ATTACHMENTS = ""; // files-path array of attachments. eg. array(e_FILE."myfile.zip",e_FILE."myotherfile.zip");
|
||||
$SIGNUPEMAIL_BACKGROUNDIMAGE = ""; // absolute path to a background image eg. e_IMAGE."mybackground.jpg";
|
||||
|
||||
*/
|
||||
|
||||
|
||||
/*===========================================================================
|
||||
@@ -121,6 +85,7 @@ $EMAIL_OVERRIDES = array(
|
||||
*/
|
||||
|
||||
// Not used in signup email
|
||||
/*
|
||||
$EMAIL_HEADER = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' >
|
||||
<head>
|
||||
@@ -144,58 +109,15 @@ $EMAIL_FOOTER = "
|
||||
|
||||
|
||||
$EMAIL_PLAINTEXT = '';
|
||||
|
||||
/*===========================================================================
|
||||
TEMPLATES FOR SPECIFIC EMAIL TYPES
|
||||
=============================================================================*/
|
||||
|
||||
/**
|
||||
Each template is an array whose name must match that used in the code.
|
||||
The array has two mandatory elements (name and type).
|
||||
The array may have up to five optional elements, each of which overrides the corresponding default value if present
|
||||
An empty element sets the field to empty.
|
||||
An element that is not present results in the default being used.
|
||||
|
||||
Elements are as follows:
|
||||
'template_name' - string - mandatory - a 'user-friendly' name for display
|
||||
'template_type' - string(user|system|all) - mandatory - 'all' and 'user' templates are available for selection in the bulk mailer
|
||||
'email_overrides' - an array
|
||||
'email_header' - string
|
||||
'email_body' - string
|
||||
'email_footer' - string
|
||||
'email_plainText' - string
|
||||
|
||||
// If everything is standard apart from the body, the body can be defined as a simple variable
|
||||
|
||||
*/
|
||||
//TODO - integrate into mailout routine
|
||||
/*
|
||||
$MAILOUT_HEADER = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' >
|
||||
<head>
|
||||
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
|
||||
{STYLESHEET}
|
||||
</head>
|
||||
<body>
|
||||
<div style='padding:10px'>
|
||||
";
|
||||
|
||||
$MAILOUT_FOOTER = "
|
||||
<br /><br />
|
||||
{SITENAME=link}
|
||||
</div>
|
||||
</body>
|
||||
</html>";
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// 'SIGNUP' TEMPLATE
|
||||
//-------------------------------------------------------------
|
||||
//@Deprecated
|
||||
/*
|
||||
$SIGNUPEMAIL_TEMPLATE = "
|
||||
<div style='padding:10px'>
|
||||
<div style='text-align:left; width:90%'>
|
||||
@@ -224,82 +146,18 @@ LAN_SIGNUP_97." {SITENAME}<br />
|
||||
</div>
|
||||
</div>
|
||||
";
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// 'NOTIFY' TEMPLATE
|
||||
//-------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
|
||||
//-------------------------------------------------------------
|
||||
// USER-DEFINED TEMPLATES (for mass mailouts)
|
||||
//-------------------------------------------------------------
|
||||
/*
|
||||
$TEST_TEMPLATE = array(
|
||||
'template_name' => 'TEst1',
|
||||
'template_type' => 'system',
|
||||
'email_overrides' => '',
|
||||
// 'email_header' - any header information (usually loaded from the default)
|
||||
'email_body' => '{BODY}',
|
||||
'email_footer' => 'footer',
|
||||
'email_plainText' => ''
|
||||
);
|
||||
$TEST2_TEMPLATE = array(
|
||||
'template_name' => 'TEst2',
|
||||
'template_type' => 'all',
|
||||
'email_overrides' => '',
|
||||
// 'email_header' - any header information (usually loaded from the default)
|
||||
'email_body' => '{BODY}',
|
||||
'email_footer' => 'footer'
|
||||
);
|
||||
$TEST3_TEMPLATE = array(
|
||||
'template_name' => 'TEst4',
|
||||
'template_type' => 'user',
|
||||
'email_overrides' => '',
|
||||
// 'email_header' - any header information (usually loaded from the default)
|
||||
'email_body' => '{BODY}',
|
||||
'email_footer' => 'footer'
|
||||
);
|
||||
$TEST4_TEMPLATE = array(
|
||||
'template_name' => 'TEst5',
|
||||
'email_overrides' => '',
|
||||
// 'email_header' - any header information (usually loaded from the default)
|
||||
'email_body' => '{BODY}',
|
||||
'email_footer' => 'footer'
|
||||
);
|
||||
*/
|
||||
$WHATSNEW_TEMPLATE = array(
|
||||
'template_name' => 'WhatsNew',
|
||||
'template_type' => 'user',
|
||||
'email_overrides' => '',
|
||||
// 'email_header' - any header information (usually loaded from the default)
|
||||
'email_body' => 'All the latest news and updates.<br />{BODY}<br />To find out more, simply click on the links!',
|
||||
// 'email_footer' => 'footer'
|
||||
);
|
||||
$MONTHLYUPDATE_TEMPLATE = array(
|
||||
'template_name' => 'MonthlyUpdate',
|
||||
'template_type' => 'user',
|
||||
'email_overrides' => '',
|
||||
// 'email_header' - any header information (usually loaded from the default)
|
||||
'email_body' => 'Just to keep you up to date, here\'s a reminder of what\'s changed in the past month.<br />
|
||||
{BODY}<br />To find out more, simply click on the links!',
|
||||
// 'email_footer' => 'footer'
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// ----------------------- Everything above this line is deprecated but may continue to work for a while ------------------------------- //
|
||||
// ----------------------- Everything above this line is deprecated ------------------------------- //
|
||||
|
||||
|
||||
/** Standardized v2 template rewrite
|
||||
*
|
||||
* Format for individual emails sent by e107 (not bulk emails for now) - a work in progress - bulk could be ported later.
|
||||
* @see e107Email::sendEmail();
|
||||
* Aim: to make email templates follow the same spec. as other templates while remaining as intuitive as other v2 templates in e107.
|
||||
* Note: giving a template a 'name' value will make it available in the admin->mailout area.
|
||||
*/
|
||||
|
||||
|
||||
@@ -311,9 +169,11 @@ $EMAIL_TEMPLATE['default']['header'] = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHT
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' >
|
||||
<head>
|
||||
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
|
||||
<style>
|
||||
<style type='text/css'>
|
||||
body { padding:10px; background-color: #E1E1E1 }
|
||||
div#body { padding:10px; width: 800px; background-color: #FFFFFF; border-radius: 5px }
|
||||
div#body { padding:10px; width: 800px; background-color: #FFFFFF; border-radius: 5px; font-family: helvetica,arial }
|
||||
.video-thumbnail { max-width: 100% }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
@@ -396,22 +256,37 @@ $EMAIL_TEMPLATE['quickadduser']['footer'] = $EMAIL_TEMPLATE['default']['footer'
|
||||
|
||||
|
||||
|
||||
// ---------------------------------
|
||||
|
||||
// ------- Notify (@see admin-> notify)
|
||||
|
||||
|
||||
// Notify (@see admin-> notify)
|
||||
$EMAIL_TEMPLATE['notify']['subject'] = '{SITENAME}: {SUBJECT} ';
|
||||
$EMAIL_TEMPLATE['notify']['header'] = $EMAIL_TEMPLATE['default']['header']; // will use default header above.
|
||||
$EMAIL_TEMPLATE['notify']['body'] = $EMAIL_TEMPLATE['default']['body']; // will use default header above.
|
||||
$EMAIL_TEMPLATE['notify']['footer'] = $EMAIL_TEMPLATE['default']['footer']; // will use default header above.
|
||||
|
||||
|
||||
// ---------------------------------
|
||||
// ------ User-Specific Templates
|
||||
|
||||
|
||||
$EMAIL_TEMPLATE['monthly']['name'] = 'Monthly Update';
|
||||
$EMAIL_TEMPLATE['monthly']['subject'] = '{SITENAME}: {SUBJECT} ';
|
||||
$EMAIL_TEMPLATE['monthly']['header'] = $EMAIL_TEMPLATE['default']['header']; // will use default header above.
|
||||
$EMAIL_TEMPLATE['monthly']['body'] = "Just to keep you up to date, here's a reminder of what's changed in the past month.<br />{BODY}{MEDIA1}{MEDIA2}{MEDIA3}{MEDIA4}{MEDIA5}To find out more, simply click on the links!";
|
||||
$EMAIL_TEMPLATE['monthly']['footer'] = $EMAIL_TEMPLATE['default']['footer'];
|
||||
|
||||
|
||||
|
||||
// A Dummy Example for theme developers.
|
||||
|
||||
$EMAIL_TEMPLATE['whatsnew']['name'] = "What's New";
|
||||
$EMAIL_TEMPLATE['whatsnew']['subject'] = '{SITENAME}: {SUBJECT} ';
|
||||
$EMAIL_TEMPLATE['whatsnew']['header'] = $EMAIL_TEMPLATE['default']['header']; // will use default header above.
|
||||
$EMAIL_TEMPLATE['whatsnew']['body'] = "All the latest news and updates.<br />{BODY}<br />To find out more, simply click on the links!";
|
||||
$EMAIL_TEMPLATE['whatsnew']['footer'] = $EMAIL_TEMPLATE['default']['footer'];
|
||||
|
||||
|
||||
|
||||
// ------ A Dummy Example for theme developers.
|
||||
|
||||
$EMAIL_TEMPLATE['example']['subject'] = '{SITENAME}: {SUBJECT} ';
|
||||
$EMAIL_TEMPLATE['example']['header'] = $EMAIL_TEMPLATE['default']['header']; // will use default header above.
|
||||
$EMAIL_TEMPLATE['example']['body'] = $EMAIL_TEMPLATE['default']['body']; // will use default header above.
|
||||
@@ -422,4 +297,7 @@ $EMAIL_TEMPLATE['example']['footer'] = "<br /><br />
|
||||
</body>
|
||||
</html>";
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
@@ -15,7 +15,11 @@
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
if (!defined("USER_WIDTH")){ define("USER_WIDTH", "width:95%"); }
|
||||
if (!defined("USER_WIDTH"))
|
||||
{
|
||||
$legacyWidth = deftrue('BOOTSTRAP') ? "" : "width:95%";
|
||||
define("USER_WIDTH", $legacyWidth);
|
||||
}
|
||||
|
||||
global $user_shortcodes, $pref, $user;
|
||||
//Set this to TRUE if you would like any extended user field that is empty to NOT be shown on the profile page
|
||||
@@ -25,11 +29,9 @@ $EXTENDED_CATEGORY_START = "<tr><td colspan='2' class='forumheader center'>{EXTE
|
||||
|
||||
$EXTENDED_CATEGORY_TABLE = "
|
||||
<tr>
|
||||
<td style='width:40%' class='forumheader3'>
|
||||
{EXTENDED_ICON}
|
||||
{EXTENDED_NAME}
|
||||
<td style='width:30%' class='forumheader3'>{EXTENDED_ICON}{EXTENDED_NAME}
|
||||
</td>
|
||||
<td style='width:60%' class='forumheader3'>{EXTENDED_VALUE}</td>
|
||||
<td style='width:70%' class='forumheader3'>{EXTENDED_VALUE}</td>
|
||||
</tr>
|
||||
";
|
||||
|
||||
@@ -96,6 +98,9 @@ $sc_style['USER_RATING']['post'] = "</div></td></tr>";
|
||||
|
||||
$sc_style['USER_LOGINNAME']['pre'] = " : ";
|
||||
|
||||
|
||||
|
||||
|
||||
//FIXME TODO - Remove IF statements from template.
|
||||
if(isset($pref['photo_upload']) && $pref['photo_upload'])
|
||||
{
|
||||
@@ -173,44 +178,65 @@ $USER_FULL_TEMPLATE = "{SETIMAGE: w=250}
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td style='width:30%' class='forumheader3'>".LAN_USER_67."</td>
|
||||
<td style='width:70%' class='forumheader3'>{USER_CHATPOSTS} ( {USER_CHATPER}% )</td>
|
||||
<td style='width:30%' class='forumheader3'>".LAN_USER_66."</td>
|
||||
<td style='width:70%' class='forumheader3'>{USER_VISITS}</td>
|
||||
</tr>
|
||||
|
||||
{USER_ADDONS}
|
||||
|
||||
|
||||
<tr>
|
||||
<td style='width:30%' class='forumheader3'>".LAN_USER_68."</td>
|
||||
<td style='width:70%' class='forumheader3'>{USER_COMMENTPOSTS} ( {USER_COMMENTPER}% )</td>
|
||||
</tr>
|
||||
{USER_COMMENTS_LINK}
|
||||
|
||||
<tr>
|
||||
<td style='width:30%' class='forumheader3'>".LAN_USER_69."</td>
|
||||
<td style='width:70%' class='forumheader3'>{USER_FORUMPOSTS} ( {USER_FORUMPER}% )</td>
|
||||
</tr>
|
||||
{USER_FORUM_LINK}
|
||||
<tr>
|
||||
<td style='width:30%' class='forumheader3'>".LAN_USER_66."</td>
|
||||
<td style='width:70%' class='forumheader3'>{USER_VISITS}</td>
|
||||
</tr>
|
||||
{USER_EMBED_USERPROFILE}
|
||||
|
||||
{USER_UPDATE_LINK}
|
||||
<tr>
|
||||
<td colspan='2' class='forumheader3 center'>
|
||||
<table style='width:95%'>
|
||||
<tr>
|
||||
<td style='width:50%'>{USER_JUMP_LINK=prev}</td>
|
||||
<td class='right' style='width:50%;'>{USER_JUMP_LINK=next}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table></div>
|
||||
</table>
|
||||
<ul class='pager user-view-nextprev'>
|
||||
<li class='previous'>
|
||||
{USER_JUMP_LINK=prev}
|
||||
</li>
|
||||
<li>
|
||||
<!-- Back to List? -->
|
||||
</li>
|
||||
<li class='next'>
|
||||
{USER_JUMP_LINK=next}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{PROFILE_COMMENTS}
|
||||
{PROFILE_COMMENT_FORM}
|
||||
";
|
||||
|
||||
$USER_EMBED_USERPROFILE_TEMPLATE = "
|
||||
<tr><td colspan='2' class='fcaption'>{USER_EMBED_USERPROFILE_CAPTION}</td></tr>
|
||||
<tr><td colspan='2' class='forumheader3'>{USER_EMBED_USERPROFILE_TEXT}</td></tr>";
|
||||
<tr>
|
||||
<td class='forumheader3'>{USER_ADDON_LABEL}</td>
|
||||
<td class='forumheader3'>{USER_ADDON_TEXT}</td>
|
||||
</tr>";
|
||||
|
||||
|
||||
|
||||
// Convert Templates from v1.x to v2.x Standards.
|
||||
|
||||
$USER_TEMPLATE['view'] = $USER_FULL_TEMPLATE;
|
||||
$USER_TEMPLATE['extended']['start'] = $EXTENDED_CATEGORY_START;
|
||||
$USER_TEMPLATE['extended']['item'] = $EXTENDED_CATEGORY_TABLE ;
|
||||
$USER_TEMPLATE['extended']['start'] = $EXTENDED_CATEGORY_END;
|
||||
$USER_TEMPLATE['addon'] = $USER_EMBED_USERPROFILE_TEMPLATE;
|
||||
|
||||
$USER_TEMPLATE['list']['start'] = $USER_SHORT_TEMPLATE_START;
|
||||
$USER_TEMPLATE['list']['item'] = $USER_SHORT_TEMPLATE;
|
||||
$USER_TEMPLATE['list']['end'] = $USER_SHORT_TEMPLATE_END;
|
||||
|
||||
// Convert Shortcode Wrappers from v1.x to v2.x standards.
|
||||
|
||||
$USER_WRAPPER['view']['USER_COMMENTS_LINK'] = $sc_style['USER_COMMENTS_LINK']['pre']."{---}".$sc_style['USER_COMMENTS_LINK']['post'];
|
||||
$USER_WRAPPER['view']['USER_SIGNATURE'] = $sc_style['USER_SIGNATURE']['pre']."{---}".$sc_style['USER_SIGNATURE']['post'];
|
||||
$USER_WRAPPER['view']['USER_UPDATE_LINK'] = $sc_style['USER_UPDATE_LINK']['pre']."{---}".$sc_style['USER_UPDATE_LINK']['post'];
|
||||
$USER_WRAPPER['view']['USER_FORUM_LINK'] = $sc_style['USER_FORUM_LINK']['pre']."{---}".$sc_style['USER_FORUM_LINK']['post'];
|
||||
$USER_WRAPPER['view']['USER_RATING'] = $sc_style['USER_RATING']['pre']."{---}".$sc_style['USER_RATING']['post'];
|
||||
$USER_WRAPPER['view']['USER_SENDPM'] = $sc_style['USER_SENDPM']['pre']."{---}".$sc_style['USER_SENDPM']['post'];
|
||||
$USER_WRAPPER['view']['USER_LOGINNAME'] = $sc_style['USER_LOGINNAME']['pre']."{---}";
|
||||
|
||||
?>
|
||||
|
@@ -181,7 +181,7 @@ $USERSETTINGS_EDIT = "
|
||||
|
||||
|
||||
|
||||
// e107 v2. bootstrap3 compatible.
|
||||
// e107 v2. bootstrap3 compatible template.
|
||||
|
||||
$USERSETTINGS_WRAPPER['edit']['USERNAME'] = "<div class='form-group'>
|
||||
<label for='username' class='col-sm-3 control-label'>".LAN_USER_01."</label>
|
||||
@@ -246,7 +246,7 @@ $USERSETTINGS_WRAPPER['edit']['SIGNATURE'] = "<div class='form-group'>
|
||||
|
||||
|
||||
|
||||
|
||||
// Bootstrap 3 only.
|
||||
|
||||
$USERSETTINGS_TEMPLATE['edit'] = "
|
||||
|
||||
@@ -295,7 +295,7 @@ $USERSETTINGS_TEMPLATE['edit'] = "
|
||||
{PHOTO_UPLOAD}
|
||||
|
||||
{USERCLASSES}
|
||||
{USEREXTENDED_ALL}
|
||||
{USEREXTENDED_ALL=tabs}
|
||||
|
||||
|
||||
{SIGNATURE=cols=58&rows=4}
|
||||
@@ -308,11 +308,16 @@ $USERSETTINGS_TEMPLATE['edit'] = "
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
";
|
||||
|
||||
|
||||
$USERSETTINGS_TEMPLATE['extended-category'] = "<h3>{CATNAME}</h3>";
|
||||
$USERSETTINGS_TEMPLATE['extended-field'] = "<div class='form-group'>
|
||||
<label class='col-sm-3 control-label'>{FIELDNAME}</label>
|
||||
<div class='col-sm-9'>
|
||||
{FIELDVAL} {HIDEFIELD}
|
||||
</div>
|
||||
</div>
|
||||
";
|
||||
|
||||
|
||||
|
||||
|
@@ -17,42 +17,42 @@
|
||||
</item>
|
||||
<item name="location">
|
||||
<type>text</type>
|
||||
<include_text>class='tbox' size='40' maxlength='254'</include_text>
|
||||
<include_text>class='form-control tbox' size='40' maxlength='254'</include_text>
|
||||
<applicable>253</applicable>
|
||||
<read>253</read>
|
||||
<write>253</write>
|
||||
</item>
|
||||
<item name="aim">
|
||||
<type>text</type>
|
||||
<include_text>class='tbox' size='40' maxlength='254'</include_text>
|
||||
<include_text>class='form-control tbox' size='40' maxlength='254'</include_text>
|
||||
<applicable>253</applicable>
|
||||
<read>253</read>
|
||||
<write>253</write>
|
||||
</item>
|
||||
<item name="icq">
|
||||
<type>text</type>
|
||||
<include_text>class='tbox' size='40' maxlength='254'</include_text>
|
||||
<include_text>class='form-control tbox' size='40' maxlength='254'</include_text>
|
||||
<applicable>253</applicable>
|
||||
<read>253</read>
|
||||
<write>253</write>
|
||||
</item>
|
||||
<item name="yahoo">
|
||||
<type>text</type>
|
||||
<include_text>class='tbox' size='40' maxlength='254'</include_text>
|
||||
<include_text>class='form-control tbox' size='40' maxlength='254'</include_text>
|
||||
<applicable>253</applicable>
|
||||
<read>253</read>
|
||||
<write>253</write>
|
||||
</item>
|
||||
<item name="msn">
|
||||
<type>text</type>
|
||||
<include_text>class='tbox' size='40' maxlength='254'</include_text>
|
||||
<include_text>class='form-control tbox' size='40' maxlength='254'</include_text>
|
||||
<applicable>253</applicable>
|
||||
<read>253</read>
|
||||
<write>253</write>
|
||||
</item>
|
||||
<item name="skype">
|
||||
<type>text</type>
|
||||
<include_text>class='tbox' size='40' maxlength='254'</include_text>
|
||||
<include_text>class='form-control tbox' size='40' maxlength='254'</include_text>
|
||||
<applicable>253</applicable>
|
||||
<read>253</read>
|
||||
<write>253</write>
|
||||
@@ -66,7 +66,7 @@
|
||||
</item>
|
||||
<item name="homepage">
|
||||
<type>text</type>
|
||||
<include_text>class='tbox' size='40' maxlength='254'</include_text>
|
||||
<include_text>class='form-control tbox' size='40' maxlength='254'</include_text>
|
||||
<regex>#^[a-z0-9]+://#si</regex>
|
||||
<applicable>253</applicable>
|
||||
<read>253</read>
|
||||
|
@@ -136,7 +136,7 @@ class e_admin_log
|
||||
|
||||
|
||||
/**
|
||||
* Add a Save an event into the admin log.
|
||||
* Add a Save an event into the admin, rolloing or user log.
|
||||
*
|
||||
* Alternative admin log entry point - compatible with legacy calls, and a bit simpler to use than the generic entry point.
|
||||
* ($eventcode has been added - give it a reference to identify the source module, such as 'NEWS_12' or 'ECAL_03')
|
||||
@@ -150,11 +150,12 @@ class e_admin_log
|
||||
*
|
||||
* @param string $event_title
|
||||
* @param mixed $event_details
|
||||
* @param integer $event_type [optional] Log level
|
||||
* @param unknown $event_code [optional]
|
||||
* @param integer $event_type [optional] Log level eg. E_LOG_INFORMATIVE, E_LOG_NOTICE, E_LOG_WARNING, E_LOG_FATAL
|
||||
* @param string $event_code [optional] - eg. 'BOUNCE'
|
||||
* @param integer $target [optional] LOG_TO_ADMIN, LOG_TO_AUDIT, LOG_TO_ROLLING
|
||||
* @return e_admin_log
|
||||
*/
|
||||
public function add($event_title, $event_detail, $event_type = E_LOG_INFORMATIVE , $event_code = '')
|
||||
public function add($event_title, $event_detail, $event_type = E_LOG_INFORMATIVE , $event_code = '', $target = LOG_TO_ADMIN )
|
||||
{
|
||||
if ($event_code == '')
|
||||
{
|
||||
@@ -200,7 +201,7 @@ class e_admin_log
|
||||
}
|
||||
|
||||
|
||||
$this->e_log_event($event_type, -1, $event_code, $event_title, $event_detail, FALSE, LOG_TO_ADMIN);
|
||||
$this->e_log_event($event_type, -1, $event_code, $event_title, $event_detail, FALSE, $target);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -383,12 +384,13 @@ class e_admin_log
|
||||
*/
|
||||
function user_audit($event_type, $event_data, $id = '', $u_name = '')
|
||||
{
|
||||
global $e107,$tp,$pref;
|
||||
global $e107,$tp;
|
||||
list($time_usec, $time_sec) = explode(" ", microtime()); // Log event time immediately to minimise uncertainty
|
||||
$time_usec = $time_usec * 1000000;
|
||||
|
||||
// See whether we should log this
|
||||
$user_logging_opts = array_flip(explode(',', varset($pref['user_audit_opts'], '')));
|
||||
$user_logging_opts = e107::getConfig()->get('user_audit_opts');
|
||||
|
||||
if (!isset($user_logging_opts[$event_type]))
|
||||
return; // Finished if not set to log this event type
|
||||
|
||||
|
@@ -5559,8 +5559,9 @@ class e_admin_form_ui extends e_form
|
||||
// TODO - core ui-batch-option class!!! REMOVE INLINE STYLE!
|
||||
// XXX Quick Fix for styling - correct.
|
||||
$text = "
|
||||
<div class='navbar navbar-inner left' style='padding-left:30px; padding-top:6px; margin-top:-20px;border-top:0px'>
|
||||
<img src='".e_IMAGE_ABS."generic/branchbottom.gif' alt='' class='icon action' />
|
||||
<div class='navbar navbar-inner left' style='padding-left:15px; padding-top:8px; margin-top:-20px;border-top:0px'>
|
||||
<div class='input-append'>
|
||||
<img src='".e_IMAGE_ABS."generic/branchbottom.gif' alt='' class='icon action' style='padding-top:5px' />
|
||||
".$this->select_open('etrigger_batch', array('class' => 'tbox select batch e-autosubmit reset', 'id' => false))."
|
||||
".$this->option(LAN_BATCH_LABEL_SELECTED, '', false)."
|
||||
".($allow_copy ? $this->option(LAN_COPY, 'copy', false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : '')."
|
||||
@@ -5571,6 +5572,7 @@ class e_admin_form_ui extends e_form
|
||||
".$this->renderBatchFilter('batch')."
|
||||
".$this->select_close()."
|
||||
".$this->admin_button('e__execute_batch', 'e__execute_batch', 'batch e-hide-if-js', LAN_GO, array('id' => false))."
|
||||
</div>
|
||||
</div>
|
||||
";
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
// WARNING, any echoed output from this script will be returned to the sender as a bounce message.
|
||||
|
||||
$_E107['debug'] = FALSE;
|
||||
$_E107['debug'] = true;
|
||||
|
||||
|
||||
if (!defined('e107_INIT'))
|
||||
@@ -33,33 +33,62 @@ class e107Bounce
|
||||
|
||||
if(!$strEmail)
|
||||
{
|
||||
if($_E107['debug'] === true)
|
||||
{
|
||||
echo "Couldn't get email data";
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
$multiArray = Bouncehandler::get_the_facts($strEmail);
|
||||
$head = BounceHandler::parse_head($strEmail);
|
||||
$message = null;
|
||||
|
||||
$e107_userid = (isset($head['X-e107-id'])) ? intval($head['X-e107-id']) : $this->getHeader($strEmail,'X-e107-id');
|
||||
$identifier = deftrue('MAIL_IDENTIFIER', 'X-e107-id');
|
||||
$e107_userid = (isset($head[$identifier])) ? $head[$identifier] : $this->getHeader($strEmail, $identifier);
|
||||
|
||||
if($_E107['debug'])
|
||||
{
|
||||
require_once(e_HANDLER."mail.php");
|
||||
$message = "Your Bounce Handler is working. The data of the email you sent is displayed below.<br />";
|
||||
|
||||
if($e107_userid)
|
||||
{
|
||||
$message .= "A user-id was detected in the email you sent: <b>".$e107_userid."</b><br />";
|
||||
}
|
||||
$message .= "<br />";
|
||||
$message .= "<pre>".print_r($multiArray,TRUE). "</pre>";
|
||||
|
||||
$message .= "<br /><h4>Head</h4>";
|
||||
$message .= print_a($head,true);
|
||||
$message .= "<h4>Emails Found</h4><pre>".print_r($multiArray,TRUE). "</pre>";
|
||||
|
||||
$message .= "<pre>".$strEmail. "</pre>";
|
||||
sendemail($pref['siteadminemail'], SITENAME." :: Bounce-Handler.", $message, $pref['siteadmin'],$pref['siteadminemail'], $pref['siteadmin']);
|
||||
|
||||
if(varset($_GET['eml']))
|
||||
{
|
||||
// echo $message;
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
if($e107_userid && ($this->setUser_Bounced($e107_userid)==TRUE))
|
||||
|
||||
|
||||
if(!empty($e107_userid))
|
||||
{
|
||||
return;
|
||||
if($errors = $this->setUser_Bounced($e107_userid))
|
||||
{
|
||||
$mesage .= print_a($errors);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!empty($message))
|
||||
{
|
||||
sendemail($pref['siteadminemail'], SITENAME." :: Bounce-Handler.", $message, $pref['siteadmin'],$pref['siteadminemail'], $pref['siteadmin']);
|
||||
}
|
||||
|
||||
return;
|
||||
/* echo "<pre>";
|
||||
print_r($multiArray);
|
||||
echo "</pre>";
|
||||
@@ -68,7 +97,7 @@ class e107Bounce
|
||||
|
||||
foreach($multiArray as $the)
|
||||
{
|
||||
$the['user_id'] = $head['X-e107-id'];
|
||||
$the['user_id'] = $head[$identifier];
|
||||
$the['user_email'] = $the['recipient'];
|
||||
unset($the['recipient']);
|
||||
|
||||
@@ -76,7 +105,7 @@ class e107Bounce
|
||||
{
|
||||
case 'failed':
|
||||
e107::getEvent()->trigger('email-bounce-failed', $the);
|
||||
$this->setUser_Bounced($the['user_email']);
|
||||
$this->setUser_Bounced(null, $the['user_email']);
|
||||
break;
|
||||
|
||||
case 'transient':
|
||||
@@ -85,7 +114,7 @@ class e107Bounce
|
||||
e107::getEvent()->trigger('email-bounce-transient', $the);
|
||||
if($num_attempts > 10)
|
||||
{
|
||||
$this->setUser_Bounced($the['user_email'], $the['user_id']);
|
||||
$this->setUser_Bounced($the['user_id'], $the['user_email']);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -111,27 +140,28 @@ class e107Bounce
|
||||
$tmp = explode("\n",$message);
|
||||
foreach($tmp as $val)
|
||||
{
|
||||
if(strpos($val,$id.":")!==FALSE)
|
||||
if(strpos($val,$id.":")!== false)
|
||||
{
|
||||
return intval(str_replace($id.":","",$val));
|
||||
return str_replace($id.":","",$val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
function setUser_Bounced($email, $bounceString = '')
|
||||
function setUser_Bounced($bounceString = '', $email='' )
|
||||
{
|
||||
if(!$email && !$bounceString){ return; }
|
||||
// echo "Email bounced ID: ".$id_or_email;
|
||||
require_once(e_HANDLER.'mail_manager_class.php');
|
||||
$mailHandler = new e107MailManager();
|
||||
if ($mailManager->markBounce($bounceString, $email))
|
||||
{ // Success
|
||||
|
||||
$mailManager = new e107MailManager();
|
||||
if ($errors = $mailManager->markBounce($bounceString, $email))
|
||||
{
|
||||
return $errors; // Failure
|
||||
}
|
||||
// Failure
|
||||
// $query = (is_numeric($id_or_email)) ? "user_ban = 3 WHERE user_id = ".intval($id_or_email)." LIMIT 1" : "user_ban = 3 WHERE user_email = '".$id_or_email."' ";
|
||||
// return e107::getDb()->db_Update('user',$query);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -921,12 +921,12 @@ class comment
|
||||
/**
|
||||
* Displays existing comments, and a comment entry form
|
||||
*
|
||||
* @param unknown_type $table - the source table for the associated item
|
||||
* @param unknown_type $action - usually 'comment' or 'reply'
|
||||
* @param unknown_type $id - ID of item associated with comments (e.g. news ID)
|
||||
* @param string $table - the source table for the associated item
|
||||
* @param string $action - usually 'comment' or 'reply'
|
||||
* @param integer $id - ID of item associated with comments (e.g. news ID)
|
||||
* @param unknown_type $width - appears to not be used
|
||||
* @param unknown_type $subject
|
||||
* @param unknown_type $rate
|
||||
* @param string $subject
|
||||
* @param boolean $rate
|
||||
*/
|
||||
function compose_comment($table, $action, $id, $width, $subject, $rate = FALSE, $return = FALSE, $tablerender = TRUE)
|
||||
{
|
||||
|
@@ -1260,7 +1260,7 @@ class e107
|
||||
|
||||
/**
|
||||
* Retrieve admin log singleton object
|
||||
*
|
||||
* @Deprecated - use e107::getLog();
|
||||
* @return e_admin_log
|
||||
*/
|
||||
public static function getAdminLog()
|
||||
@@ -1268,6 +1268,16 @@ class e107
|
||||
return self::getSingleton('e_admin_log', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve admin log singleton object
|
||||
*
|
||||
* @return e_admin_log
|
||||
*/
|
||||
public static function getLog()
|
||||
{
|
||||
return self::getSingleton('e_admin_log', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve date handler singleton object
|
||||
*
|
||||
@@ -1803,9 +1813,10 @@ class e107
|
||||
* Retrieves config() from all plugins for addons such as e_url.php, e_cron.php, e_sitelink.php
|
||||
* @param string $addonName eg. e_cron, e_url
|
||||
* @param string $className [optional] (if different from addonName)
|
||||
* @param string $methodName [optional] (if different from 'config')
|
||||
* @return none
|
||||
*/
|
||||
public function getAddonConfig($addonName, $className = '')
|
||||
public function getAddonConfig($addonName, $className = '', $methodName='config', $param=null )
|
||||
{
|
||||
$new_addon = array();
|
||||
$sql = e107::getDb(); // Might be used by older plugins.
|
||||
@@ -1827,7 +1838,7 @@ class e107
|
||||
include_once(e_PLUGIN.$key.'/'.$filename.'.php');
|
||||
|
||||
$class_name = $key.'_'.$className;
|
||||
$array = self::callMethod($class_name, 'config');
|
||||
$array = self::callMethod($class_name, $methodName,$param);
|
||||
|
||||
if($array)
|
||||
{
|
||||
@@ -1841,9 +1852,10 @@ class e107
|
||||
return $new_addon;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Safe way to call user methods.
|
||||
* @param string $class_name
|
||||
* @param string|object $class_name
|
||||
* @param string $method_name
|
||||
* @return boolean FALSE
|
||||
*/
|
||||
@@ -1851,9 +1863,19 @@ class e107
|
||||
{
|
||||
$mes = e107::getMessage();
|
||||
|
||||
if(class_exists($class_name))
|
||||
if(is_object($class_name) || class_exists($class_name))
|
||||
{
|
||||
$obj = new $class_name;
|
||||
|
||||
if(is_object($class_name))
|
||||
{
|
||||
$obj = $class_name;
|
||||
$class_name = get_class($obj);
|
||||
}
|
||||
else
|
||||
{
|
||||
$obj = new $class_name;
|
||||
}
|
||||
|
||||
if(method_exists($obj, $method_name))
|
||||
{
|
||||
if(E107_DBG_INCLUDES)
|
||||
@@ -1870,6 +1892,7 @@ class e107
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get theme name or path.
|
||||
*
|
||||
@@ -2251,6 +2274,8 @@ class e107
|
||||
//FIXME XXX URGENT - Add support for _WRAPPER and $sc_style BC. - save in registry and retrieve in getScBatch()?
|
||||
// Use: list($pre,$post) = explode("{---}",$text,2);
|
||||
|
||||
$tp = self::getParser(); // BC FIx - avoid breaking old templates due to missing globals.
|
||||
|
||||
if(null === self::getRegistry($regPath))
|
||||
{
|
||||
(deftrue('E107_DEBUG_LEVEL') ? include_once($path) : @include_once($path));
|
||||
|
@@ -2949,6 +2949,22 @@ class e_parser
|
||||
return "<img class='img-responsive' src='".$thumbSrc."' alt='Youtube Video' style='width:".vartrue($parm['w'],'80')."px'/>";
|
||||
}
|
||||
|
||||
if($thumb == 'email')
|
||||
{
|
||||
$thumbSrc = "http://i1.ytimg.com/vi/".$id."/maxresdefault.jpg"; // 640 x 480
|
||||
$filename = 'temp/yt-thumb-'.md5($id).".jpg";
|
||||
$filepath = e_MEDIA.$filename;
|
||||
$url = 'http://youtu.be/'.$id;
|
||||
|
||||
if(!file_exists($filepath))
|
||||
{
|
||||
e107::getFile()->getRemoteFile($thumbSrc, $filename,'media');
|
||||
}
|
||||
|
||||
return "<a href='".$url."'><img class='video-responsive video-thumbnail' src='{e_MEDIA}".$filename."' alt='Youtube Video' title='Click to view on Youtube' />
|
||||
<div class='video-thumbnail-caption'><small>Click to watch video</small></div></a>";
|
||||
}
|
||||
|
||||
if($thumb == 'src')
|
||||
{
|
||||
return $thumbSrc;
|
||||
|
@@ -208,6 +208,11 @@ class e_form
|
||||
$c = 0;
|
||||
foreach($array as $key=>$tab)
|
||||
{
|
||||
if(is_numeric($key))
|
||||
{
|
||||
$key = 'tab-'.$this->name2id($tab['caption']);
|
||||
}
|
||||
|
||||
$active = ($c == 0) ? ' class="active"' : '';
|
||||
$text .= '<li'.$active.'><a href="#'.$key.'" data-toggle="tab">'.$tab['caption'].'</a></li>';
|
||||
$c++;
|
||||
@@ -222,6 +227,11 @@ class e_form
|
||||
$c=0;
|
||||
foreach($array as $key=>$tab)
|
||||
{
|
||||
if(is_numeric($key))
|
||||
{
|
||||
$key = 'tab-'.$this->name2id($tab['caption']);
|
||||
}
|
||||
|
||||
$active = ($c == 0) ? ' active' : '';
|
||||
$text .= '<div class="tab-pane'.$active.'" id="'.$key.'">'.$tab['text'].'</div>';
|
||||
$c++;
|
||||
@@ -400,11 +410,13 @@ class e_form
|
||||
|
||||
$mlength = vartrue($maxlength) ? "maxlength=".$maxlength : "";
|
||||
|
||||
$type = varset($options['type']) == 'email' ? 'email' : 'text'; // used by $this->email();
|
||||
|
||||
$options = $this->format_options('text', $name, $options);
|
||||
|
||||
|
||||
//never allow id in format name-value for text fields
|
||||
return "<input type='text' name='{$name}' value='{$value}' {$mlength} ".$this->get_attributes($options, $name)." />";
|
||||
return "<input type='".$type."' name='{$name}' value='{$value}' {$mlength} ".$this->get_attributes($options, $name)." />";
|
||||
}
|
||||
|
||||
|
||||
@@ -440,11 +452,8 @@ class e_form
|
||||
|
||||
function email($name, $value, $maxlength = 200, $options = array())
|
||||
{
|
||||
$options = $this->format_options('text', $name, $options);
|
||||
|
||||
//never allow id in format name-value for text fields
|
||||
return "<input type='email' name='{$name}' value='{$value}' maxlength='{$maxlength}' ".$this->get_attributes($options, $name)." />
|
||||
";
|
||||
$options['type'] = 'email';
|
||||
return $this->text($name,$value,$maxlength,$options);
|
||||
}
|
||||
|
||||
|
||||
@@ -890,7 +899,7 @@ class e_form
|
||||
}
|
||||
else
|
||||
{
|
||||
$text .= "<input class='{$class} input-".$xsize."' type='text' size='{$size}' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-date-ampm='{$ampm}' data-date-language='".e_LAN."' data-date-firstday='{$firstDay}' {$required} />";
|
||||
$text .= "<input class='{$class} input-".$xsize." form-control' type='text' size='{$size}' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-date-ampm='{$ampm}' data-date-language='".e_LAN."' data-date-firstday='{$firstDay}' {$required} />";
|
||||
}
|
||||
|
||||
// $text .= "ValueFormat: ".$dateFormat." Value: ".$value;
|
||||
@@ -1085,6 +1094,7 @@ class e_form
|
||||
* @param string $name
|
||||
* @param number $value
|
||||
* @param array $options
|
||||
* @example Use
|
||||
*/
|
||||
public function progressBar($name,$value,$options=array())
|
||||
{
|
||||
@@ -1094,11 +1104,28 @@ class e_form
|
||||
}
|
||||
|
||||
$class = vartrue($options['class'],'');
|
||||
$target = $this->name2id($name);
|
||||
|
||||
return "<div class='progress ".$class."' id='".$this->name2id($name)."'>
|
||||
<div class='bar' style='width: ".number_format($value,1)."%'></div>
|
||||
$striped = (vartrue($options['btn-label'])) ? ' progress-striped active' : '';
|
||||
|
||||
$text = "<div class='progress ".$class."{$striped}' >
|
||||
<div id='".$target."' class='progress-bar bar' style='width: ".number_format($value,1)."%'></div>
|
||||
</div>";
|
||||
|
||||
$loading = vartrue($options['loading'],'Please wait...');
|
||||
|
||||
$buttonId = $target.'-start';
|
||||
|
||||
if(vartrue($options['btn-label']))
|
||||
{
|
||||
$text .= '<a id="'.$buttonId.'" data-loading-text="'.$loading.'" data-progress-target="'.$target.'" data-progress="' . $options['url'] . '" data-progress-mode="'.varset($options['mode'],0).'" data-progress-show="'.$nextStep.'" data-progress-hide="'.$buttonId.'" class="btn btn-primary e-progress" >'.$options['btn-label'].'</a>';
|
||||
$text .= ' <a data-progress-target="'.$target.'" class="btn btn-danger e-progress-cancel" >'.LAN_CANCEL.'</a>';
|
||||
|
||||
}
|
||||
|
||||
|
||||
return $text;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1501,6 +1528,13 @@ class e_form
|
||||
|
||||
function select_open($name, $options = array())
|
||||
{
|
||||
if(!is_array($options)) parse_str($options, $options);
|
||||
|
||||
if(vartrue($options['size']) && !is_numeric($options['size']))
|
||||
{
|
||||
$options['class'] .= " input-".$options['size'];
|
||||
unset($options['size']); // don't include in html 'size='.
|
||||
}
|
||||
$options = $this->format_options('select', $name, $options);
|
||||
|
||||
return "<select name='{$name}'".$this->get_attributes($options, $name).">";
|
||||
@@ -1545,7 +1579,11 @@ class e_form
|
||||
|
||||
if(isset($options['default']))
|
||||
{
|
||||
$text .= $this->option($options['default'], varset($options['defaultValue']));
|
||||
if($options['default'] === 'blank')
|
||||
{
|
||||
$options['default'] = ' ';
|
||||
}
|
||||
$text .= $this->option($options['default'], varset($options['defaultValue'],''));
|
||||
}
|
||||
elseif($defaultBlank)
|
||||
{
|
||||
@@ -1934,6 +1972,7 @@ class e_form
|
||||
case 'create':
|
||||
case 'import':
|
||||
case 'submit':
|
||||
case 'success':
|
||||
$options['class'] .= 'btn-success';
|
||||
break;
|
||||
|
||||
@@ -1946,6 +1985,7 @@ class e_form
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
case 'danger':
|
||||
$options['class'] .= 'btn-danger';
|
||||
$options['other'] = 'data-confirm="'.LAN_JSCONFIRM.'"';
|
||||
break;
|
||||
@@ -1956,6 +1996,7 @@ class e_form
|
||||
|
||||
case 'other':
|
||||
case 'login':
|
||||
case 'primary':
|
||||
$options['class'] .= 'btn-primary';
|
||||
break;
|
||||
|
||||
@@ -2659,7 +2700,15 @@ class e_form
|
||||
*/
|
||||
private function renderInline($dbField, $pid, $fieldName, $curVal, $linkText, $type='text', $array=null)
|
||||
{
|
||||
$source = str_replace('"',"'",json_encode($array, JSON_FORCE_OBJECT)); // SecretR - force object, fix number of bugs
|
||||
$jsonArray = array();
|
||||
foreach($array as $k=>$v)
|
||||
{
|
||||
$jsonArray[$k] = str_replace("'", "`", $v);
|
||||
}
|
||||
|
||||
$source = str_replace('"',"'",json_encode($jsonArray, JSON_FORCE_OBJECT)); // SecretR - force object, fix number of bugs
|
||||
|
||||
|
||||
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
|
||||
|
||||
$text = "<a class='e-tip e-editable editable-click' data-name='".$dbField."' ";
|
||||
@@ -3245,10 +3294,15 @@ class e_form
|
||||
// Inline Editing.
|
||||
if(!vartrue($attributes['noedit']) && vartrue($parms['editable'])) // avoid bad markup, better solution coming up
|
||||
{
|
||||
|
||||
$mode = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
|
||||
$methodParms = call_user_func_array(array($this, $method), array($value, 'inline', $parms));
|
||||
$source = str_replace('"',"'",json_encode($methodParms, JSON_FORCE_OBJECT));
|
||||
$value = "<a class='e-tip e-editable editable-click' data-type='select' data-value='".$_value."' data-name='".$field."' data-source=\"".$source."\" title=\"".LAN_EDIT." ".$attributes['title']."\" data-pk='".$id."' data-url='".e_SELF."?mode=&action=inline&id={$id}&ajax_used=1' href='#'>".$value."</a>";
|
||||
$xtype = 'select';
|
||||
|
||||
$value = $this->renderInline($field, $id, $attributes['title'], $_value, $value, $xtype, $methodParms);
|
||||
|
||||
// $source = str_replace('"',"'",json_encode($methodParms, JSON_FORCE_OBJECT));
|
||||
// $value = "<a class='e-tip e-editable editable-click' data-type='select' data-value='".$_value."' data-name='".$field."' data-source=\"".$source."\" title=\"".LAN_EDIT." ".$attributes['title']."\" data-pk='".$id."' data-url='".e_SELF."?mode=&action=inline&id={$id}&ajax_used=1' href='#'>".$value."</a>";
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -3375,8 +3429,14 @@ class e_form
|
||||
$ret = $this->text($key, e107::getIPHandler()->ipDecode($value), 32, $parms);
|
||||
break;
|
||||
|
||||
case 'url':
|
||||
case 'email':
|
||||
$maxlength = vartrue($parms['maxlength'], 255);
|
||||
unset($parms['maxlength']);
|
||||
$ret = vartrue($parms['pre']).$this->email($key, $value, $maxlength, $parms).vartrue($parms['post']); // vartrue($parms['__options']) is limited. See 'required'=>true
|
||||
break;
|
||||
|
||||
case 'url':
|
||||
// case 'email':
|
||||
case 'text':
|
||||
case 'password': // encrypts to md5 when saved.
|
||||
$maxlength = vartrue($parms['maxlength'], 255);
|
||||
@@ -3390,11 +3450,15 @@ class e_form
|
||||
|
||||
case 'textarea':
|
||||
$text = "";
|
||||
if(vartrue($parms['append'])) // similar to comments - TODO TBD. a 'comment' field type may be better.
|
||||
if(vartrue($parms['append']) && vartrue($value)) // similar to comments - TODO TBD. a 'comment' field type may be better.
|
||||
{
|
||||
$attributes['readParms'] = 'bb=1';
|
||||
$text = $this->renderValue($key, $value, $attributes).$this->hidden($key, $value).'<br />';
|
||||
|
||||
$text = $this->renderValue($key, $value, $attributes);
|
||||
$text .= '<br />';
|
||||
$value = "";
|
||||
|
||||
// Appending needs is performed and customized using function: beforeUpdate($new_data, $old_data, $id)
|
||||
}
|
||||
|
||||
$text .= $this->textarea($key, $value, vartrue($parms['rows'], 5), vartrue($parms['cols'], 40), vartrue($parms['__options'],$parms), varset($parms['counter'], false));
|
||||
@@ -3713,7 +3777,7 @@ class e_form
|
||||
$field = vartrue($options['field'], $options['pid']);
|
||||
$asc = strtoupper(vartrue($options['asc'], 'asc'));
|
||||
$elid = $fid;//$options['id'];
|
||||
$query = isset($options['query']) ? $options['query'] : e_QUERY ;
|
||||
$query = vartrue($options['query'],e_QUERY); // ? $options['query'] : ;
|
||||
if(vartrue($_GET['action']) == 'list')
|
||||
{
|
||||
$query = e_QUERY; //XXX Quick fix for loss of pagination after 'delete'.
|
||||
@@ -3724,6 +3788,8 @@ class e_form
|
||||
$current_fields = varset($options['fieldpref']) ? $options['fieldpref'] : array_keys($options['fields']);
|
||||
$legend_class = vartrue($options['legend_class'], 'e-hideme');
|
||||
|
||||
|
||||
|
||||
$text .= "
|
||||
<form method='post' action='{$formurl}' id='{$elid}-list-form'>
|
||||
<div>".$this->token()."
|
||||
@@ -3970,12 +4036,21 @@ class e_form
|
||||
}
|
||||
}
|
||||
|
||||
if(!is_array($att['writeParms']))
|
||||
{
|
||||
parse_str(varset($att['writeParms']), $writeParms);
|
||||
}
|
||||
else
|
||||
{
|
||||
$writeParms = $att['writeParms'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
if('hidden' === $att['type'])
|
||||
{
|
||||
if(!is_array($att['writeParms'])) parse_str(varset($att['writeParms']), $tmp);
|
||||
else $tmp = $att['writeParms'];
|
||||
|
||||
if(!vartrue($tmp['show']))
|
||||
if(!vartrue($writeParms['show']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -4025,12 +4100,13 @@ class e_form
|
||||
$leftCell = $required."<span{$required_class}>".defset(vartrue($att['title']), vartrue($att['title']))."</span>".$label;
|
||||
$rightCell = $this->renderElement($keyName, $model->getIfPosted($valPath), $att, varset($model_required[$key], array()), $model->getId())." {$help}";
|
||||
|
||||
if(vartrue($att['type']) == 'bbarea')
|
||||
if(vartrue($att['type']) == 'bbarea' || $writeParms['nolabel'] == true)
|
||||
{
|
||||
$text .= "
|
||||
<tr><td colspan='2'>
|
||||
<div style='padding-bottom:8px'>".$leftCell."</div>".
|
||||
$rightCell."
|
||||
<tr><td colspan='2'>";
|
||||
|
||||
$text .= "<div style='padding-bottom:8px'>".$leftCell."</div>";
|
||||
$text .= $rightCell."
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
@@ -243,7 +243,7 @@ class userlogin
|
||||
// Problem is that USERCLASS_LIST just contains 'guest' and 'everyone' at this point
|
||||
$class_list = $this->userMethods->addCommonClasses($this->userData, TRUE);
|
||||
|
||||
$user_logging_opts = array_flip(explode(',',varset($pref['user_audit_opts'],'')));
|
||||
$user_logging_opts = e107::getConfig()->get('user_audit_opts');
|
||||
if (isset($user_logging_opts[USER_AUDIT_LOGIN]) && in_array(varset($pref['user_audit_class'],''),$class_list))
|
||||
{ // Need to note in user audit trail
|
||||
$this->e107->admin_log->user_audit(USER_AUDIT_LOGIN,'', $user_id,$user_name);
|
||||
|
@@ -138,7 +138,7 @@ define('MAIL_LOG_PATH',e_LOG);
|
||||
class e107Email extends PHPMailer
|
||||
{
|
||||
private $general_opts = array();
|
||||
private $logEnable = 0; // 0 = log disabled, 1 = 'dry run' (debug and log, no send). 2 = 'log all' (send, and log result)
|
||||
private $logEnable = 2; // 0 = log disabled, 1 = 'dry run' (debug and log, no send). 2 = 'log all' (send, and log result)
|
||||
private $logHandle = FALSE; // Save handle of log file if opened
|
||||
|
||||
private $localUseVerp = FALSE; // Use our own variable - PHPMailer one doesn't work with all mailers
|
||||
@@ -156,7 +156,7 @@ class e107Email extends PHPMailer
|
||||
public $legacyBody = false; // TRUE enables legacy conversion of plain text body to HTML in HTML emails
|
||||
private $debug = false; // echos various debug info when set to true.
|
||||
private $pref = array(); // Store code prefs.
|
||||
|
||||
private $previewMode = false;
|
||||
/**
|
||||
* Constructor sets up all the global options, and sensible defaults - it should be the only place the prefs are accessed
|
||||
*
|
||||
@@ -196,7 +196,12 @@ class e107Email extends PHPMailer
|
||||
$this->allow_html = varset($pref['mail_sendstyle'],'textonly') == 'texthtml' ? true : 1;
|
||||
|
||||
if (varsettrue($pref['mail_options'])) $this->general_opts = explode(',',$pref['mail_options'],'');
|
||||
if ($this->debug) echo 'Mail_options: '.$pref['mail_options'].' Count: '.count($this->general_opts).'<br />';
|
||||
|
||||
if ($this->debug)
|
||||
{
|
||||
echo 'Mail_options: '.$pref['mail_options'].' Count: '.count($this->general_opts).'<br />';
|
||||
}
|
||||
|
||||
foreach ($this->general_opts as $k => $v)
|
||||
{
|
||||
$v = trim($v);
|
||||
@@ -520,7 +525,10 @@ class e107Email extends PHPMailer
|
||||
$message = str_replace("\r","\n",$message); // Handle alternative newline characters
|
||||
$message = str_replace("\n", "<br />\n", $message);
|
||||
}
|
||||
|
||||
|
||||
$this->MsgHTML($message); // Theoretically this should do everything, including handling of inline images.
|
||||
|
||||
}
|
||||
else
|
||||
{ // generate the plain text as the sole part of the email
|
||||
@@ -589,6 +597,64 @@ class e107Email extends PHPMailer
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Preview the BODY of an email
|
||||
* @param $eml - array.
|
||||
*/
|
||||
public function preview($eml)
|
||||
{
|
||||
$this->previewMode = true;
|
||||
|
||||
if (count($eml))
|
||||
{
|
||||
if($error = $this->arraySet($eml)) // Set parameters from list
|
||||
{
|
||||
return $error;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $this->Body;
|
||||
|
||||
}
|
||||
|
||||
|
||||
function processShortcodes($eml)
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
|
||||
$eml['shortcodes']['BODY'] = $tp->toEmail($eml['body']);
|
||||
$eml['shortcodes']['SUBJECT'] = $eml['subject'];
|
||||
$eml['shortcodes']['THEME'] = ($this->previewMode == true) ? e_THEME_ABS.$this->pref['sitetheme'].'/' : e_THEME.$this->pref['sitetheme'].'/'; // Always use front-end theme path.
|
||||
|
||||
|
||||
if(!empty($eml['media']) && is_array($eml['media']))
|
||||
{
|
||||
foreach($eml['media'] as $k=>$val)
|
||||
{
|
||||
if(vartrue($val['path']))
|
||||
{
|
||||
$id = 'MEDIA'.($k+1);
|
||||
|
||||
if($tp->isVideo($val['path']))
|
||||
{
|
||||
$eml['shortcodes'][$id] = "<div class='media media-video'>".$tp->toVideo($val['path'],array('thumb'=>'email'))."</div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$eml['shortcodes'][$id] = "<div class='media media-image'><img class='img-responsive' src='".$val['path']."' alt='' /></div>";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return $eml['shortcodes'];
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets one or more parameters from an array. See @see{sendEmail()} for list of parameters
|
||||
@@ -601,25 +667,36 @@ class e107Email extends PHPMailer
|
||||
*/
|
||||
public function arraySet($eml)
|
||||
{
|
||||
|
||||
|
||||
$tp = e107::getParser();
|
||||
|
||||
// Cleanup legacy key names. ie. remove 'email_' prefix.
|
||||
foreach($eml as $k=>$v)
|
||||
{
|
||||
if(substr($k,0,6) == 'email_')
|
||||
{
|
||||
$nkey = substr($k,6);
|
||||
$eml[$nkey] = $v;
|
||||
unset($eml[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(vartrue($eml['template'])) // @see e107_core/templates/email_template.php
|
||||
{
|
||||
|
||||
|
||||
if($tmpl = e107::getCoreTemplate('email', $eml['template'], 'front', true)) //FIXME - Core template is failing with template 'notify'. Works with theme template. Issue with core template registry?
|
||||
{
|
||||
$eml['shortcodes']['BODY'] = $eml['email_body'];
|
||||
$eml['shortcodes']['SUBJECT'] = $eml['email_subject'];
|
||||
$eml['shortcodes']['THEME'] = e_THEME.$this->pref['sitetheme'].'/'; // Always use front-end theme path.
|
||||
|
||||
$eml['shortcodes'] = $this->processShortcodes($eml);
|
||||
|
||||
// print_a($eml);
|
||||
|
||||
$emailBody = $tmpl['header']. $tmpl['body'] . $tmpl['footer'];
|
||||
|
||||
$eml['email_body'] = $tp->parseTemplate($emailBody, true, varset($eml['shortcodes'],null));
|
||||
$eml['body'] = $tp->parseTemplate($emailBody, true, $eml['shortcodes']);
|
||||
|
||||
// $eml['email_body'] = ($tp->toEmail($tmpl['header']). str_replace('{BODY}', $eml['email_body'], $tmpl['body']). $tp->toEmail($tmpl['footer']));
|
||||
// $eml['body'] = ($tp->toEmail($tmpl['header']). str_replace('{BODY}', $eml['body'], $tmpl['body']). $tp->toEmail($tmpl['footer']));
|
||||
|
||||
if($this->debug)
|
||||
{
|
||||
@@ -637,28 +714,32 @@ class e107Email extends PHPMailer
|
||||
{
|
||||
echo "<h4>Couldn't find email template: ".$eml['template']."</h4>";
|
||||
}
|
||||
if (vartrue($eml['email_subject'])) $this->Subject = $tp->parseTemplate($eml['email_subject'], true, varset($eml['shortcodes'],null));
|
||||
// $emailBody = $eml['body'];
|
||||
|
||||
if (vartrue($eml['subject'])) $this->Subject = $tp->parseTemplate($eml['subject'], true, varset($eml['shortcodes'],null));
|
||||
e107::getMessage()->addDebug("Couldn't find email template: ".$eml['template']);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (vartrue($eml['email_subject'])) $this->Subject = $tp->parseTemplate($eml['email_subject'], true, varset($eml['shortcodes'],null));
|
||||
if (vartrue($eml['subject'])) $this->Subject = $tp->parseTemplate($eml['subject'], true, varset($eml['shortcodes'],null));
|
||||
// $eml['body'] = ($tp->toEmail($tmpl['header']). str_replace('{BODY}', $eml['body'], $tmpl['body']). $tp->toEmail($tmpl['footer']));
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (isset($eml['SMTPDebug'])) $this->SMTPDebug = $eml['SMTPDebug']; // 'FALSE' is a valid value!
|
||||
|
||||
if (vartrue($eml['email_sender_email'])) $this->From = $eml['email_sender_email'];
|
||||
if (vartrue($eml['email_sender_name'])) $this->FromName = $eml['email_sender_name'];
|
||||
if (vartrue($eml['email_replyto'])) $this->AddAddressList('replyto',$eml['email_replyto'],vartrue($eml['email_replytonames'],''));
|
||||
if (vartrue($eml['sender_email'])) $this->From = $eml['sender_email'];
|
||||
if (vartrue($eml['sender_name'])) $this->FromName = $eml['sender_name'];
|
||||
if (vartrue($eml['replyto'])) $this->AddAddressList('replyto',$eml['replyto'],vartrue($eml['replytonames'],''));
|
||||
if (isset($eml['send_html'])) $this->allow_html = $eml['send_html']; // 'FALSE' is a valid value!
|
||||
if (isset($eml['add_html_header'])) $this->add_HTML_header = $eml['add_html_header']; // 'FALSE' is a valid value!
|
||||
if (vartrue($eml['email_body'])) $this->makeBody($eml['email_body'], $this->allow_html, $this->add_HTML_header);
|
||||
if (vartrue($eml['email_attach'])) $this->attach($eml['email_attach']);
|
||||
if (vartrue($eml['email_copy_to'])) $this->AddAddressList('cc',$eml['email_copy_to'],vartrue($eml['email_cc_names'],''));
|
||||
if (vartrue($eml['email_bcopy_to'])) $this->AddAddressList('bcc',$eml['email_bcopy_to'],vartrue($eml['email_bcc_names'],''));
|
||||
if (vartrue($eml['body'])) $this->makeBody($eml['body'], $this->allow_html, $this->add_HTML_header);
|
||||
if (vartrue($eml['attach'])) $this->attach($eml['attach']);
|
||||
if (vartrue($eml['copy_to'])) $this->AddAddressList('cc',$eml['copy_to'],vartrue($eml['cc_names'],''));
|
||||
if (vartrue($eml['bcopy_to'])) $this->AddAddressList('bcc',$eml['bcopy_to'],vartrue($eml['bcc_names'],''));
|
||||
|
||||
if (vartrue($eml['bouncepath']))
|
||||
{
|
||||
@@ -672,11 +753,12 @@ class e107Email extends PHPMailer
|
||||
print_a($eml);
|
||||
}
|
||||
|
||||
$identifier = deftrue('MAIL_IDENTIFIER', 'X-e107-id');
|
||||
|
||||
if (vartrue($eml['returnreceipt'])) $this->ConfirmReadingTo = $eml['returnreceipt'];
|
||||
if (vartrue($eml['email_inline_images'])) $this->addInlineImages($eml['email_inline_images']);
|
||||
if (vartrue($eml['email_priority'])) $this->Priority = $eml['email_priority'];
|
||||
if (vartrue($eml['e107_header'])) $this->AddCustomHeader("X-e107-id: {$eml['e107_header']}");
|
||||
if (vartrue($eml['inline_images'])) $this->addInlineImages($eml['inline_images']);
|
||||
if (vartrue($eml['priority'])) $this->Priority = $eml['priority'];
|
||||
if (vartrue($eml['e107_header'])) $this->AddCustomHeader($identifier.": {$eml['e107_header']}");
|
||||
if (vartrue($eml['extra_header']))
|
||||
{
|
||||
if (is_array($eml['extra_header']))
|
||||
@@ -695,6 +777,8 @@ class e107Email extends PHPMailer
|
||||
if (varset($eml['wordwrap'])) $this->WordWrap = $eml['wordwrap'];
|
||||
if (vartrue($eml['split'])) $this->SingleTo = ($eml['split'] != FALSE);
|
||||
|
||||
$this->logLine("ArraySet Data:".print_r($eml,true));
|
||||
|
||||
return 0; // No error
|
||||
}
|
||||
|
||||
@@ -706,29 +790,31 @@ class e107Email extends PHPMailer
|
||||
Where parameter not present in the array, doesn't get changed - useful for bulk mailing
|
||||
If doing bulk mailing with repetitive calls, set $bulkmail parameter true, and must call allSent() when completed
|
||||
Some of these parameters have been made compatible with the array calculated by render_email() in signup.php
|
||||
*
|
||||
Possible array parameters:
|
||||
$eml['email_subject']
|
||||
$eml['email_sender_email'] - 'From' email address
|
||||
$eml['email_sender_name'] - 'From' name
|
||||
$eml['email_replyto'] - Optional 'reply to' field
|
||||
$eml['email_replytonames'] - Name(s) corresponding to 'reply to' field - only used if 'replyto' used
|
||||
$eml['subject']
|
||||
$eml['sender_email'] - 'From' email address
|
||||
$eml['sender_name'] - 'From' name
|
||||
$eml['replyto'] - Optional 'reply to' field
|
||||
$eml['replytonames'] - Name(s) corresponding to 'reply to' field - only used if 'replyto' used
|
||||
$eml['send_html'] - if TRUE, includes HTML part in messages (only those added after this flag)
|
||||
$eml['add_html_header'] - if TRUE, adds the 2-line DOCTYPE declaration to the front of the HTML part (but doesn't add <head>...</head>)
|
||||
$eml['email_body'] - message body. May be HTML or text. Added according to the current state of the HTML enable flag
|
||||
$eml['email_attach'] - string if one file, array of filenames if one or more.
|
||||
$eml['email_copy_to'] - comma-separated list of cc addresses.
|
||||
$eml['email_cc_names'] - comma-separated list of cc names. Optional, used only if $eml['email_copy_to'] specified
|
||||
$eml['email_bcopy_to'] - comma-separated list
|
||||
$eml['email_bcc_names'] - comma-separated list of bcc names. Optional, used only if $eml['email_copy_to'] specified
|
||||
$eml['body'] - message body. May be HTML or text. Added according to the current state of the HTML enable flag
|
||||
$eml['attach'] - string if one file, array of filenames if one or more.
|
||||
$eml['copy_to'] - comma-separated list of cc addresses.
|
||||
$eml['cc_names'] - comma-separated list of cc names. Optional, used only if $eml['copy_to'] specified
|
||||
$eml['bcopy_to'] - comma-separated list
|
||||
$eml['bcc_names'] - comma-separated list of bcc names. Optional, used only if $eml['copy_to'] specified
|
||||
$eml['bouncepath'] - Sender field (used for bounces)
|
||||
$eml['returnreceipt'] - email address for notification of receipt (reading)
|
||||
$eml['email_inline_images'] - array of files for inline images
|
||||
$eml['inline_images'] - array of files for inline images
|
||||
$eml['priority'] - Email priority (1 = High, 3 = Normal, 5 = low)
|
||||
$eml['e107_header'] - Adds specific 'X-e107-id:' header
|
||||
$eml['extra_header'] - additional headers (format is name: value
|
||||
$eml['wordwrap'] - Set wordwrap value
|
||||
$eml['split'] - If true, sends an individual email to each recipient
|
||||
$eml['template'] - template to use. 'default'
|
||||
$eml['shortcodes'] - array of shortcode values. eg. array('MY_SHORTCODE'=>'12345');
|
||||
|
||||
* @param string $send_to - recipient email address
|
||||
* @param string $to_name - recipient name
|
||||
@@ -740,9 +826,12 @@ class e107Email extends PHPMailer
|
||||
public function sendEmail($send_to, $to_name, $eml = '', $bulkmail = FALSE)
|
||||
{
|
||||
if (count($eml))
|
||||
{ // Set parameters from list
|
||||
$ret = $this->arraySet($eml);
|
||||
if ($ret) return $ret;
|
||||
{
|
||||
if($error = $this->arraySet($eml)) // Set parameters from list
|
||||
{
|
||||
return $error;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ($bulkmail && $this->localUseVerp && $this->save_bouncepath && (strpos($this->save_bouncepath,'@') !== FALSE))
|
||||
@@ -764,8 +853,17 @@ class e107Email extends PHPMailer
|
||||
|
||||
if (($this->logEnable == 0) || ($this->logEnable == 2))
|
||||
{
|
||||
// prevent user/script details being exposed in X-PHP-Script header
|
||||
$oldphpself = $_SERVER['PHP_SELF'];
|
||||
$oldremoteaddr = $_SERVER['REMOTE_ADDR'];
|
||||
$_SERVER['PHP_SELF'] = "/";
|
||||
$_SERVER['REMOTE_ADDR'] = $_SERVER['SERVER_ADDR'];
|
||||
|
||||
$result = $this->Send(); // Actually send email
|
||||
|
||||
$_SERVER['PHP_SELF'] = $oldphpself;
|
||||
$_SERVER['REMOTE_ADDR'] = $oldremoteaddr;
|
||||
|
||||
if (!$bulkmail && !$this->SMTPKeepAlive && ($this->Mailer == 'smtp')) $this->SmtpClose();
|
||||
}
|
||||
else
|
||||
@@ -776,6 +874,7 @@ class e107Email extends PHPMailer
|
||||
}
|
||||
|
||||
$this->TotalSent++;
|
||||
|
||||
if (($this->pause_amount > 0) && ($this->SendCount >= $this->pause_amount))
|
||||
{
|
||||
if ($this->SMTPKeepAlive && ($this->Mailer == 'smtp')) $this->SmtpClose();
|
||||
@@ -785,6 +884,12 @@ class e107Email extends PHPMailer
|
||||
|
||||
$this->logLine("Send to {$to_name} at {$send_to} Mail-ID={$this->MessageID} - ".($result ? 'Success' : 'Fail'));
|
||||
|
||||
if(!$result)
|
||||
{
|
||||
$this->logLine(print_r($eml,true));
|
||||
}
|
||||
|
||||
|
||||
$this->ClearAddresses(); // In case we send another email
|
||||
$this->ClearCustomHeaders();
|
||||
|
||||
@@ -834,10 +939,10 @@ class e107Email extends PHPMailer
|
||||
*/
|
||||
public function MsgHTML($message, $basedir = '')
|
||||
{
|
||||
|
||||
$tp = e107::getParser();
|
||||
|
||||
preg_match_all("/(src|background)=([\"\'])(.*)\\2/Ui", $message, $images); // Modified to accept single quotes as well
|
||||
if(isset($images[3]))
|
||||
if(isset($images[3]) && ($this->previewMode === false))
|
||||
{
|
||||
|
||||
if($this->debug)
|
||||
@@ -846,10 +951,12 @@ class e107Email extends PHPMailer
|
||||
print_a($images[3]);
|
||||
}
|
||||
|
||||
$tp = e107::getParser();
|
||||
|
||||
foreach($images[3] as $i => $url)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
// do not change urls for absolute images (thanks to corvuscorax)
|
||||
if (!preg_match('#^[A-z]+://#',$url))
|
||||
{
|
||||
@@ -902,6 +1009,11 @@ class e107Email extends PHPMailer
|
||||
}
|
||||
}
|
||||
|
||||
if($this->previewMode === true)
|
||||
{
|
||||
$message = $tp->replaceConstants($message, 'abs');
|
||||
}
|
||||
|
||||
|
||||
$this->IsHTML(true);
|
||||
$this->Body = $message;
|
||||
@@ -1009,7 +1121,9 @@ function sendemail($send_to, $subject, $message, $to_name='', $send_from='', $fr
|
||||
// Create a mailer object of the correct type (which auto-fills in sending method, server details)
|
||||
$mail = new e107Email($overrides);
|
||||
|
||||
if (varsettrue($mailheader_e107id)) $mail->AddCustomHeader("X-e107-id: {$mailheader_e107id}");
|
||||
$identifier = deftrue('MAIL_IDENTIFIER', 'X-e107-id');
|
||||
|
||||
if (varsettrue($mailheader_e107id)) $mail->AddCustomHeader($identifier.": {$mailheader_e107id}");
|
||||
|
||||
$mail->legacyBody = TRUE; // Need to handle plain text email conversion to HTML
|
||||
$mail->makeBody($message); // Add body, with conversion if required
|
||||
|
@@ -123,7 +123,7 @@ class e107MailManager
|
||||
const E107_EMAIL_MAX_TRIES = 3; // Maximum number of tries by us (mail server may do more)
|
||||
// - max allowable value is MAIL_STATUS_MAX_ACTIVE - MAIL_STATUS_PENDING
|
||||
|
||||
private $debugMode = 0;
|
||||
private $debugMode = 1;
|
||||
protected $e107;
|
||||
protected $db = NULL; // Use our own database object - this one for reading data
|
||||
protected $db2 = NULL; // Use our own database object - this one for updates
|
||||
@@ -262,8 +262,8 @@ class e107MailManager
|
||||
$res[$f] = '';
|
||||
}
|
||||
}
|
||||
$array = new ArrayData;
|
||||
$res['mail_other'] = $array->WriteArray($res1, TRUE); // Ready to write to DB
|
||||
|
||||
$res['mail_other'] = e107::serialize($res1,false); // Ready to write to DB
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -296,8 +296,8 @@ class e107MailManager
|
||||
}
|
||||
if (isset($data['mail_other']))
|
||||
{
|
||||
$array = new ArrayData;
|
||||
$tmp = $array->ReadArray(str_replace('\\\'', '\'',$data['mail_other'])); // May have escaped data
|
||||
|
||||
$tmp = e107::unserialize(str_replace('\\\'', '\'',$data['mail_other'])); // May have escaped data
|
||||
if (is_array($tmp))
|
||||
{
|
||||
$res = array_merge($res,$tmp);
|
||||
@@ -315,6 +315,12 @@ class e107MailManager
|
||||
$res[$f] = '';
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($data['mail_media']))
|
||||
{
|
||||
$res['mail_media'] = e107::unserialize($data['mail_media']);
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -348,8 +354,7 @@ class e107MailManager
|
||||
}
|
||||
if (isset($data['mail_target_info']) && is_array($data['mail_target_info']))
|
||||
{
|
||||
$array = new ArrayData;
|
||||
$tmp = $array->WriteArray($data['mail_target_info'], TRUE);
|
||||
$tmp = e107::serialize($data['mail_target_info'], TRUE);
|
||||
$res['mail_target_info'] = $tmp;
|
||||
}
|
||||
return $res;
|
||||
@@ -423,10 +428,9 @@ class e107MailManager
|
||||
}
|
||||
|
||||
// Now array fields
|
||||
$array = new ArrayData;
|
||||
if (isset($data['mail_other']))
|
||||
{
|
||||
$tmp = $array->ReadArray(str_replace('\\\'', '\'',$data['mail_other'])); // May have escaped data
|
||||
$tmp = e107::unserialize(str_replace('\\\'', '\'',$data['mail_other'])); // May have escaped data
|
||||
if (is_array($tmp))
|
||||
{
|
||||
$res = array_merge($res,$tmp);
|
||||
@@ -442,9 +446,15 @@ class e107MailManager
|
||||
}
|
||||
if (isset($data['mail_target_info']))
|
||||
{
|
||||
$tmp = $array->ReadArray(str_replace('\\\'', '\'',$data['mail_target_info'])); // May have escaped data
|
||||
$tmp = e107::unserialize(str_replace('\\\'', '\'',$data['mail_target_info'])); // May have escaped data
|
||||
$res['mail_target_info'] = $tmp;
|
||||
}
|
||||
|
||||
if (isset($data['mail_media']))
|
||||
{
|
||||
$res['mail_media'] = e107::unserialize($data['mail_media']);
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -571,7 +581,8 @@ class e107MailManager
|
||||
AND (ms.`mail_last_date` >= ".time()." OR ms.`mail_last_date`=0)
|
||||
ORDER BY ms.`mail_e107_priority` DESC {$count}";
|
||||
// echo $query.'<br />';
|
||||
$result = $this->db->db_Select_gen($query);
|
||||
$result = $this->db->gen($query);
|
||||
|
||||
if ($result !== FALSE)
|
||||
{
|
||||
$this->queryActive = $result; // Note number of emails to go
|
||||
@@ -756,9 +767,9 @@ class e107MailManager
|
||||
|
||||
if ($email['mail_notify_complete'] & 1)
|
||||
{ // Notify email initiator
|
||||
if ($this->db2->db_Select('user', 'user_name, user_email', '`user_id`='.intval($email['mail_creator'])))
|
||||
if ($this->db2->select('user', 'user_name, user_email', '`user_id`='.intval($email['mail_creator'])))
|
||||
{
|
||||
$row = $this->db2->db_Fetch(MYSQL_ASSOC);
|
||||
$row = $this->db2->fetch(MYSQL_ASSOC);
|
||||
require_once(e_HANDLER.'mail.php');
|
||||
$mailer = new e107Email();
|
||||
$mailer->sendEmail($row['user_name'], $row['user_email'], $message,FALSE);
|
||||
@@ -767,6 +778,7 @@ class e107MailManager
|
||||
if ($email['mail_notify_complete'] & 2)
|
||||
{ // Do e107 notify
|
||||
require_once(e_HANDLER."notify_class.php");
|
||||
|
||||
notify_maildone($message);
|
||||
}
|
||||
e107::getEvent()->trigger('maildone', $email);
|
||||
@@ -799,8 +811,8 @@ class e107MailManager
|
||||
//'extra_header' - additional headers (format is name: value
|
||||
//'wordwrap' - Set wordwrap value
|
||||
//'split' - If true, sends an individual email to each recipient
|
||||
'template' => 'template', // required
|
||||
'shortcodes' => 'shortcodes' // required
|
||||
'template' => 'mail_send_style', // required
|
||||
'shortcodes' => 'mail_target_info' // required
|
||||
);
|
||||
$result = array();
|
||||
if (!isset($email['mail_source_id'])) $email['mail_source_id'] = 0;
|
||||
@@ -838,22 +850,42 @@ class e107MailManager
|
||||
$temp = intval($email['mail_recipient_id']).'/'.intval($email['mail_source_id']).'/'.intval($email['mail_target_id']).'/';
|
||||
$result['e107_header'] = $temp.md5($temp); // Set up an ID
|
||||
}
|
||||
|
||||
if (isset($email['mail_attach']) && (trim($email['mail_attach']) || is_array($email['mail_attach'])))
|
||||
{
|
||||
$downDir = realpath(e_ROOT.$this->e107->getFolder('downloads'));
|
||||
$tp = e107::getParser();
|
||||
|
||||
if (is_array($email['mail_attach']))
|
||||
{
|
||||
foreach ($email['mail_attach'] as $k => $v)
|
||||
{
|
||||
$result['email_attach'][$k] = $downDir.$v;
|
||||
$result['email_attach'][$k] = $tp->replaceConstants($v);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$result['email_attach'] = $downDir.trim($email['mail_attach']);
|
||||
$result['email_attach'] = $tp->replaceConstants(trim($email['mail_attach']));
|
||||
}
|
||||
}
|
||||
if (isset($email['mail_overrides']) && is_array($email['mail_overrides'])) $result = array_merge($result, $email['mail_overrides']);
|
||||
|
||||
if (isset($email['mail_overrides']) && is_array($email['mail_overrides']))
|
||||
{
|
||||
$result = array_merge($result, $email['mail_overrides']);
|
||||
}
|
||||
|
||||
$title = "<h4>".__METHOD__." Line: ".__LINE__."</h4>";
|
||||
e107::getAdminLog()->addDebug($title.print_a($email,true),true);
|
||||
|
||||
if(!empty($email['mail_media']))
|
||||
{
|
||||
$result['media'] = $email['mail_media'];
|
||||
}
|
||||
|
||||
$title2 = "<h4>".__METHOD__." Line: ".__LINE__."</h4>";
|
||||
e107::getAdminLog()->addDebug($title2.print_a($result,true),true);
|
||||
|
||||
$result['shortcodes']['MAILREF'] = $email['mail_source_id'];
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -879,6 +911,10 @@ class e107MailManager
|
||||
$this->mailer->allSent(); // Tidy up on completion
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
e107::getAdminLog()->addDebug("Couldn't select emails", true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -896,20 +932,20 @@ class e107MailManager
|
||||
$this->checkDB(2); // Make sure we have a DB object to use
|
||||
|
||||
$dbData = $this->mailToDB($emailData, FALSE); // Convert array formats
|
||||
// print_a($dbData);
|
||||
// print_a($dbData);
|
||||
|
||||
if ($isNew)
|
||||
|
||||
if ($isNew === true)
|
||||
{
|
||||
unset($dbData['mail_source_id']); // Just in case - there are circumstances where might be set
|
||||
$result = $this->db2->db_Insert('mail_content', array('data' => $dbData,
|
||||
'_FIELD_TYPES' => $this->dbTypes['mail_content'],
|
||||
'_NOTNULL' => $this->dbNull['mail_content']));
|
||||
$result = $this->db2->insert('mail_content', array('data' => $dbData,
|
||||
'_FIELD_TYPES' => $this->dbTypes['mail_content'], '_NOTNULL' => $this->dbNull['mail_content']));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($dbData['mail_source_id']))
|
||||
{
|
||||
$result = $this->db2->db_Update('mail_content', array('data' => $dbData,
|
||||
$result = $this->db2->update('mail_content', array('data' => $dbData,
|
||||
'_FIELD_TYPES' => $this->dbTypes['mail_content'],
|
||||
'WHERE' => '`mail_source_id` = '.intval($dbData['mail_source_id'])));
|
||||
if ($result !== FALSE) { $result = $dbData['mail_source_id']; }
|
||||
@@ -938,11 +974,11 @@ class e107MailManager
|
||||
return FALSE;
|
||||
}
|
||||
$this->checkDB(2); // Make sure we have a DB object to use
|
||||
if ($this->db2->db_Select('mail_content', '*', '`mail_source_id`='.$mailID) === FALSE)
|
||||
if ($this->db2->select('mail_content', '*', '`mail_source_id`='.$mailID) === FALSE)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
$mailData = $this->db2->db_Fetch(MYSQL_ASSOC);
|
||||
$mailData = $this->db2->fetch();
|
||||
return $this->dbToMail($mailData, $addMissing); // Convert to 'flat array' format
|
||||
}
|
||||
|
||||
@@ -959,20 +995,23 @@ class e107MailManager
|
||||
$result = array();
|
||||
if ($actions == 'all') $actions = 'content,recipients';
|
||||
$actArray = explode(',', $actions);
|
||||
|
||||
if (!is_numeric($mailID) || ($mailID == 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
$this->checkDB(2); // Make sure we have a DB object to use
|
||||
|
||||
if (isset($actArray['content']))
|
||||
{
|
||||
$result['content'] = $this->db2->db_Delete('mail_content', '`mail_source_id`='.$mailID);
|
||||
$result['content'] = $this->db2->delete('mail_content', '`mail_source_id`='.$mailID);
|
||||
}
|
||||
if (isset($actArray['recipients']))
|
||||
{
|
||||
$result['recipients'] = $this->db2->db_Delete('mail_recipients', '`mail_detail_id`='.$mailID);
|
||||
$result['recipients'] = $this->db2->delete('mail_recipients', '`mail_detail_id`='.$mailID);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -1041,6 +1080,11 @@ class e107MailManager
|
||||
if (($handle <= 0) || !is_numeric($handle)) return FALSE;
|
||||
if (!isset($this->mailCounters[$handle])) return 'nocounter';
|
||||
$this->checkDB(2); // Make sure DB object created
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$query = '`mail_togo_count`='.intval($this->mailCounters[$handle]['add']).' WHERE `mail_source_id`='.$handle;
|
||||
if ($this->db2->db_Update('mail_content', $query))
|
||||
{
|
||||
@@ -1050,6 +1094,22 @@ class e107MailManager
|
||||
}
|
||||
|
||||
|
||||
public function updateCounter($id, $type, $count)
|
||||
{
|
||||
if(empty($id) || empty($type))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$update = array(
|
||||
'mail_'.$type.'_count' => intval($count),
|
||||
'WHERE' => "mail_source_id=".intval($id)
|
||||
);
|
||||
|
||||
return e107::getDb('mail')->update('mail_content', $update) ? $count : false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve the counters for a mail record
|
||||
@@ -1108,15 +1168,17 @@ class e107MailManager
|
||||
$query .= '`mail_notify_complete`='.intval($notify).', `mail_content_status` = '.($hold ? MAIL_STATUS_HELD : MAIL_STATUS_PENDING).$lt.' WHERE `mail_source_id` = '.intval($handle);
|
||||
// echo "Update mail body: {$query}<br />";
|
||||
// Set status of email body first
|
||||
if (!$this->db->db_Update('mail_content',$query))
|
||||
|
||||
if (!$this->db->update('mail_content',$query))
|
||||
{
|
||||
$this->e107->admin_log->e_log_event(10,-1,'MAIL','Activate/hold mail','mail_content: '.$query.'[!br!]Fail: '.$this->db->mySQLlastErrText,FALSE,LOG_TO_ROLLING);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Now set status of individual emails
|
||||
$query = '`mail_status` = '.($hold ? MAIL_STATUS_HELD : (MAIL_STATUS_PENDING + e107MailManager::E107_EMAIL_MAX_TRIES)).$ft.' WHERE `mail_detail_id` = '.intval($handle);
|
||||
// echo "Update individual emails: {$query}<br />";
|
||||
if (FALSE === $this->db->db_Update('mail_recipients',$query))
|
||||
if (FALSE === $this->db->update('mail_recipients',$query))
|
||||
{
|
||||
$this->e107->admin_log->e_log_event(10,-1,'MAIL','Activate/hold mail','mail_recipient: '.$query.'[!br!]Fail: '.$this->db->mySQLlastErrText,FALSE,LOG_TO_ROLLING);
|
||||
return FALSE;
|
||||
@@ -1135,12 +1197,12 @@ class e107MailManager
|
||||
if (($handle <= 0) || !is_numeric($handle)) return FALSE;
|
||||
$this->checkDB(1); // Make sure DB object created
|
||||
// Set status of individual emails first, so we can get a count
|
||||
if (FALSE === ($count = $this->db->db_Update('mail_recipients','`mail_status` = '.MAIL_STATUS_CANCELLED.' WHERE `mail_detail_id` = '.intval($handle).' AND `mail_status` >'.MAIL_STATUS_FAILED)))
|
||||
if (FALSE === ($count = $this->db->update('mail_recipients','`mail_status` = '.MAIL_STATUS_CANCELLED.' WHERE `mail_detail_id` = '.intval($handle).' AND `mail_status` >'.MAIL_STATUS_FAILED)))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
// Now do status of email body - no emails to go, add those not sent to fail count
|
||||
if (!$this->db->db_Update('mail_content','`mail_content_status` = '.MAIL_STATUS_PARTIAL.', `mail_togo_count`=0, `mail_fail_count` = `mail_fail_count` + '.intval($count).' WHERE `mail_source_id` = '.intval($handle)))
|
||||
if (!$this->db->update('mail_content','`mail_content_status` = '.MAIL_STATUS_PARTIAL.', `mail_togo_count`=0, `mail_fail_count` = `mail_fail_count` + '.intval($count).' WHERE `mail_source_id` = '.intval($handle)))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1158,13 +1220,13 @@ class e107MailManager
|
||||
if (($handle <= 0) || !is_numeric($handle)) return FALSE;
|
||||
$this->checkDB(1); // Make sure DB object created
|
||||
// Set status of individual emails first, so we can get a count
|
||||
if (FALSE === ($count = $this->db->db_Update('mail_recipients','`mail_status` = '.MAIL_STATUS_HELD.' WHERE `mail_detail_id` = '.intval($handle).' AND `mail_status` >'.MAIL_STATUS_FAILED)))
|
||||
if (FALSE === ($count = $this->db->update('mail_recipients','`mail_status` = '.MAIL_STATUS_HELD.' WHERE `mail_detail_id` = '.intval($handle).' AND `mail_status` >'.MAIL_STATUS_FAILED)))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
if ($count == 0) return TRUE; // If zero count, must have held email just as queue being emptied, so don't touch main status
|
||||
|
||||
if (!$this->db->db_Update('mail_content','`mail_content_status` = '.MAIL_STATUS_HELD.' WHERE `mail_source_id` = '.intval($handle)))
|
||||
if (!$this->db->update('mail_content','`mail_content_status` = '.MAIL_STATUS_HELD.' WHERE `mail_source_id` = '.intval($handle)))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1180,83 +1242,165 @@ class e107MailManager
|
||||
*/
|
||||
public function markBounce($bounceString, $emailAddress = '')
|
||||
{
|
||||
$bounceInfo = array('mail_bounce_string' => $bounceString, 'mail_recipient_email' => $emailAddress); // Ready for event data
|
||||
$errors = array(); // Log all errors, at least until proven
|
||||
$vals = explode('/',$bounceString); // Should get one or four fields
|
||||
|
||||
$bounceString = trim($bounceString);
|
||||
|
||||
$bounceInfo = array('mail_bounce_string' => $bounceString, 'mail_recipient_email' => $emailAddress); // Ready for event data
|
||||
$errors = array(); // Log all errors, at least until proven
|
||||
$vals = explode('/', $bounceString); // Should get one or four fields
|
||||
|
||||
// echo "<h4>Bounce String</h4>";
|
||||
// print_a($bounceString);
|
||||
// echo "<h4>Vals</h4>";
|
||||
// print_a($vals);
|
||||
|
||||
if (!is_numeric($vals[0])) // Email recipient user id number (may be zero)
|
||||
{
|
||||
$errors[] = 'Bad user ID: '.$vals[0];
|
||||
}
|
||||
|
||||
$uid = intval($vals[0]); // User ID (zero is valid)
|
||||
if (count($vals) == 4)
|
||||
|
||||
if (count($vals) == 4) // Admin->Mailout format.
|
||||
{
|
||||
if (md5($vals[0].'/'.$vals[1].'/'.$vals[2].'/') != $vals[3])
|
||||
{ // 'Extended' ID has md5 validation
|
||||
$errors[] = 'Bad md5';
|
||||
}
|
||||
|
||||
if (!is_numeric($vals[1])) // Email body record number
|
||||
{
|
||||
$errors[] = 'Bad body record: '.$vals[1];
|
||||
}
|
||||
|
||||
if (!is_numeric($vals[2])) // Email recipient table record number
|
||||
{
|
||||
$errors[] = 'Bad recipient record: '.$vals[2];
|
||||
}
|
||||
|
||||
$vals[0] = intval($vals[0]);
|
||||
$vals[1] = intval($vals[1]);
|
||||
$vals[2] = intval($vals[2]);
|
||||
if (count($errors) == 0)
|
||||
{ // Look up in mailer DB if no errors so far
|
||||
$this->checkDB(1);
|
||||
if (FALSE === ($this->db->db_Select_gen(
|
||||
"SELECT mr.`mail_recipient_id`, mr.`mail_recipient_email`, mr.`mail_recipient_name` FROM `#mail_recipients` AS mr
|
||||
LEFT JOIN `#mail_content` as mc ON mr.`mail_detail_id` = mc.`mail_source_id`
|
||||
$vals[3] = trim($vals[3]);
|
||||
|
||||
|
||||
$hash = ($vals[0].'/'.$vals[1].'/'.$vals[2].'/');
|
||||
|
||||
if (md5($hash) != $vals[3]) // 'Extended' ID has md5 validation
|
||||
{
|
||||
$errors[] = 'Bad md5';
|
||||
$errors[] = print_r($vals,true);
|
||||
$errors[] = 'hash:'.md5($hash);
|
||||
}
|
||||
|
||||
if (empty($errors))
|
||||
{
|
||||
$this->checkDB(1); // Look up in mailer DB if no errors so far
|
||||
|
||||
if (false === ($this->db->gen(
|
||||
"SELECT mr.`mail_recipient_id`, mr.`mail_recipient_email`, mr.`mail_recipient_name`, mr.mail_target_info,
|
||||
mc.mail_create_date, mc.mail_start_send, mc.mail_end_send, mc.`mail_title`, mc.`mail_subject`, mc.`mail_creator`, mc.`mail_other` FROM `#mail_recipients` AS mr
|
||||
LEFT JOIN `#mail_content` as mc ON mr.`mail_detail_id` = mc.`mail_source_id`
|
||||
WHERE mr.`mail_target_id` = {$vals[2]} AND mc.`mail_source_id` = {$vals[1]}")))
|
||||
{ // Invalid mailer record
|
||||
$errors[] = 'Not found in DB: '.$vals[1].'/'.$vals[2];
|
||||
}
|
||||
$row = $this->db->db_Fetch(MYSQL_ASSOC);
|
||||
if ($emailAddress && ($emailAddress != $row['mail_recipient_email']))
|
||||
{ // Email address mismatch
|
||||
|
||||
$row = $this->db->fetch(MYSQL_ASSOC);
|
||||
|
||||
$row = $this->dbToBoth($row);
|
||||
|
||||
$bounceInfo = $row;
|
||||
|
||||
if ($emailAddress && ($emailAddress != $row['mail_recipient_email'])) // Email address mismatch
|
||||
{
|
||||
$errors[] = 'Email address mismatch: '.$emailAddress.'/'.$row['mail_recipient_email'];
|
||||
}
|
||||
if ($uid != $row['mail_recipient_id'])
|
||||
{ // User ID mismatch
|
||||
|
||||
if ($uid != $row['mail_recipient_id']) // User ID mismatch
|
||||
{
|
||||
$errors[] = 'User ID mismatch: '.$uid.'/'.$row['mail_recipient_id'];
|
||||
}
|
||||
if (count($errors) == 0)
|
||||
{ // All passed - can update mailout databases
|
||||
$this->db->db_Update('mail_content', '`mail_bounce_count` = `mail_bounce_count` + 1 WHERE `mail_source_id` = '.$vals[1]);
|
||||
$this->db->db_Update('mail_recipients', '`mail_status` = '.MAIL_STATUS_BOUNCED.' WHERE `mail_target_id` = '.$vals[2]);
|
||||
$bounceInfo['mail_source_id'] = $vals[1];
|
||||
$bounceInfo['mail_target_id'] = $vals[2];
|
||||
$bounceInfo['mail_recipient_id'] = $uid;
|
||||
$bounceInfo['mail_recipient_name'] = $row['mail_recipient_name'];
|
||||
|
||||
if (count($errors) == 0) // All passed - can update mailout databases
|
||||
{
|
||||
$bounceInfo['mail_source_id'] = $vals[1];
|
||||
$bounceInfo['mail_target_id'] = $vals[2];
|
||||
$bounceInfo['mail_recipient_id'] = $uid;
|
||||
$bounceInfo['mail_recipient_name'] = $row['mail_recipient_name'];
|
||||
|
||||
|
||||
if(!$this->db->update('mail_content', '`mail_bounce_count` = `mail_bounce_count` + 1 WHERE `mail_source_id` = '.$vals[1]))
|
||||
{
|
||||
e107::getAdminLog()->add('Unable to increment bounce-count on mail_source_id='.$vals[1],$bounceInfo, E_LOG_FATAL, 'BOUNCE',LOG_TO_ROLLING);
|
||||
}
|
||||
|
||||
|
||||
if(!$this->db->update('mail_recipients', '`mail_status` = '.MAIL_STATUS_BOUNCED.' WHERE `mail_target_id` = '.$vals[2]))
|
||||
{
|
||||
e107::getAdminLog()->add('Unable to update recipient mail_status to bounce on mail_target_id = '.$vals[2],$bounceInfo, E_LOG_FATAL, 'BOUNCE',LOG_TO_ROLLING);
|
||||
}
|
||||
|
||||
$addons = array_keys($row['mail_selectors']); // trigger e_mailout.php addons. 'bounce' method.
|
||||
foreach($addons as $plug)
|
||||
{
|
||||
if($plug == 'core')
|
||||
{
|
||||
require_once(e_HANDLER.'user_handler.php');
|
||||
if($err = userHandler::userStatusUpdate('bounce', $uid, $emailAddress));
|
||||
{
|
||||
$errors[] = $err;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if($cls = e107::getAddon($plug,'e_mailout'))
|
||||
{
|
||||
if(e107::callMethod($cls, 'bounce', $bounceInfo)===false)
|
||||
{
|
||||
e107::getAdminLog()->add($plug.' bounce process failed',$bounceInfo, E_LOG_FATAL, 'BOUNCE',LOG_TO_ROLLING);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// echo e107::getMessage()->render();
|
||||
// print_a($bounceInfo);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if ((count($vals) != 1) && (count($vals) != 4))
|
||||
elseif ((count($vals) != 1) && (count($vals) != 4)) // invalid e107-id header.
|
||||
{
|
||||
$errors[] = 'Bad element count: '.count($vals);
|
||||
}
|
||||
elseif ($uid || $emailAddress)
|
||||
{ // Now log the bounce against the user (user handler will do any required logging)
|
||||
elseif ($uid || $emailAddress) // Not using admin->mailout, so just update the user table for user_id = $uid;
|
||||
{
|
||||
require_once(e_HANDLER.'user_handler.php');
|
||||
$result = userHandler::userStatusUpdate('bounce', $uid, $emailAddress);
|
||||
if ($result) // Returns FALSE if update successful
|
||||
|
||||
if($err = userHandler::userStatusUpdate('bounce', $uid, $emailAddress))
|
||||
{
|
||||
$errors[] = $result;
|
||||
$errors[] = $err;
|
||||
}
|
||||
}
|
||||
if (count($errors))
|
||||
|
||||
if (!empty($errors))
|
||||
{
|
||||
$logString = $bounceString.' ('.$emailAddress.')[!br!]'.implode('[!br!]',$errors);
|
||||
$this->e107->admin_log->e_log_event(10,-1,'BOUNCE','Bounce receive error',$logString,FALSE,LOG_TO_ROLLING);
|
||||
return FALSE;
|
||||
$logString = $bounceString.' ('.$emailAddress.')[!br!]'.implode('[!br!]',$errors).implode('[!br!]',$bounceInfo);
|
||||
// e107::getAdminLog()->e_log_event(10,-1,'BOUNCE','Bounce receive error',$logString, FALSE,LOG_TO_ROLLING);
|
||||
e107::getAdminLog()->add('Bounce receive error',$logString, E_LOG_WARNING, 'BOUNCE', LOG_TO_ROLLING);
|
||||
return $errors;
|
||||
}
|
||||
$this->e107->admin_log->e_log_event(10,-1,'BOUNCE','Bounce received/logged',$bounceString.' ('.$emailAddress.')',FALSE,LOG_TO_ROLLING);
|
||||
else
|
||||
{
|
||||
// e107::getAdminLog()->e_log_event(10,-1,'BOUNCE','Bounce received/logged',$bounceInfo, FALSE,LOG_TO_ROLLING);
|
||||
e107::getAdminLog()->add('Bounce received/logged',$bounceInfo, E_LOG_INFORMATIVE, 'BOUNCE',LOG_TO_ROLLING);
|
||||
}
|
||||
|
||||
|
||||
e107::getEvent()->trigger('mailbounce', $bounceInfo);
|
||||
return TRUE;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1483,30 +1627,47 @@ class e107MailManager
|
||||
|
||||
public function sendEmails($templateName, $emailData, $recipientData, $extra = FALSE)
|
||||
{
|
||||
if (!is_array($emailData)) return FALSE;
|
||||
$log = e107::getAdminLog();
|
||||
$log->addDebug(print_a($emailData, true),true);
|
||||
$log->addDebug(print_a($recipientData, true),true);
|
||||
$log->toFile('mail_manager','Main Manager Log',true);
|
||||
|
||||
|
||||
if (!is_array($emailData))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!is_array($recipientData))
|
||||
{
|
||||
$recipientData = array('mail_recipient_email' => $recipientData, 'mail_recipient_name' => $recipientData);
|
||||
}
|
||||
|
||||
$emailData['mail_content_status'] = MAIL_STATUS_TEMP;
|
||||
|
||||
if ($templateName == '')
|
||||
{
|
||||
$templateName = varset($email['mail_send_style'], 'textonly'); // Safest default if nothing specified
|
||||
$templateName = varset($emailData['mail_send_style'], 'textonly'); // Safest default if nothing specified
|
||||
}
|
||||
|
||||
|
||||
$templateName = trim($templateName);
|
||||
if ($templateName == '') return FALSE;
|
||||
|
||||
|
||||
// Get template data, override email settings as appropriate
|
||||
require_once(e_HANDLER.'mail_template_class.php');
|
||||
$ourTemplate = new e107MailTemplate();
|
||||
if (!$ourTemplate->setNewTemplate($templateName) && empty($emailData['template'])) return FALSE; // Probably template not found if error
|
||||
if (!$ourTemplate->makeEmailBody($emailData['mail_body'], varset($emailData['mail_include_images'], TRUE))) return FALSE; // Create body text
|
||||
$emailData['mail_body_templated'] = $ourTemplate->mainBodyText;
|
||||
$this->currentMailBody = $emailData['mail_body_templated']; // In case we send immediately
|
||||
$emailData['mail_body_alt'] = $ourTemplate->altBodyText;
|
||||
$this->currentTextBody = $emailData['mail_body_alt'];
|
||||
// require_once(e_HANDLER.'mail_template_class.php');
|
||||
// $ourTemplate = new e107MailTemplate();
|
||||
// if (!$ourTemplate->setNewTemplate($templateName) && empty($emailData['template'])) return FALSE; // Probably template not found if error
|
||||
// if (!$ourTemplate->makeEmailBody($emailData['mail_body'], varset($emailData['mail_include_images'], TRUE))) return FALSE; // Create body text
|
||||
|
||||
|
||||
|
||||
// $emailData['mail_body_templated'] = $ourTemplate->mainBodyText;
|
||||
$this->currentMailBody = $emailData['mail_body']; // In case we send immediately
|
||||
// $emailData['mail_body_alt'] = $ourTemplate->altBodyText;
|
||||
$this->currentTextBody = strip_tags($emailData['mail_body']);
|
||||
|
||||
if (!isset($emailData['mail_overrides']))
|
||||
{
|
||||
$emailData['mail_overrides'] = $ourTemplate->lastTemplateData['email_overrides'];
|
||||
@@ -1524,7 +1685,11 @@ class e107MailManager
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$forceQueue = FALSE;
|
||||
|
||||
|
||||
if (is_array($extra) && isset($extra['mail_force_queue']))
|
||||
{
|
||||
$forceQueue = $extra['mail_force_queue'];
|
||||
@@ -1533,6 +1698,8 @@ class e107MailManager
|
||||
|
||||
if($this->debugMode)
|
||||
{
|
||||
|
||||
echo "<h4>".__CLASS__." :: ".__METHOD__." - Line ".__LINE__."</h4>";
|
||||
print_a($emailData);
|
||||
print_a($recipientData);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -113,11 +113,10 @@ class core_mailout
|
||||
|
||||
$where = array();
|
||||
$incExtended = array();
|
||||
if ($selectVals === FALSE)
|
||||
{
|
||||
$selectVals = array('email_to' => 'all');
|
||||
}
|
||||
switch (varset($selectVals['email_to'], 'all'))
|
||||
|
||||
$emailTo = vartrue($selectVals['email_to'], false);
|
||||
|
||||
switch ($emailTo)
|
||||
{
|
||||
// Build the query for the user database
|
||||
case 'all' :
|
||||
@@ -137,7 +136,7 @@ class core_mailout
|
||||
{
|
||||
$where[] = "u.`user_class` REGEXP concat('(^|,)',{$selectVals['email_to']},'(,|$)')";
|
||||
}
|
||||
$where[] = "u.`user_ban`=0";
|
||||
|
||||
}
|
||||
|
||||
if (vartrue($selectVals['extended_1_name']) && vartrue($selectVals['extended_1_value']))
|
||||
@@ -183,8 +182,19 @@ class core_mailout
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($where) && empty($incExtended))
|
||||
{
|
||||
$this->mail_read = 0;
|
||||
$this->mail_count = 0;
|
||||
return $this->mail_count;
|
||||
}
|
||||
|
||||
|
||||
$where[] = "u.`user_email` != ''"; // Ignore all records with empty email address
|
||||
|
||||
|
||||
|
||||
// Now assemble the query from the pieces
|
||||
// Determine which fields we actually need (u.user_sess is the signup link)
|
||||
$qry = 'SELECT u.user_id, u.user_name, u.user_email, u.user_loginname, u.user_sess, u.user_lastvisit';
|
||||
@@ -203,6 +213,9 @@ class core_mailout
|
||||
|
||||
$qry .= ' WHERE '.implode(' AND ',$where).' ORDER BY u.user_name';
|
||||
// echo "Selector query: ".$qry.'<br />';
|
||||
|
||||
e107::getMessage()->addDebug("Selector query: ".$qry);
|
||||
|
||||
if (!( $this->mail_count = $sql->db_Select_gen($qry))) return FALSE;
|
||||
$this->mail_read = 0;
|
||||
return $this->mail_count;
|
||||
@@ -268,7 +281,7 @@ class core_mailout
|
||||
|
||||
$var = array();
|
||||
|
||||
$var[0]['caption'] = LAN_MAILOUT_03; // User class select
|
||||
$var[0]['caption'] = LAN_MAILOUT_260; // LAN_MAILOUT_03; // User class select
|
||||
|
||||
if ($allow_edit)
|
||||
{
|
||||
|
@@ -272,28 +272,28 @@ class e_menuManager {
|
||||
$menu_count = $sql->count("menus", "(*)", " WHERE menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ");
|
||||
$sql->db_Update("menus", "menu_order=".($menu_count+1)." WHERE menu_order='{$position}' AND menu_location='{$location}' AND menu_layout = '$this->dbLayout' ");
|
||||
$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location='{$location}' AND menu_order > {$position} AND menu_layout = '".$this->dbLayout."' ");
|
||||
$admin_log->log_event('MENU_06',$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('MENU_06',$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
|
||||
if ($menu_act == "top")
|
||||
{
|
||||
$sql->db_Update("menus", "menu_order=menu_order+1 WHERE menu_location='{$location}' AND menu_order < {$position} AND menu_layout = '".$this->dbLayout."' ",$this->debug);
|
||||
$sql->db_Update("menus", "menu_order=1 WHERE menu_id='{$this->menuId}' ");
|
||||
$admin_log->log_event('MENU_05',$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('MENU_05',$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
|
||||
if ($menu_act == "dec")
|
||||
{
|
||||
$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_order='".($position+1)."' AND menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ",$this->debug);
|
||||
$sql->db_Update("menus", "menu_order=menu_order+1 WHERE menu_id='{$this->menuId}' AND menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ");
|
||||
$admin_log->log_event('MENU_08',$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('MENU_08',$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
|
||||
if ($menu_act == "inc")
|
||||
{
|
||||
$sql->db_Update("menus", "menu_order=menu_order+1 WHERE menu_order='".($position-1)."' AND menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ",$this->debug);
|
||||
$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_id='{$this->menuId}' AND menu_location='{$location}' AND menu_layout = '".$this->dbLayout."' ");
|
||||
$admin_log->log_event('MENU_07',$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('MENU_07',$location.'[!br!]'.$position.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
|
||||
if (!isset($_GET['configure']))
|
||||
@@ -345,7 +345,7 @@ class e_menuManager {
|
||||
);
|
||||
|
||||
$sql->db_Insert("menus",$insert);
|
||||
$admin_log->log_event('MENU_01',$row['menu_name'].'[!br!]'.$location.'[!br!]'.$menu_count.'[!br!]'.$row['menu_path'],E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('MENU_01',$row['menu_name'].'[!br!]'.$location.'[!br!]'.$menu_count.'[!br!]'.$row['menu_path'],E_LOG_INFORMATIVE,'');
|
||||
|
||||
}
|
||||
}
|
||||
@@ -657,7 +657,7 @@ class e_menuManager {
|
||||
|
||||
$sql->db_Insert("menus",$insert, $this->debug);
|
||||
|
||||
$admin_log->log_event('MENU_01',$row['menu_name'].'[!br!]'.$location.'[!br!]'.$menu_count.'[!br!]'.$row['menu_path'],E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('MENU_01',$row['menu_name'].'[!br!]'.$location.'[!br!]'.$menu_count.'[!br!]'.$row['menu_path'],E_LOG_INFORMATIVE,'');
|
||||
$menu_count++;
|
||||
}
|
||||
}
|
||||
@@ -774,7 +774,7 @@ class e_menuManager {
|
||||
{
|
||||
return array('msg'=>'All Okay','error'=>false);
|
||||
// FIXME - menu log
|
||||
//$admin_log->log_event('MENU_02',$_POST['menu_parms'].'[!br!]'.$parms.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
||||
//e107::getLog()->add('MENU_02',$_POST['menu_parms'].'[!br!]'.$parms.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
||||
// $this->menuAddMessage(LAN_SAVED,E_MESSAGE_SUCCESS);
|
||||
}
|
||||
elseif(false === $check)
|
||||
@@ -808,7 +808,7 @@ class e_menuManager {
|
||||
|
||||
if($sql->db_Update("menus", "menu_class='".intval($_POST['menu_class'])."', menu_pages='{$pageparms}' WHERE menu_id=".intval($_POST['menu_id'])))
|
||||
{
|
||||
$admin_log->log_event('MENU_02',$_POST['menu_class'].'[!br!]'.$pageparms.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('MENU_02',$_POST['menu_class'].'[!br!]'.$pageparms.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
||||
|
||||
return array('msg'=>LAN_UPDATED, 'error'=> false);
|
||||
//$this->menuAddMessage($message,E_MESSAGE_SUCCESS);
|
||||
@@ -862,7 +862,7 @@ class e_menuManager {
|
||||
}
|
||||
//Move all menus up (reduces order number) that have a higher menu order number than one deactivated, in the selected location.
|
||||
$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location={$row['menu_location']} AND menu_order > {$row['menu_order']} AND menu_layout = '".$this->dbLayout."' ");
|
||||
$admin_log->log_event('MENU_04',$row['menu_name'].'[!br!]'.$row['menu_location'].'[!br!]'.$row['menu_order'].'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('MENU_04',$row['menu_name'].'[!br!]'.$row['menu_location'].'[!br!]'.$row['menu_order'].'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -892,7 +892,7 @@ class e_menuManager {
|
||||
$sql->db_Update("menus", "menu_location='{$this->menuNewLoc}', menu_order=".($menu_count+1)." WHERE menu_id=".$this->menuId);
|
||||
$sql->db_Update("menus", "menu_order=menu_order-1 WHERE menu_location='{$location}' AND menu_order > {$position} AND menu_layout='".$this->dbLayout ."' ");
|
||||
}
|
||||
$admin_log->log_event('MENU_03',$row['menu_name'].'[!br!]'.$this->menuNewLoc.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('MENU_03',$row['menu_name'].'[!br!]'.$this->menuNewLoc.'[!br!]'.$this->menuId,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -44,9 +44,9 @@ class e107plugin
|
||||
'e_event',
|
||||
'e_comment',
|
||||
'e_sql',
|
||||
'e_userprofile',
|
||||
// 'e_userprofile', @deprecated @see e_user
|
||||
'e_header',
|
||||
'e_userinfo',
|
||||
// 'e_userinfo', @deprecated @see e_user
|
||||
'e_tagwords',
|
||||
'e_url',
|
||||
|
||||
@@ -56,6 +56,7 @@ class e107plugin
|
||||
'e_featurebox',
|
||||
'e_related',
|
||||
'e_rss',
|
||||
'e_user'
|
||||
);
|
||||
|
||||
|
||||
|
@@ -217,6 +217,8 @@ class pop3BounceHandler
|
||||
*/
|
||||
public function processBounces()
|
||||
{
|
||||
$identifier = deftrue('MAIL_IDENTIFIER', 'X-e107-id');
|
||||
|
||||
$this->connect();
|
||||
$tot = $this->getTotalMails(); // Get all the emails
|
||||
for ($i = 1; $i <= $tot; $i++)
|
||||
@@ -227,7 +229,7 @@ class pop3BounceHandler
|
||||
//print_a($head);
|
||||
$body = $this->getBody($i);
|
||||
$e107Header = '';
|
||||
if (preg_match('#.*X-e107-id:(.*?)[\n\r]#',$body, $result))
|
||||
if (preg_match('#.*'.$identifier.':(.*?)[\n\r]#',$body, $result))
|
||||
{
|
||||
$e107Header = varset($result[1],'');
|
||||
}
|
||||
|
@@ -1054,7 +1054,13 @@ class e_parse_shortcode
|
||||
|
||||
if ($scCode)
|
||||
{
|
||||
$ret = eval($scCode);
|
||||
$ret = @eval($scCode);
|
||||
|
||||
if($ret === false && E107_DEBUG_LEVEL > 0) // Error in Code.
|
||||
{
|
||||
$string = print_a($scCode,true);
|
||||
e107::getMessage()->addDebug('Could not parse Shortcode '.$scFile.' :: {'.$code .'} '.$string);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($ret) && ($ret != '' || is_numeric($ret)))
|
||||
|
@@ -1844,7 +1844,7 @@ class themeHandler
|
||||
}
|
||||
global $pref,$admin_log;
|
||||
// if (!varset($pref['admin_log_log']['admin_banlist'],0)) return;
|
||||
$admin_log->log_event('THEME_'.$msg_num, $woffle, E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('THEME_'.$msg_num, $woffle, E_LOG_INFORMATIVE, '');
|
||||
}
|
||||
|
||||
function parse_theme_php($path)
|
||||
|
@@ -675,10 +675,12 @@ class e107_user_extended
|
||||
$regex = $tp->toText($parms[1]);
|
||||
$regexfail = $tp->toText($parms[2]);
|
||||
$fname = "ue[user_".$struct['user_extended_struct_name']."]";
|
||||
$required = vartrue($struct['user_extended_struct_required']) ? "required" : "";
|
||||
$fid = $frm->name2id($fname);
|
||||
|
||||
if(strpos($include, 'class') === FALSE)
|
||||
{
|
||||
$include .= " class='tbox' ";
|
||||
$include .= " class='form-control tbox' ";
|
||||
}
|
||||
|
||||
|
||||
@@ -686,7 +688,8 @@ class e107_user_extended
|
||||
{
|
||||
case EUF_TEXT : //textbox
|
||||
case EUF_INTEGER : //integer
|
||||
$ret = "<input name='{$fname}' value='{$curval}' {$include} />";
|
||||
$ret = "<input id='{$fid}' type='text' name='{$fname}' value='{$curval}' {$include} {$required} />";
|
||||
|
||||
return $ret;
|
||||
break;
|
||||
|
||||
@@ -715,12 +718,12 @@ class e107_user_extended
|
||||
|
||||
if(deftrue('BOOTSTRAP'))
|
||||
{
|
||||
$ret .= $frm->radio($fname,$val,($curval == $val),array('label'=>$label));
|
||||
$ret .= $frm->radio($fname,$val,($curval == $val),array('label'=>$label, 'required'=> $struct['user_extended_struct_required']));
|
||||
}
|
||||
else
|
||||
{
|
||||
$chk = ($curval == $val)? " checked='checked' " : "";
|
||||
$ret .= "<input {$include} type='radio' name='{$fname}' value='{$val}' {$chk} /> {$label}";
|
||||
$ret .= "<input id='{$fid}' {$include} type='radio' name='{$fname}' value='{$val}' {$chk} {$required} /> {$label}";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -751,7 +754,7 @@ class e107_user_extended
|
||||
|
||||
if(deftrue('BOOTSTRAP'))
|
||||
{
|
||||
$ret .= $frm->checkbox($fname,$val,($curval == $val),array('label'=>$label));
|
||||
$ret .= $frm->checkbox($fname,$val,($curval == $val),array('label'=>$label, 'required'=> $struct['user_extended_struct_required']));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -764,7 +767,7 @@ class e107_user_extended
|
||||
break;
|
||||
|
||||
case EUF_DROPDOWN : //dropdown
|
||||
$ret = "<select {$include} name='{$fname}'>\n";
|
||||
$ret = "<select {$include} id='{$fid}' name='{$fname}' {$required} >\n";
|
||||
$ret .= "<option value=''> </option>\n"; // ensures that the user chose it.
|
||||
foreach($choices as $choice)
|
||||
{
|
||||
@@ -788,7 +791,7 @@ class e107_user_extended
|
||||
if (!method_exists($className, 'getValue')) return '???-???';
|
||||
$temp->pointerReset();
|
||||
|
||||
$ret = "<select {$include} name='{$fname}'>\n";
|
||||
$ret = "<select id='{$fid}' {$include} name='{$fname}' {$required} >\n";
|
||||
$ret .= "<option value=''> </option>\n"; // ensures that the user chooses it.
|
||||
while (FALSE !== ($row = $temp->getValue(0, 'next')))
|
||||
{
|
||||
@@ -808,7 +811,7 @@ class e107_user_extended
|
||||
|
||||
if($sql->db_Select($tp -> toDB($choices[0], true), $tp -> toDB($choices[1], true).",".$tp -> toDB($choices[2], true), "1 $order")){
|
||||
$choiceList = $sql->db_getList('ALL',FALSE);
|
||||
$ret = "<select {$include} name='{$fname}' >\n";
|
||||
$ret = "<select id='{$fid}' {$include} name='{$fname}' {$required} >\n";
|
||||
$ret .= "<option value=''> </option>\n"; // ensures that the user chose it.
|
||||
foreach($choiceList as $cArray)
|
||||
{
|
||||
@@ -825,7 +828,7 @@ class e107_user_extended
|
||||
break;
|
||||
|
||||
case EUF_TEXTAREA : //textarea
|
||||
return "<textarea {$include} name='{$fname}' >{$curval}</textarea>";
|
||||
return "<textarea id='{$fid}' {$include} name='{$fname}' {$required} >{$curval}</textarea>";
|
||||
break;
|
||||
|
||||
case EUF_DATE : //date
|
||||
@@ -839,11 +842,10 @@ class e107_user_extended
|
||||
break;
|
||||
|
||||
case EUF_LANGUAGE : // language
|
||||
require_once(e_HANDLER."file_class.php");
|
||||
$fl = new e_file;
|
||||
$lanlist = $fl->get_dirs(e_LANGUAGEDIR);
|
||||
$lanlist = e107::getLanguage()->installed();
|
||||
sort($lanlist);
|
||||
$ret = "<select {$include} name='{$fname}'>\n";
|
||||
|
||||
$ret = "<select {$include} id='{$fid}' name='{$fname}' {$required} >\n";
|
||||
$ret .= "<option value=''> </option>\n"; // ensures that the user chose it.
|
||||
foreach($lanlist as $choice)
|
||||
{
|
||||
@@ -852,6 +854,7 @@ class e107_user_extended
|
||||
$ret .= "<option value='{$choice}' {$sel}>{$choice}</option>\n";
|
||||
}
|
||||
$ret .= "</select>\n";
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
@@ -1600,7 +1600,7 @@ class e_userperms
|
||||
//$sql->db_Update("user", "user_perms='{$perm}' WHERE user_id='{$modID}' ")
|
||||
e107::getMessage()->addAuto($sysuser->set('user_perms', $perm)->save(), 'update', sprintf(LAN_UPDATED, $tp->toDB($_POST['ad_name'])), false, false);
|
||||
$logMsg = str_replace(array('--ID--', '--NAME--'),array($modID, $a_name),ADMSLAN_72).$perm;
|
||||
$admin_log->log_event('ADMIN_01',$logMsg,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('ADMIN_01',$logMsg,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -1055,7 +1055,8 @@ class e_system_user extends e_user_model
|
||||
{
|
||||
if($this->debug)
|
||||
{
|
||||
echo '$eml returned nothing';
|
||||
echo '$eml returned nothing on Line 1050 of user_model.php using $type = '.$type;
|
||||
print_a($userInfo);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1103,6 +1104,7 @@ class e_system_user extends e_user_model
|
||||
$pref = e107::getPref();
|
||||
$ret = array();
|
||||
$tp = e107::getParser();
|
||||
$mes = e107::getMessage();
|
||||
|
||||
|
||||
// mailer options
|
||||
@@ -1166,7 +1168,11 @@ class e_system_user extends e_user_model
|
||||
break;
|
||||
}
|
||||
|
||||
if(!$template) return array();
|
||||
if(!$template)
|
||||
{
|
||||
$mes->addDebug('$template is empty in user_model.php line 1171.'); // Debug only, do not translate.
|
||||
return array();
|
||||
}
|
||||
|
||||
$pass_show = varset($userInfo['user_password']);
|
||||
|
||||
@@ -1253,13 +1259,20 @@ class e_system_user extends e_user_model
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// all other email types
|
||||
if(!$userInfo['email_subject'])
|
||||
if(!$userInfo['mail_subject'])
|
||||
{
|
||||
return array();
|
||||
$mes->addDebug('No Email subject provided to renderEmail() method.'); // Debug only, do not translate.
|
||||
return array();
|
||||
}
|
||||
|
||||
$ret['email_subject'] = $userInfo['email_subject']; // $EMAIL_TEMPLATE['signup']['subject'];
|
||||
|
||||
$templateName = $ret['template'];
|
||||
|
||||
$ret['email_subject'] = varset($EMAIL_TEMPLATE[$templateName]['subject'], $EMAIL_TEMPLATE['default']['subject']) ; // $subject;
|
||||
$ret['e107_header'] = $userInfo['user_id'];
|
||||
|
||||
if (vartrue($userInfo['email_copy_to'])) { $ret['email_copy_to'] = $userInfo['email_copy_to']; }
|
||||
@@ -1274,6 +1287,7 @@ class e_system_user extends e_user_model
|
||||
$sc['USERNAME'] = $userInfo['user_name'];
|
||||
$sc['USERURL'] = vartrue($userInfo['user_website']) ? $userInfo['user_website'] : "";
|
||||
$sc['PASSWORD'] = $pass_show ? $pass_show : '******';
|
||||
$sc['SUBJECT'] = $userInfo['mail_subject'];
|
||||
|
||||
|
||||
/*
|
||||
|
@@ -37,6 +37,7 @@ $action = e107::getParser()->toDB(varset($_GET['mode'],'makemail'));
|
||||
break;
|
||||
case 'savedmail' :
|
||||
case 'makemail' :
|
||||
case 'main' :
|
||||
$text = 'Create an email, give it a meaningful title, and select the list of recipients. You can save everything as a template for later, or send immediately.<br />';
|
||||
$text .= 'Email addresses may be contributed by plugins (such as newsletter), and duplicates are removed when the mail is sent<br />';
|
||||
$text .= 'Any attachment is selected from the list of valid downloads.<br />';
|
||||
|
@@ -379,10 +379,10 @@ define("LAN_AL_MISC_07", "");
|
||||
|
||||
define("LAN_AL_PING_01", "Ping to service");
|
||||
|
||||
define("LAN_AL_ADMINUI_01", "Admin-UI DB Table Insert");
|
||||
define("LAN_AL_ADMINUI_02", "Admin-UI DB Table Update");
|
||||
define("LAN_AL_ADMINUI_03", "Admin-UI DB Table Delete");
|
||||
define("LAN_AL_ADMINUI_04", "Admin-UI DB Error");
|
||||
define("LAN_AL_ADMINUI_01", "Admin-UI DB Table Insert: [x]");
|
||||
define("LAN_AL_ADMINUI_02", "Admin-UI DB Table Update: [x]");
|
||||
define("LAN_AL_ADMINUI_03", "Admin-UI DB Table Delete: [x]");
|
||||
define("LAN_AL_ADMINUI_04", "Admin-UI DB Error: [x]");
|
||||
|
||||
|
||||
?>
|
||||
|
@@ -22,8 +22,8 @@ define("LAN_MAILOUT_08", "Send Email");
|
||||
define("LAN_MAILOUT_09", "Send format");
|
||||
define("LAN_MAILOUT_10", "User Subscribed");
|
||||
define("LAN_MAILOUT_11", "Insert Variables");
|
||||
define("LAN_MAILOUT_12", "All Members");
|
||||
define("LAN_MAILOUT_13", "All Unverified Members ");
|
||||
define("LAN_MAILOUT_12", "All Users");
|
||||
define("LAN_MAILOUT_13", "All Unverified Users ");
|
||||
define("LAN_MAILOUT_14", "Display Name");
|
||||
define("LAN_MAILOUT_15", "Mailout");
|
||||
define("LAN_MAILOUT_16", "Username");
|
||||
@@ -250,7 +250,7 @@ define("LAN_MAILOUT_231", "Bounced emails - Processing method");
|
||||
define("LAN_MAILOUT_232", "None");
|
||||
define("LAN_MAILOUT_233", "Auto-process script");
|
||||
define("LAN_MAILOUT_234", "Mail account");
|
||||
define("LAN_MAILOUT_235", "(Your server has to be configured to use this script)");
|
||||
define("LAN_MAILOUT_235", "(Your server must forward or 'pipe' from the email address above to the script path above.)");
|
||||
define("LAN_MAILOUT_236", "Last Bounce Processed");
|
||||
define("LAN_MAILOUT_237", "Summary counters updated on --COUNT-- emails");
|
||||
define("LAN_MAILOUT_238", "Earliest time to send");
|
||||
@@ -279,6 +279,8 @@ define("LAN_MAILOUT_259", "");
|
||||
|
||||
define("LAN_SEND", "Send");
|
||||
define("LAN_HOLD", "Hold");
|
||||
define("LAN_MAILOUT_260", "User-Type");
|
||||
|
||||
//define("LAN_SUBMIT", "Do it!"); LAN_RUN
|
||||
|
||||
?>
|
@@ -326,7 +326,7 @@ class alt_auth_admin extends alt_auth_base
|
||||
}
|
||||
}
|
||||
}
|
||||
e107::getAdminLog()->log_event('AUTH_03',$prefix,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('AUTH_03',$prefix,E_LOG_INFORMATIVE,'');
|
||||
return LAN_ALT_UPDATED;
|
||||
}
|
||||
|
||||
|
@@ -74,7 +74,7 @@ if(isset($_POST['updateeufs']))
|
||||
{
|
||||
$pref['auth_extended'] = $au; // @TODO:
|
||||
save_prefs();
|
||||
$admin_log->log_event('AUTH_02',$au,'');
|
||||
e107::getLog()->add('AUTH_02',$au,'');
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -687,7 +687,7 @@ function banners_adminlog($msg_num='00', $woffle='')
|
||||
$pref = e107::getPref();
|
||||
|
||||
// if (!varset($pref['admin_log_log']['admin_banners'],0)) return;
|
||||
$admin_log->log_event('BANNER_'.$msg_num,$woffle, E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('BANNER_'.$msg_num,$woffle, E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
|
||||
?>
|
@@ -62,7 +62,7 @@ if (isset($_POST['prune']))
|
||||
$prunetime = time() - $chatbox_prune;
|
||||
|
||||
$sql->db_Delete("chatbox", "cb_datestamp < '{$prunetime}' ");
|
||||
$admin_log->log_event('CHBLAN_02', $chatbox_prune.', '.$prunetime, E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('CHBLAN_02', $chatbox_prune.', '.$prunetime, E_LOG_INFORMATIVE, '');
|
||||
$e107cache->clear("nq_chatbox");
|
||||
$mes->addSuccess(CHBLAN_28);
|
||||
}
|
||||
@@ -88,7 +88,7 @@ if (isset($_POST['recalculate']))
|
||||
{
|
||||
$sql->db_Update("user", "user_chats = '{$cnt}' WHERE user_id = '{$uid}'");
|
||||
}
|
||||
$admin_log->log_event('CHBLAN_03','', E_LOG_INFORMATIVE, '');
|
||||
e107::getLog()->add('CHBLAN_03','', E_LOG_INFORMATIVE, '');
|
||||
$mes->addSuccess(CHBLAN_33);
|
||||
}
|
||||
|
||||
|
40
e107_plugins/chatbox_menu/e_user.php
Normal file
40
e107_plugins/chatbox_menu/e_user.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2014 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
// v2.x Standard
|
||||
class chatbox_menu_user // plugin-folder + '_user'
|
||||
{
|
||||
|
||||
function profile($udata)
|
||||
{
|
||||
|
||||
if(!$chatposts = e107::getRegistry('total_chatposts'))
|
||||
{
|
||||
$chatposts = 0; // In case plugin not installed
|
||||
if(e107::isInstalled("chatbox_menu"))
|
||||
{
|
||||
$chatposts = e107::getDb()->count("chatbox");
|
||||
}
|
||||
e107::setRegistry('total_chatposts', $chatposts);
|
||||
}
|
||||
|
||||
$perc = ($chatposts > 0) ? round(($udata['user_chats']/$chatposts) * 100, 2) : 0;
|
||||
|
||||
|
||||
$var = array(
|
||||
0 => array('label' => LAN_PLUGIN_CHATBOX_MENU_POSTS, 'text' => $udata['user_chats']." ( ".$perc."% )")
|
||||
);
|
||||
|
||||
return $var;
|
||||
}
|
||||
|
||||
}
|
@@ -3,6 +3,7 @@
|
||||
|
||||
define("LAN_PLUGIN_CHATBOX_MENU_NAME", "Chatbox");
|
||||
define("LAN_PLUGIN_CHATBOX_MENU_DESCRIPTION", "Chatbox Menu");
|
||||
define("LAN_PLUGIN_CHATBOX_MENU_POSTS", "Chatbox Posts");
|
||||
|
||||
// Admin Log
|
||||
//FIXME - Global LANS must begin with LAN_PLUGIN_{FOLDER_NAME}_
|
||||
|
@@ -102,7 +102,7 @@ if (isset($_POST['update_catorder']))
|
||||
$sql -> db_Update("download_category", "download_category_order='".intval($order)."' WHERE download_category_id='".intval($key)."'");
|
||||
}
|
||||
}
|
||||
$admin_log->log_event('DOWNL_08',implode(',',array_keys($_POST['catorder'])),E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('DOWNL_08',implode(',',array_keys($_POST['catorder'])),E_LOG_INFORMATIVE,'');
|
||||
$ns->tablerender("", "<div style='text-align:center'><b>".LAN_UPDATED."</b></div>");
|
||||
}
|
||||
/*
|
||||
@@ -175,7 +175,7 @@ if (isset($_POST['addlimit']))
|
||||
if ($sql->db_Insert('generic',$vals))
|
||||
{
|
||||
$message = DOWLAN_117;
|
||||
$admin_log->log_event('DOWNL_09',$valString,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('DOWNL_09',$valString,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -208,7 +208,7 @@ if (isset($_POST['updatelimits']))
|
||||
if ($sql->db_Delete('generic',"gen_id = {$idLim}"))
|
||||
{
|
||||
$message .= $idLim." - ".DOWLAN_119."<br/>";
|
||||
$admin_log->log_event('DOWNL_11','ID: '.$idLim,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('DOWNL_11','ID: '.$idLim,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -224,7 +224,7 @@ if (isset($_POST['updatelimits']))
|
||||
}
|
||||
$valString = implode(',',$vals);
|
||||
$sql->db_UpdateArray('generic',$vals," WHERE gen_id = {$idLim}");
|
||||
$admin_log->log_event('DOWNL_10',$idLim.', '.$valString,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('DOWNL_10',$idLim.', '.$valString,E_LOG_INFORMATIVE,'');
|
||||
$message .= $idLim." - ".DOWLAN_121."<br/>";
|
||||
unset($vals);
|
||||
}
|
||||
|
@@ -1187,7 +1187,7 @@ class adminDownload extends download
|
||||
$logString .= '[!br!]'.$k.'=>'.$v;
|
||||
}
|
||||
}
|
||||
$admin_log->log_event($aText,$logString,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add($aText,$logString,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
*/
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -1890,12 +1890,12 @@ class adminDownload extends download
|
||||
if ($id)
|
||||
{
|
||||
admin_update($sql->db_Update("download_category", "download_category_name='{$download_category_name}', download_category_description='{$download_category_description}', download_category_icon ='{$download_category_icon}', download_category_parent= '{$download_categoory_parent}', download_category_class='{$download_category_class}' WHERE download_category_id='{$id}'"), 'update', DOWLAN_48);
|
||||
$admin_log->log_event('DOWNL_03',$download_category_name.'[!br!]'.$download_category_description,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('DOWNL_03',$download_category_name.'[!br!]'.$download_category_description,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
else
|
||||
{
|
||||
admin_update($sql->db_Insert("download_category", "0, '{$download_category_name}', '{$download_category_description}', '{$download_category_icon}', '{$download_categoory_parent}', '{$download_category_class}', 0 "), 'insert', DOWLAN_47);
|
||||
$admin_log->log_event('DOWNL_02',$download_category_name.'[!br!]'.$download_category_description,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('DOWNL_02',$download_category_name.'[!br!]'.$download_category_description,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
if ($subAction == "sn")
|
||||
{
|
||||
@@ -1914,7 +1914,7 @@ class adminDownload extends download
|
||||
if ($delete == "mirror")
|
||||
{
|
||||
admin_update($sql -> db_Delete("download_mirror", "mirror_id=".$del_id), delete, DOWLAN_135);
|
||||
$admin_log->log_event('DOWNL_14','ID: '.$del_id,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('DOWNL_14','ID: '.$del_id,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
|
||||
|
||||
@@ -2059,12 +2059,12 @@ class adminDownload extends download
|
||||
if (isset($_POST['id']))
|
||||
{
|
||||
admin_update($sql -> db_Update("download_mirror", "mirror_name='{$name}', mirror_url='{$url}', mirror_image='".$tp->toDB($_POST['mirror_image'])."', mirror_location='{$location}', mirror_description='{$description}' WHERE mirror_id=".intval($_POST['id'])), 'update', DOWLAN_133);
|
||||
$admin_log->log_event('DOWNL_13','ID: '.intval($_POST['id']).'[!br!]'.$logString,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('DOWNL_13','ID: '.intval($_POST['id']).'[!br!]'.$logString,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
else
|
||||
{
|
||||
admin_update($sql -> db_Insert("download_mirror", "0, '{$name}', '{$url}', '".$tp->toDB($_POST['mirror_image'])."', '{$location}', '{$description}', 0"), 'insert', DOWLAN_134);
|
||||
$admin_log->log_event('DOWNL_12',$logString,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('DOWNL_12',$logString,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
@@ -380,7 +380,7 @@ class download
|
||||
|
||||
if ($dlrow['download_comment'])
|
||||
{
|
||||
$comments = e107::getComment()->compose_comment("download", "comment", $id, $width,$dlrow['download_name'], FALSE, true);
|
||||
$comments = e107::getComment()->compose_comment("download", "comment", $dlrow['download_id'], $width, $dlrow['download_name'], FALSE, true);
|
||||
$ret .= $ns->tablerender($comments['caption'], $comments['comment'].$comments['comment_form'], 'download-comments', true);
|
||||
}
|
||||
|
||||
|
@@ -1783,7 +1783,7 @@ $columnInfo = array(
|
||||
if ($delete == "mirror")
|
||||
{
|
||||
$mes->addAuto($sql -> db_Delete("download_mirror", "mirror_id=".$del_id), delete, DOWLAN_135);
|
||||
$admin_log->log_event('DOWNL_14','ID: '.$del_id,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('DOWNL_14','ID: '.$del_id,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
|
||||
|
||||
@@ -1934,12 +1934,12 @@ $columnInfo = array(
|
||||
if (isset($_POST['id']))
|
||||
{
|
||||
$mes->addAuto($sql -> db_Update("download_mirror", "mirror_name='{$name}', mirror_url='{$url}', mirror_image='".$tp->toDB($_POST['mirror_image'])."', mirror_location='{$location}', mirror_description='{$description}' WHERE mirror_id=".intval($_POST['id'])), 'update', DOWLAN_133);
|
||||
$admin_log->log_event('DOWNL_13','ID: '.intval($_POST['id']).'[!br!]'.$logString,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('DOWNL_13','ID: '.intval($_POST['id']).'[!br!]'.$logString,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
else
|
||||
{
|
||||
$mes->addAuto($sql -> db_Insert("download_mirror", "0, '{$name}', '{$url}', '".$tp->toDB($_POST['mirror_image'])."', '{$location}', '{$description}', 0"), 'insert', DOWLAN_134);
|
||||
$admin_log->log_event('DOWNL_12',$logString,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('DOWNL_12',$logString,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2120,7 +2120,7 @@ $columnInfo = array(
|
||||
$logString .= '[!br!]'.$k.'=>'.$v;
|
||||
}
|
||||
}
|
||||
$admin_log->log_event($aText,$logString,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add($aText,$logString,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
|
||||
|
||||
|
41
e107_plugins/forum/e_user.php
Normal file
41
e107_plugins/forum/e_user.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2014 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
// v2.x Standard
|
||||
class forum_user // plugin-folder + '_user'
|
||||
{
|
||||
|
||||
function profile($udata)
|
||||
{
|
||||
|
||||
$sql = e107::getDb();
|
||||
|
||||
if(!$total_forumposts = e107::getRegistry('total_forumposts'))
|
||||
{
|
||||
$total_forumposts = intval($sql->count("forum_post"));
|
||||
e107::setRegistry('total_forumposts', $total_forumposts);
|
||||
}
|
||||
|
||||
$count = $sql->retrieve('user_extended', 'user_plugin_forum_posts', 'user_extended_id = '.$udata['user_id']);
|
||||
|
||||
$perc = ($total_forumposts > 0 && $count) ? round(($count / $total_forumposts) * 100, 2) : 0;
|
||||
|
||||
$url = ($count> 0) ? e_HTTP."userposts.php?0.forums.".$udata['user_id'] : null;
|
||||
|
||||
$var = array(
|
||||
0 => array('label' => LAN_PLUGIN_FORUM_POSTS, 'text' => intval($count)." ( ".$perc."% )", 'url'=> $url)
|
||||
);
|
||||
|
||||
return $var;
|
||||
}
|
||||
|
||||
}
|
@@ -547,7 +547,7 @@ function renderProgress($caption, $step)
|
||||
<div class="bar" id="progress"></div>
|
||||
</div>
|
||||
|
||||
<a id="'.$thisStep.'" data-loading-text="Please wait..." data-progress="' . e_SELF . '" data-progress-mode="'.$step.'" data-progress-show="'.$nextStep.'" data-progress-hide="'.$thisStep.'" class="btn btn-primary e-progress" >'.$caption.'</a>
|
||||
<a id="'.$thisStep.'" data-loading-text="Please wait..." data-progress="' . e_SELF . '" data-progress-target="progress" data-progress-mode="'.$step.'" data-progress-show="'.$nextStep.'" data-progress-hide="'.$thisStep.'" class="btn btn-primary e-progress" >'.$caption.'</a>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
|
@@ -2,7 +2,7 @@
|
||||
|
||||
define("LAN_PLUGIN_FORUM_NAME", "Forum");
|
||||
define("LAN_PLUGIN_FORUM_DESC", "This plugin is a fully featured forum system.");
|
||||
|
||||
define("LAN_PLUGIN_FORUM_POSTS", "Forum posts");
|
||||
// Notify
|
||||
// TODO - LAN cleanup (see e_notify)
|
||||
|
||||
|
@@ -44,7 +44,7 @@ function pingit($vals)
|
||||
|
||||
$pinger->ping($xml_rpc_server, $xml_rpc_port, $xml_rpc_path, $xml_rpc_method, $weblog_name, $weblog_url, $changes_url, $cat_or_rss, $extended);
|
||||
$log = strip_tags($vals['news_title']."\n".$changes_url."\n".$cat_or_rss."\n".$pinger->smessage);
|
||||
$admin_log->log_event("Gsitemap Google-ping",$log, 4);
|
||||
e107::getLog()->add("Gsitemap Google-ping",$log, 4);
|
||||
|
||||
}
|
||||
|
||||
|
@@ -66,7 +66,7 @@ if(isset($deltest[LAN_DELETE]))
|
||||
if ($sql->db_Count('linkwords', '(*)', "WHERE linkword_id = ".$delete_id))
|
||||
{
|
||||
$sql->db_Delete('linkwords', 'linkword_id='.$delete_id);
|
||||
$admin_log->log_event('LINKWD_03','ID: '.$delete_id,'');
|
||||
e107::getLog()->add('LINKWD_03','ID: '.$delete_id,'');
|
||||
$e107->ecache->clear_sys(LW_CACHE_TAG);
|
||||
//$message = LWLAN_19;
|
||||
$mes->addSuccess(LAN_DELETED);
|
||||
@@ -116,7 +116,7 @@ if (isset($_POST['saveopts_linkword']))
|
||||
save_prefs();
|
||||
$logString = implode(', ',$pref['lw_context_visibility']).'[!br!]'.$pref['lw_page_visibility'].'[!br!]'.$pref['lw_ajax_enable'].'[!br!]'.$pref['lw_notsamepage'];
|
||||
$e107->ecache->clear_sys(LW_CACHE_TAG);
|
||||
$admin_log->log_event('LINKWD_04',$logString,'');
|
||||
e107::getLog()->add('LINKWD_04',$logString,'');
|
||||
}
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ if (isset($_POST['submit_linkword']) || isset($_POST['update_linkword']))
|
||||
{
|
||||
if ($sql->db_Insert('linkwords', $data))
|
||||
{
|
||||
$admin_log->log_event('LINKWD_01',$logString,'');
|
||||
e107::getLog()->add('LINKWD_01',$logString,'');
|
||||
$mes->addSuccess(LAN_CREATED);
|
||||
}
|
||||
else
|
||||
@@ -156,7 +156,7 @@ if (isset($_POST['submit_linkword']) || isset($_POST['update_linkword']))
|
||||
{
|
||||
$mes->addSuccess(LAN_UPDATED);
|
||||
$logString = 'ID: '.$id.'[!br!]'.$logString;
|
||||
$admin_log->log_event('LINKWD_02',$logString,'');
|
||||
e107::getLog()->add('LINKWD_02',$logString,'');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -57,7 +57,7 @@ class e_linkwords
|
||||
$pref['e_tohtml_list'][] = 'linkwords';
|
||||
}
|
||||
save_prefs();
|
||||
$admin_log->log_event('LINKWD_05',LWLAN_58.'[!br!]'.$pref['tohtml_hook'],''); // Log that the update was done
|
||||
e107::getLog()->add('LINKWD_05',LWLAN_58.'[!br!]'.$pref['tohtml_hook'],''); // Log that the update was done
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -196,7 +196,7 @@ if(IsSet($_POST['wipeSubmit']))
|
||||
}
|
||||
$logStr .= '[!br!]'.$key;
|
||||
}
|
||||
$admin_log->log_event('STAT_01',ADSTAT_L81.$logStr,'');
|
||||
e107::getLog()->add('STAT_01',ADSTAT_L81.$logStr,'');
|
||||
|
||||
//$message = ADSTAT_L25; // TODO:$emessage
|
||||
$mes->addSuccess(LAN_UPDATED);
|
||||
@@ -237,7 +237,7 @@ if (isset($_POST['updatesettings']))
|
||||
}
|
||||
save_prefs();
|
||||
file_put_contents(e_LOG.LogFlagFile, "<?php\n\$logEnable={$pref['statActivate']};\n?>\n"); // Logging task uses to see if logging enabled
|
||||
$admin_log->log_event('STAT_02',ADSTAT_L82.$logStr,'');
|
||||
e107::getLog()->add('STAT_02',ADSTAT_L82.$logStr,'');
|
||||
}
|
||||
|
||||
$ns->tablerender($caption, $mes->render() . $text);
|
||||
@@ -526,7 +526,7 @@ switch ($action)
|
||||
$logStr .= "[!br!]{$k} => ".$v;
|
||||
}
|
||||
$text .= "</td></tr>";
|
||||
$admin_log->log_event('STAT_04',ADSTAT_L83.$logStr,'');
|
||||
e107::getLog()->add('STAT_04',ADSTAT_L83.$logStr,'');
|
||||
}
|
||||
$text .= "<tr><td>".ADSTAT_L70."</td>";
|
||||
$text .= "<td><select class='tbox' name='delete_month'>\n";
|
||||
@@ -776,7 +776,7 @@ function rempagego()
|
||||
{
|
||||
$sql -> db_Insert("logstats", "0, 'pageTotal', '{$pagetotal}' ");
|
||||
}
|
||||
$admin_log->log_event('STAT_03',ADSTAT_L80."[!br!]".implode("[!br!]",$_POST['remcb']),'');
|
||||
e107::getLog()->add('STAT_03',ADSTAT_L80."[!br!]".implode("[!br!]",$_POST['remcb']),'');
|
||||
|
||||
$varStart = chr(36);
|
||||
$quote = chr(34);
|
||||
|
@@ -99,7 +99,7 @@ if (isset($_POST['update_menu']))
|
||||
}
|
||||
//$menuPref->setPref('login_menu', $loginPrefs);
|
||||
$menuPref->save(false, true, false);
|
||||
$admin_log->log_event('MISC_03','', E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('MISC_03','', E_LOG_INFORMATIVE,'');
|
||||
//$ns->tablerender("", '<div style=\'text-align:center\'><b>'.LAN_SETSAVED.'</b></div>');
|
||||
$mes->addSuccess(LAN_SAVED);
|
||||
$ns->tablerender("", $mes->render() . $text);
|
||||
|
@@ -87,7 +87,7 @@ $ns->tablerender($caption, $mes->render() . $text);
|
||||
if($action == "delete")
|
||||
{
|
||||
$sql->db_Delete('newsfeed', 'newsfeed_id='.$id);
|
||||
$admin_log->log_event('NEWSFD_03','ID: '.$id,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('NEWSFD_03','ID: '.$id,E_LOG_INFORMATIVE,'');
|
||||
$mes->addSuccess(LAN_DELETED);
|
||||
}
|
||||
|
||||
|
@@ -8,10 +8,6 @@
|
||||
*
|
||||
* Newsletter plugin - mailout function
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/newsletter/e_mailout.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -102,7 +98,7 @@ class newsletter_mailout
|
||||
|
||||
$qry = "SELECT newsletter_id,newsletter_subscribers FROM `#newsletter` WHERE (`newsletter_parent`=0) AND (`newsletter_id` IN ({$selectVals}))";
|
||||
// echo "Selector {$selectVals} query: ".$qry.'<br />';
|
||||
if (!($sql->db_Select_gen($qry))) return FALSE;
|
||||
if (!($sql->gen($qry))) return FALSE;
|
||||
$this->selectorActive = TRUE;
|
||||
$this->mail_count = 1; // We have no idea of how many subscribers without reading all relevant DB records
|
||||
$this->mail_read = 0;
|
||||
@@ -134,7 +130,7 @@ class newsletter_mailout
|
||||
{
|
||||
if (count($this->targets) == 0)
|
||||
{ // Read in and process another newletter mailing list
|
||||
if (!($row = $sql->db_Fetch(MYSQL_ASSOC)))
|
||||
if (!($row = $sql->fetch()))
|
||||
{
|
||||
$this->selectorActive = FALSE;
|
||||
return FALSE; // Run out of DB records
|
||||
@@ -146,9 +142,9 @@ class newsletter_mailout
|
||||
{
|
||||
if ($uid = intval(trim($v)))
|
||||
{ // Got a user ID here - look them up and add their data
|
||||
if ($this->ourDB->db_Select('user', 'user_name,user_email,user_lastvisit', '`user_id`='.$uid))
|
||||
if ($this->ourDB->select('user', 'user_name,user_email,user_lastvisit', '`user_id`='.$uid))
|
||||
{
|
||||
$row = $this->ourDB->db_Fetch();
|
||||
$row = $this->ourDB->fetch();
|
||||
$ret = array('mail_recipient_id' => $uid,
|
||||
'mail_recipient_name' => $row['user_name'], // Should this use realname?
|
||||
'mail_recipient_email' => $row['user_email'],
|
||||
@@ -197,10 +193,10 @@ class newsletter_mailout
|
||||
|
||||
$selects = array_flip(explode(',', $selectVals));
|
||||
|
||||
if ($sql->db_Select('newsletter', 'newsletter_id, newsletter_title', '`newsletter_parent`=0'))
|
||||
if ($sql->select('newsletter', 'newsletter_id, newsletter_title', '`newsletter_parent`=0'))
|
||||
{
|
||||
$c=0;
|
||||
while ($row = $sql->db_Fetch(MYSQL_ASSOC))
|
||||
while ($row = $sql->fetch())
|
||||
{
|
||||
$checked = (isset($selects[$row['newsletter_id']])) ? " checked='checked'" : '';
|
||||
|
||||
@@ -216,15 +212,32 @@ class newsletter_mailout
|
||||
}
|
||||
$c++;
|
||||
}
|
||||
|
||||
return $var;
|
||||
}
|
||||
elseif($allow_edit == true)
|
||||
{
|
||||
|
||||
$var[0]['caption'] = "No newsletters found";
|
||||
$var[0]['html'] = '';
|
||||
|
||||
return $var;
|
||||
}
|
||||
else
|
||||
{
|
||||
$var[$c]['caption'] = NLLAN_50;
|
||||
$var[$c]['html'] = '';
|
||||
return false; // Return Nothing to avoid confusion.
|
||||
}
|
||||
|
||||
return $var;
|
||||
}
|
||||
|
||||
/**
|
||||
* Manage Bounces.
|
||||
*/
|
||||
public function bounce($data)
|
||||
{
|
||||
e107::getLog()->add('Newsletter Bounce', $data, E_LOG_INFORMATIVE, 'BOUNCE');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@@ -54,7 +54,7 @@ class page_related // replace 'e_' with 'plugin-folder_'
|
||||
$items = array();
|
||||
|
||||
|
||||
$tag_regexp = "'(^|, )(".str_replace(",", "|", $tags).")(,|$)'";
|
||||
$tag_regexp = "'(^|,)(".str_replace(",", "|", $tags).")(,|$)'";
|
||||
|
||||
$query = "SELECT * FROM #page WHERE page_id != ".$parm['current']." AND page_class REGEXP '".e_CLASS_REGEXP."' AND page_metakeys REGEXP ".$tag_regexp." ORDER BY page_datestamp DESC LIMIT ".$parm['limit'];
|
||||
|
||||
|
@@ -75,7 +75,7 @@ class poll
|
||||
{
|
||||
admin_purge_related("poll", $existing);
|
||||
}
|
||||
$admin_log->log_event('POLL_01',LAN_AL_POLL_01.': '.$existing,'');
|
||||
e107::getLog()->add('POLL_01',LAN_AL_POLL_01.': '.$existing,'');
|
||||
//return POLL_ADLAN08;
|
||||
}
|
||||
}
|
||||
@@ -158,7 +158,7 @@ class poll
|
||||
$sql->update("polls", "poll_votes='".$foo['poll_votes']."' WHERE poll_id='".intval(POLLID)."' ");
|
||||
}
|
||||
|
||||
$admin_log->log_event('POLL_02','ID: '.POLLID.' - '.$poll_title,'');
|
||||
e107::getLog()->add('POLL_02','ID: '.POLLID.' - '.$poll_title,'');
|
||||
//$message = POLLAN_45;
|
||||
}
|
||||
else
|
||||
@@ -181,7 +181,7 @@ class poll
|
||||
}
|
||||
}
|
||||
$ret = $sql->insert("polls", "'0', ".time().", ".intval($active_start).", ".intval($active_end).", ".ADMINID.", '{$poll_title}', '{$poll_options}', '{$votes}', '', '1', '".$tp->toDB($poll_comment)."', '".intval($multipleChoice)."', '".intval($showResults)."', '".intval($pollUserclass)."', '".intval($storageMethod)."'");
|
||||
$admin_log->log_event('POLL_03','ID: '.$ret.' - '.$poll_title,''); // Intentionally only log admin-entered polls
|
||||
e107::getLog()->add('POLL_03','ID: '.$ret.' - '.$poll_title,''); // Intentionally only log admin-entered polls
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -200,7 +200,7 @@ if(isset($_POST['delete']))
|
||||
{
|
||||
$d_idt = array_keys($_POST['delete']);
|
||||
$message = ($sql -> db_Delete("rss", "rss_id=".intval($d_idt[0]))) ? LAN_DELETED : LAN_DELETED_FAILED;
|
||||
$admin_log->log_event('RSS_01','ID: '.intval($d_idt[0]).' - '.$message,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('RSS_01','ID: '.intval($d_idt[0]).' - '.$message,E_LOG_INFORMATIVE,'');
|
||||
$e107cache->clear("rss");
|
||||
}
|
||||
|
||||
|
@@ -199,7 +199,7 @@ class tagwords
|
||||
return implode($this->pref['tagwords_word_seperator'], $arr);
|
||||
}
|
||||
//return a \n seperated list of tagwords for the specific item
|
||||
return implode("\n", $ret);
|
||||
return implode($this->pref['tagwords_word_seperator'], $ret);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -295,10 +295,10 @@ class tagwords
|
||||
|
||||
//get existing word records
|
||||
$existing_array = $this->getRecords($tag_type, $tag_itemid, false);
|
||||
$existing = explode("\n", $existing_array);
|
||||
$existing = explode($this->pref['tagwords_word_seperator'], $existing_array);
|
||||
|
||||
//create array of new posted words
|
||||
$new = explode("\n", $tag_word);
|
||||
$new = explode($this->pref['tagwords_word_seperator'], $tag_word);
|
||||
|
||||
//delete the differences (delete what has been removed)
|
||||
$delete_diff = array_diff($existing, $new);
|
||||
|
@@ -40,7 +40,7 @@ if (isset($_POST['moderate']))
|
||||
}
|
||||
if (count($temp))
|
||||
{
|
||||
$admin_log->log_event('TRACK_02',implode(', ',$temp), E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('TRACK_02',implode(', ',$temp), E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
}
|
||||
$ns->tablerender("", "<div style='text-align:center'><b>".TRACKBACK_L15."</b></div>");
|
||||
|
@@ -60,7 +60,7 @@ if (isset($_POST['update_theme']))
|
||||
$pref['allow_theme_select'] = $themeeditclass;
|
||||
save_prefs();
|
||||
$woffle = LAN_UMENU_THEME_8.$pref['allowed_themes'].'[!br!]'.LAN_UMENU_THEME_9.$pref['allow_theme_select'];
|
||||
$admin_log->log_event('UTHEME_01',$woffle,E_LOG_INFORMATIVE,'');
|
||||
e107::getLog()->add('UTHEME_01',$woffle,E_LOG_INFORMATIVE,'');
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -112,7 +112,7 @@ img.featurebox { border-radius: 5px }
|
||||
|
||||
.btn-featurebox, .btn-cpage { margin-top:10px }
|
||||
|
||||
|
||||
.tab-pane { padding-top:15px }
|
||||
|
||||
/* CUSTOM Responsive Styles */
|
||||
|
||||
|
@@ -5,32 +5,33 @@ $(document).ready(function()
|
||||
var hash = event.target.href.toString().split('#')[1], form = $(event.target).parents('form')[0];
|
||||
window.location.hash = '/' + hash;
|
||||
if(form) {
|
||||
$(form).attr('action', $(form).attr('action').split('#')[0] + '#/' + hash);
|
||||
$(form).attr('action', $(form).attr('action').split('#')[0] + '#/' + hash);
|
||||
}
|
||||
});
|
||||
|
||||
// tabs hash
|
||||
if(/^#\/\w+/.test(window.location.hash)) {
|
||||
var hash = window.location.hash.substr(2);
|
||||
if(hash.match('^tab')) $('.nav-tabs a[href=#' + hash + ']').tab('show');
|
||||
if(hash.match('^tab')){ $('.nav-tabs a[href=#' + hash + ']').tab('show'); }
|
||||
}
|
||||
|
||||
$('.e-typeahead').each(function() {
|
||||
$('.e-typeahead').each( function(){
|
||||
|
||||
var id = $(this).attr("id");
|
||||
var name = '#' + id.replace('-usersearch', '');
|
||||
var newval = $(this).attr("data-value");
|
||||
$(this).typeahead({
|
||||
source: $(this).attr("data-source"),
|
||||
updater: function(text, type){
|
||||
if(type == 'value')
|
||||
{
|
||||
$(name).val(text);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
$(this).typeahead({
|
||||
source: $(this).attr("data-source"),
|
||||
updater: function(text, type){
|
||||
if(type === 'value')
|
||||
{
|
||||
$(name).val(text);
|
||||
}
|
||||
return text;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/* Switch to Tab containing invalid form field. */
|
||||
$('input[type=submit],button[type=submit]').on('click', function() {
|
||||
@@ -38,25 +39,24 @@ $(document).ready(function()
|
||||
var id = $(this).closest('form').attr('id');
|
||||
var found = false;
|
||||
|
||||
$('#'+id).find(':invalid').each(function(index, node) {
|
||||
$('#'+id).find('input:invalid,select:invalid,textarea:invalid').each(function(index, node) {
|
||||
|
||||
var tab = $('#'+node.id).closest('.tab-pane').attr('id');
|
||||
|
||||
if(tab && (found == false))
|
||||
if(tab && (found === false))
|
||||
{
|
||||
$('a[href="#'+tab+'"]').tab('show');
|
||||
found = true;
|
||||
//alert(node.id+' : '+tab);
|
||||
// alert(node.id+' : '+tab + ' '.index);
|
||||
}
|
||||
// var label = $('label[for=' + node.id + ']');
|
||||
})
|
||||
// var label = $('label[for=' + node.id + ']');
|
||||
});
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
// run tips on title attribute.
|
||||
$(".e-tip").each(function() {
|
||||
|
||||
@@ -125,6 +125,7 @@ $(document).ready(function()
|
||||
{
|
||||
var caption = $(this).attr('data-loading-text');
|
||||
$(this).removeClass('btn-success');
|
||||
$(this).removeClass('btn-primary');
|
||||
$(this).html(caption);
|
||||
if($(this).attr('data-disable') == 'true')
|
||||
{
|
||||
@@ -139,6 +140,7 @@ $(document).ready(function()
|
||||
var caption = $(this).attr('data-loading-text');
|
||||
$(this).val(caption);
|
||||
$(this).removeClass('btn-success');
|
||||
$(this).removeClass('btn-primary');
|
||||
//$(this).attr('disabled', 'disabled').val(caption);
|
||||
return true;
|
||||
}
|
||||
@@ -203,14 +205,22 @@ $(document).ready(function()
|
||||
|
||||
|
||||
|
||||
var progresspump = null;
|
||||
|
||||
|
||||
$('.e-progress-cancel').on('click', function(e)
|
||||
{
|
||||
clearInterval(progresspump);
|
||||
var target = $(this).attr('data-progress-target');
|
||||
$("#"+target).closest('.progress').removeClass("active");
|
||||
progresspump = null;
|
||||
alert('stopped');
|
||||
});
|
||||
|
||||
$('.e-progress').on('click', function(e)
|
||||
{
|
||||
// alert('Process Started');
|
||||
|
||||
var target = 'progress';
|
||||
var target = $(this).attr('data-progress-target');
|
||||
var script = $(this).attr('data-progress');
|
||||
var show = $(this).attr('data-progress-show');
|
||||
var hide = $(this).attr('data-progress-hide');
|
||||
@@ -224,33 +234,33 @@ $(document).ready(function()
|
||||
|
||||
$("#"+target).css('width','1%'); // so we know it's running.
|
||||
|
||||
var progresspump = setInterval(function(){
|
||||
progresspump = setInterval(function(){
|
||||
|
||||
$.get(script, { mode: mode }).done( function(data){
|
||||
|
||||
// alert(data);
|
||||
$("#"+target).css('width',data+'%'); // update the progress bar width */
|
||||
$("#"+target).html(data+'%'); // display the numeric value */
|
||||
// alert(data);
|
||||
$("#"+target).css('width', data+'%'); // update the progress bar width */
|
||||
$("#"+target).html(data+'%'); // display the numeric value */
|
||||
|
||||
if(data > 99.999) {
|
||||
|
||||
clearInterval(progresspump);
|
||||
clearInterval(progresspump);
|
||||
$("#"+target).closest('.progress').removeClass("active");
|
||||
|
||||
$("#progressouter").removeClass("active");
|
||||
$("#"+target).html("Done");
|
||||
|
||||
if(hide !== 'undefined')
|
||||
{
|
||||
$('#'+hide).hide();
|
||||
$('#'+hide).hide();
|
||||
}
|
||||
|
||||
if(show !== 'undefined')
|
||||
{
|
||||
$('#'+show).show('slow');
|
||||
$('#'+show).show('slow');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -308,7 +318,8 @@ $(document).ready(function()
|
||||
|
||||
if(multi === undefined)
|
||||
{
|
||||
$(this).selectpicker();
|
||||
// $(this).selectpicker(); // causes HTML5 validation alert to be hidden.
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -695,7 +706,7 @@ $(document).ready(function()
|
||||
|
||||
// Text-area AutoGrow
|
||||
// $("textarea.e-autoheight").elastic();
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
|
||||
/* global $ */
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
@@ -37,8 +37,8 @@ $(document).ready(function()
|
||||
|
||||
$(".e-comment-submit").live("click", function(){
|
||||
|
||||
var url = $(this).attr("data-target");
|
||||
var sort = $(this).attr("data-sort");
|
||||
var url = $(this).attr("data-target");
|
||||
var sort = $(this).attr("data-sort");
|
||||
var pid = parseInt($(this).attr("data-pid"));
|
||||
var formid = (pid != '0') ? "#e-comment-form-reply" : "#e-comment-form";
|
||||
var data = $('form'+formid).serialize() ;
|
||||
@@ -231,7 +231,7 @@ $(document).ready(function()
|
||||
url: url + '?ajax_used=1&mode=delete',
|
||||
data: { itemid: sp[3] },
|
||||
success: function(data) {
|
||||
var a = $.parseJSON(data);
|
||||
var a = $.parseJSON(data);
|
||||
|
||||
if(!a.error)
|
||||
{
|
||||
@@ -248,9 +248,9 @@ $(document).ready(function()
|
||||
|
||||
$(".e-comment-approve").live("click", function(){
|
||||
|
||||
var url = $(this).attr("data-target");
|
||||
var sp = $(this).attr('id').split("-");
|
||||
var id = "#comment-status-" + sp[3];
|
||||
var url = $(this).attr("data-target");
|
||||
var sp = $(this).attr('id').split("-");
|
||||
var id = "#comment-status-" + sp[3];
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
@@ -259,12 +259,12 @@ $(document).ready(function()
|
||||
success: function(data) {
|
||||
|
||||
|
||||
var a = $.parseJSON(data);
|
||||
var a = $.parseJSON(data);
|
||||
|
||||
|
||||
if(!a.error)
|
||||
{
|
||||
//TODO modify status of html on page.
|
||||
//TODO modify status of html on page
|
||||
$(id).text(a.html)
|
||||
.fadeIn('slow')
|
||||
.addClass('e-comment-edit-success'); //TODO another class?
|
||||
@@ -289,28 +289,28 @@ $(document).ready(function()
|
||||
|
||||
$(".e-rate-thumb").live("click", function(){
|
||||
|
||||
var src = $(this).attr("href");
|
||||
var thumb = $(this);
|
||||
var tmp = src.split('#');
|
||||
var id = tmp[1];
|
||||
var src = tmp[0];
|
||||
var src = $(this).attr("href");
|
||||
var thumb = $(this);
|
||||
var tmp = src.split('#');
|
||||
var id = tmp[1];
|
||||
var src = tmp[0];
|
||||
|
||||
|
||||
$.ajax({
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: src,
|
||||
data: { ajax_used: 1, mode: 'thumb' },
|
||||
dataType: "html",
|
||||
success: function(html) {
|
||||
|
||||
if(html == '')
|
||||
if(html === '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var tmp = html.split('|');
|
||||
up= tmp[0];
|
||||
down = tmp[1];
|
||||
up= tmp[0];
|
||||
down = tmp[1];
|
||||
|
||||
$('#'+id +'-up').text(up);
|
||||
$('#'+id +'-down').text(down);
|
||||
@@ -323,4 +323,30 @@ $(document).ready(function()
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Switch to Tab containing invalid form field. */
|
||||
$('input[type=submit],button[type=submit]').on('click', function() {
|
||||
|
||||
var id = $(this).closest('form').attr('id'), found = false;
|
||||
|
||||
$('#'+ id).find(':invalid').each(function (index, node) {
|
||||
|
||||
var tab = $('#'+node.id).closest('.tab-pane').attr('id');
|
||||
// console.log(node.id);
|
||||
|
||||
if(tab && (found === false))
|
||||
{
|
||||
$('a[href="#'+tab+'"]').tab('show');
|
||||
found = true;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
33
index.php
33
index.php
@@ -89,17 +89,25 @@
|
||||
|
||||
$tmp = e107::getAddonConfig('e_url');
|
||||
|
||||
$req = str_replace(e_HTTP,'', e_REQUEST_URI);
|
||||
$req = (e_HTTP === '/') ? ltrim(e_REQUEST_URI,'/') : str_replace(e_HTTP,'', e_REQUEST_URI) ;
|
||||
|
||||
if(count($tmp))
|
||||
{
|
||||
|
||||
foreach($tmp as $plug=>$cfg)
|
||||
{
|
||||
|
||||
foreach($cfg as $k=>$v)
|
||||
{
|
||||
|
||||
$regex = '#'.$v['regex'].'#';
|
||||
|
||||
if(empty($v['redirect']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$newLocation = preg_replace($regex, $v['redirect'], $req);
|
||||
|
||||
if($newLocation !=$req)
|
||||
@@ -107,11 +115,24 @@
|
||||
$redirect = e107::getParser()->replaceConstants($newLocation);
|
||||
list($file,$query) = explode("?",$redirect,2);
|
||||
|
||||
parse_str($query,$_GET);
|
||||
// echo " file=".$file;
|
||||
include_once($file);
|
||||
//print_a($_GET);
|
||||
exit;
|
||||
if(!empty($query))
|
||||
{
|
||||
parse_str($query,$_GET);
|
||||
}
|
||||
|
||||
e107::getMessage()->addDebug('e_URL in <b>'.$plug.'</b> matched <b>'.$v['regex'].'</b> and included: <b>'.$file.'</b> with $_GET: '.print_a($_GET,true));
|
||||
|
||||
if(file_exists($file))
|
||||
{
|
||||
include_once($file);
|
||||
exit;
|
||||
}
|
||||
elseif(getperms('0'))
|
||||
{
|
||||
echo "File missing: ".$file;
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -453,7 +453,7 @@ if (isset($_POST['register']) && $pref['user_reg'] == 1)
|
||||
{
|
||||
$allData['errors']['user_email'] = ERR_GENERIC;
|
||||
$allData['errortext']['user_email'] = LAN_SIGNUP_71;
|
||||
$admin_log->log_event('USET_15',LAN_SIGNUP_103.e107::getIPHandler()->getIP(FALSE), 4);
|
||||
e107::getLog()->add('USET_15',LAN_SIGNUP_103.e107::getIPHandler()->getIP(FALSE), 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
19
user.php
19
user.php
@@ -68,10 +68,21 @@ if (isset($_POST['delp']))
|
||||
$qs = explode(".", e_QUERY);
|
||||
$self_page =($qs[0] == 'id' && intval($qs[1]) == USERID);
|
||||
|
||||
include_once(e107::coreTemplatePath('user')); //correct way to load a core template.
|
||||
|
||||
$USER_TEMPLATE = e107::getCoreTemplate('user');
|
||||
e107::scStyle($sc_style);
|
||||
|
||||
if(empty($USER_TEMPLATE)) // BC Fix for loading old templates.
|
||||
{
|
||||
echo "DEBUG: Using v1.x user template";
|
||||
include_once(e107::coreTemplatePath('user')); //correct way to load a core template.
|
||||
}
|
||||
|
||||
|
||||
$TEMPLATE = str_replace('{USER_EMBED_USERPROFILE}','{USER_ADDONS}', $TEMPLATE); // BC Fix
|
||||
|
||||
$user_shortcodes = e107::getScBatch('user');
|
||||
|
||||
$user_shortcodes->wrapper('user/view');
|
||||
|
||||
|
||||
|
||||
@@ -214,7 +225,7 @@ echo "<div class='nextprev'> ".$tp->parseTemplate("{NEXTPREV={$parms}}")."<
|
||||
function renderuser($uid, $mode = "verbose")
|
||||
{
|
||||
global $sql, $pref, $tp, $sc_style, $user_shortcodes;
|
||||
global $EXTENDED_START, $EXTENDED_TABLE, $EXTENDED_END, $USER_SHORT_TEMPLATE, $USER_FULL_TEMPLATE;
|
||||
global $EXTENDED_START, $EXTENDED_TABLE, $EXTENDED_END, $USER_SHORT_TEMPLATE, $USER_FULL_TEMPLATE, $USER_TEMPLATE;
|
||||
global $user;
|
||||
|
||||
if(is_array($uid))
|
||||
@@ -233,7 +244,7 @@ function renderuser($uid, $mode = "verbose")
|
||||
|
||||
if($mode == 'verbose')
|
||||
{
|
||||
return $tp->parseTemplate($USER_FULL_TEMPLATE, TRUE, $user_shortcodes);
|
||||
return $tp->parseTemplate($USER_TEMPLATE['view'], TRUE, $user_shortcodes);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -629,12 +629,12 @@ if ($dataToSave && !$promptPassword)
|
||||
|
||||
// Now see if we need to log anything. First check the options and class membership
|
||||
// (Normally we would leave logging decision to the log class. But this one's a bit more complicated)
|
||||
$user_logging_opts = array_flip(explode(',', varset($pref['user_audit_opts'], '')));
|
||||
$user_logging_opts = e107::getConfig()->get('user_audit_opts');
|
||||
$do_log = array();
|
||||
$log_action = '';
|
||||
if ($_uid)
|
||||
{ // Its an admin changing someone elses data - make an admin log entry here
|
||||
$admin_log->log_event('USET_01', "UID: {$udata['user_id']}. UName: {$udata['user_name']}", E_LOG_INFORMATIVE);
|
||||
e107::getLog()->add('USET_01', "UID: {$udata['user_id']}. UName: {$udata['user_name']}", E_LOG_INFORMATIVE);
|
||||
// Check against the class of the target user, not the admin!
|
||||
if (!check_class(varset($pref['user_audit_class'], ''), $udata['user_class'])) { $user_logging_opts = array(); }
|
||||
}
|
||||
|
Reference in New Issue
Block a user