Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   BT.Manager (phpMyBitTorrent) (http://www.bvlist.com/forumdisplay.php?f=23)
-   -   How to add javascript menu to my site? (http://www.bvlist.com/showthread.php?t=5066)

Giorgatzelos 11th June 2010 15:08

How to add javascript menu to my site?
 
2 Attachment(s)
I modded the following "affiliates" javascript menu, so that i enter it to my pmbt site.what should i do?


And something more...how can i make stay always at that point ont the screen?
-------------------------------------------------------------------------------------
This is may main.php
-------------------------------------------------------------------------------------
[php] if (eregi("main.php",$_SERVER["PHP_SELF"])) die ("You can't access this file directly");

$tableopen = false;
$errtableopen = false;
$table2open = false;
$btback1 = "c0c0c0";
$btback2 = "acd2ef";
$btback3 = "3ca22e";


function OpenTable($title = "title", $tablewidth = "") {
global $tableopen, $siteurl;
if ($tableopen) return;
if($tablewidth !="") $stylewidth = "style=\"width: ".$tablewidth."px;\"";
else $stylewidth = '';
echo "
";
echo "".$title."
";

$tableopen = true;
}

function CloseTable() {
global $tableopen, $siteurl;
if (!$tableopen) return;
echo "
";

$tableopen = false;
}

function OpenTable2($title = "") {
global $tableopen2, $siteurl;
if ($tableopen2) return;
echo "
";
echo "".$title."
";

$tableopen2 = true;
}

function CloseTable2() {
global $tableopen2, $siteurl;
if (!$tableopen2) return;
echo "
";

$tableopen2 = false;
}

function OpenNewsTable($title = "") {
global $OpenNewsTable, $siteurl;
if ($OpenNewsTable) return;
echo "
";

$OpenNewsTable = true;
}

function CloseNewsTable() {
global $OpenNewsTable, $siteurl;
if (!OpenNewsTable) return;
echo "
";

$OpenNewsTable = false;
}

function OpenMessTable($title = "") {
global $OpenMessTable, $siteurl;
if ($OpenMessTable) return;
echo "
";
echo "".$title."";

$OpenMessTable = true;
}

function CloseMessTable() {
global $OpenMessTable, $siteurl;
if (!$OpenMessTable) return;
echo "
";

$OpenMessTable = false;
}

function OpenSuccTable($title = "") {
global $OpenSuccTable, $siteurl;
if ($OpenSuccTable) return;
echo "
";
echo "".$title."";

$OpenSuccTable = true;
}

function CloseSuccTable() {
global $OpenSuccTable, $siteurl;
if (!$OpenSuccTable) return;
echo "
";

$OpenSuccTable = false;
}
function OpenErrTable($title) {
global $OpenErrTable, $siteurl;
if ($OpenErrTable) return;
echo "
";
echo "".$title."";

$OpenErrTable = true;
}

function CloseErrTable() {
global $OpenErrTable, $siteurl;
if (!$OpenErrTable) return;
echo "
";

$OpenErrTable = false;
}
function themechange(){
{
global $bttheme;
$themes = Array();
$thememaindir = "themes";
$themehandle = opendir($thememaindir);
while ($themedir = readdir($themehandle)) {
if (is_dir($thememaindir."/".$themedir) AND $themedir != "." AND $themedir != ".." AND $themedir != "CVS")
$themes[$themedir] = $themedir;
}
closedir($themehandle);
unset($thememaindir,$themedir);
}
$change = '';
foreach ($themes as $key=>$val) {
$change .= "\n";
}
unset($themes);
return $change;
}
function languagechange(){
{
global $language;
$languages = Array();
$langdir = "language";
$langhandle = opendir($langdir);
while ($langfile = readdir($langhandle)) {
if (eregi("\.php$",$langfile) AND strtolower($langfile) != "mailtexts.php")
$languages[str_replace(".php","",$langfile)] = ucwords(str_replace(".php","",$langfile));
}
closedir($langhandle);
unset($langdir,$langfile);
}
$change = '';
foreach ($languages as $key=>$val) {
$change .="\n";
}
unset($languages);
return $change;
}

function themeheader() {
global $db, $db_prefix, $theme, $siteurl, $user, $upload_level, $sitename, $gfx_check, $donations, $INVITEONLY,$onlysearch, $pivate_mode;

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);
}
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "\n";
echo "";
echo "".$sitename."\n";
?>

if (is_readable("themes/$theme/favicon.png")) {
echo "\n";
}

if (!$onlysearch) {
echo "\n";
echo "\n";
}


if (is_readable("themes/$theme/style.css")) {
echo "\n\n";
}
overlib_init();

echo "\n\n";


$themepage = false;
?>
if($user->user)echo "\n";
else
echo "";
echo"\n";
echo "
\n";
echo "
\n";
echo'



';
?>






echo "\n";
function newuserpage($page)
{
if(eregi("faq.php",$page))return true;
if(eregi("rules.php",$page))return true;
if(eregi("user.php",$page))return true;
if(eregi("takeconfirminvite.php",$page))return true;
if(eregi("confirminvite.php",$page))return true;
return false;
}
if($pivate_mode AND !$user->user AND !newuserpage($_SERVER["PHP_SELF"])){
loginrequired("user", false);
include'footer.php';
echo "
\n";
echo "\n";
echo "
\n";
}
//echo "";
$reason = "";
if (is_banned($user, $reason)) {
echo "

\n";
echo "

\n";
echo "

".str_replace("**reason**",htmlspecialchars($reason),_btbannedmsg)."

\n";
echo "

\n";
echo "

\n";
include("footer.php");
die();
}

$has_newpm = false;
$sql = "SELECT id FROM ".$db_prefix."_private_messages WHERE recipient = '".$user->id."' AND is_read = 'false' LIMIT 1;";
$res = $db->sql_query($sql) or btsqlerror($sql);
$has_newpm = ($db->sql_numrows($res) > 0) ? true : false;
$db->sql_freeresult($res);
if ($has_newpm)
{
echo "";

}

echo "\n";
echo "\n";
echo "\n";
echo "";
echo"";
}
echo'

