mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 22:57:14 +02:00
PHP8 - Core shortcode cleanup
This commit is contained in:
@@ -133,8 +133,11 @@ class admin_shortcodes
|
|||||||
|
|
||||||
$act = null; // FIXME
|
$act = null; // FIXME
|
||||||
|
|
||||||
$text = show_admin_menu(FOOTLAN_14, $act, $e107_var, FALSE, TRUE, TRUE);
|
if(function_exists('show_admin_menu'))
|
||||||
return $ns -> tablerender(FOOTLAN_14,$text, array('id' => 'admin_docs', 'style' => 'button_menu'), TRUE);
|
{
|
||||||
|
$text = show_admin_menu(FOOTLAN_14, $act, $e107_var, FALSE, TRUE, TRUE);
|
||||||
|
return $ns -> tablerender(FOOTLAN_14,$text, array('id' => 'admin_docs', 'style' => 'button_menu'), TRUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_adminui_help()
|
function sc_adminui_help()
|
||||||
@@ -278,7 +281,7 @@ class admin_shortcodes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_admin_lang($parm)
|
function sc_admin_lang($parm=null)
|
||||||
{
|
{
|
||||||
if (!ADMIN || !e107::getPref('multilanguage')) { return ''; }
|
if (!ADMIN || !e107::getPref('multilanguage')) { return ''; }
|
||||||
|
|
||||||
@@ -290,7 +293,14 @@ class admin_shortcodes
|
|||||||
e107::plugLan('user_menu', '', true);
|
e107::plugLan('user_menu', '', true);
|
||||||
|
|
||||||
$params = array();
|
$params = array();
|
||||||
parse_str($parm, $params);
|
if(is_string($parm))
|
||||||
|
{
|
||||||
|
parse_str($parm, $params);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$params = $parm;
|
||||||
|
}
|
||||||
|
|
||||||
$lanlist = explode(',',e_LANLIST);
|
$lanlist = explode(',',e_LANLIST);
|
||||||
sort($lanlist);
|
sort($lanlist);
|
||||||
@@ -366,6 +376,7 @@ class admin_shortcodes
|
|||||||
}
|
}
|
||||||
$text .= "<br /><br /></div>";
|
$text .= "<br /><br /></div>";
|
||||||
|
|
||||||
|
e107::includeLan(e_PLUGIN.'user/languages/English.php');
|
||||||
|
|
||||||
$select = '';
|
$select = '';
|
||||||
if(isset($pref['multilanguage_subdomain']) && $pref['multilanguage_subdomain'])
|
if(isset($pref['multilanguage_subdomain']) && $pref['multilanguage_subdomain'])
|
||||||
@@ -430,7 +441,7 @@ class admin_shortcodes
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_admin_latest($parm)
|
function sc_admin_latest($parm=null)
|
||||||
{
|
{
|
||||||
if(($parm == 'infopanel' || $parm == 'flexpanel') && !deftrue('e_ADMIN_HOME'))
|
if(($parm == 'infopanel' || $parm == 'flexpanel') && !deftrue('e_ADMIN_HOME'))
|
||||||
{
|
{
|
||||||
@@ -550,7 +561,7 @@ class admin_shortcodes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_admin_log($parm)
|
function sc_admin_log($parm=null)
|
||||||
{
|
{
|
||||||
if (getperms('0'))
|
if (getperms('0'))
|
||||||
{
|
{
|
||||||
@@ -558,7 +569,9 @@ class admin_shortcodes
|
|||||||
{
|
{
|
||||||
function admin_log()
|
function admin_log()
|
||||||
{
|
{
|
||||||
global $sql, $ns;
|
|
||||||
|
$sql = e107::getDb();
|
||||||
|
$ns = e107::getRender();
|
||||||
$text = E_16_ADMINLOG." <a style='cursor: pointer' onclick=\"expandit('adminlog')\">".ADLAN_116."</a>\n";
|
$text = E_16_ADMINLOG." <a style='cursor: pointer' onclick=\"expandit('adminlog')\">".ADLAN_116."</a>\n";
|
||||||
if (e_QUERY == 'logall')
|
if (e_QUERY == 'logall')
|
||||||
{
|
{
|
||||||
@@ -613,11 +626,11 @@ class admin_shortcodes
|
|||||||
$str = str_replace('.', '', ADMINPERMS);
|
$str = str_replace('.', '', ADMINPERMS);
|
||||||
if (ADMINPERMS == '0')
|
if (ADMINPERMS == '0')
|
||||||
{
|
{
|
||||||
return '<b>'.ADLAN_48.':</b> '.ADMINNAME.' ('.ADLAN_49.') '.( defined('e_DBLANGUAGE') ? '<b>'.LAN_HEADER_05.'</b>: '.e_DBLANGUAGE : '' );
|
return '<b>'.ADLAN_48.':</b> '.defset('ADMINNAME').' ('.ADLAN_49.') '.( defined('e_DBLANGUAGE') ? '<b>'.LAN_HEADER_05.'</b>: '.e_DBLANGUAGE : '' );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return '<b>'.ADLAN_48.':</b> '.ADMINNAME.' '.( defined('e_DBLANGUAGE') ? '<b>'.LAN_HEADER_05.'</b>: '.e_DBLANGUAGE : '' );
|
return '<b>'.ADLAN_48.':</b> '.defset('ADMINNAME').' '.( defined('e_DBLANGUAGE') ? '<b>'.LAN_HEADER_05.'</b>: '.e_DBLANGUAGE : '' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -626,9 +639,10 @@ class admin_shortcodes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_admin_logo($parm)
|
function sc_admin_logo($parm=null)
|
||||||
{
|
{
|
||||||
parse_str($parm);
|
// parse_str($parm);
|
||||||
|
|
||||||
|
|
||||||
if (isset($file) && $file && is_readable($file))
|
if (isset($file) && $file && is_readable($file))
|
||||||
{
|
{
|
||||||
@@ -664,7 +678,7 @@ class admin_shortcodes
|
|||||||
return $image;
|
return $image;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_admin_menu($parm)
|
function sc_admin_menu($parm=null)
|
||||||
{
|
{
|
||||||
if (!ADMIN)
|
if (!ADMIN)
|
||||||
{
|
{
|
||||||
@@ -819,7 +833,7 @@ class admin_shortcodes
|
|||||||
|
|
||||||
|
|
||||||
// FIXME - make it work
|
// FIXME - make it work
|
||||||
function sc_admin_pm($parm)
|
function sc_admin_pm($parm=null)
|
||||||
{
|
{
|
||||||
if(!e107::isInstalled('pm')) return;
|
if(!e107::isInstalled('pm')) return;
|
||||||
|
|
||||||
@@ -940,7 +954,7 @@ class admin_shortcodes
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_admin_msg($parm)
|
function sc_admin_msg($parm=null)
|
||||||
{
|
{
|
||||||
if (ADMIN)
|
if (ADMIN)
|
||||||
{
|
{
|
||||||
@@ -951,11 +965,16 @@ class admin_shortcodes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_admin_nav($parm)
|
function sc_admin_nav($parm=null)
|
||||||
{
|
{
|
||||||
if (ADMIN)
|
if (ADMIN)
|
||||||
{
|
{
|
||||||
global $ns, $pref, $array_functions, $tp;
|
// global $ns, $pref, $array_functions, $tp;
|
||||||
|
$tp = e107::getParser();
|
||||||
|
$ns = e107::getRender();
|
||||||
|
$pref = e107::getPref();
|
||||||
|
$array_functions = e107::getNav()->adminLinks('legacy');
|
||||||
|
|
||||||
$e107_var = array();
|
$e107_var = array();
|
||||||
|
|
||||||
if (strpos(e_SELF, '/admin.php') !== false)
|
if (strpos(e_SELF, '/admin.php') !== false)
|
||||||
@@ -1011,7 +1030,7 @@ class admin_shortcodes
|
|||||||
$readFile = $xml->loadXMLfile(e_PLUGIN.$plugin_path.'/plugin.xml', true, true);
|
$readFile = $xml->loadXMLfile(e_PLUGIN.$plugin_path.'/plugin.xml', true, true);
|
||||||
// e107::loadLanFiles($plugin_path, 'admin');
|
// e107::loadLanFiles($plugin_path, 'admin');
|
||||||
$eplug_caption = $tp->toHTML($readFile['@attributes']['name'], FALSE, 'defs, emotes_off');
|
$eplug_caption = $tp->toHTML($readFile['@attributes']['name'], FALSE, 'defs, emotes_off');
|
||||||
$eplug_conffile = $readFile['administration']['configFile'];
|
$eplug_conffile = !empty($readFile['administration']['configFile']) ? $readFile['administration']['configFile'] : '';
|
||||||
}
|
}
|
||||||
elseif (is_readable(e_PLUGIN.$plugin_path.'/plugin.php'))
|
elseif (is_readable(e_PLUGIN.$plugin_path.'/plugin.php'))
|
||||||
{
|
{
|
||||||
@@ -1034,15 +1053,18 @@ class admin_shortcodes
|
|||||||
unset($tmp);
|
unset($tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
$e107_var['lout']['text']=LAN_LOGOUT;
|
$e107_var['lout']['text'] = LAN_LOGOUT;
|
||||||
$e107_var['lout']['link']=e_ADMIN_ABS.'admin.php?logout';
|
$e107_var['lout']['link'] = e_ADMIN_ABS.'admin.php?logout';
|
||||||
|
|
||||||
$text = e_admin_menu('', '', $e107_var);
|
if(function_exists('e_admin_menu'))
|
||||||
return $ns->tablerender(LAN_HEADER_01, $text, array('id' => 'admin_nav', 'style' => 'button_menu'), TRUE);
|
{
|
||||||
|
$text = e_admin_menu('', '', $e107_var);
|
||||||
|
return $ns->tablerender(LAN_HEADER_01, $text, array('id' => 'admin_nav', 'style' => 'button_menu'), TRUE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_admin_plugins($parm)
|
function sc_admin_plugins($parm=null)
|
||||||
{
|
{
|
||||||
if (ADMIN)
|
if (ADMIN)
|
||||||
{
|
{
|
||||||
@@ -1110,7 +1132,7 @@ class admin_shortcodes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_admin_preset($parm)
|
function sc_admin_preset($parm=null)
|
||||||
{
|
{
|
||||||
//DEPRECATED
|
//DEPRECATED
|
||||||
}
|
}
|
||||||
@@ -1180,7 +1202,7 @@ class admin_shortcodes
|
|||||||
$themename = $data['@attributes']['name'];
|
$themename = $data['@attributes']['name'];
|
||||||
$themeversion = $data['@attributes']['version'];
|
$themeversion = $data['@attributes']['version'];
|
||||||
$themedate = $data['@attributes']['date'];
|
$themedate = $data['@attributes']['date'];
|
||||||
$themeauthor = $data['author']['@attributes']['name'];
|
$themeauthor = !empty($data['author']['@attributes']['name']) ? $data['author']['@attributes']['name'] : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$text = "<b>".FOOTLAN_1."</b>
|
$text = "<b>".FOOTLAN_1."</b>
|
||||||
@@ -1221,7 +1243,7 @@ class admin_shortcodes
|
|||||||
$text .= "<br />
|
$text .= "<br />
|
||||||
<b>".FOOTLAN_9."</b>
|
<b>".FOOTLAN_9."</b>
|
||||||
<br />".
|
<br />".
|
||||||
preg_replace("/PHP.*/i", "", $_SERVER['SERVER_SOFTWARE'])."<br />(".FOOTLAN_10.": ".$_SERVER['SERVER_NAME'].")
|
preg_replace("/PHP.*/i", "", varset($_SERVER['SERVER_SOFTWARE']))."<br />(".FOOTLAN_10.": ".$_SERVER['SERVER_NAME'].")
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<b>".FOOTLAN_11."</b>
|
<b>".FOOTLAN_11."</b>
|
||||||
<br />
|
<br />
|
||||||
@@ -1244,7 +1266,7 @@ class admin_shortcodes
|
|||||||
".date('r').
|
".date('r').
|
||||||
"<br />";
|
"<br />";
|
||||||
|
|
||||||
return $ns->tablerender(FOOTLAN_13, $text, '', TRUE);
|
return e107::getRender()->tablerender(FOOTLAN_13, $text, '', TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1264,7 +1286,7 @@ class admin_shortcodes
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_admin_status($parm)
|
function sc_admin_status($parm=null)
|
||||||
{
|
{
|
||||||
if(($parm == 'infopanel' || $parm == 'flexpanel') && !deftrue('e_ADMIN_HOME'))
|
if(($parm == 'infopanel' || $parm == 'flexpanel') && !deftrue('e_ADMIN_HOME'))
|
||||||
{
|
{
|
||||||
@@ -1988,11 +2010,21 @@ Inverse 10 <span class="badge badge-inverse">10</span>
|
|||||||
function sc_admin_navigation($parm=null)
|
function sc_admin_navigation($parm=null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!ADMIN) return '';
|
if(!ADMIN)
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
|
if(is_string($parm))
|
||||||
|
{
|
||||||
|
parse_str($parm, $parms);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$parms = $parm;
|
||||||
|
}
|
||||||
|
|
||||||
parse_str($parm, $parms);
|
|
||||||
$tmpl = strtoupper(varset($parms['tmpl'], 'E_ADMIN_NAVIGATION'));
|
$tmpl = strtoupper(varset($parms['tmpl'], 'E_ADMIN_NAVIGATION'));
|
||||||
global $$tmpl;
|
global $$tmpl;
|
||||||
|
|
||||||
|
@@ -519,12 +519,10 @@ class bbcode_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_bb($parm)
|
function sc_bb($parm=null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if(!empty($parm) && method_exists($this,"bb_".$parm)) // start of the big cleanup.
|
||||||
|
|
||||||
if(method_exists($this,"bb_".$parm)) // start of the big cleanup.
|
|
||||||
{
|
{
|
||||||
$meth = "bb_".$parm;
|
$meth = "bb_".$parm;
|
||||||
|
|
||||||
@@ -548,9 +546,9 @@ class bbcode_shortcodes extends e_shortcode
|
|||||||
global $pref, $eplug_bb, $bbcode_func, $bbcode_help, $bbcode_helpactive, $bbcode_helptag, $register_bb;
|
global $pref, $eplug_bb, $bbcode_func, $bbcode_help, $bbcode_helpactive, $bbcode_helptag, $register_bb;
|
||||||
|
|
||||||
|
|
||||||
$eplug_bb = $this->var['eplug_bb'] ? $this->var['eplug_bb'] : array();
|
$eplug_bb = isset($this->var['eplug_bb']) ? $this->var['eplug_bb'] : array();
|
||||||
|
|
||||||
$bbcode_func = ($this->var['trigger']) ? $this->var['trigger'] : "addtext";
|
$bbcode_func = isset($this->var['trigger']) ? $this->var['trigger'] : "addtext";
|
||||||
|
|
||||||
|
|
||||||
$bbcode_help = ($bbcode_help) ? $bbcode_help : "help";
|
$bbcode_help = ($bbcode_help) ? $bbcode_help : "help";
|
||||||
@@ -589,7 +587,7 @@ class bbcode_shortcodes extends e_shortcode
|
|||||||
// $bbcode['preimage'] = array("e-dialog", "preimage_selector_".$rand, LANHELP_45.$imagedir_display,"preimage.png","PreImage_Select","preimage_selector_".$rand);
|
// $bbcode['preimage'] = array("e-dialog", "preimage_selector_".$rand, LANHELP_45.$imagedir_display,"preimage.png","PreImage_Select","preimage_selector_".$rand);
|
||||||
// $bbcode['prefile'] = array("expandit", "prefile_selector_".$rand, LANHELP_39,"prefile.png","PreFile_Select",'prefile_selector_'.$rand);
|
// $bbcode['prefile'] = array("expandit", "prefile_selector_".$rand, LANHELP_39,"prefile.png","PreFile_Select",'prefile_selector_'.$rand);
|
||||||
|
|
||||||
if(!isset($iconpath[$parm]))
|
if(!isset($iconpath[$parm]) && !empty($parm))
|
||||||
{
|
{
|
||||||
$iconpath[$parm] = (file_exists(THEME."bbcode/bold.png") ? THEME_ABS."bbcode/" : e_IMAGE_ABS."bbcode/");
|
$iconpath[$parm] = (file_exists(THEME."bbcode/bold.png") ? THEME_ABS."bbcode/" : e_IMAGE_ABS."bbcode/");
|
||||||
$iconpath[$parm] .= varset($bbcode[$parm][3]);
|
$iconpath[$parm] .= varset($bbcode[$parm][3]);
|
||||||
@@ -627,7 +625,7 @@ class bbcode_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$iconpath[$parm]) return '';
|
if(empty($iconpath[$parm])) return '';
|
||||||
|
|
||||||
$pre = "\n";
|
$pre = "\n";
|
||||||
$post = "\n";
|
$post = "\n";
|
||||||
@@ -672,7 +670,7 @@ class bbcode_shortcodes extends e_shortcode
|
|||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_bb_help($parm)
|
function sc_bb_help($parm=null)
|
||||||
{
|
{
|
||||||
return ''; // Use tooltips instead.
|
return ''; // Use tooltips instead.
|
||||||
/*
|
/*
|
||||||
@@ -691,7 +689,7 @@ class bbcode_shortcodes extends e_shortcode
|
|||||||
return "<input id='{$bbcode_helptag}' class='helpbox {$bbcode_helpsize}' type='text' name='{$bbcode_helptag}' size='90' readonly='readonly' />";
|
return "<input id='{$bbcode_helptag}' class='helpbox {$bbcode_helpsize}' type='text' name='{$bbcode_helptag}' size='90' readonly='readonly' />";
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_bb_preimagedir($parm)
|
function sc_bb_preimagedir($parm=null)
|
||||||
{
|
{
|
||||||
|
|
||||||
// global $bbcode_imagedir;
|
// global $bbcode_imagedir;
|
||||||
|
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
e107::coreLan('comment');
|
||||||
|
|
||||||
class comment_shortcodes extends e_shortcode
|
class comment_shortcodes extends e_shortcode
|
||||||
{
|
{
|
||||||
@@ -31,7 +32,7 @@ class comment_shortcodes extends e_shortcode
|
|||||||
);
|
);
|
||||||
|
|
||||||
$text = '<div class="form-group">';
|
$text = '<div class="form-group">';
|
||||||
$text .= $form->text('subject', $tp->toForm($this->var['subject']), 100, $options);
|
$text .= $form->text('subject', $tp->toForm(varset($this->var['subject'])), 100, $options);
|
||||||
$text .= '</div>';
|
$text .= '</div>';
|
||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
@@ -46,7 +47,7 @@ class comment_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
global $SUBJECT, $NEWIMAGE;
|
global $SUBJECT, $NEWIMAGE;
|
||||||
|
|
||||||
if (vartrue($pref['nested_comments']))
|
if (!empty($pref['nested_comments']))
|
||||||
{
|
{
|
||||||
$SUBJECT = $NEWIMAGE." ".(empty($this->var['comment_subject']) ? $SUBJECT : $tp->toHTML($this->var['comment_subject'], TRUE));
|
$SUBJECT = $NEWIMAGE." ".(empty($this->var['comment_subject']) ? $SUBJECT : $tp->toHTML($this->var['comment_subject'], TRUE));
|
||||||
}
|
}
|
||||||
@@ -55,7 +56,7 @@ class comment_shortcodes extends e_shortcode
|
|||||||
$SUBJECT = '';
|
$SUBJECT = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $SUBJECT;
|
return trim($SUBJECT);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,7 +85,7 @@ class comment_shortcodes extends e_shortcode
|
|||||||
return e107::getDate()->computeLapse($this->var['comment_datestamp'],time(),false, false, 'short');
|
return e107::getDate()->computeLapse($this->var['comment_datestamp'],time(),false, false, 'short');
|
||||||
}
|
}
|
||||||
|
|
||||||
return e107::getDate()->convert_date($this->var['comment_datestamp'], "short");
|
return e107::getDate()->convert_date(varset($this->var['comment_datestamp'],0), "short");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -107,7 +108,7 @@ class comment_shortcodes extends e_shortcode
|
|||||||
$REPLY = '';
|
$REPLY = '';
|
||||||
if(USERID || $pref['anon_post'] == 1)
|
if(USERID || $pref['anon_post'] == 1)
|
||||||
{
|
{
|
||||||
if($this->var['comment_lock'] != "1" && $this->var['comment_blocked'] < 1)
|
if(isset($this->var['comment_lock']) && $this->var['comment_lock'] != "1" && $this->var['comment_blocked'] < 1)
|
||||||
{
|
{
|
||||||
if ($thisaction == "comment" && $pref['nested_comments'])
|
if ($thisaction == "comment" && $pref['nested_comments'])
|
||||||
{
|
{
|
||||||
@@ -147,7 +148,7 @@ class comment_shortcodes extends e_shortcode
|
|||||||
$text .= '<div class="left">';
|
$text .= '<div class="left">';
|
||||||
$text .= '<h2>' . $this->sc_username() . '</h2>';
|
$text .= '<h2>' . $this->sc_username() . '</h2>';
|
||||||
// $text .= e107::getDate()-> // convert($this->var['user_lastvisit'],'short');
|
// $text .= e107::getDate()-> // convert($this->var['user_lastvisit'],'short');
|
||||||
$text .= $this->sc_joined() . '<br />' . $this->sc_comments() . '<br />' . $this->sc_rating() . $this->sc_location;
|
$text .= $this->sc_joined() . '<br />' . $this->sc_comments() . '<br />' . $this->sc_rating() . $this->sc_location();
|
||||||
$text .= '</div>';
|
$text .= '</div>';
|
||||||
$text .= '</div>';
|
$text .= '</div>';
|
||||||
|
|
||||||
@@ -191,17 +192,19 @@ class comment_shortcodes extends e_shortcode
|
|||||||
function sc_comments($parm = null)
|
function sc_comments($parm = null)
|
||||||
{
|
{
|
||||||
global $COMMENTS;
|
global $COMMENTS;
|
||||||
return (isset($this->var['user_id']) && $this->var['user_id'] ? LAN_COMMENTS.": ".$this->var['user_comments'] : COMLAN_194)."<br />";
|
return (!empty($this->var['user_id']) ? LAN_COMMENTS.": ".varset($this->var['user_comments']) : COMLAN_194)."<br />";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_joined($parm = null)
|
function sc_joined($parm = null)
|
||||||
{
|
{
|
||||||
global $JOINED, $gen;
|
global $JOINED;
|
||||||
$JOINED = '';
|
$JOINED = '';
|
||||||
if ($this->var['user_id'] && !$this->var['user_admin']) {
|
if (!empty($this->var['user_id']) && empty($this->var['user_admin']))
|
||||||
$this->var['user_join'] = $gen->convert_date($this->var['user_join'], "short");
|
{
|
||||||
$JOINED = ($this->var['user_join'] ? COMLAN_145." ".$this->var['user_join'] : '');
|
$joined = varset($this->var['user_join'], 0);
|
||||||
|
$date = e107::getDate()->convert_date($joined, "short");
|
||||||
|
$JOINED = ($this->var['user_join'] ? COMLAN_145." ".$date : '');
|
||||||
}
|
}
|
||||||
return $JOINED;
|
return $JOINED;
|
||||||
}
|
}
|
||||||
@@ -308,7 +311,7 @@ class comment_shortcodes extends e_shortcode
|
|||||||
function sc_comment_rate($parm = null)
|
function sc_comment_rate($parm = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if($this->var['comment_blocked'] > 0 || $this->var['rating_enabled'] == false)
|
if($this->var['comment_blocked'] > 0 || varset($this->var['rating_enabled']) == false)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
e107::coreLan('contact');
|
||||||
|
|
||||||
class contact_shortcodes extends e_shortcode
|
class contact_shortcodes extends e_shortcode
|
||||||
{
|
{
|
||||||
@@ -31,8 +32,7 @@ class contact_shortcodes extends e_shortcode
|
|||||||
return "<input type='checkbox' name='email_copy' value='1' />";
|
return "<input type='checkbox' name='email_copy' value='1' />";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_contact_person($parm='')
|
function sc_contact_person($parm='')
|
||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
|
@@ -16,6 +16,7 @@ if(!defined('e107_INIT'))
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
e107::coreLan('error');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class error_shortcodes.
|
* Class error_shortcodes.
|
||||||
|
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
e107::coreLan('login');
|
||||||
|
|
||||||
class login_shortcodes extends e_shortcode
|
class login_shortcodes extends e_shortcode
|
||||||
{
|
{
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
require_once(__DIR__.'/news_shortcodes_legacy.php');
|
require_once(__DIR__.'/news_shortcodes_legacy.php');
|
||||||
|
e107::coreLan('news');
|
||||||
|
|
||||||
class news_shortcodes extends e_shortcode
|
class news_shortcodes extends e_shortcode
|
||||||
{
|
{
|
||||||
@@ -30,6 +31,8 @@ class news_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
private $imageItem;
|
private $imageItem;
|
||||||
|
|
||||||
|
public $param = array();
|
||||||
|
|
||||||
// protected $param; // do not enable - erases param. .
|
// protected $param; // do not enable - erases param. .
|
||||||
|
|
||||||
|
|
||||||
@@ -85,7 +88,7 @@ class news_shortcodes extends e_shortcode
|
|||||||
$news_body = $tp->toHTML($this->news_item['news_body'], true, 'BODY, fromadmin', $this->news_item['news_author']);
|
$news_body = $tp->toHTML($this->news_item['news_body'], true, 'BODY, fromadmin', $this->news_item['news_author']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->news_item['news_extended'] && (isset($_POST['preview']) || $this->param['current_action'] == 'extend') && ($parm != 'noextend' && $parm != 'body'))
|
if($this->news_item['news_extended'] && (isset($_POST['preview']) || varset($this->param['current_action']) === 'extend') && ($parm !== 'noextend' && $parm !== 'body'))
|
||||||
{
|
{
|
||||||
$news_body .= $tp->toHTML($this->news_item['news_extended'], true, 'BODY, fromadmin', $this->news_item['news_author']);
|
$news_body .= $tp->toHTML($this->news_item['news_extended'], true, 'BODY, fromadmin', $this->news_item['news_author']);
|
||||||
}
|
}
|
||||||
@@ -97,9 +100,9 @@ class news_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_news_author($parm)
|
function sc_news_author($parm=null)
|
||||||
{
|
{
|
||||||
if($this->news_item['user_id'])
|
if(!empty($this->news_item['user_id']))
|
||||||
{
|
{
|
||||||
if($parm == 'nolink')
|
if($parm == 'nolink')
|
||||||
{
|
{
|
||||||
@@ -146,16 +149,16 @@ class news_shortcodes extends e_shortcode
|
|||||||
$latest_comment = $comments['comment_datestamp'];
|
$latest_comment = $comments['comment_datestamp'];
|
||||||
if ($latest_comment > USERLV )
|
if ($latest_comment > USERLV )
|
||||||
{
|
{
|
||||||
$NEWIMAGE = $param['image_new_small'];
|
$NEWIMAGE = varset($param['image_new_small']);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$NEWIMAGE = $param['image_nonew_small'];
|
$NEWIMAGE = varset($param['image_nonew_small']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$NEWIMAGE = $param['image_nonew_small'];
|
$NEWIMAGE = varset($param['image_nonew_small']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(deftrue('BOOTSTRAP')) // Should be done with CSS, not like above.
|
if(deftrue('BOOTSTRAP')) // Should be done with CSS, not like above.
|
||||||
@@ -163,7 +166,7 @@ class news_shortcodes extends e_shortcode
|
|||||||
$NEWIMAGE = "";
|
$NEWIMAGE = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return (!$news_item['news_allow_comments'] ? ''.($pref['comments_icon'] ? $NEWIMAGE.' ' : '')."<a title=\"".LAN_COMMENTS."\" href='".e107::getUrl()->create('news/view/item', $news_item)."'>".$param['commentlink'].intval($news_item['news_comment_total']).'</a>' : vartrue($param['commentoffstring'],'Disabled') );
|
return (!$news_item['news_allow_comments'] ? ''.($pref['comments_icon'] ? $NEWIMAGE.' ' : '')."<a title=\"".LAN_COMMENTS."\" href='".e107::getUrl()->create('news/view/item', $news_item)."'>".varset($param['commentlink']).intval($news_item['news_comment_total']).'</a>' : vartrue($param['commentoffstring'],'Disabled') );
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_trackback($parm=null)
|
function sc_trackback($parm=null)
|
||||||
@@ -230,7 +233,7 @@ class news_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
function sc_news_category_id($parm=null)
|
function sc_news_category_id($parm=null)
|
||||||
{
|
{
|
||||||
return (int) $this->news_item['category_id'];
|
return !empty($this->news_item['category_id']) ? (int) $this->news_item['category_id'] : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -241,7 +244,7 @@ class news_shortcodes extends e_shortcode
|
|||||||
$parm = array('type'=>$parm);
|
$parm = array('type'=>$parm);
|
||||||
}
|
}
|
||||||
// BC
|
// BC
|
||||||
$category_icon = str_replace('../', '', trim($this->news_item['category_icon']));
|
$category_icon = !empty($this->news_item['category_icon']) ? str_replace('../', '', trim($this->news_item['category_icon'])) : '';
|
||||||
if (!$category_icon) { return ''; }
|
if (!$category_icon) { return ''; }
|
||||||
|
|
||||||
// We store SC path in DB now + BC
|
// We store SC path in DB now + BC
|
||||||
@@ -285,7 +288,7 @@ class news_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
function sc_news_category_name($parm=null)
|
function sc_news_category_name($parm=null)
|
||||||
{
|
{
|
||||||
if(empty($parm['link']))
|
if(empty($parm['link']) && isset($this->news_item['category_name']))
|
||||||
{
|
{
|
||||||
return e107::getParser()->toHTML($this->news_item['category_name'], 'TITLE');
|
return e107::getParser()->toHTML($this->news_item['category_name'], 'TITLE');
|
||||||
}
|
}
|
||||||
@@ -313,6 +316,11 @@ class news_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
function sc_news_category_url($parm=null)
|
function sc_news_category_url($parm=null)
|
||||||
{
|
{
|
||||||
|
if(empty($this->news_item['category_id']) || empty($this->news_item['category_sef']) )
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$category = array('id' => $this->news_item['category_id'], 'name' => $this->news_item['category_sef'] );
|
$category = array('id' => $this->news_item['category_id'], 'name' => $this->news_item['category_sef'] );
|
||||||
|
|
||||||
return e107::getUrl()->create('news/list/category', $category);
|
return e107::getUrl()->create('news/list/category', $category);
|
||||||
@@ -331,6 +339,11 @@ class news_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
public function sc_news_author_signature($parm=null)
|
public function sc_news_author_signature($parm=null)
|
||||||
{
|
{
|
||||||
|
if(empty($this->news_item['user_id']))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$user = e107::user($this->news_item['user_id']);
|
$user = e107::user($this->news_item['user_id']);
|
||||||
|
|
||||||
if(!empty($user['user_signature']))
|
if(!empty($user['user_signature']))
|
||||||
@@ -341,6 +354,11 @@ class news_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
public function sc_news_author_items_url($parm=null)
|
public function sc_news_author_items_url($parm=null)
|
||||||
{
|
{
|
||||||
|
if(empty($this->news_item['user_name']))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return e107::getUrl()->create('news/list/author',array('author'=>$this->news_item['user_name'])); // e_BASE."news.php?author=".$val
|
return e107::getUrl()->create('news/list/author',array('author'=>$this->news_item['user_name'])); // e_BASE."news.php?author=".$val
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -350,6 +368,11 @@ class news_shortcodes extends e_shortcode
|
|||||||
*/
|
*/
|
||||||
public function sc_news_author_euf($parm=null)
|
public function sc_news_author_euf($parm=null)
|
||||||
{
|
{
|
||||||
|
if(empty($this->news_item['user_id']))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$userid = $this->news_item['user_id'];
|
$userid = $this->news_item['user_id'];
|
||||||
$field = (!empty($parm['field'])) ? $parm['field'] : '';
|
$field = (!empty($parm['field'])) ? $parm['field'] : '';
|
||||||
$type = (!empty($parm['type'])) ? $parm['type'] : 'value';
|
$type = (!empty($parm['type'])) ? $parm['type'] : 'value';
|
||||||
@@ -545,8 +568,8 @@ class news_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
function sc_newscategory($parm=null)
|
function sc_newscategory($parm=null)
|
||||||
{
|
{
|
||||||
$category_name = e107::getParser()->toHTML($this->news_item['category_name'], FALSE ,'defs');
|
$category_name = !empty($this->news_item['category_name']) ? e107::getParser()->toHTML($this->news_item['category_name'], FALSE ,'defs') : '';
|
||||||
$category = array('id' => $this->news_item['category_id'], 'name' => $this->news_item['category_sef'] );
|
$category = !empty($this->news_item['category_id']) ? array('id' => $this->news_item['category_id'], 'name' => $this->news_item['category_sef'] ) : array();
|
||||||
// $categoryClass = varset($GLOBALS['NEWS_CSSMODE'],'');
|
// $categoryClass = varset($GLOBALS['NEWS_CSSMODE'],'');
|
||||||
$style = isset($this->param['catlink']) ? "style='".$this->param['catlink']."'" : '';
|
$style = isset($this->param['catlink']) ? "style='".$this->param['catlink']."'" : '';
|
||||||
return "<a ".$style." href='".e107::getUrl()->create('news/list/category', $category)."'>".$category_name."</a>";
|
return "<a ".$style." href='".e107::getUrl()->create('news/list/category', $category)."'>".$category_name."</a>";
|
||||||
@@ -727,7 +750,7 @@ class news_shortcodes extends e_shortcode
|
|||||||
return "<div class='".(defined('ADMINNAME') ? ADMINNAME : "null")."'>".($this->news_item['news_render_type'] == 1 ? "<a href='".e107::getUrl()->create('news/view/item', $this->news_item)."'>".$news_title."</a>" : $news_title)."</div>";
|
return "<div class='".(defined('ADMINNAME') ? ADMINNAME : "null")."'>".($this->news_item['news_render_type'] == 1 ? "<a href='".e107::getUrl()->create('news/view/item', $this->news_item)."'>".$news_title."</a>" : $news_title)."</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_adminbody($parm)
|
function sc_adminbody($parm=null)
|
||||||
{
|
{
|
||||||
$news_body = $this->sc_news_body($parm);
|
$news_body = $this->sc_news_body($parm);
|
||||||
return "<div class='".(defined('ADMINNAME') ? ADMINNAME : 'null')."'>".$news_body.'</div>';
|
return "<div class='".(defined('ADMINNAME') ? ADMINNAME : 'null')."'>".$news_body.'</div>';
|
||||||
@@ -1046,8 +1069,13 @@ class news_shortcodes extends e_shortcode
|
|||||||
* @param string $parm
|
* @param string $parm
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function sc_newsitem_schook($parm='')
|
function sc_newsitem_schook($parm=null)
|
||||||
{
|
{
|
||||||
|
if(!is_string($parm))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$parm = explode('|', $parm, 2);
|
$parm = explode('|', $parm, 2);
|
||||||
$parm[1] = 'news_id='.$this->news_item['news_id'].(varset($parm[1]) ? '&'.$parm[1] : '');
|
$parm[1] = 'news_id='.$this->news_item['news_id'].(varset($parm[1]) ? '&'.$parm[1] : '');
|
||||||
e107::setRegistry('core/news/schook_data', array('data' => $this->news_item, 'params' => $this->param));
|
e107::setRegistry('core/news/schook_data', array('data' => $this->news_item, 'params' => $this->param));
|
||||||
|
@@ -73,17 +73,17 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
if(empty($cid))
|
if(empty($cid))
|
||||||
{
|
{
|
||||||
$pid = $this->var['page_chapter'];
|
$pid = $this->var['page_chapter'];
|
||||||
$cid = $this->chapterData[$pid]['chapter_parent'];
|
$cid = isset($this->chapterData[$pid]['chapter_parent']) ? $this->chapterData[$pid]['chapter_parent'] : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$row = $this->chapterData[$cid];
|
$row = isset($this->chapterData[$cid]) ? $this->chapterData[$cid] : array();
|
||||||
|
|
||||||
if(!empty($row['chapter_id']) && $row['chapter_parent'] < 1)
|
if(!empty($row['chapter_id']) && $row['chapter_parent'] < 1)
|
||||||
{
|
{
|
||||||
return $row;
|
return $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false; // not a book.
|
return false; // not a book.
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,12 +109,20 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
return $text ? e107::getParser()->toHTML($text, true, 'BODY') : '';
|
return $text ? e107::getParser()->toHTML($text, true, 'BODY') : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_cpageauthor($parm)
|
function sc_cpageauthor($parm=null)
|
||||||
{
|
{
|
||||||
$parms = eHelper::scParams($parm);
|
$parms = eHelper::scParams($parm);
|
||||||
$author = '';
|
$author = '';
|
||||||
$url = e107::getUrl()->create('user/profile/view', array('name' => $this->var['user_name'], 'id' => $this->var['user_id']));
|
|
||||||
|
if(!empty($this->var['user_name']))
|
||||||
|
{
|
||||||
|
$url = e107::getUrl()->create('user/profile/view', array('name' => $this->var['user_name'], 'id' => $this->var['user_id']));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$url = '';
|
||||||
|
}
|
||||||
|
|
||||||
if(isset($parms['url']))
|
if(isset($parms['url']))
|
||||||
{
|
{
|
||||||
return $url;
|
return $url;
|
||||||
@@ -123,8 +131,14 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
if($this->var['page_author'])
|
if($this->var['page_author'])
|
||||||
{
|
{
|
||||||
// currently this field used as Real Name, no matter what the db name says
|
// currently this field used as Real Name, no matter what the db name says
|
||||||
if($this->var['user_login'] && !isset($parms['user'])) $author = $this->var['user_login'];
|
if(!empty($this->var['user_login']) && !isset($parms['user']))
|
||||||
elseif($this->var['user_name']) $author = preg_replace('/[^\w\pL\s]+/u', ' ', $this->var['user_name']);
|
{
|
||||||
|
$author = $this->var['user_login'];
|
||||||
|
}
|
||||||
|
elseif(!empty($this->var['user_name']))
|
||||||
|
{
|
||||||
|
$author = preg_replace('/[^\w\pL\s]+/u', ' ', $this->var['user_name']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(empty($author)) return '';
|
if(empty($author)) return '';
|
||||||
@@ -139,7 +153,7 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
return '<a class="cpage-author" href="'.$url.'" title="">'.$author.'</a>';
|
return '<a class="cpage-author" href="'.$url.'" title="">'.$author.'</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_cpagedate($parm)
|
function sc_cpagedate($parm=null)
|
||||||
{
|
{
|
||||||
if(empty($parm))
|
if(empty($parm))
|
||||||
{
|
{
|
||||||
@@ -187,12 +201,12 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
function sc_cpagenav()
|
function sc_cpagenav()
|
||||||
{
|
{
|
||||||
return $this->var['np'];
|
return isset($this->var['np']) ? $this->var['np'] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_cpagerating()
|
function sc_cpagerating()
|
||||||
{
|
{
|
||||||
return $this->var['rating'];
|
return isset($this->var['rating']) ? $this->var['rating'] : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_cpagemessage()
|
function sc_cpagemessage()
|
||||||
@@ -251,6 +265,7 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
// For Future Use..
|
// For Future Use..
|
||||||
|
/*
|
||||||
function sc_cpageimage($parm = '')
|
function sc_cpageimage($parm = '')
|
||||||
{
|
{
|
||||||
list($num,$size) = explode("|",$parm);
|
list($num,$size) = explode("|",$parm);
|
||||||
@@ -259,9 +274,9 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
$img = explode(",",$this->var['page_images']);
|
$img = explode(",",$this->var['page_images']);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
function sc_cpagelink($parm)
|
function sc_cpagelink($parm=null)
|
||||||
{
|
{
|
||||||
$url = $this->sc_cpageurl();
|
$url = $this->sc_cpageurl();
|
||||||
|
|
||||||
@@ -278,7 +293,7 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
* @example {CPAGEBUTTON: class=btn large default mb&target=blank}
|
* @example {CPAGEBUTTON: class=btn large default mb&target=blank}
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function sc_cpagebutton($parm)
|
function sc_cpagebutton($parm=null)
|
||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
|
|
||||||
@@ -430,7 +445,7 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
$route = ($this->var['page_chapter'] == 0) ? 'page/view/other' : 'page/view';
|
$route = ($this->var['page_chapter'] == 0) ? 'page/view/other' : 'page/view';
|
||||||
$urldata = $this->var;
|
$urldata = $this->var;
|
||||||
|
|
||||||
if($this->var['page_chapter'] && $this->chapterData[$this->var['page_chapter']])
|
if(!empty($this->var['page_chapter']) && isset($this->chapterData[$this->var['page_chapter']]))
|
||||||
{
|
{
|
||||||
$chapter = $this->chapterData[$this->var['page_chapter']];
|
$chapter = $this->chapterData[$this->var['page_chapter']];
|
||||||
$urldata = array_merge($this->var, $chapter);
|
$urldata = array_merge($this->var, $chapter);
|
||||||
@@ -457,47 +472,64 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
function sc_book_id()
|
function sc_book_id()
|
||||||
{
|
{
|
||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
$row = $this->getBook();
|
|
||||||
|
if($row = $this->getBook())
|
||||||
return $row['chapter_id'];
|
{
|
||||||
|
return $row['chapter_id'];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_book_name()
|
function sc_book_name()
|
||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$row = $this->getBook();
|
|
||||||
|
|
||||||
return $tp->toHTML($row['chapter_name'], false, 'TITLE');
|
if( $row = $this->getBook())
|
||||||
|
{
|
||||||
|
return $tp->toHTML($row['chapter_name'], false, 'TITLE');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_book_anchor()
|
function sc_book_anchor()
|
||||||
{
|
{
|
||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
$row = $this->getBook();
|
|
||||||
|
if($row = $this->getBook())
|
||||||
return $frm->name2id($row['chapter_name']);
|
{
|
||||||
|
return $frm->name2id($row['chapter_name']);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_book_icon()
|
function sc_book_icon()
|
||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$row = $this->getBook();
|
|
||||||
|
if($row = $this->getBook())
|
||||||
return $tp->toIcon($row['chapter_icon'], array('space'=>' '));
|
{
|
||||||
|
return $tp->toIcon($row['chapter_icon'], array('space'=>' '));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_book_description()
|
function sc_book_description()
|
||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$row = $this->getBook();
|
|
||||||
|
if($row = $this->getBook())
|
||||||
return $tp->toHTML($row['chapter_meta_description'], true, 'BODY');
|
{
|
||||||
|
return $tp->toHTML($row['chapter_meta_description'], true, 'BODY');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_book_url()
|
function sc_book_url()
|
||||||
{
|
{
|
||||||
$row = $this->getBook();
|
if($row = $this->getBook())
|
||||||
return e107::getUrl()->create('page/book/index', $row,'allow=chapter_id,chapter_sef,book_sef') ;
|
{
|
||||||
|
return e107::getUrl()->create('page/book/index', $row,'allow=chapter_id,chapter_sef,book_sef') ;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------- Chapter - specific to the current page. -------------------------
|
// -------------------- Chapter - specific to the current page. -------------------------
|
||||||
@@ -507,8 +539,10 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
*/
|
*/
|
||||||
function sc_chapter_id()
|
function sc_chapter_id()
|
||||||
{
|
{
|
||||||
$row = $this->getChapter();
|
if($row = $this->getChapter())
|
||||||
return $row['chapter_id'];
|
{
|
||||||
|
return $row['chapter_id'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -518,11 +552,10 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
*/
|
*/
|
||||||
function sc_chapter_name()
|
function sc_chapter_name()
|
||||||
{
|
{
|
||||||
|
if($row = $this->getChapter())
|
||||||
$tp = e107::getParser();
|
{
|
||||||
$row = $this->getChapter();
|
return e107::getParser()->toHTML($row['chapter_name'], false, 'TITLE');
|
||||||
|
}
|
||||||
return $tp->toHTML($row['chapter_name'], false, 'TITLE');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -540,10 +573,10 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
*/
|
*/
|
||||||
function sc_chapter_anchor()
|
function sc_chapter_anchor()
|
||||||
{
|
{
|
||||||
$frm = e107::getForm();
|
if($row = $this->getChapter())
|
||||||
$row = $this->getChapter();
|
{
|
||||||
|
return e107::getForm()->name2id($row['chapter_name']);
|
||||||
return $frm->name2id($row['chapter_name']);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -551,18 +584,19 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
*/
|
*/
|
||||||
function sc_chapter_icon()
|
function sc_chapter_icon()
|
||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
if($row = $this->getChapter())
|
||||||
$row = $this->getChapter();
|
{
|
||||||
|
return e107::getParser()->toIcon($row['chapter_icon']);
|
||||||
return $tp->toIcon($row['chapter_icon']);
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_chapter_image($parm=null)
|
function sc_chapter_image($parm=null)
|
||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
if($row = $this->getChapter())
|
||||||
$row = $this->getChapter();
|
{
|
||||||
|
return e107::getParser()->toImage($row['chapter_image'],$parm);
|
||||||
return $tp->toImage($row['chapter_image'],$parm);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -570,10 +604,10 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
*/
|
*/
|
||||||
function sc_chapter_description()
|
function sc_chapter_description()
|
||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
if($row = $this->getChapter())
|
||||||
$row = $this->getChapter();
|
{
|
||||||
|
return e107::getParser()->toHTML($row['chapter_meta_description'], true, 'BODY');
|
||||||
return $tp->toHTML($row['chapter_meta_description'], true, 'BODY');
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -581,20 +615,24 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
*/
|
*/
|
||||||
function sc_chapter_url()
|
function sc_chapter_url()
|
||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
if(!$row = $this->getChapter())
|
||||||
$row = $this->getChapter();
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$brow = $this->getBook($row['chapter_parent']);
|
if($brow = $this->getBook($row['chapter_parent']))
|
||||||
$row['book_sef'] = vartrue($brow['chapter_sef'],"no-sef-found"); //$this->getBook();
|
{
|
||||||
|
$row['book_sef'] = vartrue($brow['chapter_sef'],"no-sef-found"); //$this->getBook();
|
||||||
|
|
||||||
return e107::getUrl()->create('page/chapter/index', $row,'allow=chapter_id,chapter_sef,book_sef') ;
|
return e107::getUrl()->create('page/chapter/index', $row,'allow=chapter_id,chapter_sef,book_sef') ;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @example {CHAPTER_BUTTON: text=More&size=sm}
|
* @example {CHAPTER_BUTTON: text=More&size=sm}
|
||||||
*/
|
*/
|
||||||
function sc_chapter_button($options)
|
function sc_chapter_button($options=null)
|
||||||
{
|
{
|
||||||
$text = vartrue($options['text'], LAN_READ_MORE);
|
$text = vartrue($options['text'], LAN_READ_MORE);
|
||||||
$size = vartrue($options['size'], "");
|
$size = vartrue($options['size'], "");
|
||||||
@@ -631,9 +669,12 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
function sc_chapter_breadcrumb()
|
function sc_chapter_breadcrumb()
|
||||||
{
|
{
|
||||||
|
$brow = array();
|
||||||
|
|
||||||
$row = $this->getChapter();
|
if($row = $this->getChapter())
|
||||||
$brow = $this->getBook($row['chapter_parent']);
|
{
|
||||||
|
$brow = $this->getBook($row['chapter_parent']);
|
||||||
|
}
|
||||||
|
|
||||||
if(empty($brow['chapter_sef']))
|
if(empty($brow['chapter_sef']))
|
||||||
{
|
{
|
||||||
@@ -643,8 +684,7 @@ class cpage_shortcodes extends e_shortcode
|
|||||||
$breadcrumb = e107::breadcrumb();
|
$breadcrumb = e107::breadcrumb();
|
||||||
|
|
||||||
return e107::getForm()->breadcrumb($breadcrumb);
|
return e107::getForm()->breadcrumb($breadcrumb);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ class signup_shortcodes extends e_shortcode
|
|||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sc_signup_coppa_form($parm)
|
function sc_signup_coppa_form($parm=null)
|
||||||
{
|
{
|
||||||
if (strpos(LAN_SIGNUP_77, "stage") !== FALSE)
|
if (strpos(LAN_SIGNUP_77, "stage") !== FALSE)
|
||||||
{
|
{
|
||||||
@@ -53,7 +53,7 @@ class signup_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_signup_xup($param) // show it to those who were using xup
|
function sc_signup_xup($param=null) // show it to those who were using xup
|
||||||
{
|
{
|
||||||
switch ($param)
|
switch ($param)
|
||||||
{
|
{
|
||||||
@@ -69,7 +69,7 @@ class signup_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO - template
|
// TODO - template
|
||||||
function sc_signup_xup_login($parm)
|
function sc_signup_xup_login($parm=null)
|
||||||
{
|
{
|
||||||
if (!e107::getUserProvider()->isSocialLoginEnabled()) return '';
|
if (!e107::getUserProvider()->isSocialLoginEnabled()) return '';
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ class signup_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO - template
|
// TODO - template
|
||||||
function sc_signup_xup_signup($parm)
|
function sc_signup_xup_signup($parm=null)
|
||||||
{
|
{
|
||||||
if (!e107::getUserProvider()->isSocialLoginEnabled()) return '';
|
if (!e107::getUserProvider()->isSocialLoginEnabled()) return '';
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ class signup_shortcodes extends e_shortcode
|
|||||||
if (check_class($pref['displayname_class']))
|
if (check_class($pref['displayname_class']))
|
||||||
{
|
{
|
||||||
$dis_name_len = varset($pref['displayname_maxlength'],15);
|
$dis_name_len = varset($pref['displayname_maxlength'],15);
|
||||||
$val = ($_POST['username']) ? filter_var($_POST['username'], FILTER_SANITIZE_STRING) : '';
|
$val = !empty($_POST['username']) ? filter_var($_POST['username'], FILTER_SANITIZE_STRING) : '';
|
||||||
return e107::getForm()->text('username', $val, $dis_name_len);
|
return e107::getForm()->text('username', $val, $dis_name_len);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -222,7 +222,7 @@ class signup_shortcodes extends e_shortcode
|
|||||||
$options['class'] = vartrue($parm['class'],'');
|
$options['class'] = vartrue($parm['class'],'');
|
||||||
$options['placeholder'] = vartrue($parm['placeholder']) ? $parm['placeholder'] : '';
|
$options['placeholder'] = vartrue($parm['placeholder']) ? $parm['placeholder'] : '';
|
||||||
|
|
||||||
$val = ($_POST['loginname']) ? filter_var($_POST['loginname'], FILTER_SANITIZE_STRING) : '';
|
$val = !empty($_POST['loginname']) ? filter_var($_POST['loginname'], FILTER_SANITIZE_STRING) : '';
|
||||||
|
|
||||||
return e107::getForm()->text('loginname', $val, $log_name_length, $options);
|
return e107::getForm()->text('loginname', $val, $log_name_length, $options);
|
||||||
}
|
}
|
||||||
@@ -467,7 +467,7 @@ class signup_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
function sc_signup_extended_user_fields($parm=null)
|
function sc_signup_extended_user_fields($parm=null)
|
||||||
{
|
{
|
||||||
global $usere, $tp, $SIGNUP_EXTENDED_USER_FIELDS, $SIGNUP_EXTENDED_CAT;
|
global $SIGNUP_EXTENDED_USER_FIELDS, $SIGNUP_EXTENDED_CAT;
|
||||||
$text = "";
|
$text = "";
|
||||||
|
|
||||||
$search = array(
|
$search = array(
|
||||||
@@ -476,21 +476,22 @@ class signup_shortcodes extends e_shortcode
|
|||||||
'{EXTENDED_USER_FIELD_EDIT}'
|
'{EXTENDED_USER_FIELD_EDIT}'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$ue = e107::getUserExt();
|
||||||
|
$tp = e107::getParser();
|
||||||
// What we need is a list of fields, ordered first by parent, and then by display order?
|
// What we need is a list of fields, ordered first by parent, and then by display order?
|
||||||
// category entries are `user_extended_struct_type` = 0
|
// category entries are `user_extended_struct_type` = 0
|
||||||
// 'unallocated' entries are `user_extended_struct_parent` = 0
|
// 'unallocated' entries are `user_extended_struct_parent` = 0
|
||||||
|
|
||||||
// Get a list of defined categories
|
// Get a list of defined categories
|
||||||
$catList = $usere->user_extended_get_categories(FALSE);
|
$catList = $ue->getCategories(FALSE);
|
||||||
// Add in category zero - the 'no category' category
|
// Add in category zero - the 'no category' category
|
||||||
array_unshift($catList,array('user_extended_struct_parent' => 0, 'user_extended_struct_id' => '0'));
|
array_unshift($catList,array('user_extended_struct_parent' => 0, 'user_extended_struct_id' => '0'));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach($catList as $cat)
|
foreach($catList as $cat)
|
||||||
{
|
{
|
||||||
$extList = $usere->user_extended_get_fieldList($cat['user_extended_struct_id']);
|
$extList = $ue->user_extended_get_fieldList($cat['user_extended_struct_id']);
|
||||||
|
|
||||||
$done_heading = FALSE;
|
$done_heading = FALSE;
|
||||||
|
|
||||||
@@ -526,7 +527,7 @@ class signup_shortcodes extends e_shortcode
|
|||||||
$replace = array(
|
$replace = array(
|
||||||
$label,
|
$label,
|
||||||
($ext['user_extended_struct_required'] == 1 ? $this->sc_signup_is_mandatory('true') : ''),
|
($ext['user_extended_struct_required'] == 1 ? $this->sc_signup_is_mandatory('true') : ''),
|
||||||
$usere->renderElement($ext, $_POST['ue']['user_' . $ext['user_extended_struct_name']], $opts)
|
$ue->renderElement($ext, $_POST['ue']['user_' . $ext['user_extended_struct_name']], $opts)
|
||||||
);
|
);
|
||||||
|
|
||||||
$text .= str_replace($search, $replace, $SIGNUP_EXTENDED_USER_FIELDS);
|
$text .= str_replace($search, $replace, $SIGNUP_EXTENDED_USER_FIELDS);
|
||||||
@@ -606,13 +607,11 @@ class signup_shortcodes extends e_shortcode
|
|||||||
'signature' => 'signup_option_signature',
|
'signature' => 'signup_option_signature',
|
||||||
);
|
);
|
||||||
|
|
||||||
if((!empty($mandatory[$parm]) && (int) $pref[$mandatory[$parm]] === 2) || $parm === 'true' || ($parm === 'email' && empty($pref['disable_emailcheck'])))
|
if((!empty($parm) && !empty($mandatory[$parm]) && (int) $pref[$mandatory[$parm]] === 2) || $parm === 'true' || ($parm === 'email' && empty($pref['disable_emailcheck'])))
|
||||||
{
|
{
|
||||||
return "<span class='required'><!-- empty --></span>";
|
return "<span class='required'><!-- empty --></span>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(!empty($parm))
|
if(!empty($parm))
|
||||||
{
|
{
|
||||||
switch($parm)
|
switch($parm)
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
e107::coreLan('sitedown');
|
||||||
|
|
||||||
class sitedown_shortcodes extends e_shortcode
|
class sitedown_shortcodes extends e_shortcode
|
||||||
{
|
{
|
||||||
|
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
e107::coreLan('user');
|
||||||
|
|
||||||
class user_shortcodes extends e_shortcode
|
class user_shortcodes extends e_shortcode
|
||||||
{
|
{
|
||||||
@@ -211,16 +212,22 @@ class user_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
function sc_user_realname_icon($parm='')
|
function sc_user_realname_icon($parm='')
|
||||||
{
|
{
|
||||||
|
$ret = '';
|
||||||
|
|
||||||
if(defined("USER_REALNAME_ICON"))
|
if(defined("USER_REALNAME_ICON"))
|
||||||
{
|
{
|
||||||
return USER_REALNAME_ICON;
|
$ret = USER_REALNAME_ICON;
|
||||||
}
|
}
|
||||||
if(file_exists(THEME."images/user_realname.png"))
|
elseif(file_exists(THEME."images/user_realname.png"))
|
||||||
{
|
{
|
||||||
return "<img src='".THEME_ABS."images/user_realname.png' alt='' style='vertical-align:middle;' /> ";
|
$ret = "<img src='".THEME_ABS."images/user_realname.png' alt='' style='vertical-align:middle;' /> ";
|
||||||
}
|
}
|
||||||
|
elseif(defined('IMODE') && file_exists( e_IMAGE."user_icons/user_realname_".IMODE.".png"))
|
||||||
return "<img src='".e_IMAGE_ABS."user_icons/user_realname_".IMODE.".png' alt='' style='vertical-align:middle;' /> ";
|
{
|
||||||
|
$ret = "<img src='".e_IMAGE_ABS."user_icons/user_realname_".IMODE.".png' alt='' style='vertical-align:middle;' /> ";
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -419,7 +426,7 @@ class user_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
function sc_user_birthday($parm='')
|
function sc_user_birthday($parm='')
|
||||||
{
|
{
|
||||||
if ($this->var['user_birthday'] != "" && $this->var['user_birthday'] != "0000-00-00" && preg_match("/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/", $this->var['user_birthday'], $regs))
|
if(!empty($this->var['user_birthday']) && $this->var['user_birthday'] != "0000-00-00" && preg_match("/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/", $this->var['user_birthday'], $regs))
|
||||||
{
|
{
|
||||||
return "$regs[3].$regs[2].$regs[1]";
|
return "$regs[3].$regs[2].$regs[1]";
|
||||||
}
|
}
|
||||||
@@ -430,14 +437,13 @@ class user_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_user_signature($parm)
|
function sc_user_signature($parm=null)
|
||||||
{
|
{
|
||||||
$tp = e107::getParser();
|
return !empty($this->var['user_signature']) ? e107::getParser()->toHTML($this->var['user_signature'], TRUE) : null;
|
||||||
return $this->var['user_signature'] ? $tp->toHTML($this->var['user_signature'], TRUE) : "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_user_comments_link($parm)
|
function sc_user_comments_link($parm=null)
|
||||||
{
|
{
|
||||||
if($this->commentsDisabled)
|
if($this->commentsDisabled)
|
||||||
{
|
{
|
||||||
@@ -447,14 +453,14 @@ class user_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_user_forum_link($parm)
|
function sc_user_forum_link($parm=null)
|
||||||
{
|
{
|
||||||
$user_forumposts = e107::getDb()->count("forum_thread","(*)","where thread_user=".$this->var['user_id']);
|
$user_forumposts = e107::getDb()->count("forum_thread","(*)","where thread_user=".$this->var['user_id']);
|
||||||
return $user_forumposts ? "<a href='".e_HTTP."userposts.php?0.forums.".$this->var['user_id']."'>".LAN_USER_37."</a>" : "";
|
return $user_forumposts ? "<a href='".e_HTTP."userposts.php?0.forums.".$this->var['user_id']."'>".LAN_USER_37."</a>" : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_user_sendpm($parm)
|
function sc_user_sendpm($parm=null)
|
||||||
{
|
{
|
||||||
$pref = e107::getPref();
|
$pref = e107::getPref();
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
@@ -465,7 +471,7 @@ class user_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_user_rating($parm='')
|
function sc_user_rating($parm=null)
|
||||||
{
|
{
|
||||||
$pref = e107::getPref();
|
$pref = e107::getPref();
|
||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
@@ -511,7 +517,7 @@ class user_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_user_update_link($parm)
|
function sc_user_update_link($parm=null)
|
||||||
{
|
{
|
||||||
$label = null;
|
$label = null;
|
||||||
|
|
||||||
@@ -598,7 +604,7 @@ class user_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_user_photo($parm)
|
function sc_user_photo($parm=null)
|
||||||
{
|
{
|
||||||
$row = array('user_image'=>$this->var['user_sess']);
|
$row = array('user_image'=>$this->var['user_sess']);
|
||||||
|
|
||||||
@@ -606,7 +612,7 @@ class user_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_user_picture($parm)
|
function sc_user_picture($parm=null)
|
||||||
{
|
{
|
||||||
return e107::getParser()->toAvatar($this->var, $parm);
|
return e107::getParser()->toAvatar($this->var, $parm);
|
||||||
|
|
||||||
@@ -628,7 +634,7 @@ class user_shortcodes extends e_shortcode
|
|||||||
/* sc_USER_AVATAR - see single/user_avatar.php */
|
/* sc_USER_AVATAR - see single/user_avatar.php */
|
||||||
|
|
||||||
|
|
||||||
function sc_user_picture_name($parm)
|
function sc_user_picture_name($parm=null)
|
||||||
{
|
{
|
||||||
if (ADMIN && getperms("4"))
|
if (ADMIN && getperms("4"))
|
||||||
{
|
{
|
||||||
@@ -637,7 +643,7 @@ class user_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_user_picture_delete($parm)
|
function sc_user_picture_delete($parm=null)
|
||||||
{
|
{
|
||||||
if (USERID == $this->var['user_id'] || (ADMIN && getperms("4")))
|
if (USERID == $this->var['user_id'] || (ADMIN && getperms("4")))
|
||||||
{
|
{
|
||||||
@@ -660,9 +666,10 @@ class user_shortcodes extends e_shortcode
|
|||||||
function sc_user_userclass_icon($parm = null)
|
function sc_user_userclass_icon($parm = null)
|
||||||
{
|
{
|
||||||
$icons = array();
|
$icons = array();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
$amount = 0;
|
||||||
|
|
||||||
if($parm['amount'])
|
if(isset($parm['amount']))
|
||||||
{
|
{
|
||||||
$amount = intval($parm['amount']);
|
$amount = intval($parm['amount']);
|
||||||
}
|
}
|
||||||
@@ -732,7 +739,7 @@ class user_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_user_extended_all($parm)
|
function sc_user_extended_all($parm=null)
|
||||||
{
|
{
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
@@ -817,7 +824,7 @@ class user_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_profile_comments($parm)
|
function sc_profile_comments($parm=null)
|
||||||
{
|
{
|
||||||
if(!e107::getPref('profile_comments'))
|
if(!e107::getPref('profile_comments'))
|
||||||
{
|
{
|
||||||
@@ -828,8 +835,11 @@ class user_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
// return e107::getRender()->tablerender($ret['caption'],$ret['comment_form']. $ret['comment'], 'profile_comments', TRUE);
|
// return e107::getRender()->tablerender($ret['caption'],$ret['comment_form']. $ret['comment'], 'profile_comments', TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated
|
||||||
|
* @param string $parm
|
||||||
|
*/
|
||||||
function sc_profile_comment_form($parm='') // deprecated.
|
function sc_profile_comment_form($parm='') // deprecated.
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -837,14 +847,14 @@ class user_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_total_users($parm='')
|
function sc_total_users($parm=null)
|
||||||
{
|
{
|
||||||
global $users_total;
|
global $users_total;
|
||||||
return $users_total;
|
return (int) $users_total;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_user_form_records($parm='')
|
function sc_user_form_records($parm=null)
|
||||||
{
|
{
|
||||||
global $records;
|
global $records;
|
||||||
|
|
||||||
@@ -853,7 +863,7 @@ class user_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_user_form_order($parm)
|
function sc_user_form_order($parm=null)
|
||||||
{
|
{
|
||||||
global $order;
|
global $order;
|
||||||
|
|
||||||
@@ -875,7 +885,7 @@ class user_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_user_form_start($parm)
|
function sc_user_form_start($parm=null)
|
||||||
{
|
{
|
||||||
global $from;
|
global $from;
|
||||||
|
|
||||||
@@ -887,19 +897,19 @@ class user_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_user_form_end($parm)
|
function sc_user_form_end($parm=null)
|
||||||
{
|
{
|
||||||
return "</form>";
|
return "</form>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_user_form_submit($parm)
|
function sc_user_form_submit($parm=null)
|
||||||
{
|
{
|
||||||
return "<input class='btn btn-default btn-secondary button' type='submit' name='submit' value='".LAN_GO."' />";
|
return "<input class='btn btn-default btn-secondary button' type='submit' name='submit' value='".LAN_GO."' />";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_user_addons($parm='')
|
function sc_user_addons($parm=null)
|
||||||
{
|
{
|
||||||
$template = e107::getCoreTemplate('user','addon');
|
$template = e107::getCoreTemplate('user','addon');
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
@@ -935,7 +945,7 @@ class user_shortcodes extends e_shortcode
|
|||||||
/**
|
/**
|
||||||
* @Deprecated Use {USER_ADDONS} instead.
|
* @Deprecated Use {USER_ADDONS} instead.
|
||||||
*/
|
*/
|
||||||
function sc_user_embed_userprofile($parm='')
|
function sc_user_embed_userprofile($parm=null)
|
||||||
{
|
{
|
||||||
return $this->sc_user_addons($parm);
|
return $this->sc_user_addons($parm);
|
||||||
//if no parm, it means we render ALL embedded contents
|
//if no parm, it means we render ALL embedded contents
|
||||||
@@ -1014,7 +1024,7 @@ class user_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_user_customtitle($parm)
|
function sc_user_customtitle($parm=null)
|
||||||
{
|
{
|
||||||
return $this->var['user_customtitle'];
|
return $this->var['user_customtitle'];
|
||||||
}
|
}
|
||||||
|
@@ -14,15 +14,24 @@
|
|||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
|
e107::coreLan('user');
|
||||||
|
e107::coreLan('usersettings');
|
||||||
|
|
||||||
class usersettings_shortcodes extends e_shortcode
|
class usersettings_shortcodes extends e_shortcode
|
||||||
{
|
{
|
||||||
private $extendedTabs = false;
|
private $extendedTabs = false;
|
||||||
public $legacyTemplate = array();
|
public $legacyTemplate = array();
|
||||||
|
private $pref;
|
||||||
|
|
||||||
function sc_username($parm) // This is the 'display name'
|
function __construct()
|
||||||
{
|
{
|
||||||
$pref = e107::getPref();
|
$this->pref = e107::getPref();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function sc_username($parm=null) // This is the 'display name'
|
||||||
|
{
|
||||||
|
$pref = $this->pref;
|
||||||
$dis_name_len = varset($pref['displayname_maxlength'], 15);
|
$dis_name_len = varset($pref['displayname_maxlength'], 15);
|
||||||
|
|
||||||
if(check_class($pref['displayname_class']) || $pref['allowEmailLogin'] == 1) // display if email is used for login.
|
if(check_class($pref['displayname_class']) || $pref['allowEmailLogin'] == 1) // display if email is used for login.
|
||||||
@@ -51,19 +60,18 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_loginname($parm)
|
function sc_loginname($parm=null)
|
||||||
{
|
{
|
||||||
$pref = e107::getPref();
|
|
||||||
|
|
||||||
if($pref['allowEmailLogin'] == 1) // email/password login only.
|
if($this->pref['allowEmailLogin'] == 1) // email/password login only.
|
||||||
{
|
{
|
||||||
return; // hide login name when email-login is being used. (may contain social login info)
|
return; // hide login name when email-login is being used. (may contain social login info)
|
||||||
}
|
}
|
||||||
|
|
||||||
$log_name_length = varset($pref['loginname_maxlength'], 30);
|
$log_name_length = varset($this->pref['loginname_maxlength'], 30);
|
||||||
|
|
||||||
$options = array(
|
$options = array(
|
||||||
'title' => ($pref['allowEmailLogin'] == 1) ? LAN_USER_82 : LAN_USER_80,
|
'title' => ($this->pref['allowEmailLogin'] == 1) ? LAN_USER_82 : LAN_USER_80,
|
||||||
'size' => 40,
|
'size' => 40,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -79,30 +87,29 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_customtitle($parm)
|
function sc_customtitle($parm=null)
|
||||||
{
|
{
|
||||||
$pref = e107::getPref();
|
if ($this->pref['signup_option_customtitle'])
|
||||||
if ($pref['signup_option_customtitle'])
|
|
||||||
{
|
{
|
||||||
$options = array(
|
$options = array(
|
||||||
'title'=> '',
|
'title'=> '',
|
||||||
'size' => 40,
|
'size' => 40,
|
||||||
'required' => ($pref['signup_option_customtitle'] == 2));
|
'required' => ($this->pref['signup_option_customtitle'] == 2));
|
||||||
return e107::getForm()->text('customtitle', $this->var['user_customtitle'], 100, $options);
|
return e107::getForm()->text('customtitle', $this->var['user_customtitle'], 100, $options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_realname($parm)
|
function sc_realname($parm=null)
|
||||||
{
|
{
|
||||||
$pref = e107::getPref();
|
|
||||||
if ($pref['signup_option_realname'])
|
if ($this->pref['signup_option_realname'])
|
||||||
{
|
{
|
||||||
$sc = e107::getScBatch('usersettings');
|
$sc = e107::getScBatch('usersettings');
|
||||||
$options = array(
|
$options = array(
|
||||||
'title' => '',
|
'title' => '',
|
||||||
'size' => 40,
|
'size' => 40,
|
||||||
'required' => ($pref['signup_option_realname'] == 2),
|
'required' => ($this->pref['signup_option_realname'] == 2),
|
||||||
);
|
);
|
||||||
if(!empty($sc->var['user_login']) && !empty($sc->var['user_xup'])) // social login active.
|
if(!empty($sc->var['user_login']) && !empty($sc->var['user_xup'])) // social login active.
|
||||||
{
|
{
|
||||||
@@ -114,9 +121,9 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
function sc_realname2($parm)
|
function sc_realname2($parm=null)
|
||||||
{
|
{
|
||||||
$pref = e107::getPref();
|
|
||||||
$sc = e107::getScBatch('usersettings');
|
$sc = e107::getScBatch('usersettings');
|
||||||
|
|
||||||
$options = array(
|
$options = array(
|
||||||
@@ -135,9 +142,8 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
function sc_password1($parm)
|
function sc_password1($parm=null)
|
||||||
{
|
{
|
||||||
$pref = e107::getPref();
|
|
||||||
|
|
||||||
if(!empty($this->var['user_xup'])) // social login active.
|
if(!empty($this->var['user_xup'])) // social login active.
|
||||||
{
|
{
|
||||||
@@ -155,16 +161,15 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_password2($parm)
|
function sc_password2($parm=null)
|
||||||
{
|
{
|
||||||
$pref = e107::getPref();
|
|
||||||
|
|
||||||
if(!empty($this->var['user_xup'])) // social login active.
|
if(!empty($this->var['user_xup'])) // social login active.
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isset($pref['auth_method']) || $pref['auth_method'] == '' || $pref['auth_method'] == 'e107' || $pref['auth_method'] == '>e107')
|
if(!isset($this->pref['auth_method']) || $this->pref['auth_method'] == '' || $this->pref['auth_method'] == 'e107' || $this->pref['auth_method'] == '>e107')
|
||||||
{
|
{
|
||||||
$options = array('size' => 40,'title'=>LAN_USET_23, 'required'=>0);
|
$options = array('size' => 40,'title'=>LAN_USET_23, 'required'=>0);
|
||||||
return e107::getForm()->password('password2', '', 20, $options);
|
return e107::getForm()->password('password2', '', 20, $options);
|
||||||
@@ -175,21 +180,20 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_password_len($parm)
|
function sc_password_len($parm=null)
|
||||||
{
|
{
|
||||||
$pref = e107::getPref();
|
if(!isset($this->pref['auth_method']) || ($this->pref['auth_method'] != 'e107' && $this->pref['auth_method'] != '>e107'))
|
||||||
if(!isset($pref['auth_method']) || ($pref['auth_method'] != 'e107' && $pref['auth_method'] != '>e107'))
|
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
return $pref['signup_pass_len'];
|
return $this->pref['signup_pass_len'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_email($parm)
|
function sc_email($parm=null)
|
||||||
{
|
{
|
||||||
$sc = e107::getScBatch('usersettings');
|
$sc = $this;
|
||||||
|
|
||||||
$options = array(
|
$options = array(
|
||||||
'size' => 40,
|
'size' => 40,
|
||||||
@@ -208,7 +212,7 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_hideemail($parm)
|
function sc_hideemail($parm=null)
|
||||||
{
|
{
|
||||||
if($parm == 'radio')
|
if($parm == 'radio')
|
||||||
{
|
{
|
||||||
@@ -219,12 +223,11 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_userclasses($parm)
|
function sc_userclasses($parm=null)
|
||||||
{
|
{
|
||||||
global $e_userclass;
|
global $e_userclass;
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$pref = e107::getPref();
|
|
||||||
|
|
||||||
$ret = "";
|
$ret = "";
|
||||||
if(ADMIN && $this->var['user_id'] != USERID)
|
if(ADMIN && $this->var['user_id'] != USERID)
|
||||||
{
|
{
|
||||||
@@ -256,10 +259,9 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_signature($parm)
|
function sc_signature($parm=null)
|
||||||
{
|
{
|
||||||
$pref = e107::getPref();
|
if(!check_class(varset($this->pref['signature_access'],0)))
|
||||||
if(!check_class(varset($pref['signature_access'],0)))
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -274,7 +276,7 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
/**
|
/**
|
||||||
* @DEPRECATED - it is integreated with sc_signature now.
|
* @DEPRECATED - it is integreated with sc_signature now.
|
||||||
*/
|
*/
|
||||||
function sc_signature_help($parm)
|
function sc_signature_help($parm=null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
/*
|
/*
|
||||||
@@ -289,14 +291,14 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_avatar_upload($parm) // deprecated and combined into avatarpicker() (see sc_avatar_remote)
|
function sc_avatar_upload($parm=null) // deprecated and combined into avatarpicker() (see sc_avatar_remote)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_avatar_remote($parm)
|
function sc_avatar_remote($parm=null)
|
||||||
{
|
{
|
||||||
if(!empty($this->var['user_xup'])) // social login active.
|
if(!empty($this->var['user_xup'])) // social login active.
|
||||||
{
|
{
|
||||||
@@ -309,21 +311,20 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_avatar_choose($parm) // deprecated
|
function sc_avatar_choose($parm=null) // deprecated
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function sc_photo_upload($parm)
|
function sc_photo_upload($parm=null)
|
||||||
{
|
{
|
||||||
$diz = LAN_USET_27.". ".LAN_USET_28.".";
|
$diz = LAN_USET_27.". ".LAN_USET_28.".";
|
||||||
$text = '';
|
$text = '';
|
||||||
|
|
||||||
if(USERPHOTO)
|
if(defset('USERPHOTO'))
|
||||||
{
|
{
|
||||||
|
|
||||||
$text .= e107::getParser()->parseTemplate("{PICTURE}",true);
|
$text .= e107::getParser()->parseTemplate("{PICTURE}",true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -367,6 +368,7 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
e107::getMessage()->addDebug("No extended fields found");
|
e107::getMessage()->addDebug("No extended fields found");
|
||||||
|
$catList = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$catList[] = array("user_extended_struct_id" => 0, "user_extended_struct_name" => LAN_USET_7);
|
$catList[] = array("user_extended_struct_id" => 0, "user_extended_struct_name" => LAN_USET_7);
|
||||||
@@ -403,10 +405,12 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_userextended_cat($parm = '')
|
function sc_userextended_cat($parm = 0)
|
||||||
{
|
{
|
||||||
global $extended_showed;
|
global $extended_showed;
|
||||||
|
|
||||||
|
$parm = (int) $parm;
|
||||||
|
|
||||||
if(THEME_LEGACY === true)
|
if(THEME_LEGACY === true)
|
||||||
{
|
{
|
||||||
$USER_EXTENDED_CAT = $this->legacyTemplate['USER_EXTENDED_CAT'];
|
$USER_EXTENDED_CAT = $this->legacyTemplate['USER_EXTENDED_CAT'];
|
||||||
@@ -424,6 +428,7 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret = "";
|
$ret = "";
|
||||||
$catInfo = e107::getRegistry("extendedcat_{$parm}");
|
$catInfo = e107::getRegistry("extendedcat_{$parm}");
|
||||||
if(!$catInfo)
|
if(!$catInfo)
|
||||||
@@ -432,7 +437,7 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
SELECT * FROM #user_extended_struct
|
SELECT * FROM #user_extended_struct
|
||||||
WHERE user_extended_struct_applicable IN (" . $tp->toDB($this->var['userclass_list'], true) . ")
|
WHERE user_extended_struct_applicable IN (" . $tp->toDB($this->var['userclass_list'], true) . ")
|
||||||
AND user_extended_struct_write IN (" . USERCLASS_LIST . ")
|
AND user_extended_struct_write IN (" . USERCLASS_LIST . ")
|
||||||
AND user_extended_struct_id = " . intval($parm) . "
|
AND user_extended_struct_id = " . (int) $parm . "
|
||||||
";
|
";
|
||||||
if($sql->gen($qry))
|
if($sql->gen($qry))
|
||||||
{
|
{
|
||||||
@@ -446,7 +451,7 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
SELECT * FROM #user_extended_struct
|
SELECT * FROM #user_extended_struct
|
||||||
WHERE user_extended_struct_applicable IN (" . $tp->toDB($this->var['userclass_list'], true) . ")
|
WHERE user_extended_struct_applicable IN (" . $tp->toDB($this->var['userclass_list'], true) . ")
|
||||||
AND user_extended_struct_write IN (" . USERCLASS_LIST . ")
|
AND user_extended_struct_write IN (" . USERCLASS_LIST . ")
|
||||||
AND user_extended_struct_parent = " . intval($parm) . "
|
AND user_extended_struct_parent = " . (int) $parm . "
|
||||||
AND user_extended_struct_type != 0
|
AND user_extended_struct_type != 0
|
||||||
ORDER BY user_extended_struct_order ASC
|
ORDER BY user_extended_struct_order ASC
|
||||||
";
|
";
|
||||||
@@ -466,7 +471,7 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
if($ret && $this->extendedTabs == false)
|
if($ret && $this->extendedTabs == false)
|
||||||
{
|
{
|
||||||
$catName = $catInfo['user_extended_struct_text'] ? $catInfo['user_extended_struct_text'] : $catInfo['user_extended_struct_name'];
|
$catName = !empty($catInfo['user_extended_struct_text']) ? $catInfo['user_extended_struct_text'] : $catInfo['user_extended_struct_name'];
|
||||||
if(defined($catName))
|
if(defined($catName))
|
||||||
{
|
{
|
||||||
$catName = constant($catName);
|
$catName = constant($catName);
|
||||||
@@ -480,9 +485,13 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function sc_userextended_field($parm = '')
|
function sc_userextended_field($parm = null)
|
||||||
{
|
{
|
||||||
global $extended_showed;
|
global $extended_showed;
|
||||||
|
if(empty($parm))
|
||||||
|
{
|
||||||
|
$parm = '';
|
||||||
|
}
|
||||||
|
|
||||||
$ue = e107::getUserExt();
|
$ue = e107::getUserExt();
|
||||||
|
|
||||||
@@ -557,7 +566,7 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
$fhide = $ue->user_extended_hide($fInfo, $chk);
|
$fhide = $ue->user_extended_hide($fInfo, $chk);
|
||||||
}
|
}
|
||||||
|
|
||||||
$uVal = str_replace(chr(1), "", $this->var['user_' . $parm]);
|
$uVal = str_replace(chr(1), "", varset($this->var['user_' . $parm]));
|
||||||
$fval = $ue->user_extended_edit($fInfo, $uVal);
|
$fval = $ue->user_extended_edit($fInfo, $uVal);
|
||||||
|
|
||||||
|
|
||||||
@@ -594,16 +603,35 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sc_required($parm=null)
|
||||||
|
{
|
||||||
|
if(empty($parm) || !isset($this->pref['signup_option_'.$parm]))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($parm === 'email' && !e107::getPref('disable_emailcheck'))
|
||||||
|
{
|
||||||
|
return $this->required(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((int) $this->pref['signup_option_'.$parm] === 2)
|
||||||
|
{
|
||||||
|
return $this->required(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function sc_deleteaccountbutton($parm=array())
|
function sc_deleteaccountbutton($parm=array())
|
||||||
{
|
{
|
||||||
|
|
||||||
if((int) $_GET['id'] !== USERID)
|
if(!empty($_GET['id']) && (int) $_GET['id'] !== USERID)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
$pref = e107::getPref();
|
|
||||||
if($pref['del_accu'] == 1)
|
if($this->pref['del_accu'] == 1)
|
||||||
{
|
{
|
||||||
$confirm = defset("LAN_USET_51", "Are you sure? This procedure cannot be reversed! Once completed all personal data that you have entered on this site will be permanently lost and you will no longer be able to login.");
|
$confirm = defset("LAN_USET_51", "Are you sure? This procedure cannot be reversed! Once completed all personal data that you have entered on this site will be permanently lost and you will no longer be able to login.");
|
||||||
$label = defset('LAN_USET_50', "Delete All Account Information");
|
$label = defset('LAN_USET_50', "Delete All Account Information");
|
||||||
@@ -620,4 +648,3 @@ class usersettings_shortcodes extends e_shortcode
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
|
Reference in New Issue
Block a user