The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
[HOW TO - vB4] Sidebar in your own mod
Do you like the sidebar ? Here I will explain how to insert it into your own mod. 1.) make sure that you have loaded forumhome.css. This is nessesary for the blocks. 2.) prepare your template(s) (modify your product). You have to do this for all "main" templates you'd like to insert the sidebar! search for: Code:
</head> Code:
<vb:if condition="$show['sidebar']"> <link rel="stylesheet" type="text/css" href="{vb:var vbcsspath}tagcloud.css" /> <script type="text/javascript" src="{vb:stylevar yuipath}/animation/animation-min.js?v={vb:raw vboptions.simpleversion}"></script> <script type="text/javascript"> var sidebar_align = '<vb:if condition="$vboptions['sidebarposition'] == 0">left<vb:else />right</vb:if>'; var content_container_margin = parseInt('{vb:math {vb:stylevar forum_sidebar_width}+{vb:math {vb:stylevar padding}*2}}'); var sidebar_width = parseInt('{vb:stylevar forum_sidebar_width}'); </script> <script type="text/javascript" src="{vb:raw vboptions.bburl}/clientscript/vbulletin-sidebar.js?v={vb:raw vboptions.simpleversion}"></script> </vb:if> Code:
{vb:raw header} {vb:raw navbar} Code:
<vb:if condition="$show['sidebar']"> <div id="content_container"<vb:if condition="$vboptions['sidebarposition'] == 0"> class="contentright"</vb:if>> <div id="content"> </vb:if> Code:
{vb:raw footer} Code:
<vb:if condition="$show['sidebar']"> </div> </div> <div id="sidebar_container"<vb:if condition="$vboptions['sidebarposition'] == 0"> class="sidebarleft"</vb:if>> <a id="sidebar_button_link" href="#"> <vb:if condition="$vboptions['sidebarposition'] == 0"> <img id="sidebar_button" src="{vb:stylevar imgdir_misc}/tab-collapsed-left.png" alt="" /> <vb:else /> <img id="sidebar_button" src="{vb:stylevar imgdir_misc}/tab-collapsed.png" alt="" /> </vb:if> </a> <ul id="sidebar"> {vb:raw sidebar} </ul> </div> </vb:if> Below it you can insert the following script: Code:
// sidebar $show['sidebar'] = false; if ($vbulletin->options['enablesidebar'] AND !(is_browser('ie') AND !is_browser('ie', 7))) { require_once (DIR . '/includes/class_block.php'); $blockmanager = vB_BlockManager::create($vbulletin); $sidebar = $blockmanager->getSidebarHTML(); if ($sidebar) { $show['sidebar'] = true; } } If you like to change that, simply change the following line: Code:
if ($vbulletin->options['enablesidebar'] AND !(is_browser('ie') AND !is_browser('ie', 7))) Code:
if ($sidebar_in_my_mod AND $vbulletin->options['enablesidebar'] AND !(is_browser('ie') AND !is_browser('ie', 7))) Now the last step. Somewhere you have to register your "main" template, simply insert Code:
$templater->register('sidebar', $sidebar); Remember: This will show all availiable blocks. You can use this mod to set the block on page .... https://vborg.vbsupport.ru/showthread.php?t=235219 I hope this article is helpfull. Coroner |
#2
|
||||
|
||||
thank you
nice ! |
#3
|
||||
|
||||
|
#4
|
|||
|
|||
This isn't working for me... at all. I get the small arrow tab, but it shows on the bottom of my page... instead of on the right... and if I click the arrow, nothing shows up. Below is my page... I cut and pasted the contents directly into it for testing purposes...
Code:
{vb:stylevar htmldoctype} <html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html"> <head> {vb:raw headinclude} <link rel="stylesheet" type="text/css" href="{vb:raw vbcsspath}album.css" /> <title>{vb:raw vboptions.bbtitle} - {vb:raw pagetitle}</title> {vb:raw headinclude_bottom} <vb:if condition="$show['sidebar']"> <link rel="stylesheet" type="text/css" href="{vb:var vbcsspath}tagcloud.css" /> <script type="text/javascript" src="{vb:stylevar yuipath}/animation/animation-min.js?v={vb:raw vboptions.simpleversion}"></script> <script type="text/javascript"> var sidebar_align = '<vb:if condition="$vboptions['sidebarposition'] == 0">left<vb:else />right</vb:if>'; var content_container_margin = parseInt('{vb:math {vb:stylevar forum_sidebar_width}+{vb:math {vb:stylevar padding}*2}}'); var sidebar_width = parseInt('{vb:stylevar forum_sidebar_width}'); </script> <script type="text/javascript" src="{vb:raw vboptions.bburl}/clientscript/vbulletin-sidebar.js?v={vb:raw vboptions.simpleversion}"></script> </vb:if> </head> <body> {vb:raw header} {vb:raw navbar} <vb:if condition="$show['sidebar']"> <div id="content_container"<vb:if condition="$vboptions['sidebarposition'] == 0"> class="contentright"</vb:if>> <div id="content"> </vb:if> <div class="block"> <h2 class="blockhead">Most Recent Media</h2> <div class="blockbody floatcontainer"> <ul id="mediacontainer" style="padding: 20px 0px 0px 0px; text-align: center;"> <li style="-webkit-box-shadow: #C8C8C8 -2px 2px 2px; background: white none; border: 1px solid #E9E9E9; display: block; float: left; padding: 20px; margin: 0px 0px 20px 20px; width: 400px;"> <div style="padding-bottom: 10px;"> <b><a href="media.php?do=details&mid=7">Soulcalibur IV: Ending Compilation 3</a></b> </div> <div style="float:left; position: relative;"> <span style="position:absolute; bottom:3px; right:3px; font-size:12px; color:#FFFFFF; background-color:#000000; padding:2px;"><b>10:36</b></span> <a href="media.php?do=details&mid=7"><img src="customVID/1/_SCipTB-7gI.jpg" border="0" alt="Soulcalibur IV: Ending Compilation 3" height="106" /></a> </div> <div> 03/28/2010 at <span class="time">09:46 PM</span><br /> Uploaded by <a href="media.php?do=user&uid=1">Jaxel</a><br /> <br /> <img src="images/rating/rating-trans-15_0.png" alt="Rating: 0" /><br /> <br /> <a href="media.php?do=category&cid=1">Intros/Cutscenes</a><br /> Views: 16 - Comments: 0 </div> </li> </ul> </div> </div> <vb:if condition="$show['sidebar']"> </div> </div> <div id="sidebar_container"<vb:if condition="$vboptions['sidebarposition'] == 0"> class="sidebarleft"</vb:if>> <a id="sidebar_button_link" href="#"> <vb:if condition="$vboptions['sidebarposition'] == 0"> <img id="sidebar_button" src="{vb:stylevar imgdir_misc}/tab-collapsed-left.png" alt="" /> <vb:else /> <img id="sidebar_button" src="{vb:stylevar imgdir_misc}/tab-collapsed.png" alt="" /> </vb:if> </a> <ul id="sidebar"> {vb:raw sidebar} </ul> </div> </vb:if> <div style="text-align: center;"> SpyGlass Media Library © Jason Axelrod from <a href="http://www.8wayrun.com/">8WayRun.Com</a> </div> {vb:raw footer} </body> </html> Code:
require_once('./global.php'); // sidebar $show['sidebar'] = false; if ($vbulletin->options['enablesidebar'] AND !(is_browser('ie') AND !is_browser('ie', 7))) { require_once (DIR . '/includes/class_block.php'); $blockmanager = vB_BlockManager::create($vbulletin); $sidebar = $blockmanager->getSidebarHTML(); if ($sidebar) { $show['sidebar'] = true; } } Okay... I got it working... but it doesn't align correctly... http://test.8wayrun.com/media.php? |
#5
|
|||
|
|||
What do you mean with: "align correctely" ? I see your bar on the right.
|
#6
|
|||
|
|||
The TOP of the sidebar is not lined up with the TOP of my main content...
|
#7
|
||||
|
||||
Quote:
You can wrap the entire DIV for the sidebar with a simple: <div style="margin: -4px 0px 0px 0px;"> All that code up above here blah blah </div> to test then modify the original css to suit and remove the div style wrapper. |
#8
|
|||
|
|||
Thanks, I don't know why I didn't think of that. I've been programming nonstop for a week... so your brain starts to short out after a while.
Any word on how to add this kind of sidebar functionality to my own sidebar? Not the VB Sidebar? |
#9
|
|||
|
|||
Quote:
How did you manage to get it working? I'm having the same issue. |
#10
|
||||
|
||||
it want work on activity.php :S
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|