\n";
echo "
";
if(!eregi("phpBB.php",$_SERVER["PHP_SELF"]))
{
if ($donations){
include("./blocks/donation_block.php");
}
//include("blocks/shoutbox.php");

}
echo "
\n";
echo "
";
$sql_profile = "SELECT * FROM ".$db_prefix."_users where id = '".$user->id."' ;";
$res_profile = $db->sql_query($sql_profile);
$userrow = $db->sql_fetchrow($res_profile);
$db->sql_freeresult($res_profile);
// WARN things START
if ($user->user) {
if ($user->downloaded > 0){
include ("./ratiowarn.php");
}
}
if ($userrow["warned"])
{
$warn_kapta = $userrow["warn_kapta"];
$warn_hossz = $userrow["warn_hossz"];
$modcomment = $userrow["modcomment"];

if ($warn_hossz != -1) {
$warn = $warn_kapta + $warn_hossz;
$time_now = strtotime(gmdate("Y-m-d H:i:s", time()));
if ($warn < $time_now)
{
$modcomment = "[ " . gmdate("Y-m-d H:i:s", time()) . " - WARN time expired ]\n" . $modcomment;
$msg = ("Your WARN time expired, so we deleted it!");
@$db->sql_query("INSERT INTO ".$db_prefix."_private_messages (sender, recipient, subject, text, sent) VALUES(1, " .$user->id. ",'WARNING' '" . $msg ."', NOW())") or die(mysql_error());
$modcomment = $modcomment;
$frissites = $db->sql_query("UPDATE ".$db_prefix."_users SET modcomment=$modcomment, warned='0', warn_kapta='0', warn_hossz='0' WHERE id='".$user->id."'") or die(mysql_error());
}
}
}
// WARN things END
//////////////////// Kommentera modd ////////////////////////
$res = $db->sql_query("SELECT torrent FROM ".$db_prefix."_peers WHERE uid='".$user->id."'")or print(mysql_error());
while($row = $db->sql_fetchrow($res)){
$kom = $db->sql_fetchrow( $db->sql_query("SELECT count(*) FROM ".$db_prefix."_comments WHERE user= '".$user->id."' AND torrent='$row[torrent]'"))or print(mysql_error());
$tor = $db->sql_fetchrow( $db->sql_query("SELECT name,owner FROM ".$db_prefix."_torrents WHERE id='$row[torrent]'"))or print(mysql_error());
if(!$kom[0] && $tor[owner] != $user->id){
$komment .= "".$tor[name]."
";
}
}
/////////////////////////////////////////////////////////////
if ($user->user) {
if ($komment){
print("

\n");
print("Please leave a comment on:
$komment");
print("

\n");
}
}
}

function overlib_init() {
echo "\n";
echo "\n";
}
function themefooter(){
global $startpagetime;
if(!eregi("phpBB.php",$_SERVER["PHP_SELF"])){
echo"
";
echo"


joeroberts 12th June 2010 06:12

You want this only on index or all pages?

Giorgatzelos 12th June 2010 11:39

Quote:

Originally Posted by joeroberts (Post 23454)
You want this only on index or all pages?


Of course, i want it to be shown on all pages...any ideas?

joeroberts 12th June 2010 14:03

like on here http://guv2.com/pmbt2/index.php on the evo_blue theme?

Giorgatzelos 12th June 2010 15:30

Quote:

Originally Posted by joeroberts (Post 23460)
like on here http://guv2.com/pmbt2/index.php on the evo_blue theme?


Yes! Just like That...but how can it stay at the same point of the screen, no matter how much you scroll down or up?...and the links are smaller than they show at my script...aren't they?

joeroberts 13th June 2010 09:19

In your theme main.php find
PHP Code:

include("./blocks/usercp.php"); 

and add after
PHP Code:

echo '<div id="sideBar">';
echo 
'<a id="sideBarTab"><img src="http://guv2.com/pmbt2/images/slide-button.gif" alt="sideBar" title="sideBar" /></a>';
echo 
'<div id="sideBarContents" style="width:0px;">';
echo 
'<div id="sideBarContentsInner">';
echo 
'<h2 align="center">&nbsp;</h2>';
echo 
'<ul>';
echo 
'<li><a href="http://www.animeclipse.com">AnimeClipse</a></li>';
echo 
'<li><a href="http://www.omega-team.eu">Omega Team</a></li>';
echo 
'<li><a href="http://www.anime-greek.com">Anime-Greek</a></li>';
echo 
'<li><a href="http://animearth.com">Animearth</a></li>';
echo 
'<li><a href="http://seikisubs.blogspot.com">Seiki Subs</a></li>';
echo 
'<li><a href="http://eternallightsubs.niceboard.net/portal.htm">Eternal Light Subs</a></li>';
echo 
'<li><a href="http://www.ss-anime.info">SS-Anime</a></li>';
echo 
'<li><a href="http://www.tzatziki-fansubs.com">TzaTziki Fansub</a></li>';
echo 
'<li><a href="http://www.onepiecegr-rpg.com">OnePieceGr</a></li>';
echo 
'<li><a href="http://www.animefiury.com">AnimeFiury</a></li>';
echo 
'<li><a href="http://taka-greece.blogspot.com">Taka Greece</a></li>';
echo 
'<li><a href="http://www.ookami-fansubs.com">Okami Fansubs</a></li>';
echo 
'</ul>';
echo 
'</div>';
echo 
'</div>';
echo 
'</div>'

Now find
PHP Code:

function overlib_init() {
        echo 
"<script type=\"text/javascript\" src=\"overlib/overlib.js\"><!-- overLIB (c) Erik Bosrup --></script>\n";
        echo 
"<script type=\"text/javascript\" src=\"overlib/overlib_shadow.js\"><!-- overLIB (c) Erik Bosrup --></script>\n"

and add after
PHP Code:

        echo "<script type=\"text/javascript\" src=\"js/mootools.js\"></script>\n";
        echo 
"<script type=\"text/javascript\" src=\"js/side-bar.js\"></script>\n"

and add to your css file
Code:

h2{
    color:#666666;
    font-size:90%;
    font-family:arial;
    margin:10px 10px 10px 10px;
    font-weight:bold;
    }
   
    h2 span{
        font-size:105%;
        font-weight:normal;
    }
   
    ul{
        margin:0px 0px 0px 0px;
        padding:0px 0px 0px 0px;
    }
   
    li{
    margin:0px 0px 1px 30px;
    padding:2px;
    list-style-type:none;
    display:block;
    width:102px;
    background-color: #cccccc;
    }
   
    li a{
        width:100%;
    }
   
    li a:link,
    li a:visited{
    color:#2EB4F3;
    font-family:verdana;
    font-size:70%;
    text-decoration:none;
    display:block;
    margin:0px 0px 0px 0px;
    padding:0px;
    width:100%;
    }
   
    li a:hover{
    color:#666666;
    text-decoration:inherit;
    background-color: #CCCCCC;
    }
   
    #sideBar{
    position: absolute;
    width: auto;
    height: 350px;
    top: 200px;
    right:-7px;
    background-image:url(pics/test2.png);
    background-position:top left;
    background-repeat:no-repeat;
    }
   
    #sideBarTab{
    float:left;
    height:0px;
    width:28px;
    }
   
    #sideBarTab img{
    border:0px solid #FFFFFF;
    }
   
    #sideBarContents{
    overflow:hidden !important;
    }
   
    #sideBarContentsInner{
        width:127px;
    }

