Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Mods & Themes (http://www.bvlist.com/forumdisplay.php?f=109)
-   -   TorrentStrike Themes System (http://www.bvlist.com/showthread.php?t=6925)

Fynnon 29th August 2011 19:23

TorrentStrike Themes System
 
attention

Attention


For TBDev 2009 - TorrentStrike themes on TBDev





1. open bittorrent.php and find:

PHP Code:

function stdhead($title = "", $msgalert = true) {
    global $CURUSER, $SITE_ONLINE, $FUNDS, $SITENAME, $pic_base_url;

  if (!$SITE_ONLINE)
    die("Site is down for maintenance, please check back again later... thanks");

    header("Content-Type: text/html; charset=iso-8859-1");
    //header("Pragma: No-cache");
    if ($title == "")
        $title = $SITENAME .(isset($_GET['tbv'])?" (".TBVERSION.")":'');
    else
        $title = $SITENAME .(isset($_GET['tbv'])?" (".TBVERSION.")":''). " :: " . htmlspecialchars($title);
  if ($CURUSER)
  {
    $ss_a = @mysql_fetch_array(@mysql_query("select uri from stylesheets where id=" . $CURUSER["stylesheet"]));
    if ($ss_a) $ss_uri = $ss_a["uri"];
  }
  if (!$ss_uri)
  {
    ($r = mysql_query("SELECT uri FROM stylesheets WHERE id=1")) or die(mysql_error());
    ($a = mysql_fetch_array($r)) or die(mysql_error());
    $ss_uri = $a["uri"];
  }
  if ($msgalert && $CURUSER)
  {
    $res = mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " && unread='yes'") or die("OopppsY!");
    $arr = mysql_fetch_row($res);
    $unread = $arr[0];
  }
?>
<html><head>
<title><?= $title ?></title>
<link rel="stylesheet" href="<?=$ss_uri?>" type="text/css">

<script type="text/javascript">

window.google_analytics_uacct = "UA-3186736-1";


</script>
</head>
<body>

<table width=100% cellspacing=0 cellpadding=0 style='background: transparent'>
<tr>
<td class=clear width=49%>
<!--
<table border=0 cellspacing=0 cellpadding=0 style='background: transparent'>
<tr>

<td class=clear>
<img src="<?=$pic_base_url?>star20.gif" style='margin-right: 10px'>
</td>
<td class=clear>
<font color=white><b>Current funds: <?=$FUNDS?></b></font>
</td>
</tr>
</table>
-->

</td>
<td class=clear>
<div align=center>
<img src="<?=$pic_base_url?>logo.gif" align=center>
</div>
</td>
<td class=clear width=49% align=right>
<a href=donate.php><img src="https://www.paypal.com/en_US/i/btn/x-click-but04.gif" border="0" alt="Make a donation" style='margin-top: 5px'></a>
</td>
</tr></table>
<?php

$w 
"width=100%";
//if ($_SERVER["REMOTE_ADDR"] == $_SERVER["SERVER_ADDR"]) $w = "width=984";

?>
<table class=mainouter <?=$w?> border="1" cellspacing="0" cellpadding="10">

<!------------- MENU ------------------------------------------------------------------------>

<? $fn substr($_SERVER['PHP_SELF'], strrpos($_SERVER['PHP_SELF'], "/") + 1); ?>
<tr><td class=outer align=center>
<table class=main width=700 cellspacing="0" cellpadding="5" border="0">
<tr>

<td align="center" class="navigation"><a href=index.php>Home</a></td>
<td align="center" class="navigation"><a href=browse.php>Browse</a></td>
<td align="center" class="navigation"><a href=search.php>Search</a></td>
<td align="center" class="navigation"><a href=upload.php>Upload</a></td>
<? if (!$CURUSER) { ?>
<td align="center" class="navigation">
<a href=login.php>Login</a> / <a href=signup.php>Signup</a>
</td>
<? } else { ?>
<td align="center" class="navigation"><a href=my.php>Profile</a></td>
<? ?>
<td align="center" class="navigation"><a href=chat.php>Chat</a></td>
<td align="center" class="navigation"><a href=forums.php>Forums</a></td>
<td align="center" class="navigation"><a href=misc/dox.php>DOX</a></td>
<td align="center" class="navigation"><a href=topten.php>Top 10</a></td>
<td align="center" class="navigation"><a href=log.php>Log</a></td>
<td align="center" class="navigation"><a href=rules.php>Rules</a></td>
<td align="center" class="navigation"><a href=faq.php>FAQ</a></td>
<td align="center" class="navigation"><a href=links.php>Links</a></td>
<td align="center" class="navigation"><a href=staff.php>Staff</a></td>
</tr>
</table>
</td>
</tr>
<tr><td align=center class=outer style="padding-top: 20px; padding-bottom: 20px">
<?

if ($unread)
{
  print(
"<p><table border=0 cellspacing=0 cellpadding=10 bgcolor=red><tr><td style='padding: 10px; background: red'>\n");
  print(
"<b><a href=inbox.php><font color=white>You have $unread new message" . ($unread "s" "") . "!</font></a></b>");
  print(
"</td></tr></table></p>\n");
}

// stdhead

function stdfoot() {
  global 
$pic_base_url;
  print(
"</td></tr></table>\n");
  print(
"<table class=bottom width=100% border=0 cellspacing=0 cellpadding=0><tr valign=top>\n");
  print(
"<td class=bottom align=left width=49%><img src=\"{$pic_base_url}bottom_left.gif\"></td><td width=49% align=right class=bottom><img src=\"{$pic_base_url}bottom_right.gif\"></td>\n");
  print(
"</tr></table>\n");
  print(
"
<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-3186736-1");
pageTracker._trackPageview();
} catch(err) {}
//-->
</script>
</body></html>\n");
}

replace it with this:

PHP Code:

function stdhead($title ""$msgalert true) {
    global 
$CURUSER$SITE_ONLINE$FUNDS$SITENAME$BASEURL;
    global 
$ss_uri;

  if (!
$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 $SITENAME .(isset($_GET['tbv'])?" (".TBVERSION.")":'');
    else
        
$title $SITENAME .(isset($_GET['tbv'])?" (".TBVERSION.")":''). " :: " htmlspecialchars($title);
  if (
$CURUSER)
  {
    
$ss_a = @mysql_fetch_array(@mysql_query("select uri from stylesheets where id=" $CURUSER["stylesheet"]));
    if (
$ss_a$ss_uri $ss_a["uri"];
  }
  if (!
$ss_uri)
  {
    (
$r mysql_query("SELECT uri FROM stylesheets WHERE id=1")) or die(mysql_error());
    (
$a mysql_fetch_array($r)) or die(mysql_error());
    
$ss_uri $a["uri"];
  }
  if (
$msgalert && $CURUSER)
  {
    
$res mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" $CURUSER["id"] . " && unread='yes'") or die("OopppsY!");
    
$arr mysql_fetch_row($res);
    
$unread $arr[0];
  }

  require_once 
"themes/".$ss_uri."/template.php";
  require_once(
"themes/" $ss_uri "/stdhead.php");

  if (
$unread)
  {
    print(
"<table border=\"0\" cellspacing=\"0\" cellpadding=\"10\"><tr><td style=\"padding: 10px; background: red\">\n");
    print(
"<b><a href=\"$BASEURL/messages.php?action=viewmailbox\"><font color=\"white\">You have $unread new message" . ($unread "s" "") . "!</font></a></b>");
    print(
"</td></tr></table>\n");
  }
  
////FOR TEMPORARY DEMOTION
   
if ($CURUSER['override_class'] != 255 && $CURUSER// Second condition needed so that this box isn't displayed for non members/logged out members.
 
{
  print(
"<table class=\"coltable\"><tr><td>\n");
  print(
"<b><a class=\"altlink\" href=\"$BASEURL/restoreclass.php\">You are running under a lower class. Click here to restore.</a></b>");
  print(
"</td></tr></table>\n");
 }

// stdhead

function stdfoot()
{
  global 
$CURUSER;
  global 
$ss_uri;

  if (
$CURUSER)
  {
    
$ss_a = @mysql_fetch_array(@mysql_query("select uri from stylesheets where id=" $CURUSER["stylesheet"]));
    if (
$ss_a$ss_uri $ss_a["uri"];
  }
  if (!
$ss_uri)
  {
    (
$r mysql_query("SELECT uri FROM stylesheets WHERE id=1")) or die(mysql_error());
    (
$a mysql_fetch_array($r)) or die(mysql_error());
    
$ss_uri $a["uri"];
  }

  require_once 
"themes/".$ss_uri."/template.php";
  require_once(
"themes/" $ss_uri "/stdfoot.php");


2. open /include/global.php and remove or /*code*/ out these functions:

PHP Code:

//-------- Begins a main frame

  
function begin_main_frame()
  {
    print(
"<table class=main width=750 border=0 cellspacing=0 cellpadding=0>" .
      
"<tr><td class=embedded>\n");
  }

  
//-------- Ends a main frame

  
function end_main_frame()
  {
    print(
"</td></tr></table>\n");
  }

  function 
begin_frame($caption ""$center false$padding 10)
  {
    
$tdextra "";
    
    if (
$caption)
      print(
"<h2>$caption</h2>\n");

    if (
$center)
      
$tdextra .= " align=center";

    print(
"<table width=100% border=1 cellspacing=0 cellpadding=$padding><tr><td$tdextra>\n");

  }

  function 
attach_frame($padding 10)
  {
    print(
"</td></tr><tr><td style='border-top: 0px'>\n");
  }

  function 
end_frame()
  {
    print(
"</td></tr></table>\n");
  }

  function 
begin_table($fullwidth false$padding 5)
  {
    
$width "";
    
    if (
$fullwidth)
      
$width .= " width=100%";
    print(
"<table class=main$width border=1 cellspacing=0 cellpadding=$padding>\n");
  }

  function 
end_table()
  {
    print(
"</td></tr></table>\n");
  }

  
//-------- Inserts a smilies frame
  //         (move to globals)

  
function insert_smilies_frame()
  {
    global 
$smilies$BASEURL$pic_base_url;

    
begin_frame("Smilies"true);

    
begin_table(false5);

    print(
"<tr><td class=colhead>Type...</td><td class=colhead>To make a...</td></tr>\n");

    while (list(
$code$url) = each($smilies))
      print(
"<tr><td>$code</td><td><img src=\"{$pic_base_url}smilies/{$url}></td>\n");

    
end_table();

    
end_frame();
  } 

3. drop the stylesheets table and add this table

PHP Code:

CREATE TABLE stylesheets (
  
id int(10unsigned NOT NULL auto_increment,
  
uri varchar(255NOT NULL default '',
  
name varchar(64NOT NULL default '',
  
PRIMARY KEY  (id)
TYPE=MyISAM

then add these (you can add any of below if you dont want all 3 but make sure to make your default theme id 1 )
PHP Code:

INSERT INTO stylesheets VALUES (1,'ICGstation','ICGstation theme');
INSERT INTO stylesheets VALUES (2,'default','(default)');
INSERT INTO stylesheets VALUES (3,'large','Large text'); 

4. create a folder in your root and call it "themes", copy the themes in there and then edit the links to your inbox, etc



5. (optional) make a folder in your themes folder and call it whatever you like then make the following files in the folder you just created

stdhead.php <-- becomes the top part of your theme
stdfoot.php <-- becomes the bottom part of your theme
template.php <-- deals with all the begin_table(); , end_table(); layouts
YOURthemename.css <-- you know this 1 :P

now you will have to take bits from your bittorrents "OLD" stdhead function and add it into your stdhead.php and same goes for the "OLD" stdfoot function but that goes in your stdfoot.php

any theme you make ID 1 from within your stylesheets table will become the default theme and the ID 2 will become a sellectable theme etc


tornado2003@tbdev.net/topic/14878-theme

TheLegend88 20th September 2012 01:15

Question
 
Hy!How can I make this theme engine work on the latest tbdev 2009 source?
I cannot find global.php and when I install the theme engine i recive an error message that say "Site is down for maintenance, please check back again later... thanks":sos:

cippxb 24th August 2013 12:17

Same problem.
 
I cannot find "global.php" in "include" folder . :sos:

Krypto 24th August 2013 15:27

This will not work on TBDev 09 unless you make a number of changes to it.

A theme system was made for '09 and it maybe posted on here or you may find a copy on U-232 Forums?

Also your first post should have been an Introduction in the appropriate forum.


All times are GMT +2. The time now is 00:51.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.