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

Code cleanup

This commit is contained in:
Cameron 2015-02-15 02:37:36 -08:00
parent 5be1cbe67f
commit 027a74f5b0
55 changed files with 211 additions and 174 deletions

View File

@ -92,16 +92,16 @@ class page_admin_form_ui extends e_admin_form_ui
if($mode == 'write')
{
return;
return null;
}
if($mode == 'filter')
{
return;
return null;
}
if($mode == 'batch')
{
return;
return null;
}
}

View File

@ -296,7 +296,7 @@ class mailout_main_ui extends e_admin_ui
'mail_bounce_count' => array('title' => LAN_MAILOUT_144, 'noedit'=>true, 'type'=>'number'),
'mail_start_send' => array('title' => LAN_MAILOUT_131,'noedit'=>true, 'type'=>'number', 'proc' => 'sdatetime'),
'mail_end_send' => array('title' => LAN_MAILOUT_132, 'noedit'=>true, 'type'=>'number', 'proc' => 'sdatetime'),
'mail_create_date' => array('title' => LAN_MAILOUT_130, 'type'=>null, 'noedit'=>true, 'data'=>'int', 'type'=>'number'),
'mail_create_date' => array('title' => LAN_MAILOUT_130, 'type'=>null, 'noedit'=>true, 'data'=>'int'),
'mail_creator' => array('title' => LAN_MAILOUT_85, 'type'=>null, 'noedit'=>true, 'data'=>'int'),
'mail_create_app' => array('title' => LAN_MAILOUT_133, 'type'=>null, 'noedit'=>true,'data'=>'str'),
'mail_e107_priority' => array('title' => LAN_MAILOUT_134, 'noedit'=>true),

View File

@ -82,7 +82,7 @@ if($amount = $sql -> db_Select("generic", "*", $queryString))
<td style='width: 100%;' class='forumheader3'><b>".MESSLAN_8."</b>: $gen_type<br />
<b>".MESSLAN_9."</b>: ".$gen->convert_date($gen_datestamp, 'long')."<br />
<b>".MESSLAN_10."</b>: $user<br />
<b>".MESSLAN_13."</b>: $link ";
<b>".MESSLAN_13."</b>: $link ".
($gen_chardata ? "<br /><b>".MESSLAN_12."</b>: $gen_chardata" : "")."<br /><input class='btn button' type='submit' name='delete_message' value='".MESSLAN_2." $gen_id' />
</td>\n</tr>\n";
}

View File

@ -98,7 +98,7 @@ class news_cat_ui extends e_admin_ui
'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'),
'category_id' => array('title'=> LAN_ID, 'type' => 'number', 'width' =>'5%', 'forced'=> TRUE, 'readonly'=>TRUE),
'category_icon' => array('title'=> LAN_ICON, 'type' => 'icon', 'data' => 'str', 'width' => '100px', 'thclass' => 'center', 'class'=>'center', 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60', 'writeParms' => 'glyphs=1', 'readonly'=>FALSE, 'batch' => FALSE, 'filter'=>FALSE),
'category_name' => array('title'=> LAN_TITLE, 'type' => 'text', 'inline'=>true, 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE, 'validate' => true, 'inline' => true),
'category_name' => array('title'=> LAN_TITLE, 'type' => 'text', 'inline'=>true, 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE, 'validate' => true),
'category_meta_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'textarea', 'inline'=>true, 'width' => 'auto', 'thclass' => 'left','readParms' => 'expand=...&truncate=150&bb=1', 'readonly'=>FALSE),
'category_meta_keywords' => array('title'=> LAN_KEYWORDS, 'type' => 'tags', 'inline'=>true, 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),

View File

@ -220,7 +220,7 @@ class users_admin_ui extends e_admin_ui
'user_email' => array('title' => LAN_EMAIL, 'tab'=>0, 'type' => 'text', 'inline'=>true, 'data'=>'str', 'width' => 'auto'),
'user_hideemail' => array('title' => LAN_USER_10, 'tab'=>0, 'type' => 'boolean', 'data'=>'int', 'width' => 'auto', 'thclass'=>'center', 'class'=>'center', 'filter'=>true, 'batch'=>true, 'readParms'=>'trueonly=1'),
'user_xup' => array('title' => 'Xup', 'tab'=>0, 'noedit'=>true, 'type' => 'text', 'width' => 'auto'),
'user_class' => array('title' => LAN_USER_12, 'tab'=>0, 'type' => 'userclasses' , 'inline'=>true, 'writeParms' => 'classlist=classes', 'inline'=>true, 'filter'=>true, 'batch'=>true),
'user_class' => array('title' => LAN_USER_12, 'tab'=>0, 'type' => 'userclasses' , 'inline'=>true, 'writeParms' => 'classlist=classes', 'filter'=>true, 'batch'=>true),
'user_join' => array('title' => LAN_USER_14, 'tab'=>0, 'noedit'=>true, 'type' => 'datestamp', 'width' => 'auto', 'writeParms'=>'readonly=1'),
'user_lastvisit' => array('title' => LAN_USER_15, 'tab'=>0, 'noedit'=>true, 'type' => 'datestamp', 'width' => 'auto'),
'user_currentvisit' => array('title' => LAN_USER_16, 'tab'=>0, 'noedit'=>true, 'type' => 'datestamp', 'width' => 'auto'),

View File

@ -259,6 +259,8 @@ class admin_shortcodes
sort($lanlist);
$text = '';
$lanperms = array();
foreach($lanlist as $langval)
{
if (getperms($langval))
@ -338,7 +340,7 @@ class admin_shortcodes
{
$selected = ($lng == $sql->mySQLlanguage || ($lng == $pref['sitelanguage'] && !$sql->mySQLlanguage)) ? " selected='selected'" : "";
$urlval = $slng->subdomainUrl($lng);
$select .= "<option value='".$urlval."'{$selected}>$lng</option>\n";
$select .= "<option value='".$urlval."' {$selected}>$lng</option>\n";
}
$select .= "</select>";

View File

@ -322,7 +322,7 @@ class user_shortcodes extends e_shortcode
}
/*
if(defined("USER_ICON"))
{
return USER_ICON;
@ -333,6 +333,7 @@ class user_shortcodes extends e_shortcode
}
return "<img src='".e_IMAGE_ABS."user_icons/user.png' alt='' style='vertical-align:middle;' /> ";
*/
}

