mirror of
https://github.com/e107inc/e107.git
synced 2025-08-30 17:50:12 +02:00
moving batch shortcode folder
This commit is contained in:
37
e107_core/shortcodes/batch/admin_shortcodes.php
Normal file
37
e107_core/shortcodes/batch/admin_shortcodes.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
* $Id$
|
||||
*
|
||||
* Admin shortcode batch - registration
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
$codes = array(
|
||||
'admin_alt_nav',
|
||||
'admin_credits',
|
||||
'admin_docs',
|
||||
'admin_help',
|
||||
'admin_icon',
|
||||
'admin_lang',
|
||||
'admin_latest',
|
||||
'admin_log',
|
||||
'admin_logged',
|
||||
'admin_logo',
|
||||
'admin_menu',
|
||||
'admin_msg',
|
||||
'admin_nav',
|
||||
'admin_navigation',
|
||||
'admin_plugins',
|
||||
'admin_preset',
|
||||
'admin_pword',
|
||||
'admin_sel_lan',
|
||||
'admin_siteinfo',
|
||||
'admin_status',
|
||||
'admin_update',
|
||||
'admin_userlan',
|
||||
'admin_menumanager',
|
||||
);
|
||||
|
||||
register_shortcode('admin_shortcodes', $codes, e_FILE.'shortcode/batch/admin_shortcodes_class.php');
|
||||
?>
|
1372
e107_core/shortcodes/batch/admin_shortcodes_class.php
Normal file
1372
e107_core/shortcodes/batch/admin_shortcodes_class.php
Normal file
File diff suppressed because it is too large
Load Diff
152
e107_core/shortcodes/batch/bbcode_shortcodes.php
Normal file
152
e107_core/shortcodes/batch/bbcode_shortcodes.php
Normal file
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/bbcode_shortcodes.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
include_once(e_HANDLER.'shortcode_handler.php');
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_ren_help.php');
|
||||
|
||||
$codes = array('bb', 'bb_help', 'bb_preimagedir');
|
||||
register_shortcode('bbcode_shortcodes', $codes);
|
||||
|
||||
class bbcode_shortcodes
|
||||
{
|
||||
function sc_bb($parm)
|
||||
{
|
||||
//FIXME - cachevars/getcachedvars!
|
||||
global $pref, $eplug_bb, $bbcode_func, $bbcode_help, $bbcode_filedir, $bbcode_imagedir, $bbcode_helpactive, $bbcode_helptag, $register_bb;
|
||||
|
||||
if(defsettrue('e_WYSIWYG')){ return; }
|
||||
|
||||
$bbcode_func = ($bbcode_func) ? $bbcode_func : "addtext";
|
||||
$bbcode_help = ($bbcode_help) ? $bbcode_help : "help";
|
||||
$bbcode_tag = ($bbcode_helptag != 'helpb') ? ",'$bbcode_helptag'" : "";
|
||||
|
||||
$rand = rand(1000,9999);
|
||||
$imagedir_display = str_replace('../','',$bbcode_imagedir);
|
||||
|
||||
if($parm == 'emotes')
|
||||
{
|
||||
if ($pref['comments_emoticons'] && $pref['smiley_activate'] && !defsettrue('e_WYSIWYG'))
|
||||
{
|
||||
$bbcode['emotes'] = array("expandit","emoticon_selector_".$rand, LANHELP_44, "emotes.png", "Emoticon_Select", "emoticon_selector_".$rand);
|
||||
}
|
||||
else
|
||||
{ // If emotes disabled, don't return anything (without this we return an empty image reference)
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
// Format: $bbcode['UNIQUE_NAME'] = array(ONCLICK_FUNC, ONCLICK_VAR, HELPTEXT, ICON, INCLUDE_FUNC, INCLUDE_FUNCTION_VAR);
|
||||
|
||||
$bbcode['newpage'] = array($bbcode_func,"[newpage]", LANHELP_34, "newpage.png");
|
||||
$bbcode['link'] = array($bbcode_func,"[link=".LANHELP_35."][/link]", LANHELP_23,"link.png");
|
||||
$bbcode['b'] = array($bbcode_func,"[b][/b]", LANHELP_24,"bold.png");
|
||||
$bbcode['i'] = array($bbcode_func,"[i][/i]", LANHELP_25,"italic.png");
|
||||
$bbcode['u'] = array($bbcode_func,"[u][/u]", LANHELP_26,"underline.png");
|
||||
$bbcode['center'] = array($bbcode_func,"[center][/center]", LANHELP_28,"center.png");
|
||||
$bbcode['left'] = array($bbcode_func,"[left][/left]", LANHELP_29,"left.png");
|
||||
$bbcode['right'] = array($bbcode_func,"[right][/right]", LANHELP_30,"right.png");
|
||||
$bbcode['bq'] = array($bbcode_func,"[blockquote][/blockquote]", LANHELP_31,"blockquote.png");
|
||||
$bbcode['code'] = array($bbcode_func,"[code][/code]", LANHELP_32,"code.png");
|
||||
$bbcode['list'] = array($bbcode_func,"[list][/list]", LANHELP_36,"list.png");
|
||||
$bbcode['img'] = array($bbcode_func,"[img][/img]", LANHELP_27,"image.png");
|
||||
$bbcode['flash'] = array($bbcode_func,"[flash=width,height][/flash]", LANHELP_47,"flash.png");
|
||||
|
||||
$bbcode['fontsize'] = array("expandit","size_selector_".$rand, LANHELP_22,"fontsize.png","Size_Select",'size_selector_'.$rand);
|
||||
$bbcode['fontcol'] = array("expandit","col_selector_".$rand, LANHELP_21,"fontcol.png","Color_Select",'col_selector_'.$rand);
|
||||
$bbcode['preimage'] = array("expandit","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);
|
||||
|
||||
if(!isset($iconpath[$parm]))
|
||||
{
|
||||
$iconpath[$parm] = (file_exists(THEME."bbcode/bold.png") ? THEME_ABS."bbcode/" : e_IMAGE_ABS."bbcode/");
|
||||
$iconpath[$parm] .= $bbcode[$parm][3];
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!empty($register_bb))
|
||||
{
|
||||
foreach($register_bb as $key=>$val) // allow themes to plug in to it.
|
||||
{
|
||||
if($val[0]=="")
|
||||
{
|
||||
$val[0] = $bbcode_func;
|
||||
}
|
||||
$bbcode[$key] = $val;
|
||||
$iconpath[$key] = $val[3];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!empty($eplug_bb))
|
||||
{
|
||||
foreach($eplug_bb as $key=>$val) // allow plugins to plug into it.
|
||||
{
|
||||
extract($val);
|
||||
// echo "$onclick $onclick_var $helptext $icon <br />";
|
||||
$bbcode[$name] = array($onclick,$onclick_var,$helptext,$icon,$function,$function_var);
|
||||
$iconpath[$name] = $icon;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$_onclick_func = (isset($bbcode[$parm][0])) ? $bbcode[$parm][0] : $bbcode_func;
|
||||
$_onclick_var = (isset($bbcode[$parm][1])) ? $bbcode[$parm][1] : '';
|
||||
$_helptxt = (isset($bbcode[$parm][2])) ? $bbcode[$parm][2] : '';
|
||||
$_function = (isset($bbcode[$parm][4])) ? $bbcode[$parm][4] : '';
|
||||
$_function_var = (isset($bbcode[$parm][5])) ? $bbcode[$parm][5] : '';
|
||||
|
||||
|
||||
if($bbcode[$parm]) // default - insert text.
|
||||
{
|
||||
$text = "\n<img class='bbcode bbcode_buttons e-pointer' src='".$iconpath[$parm]."' alt='' title='".$_helptxt."' onclick=\"{$_onclick_func}('".$_onclick_var."')\" ".($bbcode_helpactive ? "onmouseout=\"{$bbcode_help}(''{$bbcode_tag})\" onmouseover=\"{$bbcode_help}('".$_helptxt."'{$bbcode_tag})\"" : "" )." />\n";
|
||||
}
|
||||
|
||||
if($_function)
|
||||
{
|
||||
|
||||
$text .= ($bbcode_helpactive && $_helptxt && !$iconpath[$parm]) ? "<span onmouseout=\"{$bbcode_help}(''{$bbcode_tag})\" onmouseover=\"{$bbcode_help}('".$_helptxt."'{$bbcode_tag})\" >" : "";
|
||||
$text .= call_user_func($_function, $_function_var);
|
||||
$text .= ($bbcode_helpactive && $_helptxt && !$iconpath[$parm]) ? "</span>" : "";
|
||||
}
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
function sc_bb_help($parm)
|
||||
{
|
||||
if(defsettrue('e_WYSIWYG')) { return; }
|
||||
global $bbcode_helpactive,$bbcode_helptag, $bbcode_helpsize;
|
||||
if($parm) $bbcode_helptag = $parm;
|
||||
elseif(!varset($bbcode_helptag)) $bbcode_helptag = 'helpb';
|
||||
if($bbcode_helpsize) $bbcode_helpsize = ' '.$bbcode_helpsize;
|
||||
$bbcode_helpactive = TRUE;
|
||||
|
||||
//FIXME - better bb help
|
||||
return "<input id='{$bbcode_helptag}' class='helpbox{$bbcode_helpsize}' type='text' name='{$bbcode_helptag}' size='90' readonly='readonly' />";
|
||||
}
|
||||
|
||||
function sc_bb_preimagedir($parm)
|
||||
{
|
||||
if(defsettrue('e_WYSIWYG')) { return; }
|
||||
global $bbcode_imagedir;
|
||||
$bbcode_imagedir = $parm;
|
||||
return;
|
||||
}
|
||||
}
|
||||
?>
|
153
e107_core/shortcodes/batch/comment_shortcodes.php
Normal file
153
e107_core/shortcodes/batch/comment_shortcodes.php
Normal file
@@ -0,0 +1,153 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/comment_shortcodes.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
include_once(e_HANDLER.'shortcode_handler.php');
|
||||
$comment_shortcodes = e107::getScParser()->parse_scbatch(__FILE__);
|
||||
|
||||
/*
|
||||
SC_BEGIN SUBJECT
|
||||
global $SUBJECT, $comrow, $pref, $NEWIMAGE, $tp;
|
||||
if (isset($pref['nested_comments']) && $pref['nested_comments']) {
|
||||
$SUBJECT = $NEWIMAGE." ".(empty($comrow['comment_subject']) ? $subject : $tp->toHTML($comrow['comment_subject'], TRUE));
|
||||
} else {
|
||||
$SUBJECT = '';
|
||||
}
|
||||
return $SUBJECT;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USERNAME
|
||||
global $USERNAME, $comrow;
|
||||
if (isset($comrow['user_id']) && $comrow['user_id'])
|
||||
{
|
||||
$USERNAME = $parm == 'raw' ? $comrow['user_name'] : "<a href='".e107::getUrl()->create('core:user', 'main', 'func=profile&id='.$comrow['user_id'])."'>".$comrow['user_name']."</a>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$comrow['user_id'] = 0;
|
||||
$USERNAME = preg_replace("/[0-9]+\./", '', $comrow['comment_author_name']);
|
||||
$USERNAME = str_replace("Anonymous", LAN_ANONYMOUS, $USERNAME);
|
||||
}
|
||||
return $USERNAME;
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN TIMEDATE
|
||||
global $TIMEDATE, $comrow, $datestamp, $gen;
|
||||
$datestamp = $gen->convert_date($comrow['comment_datestamp'], "short");
|
||||
return $datestamp;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN REPLY
|
||||
global $REPLY, $comrow, $action, $pref, $table, $id, $thisaction, $thistable, $thisid;
|
||||
$REPLY = '';
|
||||
if($comrow['comment_lock'] != "1"){
|
||||
if ($thisaction == "comment" && $pref['nested_comments']) {
|
||||
$REPLY = "<a href='".SITEURL."comment.php?reply.".$thistable.".".$comrow['comment_id'].".".$thisid."'>".COMLAN_326."</a>";
|
||||
}
|
||||
}
|
||||
return $REPLY;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN AVATAR
|
||||
global $AVATAR, $comrow;
|
||||
if (isset($comrow['user_id']) && $comrow['user_id']) {
|
||||
if (isset($comrow['user_image']) && $comrow['user_image']) {
|
||||
require_once(e_HANDLER."avatar_handler.php");
|
||||
$comrow['user_image'] = avatar($comrow['user_image']);
|
||||
$comrow['user_image'] = "<div class='spacer'><img src='".$comrow['user_image']."' alt='' /></div>";
|
||||
}else{
|
||||
$comrow['user_image'] = '';
|
||||
}
|
||||
}else{
|
||||
$comrow['user_image'] = '';
|
||||
}
|
||||
return $comrow['user_image'];
|
||||
SC_END
|
||||
|
||||
SC_BEGIN COMMENTS
|
||||
global $COMMENTS, $comrow;
|
||||
return (isset($comrow['user_id']) && $comrow['user_id'] ? COMLAN_99.": ".$comrow['user_comments'] : COMLAN_194)."<br />";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN JOINED
|
||||
global $JOINED, $comrow, $gen;
|
||||
$JOINED = '';
|
||||
if ($comrow['user_id'] && !$comrow['user_admin']) {
|
||||
$comrow['user_join'] = $gen->convert_date($comrow['user_join'], "short");
|
||||
$JOINED = ($comrow['user_join'] ? COMLAN_145." ".$comrow['user_join'] : '');
|
||||
}
|
||||
return $JOINED;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN COMMENT
|
||||
global $COMMENT, $comrow, $tp, $pref;
|
||||
return (isset($comrow['comment_blocked']) && $comrow['comment_blocked'] ? COMLAN_0 : $tp->toHTML($comrow['comment_comment'], TRUE, FALSE, $comrow['user_id']));
|
||||
SC_END
|
||||
|
||||
SC_BEGIN COMMENTEDIT
|
||||
global $COMMENTEDIT, $pref, $comrow, $comment_edit_query;
|
||||
if ($pref['allowCommentEdit'] && USER && $comrow['user_id'] == USERID && $comrow['comment_lock'] != "1")
|
||||
{
|
||||
$adop_icon = (file_exists(THEME."images/commentedit.png") ? THEME_ABS."images/commentedit.png" : e_IMAGE_ABS."admin_images/edit_16.png");
|
||||
//Searching for '.' is BAD!!! It breaks mod rewritten requests. Why is this needed at all?
|
||||
if (strstr(e_QUERY, "&"))
|
||||
{
|
||||
return "<a href='".e_SELF."?".e_QUERY."&comment=edit&comment_id=".$comrow['comment_id']."'><img src='".$adop_icon."' alt='".COMLAN_318."' title='".COMLAN_318."' class='icon' /></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
// return "<a href='".e_SELF."?".$comment_edit_query.".edit.".$comrow['comment_id']."'><img src='".e_IMAGE."generic/newsedit.png' alt='".COMLAN_318."' title='".COMLAN_318."' style='border: 0;' /></a>";
|
||||
return "<a href='".SITEURL."comment.php?".$comment_edit_query.".edit.".$comrow['comment_id']."#e-comment-form'><img src='".$adop_icon."' alt='".COMLAN_318."' title='".COMLAN_318."' class='icon' /></a>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return "";
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN RATING
|
||||
global $RATING;
|
||||
return $RATING;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN IPADDRESS
|
||||
global $IPADDRESS, $comrow, $e107;
|
||||
//require_once(e_HANDLER."encrypt_handler.php");
|
||||
return (ADMIN ? "<a href='".SITEURL."userposts.php?0.comments.".$comrow['user_id']."'>".COMLAN_330." ".$e107->ipDecode($comrow['comment_ip'])."</a>" : "");
|
||||
SC_END
|
||||
|
||||
SC_BEGIN LEVEL
|
||||
global $LEVEL, $comrow, $pref;
|
||||
$ldata = get_level($comrow['user_id'], $comrow['user_forums'], $comrow['user_comments'], $comrow['user_chats'], $comrow['user_visits'], $comrow['user_join'], $comrow['user_admin'], $comrow['user_perms'], $pref);
|
||||
return ($comrow['user_admin'] ? $ldata[0] : $ldata[1]);
|
||||
SC_END
|
||||
|
||||
SC_BEGIN LOCATION
|
||||
global $LOCATION, $comrow, $tp;
|
||||
return (isset($comrow['user_location']) && $comrow['user_location'] ? COMLAN_313.": ".$tp->toHTML($comrow['user_location'], TRUE) : '');
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNATURE
|
||||
global $SIGNATURE, $comrow, $tp;
|
||||
$SIGNATURE = (isset($comrow['user_signature']) && $comrow['user_signature'] ? $tp->toHTML($comrow['user_signature'], true) : '');
|
||||
return $SIGNATURE;
|
||||
SC_END
|
||||
|
||||
*/
|
||||
|
||||
?>
|
66
e107_core/shortcodes/batch/contact_shortcodes.php
Normal file
66
e107_core/shortcodes/batch/contact_shortcodes.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/contact_shortcodes.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
include_once(e_HANDLER.'shortcode_handler.php');
|
||||
$contact_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
|
||||
/*
|
||||
SC_BEGIN CONTACT_EMAIL_COPY
|
||||
global $pref;
|
||||
if(!isset($pref['contact_emailcopy']) || !$pref['contact_emailcopy'])
|
||||
{
|
||||
return;
|
||||
}
|
||||
return "<input type='checkbox' name='email_copy' value='1' />";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN CONTACT_PERSON
|
||||
global $sql,$tp,$pref;
|
||||
if($pref['sitecontacts'] == e_UC_ADMIN){
|
||||
$query = "user_admin =1";
|
||||
}elseif($pref['sitecontacts'] == e_UC_MAINADMIN){
|
||||
$query = "user_admin = 1 AND (user_perms = '0' OR user_perms = '0.') ";
|
||||
}else{
|
||||
$query = "FIND_IN_SET(".$pref['sitecontacts'].",user_class) ";
|
||||
}
|
||||
|
||||
$text = "<select name='contact_person' class='tbox contact_person'>\n";
|
||||
$count = $sql -> db_Select("user", "user_id,user_name", $query . " ORDER BY user_name");
|
||||
if($count > 1){
|
||||
while($row = $sql-> db_Fetch())
|
||||
{
|
||||
$text .= "<option value='".$row['user_id']."'>".$row['user_name']."</option>\n";
|
||||
}
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
$text .= "</select>";
|
||||
return $text;
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN CONTACT_IMAGECODE
|
||||
global $sec_img;
|
||||
return "<input type='hidden' name='rand_num' value='".$sec_img->random_number."' />".$sec_img->r_image();
|
||||
SC_END
|
||||
|
||||
SC_BEGIN CONTACT_IMAGECODE_INPUT
|
||||
return "<input class='tbox' type='text' name='code_verify' size='15' maxlength='20' />";
|
||||
SC_END
|
||||
|
||||
*/
|
||||
|
||||
?>
|
523
e107_core/shortcodes/batch/download_shortcodes.php
Normal file
523
e107_core/shortcodes/batch/download_shortcodes.php
Normal file
@@ -0,0 +1,523 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/download_shortcodes.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
include_once(e_HANDLER.'shortcode_handler.php');
|
||||
$download_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
|
||||
/*
|
||||
SC_BEGIN DOWNLOAD_LIST_NAME
|
||||
global $row,$tp,$pref;
|
||||
if($parm == "nolink"){
|
||||
return $tp->toHTML($row['download_name'],TRUE,'LINKTEXT');
|
||||
}
|
||||
if($parm == "request"){
|
||||
|
||||
$agreetext = $tp->toJS($tp->toHTML($pref['agree_text'],FALSE,'DESCRIPTION'));
|
||||
if($row['download_mirror_type']){
|
||||
$text = ($pref['agree_flag'] ? "<a href='".e_BASE."download.php?mirror.".$row['download_id']."' onclick= \"return confirm('{$agreetext}');\">" : "<a href='".e_BASE."download.php?mirror.".$row['download_id']."' title='".LAN_dl_32."'>");
|
||||
}else{
|
||||
$text = ($pref['agree_flag'] ? "<a href='".e_BASE."request.php?".$row['download_id']."' onclick= \"return confirm('{$agreetext}');\">" : "<a href='".e_BASE."request.php?".$row['download_id']."' title='".LAN_dl_32."'>");
|
||||
}
|
||||
$text .= $tp->toHTML($row['download_name'], FALSE, 'USER_TITLE')."</a>";
|
||||
return $text;
|
||||
}
|
||||
|
||||
return "<a href='".e_BASE."download.php?view.".$row['download_id']."'>".$tp->toHTML($row['download_name'],TRUE,'LINKTEXT')."</a>";
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN DOWNLOAD_LIST_AUTHOR
|
||||
global $row;
|
||||
return $row['download_author'];
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN DOWNLOAD_LIST_REQUESTED
|
||||
global $row;
|
||||
return $row['download_requested'];
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN DOWNLOAD_LIST_ICON
|
||||
global $row;
|
||||
$img = "<img src='".IMAGE_DOWNLOAD."' alt='' style='border:0' title='".LAN_dl_32."' />";
|
||||
if($parm == "link"){
|
||||
return "<a href='".e_BASE."download.php?view.".$row['download_id']."' >".$img."</a>";
|
||||
}else{
|
||||
return $img;
|
||||
}
|
||||
return;
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN DOWNLOAD_LIST_NEWICON
|
||||
global $row;
|
||||
return (USER && $row['download_datestamp'] > USERLV ? "<img src='".IMAGE_NEW."' alt='' style='vertical-align:middle' />" : "");
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN DOWNLOAD_LIST_FILESIZE
|
||||
global $row, $e107;
|
||||
return $e107->parseMemorySize($row['download_filesize']);
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN DOWNLOAD_LIST_DATESTAMP
|
||||
global $row;
|
||||
$gen = new convert;
|
||||
return $gen->convert_date($row['download_datestamp'], "short");
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN DOWNLOAD_LIST_THUMB
|
||||
global $row;
|
||||
$img = ($row['download_thumb']) ? "<img src='".e_FILE."downloadthumbs/".$row['download_thumb']."' alt='' style='".DL_IMAGESTYLE."' />" : "";
|
||||
if($parm == "link" && $row['download_thumb']){
|
||||
return "<a href='".e_BASE."download.php?view.".$row['download_id']."'>".$img."</a>";
|
||||
}else{
|
||||
return $img;
|
||||
}
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN DOWNLOAD_LIST_ID
|
||||
global $row;
|
||||
return $row['download_id'];
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN DOWNLOAD_LIST_RATING
|
||||
global $row;
|
||||
$rater = new rater;
|
||||
$ratearray = $rater->getrating("download", $row['download_id']);
|
||||
if (!$ratearray[0]) {
|
||||
return LAN_dl_13;
|
||||
} else {
|
||||
return ($ratearray[2] ? "{$ratearray[1]}.{$ratearray[2]}/{$ratearray[0]}" : "{$ratearray[1]}/{$ratearray[0]}");
|
||||
}
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN DOWNLOAD_LIST_LINK
|
||||
global $tp,$row,$pref;
|
||||
$agreetext = $tp->toJS($tp->toHTML($pref['agree_text'],FALSE,'DESCRIPTION'));
|
||||
if($row['download_mirror_type']){
|
||||
return ($pref['agree_flag'] ? "<a href='".e_BASE."download.php?mirror.".$row['download_id']."' onclick= \"return confirm('{$agreetext}');\">" : "<a href='".e_BASE."download.php?mirror.".$row['download_id']."' >");
|
||||
}else{
|
||||
return ($pref['agree_flag'] ? "<a href='".e_BASE."request.php?".$row['download_id']."' onclick= \"return confirm('{$agreetext}');\">" : "<a href='".e_BASE."request.php?".$row['download_id']."' >");
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_LIST_NEXTPREV
|
||||
global $nextprev_parms,$tp;
|
||||
return $tp->parseTemplate("{NEXTPREV={$nextprev_parms}}");
|
||||
SC_END
|
||||
|
||||
|
||||
// ---------------------- Download View ----------------------------------------
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_ID
|
||||
global $dl;
|
||||
return $dl['download_id'];
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN DOWNLOAD_ADMIN_EDIT
|
||||
global $dl;
|
||||
return (ADMIN && getperms('6')) ? "<a href='".e_ADMIN."download.php?create.edit.".$dl['download_id']."' title='edit'><img src='".e_IMAGE."generic/lite/edit.png' alt='' style='padding:0px;border:0px' /></a>" : "";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_CATEGORY
|
||||
global $dl;
|
||||
return $dl['download_category_name'];
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_CATEGORY_ICON
|
||||
global $dl;
|
||||
list($present,$missing) = explode(chr(1),$dl['download_category_icon']);
|
||||
if($present)
|
||||
{
|
||||
return "<img class='dl_cat_icon' src='".e_IMAGE."icons/".$present."' alt='' />";
|
||||
}
|
||||
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_CATEGORY_DESCRIPTION
|
||||
global $tp,$dl;
|
||||
$text = $tp -> toHTML($dl['download_category_description'], TRUE,'DESCRIPTION');
|
||||
if($parm){
|
||||
return substr($text,0,$parm);
|
||||
}else{
|
||||
return $text;
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_NAME
|
||||
global $dl;
|
||||
$link['view'] = "<a href='".e_BASE."download.php?view.".$dl['download_id']."'>".$dl['download_name']."</a>";
|
||||
$link['request'] = "<a href='".e_BASE."request.php?".$dl['download_id']."' title='".LAN_dl_46."'>".$dl['download_name']."</a>";
|
||||
|
||||
if($parm){
|
||||
return $link[$parm];
|
||||
}
|
||||
return $dl['download_name'];
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_NAME_LINKED
|
||||
global $pref,$dl,$tp;
|
||||
if ($pref['agree_flag'] == 1) {
|
||||
return "<a href='".e_BASE."request.php?".$dl['download_id']."' onclick= \"return confirm('".$tp->toJS($tp->toHTML($pref['agree_text'],FALSE,'DESCRIPTION'))."');\" title='".LAN_dl_46."'>".$dl['download_name']."</a>";
|
||||
} else {
|
||||
return "<a href='".e_BASE."request.php?".$dl['download_id']."' title='".LAN_dl_46."'>".$dl['download_name']."</a>";
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_AUTHOR
|
||||
global $dl;
|
||||
return ($dl['download_author'] ? $dl['download_author'] : "");
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_AUTHOREMAIL
|
||||
global $tp,$dl;
|
||||
return ($dl['download_author_email']) ? $tp -> toHTML($dl['download_author_email'], TRUE, 'LINKTEXT') : "";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_AUTHORWEBSITE
|
||||
global $tp,$dl;
|
||||
return ($dl['download_author_website']) ? $tp -> toHTML($dl['download_author_website'], TRUE,'LINKTEXT') : "";
|
||||
SC_END
|
||||
|
||||
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_DESCRIPTION
|
||||
global $tp, $dl;
|
||||
$maxlen = ($parm ? intval($parm) : 0);
|
||||
$text = ($dl['download_description'] ? $tp->toHTML($dl['download_description'], TRUE, 'DESCRIPTION') : "");
|
||||
if($maxlen){
|
||||
return substr($text, 0, $maxlen);
|
||||
}else{
|
||||
return $text;
|
||||
}
|
||||
return $text;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_DATE
|
||||
global $gen,$dl;
|
||||
return ($dl['download_datestamp']) ? $gen->convert_date($dl['download_datestamp'], $parm) : "";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_DATE_SHORT
|
||||
// deprecated: DOWNLOAD_VIEW_DATE should be used instead.
|
||||
global $gen,$dl;
|
||||
return ($dl['download_datestamp']) ? $gen->convert_date($dl['download_datestamp'], "short") : "";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_DATE_LONG
|
||||
// deprecated: DOWNLOAD_VIEW_DATE should be used instead.
|
||||
global $gen,$dl;
|
||||
return ($dl['download_datestamp']) ? $gen->convert_date($dl['download_datestamp'], "long") : "";
|
||||
SC_END
|
||||
|
||||
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_IMAGE
|
||||
global $dl;
|
||||
if ($dl['download_thumb']) {
|
||||
return ($dl['download_image'] ? "<a href='".e_BASE."request.php?download.".$dl['download_id']."'><img class='dl_image' src='".e_FILE."downloadthumbs/".$dl['download_thumb']."' alt='' style='".DL_IMAGESTYLE."' /></a>" : "<img class='dl_image' src='".e_FILE."downloadthumbs/".$dl['download_thumb']."' alt='' style='".DL_IMAGESTYLE."' />");
|
||||
}
|
||||
else if($dl['download_image']) {
|
||||
return "<a href='".e_BASE."request.php?download.".$dl['download_id']."'>".LAN_dl_40."</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
return LAN_dl_75;
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_IMAGEFULL
|
||||
global $dl;
|
||||
return ($dl['download_image']) ? "<img class='dl_image' src='".e_FILE."downloadimages/".$dl['download_image']."' alt='' style='".DL_IMAGESTYLE."' />" : "";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_LINK
|
||||
global $pref,$dl,$tp;
|
||||
if ($pref['agree_flag'] == 1) {
|
||||
$dnld_link = "<a href='".e_BASE."request.php?".$dl['download_id']."' onclick= \"return confirm('".$tp->toJS($tp->toHTML($pref['agree_text'],FALSE,'DESCRIPTION'))."');\">";
|
||||
} else {
|
||||
$dnld_link = "<a href='".e_BASE."request.php?".$dl['download_id']."'>";
|
||||
}
|
||||
|
||||
if($dl['download_mirror'])
|
||||
{
|
||||
if($dl['download_mirror_type'])
|
||||
{
|
||||
return "<a href='".e_BASE."download.php?mirror.".$dl['download_id']."'>".LAN_dl_66."</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
return $dnld_link." <img src='".IMAGE_DOWNLOAD."' alt='' style='border:0' /></a>";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return $dnld_link." <img src='".IMAGE_DOWNLOAD."' alt='' style='border:0' /></a>";
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_FILESIZE
|
||||
global $dl, $e107;
|
||||
return ($dl['download_filesize']) ? $e107->parseMemorySize($dl['download_filesize']) : "";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_RATING
|
||||
require_once(e_HANDLER."rate_class.php");
|
||||
$rater = new rater;
|
||||
global $dl;
|
||||
$text = "
|
||||
<table style='width:100%'>
|
||||
<tr>
|
||||
<td style='width:50%'>";
|
||||
|
||||
if ($ratearray = $rater->getrating("download", $dl['download_id'])) {
|
||||
for($c = 1; $c <= $ratearray[1]; $c++) {
|
||||
$text .= "<img src='".e_IMAGE."rate/star.png' alt='' />";
|
||||
}
|
||||
if ($ratearray[2]) {
|
||||
$text .= "<img src='".e_IMAGE."rate/".$ratearray[2].".png' alt='' />";
|
||||
}
|
||||
if ($ratearray[2] == "") {
|
||||
$ratearray[2] = 0;
|
||||
}
|
||||
$text .= " ".$ratearray[1].".".$ratearray[2]." - ".$ratearray[0]." ";
|
||||
$text .= ($ratearray[0] == 1 ? LAN_dl_43 : LAN_dl_44);
|
||||
} else {
|
||||
$text .= LAN_dl_13;
|
||||
}
|
||||
$text .= "</td><td style='width:50%; text-align:right'>";
|
||||
|
||||
if (!$rater->checkrated("download", $dl['download_id']) && USER) {
|
||||
$text .= $rater->rateselect(" <b>".LAN_dl_14, "download", $dl['download_id'])."</b>";
|
||||
}
|
||||
else if(!USER) {
|
||||
$text .= " ";
|
||||
} else {
|
||||
$text .= LAN_dl_15;
|
||||
}
|
||||
$text .= "</td></tr></table>";
|
||||
return $text;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_REPORT_LINK
|
||||
global $dl,$pref;
|
||||
return (check_class($pref['download_reportbroken'])) ? "<a href='".e_BASE."download.php?report.".$dl['download_id']."'>".LAN_dl_45."</a>" : "";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_CAPTION
|
||||
global $dl;
|
||||
$text = $dl['download_category_name'];
|
||||
$text .= ($dl['download_category_description']) ? " [ ".$dl['download_category_description']." ]" : "";
|
||||
return $text;
|
||||
SC_END
|
||||
|
||||
|
||||
// --------- Download View Lans -----------------------------
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_AUTHOR_LAN
|
||||
global $dl;
|
||||
return ($dl['download_author']) ? LAN_dl_24 : "";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_AUTHOREMAIL_LAN
|
||||
global $dl;
|
||||
return ($dl['download_author_email']) ? LAN_dl_30 : "";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_AUTHORWEBSITE_LAN
|
||||
global $dl;
|
||||
return ($dl['download_author_website']) ? LAN_dl_31 : "";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_DATE_LAN
|
||||
global $dl;
|
||||
return ($dl['download_datestamp']) ? LAN_dl_22 : "";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_IMAGE_LAN
|
||||
return LAN_dl_11;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_REQUESTED
|
||||
global $dl;
|
||||
return $dl['download_requested'];
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_RATING_LAN
|
||||
return LAN_dl_12;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_FILESIZE_LAN
|
||||
return LAN_dl_10;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_DESCRIPTION_LAN
|
||||
return LAN_dl_7;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_REQUESTED_LAN
|
||||
return LAN_dl_77;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_LINK_LAN
|
||||
return LAN_dl_32;
|
||||
SC_END
|
||||
|
||||
|
||||
|
||||
// ----------- Download View : Previous and Next ---------------
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_PREV
|
||||
global $dl,$sql;
|
||||
|
||||
$dl_id = intval($dl['download_id']);
|
||||
|
||||
if ($sql->db_Select("download", "*", "download_category='".intval($dl['download_category_id'])."' AND download_id < {$dl_id} AND download_active > 0 && download_visible IN (".USERCLASS_LIST.") ORDER BY download_datestamp DESC LIMIT 1")) {
|
||||
$row = $sql->db_Fetch();
|
||||
return "<a href='".e_BASE."download.php?view.".$row['download_id']."'><< ".LAN_dl_33." [".$row['download_name']."]</a>\n";
|
||||
} else {
|
||||
return " ";
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_VIEW_NEXT
|
||||
global $dl,$sql;
|
||||
$dl_id = intval($dl['download_id']);
|
||||
if ($sql->db_Select("download", "*", "download_category='".intval($dl['download_category_id'])."' AND download_id > {$dl_id} AND download_active > 0 && download_visible IN (".USERCLASS_LIST.") ORDER BY download_datestamp ASC LIMIT 1")) {
|
||||
$row = $sql->db_Fetch();
|
||||
extract($row);
|
||||
return "<a href='".e_BASE."download.php?view.".$row['download_id']."'>[".$row['download_name']."] ".LAN_dl_34." >></a>\n";
|
||||
} else {
|
||||
return " ";
|
||||
}
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN DOWNLOAD_BACK_TO_LIST
|
||||
global $dl;
|
||||
return "<a href='".e_BASE."download.php?list.".$dl['download_category']."'>".LAN_dl_35."</a>";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN DOWNLOAD_BACK_TO_CATEGORY_LIST
|
||||
return "<a href='".e_SELF."'>".LAN_dl_9."</a>";
|
||||
SC_END
|
||||
|
||||
|
||||
// --------------- Download - Admin -----------------------------------
|
||||
|
||||
SC_BEGIN DOWNLOAD_CATEGORY_SELECT
|
||||
global $sql;
|
||||
$cdc = $parm;
|
||||
|
||||
$boxinfo = "\n";
|
||||
$qry = "
|
||||
SELECT dc.download_category_name, dc.download_category_order, dc.download_category_id, dc.download_category_parent,
|
||||
dc1.download_category_parent AS d_parent1
|
||||
FROM #download_category AS dc
|
||||
LEFT JOIN #download_category as dc1 ON dc1.download_category_id=dc.download_category_parent AND dc1.download_category_class IN (".USERCLASS_LIST.")
|
||||
LEFT JOIN #download_category as dc2 ON dc2.download_category_id=dc1.download_category_parent ";
|
||||
if (ADMIN === FALSE) $qry .= " WHERE dc.download_category_class IN (".USERCLASS_LIST.") ";
|
||||
$qry .= " ORDER by dc2.download_category_order, dc1.download_category_order, dc.download_category_order"; // This puts main categories first, then sub-cats, then sub-sub cats
|
||||
|
||||
if (!$sql->db_Select_gen($qry))
|
||||
{
|
||||
return "Error reading categories<br />";
|
||||
exit;
|
||||
}
|
||||
|
||||
$boxinfo .= "<select name='download_category' id='download_category' class='tbox'>
|
||||
<option value=''> </option>\n";
|
||||
|
||||
// Its a structured display option - need a 2-step process to create a tree
|
||||
$catlist = array();
|
||||
while ($row = $sql->db_Fetch(MYSQL_ASSOC))
|
||||
{
|
||||
$tmp = $row['download_category_parent'];
|
||||
if ($tmp == '0')
|
||||
{
|
||||
$row['subcats'] = array();
|
||||
$catlist[$row['download_category_id']] = $row;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isset($catlist[$tmp]))
|
||||
{ // Sub-Category
|
||||
$catlist[$tmp]['subcats'][$row['download_category_id']] = $row;
|
||||
$catlist[$tmp]['subcats'][$row['download_category_id']]['subsubcats'] = array();
|
||||
}
|
||||
else
|
||||
{ // Its a sub-sub category
|
||||
if (isset($catlist[$row['d_parent1']]['subcats'][$tmp]))
|
||||
{
|
||||
$catlist[$row['d_parent1']]['subcats'][$tmp]['subsubcats'][$row['download_category_id']] = $row;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Now generate the options
|
||||
foreach ($catlist as $thiscat)
|
||||
{ // Main categories
|
||||
// Could add a display class to the group, but the default looked OK
|
||||
|
||||
if(count($thiscat['subcats'])>0)
|
||||
{
|
||||
$boxinfo .= "<optgroup label='".htmlspecialchars($thiscat['download_category_name'])."'>\n";
|
||||
$scprefix = '';
|
||||
}
|
||||
else
|
||||
{
|
||||
$sel = ($cdc == $thiscat['download_category_id']) ? " selected='selected'" : "";
|
||||
$boxinfo .= "<option value='".$thiscat['download_category_id']."' {$sel}>".htmlspecialchars($thiscat['download_category_name'])."</option>\n";
|
||||
}
|
||||
|
||||
foreach ($thiscat['subcats'] as $sc)
|
||||
{ // Sub-categories
|
||||
$sscprefix = '--> ';
|
||||
$boxinfo .= "<option value='".$sc['download_category_id']."'";
|
||||
if ($cdc == $sc['download_category_id']) { $boxinfo .= " selected='selected'"; }
|
||||
$boxinfo .= ">".$scprefix.htmlspecialchars($sc['download_category_name'])."</option>\n";
|
||||
foreach ($sc['subsubcats'] as $ssc)
|
||||
{ // Sub-sub categories
|
||||
$boxinfo .= "<option value='".$ssc['download_category_id']."'";
|
||||
if ($cdc == $ssc['download_category_id']) { $boxinfo .= " selected='selected'"; }
|
||||
$boxinfo .= ">".htmlspecialchars($sscprefix.$ssc['download_category_name'])."</option>\n";
|
||||
}
|
||||
}
|
||||
$boxinfo .= "</optgroup>\n";
|
||||
}
|
||||
|
||||
$boxinfo .= "</select>\n";
|
||||
return $boxinfo;
|
||||
|
||||
SC_END
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
?>
|
0
e107_core/shortcodes/batch/index.html
Normal file
0
e107_core/shortcodes/batch/index.html
Normal file
59
e107_core/shortcodes/batch/news_archives.php
Normal file
59
e107_core/shortcodes/batch/news_archives.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/news_archives.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
include_once(e_HANDLER.'shortcode_handler.php');
|
||||
$news_archive_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
|
||||
|
||||
/*
|
||||
SC_BEGIN ARCHIVE_BULLET
|
||||
//TODO review bullet
|
||||
$bullet = '';
|
||||
if(defined('BULLET'))
|
||||
{
|
||||
$bullet = '<img src="'.THEME.'images/'.BULLET.'" alt="" class="icon" />';
|
||||
}
|
||||
elseif(file_exists(THEME.'images/bullet2.gif'))
|
||||
{
|
||||
$bullet = '<img src="'.THEME.'images/bullet2.gif" alt="" class="icon" />';
|
||||
}
|
||||
return $bullet;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN ARCHIVE_LINK
|
||||
global $news2;
|
||||
return "<a href='news.php?item.".$news2['news_id']."'>".$news2['news_title']."</a>";
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN ARCHIVE_AUTHOR
|
||||
global $news2;
|
||||
return "<a href='".e_BASE."user.php?id.".$news2['user_id']."'>".$news2['user_name']."</a>";
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN ARCHIVE_DATESTAMP
|
||||
global $news2;
|
||||
return $news2['news_datestamp'];
|
||||
SC_END
|
||||
|
||||
SC_BEGIN ARCHIVE_CATEGORY
|
||||
global $news2;
|
||||
return $news2['category_name'];
|
||||
SC_END
|
||||
|
||||
*/
|
||||
?>
|
423
e107_core/shortcodes/batch/news_shortcodes.php
Normal file
423
e107_core/shortcodes/batch/news_shortcodes.php
Normal file
@@ -0,0 +1,423 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
* $Id$
|
||||
*
|
||||
* News shortcode batch
|
||||
*/
|
||||
/**
|
||||
* @package e107
|
||||
* @subpackage shortcodes
|
||||
* @version $Id$;
|
||||
*
|
||||
* Shortcodes for news item display
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
//include_once(e_HANDLER.'shortcode_handler.php');
|
||||
|
||||
/*
|
||||
$codes = array(
|
||||
'newstitle', 'newsbody', 'newsicon','newsauthor', 'newscomments',
|
||||
'trackback', 'newsheader', 'newscategory', 'newsdate', 'newscommentlink',
|
||||
'newscommentcount', 'emailicon', 'printicon', 'pdficon', 'newsid', 'adminoptions',
|
||||
'extended', 'captionclass', 'admincaption', 'adminbody', 'newssummary',
|
||||
'newsthumbnail', 'newsimage', 'sticky_icon', 'newstitlelink', 'newscaticon', 'newsinfo'
|
||||
);
|
||||
*/
|
||||
|
||||
$codes = array();
|
||||
/*
|
||||
$tmp = get_class_methods('news_shortcodes');
|
||||
foreach($tmp as $c)
|
||||
{
|
||||
if(strpos($c, 'sc_') === 0)
|
||||
{
|
||||
$codes[] = substr($c, 3);
|
||||
}
|
||||
}
|
||||
unset($tmp);
|
||||
*/
|
||||
register_shortcode('news_shortcodes', TRUE);
|
||||
initShortcodeClass('news_shortcodes');
|
||||
|
||||
class news_shortcodes
|
||||
{
|
||||
var $news_item, $param, $e107;
|
||||
|
||||
function news_shortcodes()
|
||||
{
|
||||
$this->e107 = e107::getInstance();
|
||||
}
|
||||
|
||||
function loadNewsItem()
|
||||
{
|
||||
$e107 = e107::getInstance();
|
||||
$e107->tp->e_sc->scClasses['news_shortcodes']->news_item = getcachedvars('current_news_item');
|
||||
$e107->tp->e_sc->scClasses['news_shortcodes']->param = getcachedvars('current_news_param');
|
||||
}
|
||||
|
||||
function sc_newstitle()
|
||||
{
|
||||
return $this->e107->tp->toHTML($this->news_item['news_title'], TRUE, 'TITLE');
|
||||
}
|
||||
|
||||
function sc_newsbody($parm)
|
||||
{
|
||||
$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']) || $this->param['current_action'] == 'extend') && $parm != 'noextend')
|
||||
{
|
||||
$news_body .= $this->e107->tp->toHTML($this->news_item['news_extended'], true, 'BODY, fromadmin', $this->news_item['news_author']);
|
||||
}
|
||||
|
||||
return $news_body;
|
||||
}
|
||||
|
||||
function sc_newsicon($parm)
|
||||
{
|
||||
$category_icon = str_replace('../', '', trim($this->news_item['category_icon']));
|
||||
if ($category_icon && strstr('images', $category_icon))
|
||||
{
|
||||
$category_icon = THEME_ABS.$category_icon;
|
||||
}
|
||||
else
|
||||
{
|
||||
$category_icon = e_IMAGE_ABS.'icons/'.$category_icon;
|
||||
}
|
||||
if (!$category_icon) { return ''; }
|
||||
|
||||
return "<a href='".$this->e107->url->getUrl('core:news', 'main', 'action=list&id='.$this->news_item['news_category'].'&sef='.$this->news_item['news_category_rewrite_string'])."'><img style='".$this->param['caticon']."' src='".$category_icon."' alt='' /></a>";
|
||||
}
|
||||
|
||||
function sc_newsauthor($parm)
|
||||
{
|
||||
if($this->news_item['user_id'])
|
||||
{
|
||||
if($parm == 'nolink')
|
||||
{
|
||||
return $this->news_item['user_name'];
|
||||
}
|
||||
else
|
||||
{
|
||||
return "<a href='".$this->e107->url->getUrl('core:user', 'main', 'func=profile&id='.$this->news_item['user_id'])."'>".$this->news_item['user_name']."{$parm}</a>";
|
||||
}
|
||||
}
|
||||
return "<a href='http://e107.org'>e107</a>";
|
||||
}
|
||||
|
||||
function sc_newscomments($parm)
|
||||
{
|
||||
global $pref, $sql;
|
||||
if($pref['comments_disabled'] == 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
$news_item = $this->news_item;
|
||||
$param = $this->param;
|
||||
|
||||
if($param['current_action'] == 'extend')
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
if (vartrue($pref['multilanguage']))
|
||||
{ // Can have multilanguage news table, monlingual comment table. If the comment table is multilingual, it'll only count entries in the current language
|
||||
$news_item['news_comment_total'] = $sql->db_Count("comments", "(*)", "WHERE comment_item_id='".$news_item['news_id']."' AND comment_type='0' ");
|
||||
}
|
||||
|
||||
//XXX - ??? - another query? We should cache it in news table.
|
||||
if ($pref['comments_icon'] && $news_item['news_comment_total'])
|
||||
{
|
||||
$sql->db_Select('comments', 'comment_datestamp', "comment_item_id='".intval($news_item['news_id'])."' AND comment_type='0' ORDER BY comment_datestamp DESC LIMIT 0,1");
|
||||
list($comments['comment_datestamp']) = $sql->db_Fetch();
|
||||
$latest_comment = $comments['comment_datestamp'];
|
||||
if ($latest_comment > USERLV )
|
||||
{
|
||||
$NEWIMAGE = $param['image_new_small'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$NEWIMAGE = $param['image_nonew_small'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$NEWIMAGE = $param['image_nonew_small'];
|
||||
}
|
||||
return (!$news_item['news_allow_comments'] ? ''.($pref['comments_icon'] ? $NEWIMAGE : '')." <a href='".e107::getUrl()->create('core:news', 'main', 'action=extend&id='.$news_item['news_id'].'&sef='.$news_item['news_rewrite_string'])."'>".$param['commentlink'].$news_item['news_comment_total'].'</a>' : $param['commentoffstring']);
|
||||
}
|
||||
|
||||
function sc_trackback($parm)
|
||||
{
|
||||
global $pref;
|
||||
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'] : '');
|
||||
}
|
||||
|
||||
function sc_newsheader($parm)
|
||||
{
|
||||
$category_icon = str_replace("../", "", trim($this->news_item['category_icon']));
|
||||
if (!$category_icon) return '';
|
||||
if ($category_icon && strstr("images", $category_icon)) {
|
||||
return THEME_ABS.$category_icon;
|
||||
} else {
|
||||
return e_IMAGE_ABS."icons/".$category_icon;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function sc_newscategory($parm)
|
||||
{
|
||||
$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=list&id='.$this->news_item['news_category'].'&sef='.$this->news_item['news_category_rewrite_string'])."'>".$category_name."</a>";
|
||||
}
|
||||
|
||||
function sc_newsdate($parm)
|
||||
{
|
||||
$date = ($this->news_item['news_start'] > 0) ? $this->news_item['news_start'] : $this->news_item['news_datestamp'];
|
||||
$con = new convert;
|
||||
if($parm == '')
|
||||
{
|
||||
return $con->convert_date($date, 'long');
|
||||
}
|
||||
switch($parm)
|
||||
{
|
||||
case 'long':
|
||||
return $con->convert_date($date, 'long');
|
||||
break;
|
||||
case 'short':
|
||||
return $con->convert_date($date, 'short');
|
||||
break;
|
||||
case 'forum':
|
||||
return $con->convert_date($date, 'forum');
|
||||
break;
|
||||
default :
|
||||
return date($parm, $date);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function sc_newscommentlink($parm)
|
||||
{
|
||||
return ($this->news_item['news_allow_comments'] ? $this->param['commentoffstring'] : " <a href='".e107::getUrl()->create('core:news', 'main', 'action=extend&id='.$this->news_item['news_id'].'&sef='.$this->news_item['news_rewrite_string'])."'>".$this->param['commentlink'].'</a>');
|
||||
}
|
||||
|
||||
function sc_newscommentcount($parm)
|
||||
{
|
||||
return $this->news_item['news_comment_total'];
|
||||
}
|
||||
|
||||
function sc_emailicon($parm)
|
||||
{
|
||||
global $pref;
|
||||
if (!check_class(varset($pref['email_item_class'],e_UC_MEMBER)))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
require_once(e_HANDLER.'emailprint_class.php');
|
||||
return emailprint::render_emailprint('news', $this->news_item['news_id'], 1);
|
||||
}
|
||||
|
||||
function sc_printicon()
|
||||
{
|
||||
require_once(e_HANDLER.'emailprint_class.php');
|
||||
return emailprint::render_emailprint('news', $this->news_item['news_id'], 2);
|
||||
}
|
||||
|
||||
function sc_pdficon()
|
||||
{
|
||||
global $pref;
|
||||
if (!$pref['plug_installed']['pdf']) { return ''; }
|
||||
return $this->e107->tp->parseTemplate('{PDF='.LAN_NEWS_24.'^news.'.$this->news_item['news_id'].'}');
|
||||
}
|
||||
|
||||
function sc_newsid()
|
||||
{
|
||||
return $this->news_item['news_id'];
|
||||
}
|
||||
|
||||
function sc_adminoptions()
|
||||
{
|
||||
if (ADMIN && getperms('H'))
|
||||
{
|
||||
$adop_icon = (file_exists(THEME."images/newsedit.png") ? THEME_ABS."images/newsedit.png" : e_IMAGE_ABS."admin_images/edit_16.png");
|
||||
return " <a href='".e_ADMIN_ABS."newspost.php?create.edit.".$this->news_item['news_id']."'><img src='".$adop_icon."' alt='".LAN_NEWS_25."' class='icon' /></a>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
function sc_extended($parm)
|
||||
{
|
||||
|
||||
if ($this->news_item['news_extended'] && ($this->param['current_action'] != 'extend' || $parm == 'force'))
|
||||
{
|
||||
if (defined('PRE_EXTENDEDSTRING'))
|
||||
{
|
||||
$es1 = PRE_EXTENDEDSTRING;
|
||||
}
|
||||
if (defined('POST_EXTENDEDSTRING'))
|
||||
{
|
||||
$es2 = POST_EXTENDEDSTRING;
|
||||
}
|
||||
if (isset($_POST['preview']))
|
||||
{
|
||||
return $es1.EXTENDEDSTRING.$es2."<br />".$this->news_item['news_extended'];
|
||||
}
|
||||
else
|
||||
{
|
||||
return $es1."<a href='".$this->e107->url->getUrl('core:news', 'main', 'action=extend&id='.$this->news_item['news_id'].'&sef='.$this->news_item['news_rewrite_string'])."'>".EXTENDEDSTRING."</a>".$es2;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
function sc_captionclass()
|
||||
{
|
||||
$news_title = $this->e107->tp->toHTML($this->news_item['news_title'], TRUE,'TITLE');
|
||||
return "<div class='category".$this->news_item['news_category']."'>".($this->news_item['news_render_type'] == 1 ? "<a href='".e107::getUrl()->create('core:news', 'main', 'action=extend&id='.$this->news_item['news_id'].'&sef='.$this->news_item['news_rewrite_string'])."'>".$news_title."</a>" : $news_title)."</div>";
|
||||
}
|
||||
|
||||
function sc_admincaption()
|
||||
{
|
||||
$news_title = $this->e107->tp->toHTML($this->news_item['news_title'], TRUE,'TITLE');
|
||||
return "<div class='".(defined('ADMINNAME') ? ADMINNAME : "null")."'>".($this->news_item['news_render_type'] == 1 ? "<a href='".e107::getUrl()->create('core:news', 'main', 'action=extend&id='.$this->news_item['news_id'].'&sef='.$this->news_item['news_rewrite_string'])."'>".$news_title."</a>" : $news_title)."</div>";
|
||||
}
|
||||
|
||||
function sc_adminbody($parm)
|
||||
{
|
||||
$news_body = $this->sc_newsbody($parm);
|
||||
return "<div class='".(defined('ADMINNAME') ? ADMINNAME : 'null')."'>".$news_body.'</div>';
|
||||
}
|
||||
|
||||
function sc_newssummary()
|
||||
{
|
||||
return ($this->news_item['news_summary']) ? $this->news_item['news_summary'].'<br />' : '';
|
||||
}
|
||||
|
||||
function sc_newsthumbnail($parm = '')
|
||||
{
|
||||
switch($parm)
|
||||
{
|
||||
case 'src':
|
||||
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail'] ? e_IMAGE_ABS."newspost_images/".$this->news_item['news_thumbnail'] : '');
|
||||
break;
|
||||
|
||||
case 'tag':
|
||||
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail'] ? "<img class='news_image' src='".e_IMAGE_ABS."newspost_images/".$this->news_item['news_thumbnail']."' alt='' style='".$this->param['thumbnail']."' />" : '');
|
||||
break;
|
||||
|
||||
default:
|
||||
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail']) ? "<a href='".$this->e107->url->getUrl('core:news', 'main', "action=extend&id={$this->news_item['news_id']}&catid={$this->news_item['news_category']}&sef={$this->news_item['news_rewrite_string']}")."'><img class='news_image' src='".e_IMAGE_ABS."newspost_images/".$this->news_item['news_thumbnail']."' alt='' style='".$this->param['thumbnail']."' /></a>" : '';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function sc_newsimage($parm = '')
|
||||
{
|
||||
switch($parm)
|
||||
{
|
||||
case 'src':
|
||||
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail'] ? e_IMAGE_ABS.$this->news_item['news_thumbnail'] : '');
|
||||
break;
|
||||
|
||||
case 'tag':
|
||||
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail'] ? "<img class='news_image' src='".e_IMAGE_ABS."newspost_images/".$this->news_item['news_thumbnail']."' alt='' style='".$this->param['thumbnail']."' />" : '');
|
||||
break;
|
||||
|
||||
default:
|
||||
return (isset($this->news_item['news_thumbnail']) && $this->news_item['news_thumbnail']) ? "<a href='".$this->e107->url->getUrl('core:news', 'main', "action=extend&id={$this->news_item['news_id']}&catid={$this->news_item['news_category']}&sef={$this->news_item['news_rewrite_string']}")."'><img class='news_image' src='".e_IMAGE_ABS."newspost_images/".$this->news_item['news_thumbnail']."' alt='' style='".$this->param['thumbnail']."' /></a>" : '';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function sc_sticky_icon()
|
||||
{
|
||||
return $this->news_item['news_sticky'] ? $this->param['image_sticky'] : '';
|
||||
}
|
||||
|
||||
function sc_newstitlelink($parm = '')
|
||||
{
|
||||
parse_str($parm, $parms);
|
||||
$url = $this->e107->url->getUrl('core:news', 'main', "action=".vartrue($parms['action'], 'extend')."&id={$this->news_item['news_id']}&sef={$this->news_item['news_rewrite_string']}");
|
||||
if(isset($parms['href']))
|
||||
{
|
||||
return $url;
|
||||
}
|
||||
return "<a style='".(isset($this->param['itemlink']) ? $this->param['itemlink'] : 'null')."' href='{$url}'>".$this->news_item['news_title'].'</a>';
|
||||
}
|
||||
|
||||
function sc_newscaticon($parm = '')
|
||||
{
|
||||
$category_icon = str_replace('../', '', trim($this->news_item['category_icon']));
|
||||
if (!$category_icon) { return ''; }
|
||||
if ($category_icon && strstr('images', $category_icon))
|
||||
{
|
||||
$category_icon = THEME_ABS.$category_icon;
|
||||
}
|
||||
else
|
||||
{
|
||||
$category_icon = e_IMAGE_ABS.'icons/'.$category_icon;
|
||||
}
|
||||
|
||||
//TODO - remove inline styles
|
||||
if($this->param['caticon'] == ''){$this->param['caticon'] = 'border:0px';}
|
||||
|
||||
switch($parm)
|
||||
{
|
||||
case 'src':
|
||||
return $category_icon;
|
||||
break;
|
||||
|
||||
case 'tag':
|
||||
return "<img class='news_image' src='{$category_icon}' alt='' style='".$this->param['caticon']."' />";
|
||||
break;
|
||||
|
||||
default:
|
||||
return "<a href='".$this->e107->url->getUrl('core:news', 'main', "action=list&id={$this->news_item['news_category']}&sef={$this->news_item['news_category_rewrite_string']}")."'><img style='".$this->param['caticon']."' src='".$category_icon."' alt='' /></a>";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Example usage: {NEWSITEM_SCHOOK=mysc_name|my_var1=val1&myvar2=myval2}
|
||||
* will fire {MYSC_NAME=news_id=1&my_var1=val1&myvar2=myval2}
|
||||
* Inside your 'MYSC_NAME' shortcode you are also able to access current item data this way
|
||||
* <code>
|
||||
* $newsdata = e107::getRegistry('core/news/schook_data');
|
||||
* //returns array('data' => (array) $current_news_data, 'params' => array() $current_params)
|
||||
* </code>
|
||||
*
|
||||
* @param string $parm
|
||||
* @return string
|
||||
*/
|
||||
function sc_newsitem_schook($parm)
|
||||
{
|
||||
$parm = explode('|', $parm, 2);
|
||||
$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));
|
||||
return $this->e107->tp->parseTemplate('{'.strtoupper($parm[0]).'='.$parm[1].'}');
|
||||
}
|
||||
|
||||
function sc_newsinfo()
|
||||
{
|
||||
$news_item = $this->news_item;
|
||||
$param = $this->param;
|
||||
$con = new convert;
|
||||
$news_item['news_start'] = (isset($news_item['news_start']) && $news_item['news_start'] ? str_replace(' - 00:00:00', '', $con->convert_date($news_item['news_start'], 'long')) : LAN_NEWS_19);
|
||||
$news_item['news_end'] = (isset($news_item['news_end']) && $news_item['news_end'] ? ' to '.str_replace(' - 00:00:00', '', $con->convert_date($news_item['news_end'], 'long')) : '');
|
||||
$info = $news_item['news_render_type'] == 1 ? LAN_NEWS_9 : '';
|
||||
$info .= $news_item['news_class'] == 255 ? LAN_NEWS_10 : LAN_NEWS_11;
|
||||
$info .= $news_item['news_sticky'] ? '<br />'.LAN_NEWS_31 : '';
|
||||
$info .= '<br />'.($news_item['news_allow_comments'] ? LAN_NEWS_13 : LAN_NEWS_12);
|
||||
$info .= LAN_NEWS_14.$news_item['news_start'].$news_item['news_end'].'<br />';
|
||||
$info .= LAN_NEWS_15.strlen($news_item['news_body']).LAN_NEWS_16.strlen($news_item['news_extended']).LAN_NEWS_17."<br /><br />";
|
||||
//return $this->e107->ns->tablerender(LAN_NEWS_18, $info);
|
||||
return $info;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
?>
|
324
e107_core/shortcodes/batch/signup_shortcodes.php
Executable file
324
e107_core/shortcodes/batch/signup_shortcodes.php
Executable file
@@ -0,0 +1,324 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/signup_shortcodes.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
// Mods to show extended field categories
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
include_once(e_HANDLER.'shortcode_handler.php');
|
||||
$signup_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
|
||||
|
||||
/*
|
||||
SC_BEGIN SIGNUP_COPPA_FORM
|
||||
if (strpos(LAN_SIGNUP_77, "stage") !== FALSE)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "
|
||||
<form method='post' action='".e_SELF."?stage1' >\n
|
||||
<div><br />
|
||||
<input type='radio' name='coppa' value='0' checked='checked' /> ".LAN_NO."
|
||||
<input type='radio' name='coppa' value='1' /> ".LAN_YES."<br />
|
||||
<br />
|
||||
<input class='button' type='submit' name='newver' value=\"".LAN_CONTINUE."\" />
|
||||
</div></form>
|
||||
";
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNUP_FORM_OPEN
|
||||
global $rs;
|
||||
return $rs->form_open("post", e_SELF, "signupform");
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNUP_SIGNUP_TEXT
|
||||
global $pref, $tp, $SIGNUP_TEXT;
|
||||
|
||||
if($pref['signup_text'])
|
||||
{
|
||||
return $tp->toHTML($pref['signup_text'], TRUE, 'parse_sc,defs');
|
||||
}
|
||||
elseif($pref['user_reg_veri'])
|
||||
{
|
||||
return $SIGNUP_TEXT;
|
||||
}
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN SIGNUP_XUP
|
||||
global $pref, $tp, $SIGNUP_XUP_FORM, $signup_shortcodes;
|
||||
if(isset($pref['xup_enabled']) && $pref['xup_enabled'])
|
||||
{
|
||||
return $tp->parseTemplate($SIGNUP_XUP_FORM, TRUE, $signup_shortcodes);
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNUP_XUP_ACTION
|
||||
global $pref, $tp, $SIGNUP_XUP_BUTTON, $signup_shortcodes;
|
||||
if(isset($pref['xup_enabled']) && $pref['xup_enabled'])
|
||||
{
|
||||
// Puts the button to allow XUP signup onto the 'normal' signup screen
|
||||
return $tp->parseTemplate($SIGNUP_XUP_BUTTON, TRUE, $signup_shortcodes);
|
||||
}
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN SIGNUP_DISPLAYNAME
|
||||
global $pref, $rs;
|
||||
if (check_class($pref['displayname_class']))
|
||||
{
|
||||
$dis_name_len = varset($pref['displayname_maxlength'],15);
|
||||
return $rs->form_text('username', $dis_name_len+5, ($_POST['username'] ? $_POST['username'] : $username), $dis_name_len);
|
||||
}
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN SIGNUP_LOGINNAME
|
||||
global $rs, $pref;
|
||||
if (varsettrue($pref['predefinedLoginName']))
|
||||
{
|
||||
return LAN_SIGNUP_67;
|
||||
}
|
||||
$log_name_length = varset($pref['loginname_maxlength'],30);
|
||||
return $rs->form_text("loginname", $log_name_length+5, ($_POST['loginname'] ? $_POST['loginname'] : $loginname), $log_name_length);
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNUP_REALNAME
|
||||
global $rs, $pref;
|
||||
if ($pref['signup_option_realname'])
|
||||
{
|
||||
return $rs->form_text("realname", 30, ($_POST['realname'] ? $_POST['realname'] : $realname), 100);
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNUP_PASSWORD1
|
||||
global $rs;
|
||||
return $rs->form_password("password1", 30, $password1, 20);
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNUP_PASSWORD2
|
||||
global $rs;
|
||||
return $rs->form_password("password2", 30, $password2, 20);
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNUP_PASSWORD_LEN
|
||||
global $pref, $SIGNUP_PASSWORD_LEN;
|
||||
if($pref['signup_pass_len'])
|
||||
{
|
||||
return $SIGNUP_PASSWORD_LEN;
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNUP_EMAIL
|
||||
global $rs;
|
||||
return $rs->form_text("email", 30, ($_POST['email'] ? $_POST['email'] : $email), 100);
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNUP_EMAIL_CONFIRM
|
||||
global $rs;
|
||||
return $rs->form_text("email_confirm", 30, ($_POST['email_confirm'] ? $_POST['email_confirm'] : $email_confirm), 100);
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN SIGNUP_HIDE_EMAIL
|
||||
global $rs;
|
||||
$default_email_setting = 1; // Gives option of turning into a pref later if wanted
|
||||
return $rs->form_radio("hideemail", 1, $default_email_setting==1)." ".LAN_YES." ".$rs->form_radio("hideemail", 0,$default_email_setting==0)." ".LAN_NO;
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN SIGNUP_USERCLASS_SUBSCRIBE
|
||||
global $pref, $e_userclass, $USERCLASS_SUBSCRIBE_START, $USERCLASS_SUBSCRIBE_END, $signupData;
|
||||
$ret = "";
|
||||
if($pref['signup_option_class'])
|
||||
{
|
||||
if (!is_object($e_userclass))
|
||||
{
|
||||
require_once(e_HANDLER.'userclass_class.php');
|
||||
$e_userclass = new user_class;
|
||||
}
|
||||
$ucList = $e_userclass->get_editable_classes(); // List of classes which this user can edit
|
||||
$ret = '';
|
||||
if(!$ucList) return;
|
||||
|
||||
function show_signup_class($treename, $classnum, $current_value, $nest_level)
|
||||
{
|
||||
global $USERCLASS_SUBSCRIBE_ROW, $e_userclass, $tp;
|
||||
$tmp = explode(',',$current_value);
|
||||
$search = array('{USERCLASS_ID}', '{USERCLASS_NAME}', '{USERCLASS_DESCRIPTION}', '{USERCLASS_INDENT}', '{USERCLASS_CHECKED}');
|
||||
$replace = array($classnum, $tp->toHTML($e_userclass->uc_get_classname($classnum), FALSE, 'defs'),
|
||||
$tp->toHTML($e_userclass->uc_get_classdescription($classnum), FALSE, 'defs'), " style='text-indent:".(1.2*$nest_level)."em'",
|
||||
( in_array($classnum, $tmp) ? " checked='checked'" : ''));
|
||||
return str_replace($search, $replace, $USERCLASS_SUBSCRIBE_ROW);
|
||||
}
|
||||
$ret = $USERCLASS_SUBSCRIBE_START;
|
||||
$ret .= $e_userclass->vetted_tree('class',show_signup_class,varset($signupData['user_class'],''),'editable');
|
||||
$ret .= $USERCLASS_SUBSCRIBE_END;
|
||||
return $ret;
|
||||
}
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN SIGNUP_EXTENDED_USER_FIELDS
|
||||
global $usere, $tp, $SIGNUP_EXTENDED_USER_FIELDS, $EXTENDED_USER_FIELD_REQUIRED, $SIGNUP_EXTENDED_CAT;
|
||||
$text = "";
|
||||
|
||||
$search = array(
|
||||
'{EXTENDED_USER_FIELD_TEXT}',
|
||||
'{EXTENDED_USER_FIELD_REQUIRED}',
|
||||
'{EXTENDED_USER_FIELD_EDIT}'
|
||||
);
|
||||
|
||||
|
||||
// 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
|
||||
// 'unallocated' entries are `user_extended_struct_parent` = 0
|
||||
|
||||
// Get a list of defined categories
|
||||
$catList = $usere->user_extended_get_categories(FALSE);
|
||||
// Add in category zero - the 'no category' category
|
||||
array_unshift($catList,array('user_extended_struct_parent' => 0, 'user_extended_struct_id' => '0'));
|
||||
|
||||
|
||||
|
||||
foreach($catList as $cat)
|
||||
{
|
||||
$extList = $usere->user_extended_get_fieldList($cat['user_extended_struct_id']);
|
||||
|
||||
$done_heading = FALSE;
|
||||
|
||||
foreach($extList as $ext)
|
||||
{
|
||||
if($ext['user_extended_struct_required'] == 1 || $ext['user_extended_struct_required'] == 2)
|
||||
{
|
||||
if(!$done_heading && ($cat['user_extended_struct_id'] > 0))
|
||||
{ // Add in a heading
|
||||
$text .= str_replace('{EXTENDED_CAT_TEXT}', $tp->toHTML($cat['user_extended_struct_name'], FALSE, 'emotes_off,defs'), $SIGNUP_EXTENDED_CAT);
|
||||
$done_heading = TRUE;
|
||||
}
|
||||
$replace = array(
|
||||
$tp->toHTML($ext['user_extended_struct_text'], FALSE, 'emotes_off,defs'),
|
||||
($ext['user_extended_struct_required'] == 1 ? $EXTENDED_USER_FIELD_REQUIRED : ''),
|
||||
$usere->user_extended_edit($ext, $_POST['ue']['user_'.$ext['user_extended_struct_name']])
|
||||
);
|
||||
$text .= str_replace($search, $replace, $SIGNUP_EXTENDED_USER_FIELDS);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $text;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNUP_SIGNATURE
|
||||
global $pref, $SIGNUP_SIGNATURE_START, $SIGNUP_SIGNATURE_END;
|
||||
if($pref['signup_option_signature'])
|
||||
{
|
||||
require_once(e_HANDLER."ren_help.php");
|
||||
$SIGNUP_SIGNATURE_START = str_replace("{REN_HELP}", display_help('helpb', 2), $SIGNUP_SIGNATURE_START);
|
||||
$SIGNUP_SIGNATURE_END = str_replace("{REN_HELP}", display_help('helpb', 2), $SIGNUP_SIGNATURE_END);
|
||||
$sig = ($_POST['signature'] ? $_POST['signature'] : $signature);
|
||||
return $SIGNUP_SIGNATURE_START.$sig.$SIGNUP_SIGNATURE_END;
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNUP_IMAGES
|
||||
global $pref;
|
||||
if($pref['signup_option_image'])
|
||||
{
|
||||
|
||||
$text = "
|
||||
<input class='tbox' style='width:80%' id='avatar' type='text' name='image' size='40' value='$image' maxlength='100' />
|
||||
|
||||
<input class='button' type ='button' style='cursor:pointer' size='30' value='".LAN_SIGNUP_27."' onclick='expandit(this)' />
|
||||
<div style='display:none' >";
|
||||
$avatarlist[0] = "";
|
||||
$handle = opendir(e_IMAGE."avatars/");
|
||||
while ($file = readdir($handle))
|
||||
{
|
||||
if ($file != "." && $file != ".." && $file != "CVS" && $file != "index.html")
|
||||
{
|
||||
$avatarlist[] = $file;
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
|
||||
for($c = 1; $c <= (count($avatarlist)-1); $c++)
|
||||
{
|
||||
$text .= "<a href='javascript:insertext(\"$avatarlist[$c]\", \"avatar\")'><img src='".e_IMAGE."avatars/".$avatarlist[$c]."' alt='' /></a> ";
|
||||
}
|
||||
|
||||
$text .= "<br />
|
||||
</div><br />";
|
||||
|
||||
// Intentionally disable uploadable avatar and photos at this stage
|
||||
if (false && $pref['avatar_upload'] && FILE_UPLOADS)
|
||||
{
|
||||
$text .= "<br /><span class='smalltext'>".LAN_SIGNUP_25."</span> <input class='tbox' name='file_userfile[]' type='file' size='40' />
|
||||
<br /><div class='smalltext'>".LAN_SIGNUP_34."</div>";
|
||||
}
|
||||
|
||||
if (false && $pref['photo_upload'] && FILE_UPLOADS)
|
||||
{
|
||||
$text .= "<br /><span class='smalltext'>".LAN_SIGNUP_26."</span> <input class='tbox' name='file_userfile[]' type='file' size='40' />
|
||||
<br /><div class='smalltext'>".LAN_SIGNUP_34."</div>";
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN SIGNUP_IMAGECODE
|
||||
global $signup_imagecode, $rs, $sec_img;
|
||||
if($signup_imagecode)
|
||||
{
|
||||
return $rs->form_hidden("rand_num", $sec_img->random_number). $sec_img->r_image()."<br />".$rs->form_text("code_verify", 20, "", 20);
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNUP_FORM_CLOSE
|
||||
return "</form>";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNUP_XUP_LOGINNAME
|
||||
global $rs, $loginname;
|
||||
return $rs->form_text("loginnamexup", 30, $loginname, 30);
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNUP_XUP_PASSWORD1
|
||||
global $rs, $password1;
|
||||
return $rs->form_password("password1xup", 30, $password1, 20);
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNUP_XUP_PASSWORD2
|
||||
global $rs, $password1;
|
||||
return $rs->form_password("password2xup", 30, $password2, 20);
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNUP_IS_MANDATORY
|
||||
global $pref;
|
||||
if (isset($parm))
|
||||
{
|
||||
switch ($parm)
|
||||
{
|
||||
case 'email' : if (varset($pref['disable_emailcheck'],FALSE)) return '';
|
||||
}
|
||||
}
|
||||
return " *";
|
||||
SC_END
|
||||
|
||||
*/
|
||||
|
||||
?>
|
37
e107_core/shortcodes/batch/sitedown_shortcodes.php
Normal file
37
e107_core/shortcodes/batch/sitedown_shortcodes.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/sitedown_shortcodes.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
include_once(e_HANDLER.'shortcode_handler.php');
|
||||
$sitedown_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
|
||||
/*
|
||||
|
||||
SC_BEGIN SITEDOWN_TABLE_MAINTAINANCETEXT
|
||||
global $pref,$tp;
|
||||
if($pref['maintainance_text']) {
|
||||
return $tp->toHTML($pref['maintainance_text'], TRUE, 'parse_sc', 'admin');
|
||||
} else {
|
||||
return "<b>- ".SITENAME." ".LAN_SITEDOWN_00." -</b><br /><br />".LAN_SITEDOWN_01 ;
|
||||
}
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN SITEDOWN_TABLE_PAGENAME
|
||||
return PAGE_NAME;
|
||||
SC_END
|
||||
|
||||
*/
|
||||
?>
|
647
e107_core/shortcodes/batch/user_shortcodes.php
Normal file
647
e107_core/shortcodes/batch/user_shortcodes.php
Normal file
@@ -0,0 +1,647 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
* User information - shortcodes
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/user_shortcodes.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
include_once(e_HANDLER.'shortcode_handler.php');
|
||||
$user_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
|
||||
|
||||
/*
|
||||
SC_BEGIN TOTAL_CHATPOSTS
|
||||
global $sql;
|
||||
if(!$chatposts = getcachedvars('total_chatposts'))
|
||||
{
|
||||
$chatposts = 0; // In case plugin not installed
|
||||
if (isset($pref['plug_installed']['chatbox_menu']))
|
||||
{
|
||||
$chatposts = $sql->db_Count("chatbox");
|
||||
}
|
||||
cachevars('total_chatposts', $chatposts);
|
||||
}
|
||||
return $chatposts;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TOTAL_COMMENTPOSTS
|
||||
global $sql;
|
||||
if(!$commentposts = getcachedvars('total_commentposts'))
|
||||
{
|
||||
$commentposts = $sql->db_Count("comments");
|
||||
cachevars('total_commentposts', $commentposts);
|
||||
}
|
||||
return $commentposts;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TOTAL_FORUMPOSTS
|
||||
global $sql;
|
||||
if(!$forumposts = getcachedvars('total_forumposts'))
|
||||
{
|
||||
$forumposts = $sql->db_Count("forum_t");
|
||||
cachevars('total_forumposts', $forumposts);
|
||||
}
|
||||
return $forumposts;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_COMMENTPOSTS
|
||||
global $user;
|
||||
return $user['user_comments'];
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_FORUMPOSTS
|
||||
global $user;
|
||||
return $user['user_forums'];
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_CHATPOSTS
|
||||
global $user;
|
||||
return $user['user_chats'];
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_DOWNLOADS
|
||||
global $sql,$user;
|
||||
$downloads = $sql->db_Count("download_requests","(*)","where download_request_userid=".$user['user_id']);
|
||||
return $downloads;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_CHATPER
|
||||
global $sql, $user;
|
||||
if(!$chatposts = getcachedvars('total_chatposts'))
|
||||
{
|
||||
$chatposts = 0; // In case plugin not installed
|
||||
if (isset($pref['plug_installed']['chatbox_menu']))
|
||||
{
|
||||
$chatposts = $sql->db_Count("chatbox");
|
||||
}
|
||||
cachevars('total_chatposts', $chatposts);
|
||||
}
|
||||
return ($chatposts!=0) ? round(($user['user_chats']/$chatposts) * 100, 2): 0;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_COMMENTPER
|
||||
global $sql, $user;
|
||||
if(!$commentposts = getcachedvars('total_commentposts'))
|
||||
{
|
||||
$commentposts = $sql->db_Count("comments");
|
||||
cachevars('total_commentposts', $commentposts);
|
||||
}
|
||||
return ($commentposts!=0) ? round(($user['user_comments']/$commentposts) * 100, 2): 0;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_FORUMPER
|
||||
global $sql, $user;
|
||||
if(!$forumposts = getcachedvars('total_forumposts'))
|
||||
{
|
||||
$forumposts = (isset($pref['plug_installed']['forum'])) ? $sql->db_Count("forum_t"): 0;
|
||||
cachevars('total_forumposts', $forumposts);
|
||||
}
|
||||
return ($forumposts!==0) ? round(($user['user_forums']/$forumposts) * 100, 2): 0;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_LEVEL
|
||||
global $user, $pref;
|
||||
require_once(e_HANDLER."level_handler.php");
|
||||
$ldata = get_level($user['user_id'], $user['user_forums'], $user['user_comments'], $user['user_chats'], $user['user_visits'], $user['user_join'], $user['user_admin'], $user['user_perms'], $pref);
|
||||
|
||||
if (strstr($ldata[0], "IMAGE_rank_main_admin_image"))
|
||||
{
|
||||
return LAN_USER_31;
|
||||
}
|
||||
elseif(strstr($ldata[0], "IMAGE"))
|
||||
{
|
||||
return LAN_USER_32;
|
||||
}
|
||||
else
|
||||
{
|
||||
return $USER_LEVEL = $ldata[1];
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_LASTVISIT
|
||||
global $user;
|
||||
$gen = new convert;
|
||||
return $user['user_currentvisit'] ? $gen->convert_date($user['user_currentvisit'], "long") : "<i>".LAN_USER_33."</i>";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_LASTVISIT_LAPSE
|
||||
global $user;
|
||||
$gen = new convert;
|
||||
return $user['user_currentvisit'] ? "( ".$gen -> computeLapse($user['user_currentvisit'])." ".LAN_USER_34." )" : "<i>".LAN_USER_33."</i>";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_VISITS
|
||||
global $user;
|
||||
return $user['user_visits'];
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_JOIN
|
||||
global $user;
|
||||
$gen = new convert;
|
||||
return $gen->convert_date($user['user_join'], "forum");
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_DAYSREGGED
|
||||
global $user;
|
||||
$gen = new convert;
|
||||
return $gen -> computeLapse($user['user_join'])." ".LAN_USER_34;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_REALNAME_ICON
|
||||
|
||||
if(defined("USER_REALNAME_ICON"))
|
||||
{
|
||||
return USER_REALNAME_ICON;
|
||||
}
|
||||
if(file_exists(THEME."images/user_realname.png"))
|
||||
{
|
||||
return "<img src='".THEME_ABS."images/user_realname.png' alt='' style='vertical-align:middle;' /> ";
|
||||
}
|
||||
return "<img src='".e_IMAGE_ABS."user_icons/user_realname.png' alt='' style='vertical-align:middle;' /> ";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_REALNAME
|
||||
global $user;
|
||||
return $user['user_login'] ? $user['user_login'] : "<i>".LAN_USER_33."</i>";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_EMAIL_ICON
|
||||
|
||||
if(defined("USER_EMAIL_ICON"))
|
||||
{
|
||||
return USER_EMAIL_ICON;
|
||||
}
|
||||
if(file_exists(THEME."images/email.png"))
|
||||
{
|
||||
return "<img src='".THEME_ABS."images/email.png' alt='' style='vertical-align:middle;' /> ";
|
||||
}
|
||||
return "<img src='".e_IMAGE_ABS."generic/email.png' alt='' style='vertical-align:middle;' /> ";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_EMAIL_LINK
|
||||
global $user, $tp;
|
||||
return ($user['user_hideemail'] && !ADMIN) ? "<i>".LAN_USER_35."</i>" : $tp->parseTemplate("{email={$user['user_email']}-link}");
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_EMAIL
|
||||
global $user,$tp;
|
||||
return ($user['user_hideemail'] && !ADMIN) ? "<i>".LAN_USER_35."</i>" : $tp->toHTML($user['user_email'],"no_replace");
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_ICON
|
||||
if(defined("USER_ICON"))
|
||||
{
|
||||
return USER_ICON;
|
||||
}
|
||||
if(file_exists(THEME."images/user.png"))
|
||||
{
|
||||
return "<img src='".THEME_ABS."images/user.png' alt='' style='vertical-align:middle;' /> ";
|
||||
}
|
||||
return "<img src='".e_IMAGE_ABS."user_icons/user.png' alt='' style='vertical-align:middle;' /> ";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_ICON_LINK
|
||||
global $user;
|
||||
if(defined("USER_ICON"))
|
||||
{
|
||||
$icon = USER_ICON;
|
||||
}
|
||||
else if(file_exists(THEME."images/user.png"))
|
||||
{
|
||||
$icon = "<img src='".THEME_ABS."images/user.png' alt='' style='vertical-align:middle;' /> ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$icon = "<img src='".e_IMAGE_ABS."user_icons/user.png' alt='' style='vertical-align:middle;' /> ";
|
||||
}
|
||||
return "<a href='".e_SELF."?id.{$user['user_id']}'>{$icon}</a>";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_ID
|
||||
global $user;
|
||||
return $user['user_id'];
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_NAME
|
||||
global $user;
|
||||
return $user['user_name'];
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_NAME_LINK
|
||||
global $user;
|
||||
return "<a href='".e_SELF."?id.{$user['user_id']}'>".$user['user_name']."</a>";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_LOGINNAME
|
||||
global $user;
|
||||
if(ADMIN && getperms("4")) {
|
||||
return $user['user_loginname'];
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_BIRTHDAY_ICON
|
||||
|
||||
if(defined("USER_BIRTHDAY_ICON"))
|
||||
{
|
||||
return USER_BIRTHDAY_ICON;
|
||||
}
|
||||
if(file_exists(THEME."images/user_birthday.png"))
|
||||
{
|
||||
return "<img src='".THEME_ABS."images/user_birthday.png' alt='' style='vertical-align:middle;' /> ";
|
||||
}
|
||||
return "<img src='".e_IMAGE_ABS."user_icons/user_birthday.png' alt='' style='vertical-align:middle;' /> ";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_BIRTHDAY
|
||||
global $user;
|
||||
if ($user['user_birthday'] != "" && $user['user_birthday'] != "0000-00-00" && preg_match("/([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})/", $user['user_birthday'], $regs))
|
||||
{
|
||||
return "$regs[3].$regs[2].$regs[1]";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "<i>".LAN_USER_33."</i>";
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_SIGNATURE
|
||||
global $tp, $user;
|
||||
return $user['user_signature'] ? $tp->toHTML($user['user_signature'], TRUE) : "";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_COMMENTS_LINK
|
||||
global $user;
|
||||
return $user['user_comments'] ? "<a href='".e_HTTP."userposts.php?0.comments.".$user['user_id']."'>".LAN_USER_36."</a>" : "";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_FORUM_LINK
|
||||
global $user;
|
||||
return $user['user_forums'] ? "<a href='".e_HTTP."userposts.php?0.forums.".$user['user_id']."'>".LAN_USER_37."</a>" : "";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_SENDPM
|
||||
global $pref, $tp, $user;
|
||||
if(isset($pref['plug_installed']['pm']) && ($user['user_id'] > 0))
|
||||
{
|
||||
return $tp->parseTemplate("{SENDPM={$user['user_id']}}");
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_RATING
|
||||
global $pref, $user;
|
||||
if($pref['profile_rate'] && USER)
|
||||
{
|
||||
include_once(e_HANDLER."rate_class.php");
|
||||
$rater = new rater;
|
||||
$ret = "<span>";
|
||||
if($rating = $rater->getrating('user', $user['user_id']))
|
||||
{
|
||||
$num = $rating[1];
|
||||
for($i=1; $i<= $num; $i++)
|
||||
{
|
||||
$ret .= "<img src='".e_IMAGE_ABS."user_icons/user_star.png' alt='' />";
|
||||
}
|
||||
}
|
||||
if(!$rater->checkrated('user', $user['user_id']))
|
||||
{
|
||||
$ret .= " ".$rater->rateselect('', 'user', $user['user_id']);
|
||||
}
|
||||
$ret .= "</span>";
|
||||
return $ret;
|
||||
}
|
||||
return "";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_UPDATE_LINK
|
||||
global $user;
|
||||
if (USERID == $user['user_id'])
|
||||
{
|
||||
return "<a href='".e_HTTP."usersettings.php'>".LAN_USER_38."</a>";
|
||||
}
|
||||
else if(ADMIN && getperms("4") && !$user['user_admin'])
|
||||
{
|
||||
return "<a href='".e_HTTP."usersettings.php?".$user['user_id']."'>".LAN_USER_39."</a>";
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_JUMP_LINK
|
||||
global $sql, $user, $full_perms;
|
||||
if (!$full_perms) return;
|
||||
if(!$userjump = getcachedvars('userjump'))
|
||||
{
|
||||
// $sql->db_Select("user", "user_id, user_name", "`user_id` > ".intval($user['user_id'])." AND `user_ban`=0 ORDER BY user_id ASC LIMIT 1 ");
|
||||
$sql->db_Select_gen("SELECT user_id, user_name FROM `#user` FORCE INDEX (PRIMARY) WHERE `user_id` > ".intval($user['user_id'])." AND `user_ban`=0 ORDER BY user_id ASC LIMIT 1 ");
|
||||
if ($row = $sql->db_Fetch())
|
||||
{
|
||||
$userjump['next']['id'] = $row['user_id'];
|
||||
$userjump['next']['name'] = $row['user_name'];
|
||||
}
|
||||
// $sql->db_Select("user", "user_id, user_name", "`user_id` < ".intval($user['user_id'])." AND `user_ban`=0 ORDER BY user_id DESC LIMIT 1 ");
|
||||
$sql->db_Select_gen("SELECT user_id, user_name FROM `#user` FORCE INDEX (PRIMARY) WHERE `user_id` < ".intval($user['user_id'])." AND `user_ban`=0 ORDER BY user_id DESC LIMIT 1 ");
|
||||
if ($row = $sql->db_Fetch())
|
||||
{
|
||||
$userjump['prev']['id'] = $row['user_id'];
|
||||
$userjump['prev']['name'] = $row['user_name'];
|
||||
}
|
||||
cachevars('userjump', $userjump);
|
||||
}
|
||||
if($parm == 'prev')
|
||||
{
|
||||
return isset($userjump['prev']['id']) ? "<< ".LAN_USER_40." [ <a href='".e_SELF."?id.".$userjump['prev']['id']."'>".$userjump['prev']['name']."</a> ]" : " ";
|
||||
}
|
||||
else
|
||||
{
|
||||
return isset($userjump['next']['id']) ? "[ <a href='".e_SELF."?id.".$userjump['next']['id']."'>".$userjump['next']['name']."</a> ] ".LAN_USER_41." >>" : " ";
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_PICTURE
|
||||
global $user;
|
||||
if ($user['user_sess'] && file_exists(e_UPLOAD."avatars/".$user['user_sess']))
|
||||
{
|
||||
return "<img src='".e_UPLOAD_ABS."public/avatars/".$user['user_sess']."' alt='' />";
|
||||
}
|
||||
else
|
||||
{
|
||||
return LAN_USER_42;
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_AVATAR
|
||||
global $user, $tp;
|
||||
if ($user['user_image'])
|
||||
{
|
||||
return $tp->parseTemplate("{USER_AVATAR=".$user['user_image']."}", true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return LAN_USER_42;
|
||||
}
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN USER_PICTURE_NAME
|
||||
global $user;
|
||||
if (ADMIN && getperms("4"))
|
||||
{
|
||||
return $user['user_sess'];
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_PICTURE_DELETE
|
||||
if (USERID == $user['user_id'] || (ADMIN && getperms("4")))
|
||||
{
|
||||
return "
|
||||
<form method='post' action='".e_SELF."?".e_QUERY."'>
|
||||
<input class='button' type='submit' name='delp' value='".LAN_USER_43."' />
|
||||
</form>
|
||||
";
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_EXTENDED_ALL
|
||||
|
||||
global $user, $tp, $sql;
|
||||
global $EXTENDED_CATEGORY_START, $EXTENDED_CATEGORY_END, $EXTENDED_CATEGORY_TABLE;
|
||||
$qry = "SELECT f.*, c.user_extended_struct_name AS category_name, c.user_extended_struct_id AS category_id FROM #user_extended_struct as f
|
||||
LEFT JOIN #user_extended_struct as c ON f.user_extended_struct_parent = c.user_extended_struct_id
|
||||
ORDER BY c.user_extended_struct_order ASC, f.user_extended_struct_order ASC
|
||||
";
|
||||
|
||||
|
||||
|
||||
require_once(e_HANDLER."user_extended_class.php");
|
||||
|
||||
$ue = new e107_user_extended;
|
||||
$ueCatList = $ue->user_extended_get_categories();
|
||||
$ueFieldList = $ue->user_extended_get_fields();
|
||||
$ueCatList[0][0] = array('user_extended_struct_name' => LAN_USER_44);
|
||||
$ret = "";
|
||||
foreach($ueCatList as $catnum => $cat)
|
||||
{
|
||||
$key = $cat[0]['user_extended_struct_name'];
|
||||
$cat_name = $tp->parseTemplate("{USER_EXTENDED={$key}.text.{$user['user_id']}}", TRUE);
|
||||
if($cat_name != FALSE && count($ueFieldList[$catnum]))
|
||||
{
|
||||
|
||||
$ret .= str_replace("{EXTENDED_NAME}", $key, $EXTENDED_CATEGORY_START);
|
||||
foreach($ueFieldList[$catnum] as $f)
|
||||
{
|
||||
$key = $f['user_extended_struct_name'];
|
||||
if($ue_name = $tp->parseTemplate("{USER_EXTENDED={$key}.text.{$user['user_id']}}", TRUE))
|
||||
{
|
||||
$extended_record = str_replace("EXTENDED_ICON","USER_EXTENDED={$key}.icon", $EXTENDED_CATEGORY_TABLE);
|
||||
$extended_record = str_replace("{EXTENDED_NAME}", $tp->toHTML($ue_name,"","defs"), $extended_record);
|
||||
$extended_record = str_replace("EXTENDED_VALUE","USER_EXTENDED={$key}.value.{$user['user_id']}", $extended_record);
|
||||
if(HIDE_EMPTY_FIELDS === TRUE)
|
||||
{
|
||||
$this_value = $tp->parseTemplate("{USER_EXTENDED={$key}.value.{$user['user_id']}}", TRUE);
|
||||
if($this_value != "")
|
||||
{
|
||||
$ret .= $tp->parseTemplate($extended_record, TRUE);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret .= $tp->parseTemplate($extended_record, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$ret .= $EXTENDED_CATEGORY_END;
|
||||
}
|
||||
return $ret;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN PROFILE_COMMENTS
|
||||
global $user, $pref, $sql, $ns;
|
||||
if($pref['profile_comments'])
|
||||
{
|
||||
include_once(e_HANDLER."comment_class.php");
|
||||
$cobj = new comment;
|
||||
$qry = "
|
||||
SELECT c.*, u.*, ue.* FROM #comments AS c
|
||||
LEFT JOIN #user AS u ON c.comment_author = u.user_id
|
||||
LEFT JOIN #user_extended AS ue ON c.comment_author = ue.user_extended_id
|
||||
WHERE c.comment_item_id='".intval($user['user_id'])."'
|
||||
AND c.comment_type='profile'
|
||||
AND c.comment_pid='0'
|
||||
ORDER BY c.comment_datestamp
|
||||
";
|
||||
|
||||
if($comment_total = $sql->db_Select_gen($qry))
|
||||
{
|
||||
while($row = $sql->db_Fetch())
|
||||
{
|
||||
$ret .= $cobj->render_comment($row);
|
||||
}
|
||||
}
|
||||
return $ns->tablerender(COMLAN_5, $ret, 'profile_comments', TRUE);
|
||||
}
|
||||
return "";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN PROFILE_COMMENT_FORM
|
||||
global $pref, $user;
|
||||
if($pref['profile_comments'])
|
||||
{
|
||||
include_once(e_HANDLER."comment_class.php");
|
||||
$cobj = new comment;
|
||||
$ret = "";
|
||||
if(ADMIN === TRUE)
|
||||
{
|
||||
$ret .= "<a href='".e_BASE.e_ADMIN."modcomment.php?profile.{$user['user_id']}'>".COMLAN_314."</a><br /><br />";
|
||||
}
|
||||
$ret .= $cobj->form_comment("comment", "profile", $user['user_id'], "", "", TRUE);
|
||||
return $ret;
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN TOTAL_USERS
|
||||
global $users_total;
|
||||
return $users_total;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_FORM_RECORDS
|
||||
global $records, $user_frm;
|
||||
$ret = $user_frm->form_select_open("records");
|
||||
for($i=10; $i<=30; $i+=10)
|
||||
{
|
||||
$sel = ($i == $records ? true: false);
|
||||
$ret .= $user_frm->form_option($i, $sel, $i);
|
||||
}
|
||||
$ret .= $user_frm->form_select_close();
|
||||
return $ret;
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN USER_FORM_ORDER
|
||||
global $order;
|
||||
if ($order == "ASC")
|
||||
{
|
||||
$ret = "<select name='order' class='tbox'>
|
||||
<option value='DESC'>".LAN_USER_45."</option>
|
||||
<option value='ASC' selected='selected'>".LAN_USER_46."</option>
|
||||
</select>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$ret = "<select name='order' class='tbox'>
|
||||
<option value='DESC' selected='selected'>".LAN_USER_45."</option>
|
||||
<option value='ASC'>".LAN_USER_46."</option>
|
||||
</select>";
|
||||
}
|
||||
return $ret;
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN USER_FORM_START
|
||||
global $from;
|
||||
return "
|
||||
<form method='post' action='".e_SELF."'>
|
||||
<p><input type='hidden' name='from' value='$from' /></p>
|
||||
";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_FORM_END
|
||||
return "</form>";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_FORM_SUBMIT
|
||||
return "<input class='button' type='submit' name='submit' value='".LAN_USER_47."' />";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_EMBED_USERPROFILE
|
||||
global $pref, $USER_EMBED_USERPROFILE_TEMPLATE, $embed_already_rendered;
|
||||
|
||||
//if no parm, it means we render ALL embedded contents
|
||||
//so we're preloading all registerd e_userprofile files
|
||||
$key = varset($pref['e_userprofile_list']);
|
||||
|
||||
//if we don't have any embedded contents, return
|
||||
if(!is_array($key) || empty($key)){ return; }
|
||||
|
||||
//array holding specific hooks to render
|
||||
$render=array();
|
||||
|
||||
if($parm){
|
||||
|
||||
//if the first char of parm is an ! mark, it means it should not render the following parms
|
||||
if(strpos($parm,'!')===0){
|
||||
$tmp = explode(",", substr($parm,1) );
|
||||
foreach($tmp as $not){
|
||||
$not=trim($not);
|
||||
if(isset($key[$not])){
|
||||
//so we're unsetting them from the $key array
|
||||
unset($key[$not]);
|
||||
}
|
||||
}
|
||||
|
||||
//else it means we render only the following parms
|
||||
}else{
|
||||
$tmp = explode(",", $parm );
|
||||
foreach($tmp as $yes){
|
||||
$yes=trim($yes);
|
||||
if(isset($key[$yes])){
|
||||
//so add the ones we need to render to the $render array
|
||||
$render[$yes] = $key[$yes];
|
||||
}
|
||||
}
|
||||
//finally assign the render array as the key array, overwriting it
|
||||
$key = $render;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($key as $hook){
|
||||
//include the e_user file and initiate the class
|
||||
if(is_readable(e_PLUGIN.$hook."/e_userprofile.php")){
|
||||
//if the current hook is not yet rendered
|
||||
if(!in_array($hook, $embed_already_rendered)){
|
||||
require_once(e_PLUGIN.$hook."/e_userprofile.php");
|
||||
$name = "e_userprofile_{$hook}";
|
||||
if(function_exists($name)){
|
||||
$arr[] = $name();
|
||||
//we need to store which hooks are already rendered
|
||||
$embed_already_rendered[] = $hook;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ret = '';
|
||||
foreach($arr as $data){
|
||||
if(is_array($data['caption'])){
|
||||
foreach($data['caption'] as $k=>$v){
|
||||
if(isset($data['caption'][$k]) && isset($data['text'][$k])){
|
||||
$search = array('{USER_EMBED_USERPROFILE_CAPTION}', '{USER_EMBED_USERPROFILE_TEXT}');
|
||||
$replace = array($data['caption'][$k], $data['text'][$k]);
|
||||
$ret .= str_replace($search, $replace, $USER_EMBED_USERPROFILE_TEMPLATE);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(isset($data['caption']) && isset($data['text'])){
|
||||
$search = array('{USER_EMBED_USERPROFILE_CAPTION}', '{USER_EMBED_USERPROFILE_TEXT}');
|
||||
$replace = array($data['caption'], $data['text']);
|
||||
$ret .= str_replace($search, $replace, $USER_EMBED_USERPROFILE_TEMPLATE);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $ret;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USER_CUSTOMTITLE
|
||||
global $user;
|
||||
return $user['user_customtitle'];
|
||||
SC_END
|
||||
|
||||
*/
|
||||
?>
|
339
e107_core/shortcodes/batch/usersettings_shortcodes.php
Executable file
339
e107_core/shortcodes/batch/usersettings_shortcodes.php
Executable file
@@ -0,0 +1,339 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_files/shortcode/batch/usersettings_shortcodes.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
include_once(e_HANDLER.'shortcode_handler.php');
|
||||
$usersettings_shortcodes = $tp -> e_sc -> parse_scbatch(__FILE__);
|
||||
/*
|
||||
SC_BEGIN USERNAME
|
||||
global $rs, $curVal, $pref;
|
||||
// This is the 'display name'
|
||||
if (check_class($pref['displayname_class']))
|
||||
{
|
||||
$dis_name_len = varset($pref['displayname_maxlength'],15);
|
||||
return $rs->form_text("username", $dis_name_len, $curVal['user_name'], $dis_name_len, "tbox");
|
||||
}
|
||||
else
|
||||
{
|
||||
return $curVal['user_name'];
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN LOGINNAME
|
||||
global $rs, $curVal;
|
||||
if (ADMIN && getperms("4"))
|
||||
{
|
||||
$log_name_length = varset($pref['loginname_maxlength'],30);
|
||||
return $rs->form_text("loginname", $log_name_length, $curVal['user_loginname'], $log_name_length, "tbox");
|
||||
}
|
||||
else
|
||||
{
|
||||
return $curVal['user_loginname'];
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN CUSTOMTITLE
|
||||
global $rs, $curVal, $pref;
|
||||
if ($pref['signup_option_customtitle'])
|
||||
{
|
||||
return $rs->form_text("customtitle", 40, $curVal['user_customtitle'], 100, "tbox");
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN REALNAME
|
||||
global $rs, $curVal;
|
||||
return $rs->form_text("realname", 20, $curVal['user_login'], 100, "tbox");
|
||||
SC_END
|
||||
|
||||
SC_BEGIN PASSWORD1
|
||||
global $rs, $curVal, $pref;
|
||||
if(!isset($pref['auth_method']) || $pref['auth_method'] == '' || $pref['auth_method'] == 'e107' || $pref['auth_method'] == '>e107')
|
||||
{
|
||||
return $rs->form_password("password1", 40, "", 20);
|
||||
}
|
||||
|
||||
return "";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN PASSWORD2
|
||||
global $rs, $curVal, $pref;
|
||||
if(!isset($pref['auth_method']) || $pref['auth_method'] == '' || $pref['auth_method'] == 'e107' || $pref['auth_method'] == '>e107')
|
||||
{
|
||||
return $rs->form_password("password2", 40, "", 20);
|
||||
}
|
||||
|
||||
return "";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN PASSWORD_LEN
|
||||
global $pref;
|
||||
if(!isset($pref['auth_method']) || ($pref['auth_method'] != 'e107' && $pref['auth_method'] != '>e107'))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
return $pref['signup_pass_len'];
|
||||
SC_END
|
||||
|
||||
SC_BEGIN EMAIL
|
||||
global $rs, $curVal;
|
||||
return $rs->form_text("email", 40, $curVal['user_email'], 100);
|
||||
SC_END
|
||||
|
||||
SC_BEGIN HIDEEMAIL
|
||||
global $rs, $curVal;
|
||||
if($parm == 'radio')
|
||||
{
|
||||
return ($curVal['user_hideemail'] ? $rs->form_radio("hideemail", 1, 1)." ".LAN_YES." ".$rs->form_radio("hideemail", 0)." ".LAN_NO : $rs->form_radio("hideemail", 1)." ".LAN_YES." ".$rs->form_radio("hideemail", 0, 1)." ".LAN_NO);
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USERCLASSES
|
||||
global $e_userclass, $pref, $tp, $curVal;
|
||||
$ret = "";
|
||||
if(ADMIN && $curVal['user_id'] != USERID)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
if (!is_object($e_userclass)) $e_userclass = new user_class;
|
||||
$ucList = $e_userclass->get_editable_classes(USERCLASS_LIST, TRUE); // List of classes which this user can edit (as array)
|
||||
$ret = '';
|
||||
if(!count($ucList)) return;
|
||||
|
||||
$is_checked = array();
|
||||
foreach ($ucList as $cid)
|
||||
{
|
||||
if (check_class($cid, $curVal['user_class'])) $is_checked[$cid] = $cid;
|
||||
if(isset($_POST['class']))
|
||||
{
|
||||
// $is_checked[$cid] = in_array($cid, $_POST['class']);
|
||||
}
|
||||
|
||||
}
|
||||
$inclass = implode(',',$is_checked);
|
||||
|
||||
$ret = "<table style='width:95%'><tr><td class='defaulttext'>";
|
||||
$ret .= $e_userclass->vetted_tree('class',array($e_userclass,checkbox_desc),$inclass,'editable');
|
||||
$ret .= "</td></tr></table>\n";
|
||||
|
||||
return $ret;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNATURE
|
||||
global $curVal;
|
||||
parse_str($parm);
|
||||
$cols = (isset($cols) ? $cols : 58);
|
||||
$rows = (isset($rows) ? $rows : 4);
|
||||
return "<textarea class='tbox signature' name='signature' cols='{$cols}' rows='{$rows}' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this);'>".$curVal['user_signature']."</textarea>";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN SIGNATURE_HELP
|
||||
return display_help("", 2);
|
||||
SC_END
|
||||
|
||||
|
||||
|
||||
SC_BEGIN AVATAR_UPLOAD
|
||||
global $pref;
|
||||
if ($pref['avatar_upload'] && FILE_UPLOADS)
|
||||
{
|
||||
return "<input class='tbox' name='file_userfile[avatar]' type='file' size='47' />";
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN AVATAR_REMOTE
|
||||
global $curVal;
|
||||
return "<input class='tbox' type='text' name='image' size='60' value='".$curVal['user_image']."' maxlength='100' />";
|
||||
SC_END
|
||||
|
||||
SC_BEGIN AVATAR_CHOOSE
|
||||
$ret = "
|
||||
<input class='button' type ='button' style=' cursor:pointer' size='30' value='".LAN_USET_38."' onclick='expandit(this)' />
|
||||
<div style='display:none' >";
|
||||
$avatarlist[0] = "";
|
||||
$handle = opendir(e_IMAGE."avatars/");
|
||||
while ($file = readdir($handle))
|
||||
{
|
||||
if ($file != "." && $file != ".." && $file != "index.html" && $file != "CVS")
|
||||
{
|
||||
$avatarlist[] = $file;
|
||||
}
|
||||
}
|
||||
closedir($handle);
|
||||
|
||||
for($c = 1; $c <= (count($avatarlist)-1); $c++)
|
||||
{
|
||||
$ret .= "<a href='javascript:addtext_us(\"$avatarlist[$c]\")'><img src='".e_IMAGE."avatars/".$avatarlist[$c]."' alt='' /></a> ";
|
||||
}
|
||||
|
||||
$ret .= "
|
||||
<br />
|
||||
</div>
|
||||
";
|
||||
return $ret;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN PHOTO_UPLOAD
|
||||
global $pref;
|
||||
if ($pref['photo_upload'] && FILE_UPLOADS)
|
||||
{
|
||||
return "<input type='checkbox' name='user_delete_photo' value='1' />".LAN_USET_16."<br />\n
|
||||
<input class='tbox' name='file_userfile[photo]' type='file' size='47' />";
|
||||
}
|
||||
SC_END
|
||||
|
||||
SC_BEGIN XUP
|
||||
global $pref,$curVal;
|
||||
if(isset($pref['xup_enabled']) && $pref['xup_enabled'] == 1)
|
||||
{
|
||||
return "<input class='tbox' type='text' name='user_xup' size='50' value='{$curVal['user_xup']}' maxlength='100' />";
|
||||
}
|
||||
SC_END
|
||||
|
||||
|
||||
SC_BEGIN USEREXTENDED_ALL
|
||||
global $sql, $tp, $curVal, $usersettings_shortcodes;
|
||||
$qry = "
|
||||
SELECT * FROM #user_extended_struct
|
||||
WHERE user_extended_struct_applicable IN (".$tp -> toDB($curVal['userclass_list'], true).")
|
||||
AND user_extended_struct_write IN (".USERCLASS_LIST.")
|
||||
AND user_extended_struct_type = 0
|
||||
ORDER BY user_extended_struct_order ASC
|
||||
";
|
||||
$ret="";
|
||||
if($sql->db_Select_gen($qry))
|
||||
{
|
||||
$catList = $sql->db_getList();
|
||||
}
|
||||
$catList[] = array("user_extended_struct_id" => 0, "user_extended_struct_name" => LAN_USET_7);
|
||||
foreach($catList as $cat)
|
||||
{
|
||||
cachevars("extendedcat_{$cat['user_extended_struct_id']}", $cat);
|
||||
$ret .= $tp->parseTemplate("{USEREXTENDED_CAT={$cat['user_extended_struct_id']}}", TRUE, $usersettings_shortcodes);
|
||||
}
|
||||
return $ret;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USEREXTENDED_CAT
|
||||
global $sql, $tp, $curVal, $usersettings_shortcodes, $USER_EXTENDED_CAT, $extended_showed;
|
||||
if(isset($extended_showed['cat'][$parm]))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
$ret = "";
|
||||
$catInfo = getcachedvars("extendedcat_{$parm}");
|
||||
if(!$catInfo)
|
||||
{
|
||||
$qry = "
|
||||
SELECT * FROM #user_extended_struct
|
||||
WHERE user_extended_struct_applicable IN (".$tp -> toDB($curVal['userclass_list'], true).")
|
||||
AND user_extended_struct_write IN (".USERCLASS_LIST.")
|
||||
AND user_extended_struct_id = ".intval($parm)."
|
||||
";
|
||||
if($sql->db_Select_gen($qry))
|
||||
{
|
||||
$catInfo = $sql->db_Fetch();
|
||||
}
|
||||
}
|
||||
|
||||
if($catInfo)
|
||||
{
|
||||
$qry = "
|
||||
SELECT * FROM #user_extended_struct
|
||||
WHERE user_extended_struct_applicable IN (".$tp -> toDB($curVal['userclass_list'], true).")
|
||||
AND user_extended_struct_write IN (".USERCLASS_LIST.")
|
||||
AND user_extended_struct_parent = ".intval($parm)."
|
||||
AND user_extended_struct_type != 0
|
||||
ORDER BY user_extended_struct_order ASC
|
||||
";
|
||||
if($sql->db_Select_gen($qry))
|
||||
{
|
||||
$fieldList = $sql->db_getList();
|
||||
foreach($fieldList as $field)
|
||||
{
|
||||
cachevars("extendedfield_{$cat['user_extended_struct_name']}", $field);
|
||||
$ret .= $tp->parseTemplate("{USEREXTENDED_FIELD={$field['user_extended_struct_name']}}", TRUE, $usersettings_shortcodes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($ret)
|
||||
{
|
||||
$ret = str_replace("{CATNAME}", $catInfo['user_extended_struct_name'], $USER_EXTENDED_CAT).$ret;
|
||||
}
|
||||
|
||||
$extended_showed['cat'][$parm] = 1;
|
||||
return $ret;
|
||||
SC_END
|
||||
|
||||
SC_BEGIN USEREXTENDED_FIELD
|
||||
global $sql, $tp, $curVal, $usersettings_shortcodes, $extended_showed, $ue, $USEREXTENDED_FIELD, $REQUIRED_FIELD;
|
||||
if(isset($extended_showed['field'][$parm]))
|
||||
{
|
||||
return "";
|
||||
}
|
||||
$ret = "";
|
||||
|
||||
$fInfo = getcachedvars("extendeddata_{$parm}");
|
||||
if(!$fInfo)
|
||||
{
|
||||
$qry = "
|
||||
SELECT * FROM #user_extended_struct
|
||||
WHERE user_extended_struct_applicable IN (".$tp -> toDB($curVal['userclass_list'], true).")
|
||||
AND user_extended_struct_write IN (".USERCLASS_LIST.")
|
||||
AND user_extended_struct_name = '".$tp -> toDB($parm, true)."'
|
||||
";
|
||||
if($sql->db_Select_gen($qry))
|
||||
{
|
||||
$fInfo = $sql->db_Fetch();
|
||||
}
|
||||
}
|
||||
|
||||
if($fInfo)
|
||||
{
|
||||
$fname = $tp->toHTML($fInfo['user_extended_struct_text'], "", "emotes_off, defs");
|
||||
if($fInfo['user_extended_struct_required'] == 1)
|
||||
{
|
||||
$fname = str_replace("{FIELDNAME}", $fname, $REQUIRED_FIELD);
|
||||
}
|
||||
|
||||
$parms = explode("^,^",$fInfo['user_extended_struct_parms']);
|
||||
|
||||
$fhide="";
|
||||
if($parms[3])
|
||||
{
|
||||
$chk = (strpos($curVal['user_hidden_fields'], "^user_".$parm."^") === FALSE) ? FALSE : TRUE;
|
||||
if(isset($_POST['updatesettings']))
|
||||
{
|
||||
$chk = isset($_POST['hide']['user_'.$parm]);
|
||||
}
|
||||
$fhide = $ue->user_extended_hide($fInfo, $chk);
|
||||
}
|
||||
|
||||
$uVal = str_replace(chr(1), "", $curVal['user_'.$parm]);
|
||||
$fval = $ue->user_extended_edit($fInfo, $uVal);
|
||||
|
||||
$ret = $USEREXTENDED_FIELD;
|
||||
$ret = str_replace("{FIELDNAME}", $fname, $ret);
|
||||
$ret = str_replace("{FIELDVAL}", $fval, $ret);
|
||||
$ret = str_replace("{HIDEFIELD}", $fhide, $ret);
|
||||
}
|
||||
|
||||
$extended_showed['field'][$parm] = 1;
|
||||
return $ret;
|
||||
SC_END
|
||||
|
||||
*/
|
||||
?>
|
Reference in New Issue
Block a user