make sure you add the images to your pics folder of your theme
and Im not sure on the making it stay localized.

Giorgatzelos 13th June 2010 15:43

Finally i made it by entering what you sai but a little bit modded.

In my theme main.php found

PHP Code:

include("./blocks/usercp.php"); 


and added after
PHP Code:

echo '<div id="sideBar">'
echo 
'<a id="sideBarTab"><img src="themes/archeCtypo/images/slide-button.png" alt="sideBar" title="sideBar" /></a>'
echo 
'<div id="sideBarContents" style="width:0px;">'
echo 
'<div id="sideBarContentsInner">'
echo 
'<h2 align="center">&nbsp;</h2>'
echo 
'<ul>'
echo 
'<li><a href="http://www.animeclipse.com">AnimeClipse</a></li>'
echo 
'<li><a href="http://www.omega-team.eu">Omega Team</a></li>'
echo 
'<li><a href="http://www.anime-greek.com">Anime-Greek</a></li>'
echo 
'<li><a href="http://animearth.com">Animearth</a></li>'
echo 
'<li><a href="http://seikisubs.blogspot.com">Seiki Subs</a></li>'
echo 
'<li><a href="http://eternallightsubs.niceboard.net/portal.htm">Eternal Light Subs</a></li>'
echo 
'<li><a href="http://www.ss-anime.info">SS-Anime</a></li>'
echo 
'<li><a href="http://www.tzatziki-fansubs.com">TzaTziki Fansub</a></li>'
echo 
'<li><a href="http://www.onepiecegr-rpg.com">OnePieceGr</a></li>'
echo 
'<li><a href="http://www.animefiury.com">AnimeFiury</a></li>'
echo 
'<li><a href="http://taka-greece.blogspot.com">Taka Greece</a></li>'
echo 
'<li><a href="http://www.ookami-fansubs.com">Okami Fansubs</a></li>'
echo 
'</ul>'
echo 
'</div>'
echo 
'</div>'
echo 
'</div>'