View File

@ -206,12 +206,14 @@ class usersettings_shortcodes extends e_shortcode
function sc_signature_help($parm)
{
return;
/*
$pref = e107::getPref();
if(!check_class(varset($pref['signature_access'],0)))
{
return;
}
return display_help("", 2);
*/
}

View File

@ -143,9 +143,6 @@ if (!defined('E_32_PLUGIN')) {
if (!defined('E_32_PLUGMANAGER')) {
define('E_32_PLUGMANAGER', "<i class='S32 e-plugmanager-32'></i> ");
}
if (!defined('E_32_DOCS')) {
define('E_32_DOCS', "<i class='S32 e-docs-32'></i> ");
}
if (!defined('E_32_MAIN')) {
define('E_32_MAIN', "<i class='S32 e-main-32'></i> ");
}
@ -411,17 +408,11 @@ if (!defined('E_16_PLUGIN')) {
if (!defined('E_16_PLUGMANAGER')) {
define('E_16_PLUGMANAGER', "<i class='S16 e-plugmanager-16'></i>");
}
if (!defined('E_16_DOCS')) {
define('E_16_DOCS', "<i class='S16 e-docs-16'></i>");
}
if (!defined('E_16_THEMEMANAGER')) {
define('E_16_THEMEMANAGER', "<i class='S16 e-themes-16'></i>");
}
// Small Admin Other Images
if (!defined('E_16_COMMENT')) {
define('E_16_COMMENT', "<i class='S16 e-comments-16'></i>");
}
if (!defined('E_16_ADMINLOG')) {
define('E_16_ADMINLOG', "<i class='S16 e-adminlogs-16'></i>");
}
@ -495,7 +486,7 @@ define("E_32_TRUE", "<i class='S32 e-true-32'></i>");
if(!defined('ADMIN_EDIT_ICON') && !defined('ADMIN_TRUE_ICON'))
{
{/*
define("ADMIN_TRUE_ICON", "<i class='S16 e-true-16'></i>");
define("ADMIN_FALSE_ICON", "<i class='S16 e-false-16'></i>");
define("ADMIN_EDIT_ICON", "<i class='S16 e-edit-16' ></i>");
@ -513,12 +504,12 @@ define("E_32_TRUE", "<i class='S32 e-true-32'></i>");
define("ADMIN_UPGRADEPLUGIN_ICON", "<i class='S16 e-up-16'></i>");
define("ADMIN_EXECUTE_ICON", "<i class='S16 e-execute-16'></i>");
define("ADMIN_SORT_ICON", "<i class='S16 e-sort'></i>");
*/
define("ADMIN_TRUE_ICON_PATH", e_IMAGE_ABS."admin_images/true_16.png"); //XXX DEPRECATED but used in v1.x
define("ADMIN_FALSE_ICON_PATH", e_IMAGE_ABS."admin_images/false_16.png"); //XXX DEPRECATED but used in v1.x
define("ADMIN_EDIT_ICON_PATH", e_IMAGE_ABS."admin_images/edit_16.png"); //XXX DEPRECATED but used in v1.x
define("ADMIN_DELETE_ICON_PATH", e_IMAGE_ABS."admin_images/delete_16.png"); //XXX DEPRECATED but used in v1.x
define("ADMIN_WARNING_ICON_PATH", e_IMAGE_ABS."admin_images/warning_16.png"); //XXX DEPRECATED but used in v1.x
// define("ADMIN_EDIT_ICON_PATH", e_IMAGE_ABS."admin_images/edit_16.png"); //XXX DEPRECATED but used in v1.x
// define("ADMIN_DELETE_ICON_PATH", e_IMAGE_ABS."admin_images/delete_16.png"); //XXX DEPRECATED but used in v1.x
// define("ADMIN_WARNING_ICON_PATH", e_IMAGE_ABS."admin_images/warning_16.png"); //XXX DEPRECATED but used in v1.x
}

View File

@ -118,15 +118,15 @@ class e_admin_log
}
/**
* Save all logs in the queue to the database and render any unhidden messages with the message handler.
* @see alias flushMessages() method below.
* Save all logs in the queue to the database and render any unhidden messages with the message handler.
* @see alias flushMessages() method below.
* @param string $logTitle - title for log entry eg. 'PREF_01'
* @param int $logImportance [optional] default E_LOG_INFORMATIVE - passed directly to admin log
* @param string $logEventCode [optional] - passed directly to admin log
* @param string $mstack [optional] message stack passed to message handler
*/
* @return \e_admin_log
*/
public function save($logTitle, $logImportance = E_LOG_INFORMATIVE, $logEventCode = '', $mstack = false)
{
return $this->flushMessages($logTitle, $logImportance, $logEventCode, $mstack);

View File

@ -677,20 +677,22 @@ class eDispatcher
return self::$_configObjects[$reg];
}
/**
* Auto discover module location from stored in core prefs data
* @param string $module
* @return mixed
*/
public static function getModuleConfigLocation($module)
{
//retrieve from config prefs
return e107::findPref('url_config/'.$module, '');
}
/**
* Auto discover module location from stored in core prefs data
* @param string $module
* @return mixed|null|string
*/
public static function getDispatchLocation($module)
{
@ -3893,6 +3895,7 @@ class eResponse
* Assemble title
* @param str $ns
* @param bool $reset
* @return string
*/
function getTitle($ns = 'default', $reset = false)
{
@ -4104,6 +4107,7 @@ class eResponse
* @param string $ns namespace/segment
* @param bool $return
* @param bool $render_message append system messages
* @return null|string
*/
function send($ns = null, $return = true, $render_message = true)
{
@ -4264,12 +4268,13 @@ class eHelper
$descrString = preg_replace('/[\r]*\n[\r]*/', ' ', trim(str_replace(array('"', "'"), '', strip_tags(e107::getParser()->toHTML($descrString, TRUE)))));
return trim(preg_replace('/[\s]+/', ' ', str_replace('_', ' ', $descrString)));
}
/**
* Convert title to valid SEF URL string
* Type ending with 'l' stands for 'to lowercase', ending with 'c' - 'to camel case'
* @param string $title
* @param string $type dashl|dashc|dash|underscorel|underscorec|underscore|plusl|plusc|plus|none
* @return mixed|string
*/
public static function title2sef($title, $type = null)
{

View File

@ -290,17 +290,16 @@ class e_bbcode
}
/**
* Process a bbcode
* Process a bbcode
*
* @var string $code - textual value of the bbcode (already begins with '_' if a single code)
* @var string $param1 - any text after '=' in the opening code
* @var string $code_text_par - text between the opening and closing codes
* @var string $param2 - any text after '=' for the closing code
* @var char $sep - character separating bbcode name and any parameters
* @var string $full_text - the 'raw' text between, and including, the opening and closing bbcode tags
* @var string $code - textual value of the bbcode (already begins with '_' if a single code)
* @var string $param1 - any text after '=' in the opening code
* @var string $code_text_par - text between the opening and closing codes
* @var string $param2 - any text after '=' for the closing code
* @var char $sep - character separating bbcode name and any parameters
* @var string $full_text - the 'raw' text between, and including, the opening and closing bbcode tags
* @return string
*/
private function proc_bbcode($code, $param1='', $code_text_par='', $param2='', $sep='', $full_text='')
{

View File

@ -207,10 +207,11 @@ class e_chart
{
return json_encode($this->options);
}
/**
* Set the type of graph
* @param string $type - line | bar | pie | radar | doughnut | polar
* @param string $type - line | bar | pie | radar | doughnut | polar
* @return $this
*/
public function setType($type)
{
@ -223,6 +224,7 @@ class e_chart
* Set the data values
* @param array $data
* @param string $id of canvas element
* @return $this
*/
public function setData($data)
{

View File

@ -149,11 +149,11 @@ class convert
}
/**
* Converts between unix timestamp and human-readable date-time OR vice-versa. (auto-detected)
* @param string $string unix timestamp OR human-readable date-time.
* @param string $string unix timestamp OR human-readable date-time.
* @param string $mask (optional) long | short | input
* @return bool|int|string
*/
function convert($string=null, $mask = 'inputdate')
{

View File

@ -123,7 +123,15 @@ class e107_db_debug {
}
function Mark_Query($query, $rli, $origQryRes, $aTrace, $mytime, $curtable)
/**
* @param $query
* @param $rli
* @param $origQryRes
* @param $aTrace
* @param $mytime
* @param $curtable
*/
function Mark_Query($query, $rli, $origQryRes, $aTrace, $mytime, $curtable)
{
// global $sql;
$sql = e107::getDb( $rli);

View File

@ -531,7 +531,7 @@ class db_verify
function fixForm($file,$table,$field, $newvalue,$mode,$after ='')
{
$frm = e107::getForm();
$text .= $frm->checkbox("fix[$file][$table][$field][]", $mode, false, array('id'=>false));
$text = $frm->checkbox("fix[$file][$table][$field][]", $mode, false, array('id'=>false));
return $text;
}

View File

@ -568,7 +568,7 @@ class e107
* @param string $for
* @return string
*/
function getFolder($for)
public static function getFolder($for)
{
$key = strtoupper($for).'_DIRECTORY';
$self = self::getInstance();

View File

@ -168,10 +168,11 @@ class e_marketplace
return $text;
}
/**
* Retrieve currently used adapter
* @param e_marketplace_adapter_abstract
* @return \e_marketplace_adapter_abstract
*/
public function adapter()
{
@ -652,6 +653,7 @@ class e_marketplace_adapter_xmlrpc extends e_marketplace_adapter_abstract
* XXX replace xmlClass::xml2array() after this one passes all tests
* @param SimpleXmlIterator $xml
* @param string $parentName parent node name - used currently for debug only
* @return array|string
*/
public function parse($xml, $parentName = null)
{

View File

@ -782,10 +782,11 @@ class e_parse extends e_parser
}
/**
* @param $text - template to parse.
* @param $text - template to parse.
* @param boolean $parseSCFiles - parse core 'single' shortcodes
* @param array $extraCodes - support legacy shortcode content (eg. content within .sc) as well as simpleParse array format.
* @param object $eVars - XXX more info needed.
* @param array $extraCodes - support legacy shortcode content (eg. content within .sc) as well as simpleParse array format.
* @param object $eVars - XXX more info needed.
* @return string
*/
function parseTemplate($text, $parseSCFiles = TRUE, $extraCodes = null, $eVars = null)
{

View File

@ -31,12 +31,13 @@ class e_upgrade
protected $_options = array();
/**
*
* @param string $curFolder - folder name of the plugin or theme to check
* @param string $curVersions - installed version of the plugin or theme.
* @param string $releaseUrl - url of the XML file in the above format.
* @param boolean $cache
*/
*
* @param string $curFolder - folder name of the plugin or theme to check
* @param string $curVersions - installed version of the plugin or theme.
* @param string $releaseUrl - url of the XML file in the above format.
* @param boolean $cache
* @return $this
*/
public function setOptions($dataArray)
{

View File

@ -198,7 +198,7 @@ class e107_event
global $pref;
if(!is_array($parms))
{
$_tmp = parse_str($parms, $parms);
parse_str($parms, $parms);
}
if(isset($pref['e_admin_events_list']) && is_array($pref['e_admin_events_list']))
{

View File

@ -137,11 +137,12 @@ class e_file
$this->fileFilter = $filter;
return $this;
}
/**
* Clean and rename file name
* @param $f array as returned by get_files();
* @param $rename boolean - set to true to rename file.
* @param $rename boolean - set to true to rename file.
* @return array
*/
public function cleanFileName($f,$rename=false)
{

View File

@ -89,8 +89,8 @@ class e_form
* @param string name
* @param $method - post|get default is post
* @param @target - e_REQUEST_URI by default
* @param $other - unused at the moment.
* @param $other - unused at the moment.
* @return string
*/
public function open($name, $method=null, $target=null, $options=null)
{
@ -245,19 +245,18 @@ class e_form
}
/**
* Render Bootstrap Carousel
* @param string $name : A unique name
* Render Bootstrap Carousel
* @param string $name : A unique name
* @param array $array
* @param array $options : default, interval, pause, wrap
* @return string
* @example
* $array = array(
* 'slide1' => array('caption' => 'Slide 1', 'text' => 'first slide content' ),
* 'slide2' => array('caption' => 'Slide 2', 'text' => 'second slide content' ),
* 'slide3' => array('caption' => 'Slide 3', 'text' => 'third slide content' )
* );
* 'slide1' => array('caption' => 'Slide 1', 'text' => 'first slide content' ),
* 'slide2' => array('caption' => 'Slide 2', 'text' => 'second slide content' ),
* 'slide3' => array('caption' => 'Slide 3', 'text' => 'third slide content' )
* );
*/
function carousel($name="e-carousel", $array, $options = null)
{
@ -355,9 +354,10 @@ class e_form
* @param $maxlength
* @param $options
* - size: mini, small, medium, large, xlarge, xxlarge
* - class:
* - typeahead: 'users'
*
* - class:
* - typeahead: 'users'
*
* @return string
*/
function text($name, $value = '', $maxlength = 80, $options= array())
{
@ -1275,7 +1275,7 @@ class e_form
* @param mixed $value
* @param boolean $checked
* @param mixed $options query-string or array or string for a label. eg. label=Hello&foo=bar or array('label'=>Hello') or 'Hello'
* @return void
* @return string
*/
function checkbox($name, $value, $checked = false, $options = array())
{
@ -4207,6 +4207,7 @@ class e_form
* @param string $id field id
* @param array $fdata fieldset data
* @param e_admin_model $model
* @return string
*/
function renderCreateFieldset($id, $fdata, $model, $tab=0)
{
@ -4663,13 +4664,14 @@ class e_form
";
return $text;
}
/**
* Generic renderForm solution
* @param @forms
* @param @nocontainer
*/
* Generic renderForm solution
* @param @forms
* @param @nocontainer
* @return string
*/
function renderForm($forms, $nocontainer = false)
{
$text = '';

View File

@ -415,7 +415,7 @@ class language{
? str_replace($_SERVER['HTTP_HOST'], $codelnk.'.'.e_DOMAIN, e_SELF).'?'.e_QUERY
: str_replace($_SERVER['HTTP_HOST'], $codelnk.'.'.e_DOMAIN, e_SELF);
return $urlval;
return (string) $urlval;
}
/**

View File

@ -202,8 +202,8 @@ class e107Email extends PHPMailer
$this->debug = true;
}
else
{
$this->Debugoutput = 'handlePHPMailerDebug';
{
$this->Debugoutput = 'handlePHPMailerDebug';
}
$this->pref = $pref;
@ -331,8 +331,8 @@ class e107Email extends PHPMailer
$this->arraySet(array($opt => $overrides[$key]));
}
elseif(!empty($overrides[$opt]))
{
$this->arraySet(array($opt => $overrides[$opt]));
{
$this->arraySet(array($opt => $overrides[$opt]));
}
}
}
@ -616,9 +616,9 @@ class e107Email extends PHPMailer
$this->previewAttachments[] = array('file'=>$attach, 'status'=>true);
}
else
{
{
$ext = pathinfo($attach, PATHINFO_EXTENSION);
$this->AddAttachment($attach, $tempName,'base64',$this->_mime_types($ext));
$this->AddAttachment($attach, $tempName,'base64',$this->_mime_types($ext));
}
}
@ -651,8 +651,9 @@ class e107Email extends PHPMailer
}
/**
* Preview the BODY of an email
* @param $eml - array.
* Preview the BODY of an email
* @param $eml - array.
* @return string
*/
public function preview($eml)
{

View File

@ -257,16 +257,15 @@ class e_media
}
return e107::getDb()->insert('core_media_cat', $data);
}
/**
* Create a user Media-Category.
* Create a user Media-Category.
* @param $type string image | file | video
* @param $userId int - leave empty for currently logged in user.
* @param $userId int - leave empty for currently logged in user.
* @param $userName string - leave blank for currently logged in user
* @param $parms (optional) - for future use.
* @param $parms (optional) - for future use.
* @return bool|int
*/
public function createUserCategory($type='image', $userId = USERID, $userName = USERNAME, $parms=null)
{
@ -416,16 +415,15 @@ class e_media
{
return $this->getImages('_common_file', $from, $amount, $search);
}
/**
* Return an array of Images in a particular category
* @param string $cat : category name. use + to include _common eg. 'news+'
* @param $from
* @param $amount
* @param $search
* @return array
*/
public function getImages($cat='', $from=0, $amount=null,$search=null)
{
@ -503,12 +501,12 @@ class e_media
}
/**
* Return an array of Images in a particular category
* @param string $type : 16 | 32 | 48 | 64
* @param integer $from
* @param integer $amount
* @return array
*/
public function getIcons($type='', $from=0, $amount=null)
{

View File

@ -385,13 +385,14 @@ class eMessage
}
return deftrue('EMESSLAN_TITLE_'.strtoupper($type), '');
}
/**
* Set a custom title/caption (useful for front-end)
*
* @param string $title
* @param string $type E_MESSAGE_SUCCESS,E_MESSAGE_ERROR, E_MESSAGE_WARNING, E_MESSAGE_INFO
* @param string $type E_MESSAGE_SUCCESS,E_MESSAGE_ERROR, E_MESSAGE_WARNING, E_MESSAGE_INFO
* @return $this
* @example e107::getMessage()->setTitle('Custom Title', E_MESSAGE_INFO);
*/
public function setTitle($title, $type)

View File

@ -3371,7 +3371,7 @@ class e_tree_model extends e_front_model
public function toHTML($template, $parsesc = true, $eVars = null)
{
$ret = '';
$i == 1;
$i = 1;
foreach ($this->getTree() as $model)
{
if($eVars) $eVars->treeCounter = $i;

View File

@ -469,46 +469,47 @@ class e_db_mysql
/**
* Query and fetch at once
*
*
* Examples:
* <code>
* <?php
*
*
* // Get single value, $multi and indexField are ignored
* $string = e107::getDb()->retrieve('user', 'user_email', 'user_id=1');
*
*
* // Get single row set, $multi and indexField are ignored
* $array = e107::getDb()->retrieve('user', 'user_email, user_name', 'user_id=1');
*
*
* // Fetch all, don't append WHERE to the query, index by user_id, noWhere auto detected (string starts with upper case ORDER)
* $array = e107::getDb()->retrieve('user', 'user_id, user_email, user_name', 'ORDER BY user_email LIMIT 0,20', true, 'user_id');
*
*
* // Same as above but retrieve() is only used to fetch, not useable for single return value
* if(e107::getDb()->select('user', 'user_id, user_email, user_name', 'ORDER BY user_email LIMIT 0,20', true))
* {
* $array = e107::getDb()->retrieve(null, null, null, true, 'user_id');
* $array = e107::getDb()->retrieve(null, null, null, true, 'user_id');
* }
*
* // Using whole query example, in this case default mode is 'single'
* $array = e107::getDb()->retrieve('SELECT
* p.*, u.user_email, u.user_name FROM `#user` AS u
* LEFT JOIN `#myplug_table` AS p ON p.myplug_table=u.user_id
* ORDER BY u.user_email LIMIT 0,20'
*
* // Using whole query example, in this case default mode is 'single'
* $array = e107::getDb()->retrieve('SELECT
* p.*, u.user_email, u.user_name FROM `#user` AS u
* LEFT JOIN `#myplug_table` AS p ON p.myplug_table=u.user_id
* ORDER BY u.user_email LIMIT 0,20'
* );
*
*
* // Using whole query example, multi mode - $fields argument mapped to $multi
* $array = e107::getDb()->retrieve('SELECT u.user_email, u.user_name FROM `#user` AS U ORDER BY user_email LIMIT 0,20', true);
*
*
* // Using whole query example, multi mode with index field
* $array = e107::getDb()->retrieve('SELECT u.user_email, u.user_name FROM `#user` AS U ORDER BY user_email LIMIT 0,20', null, null, true, 'user_id');
* </code>
*
*
* @param string $table if empty, enter fetch only mode
* @param string $fields comma separated list of fields or * or single field name (get one); if $fields is of type boolean and $where is not found, $fields overrides $multi
* @param string $where WHERE/ORDER/LIMIT etc clause, empty to disable
* @param boolean $multi if true, fetch all (multi mode)
* @param string $indexField field name to be used for indexing when in multi mode
* @param boolean $debug
* @return array
*/
public function retrieve($table, $fields = null, $where=null, $multi = false, $indexField = null, $debug = false)
{

View File

@ -339,6 +339,7 @@ class e_pref extends e_front_model
* @param string|array $pref_name
* @param mixed value
* @param boolean $strict
* @return $this|\e_model
*/
final public function addData($pref_name, $value = null)
{

View File

@ -645,7 +645,6 @@ class e_navigation
'search' => E_32_SEARCH,
'syslogs' => E_32_ADMINLOG,
'theme_manage' => E_32_THEMEMANAGER,
'maintain' => E_32_MAINTAIN,
'upload' => E_32_UPLOADS,
'eurl' => E_32_EURL,
'userclass' => E_32_USERCLASS,

View File

@ -514,13 +514,10 @@ class UserHandler
}
/**
* Return an array of descriptive names for each field in the user DB.
*
* @param bool $all if false, just returns modifiable fields. Else returns all
*
* $return array - key is field name, value is 'nice name' (descriptive name)
* Return an array of descriptive names for each field in the user DB.
* @param bool $all if false, just returns modifiable fields. Else returns all
* @return array - key is field name, value is 'nice name' (descriptive name)
*/
public function getNiceNames($all = FALSE)
{

View File

@ -182,10 +182,11 @@ class e_user_model extends e_admin_model
{
return $this->get('user_loginname');
}
/**
* Real name getter. Use it as DB field name will be changed soon.
* @param bool $strict if false, fall back to Display name when empty
* @return mixed
*/
final public function getRealName($strict = false)
{

View File

@ -51,12 +51,13 @@ class user_select
$text .= "</select>";
return $text;
}
/**
* Display selection dropdown of all user classes
* Display selection dropdown of all user classes
*
* @param int $class - if its e_UC_MEMBER, all classes are shown. Otherwise only the class matching the value is shown.
* @param int $class - if its e_UC_MEMBER, all classes are shown. Otherwise only the class matching the value is shown.
* @return string
*/
function class_list($class, $form_name)
{

View File

@ -542,17 +542,17 @@ class user_class
}
/**
* Very similar to self::uc_dropdown, but returns a list of check boxes. Doesn't encapsulate it.
* Very similar to self::uc_dropdown, but returns a list of check boxes. Doesn't encapsulate it.
*
* @param string $fieldname is the name for the array of checkboxes
* @param string $curval is a comma separated list of class IDs for boxes which are checked.
* @param string $optlist as for uc_dropdown
* @param boolean $showdescription - if TRUE, appends the class description in brackets
* @param boolean $asArray - if TRUE, result returned as array; otherwise result returned as string
* @param string $fieldname is the name for the array of checkboxes
* @param string $curval is a comma separated list of class IDs for boxes which are checked.
* @param string $optlist as for uc_dropdown
* @param boolean $showdescription - if TRUE, appends the class description in brackets
* @param boolean $asArray - if TRUE, result returned as array; otherwise result returned as string
*
* return string|array according to $asArray
* return string|array according to $asArray
* @return array|string
*/
public function uc_checkboxes($fieldname, $curval='', $optlist = '', $showdescription = FALSE, $asArray = FALSE)
{

View File

@ -65,7 +65,7 @@ define("LAN_EURL_UC", "Under Construction");
define("LAN_EURL_CORE_MAIN", "Site Root Namespace - alias not in use.");
define("LAN_EURL_DEFAULT", "Default");
define("LAN_EURL_FRIENDLY", "Friendly");
define("LAN_EURL_LEGACY", "Legacy direct URLs.");

View File

@ -334,9 +334,7 @@ define("LAN_AL_NEWS_11", "News category rewrite deleted");
define("LAN_AL_NEWS_12", "News rewrite changed");
define("LAN_AL_NEWS_13", "News rewrite deleted");
// Comments
//---------
define("LAN_AL_COMMENT_01", "Comment(s) deleted");
// File Manager
//-------------

View File

@ -143,5 +143,5 @@ define("LAN_435", "XML User Protocol file");
define("LAN_CUSTOMTITLE", "Custom title");
define("LAN_USET_5", "Subscribed to");
define("LAN_USET_6", "Subscribe to our mailing-list(s) and/or sections of this site.");
define("LAN_USET_8", "Signature / Time zone");
// define("LAN_USET_8", "Signature / Time zone");
?>

View File

@ -114,7 +114,7 @@ $archive = "<div style='text-align:center'>
$archive .= "<td colspan='{$months_per_row}'>{$year_selector}</td></tr><tr>";
for($i = 1; $i <= 12; $i++)
{
if (++$newline == $months_per_row+1)
if (++$newline == $months_per_row + 1)
{
$archive .= "</tr><tr>";
$newline = 1;

View File

@ -104,10 +104,11 @@ if(!class_exists('chatbox_shortcodes'))
$cb_message = e107::getParser()->toHTML($this->var['cb_message'], false, $emotes_active, $cb_uid, $pref['menu_wordwrap']);
return $cb_message;
/*
$replace[0] = "["; $replace[1] = "]";
$search[0] = "&lsqb;"; $search[1] = "&rsqb;";
$cb_message = str_replace($search, $replace, $cb_message);
$cb_message = str_replace($search, $replace, $cb_message);
*/
}
function sc_cb_avatar($parm='')

View File

@ -128,7 +128,7 @@ class faqs_shortcodes extends e_shortcode
$tp = e107::getParser();
$url = e107::url('faqs','category', $this->var); //@See faqs/e_url.php
return "<a href='".$url."'>".$tp->toHTML($this->var['faq_info_title'])."</a>";
/*
return "<a href='".e107::getUrl()->create('faqs/list/all', array('category' => $this->var['faq_info_id']))."'>".$tp->toHTML($this->var['faq_info_title'])."</a>";
@ -146,6 +146,7 @@ class faqs_shortcodes extends e_shortcode
}
return "<a href='".e107::getUrl()->create('faqs/list/all', array('category' => $this->var['faq_info_id']))."'>".$tp->toHTML($this->var['faq_info_title'])."</a>";
*/
}
function sc_faq_category_description($parm='')
@ -217,8 +218,8 @@ class faqs_shortcodes extends e_shortcode
return ''; // UNDER CONSTRUCTION
$tp = e107::getParser();
return "<div style='text-align:center'><br />".$tp->parseTemplate("{SEARCH=faqs}")."</div>";
// $tp = e107::getParser();
// return "<div style='text-align:center'><br />".$tp->parseTemplate("{SEARCH=faqs}")."</div>";
}

View File

@ -86,7 +86,7 @@ class plugin_forum_post_shortcodes extends e_shortcode
global $post;
return e107::getForm()->bbarea('post',$post,'forum');
/*
$rows = (e107::wysiwyg()==true) ? 15 : 10;
$ret = "<textarea class='e-wysiwyg tbox form-control' id='post' name='post' cols='70' rows='{$rows}' style='width:95%' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>$post</textarea>\n<br />\n";
// if(!e_WYSIWYG)
@ -94,6 +94,7 @@ class plugin_forum_post_shortcodes extends e_shortcode
// $ret .= display_help('helpb', 'forum');
}
return $ret;
*/
}
function sc_buttons()

View File

@ -83,7 +83,7 @@ class plugin_forum_view_shortcodes extends e_shortcode
".LAN_FORUM_2037.": {$info['deldate']}<br />
".LAN_FORUM_2038.": {$info['delreason']}
";
$ret = '<pre>'.print_r($info, true).'</pre>';
// $ret = '<pre>'.print_r($info, true).'</pre>';
}
}

View File

@ -187,7 +187,7 @@ class rss_import extends base_import_class
return $target; // comment out to debug
$this->renderDebug($source,$target);
// $this->renderDebug($source,$target);
// DEBUG INFO BELOW.

View File

@ -1077,7 +1077,7 @@ function AwesomeChart(canvasElementId){
if(this.title){
pieAreaHeight = pieAreaHeight - this.titleFontHeight - this.titleMargin;
marginTop += this.titleFontHeight + this.titleMargin;
};
}
for(var i=0; i<this.data.length; i++){
dataSum += this.data[i];

View File

@ -42,7 +42,7 @@ class online_shortcodes
{
$seen_ago = $this->gen->computeLapse($this->currentUser['user_currentvisit'], false, false, true, 'short');
return $seen_ago;
return ($seen_ago ? $seen_ago : '1 '.LANDT_09).' '.LANDT_AGO;
// return ($seen_ago ? $seen_ago : '1 '.LANDT_09).' '.LANDT_AGO;
}

View File

@ -3,8 +3,8 @@
/**************************************************************/
function pageNavList() {
$('ul.page-nav').find('li:has(ul)').attr('title', 'Expand/Collapse');;
$('ul.page-nav').find('li:has(ul)').attr('title', 'Expand/Collapse');
$('ul.page-nav').find('li:has(ul)')
.click( function(event) {
@ -35,7 +35,7 @@ function pageNavList() {
$('.collapsed').children().hide('medium');
});
};
}
/**************************************************************/

View File

@ -158,7 +158,7 @@ class pm_shortcodes extends e_shortcode
return e107::getForm()->text('pm_subject',$value,255);
return "<input class='tbox' type='text' name='pm_subject' value='{$value}' size='63' maxlength='255' />";
// return "<input class='tbox' type='text' name='pm_subject' value='{$value}' size='63' maxlength='255' />";
}

View File

@ -112,7 +112,7 @@
function rep(re, str) {
s = s.replace(re, str);
};
}
// return s;
@ -233,7 +233,7 @@
function rep(re, str) {
s = s.replace(re, str);
};
}
// example: [b] to <strong>

View File

@ -147,7 +147,7 @@ exit;
echo_gzipped_page();
// echo_gzipped_page();
class wysiwyg
{

View File

@ -37,7 +37,7 @@ body { padding-top: 75px; }
.e-tabs { padding:0px }
e-tabs fieldset { padding:0px ; padding-left:3px; border-top:0px;}
.e-tabs fieldset { padding:0px ; padding-left:3px; border-top:0px;}
#tab-container fieldset { padding:0px ; padding-left:3px; border-top:0px;}
#tab-container table { border-top:0px;}
#tab-container td { border-top:0px; border-bottom:1px solid rgb(221, 221, 221) }

View File

@ -718,7 +718,7 @@ $(document).ready(function()
success: function(data)
{
// console.log(data);
$("#"+target).html(data).hide().show("slow");;
$("#"+target).html(data).hide().show("slow");
}
});
@ -821,7 +821,7 @@ $(document).ready(function()
idt = $(e).next("div");
$(idt).toggle("slow");
return false;;
return false;
}
var id = "#" + e;
@ -829,7 +829,7 @@ $(document).ready(function()
$(id).toggle("slow");
return false;
};
}
var addinput = function(text,rep) {
@ -1172,7 +1172,7 @@ function sendInfo(handler, container, form)
success: function(data)
{
// console.log(data);
$("#"+container).html(data).hide().show("slow");;
$("#"+container).html(data).hide().show("slow");
}
});

29
fpw.php
View File

@ -72,16 +72,34 @@ class fpw_shortcodes extends e_shortcode
function sc_fpw_captcha_hidden($parm='')
{
return; // no longer required - included in renderInput();
}
}
/**
* @param string $parm
* @return mixed|null|string
*/
function sc_fpw_captcha_img($parm='')
{
if(USE_IMAGECODE){ return $this->secImg->renderImage(); }
if(USE_IMAGECODE)
{
return $this->secImg->renderImage();
}
return null;
}
/**
* @param string $parm
* @return mixed|null|string
*/
function sc_fpw_captcha_input($parm='')
{
if(USE_IMAGECODE){ return $this->secImg->renderInput(); }
if(USE_IMAGECODE)
{
return $this->secImg->renderInput();
}
return null;
}
function sc_fpw_logo($parm='')
@ -262,6 +280,7 @@ if (isset($_POST['pwsubmit']))
{
case USER_BANNED:
e107::getRedirect()->redirect(SITEURL);
break;
case USER_VALIDATED:
break;
default:

View File

@ -1447,6 +1447,7 @@ function parsesearch($text, $match)
return($text);
}
function headerjs() {
global $search_count, $google_id, $search_prefs, $js_adv, $search_info;
if ($search_prefs['selector'] == 1) {

View File

@ -111,7 +111,7 @@ class e_thumbpage
'SYSTEM_DIRECTORY',
'CORE_DIRECTORY'
);
$sql_info = array(); //compact('mySQLserver', 'mySQLuser', 'mySQLpassword', 'mySQLdefaultdb', 'mySQLprefix', 'mySQLcharset');
// $sql_info = array(); //compact('mySQLserver', 'mySQLuser', 'mySQLpassword', 'mySQLdefaultdb', 'mySQLprefix', 'mySQLcharset');
//e107::getInstance()->initCore($e107_paths, $self, $sql_info, varset($e107_CONFIG, array()));
$e107 = e107::getInstance();
@ -294,8 +294,8 @@ class e_thumbpage
$thumb->adaptiveResizeQuadrant((integer) vartrue($this->_request['aw'], 0), (integer) vartrue($this->_request['ah'], 0), 'T');
}
else
{
$thumb->adaptiveResize((integer) vartrue($this->_request['aw'], 0), (integer) vartrue($this->_request['ah'], 0));
{
$thumb->adaptiveResize((integer) vartrue($this->_request['aw'], 0), (integer) vartrue($this->_request['ah'], 0));
}
// Watermark Option - See admin->MediaManager->prefs for details.
@ -392,8 +392,7 @@ class e_thumbpage
function placeholder($parm)
{
$getsize = isset($parm['size']) ? $parm['size'] : '100x100';
$dimensions = explode('x', $getsize);
header('location: http://placehold.it/'.$getsize);
header('Content-Length: 0');
exit();