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

Code Cleanup

This commit is contained in:
Cameron
2019-05-20 14:53:43 -07:00
parent 6a2fdab074
commit bdb45485ee
27 changed files with 55 additions and 44 deletions

View File

@@ -67,7 +67,7 @@ class _blank_search extends e_search // include plugin-folder in the name.
* Optional - Advanced Where
* @param $parm - data returned from $_GET (ie. advanced fields included. in this case 'date' and 'author' )
*/
function where($parm='')
function where($parm=null)
{
$tp = e107::getParser();

View File

@@ -48,7 +48,7 @@ class banner_shortcodes extends e_shortcode
}
// Also used by banner_menu.php
public function renderBanner($row, $parm = '')
public function renderBanner($row, $parm = null)
{
$sql = e107::getDb('banner');
$tp = e107::getParser();

View File

@@ -67,7 +67,7 @@ class chatbox_menu_search extends e_search // include plugin-folder in the name.
* Optional - Advanced Where
* @param $parm - data returned from $_GET (ie. advanced fields included. in this case 'date' and 'author' )
*/
function where($parm='')
function where($parm=null)
{
$tp = e107::getParser();

View File

@@ -52,7 +52,7 @@ class faqs_search extends e_search // include plugin-folder in the name.
* Optional - Advanced Where
* @param $parm - data returned from $_GET (ie. advanced fields included. in this case 'date' and 'author' )
*/
function where($parm='')
function where($parm=null)
{
$tp = e107::getParser();

View File

@@ -132,7 +132,7 @@ class featurebox_shortcodes// must match the plugin's folder name. ie. [PLUGIN_F
* @param string $parm parameters
* @param string $mod category template
*/
function sc_featurebox_navigation($parm, $mod = '')
function sc_featurebox_navigation($parm=null, $mod = '')
{
// TODO cache
//TODO default $parm values. eg. assume 'tabs' when included in the 'tabs' template.

View File

@@ -46,7 +46,7 @@ class plugin_featurebox_item extends e_model
* @param string $parm
* @return string
*/
public function sc_featurebox_title($parm = '')
public function sc_featurebox_title($parm = null)
{
if(!empty($parm) && is_string($parm))
{
@@ -77,7 +77,7 @@ class plugin_featurebox_item extends e_model
* @param string $parm
* @return string
*/
public function sc_featurebox_url($parm = '')
public function sc_featurebox_url($parm = null)
{
$tp = e107::getParser();
$url = $tp->replaceConstants($this->get('fb_imageurl'), 'full');
@@ -126,7 +126,7 @@ class plugin_featurebox_item extends e_model
* @param string $parm
* @return string
*/
public function sc_featurebox_image($parm = '')
public function sc_featurebox_image($parm = null)
{
if(!$this->get('fb_image') && $parm != 'placeholder')
{
@@ -168,7 +168,7 @@ class plugin_featurebox_item extends e_model
return '<a id="featurebox-imageurl-'.$this->getId().'" href="'.$tp->replaceConstants($this->get('fb_imageurl'), 'full').'" title="'.$tp->toAttribute($this->get('fb_title')).'" rel="'.$tp->toAttribute(vartrue($parm['rel'], 'external')).'">'.$tag.'</a>';
}
public function sc_featurebox_thumb($parm='')
public function sc_featurebox_thumb($parm=null)
{
$tp = e107::getParser();
if(!$this->get('fb_image'))

View File

@@ -107,7 +107,7 @@ class forum_search extends e_search // include plugin-folder in the name.
* Optional - Advanced Where
* @param $parm - data returned from $_GET (ie. advanced fields included. in this case 'date' and 'author' )
*/
function where($parm='')
function where($parm=null)
{
$tp = e107::getParser();

View File

@@ -278,7 +278,7 @@ class forum_post_handler
$poll = new poll;
require_once(HEADERF);
$template = $this->getTemplate('posted');
$template = (array) $this->getTemplate('posted');
echo $template['poll'];
require_once(FOOTERF);
exit;
@@ -389,7 +389,7 @@ class forum_post_handler
/**
* @return string
* @return array|string
*/
function getTemplate($type = 'post')
{

View File

@@ -296,7 +296,7 @@
/**
* @example {JOINED: dateformat=relative} - long|short|relative
*/
function sc_joined($parm = '')
function sc_joined($parm = null)
{
$gen = e107::getDate();
if($this->postInfo['post_user'])

View File

@@ -307,7 +307,7 @@
}
function sc_search($parm='')
function sc_search($parm=null)
{
if(!deftrue('FONTAWESOME') || !$srchIcon = e107::getParser()->toGlyph('fa-search'))
@@ -679,7 +679,7 @@
------*/
function sc_views($parm='')
function sc_views($parm=null)
{
$val = ($this->var['thread_views']) ? $this->var['thread_views'] : '0' ;
@@ -692,7 +692,7 @@
}
function sc_replies($parm='')
function sc_replies($parm=null)
{
$val = ($this->var['thread_total_replies']) ? $this->var['thread_total_replies'] : '0';

View File

@@ -94,7 +94,7 @@ e107::getLanguage()->bcDefs($bcDefs);
function sc_lm_username_input($parm='')
function sc_lm_username_input($parm=null)
{
$pref = e107::getPref();
@@ -113,7 +113,7 @@ e107::getLanguage()->bcDefs($bcDefs);
}
function sc_lm_password_input($parm='')
function sc_lm_password_input($parm=null)
{
$pref = e107::getPref();
$t_password = "

View File

@@ -64,7 +64,7 @@ class news_rss // plugin-folder + '_rss'
* @param string $parms
* @return array
*/
function data($parms='')
function data($parms=null)
{
$pref = e107::getConfig()->getPref();

View File

@@ -89,7 +89,7 @@ class news_search extends e_search // include plugin-folder in the name.
* Optional - Advanced Where
* @param $parm - data returned from $parm (ie. advanced fields included. in this case 'date' and 'author' )
*/
function where($parm='')
function where($parm=null)
{
$tp = e107::getParser();

View File

@@ -142,6 +142,11 @@ if(!defined("OTHERNEWS2_SPACING")){
// define("OTHERNEWS2_SPACING","0");
}
if(!isset($param))
{
$param = array();
}
$param['itemlink'] = defset('OTHERNEWS2_ITEMLINK','');
$param['thumbnail'] = OTHERNEWS2_THUMB;
$param['catlink'] = defset('OTHERNEWS2_CATLINK','');

View File

@@ -128,6 +128,11 @@ if(!defined("OTHERNEWS_SPACING")){
define("OTHERNEWS_SPACING","0");
}
if(!isset($param))
{
$param = array();
}
$param['itemlink'] = defset('OTHERNEWS_ITEMLINK');
$param['thumbnail'] = defset('OTHERNEWS_THUMB');
$param['catlink'] = defset('OTHERNEWS_CATLINK');