Found:

PHP Code:

function overlib_init() { 
        echo 
"<script type=\"text/javascript\" src=\"overlib/overlib.js\"><!-- overLIB (c) Erik Bosrup --></script>\n"
        echo 
"<script type=\"text/javascript\" src=\"overlib/overlib_shadow.js\"><!-- overLIB (c) Erik Bosrup --></script>\n"


and added after:

PHP Code:

echo "<script type=\"text/javascript\" src=\"themes/archeCtypo/js/mootools.js\"></script>\n";
        echo 
"<script type=\"text/javascript\" src=\"themes/archeCtypo/js/side-bar.js\"></script>\n"

and added to my css file:

PHP Code:

h2{
    
color:#666666;
    
font-size:90%;
    
font-family:arial;
    
margin:10px 10px 10px 10px;
    
font-weight:bold;
    }
    
    
h2 span{
        
font-size:105%;
        
font-weight:normal;
    }
    
    
ul{
        
margin:0px 0px 0px 0px;
        
padding:0px 0px 0px 0px;
    }
    
    
li{
    
margin:0px 0px 1px 15px;
    
padding:2px;
    list-
style-type:none;
    
display:block;
    
width:90px;
    
background-color#cccccc;
    
}
    
    
li a{
        
width:100%;
    }
    
    
li a:link,
    
li a:visited{
    
color:#2EB4F3;
    
font-family:verdana;
    
font-size:70%;
    
text-decoration:none;
    
display:block;
    
margin:0px 0px 0px 0px;
    
padding:0px;
    
width:100%;
    }
    
    
li a:hover{
    
color:#666666;
    
text-decoration:inherit;
    
background-color#CCCCCC;
    
}
    
    
#sideBar{
    
positionfixed;
    
widthauto;
    
height350px;
    
top200px;
    
right:0px;
    
background-image:url(images/test2.png);
    
background-position:top left;
    
background-repeat:no-repeat;
    }
    
    
#sideBarTab{
    
float:left;
    
height:0px;
    
width:28px;
    }
    
    
#sideBarTab img{
    
border:0px solid #FFFFFF;
    
}
    
    
#sideBarContents{
    
overflow:hidden !important;
    }
    
    
#sideBarContentsInner{
        
width:127px;
    } 


But my upper right menu gets missplaced...is there any way to make a sidemenustyle.css associate it somehow with archectypo theme and paste the code in there?

joeroberts 14th June 2010 15:40

Not sure I do not have that theme to test it with

Giorgatzelos 14th June 2010 18:08

Joe how can i insert two additional javascript bars one to the upper left and one to the upper right based at this javascript menu but ratated 90 degrees counter clockwise,so that it's dropdown menu?

Bump: Joe how can i insert two additional javascript bars one to the upper left and one to the upper right based at this javascript menu ?

joeroberts 24th October 2010 14:17

please let me see your main.php


All times are GMT +2. The time now is 12:18.

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