Help with Theme System

Started by Ali, February 04, 2014, 02:40:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RogueSurfer

#5
the template.php file


<?php

/*
**Template Mod By AronTh for TBDEV.NET source code 2009, theme made by AronTh
**Special Thanks to CoLdFuSiOn for providing the source code and KiD for the motivation to me(AronTh) to make themes for TbDev.net
*/

function stdhead($title ""$msgalert true) {
    global 
$CURUSER$TBDEV$lang;

    if (!
$TBDEV['site_online'])
      die(
"Site is down for maintenance, please check back again later... thanks<br />");

    
//header("Content-Type: text/html; charset=iso-8859-1");
    //header("Pragma: No-cache");
    
if ($title == "")
        
$title $TBDEV['site_name'] .(isset($_GET['tbv'])?" (".TBVERSION.")":'');
    else
        
$title $TBDEV['site_name'].(isset($_GET['tbv'])?" (".TBVERSION.")":''). " :: " htmlspecialchars($title);
        
    if (
$TBDEV['msg_alert'] && $msgalert && $CURUSER)
    {
      
$res mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" $CURUSER["id"] . " && unread='yes'") or sqlerr(__FILE__,__LINE__);
      
$arr mysql_fetch_row($res);
      
$unread $arr[0];
    }

    
$htmlout "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">

<html xmlns='http://www.w3.org/1999/xhtml'>
<head>

<meta name='generator' content='TBDev.net' />
<meta http-equiv='Content-Language' content='en-us' />
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<meta name='MSSmartTagsPreventParsing' content='TRUE' />

<title>
{$title}</title>
<link rel='stylesheet' href='templates/1/1.css' type='text/css' />
</head>
    
    <body>

      <table width='100%' cellspacing='0' cellpadding='0' style='background: transparent'>
      <tr>

      <td class='clear'>
      <div id='logostrip'>
      <img src='
{$TBDEV['pic_base_url']}logo.jpg' alt='' />

      <a href='donate.php'><img src='
{$TBDEV['pic_base_url']}x-click-but04.gif' border='0' alt='{$lang['gl_donate']}' title='{$lang['gl_donate']}' style='margin-top: 5px' /></a>
      </div>
      </td>

      </tr></table>

      <table class='mainouter' width='100%' border='1' cellspacing='0' cellpadding='10'>
<!-- STATUSBAR -->"
;

    
$htmlout .= StatusBar();

    
$htmlout .= "<!-- MENU -->
      <tr><td class='outer'>
      <div id='submenu'>"
;

    if (
$CURUSER
    { 
      
$htmlout .= "<div class='tb-top-left-link'>
      <a href='index.php'>
{$lang['gl_home']}</a>
      <a href='browse.php'>
{$lang['gl_browse']}</a>
      <a href='search.php'>
{$lang['gl_search']}</a>
      <a href='upload.php'>
{$lang['gl_upload']}</a>
      <a href='chat.php'>
{$lang['gl_chat']}</a>
      <a href='forums.php'>
{$lang['gl_forums']}</a>
      <!--<a href='misc/dox.php'>DOX</a>-->
      <a href='topten.php'>
{$lang['gl_top_10']}</a>
      <a href='rules.php'>
{$lang['gl_rules']}</a>
      <a href='faq.php'>
{$lang['gl_faq']}</a>
      <a href='links.php'>
{$lang['gl_links']}</a>
      <a href='staff.php'>
{$lang['gl_staff']}</a>
      </div>
      <div class='tb-top-right-link'>"
;

      if( 
$CURUSER['class'] >= UC_MODERATOR )
      {
        
$htmlout .= "<a href='admin.php'>{$lang['gl_admin']}</a>";
      }

    
$htmlout .= "<a href='my.php'>{$lang['gl_profile']}</a>
      <a href='logout.php'>
{$lang['gl_logout']}</a>
      </div>"
;
    } 
    else
    {
      
$htmlout .= "<div class='tb-top-left-link'>
      <a href='login.php'>
{$lang['gl_login']}</a>
      <a href='signup.php'>
{$lang['gl_signup']}</a>
      <a href='recover.php'>
{$lang['gl_recover']}</a>
      </div>"
;
    }

    
$htmlout .= "</div>
    </td>
    </tr>
    <tr><td align='center' class='outer' style='padding-top: 20px; padding-bottom: 20px'>"
;


    if (
$TBDEV['msg_alert'] && isset($unread) && !empty($unread))
    {
      
$htmlout .= "<p><table border='0' cellspacing='0' cellpadding='10' bgcolor='red'>
                  <tr><td style='padding: 10px; background: red'>\n
                  <b><a href='messages.php'><font color='white'>"
.sprintf($lang['gl_msg_alert'], $unread) . ($unread "s" "") . "!</font></a></b>
                  </td></tr></table></p>\n"
;
    }

    return 
$htmlout;
    
// stdhead

function stdfoot() {
  global 
$TBDEV;
  
    return 
"<p align='center'>
    <a rel='license' href='http://creativecommons.org/licenses/by-nc-nd/2.0/uk/'><img alt='Creative Commons License' style='border-width:0' src='http://i.creativecommons.org/l/by-nc-nd/2.0/uk/88x31.png' /></a><br />
    <a href='http://www.tbdev.net'><img src='
{$TBDEV['pic_base_url']}tbdev_btn_red.png' border='0' alt='Powered By TBDev &copy;2009' title='Powered By TBDev &copy;2009' /></a></p>
<script type=\"text/javascript\">
var gaJsHost = ((\"https:\" == document.location.protocol) ? \"https://ssl.\" : \"http://www.\");
document.write(unescape(\"%3Cscript src='\" + gaJsHost + \"google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E\"));
</script>
<script type=\"text/javascript\">
try {
var pageTracker = _gat._getTracker(\"UA-13256113-1\");
pageTracker._trackPageview();
} catch(err) {}</script>\n
<!-- Piwik -->
<script type=\"text/javascript\">
var pkBaseURL = ((\"https:\" == document.location.protocol) ? \"https://stats.xdns.ro/\" : \"http://stats.xdns.ro/\");
document.write(unescape(\"%3Cscript src='\" + pkBaseURL + \"piwik.js' type='text/javascript'%3E%3C/script%3E\"));
</script><script type=\"text/javascript\">
try {
var piwikTracker = Piwik.getTracker(pkBaseURL + \"piwik.php\", 4);
piwikTracker.trackPageView();
piwikTracker.enableLinkTracking();
} catch( err ) {}
</script><noscript><p><img src=\"http://stats.xdns.ro/piwik.php?idsite=4\" style=\"border:0\" alt=\"\"/></p></noscript>
<!-- End Piwik Tag -->\n
    </td></tr></table>\n
    </body></html>\n"
;
}

function 
stdmsg($heading$text)
{
    
$htmlout "<table class='main' width='750' border='0' cellpadding='0' cellspacing='0'>
    <tr><td class='embedded'>\n"
;
    
    if (
$heading)
      
$htmlout .= "<h2>$heading</h2>\n";
    
    
$htmlout .= "<table width='100%' border='1' cellspacing='0' cellpadding='10'><tr><td class='text'>\n";
    
$htmlout .= "{$text}</td></tr></table></td></tr></table>\n";
  
    return 
$htmlout;
}

function 
StatusBar() {

global $CURUSER$TBDEV$lang;

if (!$CURUSER)
return "<tr><td colspan='2'>Yeah Yeah!</td></tr>";


$upped mksize($CURUSER['uploaded']);

$downed mksize($CURUSER['downloaded']);

$ratio $CURUSER['downloaded'] > $CURUSER['uploaded']/$CURUSER['downloaded'] : 0;

$ratio number_format($ratio2);

$IsDonor '';
if ($CURUSER['donor'] == "yes")

$IsDonor "<img src='pic/star.gif' alt='donor' title='donor' />";


$warn '';
if ($CURUSER['warned'] == "yes")

$warn "<img src='pic/warned.gif' alt='warned' title='warned' />";

$res1 = @mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" $CURUSER["id"] . " AND unread='yes'") or sqlerr(__LINE__,__FILE__);

$arr1 mysql_fetch_row($res1);

$unread $arr1[0];

$inbox = ($unread == "$unread&nbsp;{$lang['gl_msg_singular']}"$unread&nbsp;{$lang['gl_msg_plural']}");


$res2 = @mysql_query("SELECT seeder, COUNT(*) AS pCount FROM peers WHERE userid=".$CURUSER['id']." GROUP BY seeder") or sqlerr(__LINE__,__FILE__);

$seedleech = array('yes' => '0''no' => '0');

while( $row mysql_fetch_assoc($res2) ) {
if($row['seeder'] == 'yes')
$seedleech['yes'] = $row['pCount'];
else
$seedleech['no'] = $row['pCount'];

}

/////////////// REP SYSTEM /////////////
//$CURUSER['reputation'] = 49;

$member_reputation get_reputation($CURUSER1);
////////////// REP SYSTEM END //////////

$StatusBar '';
$StatusBar "<tr>".

"<td colspan='2' style='padding: 2px;'>".

"<div id='statusbar'>".
"<div style='float:left;color:black;'>{$lang['gl_msg_welcome']}, <a href='userdetails.php?id={$CURUSER['id']}'>{$CURUSER['username']}</a>".
  
"$IsDonor$warn&nbsp; [<a href='logout.php'>{$lang['gl_logout']}</a>]&nbsp;$member_reputation
<br />
{$lang['gl_ratio']}:$ratio".
"&nbsp;&nbsp;{$lang['gl_uploaded']}:$upped".
"&nbsp;&nbsp;{$lang['gl_downloaded']}:$downed".

"&nbsp;&nbsp;{$lang['gl_act_torrents']}:&nbsp;<img alt='{$lang['gl_seed_torrents']}' title='{$lang['gl_seed_torrents']}' src='pic/arrowup.gif' />&nbsp;{$seedleech['yes']}".

"&nbsp;&nbsp;<img alt='{$lang['gl_leech_torrents']}' title='{$lang['gl_leech_torrents']}' src='pic/arrowdown.gif' />&nbsp;{$seedleech['no']}</div>".
    
"<div><p style='text-align:right;'>".date(DATE_RFC822)."<br />".

    
"<a href='messages.php'>$inbox</a></p></div>".
    
"</div></td></tr>";

return $StatusBar;

}

?>



This is the template.php
I'm at a lost the location of this part, coder's help me on this part :)

function get_template(){
        global $CURUSER, $TBDEV;
        if(isset($CURUSER)){
                if(file_exists("templates/".$CURUSER['stylesheet']."/template.php")){
                        require_once("templates/".$CURUSER['stylesheet']."/template.php");
                }else{
                        if(isset($TBDEV)){
                                if(file_exists("templates/".$TBDEV['stylesheet']."/template.php")){
                                        require_once("templates/".$TBDEV['stylesheet']."/template.php");
                                }else{
                                        print("Sorry, Templates do not seem to be working properly and missing some code. Please report this to the programmers/owners.");
                                }
                        }else{
                                if(file_exists("templates/1/template.php")){
                                        require_once("templates/1/template.php");
                                }else{
                                        print("Sorry, Templates do not seem to be working properly and missing some code. Please report this to the programmers/owners.");
                                }
                        }
                }
        }else{
                if(file_exists("templates/".$TBDEV['stylesheet']."/template.php")){
                        require_once("templates/".$TBDEV['stylesheet']."/template.php");
                }else{
                        print("Sorry, Templates do not seem to be working properly and missing some code. Please report this to the programmers/owners.");
                }
        }
        if(!function_exists("stdhead")){
                print("stdhead function missing");
                function stdhead($title="", $message=true){
                        return "<html><head><title>$title</title></head><body>";
                }
        }
        if(!function_exists("stdfoot")){
                print("stdfoot function missing");
                function stdfoot(){
                        return "</body></html>";
                }
        }
        if(!function_exists("stdmsg")){
                print("stdmgs function missing");
                function stdmsg($TITLE, $MSG){
                        return "<b>".$TITLE."</b><br />$MSG";
                }
        }
        if(!function_exists("StatusBar")){
                print("StatusBar function missing");
                function StatusBar(){
                        global $CURUSER, $lang;
                        return "{$lang['gl_msg_welcome']}, $CURUSER[username]";
                }
        }
}



This is the css for it, but you will need to purge the not needed


body {
        font-family: Verdana, Tahoma, Arial, "Trebuchet MS", Sans-Serif, Georgia, Courier, "Times New Roman", Serif;
        font-size: 8pt;
  background-color: #004E98;
  color: #000000;
  margin-top: 0px;
  margin-bottom: 0px;
}

img{
        border: 0; /* makes sure linked images do not have a border */
        vertical-align: middle;
}

#logostrip{
        background: #00326A url(/pic/tile_back.gif);
        border: 1px solid #FFF;
        height: 130px;
        margin: 0;
        padding: 0;
}

#submenu{
        border: 1px solid #FFF;
        border-top: 0;
        color: #3A4F6C;
        margin: 0;
        height: 22px;
        text-align: right;
}

.tb-top-left-link,
.tb-top-right-link
{
        float: right;
        font-size: 10px;
        font-weight: bold;
        letter-spacing: 0.5px;
        margin-top: 4px;
        width: auto;
}

.tb-top-left-link {
        float: left;
}

.forumtable
{
  width: 100%;
  margin: 0;
  padding: 0;
/*  font-family: Verdana, Arial, sans-serif; */
  font-size: 8pt;
  border: 1px solid #ccc;
  border-collapse: collapse;
  background-color: white;
}

#submenu a:link,
#submenu  a:visited,
#submenu a:hover,
#submenu a:active {
        background: #003977;
        border : 1px solid #FFF;
        color: #FFF;
        padding: 1px 3px 2px 4px;
        margin: 0px 1px 0px 2px;
        text-decoration:none;
}

#submenu a:hover,
#submenu a:active{
        background: #EA5F00;
}

/*
status bar style
*/
#statusbar{
        background: #E9D58F;
        border: 1px solid #CEAA49;
        margin: 5px 0 5px 0;
        padding: 0 5px 0 5px;
}

#statusbar p{
        background: transparent !important;
        border: 0 !important;
        font-size: 10px;
        font-weight: bold;
        letter-spacing: 1px;
        margin: 0 !important;
        padding: 3px 0 3px 0;
        text-align: right;
}

#statusbar p{
        font-weight: normal;
        letter-spacing: 0;
}

#statusbar p.home{
        float: left;
}
/*
status bar
*/

table {
  border-collapse: collapse;
  border: none;
   background-color: #ECE9D8;
}

table.main, table.mainouter {
  background-color: #F5F4EA;
}

table.bottom {
  background: transparent;
}

h1 {
  font-size: 12pt;
}

h2 {
  font-size: 10pt;
  margin-bottom: 6px;
}

h3 {
  font-size: 11pt;
  margin-bottom: 6px;
}

p {
        font-size: 8pt;
}

p.sub {
  margin-bottom: 4pt;
}You to get the corresponding css that goes with this, and you may also need to compare your stdhead and stdfoot in the bitrroent.php file

td {
        font-size: 8pt;
        border: solid #000000 1px;
}

td.embedded {
   border: none;
   padding: 0px;
  text-align: left;
}

td.bottom {
  border: none;
}

td.heading {
  font-weight: bold;
}

td.text {
  padding: 10pt;
  text-align: left;
}

td.comment {
  padding: 10pt;
  font-size: 8pt;
  text-align: left;
}

td.colhead {
  font-weight: bold;
  color: #ffffff;
  background-color: #0055A4;
}

td.rowhead {
  font-weight: bold;
  text-align: right;
  vertical-align: top;
}

td.title {
        font-size: 14pt;
}

td.navigation {
        font-weight: bold;
        font-size: 10pt;
   border: none;
}

td.clear {
  padding: 0px;
  border: 0px;
  background: transparent;
}

form {
        display: inline;
        margin-top: 0;
        margin-bottom: 0;
        padding: 0;
}

.sublink {
        font-style: italic;
        font-size: 7pt;
        font-weight: normal;
}

/*
pagination links start
*/
font.gray
{
  color: #ACA899;
  text-decoration: underline;
}

.pagelink,
.pagelinklast,
.pagecurrent,
.minipagecurrent,
.minipagelink,
.minipagelinklast{
        background: #F0F5FA;
        border: 1px solid #072A66;
        padding: 1px 3px 1px 3px;
}

.pagelinklast,
.minipagelinklast{
        background: #DFE6EF;
}

.pagecurrent{
        background: #FFC9A5;
}

.minipagecurrent{
        background: #F0F5FA;
        font-size: 10px;
}

.minipagelink,
.minipagelinklast{
        border: 1px solid #C2CFDF;
        font-size: 10px;
        margin: 0 1px 0 0;
}

.pagelink a:active,
.pagelink a:visited,
.pagelink a:link,
.pagelinklast a:active,
.pagelinklast a:visited,
.pagelinklast a:link,
.pagecurrent a:active,
.pagecurrent a:visited,
.pagecurrent a:link,
.minipagelink a:active,
.minipagelink a:visited,
.minipagelink a:link,
.minipagelinklast a:active,
.minipagelinklast a:visited,
.minipagelinklast a:link{
        text-decoration: none;
}
/*
pagination links end
*/

a:link, a:visited {
  text-decoration: none;
  color: #000000;
  /*font-weight: bold;*/
}

a:hover {
  color: #FF0000;
}

a.index {
        font-weight: bold;
}

a.biglink {
        font-weight: bold;
        font-size: 12pt;
}

a.altlink:link, a.altlink:visited{
        font-weight: bold;
        color: #A83838;
        text-decoration: none;
}

a.altlink:hover {
  text-decoration: underline;
}

a.altlink_blue:link, a.altlink_blue:visited{
        font-weight: bold;
        color: #004E98;
        text-decoration: none;
}

a.altlink_blue:hover {
  text-decoration: underline;
}

a.altlink_green:link, a.altlink_green:visited{
        font-weight: bold;
        color: #007800;
        text-decoration: none;
}

a.altlink_green:hover {
  text-decoration: underline;
}

a.colheadlink:link, a.colheadlink:visited {
   font-weight: bold;
   color: #FFFFFF;
   text-decoration: none;
}

a.colheadlink:hover {
   text-decoration: underline;
}

.important {
        font-weight: bold;
        font-size: 8pt;
}

.red {
        color: #ee0000;
}

.yellow {
        color: #997700;
}

.green {
        color: #000000;
}

input, select, textarea {
        background: #FFF;
        border: 1px solid #00326A;
        color: #000;
        font-family: verdana, helvetica, sans-serif;
        font-size: 11px;
        margin: 5px;
        padding: 2px;
        vertical-align: middle;
}

input:focus {
  background-color: #FFFF99;
}

textarea:focus {
  background-color: #FFFF99;
}

select
{
        margin: 0px;
}

.btn
{
   font-size:12px;
   font-family:Verdana,sans-serif;
   /* font-weight:bold; */
   color:#999999;
   background-color:#F0F5FA;
   border: 1px solid #072A66;
   border-width:1px;
   padding: 1px 3px 1px 3px;
}

.small {
  font-size: 7pt;
}

.big {
  font-size: 10pt;
}

li {
  margin-top: 6pt;
  margin-bottom: 6pt;
}

ul {
  margin-left: 16pt;
  margin-top: 0px;
  margin-bottom: 0px;
}


/*
Cpatcha/pin stuff
*/
.cimage
{
border: 1px solid #eee;
}

p#statusgreen
{
font-size: 1.2em; background-color: #fff; color: #0a0;
}

p#statusred
{
font-size: 1.2em; background-color: #fff; color: #a00;
}

.tag_cloud
{padding: 3px; text-decoration: none;
font-family: verdana;   
}
.tag_cloud:link  { color: #0099FF; text-decoration:none;
}
.tag_cloud:visited { color: #00CCFF;
}
.tag_cloud:hover { color: #0000FF; background: #00CCFF;
}
.tag_cloud:active { color: #0000FF; background: #FFFFFF;
}

.forumrules_title
{
  background-color: #7192b2;
        font-size: 14px;
        color: #fff;
        padding: 7px;
  margin-bottom: 4px;
}

.forumrules_border
{
  border:1px solid #e2e2e0;
  padding:4px;
}

.forumrules_text_border
{
  border:1px solid #e2e2e0;
  padding:4px;
}

.forumrules_text
{
  background-color: #FFFF99;
        font-size: 14px;
        color: #000;

}


.popupmenu
{
   background: #C2CFDF;
   color: #3A4F6C;
   border: 1px solid #3A4F6C;
   text-align:left;
   font-size:11px;
   font-weight:bold;
   white-space:nowrap;
   /*padding:3px 5px 3px 3px;*/
   /* width:120px; */
}

.popupmenu-item
{
        padding: 5px;
        /*margin-top:4px;*/
        white-space: nowrap;
        border-bottom: 1px solid #C2CFDF;
        color:  #000000;
        font-weight: normal;
}

.popupmenu-item-last
{
        padding: 5px;
        /*margin-top:4px;*/
        white-space: nowrap;
        color:  #000000;
        font-weight: normal;
}

.popupmenubutton
{
   background: #C2CFDF;
   color: #3A4F6C;
   border: 1px solid #3A4F6C;
   text-align:center;
   font-size:11px;
   font-weight:bold;
   white-space:nowrap;
   /*padding:3px 5px 3px 3px;*/
   height:18px;
   width:120px;
}

.popupmenu-item a:link,
.popupmenu-item a:visited,
.popupmenu-item-last a:link,
.popupmenu-item-last a:visited
{
        color: #000;
        text-decoration: none;
}

.popupmenu-item a:hover,
.popupmenu-item-last a:hover
{
        color: #EA5F00;
        text-decoration: none;
}



.tbi
{
        vertical-align:middle;
        border:0px;
        padding:0px;
        margin:0px;
        float:none;
}

.menusep
{
        white-space: nowrap;  /* stop menu collapsing in IE */
        padding-top:4px;
        padding-bottom:3px;
        border-bottom:1px solid #DDD;
}

.menuseplast
{
        white-space: nowrap; /* stop menu collapsing in IE */
        padding-top:4px;
        padding-bottom:3px;
        color: #000;
}

.menusep a:link,
.menusep a:visited,
.menusep a:active,
.menuseplast a:link,
.menuseplast a:visited,
.menuseplast a:active
{
        text-decoration:none;
        font-weight:bold;
        color: #000000;
}

.roundedCorners {
        border: 1px solid #000;
        -moz-border-radius: 6px;
        -webkit-border-radius: 6px;
}

.codetop {
    background: #0099FF url(../pic/bbcode/code.jpg) no-repeat right;
    color: #000;
    font-weight: bold;
    margin: 0 auto 0 auto;
    padding: 3px;
    border: 1px solid #000;
    width:500px;
}
.codemain {
    background: #FFF;
    border: 1px solid #000;
    color: #000;
    margin: 0 auto 0 auto;
    padding: 3px;
    width:500px;
    overflow:auto;
    height:150px;
}


themes.php admin tool i think, lol

<?php

if ( ! defined'IN_TBDEV_ADMIN' ) ){
        require(
"include/bittorrent.php");
        
$lang array_merge(load_language('ad_index'));
        print 
"<h1>{$lang['text_incorrect']}</h1>{$lang['text_cannot']}";
        exit();
}

require_once 
"include/user_functions.php";
 
    
$lang array_merge$langload_language('ad_themes') );
   
        
$HTML="";
       
        if(!
function_exists("html")){
                function 
html($VAL){
                        
//return htmlentities($VAL, ENT_QUOTES);
                        
return htmlspecialchars($VAL);
                }
        }
       
        if(isset(
$_GET['act'])){
                
$ACT=$_GET['act'];
                if(!
is_valid_id($ACT))stderr("{$lang['themes_error']}""{$lang['themes_inv_act']}");
                if(
$ACT==1){//--EDIT
                        
if(!isset($_GET['id']))stderr("{$lang['themes_error']}""{$lang['themes_inv_id']}");
                        
$ID=$_GET['id'];
                        if(!
is_valid_id($ID))stderr("{$lang['themes_error']}""{$lang['themes_inv_id']}");
                        
$TEMPLATE=mysql_query("SELECT * FROM stylesheets WHERE id=".sqlesc($ID)." LIMIT 1");
                        
$TEM=mysql_fetch_array($TEMPLATE);
                        
$HTML.="
                        <form action='
{$TBDEV['baseurl']}/admin.php?action=themes&amp;act=4' method='post'><input type='hidden' value='{$TEM['id']}' name='ori' /><table width='50%'>
                        <tr><td colspan='2' class='colhead' align='center'>
{$lang['themes_edit_tem']} $TEM[name]</td></tr>
                        <tr><td class='rowhead'>
{$lang['themes_id']}<br/>{$lang['themes_explain_id']}</td><td><input type='text' value='{$TEM['id']}' name='id' /></td></tr>
                        <tr><td class='rowhead'>
{$lang['themes_name']}</td><td><input type='text' value='{$TEM['name']}' name='title' /></td></tr>
                        <tr><td class='rowhead'>
{$lang['themes_is_folder']}</td><td>
                        <b>"
.(file_exists("templates/".$TEM['id']."/template.php")?"{$lang['themes_file_exists']}":"{$lang['themes_not_exists']}")."</b>
                        </td></tr>
                        <tr><td class='colhead' colspan='2' align='center'><input type='submit' value='
{$lang['themes_save']}' /></td></tr></table></form>
                        "
;
                }
                if(
$ACT==2){//--DELETE
                        
if(!isset($_GET['id']))stderr("{$lang['themes_error']}""{$lang['themes_inv_id']}");
                        
$ID=$_GET['id'];
                        if(!
is_valid_id($ID))stderr("{$lang['themes_error']}""{$lang['themes_inv_id']}");
                        
stderr("{$lang['themes_delete_q']}""{$lang['themes_delete_sure_q']}<a href='{$TBDEV['baseurl']}/admin.php?action=themes&amp;act=5&amp;id=$ID&amp;sure=1'>
                        
{$lang['themes_delete_sure_q2']}</a> {$lang['themes_delete_sure_q3']}");
                }
                if(
$ACT==3){//--ADD NEW
                        
$IDS=mysql_query("SELECT id FROM stylesheets");
                        while(
$ID=mysql_fetch_array($IDS)){
                                if(
file_exists("templates/".$ID['id']."/template.php"))$TAKEN[]="<font color='green'>$ID[id]</font>";
                                else 
$TAKEN[]="<font color='red'>$ID[id]</font>";
                        }
                        
$HTML.="
                        <form action='admin.php?action=themes&amp;act=6' method='post'>
                        <table width='50%'>
                        <tr><td class='colhead' colspan='2' align='center'>
{$lang['themes_addnew']}</td></tr>
                        <tr valign='middle'><td class='rowhead'>
{$lang['themes_id']}</td><td><input type='text' value='' name='id' /><br />
                        
{$lang['themes_takenids']}<b>".implode(", "$TAKEN)."</b></td></tr>
                        <tr valign='middle'><td class='rowhead'>
{$lang['themes_name']}</td><td><input type='text' value='' name='name' /></td></tr>
                        <tr><td colspan='2'>
{$lang['themes_guide']}</td></tr>
                        <tr><td class='colhead' colspan='2' align='center'><input type='submit' value='
{$lang['themes_add']}' /></td></tr>
                        </table>
                        </form>
                        "
;
                }
                if(
$ACT==4){//--SEVE EDIT
                        
if(!isset($_POST['id']))stderr("{$lang['themes_error']}""{$lang['themes_inv_id']}");
                        if(!isset(
$_POST['ori']))stderr("{$lang['themes_error']}""{$lang['themes_inv_id']}");
                        if(!isset(
$_POST['title']))stderr("{$lang['themes_error']}""{$lang['themes_inv_name']}");
                        
$ID=$_POST['id'];
                        
$ORI=$_POST['ori'];
                        
$NAME=$_POST['title'];
                        if(!
is_valid_id($ID))stderr("{$lang['themes_error']}""{$lang['themes_inv_id']}");
                        if(!
is_valid_id($ORI))stderr("{$lang['themes_error']}""{$lang['themes_inv_id']}");
                        
$CURRENT=mysql_query("SELECT * FROM stylesheets WHERE id=".sqlesc($ORI));
                        
$CUR=mysql_fetch_array($CURRENT);
                        if(
$ID!=$CUR['id'])$EDIT[]="id=".sqlesc($ID);
                        if(
$NAME!=$CUR['name'])$EDIT[]="name=".sqlesc($NAME);
                        if(!
mysql_query("UPDATE stylesheets SET ".implode(", "$EDIT)." WHERE id=".sqlesc($ORI)))stderr("{$lang['themes_error']}""{$lang['themes_some_wrong']}");
                        
header("Location: {$TBDEV['baseurl']}/admin.php?action=themes&msg=1");
                }
                if(
$ACT==5){//--DELETE FINAL
                        
if(!isset($_GET['id']))stderr("{$lang['themes_error']}""{$lang['themes_inv_id']}");
                        
$ID=$_GET['id'];
                        if(!
is_valid_id($ID))stderr("{$lang['themes_error']}""{$lang['themes_inv_id']}");
                        if(!isset(
$_POST['sure']))header("Location: admin.php?action=themes");
                        if(
$_POST['sure']!="1")header("Location: admin.php?action=themes");
                        
mysql_query("DELETE FROM stylesheets WHERE id=".sqlesc($ID));
                        
$RANDSTYLE=mysql_fetch_array(mysql_query("SELECT id FROM stylesheets ORDER BY RAND() LIMIT 1"));
                        
mysql_query("UPDATE users SET stylesheet=".sqlesc($RANDSTYLE['id'])." WHERE stylesheet=".sqlesc($ID));
                        
header("Location: {$TBDEV['baseurl']}/admin.php?action=themes&msg=2");
                }
                if(
$ACT==6){//--ADD NEW SAVE
                        
if(!isset($_POST['id']))stderr("{$lang['themes_error']}""{$lang['themes_inv_id']}");
                        if(!isset(
$_POST['name']))stderr("{$lang['themes_error']}""{$lang['themes_inv_name']}");
                        if(!
file_exists("templates/".$_POST['id']."/template.php"))stderr("{$lang['themes_nofile']}",
                        
"{$lang['themes_inv_file']}<a href='{$TBDEV['baseurl']}/admin.php?action=themes&amp;act=7&amp;amp;id=$_POST[id]&amp;name=$_POST[name]'>{$lang['themes_file_exists']}</a>/
                        <a href='
{$TBDEV['baseurl']}/admin.php?action=themes'>{$lang['themes_not_exists']}</a>");
                        @
mysql_query("INSERT INTO stylesheets(id, uri, name)VALUES(".sqlesc($_POST['id']).", '', ".sqlesc($_POST['name']).")");
                        
header("Location: {$TBDEV['baseurl']}/admin.php?action=themes&msg=3");
                }
                if(
$ACT==7){//--ADD NEW IF FOLDER NO EXISTS
                        
if(!isset($_GET['id']))stderr("{$lang['themes_error']}""{$lang['themes_inv_id']}");
                        if(!isset(
$_GET['name']))stderr("{$lang['themes_error']}""{$lang['themes_inv_name']}");
                        
$ID=$_GET['id'];
                        
$NAME=$_GET['name'];
                        @
mysql_query("INSERT INTO stylesheets(id, uri, name)VALUES(".sqlesc($ID).", '', ".sqlesc($NAME).")");
                        
header("Location: admin.php?action=themes&msg=3");
                }
        }
       
        if(isset(
$_GET['msg'])){
                
$MSG=$_GET['msg'];
                if(
$MSG>0)$HTML.="<h1>{$lang['themes_msg']}</h1>";
        }
       
        if(!isset(
$_GET['act'])){
                
$HTML.="<table width='100%'>
                <tr><td colspan='4'><a href='
{$TBDEV['baseurl']}/admin.php?action=themes&amp;act=3'><span class='btn'>{$lang['themes_addnew']}</span></a></td></tr>
                <tr>
                <td class='colhead'>
{$lang['themes_id']}</td>
                <td class='colhead'>
{$lang['themes_name']}</td>
                <td class='colhead'>
{$lang['themes_is_folder']}</td>
                <td class='colhead'>
{$lang['themes_e_d']}</td>
                </tr>"
;
               
                
$TEMPLATES=mysql_query("SELECT * FROM stylesheets");
                while(
$TE=mysql_fetch_array($TEMPLATES)){
                        
$HTML.="
                        <tr>
                        <td class='rowhead'>
$TE[id]</td>
                        <td>"
.html($TE['name'])."</td>
                        <td><b>"
.(file_exists("templates/".$TE['id']."/template.php")?"{$lang['themes_file_exists']}":"{$lang['themes_not_exists']}")."</b></td>
                        <td><a href='
{$TBDEV['baseurl']}/admin.php?action=themes&amp;act=1&amp;id=$TE[id]'>[{$lang['themes_edit']}]</a>
                        <a href='
{$TBDEV['baseurl']}/admin.php?action=themes&amp;act=2&amp;id=$TE[id]'>[{$lang['themes_delete']}]</a></td>
                        </tr>
                        "
;
                }
               
                
$HTML.="<tr><td class='colhead' colspan='4' align='center'>{$lang['themes_credits']}</td></tr></table>";
        }
   
    print 
stdhead("{$lang['stdhead_templates']}") . $HTML stdfoot();

?>



i Hope this help's
Sorry, I do not have IM, facebook or twitter accounts.

Ali

Quote from: Mindless on February 04, 2014, 06:04:52 PM
Provide more information, show us what you've edited and also show the final edited files, bring any error log information, no one can advise you until you do so.

All I have done is create template.php in root dir then pasted AronTH's theme system code into it. I don't know how to install the theme system is what I'm trying to say. :(

Mindless

Provide more information, show us what you've edited and also show the final edited files, bring any error log information, no one can advise you until you do so.

xe84

Quote from: Ali on February 04, 2014, 02:40:43 PM
Okay, so I got the theme system by AronTh. I create a .php file named template.php and paste the theme system code into it. What do I do now or am I doing it wrong? I'm so confused.

I am running TBDev 09, final release.

Hey Ali.

Iam sorey to say but you have posted in the wrong section. Heres is the correct section to post in:https://u-232-forum.duckdns.org/board,29.0.html
The BEST programming language in the world is the one you are currently using !!

Ali

Okay, so I got the theme system by AronTh. I create a .php file named template.php and paste the theme system code into it. What do I do now or am I doing it wrong? I'm so confused.

I am running TBDev 09, final release.