1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 13:47:31 +02:00

renamed get_function_name() changed to sc_function_name() for shortcode functions. Removing confusion with get_userdata, get_userclasses and other get_ functions built into PHP.

This commit is contained in:
CaMer0n
2009-07-21 06:31:23 +00:00
parent e2de6db7a8
commit 03715cc464
6 changed files with 78 additions and 77 deletions

View File

@@ -1,7 +1,7 @@
<?php <?php
/* /*
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt) * Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id: admin_shortcodes_class.php,v 1.14 2009-07-19 11:44:28 marj_nl_fr Exp $ * $Id: admin_shortcodes_class.php,v 1.15 2009-07-21 06:31:23 e107coders Exp $
* *
* Admin shortcode batch - class * Admin shortcode batch - class
*/ */
@@ -9,7 +9,7 @@ if (!defined('e107_INIT')) { exit; }
class admin_shortcodes class admin_shortcodes
{ {
function get_admin_credits() function sc_admin_credits()
{ {
if (!ADMIN) { return ''; } if (!ADMIN) { return ''; }
return "<div style='text-align: center'> return "<div style='text-align: center'>
@@ -17,7 +17,7 @@ class admin_shortcodes
</div>"; </div>";
} }
function get_admin_docs() function sc_admin_docs()
{ {
if (!ADMIN) { return ''; } if (!ADMIN) { return ''; }
global $ns; global $ns;
@@ -47,7 +47,7 @@ class admin_shortcodes
return $ns -> tablerender(FOOTLAN_14,$text, array('id' => 'admin_docs', 'style' => 'button_menu'), TRUE); return $ns -> tablerender(FOOTLAN_14,$text, array('id' => 'admin_docs', 'style' => 'button_menu'), TRUE);
} }
function get_admin_help() function sc_admin_help()
{ {
if (!ADMIN) { return ''; } if (!ADMIN) { return ''; }
@@ -87,7 +87,7 @@ class admin_shortcodes
return $help_text; return $help_text;
} }
function get_admin_icon() function sc_admin_icon()
{ {
if (ADMIN) if (ADMIN)
{ {
@@ -126,7 +126,7 @@ class admin_shortcodes
} }
} }
function get_admin_lang($parm) function sc_admin_lang($parm)
{ {
global $e107, $sql, $pref; global $e107, $sql, $pref;
@@ -260,7 +260,7 @@ class admin_shortcodes
} }
function get_admin_latest($parm) function sc_admin_latest($parm)
{ {
if (ADMIN) { if (ADMIN) {
if (!function_exists('admin_latest')) if (!function_exists('admin_latest'))
@@ -320,7 +320,7 @@ class admin_shortcodes
} }
} }
function get_admin_log($parm) function sc_admin_log($parm)
{ {
if (getperms('0')) if (getperms('0'))
{ {
@@ -376,7 +376,7 @@ class admin_shortcodes
} }
} }
function get_admin_logged() function sc_admin_logged()
{ {
if (ADMIN) if (ADMIN)
{ {
@@ -396,7 +396,7 @@ class admin_shortcodes
} }
} }
function get_admin_logo($parm) function sc_admin_logo($parm)
{ {
parse_str($parm); parse_str($parm);
@@ -434,7 +434,7 @@ class admin_shortcodes
return $image; return $image;
} }
function get_admin_menu($parm) function sc_admin_menu($parm)
{ {
if (ADMIN) if (ADMIN)
{ {
@@ -478,7 +478,7 @@ class admin_shortcodes
} }
} }
function get_admin_msg($parm) function sc_admin_msg($parm)
{ {
if (ADMIN) if (ADMIN)
{ {
@@ -499,7 +499,7 @@ class admin_shortcodes
} }
} }
function get_admin_nav($parm) function sc_admin_nav($parm)
{ {
if (ADMIN) if (ADMIN)
{ {
@@ -591,7 +591,7 @@ class admin_shortcodes
} }
} }
function get_admin_plugins($parm) function sc_admin_plugins($parm)
{ {
if (ADMIN) if (ADMIN)
{ {
@@ -655,7 +655,7 @@ class admin_shortcodes
} }
} }
function get_admin_preset($parm) function sc_admin_preset($parm)
{ {
if(ADMIN && getperms('0')) if(ADMIN && getperms('0'))
{ {
@@ -708,7 +708,7 @@ class admin_shortcodes
} }
} }
function get_admin_pword() function sc_admin_pword()
{ {
global $pref; global $pref;
if (ADMIN && ADMINPERMS == '0') if (ADMIN && ADMINPERMS == '0')
@@ -722,7 +722,7 @@ class admin_shortcodes
} }
} }
function get_admin_sel_lan() function sc_admin_sel_lan()
{ {
global $pref; global $pref;
if (ADMIN) if (ADMIN)
@@ -737,7 +737,7 @@ class admin_shortcodes
} }
} }
function get_admin_siteinfo() function sc_admin_siteinfo()
{ {
if (ADMIN) if (ADMIN)
{ {
@@ -797,7 +797,7 @@ class admin_shortcodes
} }
} }
function get_admin_status($parm) function sc_admin_status($parm)
{ {
if (getperms('0') || getperms('4')) if (getperms('0') || getperms('4'))
{ {
@@ -850,7 +850,7 @@ class admin_shortcodes
} }
} }
function get_admin_update() function sc_admin_update()
{ {
if (!ADMIN) { return ''; } if (!ADMIN) { return ''; }
@@ -909,7 +909,7 @@ class admin_shortcodes
} }
} }
function get_admin_userlan() function sc_admin_userlan()
{ {
if (isset($_COOKIE['userlan']) && $_COOKIE['userlan']) if (isset($_COOKIE['userlan']) && $_COOKIE['userlan'])
{ {
@@ -917,11 +917,11 @@ class admin_shortcodes
} }
} }
function get_admin_alt_nav($parm) function sc_admin_alt_nav($parm)
{ {
/* /*
* e107 website system (c) 2001-2008 Steve Dunstan (e107.org) * e107 website system (c) 2001-2008 Steve Dunstan (e107.org)
* $Id: admin_shortcodes_class.php,v 1.14 2009-07-19 11:44:28 marj_nl_fr Exp $ * $Id: admin_shortcodes_class.php,v 1.15 2009-07-21 06:31:23 e107coders Exp $
*/ */
if (ADMIN) if (ADMIN)
@@ -1088,7 +1088,7 @@ class admin_shortcodes
} }
} }
function get_admin_navigation($parm) function sc_admin_navigation($parm)
{ {
if (!ADMIN) return ''; if (!ADMIN) return '';
@@ -1278,7 +1278,7 @@ class admin_shortcodes
return e_admin_menu('', '', $menu_vars, $$tmpl, false, false); return e_admin_menu('', '', $menu_vars, $$tmpl, false, false);
} }
function get_admin_menumanager() // List all menu-configs for easy-navigation function sc_admin_menumanager() // List all menu-configs for easy-navigation
{ {
global $pref; global $pref;
$action = ""; $action = "";

View File

@@ -11,8 +11,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/bbcode_shortcodes.php,v $ | $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/bbcode_shortcodes.php,v $
| $Revision: 1.11 $ | $Revision: 1.12 $
| $Date: 2009-07-07 07:32:59 $ | $Date: 2009-07-21 06:31:23 $
| $Author: e107coders $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -26,7 +26,7 @@ register_shortcode('bbcode_shortcodes', $codes);
class bbcode_shortcodes class bbcode_shortcodes
{ {
function get_bb($parm) function sc_bb($parm)
{ {
//FIXME - cachevars/getcachedvars! //FIXME - cachevars/getcachedvars!
global $pref, $eplug_bb, $bbcode_func, $bbcode_help, $bbcode_filedir, $bbcode_imagedir, $bbcode_helpactive, $bbcode_helptag, $register_bb; global $pref, $eplug_bb, $bbcode_func, $bbcode_help, $bbcode_filedir, $bbcode_imagedir, $bbcode_helpactive, $bbcode_helptag, $register_bb;
@@ -130,7 +130,7 @@ class bbcode_shortcodes
return $text; return $text;
} }
function get_bb_help($parm) function sc_bb_help($parm)
{ {
if(defsettrue('e_WYSIWYG')) { return; } if(defsettrue('e_WYSIWYG')) { return; }
global $bbcode_helpactive,$bbcode_helptag; global $bbcode_helpactive,$bbcode_helptag;
@@ -141,7 +141,7 @@ class bbcode_shortcodes
return "<input id='{$bbcode_helptag}' class='tbox large helpbox' type='text' name='{$bbcode_helptag}' size='90' readonly='readonly' />"; return "<input id='{$bbcode_helptag}' class='tbox large helpbox' type='text' name='{$bbcode_helptag}' size='90' readonly='readonly' />";
} }
function get_bb_preimagedir($parm) function sc_bb_preimagedir($parm)
{ {
if(defsettrue('e_WYSIWYG')) { return; } if(defsettrue('e_WYSIWYG')) { return; }
global $bbcode_imagedir; global $bbcode_imagedir;

View File

@@ -1,7 +1,7 @@
<?php <?php
/* /*
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt) * Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id: news_shortcodes.php,v 1.21 2009-07-07 07:25:27 e107coders Exp $ * $Id: news_shortcodes.php,v 1.22 2009-07-21 06:31:23 e107coders Exp $
* *
* News shortcode batch * News shortcode batch
*/ */
@@ -22,9 +22,9 @@ $codes = array();
$tmp = get_class_methods('news_shortcodes'); $tmp = get_class_methods('news_shortcodes');
foreach($tmp as $c) foreach($tmp as $c)
{ {
if(strpos($c, 'get_') === 0) if(strpos($c, 'sc_') === 0)
{ {
$codes[] = substr($c, 4); $codes[] = substr($c, 3);
} }
} }
unset($tmp); unset($tmp);
@@ -48,12 +48,12 @@ class news_shortcodes
$e107->tp->e_sc->scClasses['news_shortcodes']->param = getcachedvars('current_news_param'); $e107->tp->e_sc->scClasses['news_shortcodes']->param = getcachedvars('current_news_param');
} }
function get_newstitle() function sc_newstitle()
{ {
return $this->e107->tp->toHTML($this->news_item['news_title'], TRUE, 'TITLE'); return $this->e107->tp->toHTML($this->news_item['news_title'], TRUE, 'TITLE');
} }
function get_newsbody($parm) function sc_newsbody($parm)
{ {
$news_body = $this->e107->tp->toHTML($this->news_item['news_body'], true, 'BODY, fromadmin', $this->news_item['news_author']); $news_body = $this->e107->tp->toHTML($this->news_item['news_body'], true, 'BODY, fromadmin', $this->news_item['news_author']);
if($this->news_item['news_extended'] && (isset($_POST['preview']) || strpos(e_QUERY, 'extend') !== FALSE) && $parm != 'noextend') if($this->news_item['news_extended'] && (isset($_POST['preview']) || strpos(e_QUERY, 'extend') !== FALSE) && $parm != 'noextend')
@@ -64,7 +64,7 @@ class news_shortcodes
return $news_body; return $news_body;
} }
function get_newsicon($parm) function sc_newsicon($parm)
{ {
$category_icon = str_replace('../', '', trim($this->news_item['category_icon'])); $category_icon = str_replace('../', '', trim($this->news_item['category_icon']));
if ($category_icon && strstr('images', $category_icon)) if ($category_icon && strstr('images', $category_icon))
@@ -80,7 +80,7 @@ class news_shortcodes
return "<a href='".$this->e107->url->getUrl('core:news', 'main', 'action=cat&value='.$this->news_item['news_category'])."'><img style='".$this->param['caticon']."' src='".$category_icon."' alt='' /></a>"; return "<a href='".$this->e107->url->getUrl('core:news', 'main', 'action=cat&value='.$this->news_item['news_category'])."'><img style='".$this->param['caticon']."' src='".$category_icon."' alt='' /></a>";
} }
function get_newsauthor($parm) function sc_newsauthor($parm)
{ {
if($this->news_item['user_id']) if($this->news_item['user_id'])
{ {
@@ -96,7 +96,7 @@ class news_shortcodes
return "<a href='http://e107.org'>e107</a>"; return "<a href='http://e107.org'>e107</a>";
} }
function get_newscomments($parm) function sc_newscomments($parm)
{ {
global $pref, $sql; global $pref, $sql;
if($pref['comments_disabled'] == 1) if($pref['comments_disabled'] == 1)
@@ -132,14 +132,14 @@ class news_shortcodes
return ($news_item['news_allow_comments'] ? ''.($pref['comments_icon'] ? $NEWIMAGE : '')." <a href='".e_HTTP."comment.php?comment.news.".$news_item['news_id']."'>".$param['commentlink'].$news_item['news_comment_total'].'</a>' : $param['commentoffstring']); return ($news_item['news_allow_comments'] ? ''.($pref['comments_icon'] ? $NEWIMAGE : '')." <a href='".e_HTTP."comment.php?comment.news.".$news_item['news_id']."'>".$param['commentlink'].$news_item['news_comment_total'].'</a>' : $param['commentoffstring']);
} }
function get_trackback($parm) function sc_trackback($parm)
{ {
global $pref; global $pref;
if(!varsettrue($pref['trackbackEnabled'])) { return ''; } if(!varsettrue($pref['trackbackEnabled'])) { return ''; }
return ($this->param['trackbackbeforestring'] ? $this->param['trackbackbeforestring'] : '')."<a href='".e_HTTP."comment.php?comment.news.".$this->news_item['news_id']."#track'>".$this->param['trackbackstring'].$this->news_item['tb_count'].'</a>'.($this->param['trackbackafterstring'] ? $this->param['trackbackafterstring'] : ''); return ($this->param['trackbackbeforestring'] ? $this->param['trackbackbeforestring'] : '')."<a href='".e_HTTP."comment.php?comment.news.".$this->news_item['news_id']."#track'>".$this->param['trackbackstring'].$this->news_item['tb_count'].'</a>'.($this->param['trackbackafterstring'] ? $this->param['trackbackafterstring'] : '');
} }
function get_newsheader($parm) function sc_newsheader($parm)
{ {
$category_icon = str_replace("../", "", trim($this->news_item['category_icon'])); $category_icon = str_replace("../", "", trim($this->news_item['category_icon']));
if (!$category_icon) return ''; if (!$category_icon) return '';
@@ -151,13 +151,13 @@ class news_shortcodes
} }
function get_newscategory($parm) function sc_newscategory($parm)
{ {
$category_name = $this->e107->tp->toHTML($this->news_item['category_name'], FALSE ,'defs'); $category_name = $this->e107->tp->toHTML($this->news_item['category_name'], FALSE ,'defs');
return "<a class='".$GLOBALS['NEWS_CSSMODE']."_category' style='".(isset($this->param['catlink']) ? $this->param['catlink'] : "#")."' href='".$this->e107->url->getUrl('core:news', 'main', 'action=cat&value='.$this->news_item['news_category'])."'>".$category_name."</a>"; return "<a class='".$GLOBALS['NEWS_CSSMODE']."_category' style='".(isset($this->param['catlink']) ? $this->param['catlink'] : "#")."' href='".$this->e107->url->getUrl('core:news', 'main', 'action=cat&value='.$this->news_item['news_category'])."'>".$category_name."</a>";
} }
function get_newsdate($parm) function sc_newsdate($parm)
{ {
$con = new convert; $con = new convert;
if($parm == '') if($parm == '')
@@ -181,41 +181,41 @@ class news_shortcodes
} }
} }
function get_newscommentlink($parm) function sc_newscommentlink($parm)
{ {
return ($this->news_item['news_allow_comments'] ? $this->param['commentoffstring'] : " <a href='".e_HTTP."comment.php?comment.news.".$this->news_item['news_id']."'>".$this->param['commentlink'].'</a>'); return ($this->news_item['news_allow_comments'] ? $this->param['commentoffstring'] : " <a href='".e_HTTP."comment.php?comment.news.".$this->news_item['news_id']."'>".$this->param['commentlink'].'</a>');
} }
function get_newscommentcount($parm) function sc_newscommentcount($parm)
{ {
return $this->news_item['news_comment_total']; return $this->news_item['news_comment_total'];
} }
function get_emailicon($parm) function sc_emailicon($parm)
{ {
require_once(e_HANDLER.'emailprint_class.php'); require_once(e_HANDLER.'emailprint_class.php');
return emailprint::render_emailprint('news', $this->news_item['news_id'], 1); return emailprint::render_emailprint('news', $this->news_item['news_id'], 1);
} }
function get_printicon() function sc_printicon()
{ {
require_once(e_HANDLER.'emailprint_class.php'); require_once(e_HANDLER.'emailprint_class.php');
return emailprint::render_emailprint('news', $this->news_item['news_id'], 2); return emailprint::render_emailprint('news', $this->news_item['news_id'], 2);
} }
function get_pdficon() function sc_pdficon()
{ {
global $pref; global $pref;
if (!$pref['plug_installed']['pdf']) { return ''; } if (!$pref['plug_installed']['pdf']) { return ''; }
return $this->e107->tp->parseTemplate('{PDF='.LAN_NEWS_24.'^news.'.$this->news_item['news_id'].'}'); return $this->e107->tp->parseTemplate('{PDF='.LAN_NEWS_24.'^news.'.$this->news_item['news_id'].'}');
} }
function get_newsid() function sc_newsid()
{ {
return $this->news_item['news_id']; return $this->news_item['news_id'];
} }
function get_adminoptions() function sc_adminoptions()
{ {
if (ADMIN && getperms('H')) if (ADMIN && getperms('H'))
{ {
@@ -228,7 +228,7 @@ class news_shortcodes
} }
} }
function get_extended($parm) function sc_extended($parm)
{ {
if ($this->news_item['news_extended'] && (strpos(e_QUERY, 'extend') === FALSE || $parm == 'force')) if ($this->news_item['news_extended'] && (strpos(e_QUERY, 'extend') === FALSE || $parm == 'force'))
{ {
@@ -252,50 +252,50 @@ class news_shortcodes
return ''; return '';
} }
function get_captionclass() function sc_captionclass()
{ {
$news_title = $this->e107->tp->toHTML($this->news_item['news_title'], TRUE,'no_hook,emotes_off, no_make_clickable'); $news_title = $this->e107->tp->toHTML($this->news_item['news_title'], TRUE,'no_hook,emotes_off, no_make_clickable');
return "<div class='category".$this->news_item['news_category']."'>".($this->news_item['news_render_type'] == 1 ? "<a href='".e_HTTP."comment.php?comment.news.".$this->news_item['news_id']."'>".$news_title."</a>" : $news_title)."</div>"; return "<div class='category".$this->news_item['news_category']."'>".($this->news_item['news_render_type'] == 1 ? "<a href='".e_HTTP."comment.php?comment.news.".$this->news_item['news_id']."'>".$news_title."</a>" : $news_title)."</div>";
} }
function get_admincaption() function sc_admincaption()
{ {
$news_title = $this->e107->tp->toHTML($this->news_item['news_title'], TRUE,'no_hook,emotes_off, no_make_clickable'); $news_title = $this->e107->tp->toHTML($this->news_item['news_title'], TRUE,'no_hook,emotes_off, no_make_clickable');
return "<div class='".(defined(ADMINNAME) ? ADMINNAME : "null")."'>".($this->news_item['news_render_type'] == 1 ? "<a href='".e_HTTP."comment.php?comment.news.".$this->news_item['news_id']."'>".$news_title."</a>" : $news_title)."</div>"; return "<div class='".(defined(ADMINNAME) ? ADMINNAME : "null")."'>".($this->news_item['news_render_type'] == 1 ? "<a href='".e_HTTP."comment.php?comment.news.".$this->news_item['news_id']."'>".$news_title."</a>" : $news_title)."</div>";
} }
function get_adminbody($parm) function sc_adminbody($parm)
{ {
$news_body = $this->get_newsbody($parm); $news_body = $this->sc_newsbody($parm);
return "<div class='".(defined(ADMINNAME) ? ADMINNAME : 'null')."'>".$news_body.'</div>'; return "<div class='".(defined(ADMINNAME) ? ADMINNAME : 'null')."'>".$news_body.'</div>';
} }
function get_newssummary() function sc_newssummary()
{ {
return ($this->news_item['news_summary']) ? $this->news_item['news_summary'].'<br />' : ''; return ($this->news_item['news_summary']) ? $this->news_item['news_summary'].'<br />' : '';
} }
function get_newsthumbnail() function sc_newsthumbnail()
{ {
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail']) ? "<a href='".$this->e107->url->getUrl('core:news', 'main', "action=item&value1={$this->news_item['news_id']}&value2={$this->news_item['news_category']}")."'><img class='news_image' src='".e_IMAGE_ABS."newspost_images/".$this->news_item['news_thumbnail']."' alt='' style='".$this->param['thumbnail']."' /></a>" : ''; return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail']) ? "<a href='".$this->e107->url->getUrl('core:news', 'main', "action=item&value1={$this->news_item['news_id']}&value2={$this->news_item['news_category']}")."'><img class='news_image' src='".e_IMAGE_ABS."newspost_images/".$this->news_item['news_thumbnail']."' alt='' style='".$this->param['thumbnail']."' /></a>" : '';
} }
function get_newsimage() function sc_newsimage()
{ {
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail']) ? "<a href='".$this->e107->url->getUrl('core:news', 'main', "action=item&value1={$this->news_item['news_id']}&value2={$this->news_item['news_category']}")."'><img class='news_image' src='".e_IMAGE_ABS."newspost_images/".$this->news_item['news_thumbnail']."' alt='' style='".$this->param['thumbnail']."' /></a>" : ''; return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail']) ? "<a href='".$this->e107->url->getUrl('core:news', 'main', "action=item&value1={$this->news_item['news_id']}&value2={$this->news_item['news_category']}")."'><img class='news_image' src='".e_IMAGE_ABS."newspost_images/".$this->news_item['news_thumbnail']."' alt='' style='".$this->param['thumbnail']."' /></a>" : '';
} }
function get_sticky_icon() function sc_sticky_icon()
{ {
return $this->news_item['news_sticky'] ? $this->param['image_sticky'] : ''; return $this->news_item['news_sticky'] ? $this->param['image_sticky'] : '';
} }
function get_newstitlelink() function sc_newstitlelink()
{ {
return "<a style='".(isset($this->param['itemlink']) ? $this->param['itemlink'] : 'null')."' href='".$this->e107->url->getUrl('core:news', 'main', "action=item&value1={$this->news_item['news_id']}&value2={$this->news_item['news_category']}")."'>".$this->news_item['news_title'].'</a>'; return "<a style='".(isset($this->param['itemlink']) ? $this->param['itemlink'] : 'null')."' href='".$this->e107->url->getUrl('core:news', 'main', "action=item&value1={$this->news_item['news_id']}&value2={$this->news_item['news_category']}")."'>".$this->news_item['news_title'].'</a>';
} }
function get_newscaticon() function sc_newscaticon()
{ {
$category_icon = str_replace('../', '', trim($this->news_item['category_icon'])); $category_icon = str_replace('../', '', trim($this->news_item['category_icon']));
if (!$category_icon) { return ''; } if (!$category_icon) { return ''; }
@@ -312,7 +312,7 @@ class news_shortcodes
return "<a href='".$this->e107->url->getUrl('core:news', 'main', "action=cat&value={$this->news_item['news_category']}")."'><img style='".$this->param['caticon']."' src='".$category_icon."' alt='' /></a>"; return "<a href='".$this->e107->url->getUrl('core:news', 'main', "action=cat&value={$this->news_item['news_category']}")."'><img style='".$this->param['caticon']."' src='".$category_icon."' alt='' /></a>";
} }
function get_newsinfo() function sc_newsinfo()
{ {
$news_item = $this->news_item; $news_item = $this->news_item;
$param = $this->param; $param = $this->param;

View File

@@ -1,7 +1,7 @@
<?php <?php
/* /*
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt) * Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
* $Id: siteinfo_shortcodes.php,v 1.3 2009-01-09 13:10:01 mcfly_e107 Exp $ * $Id: siteinfo_shortcodes.php,v 1.4 2009-07-21 06:31:23 e107coders Exp $
* *
* Siteinfo shortcode batch * Siteinfo shortcode batch
*/ */
@@ -12,36 +12,36 @@ register_shortcode('siteinfo_shortcodes', $codes);
class siteinfo_shortcodes class siteinfo_shortcodes
{ {
function get_sitebutton() function sc_sitebutton()
{ {
$e107 = e107::getInstance(); $e107 = e107::getInstance();
$path = ($_POST['sitebutton'] && $_POST['ajax_used']) ? $e107->tp->replaceConstants($_POST['sitebutton']) : (strstr(SITEBUTTON, 'http:') ? SITEBUTTON : e_IMAGE.SITEBUTTON); $path = ($_POST['sitebutton'] && $_POST['ajax_used']) ? $e107->tp->replaceConstants($_POST['sitebutton']) : (strstr(SITEBUTTON, 'http:') ? SITEBUTTON : e_IMAGE.SITEBUTTON);
return "<a href='".SITEURL."'><img src='".$path."' alt=\"".SITENAME."\" style='border: 0px; width: 88px; height: 31px' /></a>"; return "<a href='".SITEURL."'><img src='".$path."' alt=\"".SITENAME."\" style='border: 0px; width: 88px; height: 31px' /></a>";
} }
function get_sitedisclaimer() function sc_sitedisclaimer()
{ {
$e107 = e107::getInstance(); $e107 = e107::getInstance();
return $e107->tp->toHtml(SITEDISCLAIMER, true, 'constants defs'); return $e107->tp->toHtml(SITEDISCLAIMER, true, 'constants defs');
} }
function get_sitename($parm) function sc_sitename($parm)
{ {
return ($parm == 'link') ? "<a href='".SITEURL."' title=\"".SITENAME."\">".SITENAME."</a>" : SITENAME; return ($parm == 'link') ? "<a href='".SITEURL."' title=\"".SITENAME."\">".SITENAME."</a>" : SITENAME;
} }
function get_sitedescription() function sc_sitedescription()
{ {
global $pref; global $pref;
return SITEDESCRIPTION.(defined('THEME_DESCRIPTION') && $pref['displaythemeinfo'] ? THEME_DESCRIPTION : ''); return SITEDESCRIPTION.(defined('THEME_DESCRIPTION') && $pref['displaythemeinfo'] ? THEME_DESCRIPTION : '');
} }
function get_sitetag() function sc_sitetag()
{ {
return SITETAG; return SITETAG;
} }
function get_logo($parm) function sc_logo($parm)
{ {
parse_str($parm); // Optional {LOGO=file=file_name} or {LOGO=link=url} or {LOGO=file=file_name&link=url} parse_str($parm); // Optional {LOGO=file=file_name} or {LOGO=link=url} or {LOGO=file=file_name&link=url}
// Paths to image file, link are relative to site base // Paths to image file, link are relative to site base
@@ -81,7 +81,7 @@ class siteinfo_shortcodes
return $image; return $image;
} }
function get_theme_disclaimer($parm) function sc_theme_disclaimer($parm)
{ {
global $pref; global $pref;
return (defined('THEME_DISCLAIMER') && $pref['displaythemeinfo'] ? THEME_DISCLAIMER : ''); return (defined('THEME_DISCLAIMER') && $pref['displaythemeinfo'] ? THEME_DISCLAIMER : '');

View File

@@ -9,8 +9,8 @@
* User information - shortcodes * User information - shortcodes
* *
* $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/user_shortcodes.php,v $ * $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/user_shortcodes.php,v $
* $Revision: 1.14 $ * $Revision: 1.15 $
* $Date: 2009-07-07 07:25:27 $ * $Date: 2009-07-21 06:31:23 $
* $Author: e107coders $ * $Author: e107coders $
* *
*/ */
@@ -423,7 +423,8 @@ require_once(e_HANDLER."user_extended_class.php");
$ue = new e107_user_extended; $ue = new e107_user_extended;
$ueCatList = $ue->user_extended_get_categories(); $ueCatList = $ue->user_extended_get_categories();
$ueFieldList = $ue->user_extended_get_fields(); $ueFieldList = $ue->user_extended_get_
fields();
$ueCatList[0][0] = array('user_extended_struct_name' => LAN_USER_44); $ueCatList[0][0] = array('user_extended_struct_name' => LAN_USER_44);
$ret = ""; $ret = "";
foreach($ueCatList as $catnum => $cat) foreach($ueCatList as $catnum => $cat)

View File

@@ -12,8 +12,8 @@
| GNU General Public License (http://gnu.org). | GNU General Public License (http://gnu.org).
| |
| $Source: /cvs_backup/e107_0.8/e107_handlers/shortcode_handler.php,v $ | $Source: /cvs_backup/e107_0.8/e107_handlers/shortcode_handler.php,v $
| $Revision: 1.26 $ | $Revision: 1.27 $
| $Date: 2009-07-12 02:29:24 $ | $Date: 2009-07-21 06:31:23 $
| $Author: e107coders $ | $Author: e107coders $
+----------------------------------------------------------------------------+ +----------------------------------------------------------------------------+
*/ */
@@ -32,9 +32,9 @@ function register_shortcode($classFunc, $codes, $path='', $force=false)
$tmp = get_class_methods($classFunc); $tmp = get_class_methods($classFunc);
foreach($tmp as $c) foreach($tmp as $c)
{ {
if(strpos($c, 'get_') === 0) if(strpos($c, 'sc_') === 0)
{ {
$codes[] = substr($c, 4); $codes[] = substr($c, 3);
} }
} }
unset($tmp); unset($tmp);
@@ -253,7 +253,7 @@ class e_shortcode
case 'class': case 'class':
//It is batch shortcode. Load the class and call the method //It is batch shortcode. Load the class and call the method
$_class = $this->registered_codes[$code]['class']; $_class = $this->registered_codes[$code]['class'];
$_method = 'get_'.strtolower($code); $_method = 'sc_'.strtolower($code);
if(!isset($this->scClasses[$_class])) if(!isset($this->scClasses[$_class]))
{ {
if(!class_exists($_class) && $this->registered_codes[$code]['path']) if(!class_exists($_class) && $this->registered_codes[$code]['path'])