Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > Template Shares
Reply
  #1  
Old 9th August 2008, 00:16
GaBoNtZ's Avatar
GaBoNtZ GaBoNtZ is offline
Senior Member
 
Join Date: Mar 2008
P2P
Posts: 113
Question 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
?>
maybe someone can correct this?

Last edited by GaBoNtZ; 9th November 2008 at 23:07.
Reply With Quote
  #2  
Old 9th August 2008, 22:27
trilious trilious is offline
Senior Member
 
Join Date: Aug 2008
Posts: 30
Default hi
hi i see what u mean for soemr eason mine apepars above shoutbox but not in a box like the others its wierd
Reply With Quote
  #3  
Old 6th September 2008, 15:06
GaBoNtZ's Avatar
GaBoNtZ GaBoNtZ is offline
Senior Member
 
Join Date: Mar 2008
P2P
Posts: 113
Default
so noone can help with this?
Reply With Quote
Reply

Tags
chooser , frontend , template , tsse

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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



All times are GMT +2. The time now is 11:57. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.