|
#1
|
||||
|
||||
TSSE Frontend Template Chooser
i made a plugin but i dunno what i done wrong.
the plugin is working but is not in right place. you can see the plugin here: tsse.smart-host.ro :: Welcome ! and the code is: Code:
<?php define('TS_P_VERSION', '0.1 by GaBoNtZ'); // Security Check. if (!defined('IN_PLUGIN_SYSTEM')) { die("<font face='verdana' size='2' color='darkred'><b>Error!</b> Direct initialization of this file is not allowed.</font>"); } // BEGIN Plugin: Template Changer require_once('global.php'); gzip(); dbconn(); loggedinorreturn(); maxsysop(); $action = isset($_POST['action']) ? htmlspecialchars_uni($_POST['action']) : (isset($_GET['action']) ? htmlspecialchars_uni($_GET['action']) : ''); $type = isset($_POST['type']) ? htmlspecialchars_uni($_POST['type']) : (isset($_GET['type']) ? htmlspecialchars_uni($_GET['type']) : ''); $lang->load('usercp'); function form($name,$emailcheck=false) { return print("<form method='post' action='".$_SERVER['SCRIPT_NAME']."' name='theme_changer' ".($emailcheck ? "onSubmit='return checkEmail(this)'" : "")."><input type='hidden' name='action' value='".htmlspecialchars_uni($name)."'><input type='hidden' name='type' value='save'>"); } function submit() { global $lang; return tr($lang->usercp['savesettings'], "<input type='submit' class='btn' value='".$lang->global['buttonsave']."'></form>",1); } if ($type != 'save') { //stdhead($lang->usercp['tracker']); //usercpmenu ("tracker"); print ("<table border=0 cellspacing=0 cellpadding=5 width=100%>"); form ("tracker"); } if ($type == 'save') { $stylesheet = htmlspecialchars_uni($_POST["stylesheet"]); if ($stylesheet != $CURUSER['stylesheet']) $updateset[] = "stylesheet = " . sqlesc($stylesheet); if (isset($updateset) && count($updateset) > 0) sql_query("UPDATE users SET " . implode(", ", $updateset) . " WHERE id=".sqlesc($CURUSER['id'])) or sqlerr(__FILE__, __LINE__); redirect("index.php"); } $defaulttemplate = ts_template(); $template_dirs = dir_list(INC_PATH.'/templates'); if (empty($template_dirs)) $dirlist .= '<option value="">There is no template</option>'; else { foreach ($template_dirs as $dir) { if (substr($dir, -4, 1) !== '.') { $dirlist .= '<option value="'.$dir.'" '.($CURUSER['stylesheet'] == $dir ? 'selected="selected"' : ($defaulttemplate == $dir ? 'selected="selected"' : '')).'>'.$dir.'</option>'; } } } $t_image = '<img src="'.$BASEURL.'/include/templates/'.($CURUSER['stylesheet'] ? htmlspecialchars_uni($CURUSER['stylesheet']) : 'default').'/images/header.jpg" border="0" width="100" height="20" style="vertical-align: middle;" id="t_image">'; tr($lang->usercp['stylesheet'], "<select name='stylesheet' id='specialboxs' style='vertical-align: middle;' OnChange='javascript:document.forms[0].t_image.src=\"".$BASEURL."/include/templates/\"+this.value+\"/images/header.jpg\"'>\n$dirlist \n</select> ".$t_image,1); submit(); //End Plugin: Template Changer ?>
__________________
http://img329.imageshack.us/img329/6...tysysopvf1.png Last edited by GaBoNtZ; 9th November 2008 at 23:07. |
#2
|
|||
|
|||
hi
hi i see what u mean for soemr eason mine apepars above shoutbox but not in a box like the others its wierd
|
#3
|
||||
|
||||
so noone can help with this?
__________________
http://img329.imageshack.us/img329/6...tysysopvf1.png |
Tags |
chooser , frontend , template , tsse |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[TS 6.3]template | psl | Template Shares | 4 | 31st January 2010 22:24 |
Frontend for XBT tracker? | Viperia | Community Cafe | 6 | 24th September 2009 09:24 |
TSSE 3.1 Minor Template Change | Preceptor | Template Shares | 1 | 8th February 2009 00:40 |
Template for FTS | Dragan3591 | Free Torrent Source | 3 | 18th January 2009 14:36 |
TSSE 4.3 problems with template | weevazi | Template Shares | 1 | 3rd December 2008 23:51 |