Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   BT.Manager (phpMyBitTorrent) (http://www.bvlist.com/forumdisplay.php?f=23)
-   -   Tutorial On creating a theme For phpMyBitTorrent (http://www.bvlist.com/showthread.php?t=4343)

joeroberts 28th January 2010 10:49

Tutorial On creating a theme For phpMyBitTorrent
 
8 Attachment(s)
First and foremost you well need a good working nolige of PHP!

The theme for PMBT is the complete layout of your site so you well want to
Be very careful when doing it.
The far easiest way is to take copy the content of a theme that is laid out the way you already want yours but you want deffrent Images and colors.

phpMyBitTorrent theme's are laid out fairly easy you have 19 separate function

OpenTable()
CloseTable()
OpenTable2()
CloseTable2()
OpenNewsTable()
CloseNewsTable()
OpenMessTable()
CloseMessTable()
OpenSuccTable()
CloseSuccTable()
OpenErrTable()
CloseErrTable()
newuserpage()
themeheader()
themefooter()
overlib_init()
help()


Optional are

themechange()
languagechange()


We well take Vista theme as our example theme

The two Most changed are themeheader and themefooter these to are seen on ever page

Attachment 2059

themeheader is the top of your web site down the left side and you left collom if you want one.

Attachment 2060

themefooter is the bottom of your web site the right side and your right colom if you want one

Your second most changes is OpenTable and CloseTable these 2 are seen on every page

OpenTable is the top and left side of your blocks

Attachment 2061

CloseTable are the bottom and right side of your blocks

Attachment 2062

then you have your special tables

OpenTable2 CloseTable2

Attachment 2066

OpenSuccTable CloseSuccTable

Attachment 2065

OpenMessTable CloseMessTable

Attachment 2064

OpenErrTable CloseErrTable

Attachment 2063

overlib_init is your java scripts
Help is your popup bubble(help tips)

underx 28th January 2010 13:37

thank you very much for those instructions !

joeroberts 28th January 2010 19:07

Creating function themeheader()

This is the first peace that you your browser the world see's

This is a Function so You well want to make sure you retrieve all global variables
PHP Code:

global $db$db_prefix$theme$siteurl$user$upload_level$sitename$gfx_check$donations$INVITEONLY,$onlysearch$shout_config$pivate_mode$forumshare$PHP_SELF

the most IMPORTANT are
$db
$db_prefix
$user

Those are Your data base connection Class and Data Base Prefix.
You well not need to make any further data base connection so If you can't figure out $db class But you know simple mysql you can still do this
I wont get in to $db class at this time or mysql .

Now your going to want to set users online this is Not all that Hard
PHP Code:

if ($user->user) {
        
//Update online user list
        
$pagename substr($_SERVER["PHP_SELF"],strrpos($_SERVER["PHP_SELF"],"/")+1);
        
$sqlupdate "UPDATE ".$db_prefix."_online_users SET page = '".addslashes($pagename)."', last_action = NOW() WHERE id = ".$user->id.";";
        
$sqlinsert "INSERT INTO ".$db_prefix."_online_users VALUES ('".$user->id."','".addslashes($pagename)."', NOW(), NOW())";
        
$res $db->sql_query($sqlupdate);
        if (!
$db->sql_affectedrows($res)) $db->sql_query($sqlinsert);


If you use a hard language and need to set Charset I would say set a header
header("Content-Type: text/html; charset=UTF-8");

after this you can start you html coding
first you well want to set your webcoding
HTML Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
This tells Most browser what type of information to expect and is the first line it reads
Now you want to set your
HTML Code:

<html>
followed by
HTML Code:

<head></head>
this is where you set your
style sheets
java scripts
meta tag
if You want a favacon (this is the little image beside your address bar in your browser)
this is also where it is set
here is an example
PHP Code:

echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
echo "<html>\n";
echo "<head>\n";
echo "<meta name='keywords' content='Jungle-Pieates, http://www.jungle-pirates.com/, joeroberts' >\n
<meta name=\"MSSmartTagsPreventParsing\" content=\"TRUE\" >\n
<meta http-equiv=\"Content-Language\" content=\"en-us\" >\n
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\" >\n";
echo "<meta name=\"generator\" content=\"PMBT 2.0.2\" >\n";
echo "<meta http-equiv=\"Pragma\" content=\"no-cache\" >\n";
echo "<meta http-equiv=\"Expires\" content=\"-1\" >\n";
echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" >\n";
echo "<script defer type=\"text/javascript\" src=\"".$siteurl."pngfix.js\"></script>";
echo "<title>".$sitename."</title>\n";
if (is_readable("themes/$theme/favicon.ico")) {
        echo "<link REL=\"shortcut icon\" HREF=\"themes/".$theme."/favicon.ico\" TYPE=\"image/x-icon\">\n";
}

?>
<script type="text/javascript">
pmbtsite_url = "<?php echo $siteurl?>";
tag_prompt = "<?php echo _bb_tag_prompt?>";
img_prompt = "<?php echo _bb_img_prompt?>";
font_formatter_prompt = "<?php echo _bb_font_formatter_prompt?>";
link_text_prompt = "<?php echo _bb_link_text_prompt?>";
link_url_prompt = "<?php echo _bb_link_url_prompt?>";
link_email_prompt = "<?php echo _bb_link_email_prompt?>";
list_type_prompt = "<?php echo _bb_list_type_prompt?>";
list_item_prompt = "<?php echo _bb_list_item_prompt?>";
_btshoutnowprivate = "<?php echo _btshoutnowprivate?>";
shoutrefresht = "<?php echo $shout_config['refresh_time']; ?>";
shoutidle = "<?php echo $shout_config['idle_time']; ?>";
</script>
<?php
if (!$onlysearch) {
        echo 
"<link rel=\"alternate\" type=\"application/rss+xml\" title=\"Last Torrents\" href=\"backend.php?op=last\">\n";
        echo 
"<link rel=\"alternate\" type=\"application/rss+xml\" title=\"Best Torrents\" href=\"backend.php?op=best\">\n";
}


if (
is_readable("themes/$theme/style.css")) {
        echo 
"<link rel=\"StyleSheet\" href=\"$siteurl/themes/$theme/style.css\" type=\"text/css\">\n<script type=\"text/javascript\" src=\"$siteurl/global.js\"></script>\n";
}
overlib_init();

echo 
"</head>\n\n";

remember this
PHP Code:

?>
<script type="text/javascript">
pmbtsite_url = "<?php echo $siteurl?>";
tag_prompt = "<?php echo _bb_tag_prompt?>";
img_prompt = "<?php echo _bb_img_prompt?>";
font_formatter_prompt = "<?php echo _bb_font_formatter_prompt?>";
link_text_prompt = "<?php echo _bb_link_text_prompt?>";
link_url_prompt = "<?php echo _bb_link_url_prompt?>";
link_email_prompt = "<?php echo _bb_link_email_prompt?>";
list_type_prompt = "<?php echo _bb_list_type_prompt?>";
list_item_prompt = "<?php echo _bb_list_item_prompt?>";
_btshoutnowprivate = "<?php echo _btshoutnowprivate?>";
shoutrefresht = "<?php echo $shout_config['refresh_time']; ?>";
shoutidle = "<?php echo $shout_config['idle_time']; ?>";
</script>
<?php

Is your java info for shoutbox text editor and auto matic PM checker POPUP
Now We can start the
HTML Code:

<body>
this is the layout of your site
It can be as semple as a /

this is a little tricky because this is where you figure out if you want
1 main layout
a left collom and a Main collom
a left collom center and right collom
you well also set your header here and tab bar if wanted
simple way is a plain table system
for your header and menu do
HTML Code:

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr><td><img src="imagelink.png"></td></tr>
<tr><td>your nav bar code</td></tr>
</table>


Now do you want 3 rows?
sample for left collom at 25% of the page
HTML Code:

<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr><td {{you might want to set width here}}width="25%">
your coding for your left collom</td>

sample of Center at 50% of the page
HTML Code:

<td width="50%">
this is where you page is added (index.php torrents.php pm.php) you can put codes here witch show above theses pages such as a add link or what not

do Not close this
as it well be closed in the themefooter that I well cover later on.

to sum up we just created a semple page layout with a header nav bar your left collom and center page
Attachment 2059

underx 6th February 2010 18:17

hey joe :)
have some quesions:

1/ I try to change the nav container a little bit but I don't find where !!
I want to remove that gray color and edit text color too

http://i47.tinypic.com/16734hl.jpg

2/ also I want to move menu and the categories bloacks from the right to the top (just after the nav container) ! In one word I want to make those 2 bloks horizontally at the top !

hope u understand me :)
thks

joeroberts 6th February 2010 18:32

in default PMBT theme this is the nav bar
PHP Code:

        echo "<div id=\"navcontainer\" align=\"center\">
                <ul id=\"navlist\">\n"
;
                    echo(
preg_match("/index.php/",$_SERVER["PHP_SELF"])) ? "<li id=\"active\"><a id=\"current\" >Home</a>":"<li><a href=\"index.php\">Home</a></li>";
                    echo(
preg_match("/torrents.php/",$_SERVER["PHP_SELF"])) ? "<li id=\"active\"><a id=\"current\" >Torrents</a>":"<li><a href=\"torrents.php\">Torrents</a></li>";
                    if(
$forumshare)echo(preg_match("/phpBB.php/",$_SERVER["PHP_SELF"])) ? "<li id=\"active\"><a id=\"current\">Forums</a></li>":"<li><a href=\"phpBB.php\">Forums</a></li>";
                    echo(
preg_match("/chat.php/",$_SERVER["PHP_SELF"])) ? "<li id=\"active\"><a id=\"current\" >Chat</a></li>":"<li><a href=\"chat.php\">Chat</a></li>";
                    if(
$user->user)echo(preg_match("/user.php/",$_SERVER["PHP_SELF"])) ? "<li id=\"active\"><a id=\"current\" href=\"user.php?op=profile&id=" $user->id ."\">My Profile</a></li>":"<li><a href=\"user.php?op=profile&id=" $user->id ."\">My Profile</a></li>";
                    echo(
preg_match("/donate.php/",$_SERVER["PHP_SELF"])) ? "<li id=\"active\"><a id=\"current\"  onClick=\"javascript:urchinTracker ('/donate/navbar');\">Donate<span style='margin-left: 4px; vertical-align: super; color:#AA0000; font-family:sans-serif; font-weight: bolder; font-size: 6pt;'>NOW</span></a></li>":"<li><a href=\"donate.php\" onClick=\"javascript:urchinTracker ('/donate/navbar');\">Donate<span style='margin-left: 4px; vertical-align: super; color:#AA0000; font-family:sans-serif; font-weight: bolder; font-size: 6pt;'>NOW</span></a></li>";
                    if((
$user->user OR $upload_level == "all"))echo(preg_match("/upload.php/",$_SERVER["PHP_SELF"])) ? "<li id=\"active\"><a id=\"current\" href=\"upload.php\">Upload</a></li>":"<li><a href=\"upload.php\">Upload</a></li>";
                    if(
$user->user)echo(preg_match("/memberslist.php/",$_SERVER["PHP_SELF"])) ? "<li id=\"active\"><a id=\"current\" >Members</a></li>":"<li><a href=\"memberslist.php\">Members</a></li>";
                    if(
$user->user)echo(preg_match("/helpdesk.php/",$_SERVER["PHP_SELF"])) ? "<li id=\"active\"><a id=\"current\" >Help Desk</a></li>":"<li><a href=\"helpdesk.php\">Help Desk</a></li>";

                echo 
"</ul> 

to change the BG color of the tabs you need to edit css
this
Code:

#navlist li a {
padding : 3px 0.5em;
margin-left : 3px;
border : 1px solid #778;
border-bottom : none;
background : #d2d2d2;
text-decoration : none;
}

is the tabs
and
Code:

background : #d2d2d2;
sets the color
as for the others I well work on it as you well need to rewrite the 2 blocks.

pwnage 8th February 2010 01:33

I seen in your forums page on ur site u got 1px line for ur tables how do u do that i tryd doin the table border=1 and all that help pleaaase

joeroberts 8th February 2010 01:36

on what tables?

pwnage 8th February 2010 01:37

1 Attachment(s)
Quote:

Originally Posted by joeroberts (Post 20624)
on what tables?

i want it for all tables that lists stuff like...
Browse, the search, recent 10 uploaded

DAKz 13th June 2011 06:04

Very good stuff!!
 
I follow this guys postings here and at the phpMyBit Torrent forum site, and find that he is accurate, understanding and very good. Thanks for the effort you put in and all the knowledge you share with all of us!!


All times are GMT +2. The time now is 16:35.

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