PDA

View Full Version : Sidebar advanced


Phlex
01-22-2006, 07:14 AM
Hi !
I used this option http://www.vbadvanced.com/membersarea.php?do=viewusermanual&productid=4&pageid=6 to creat a sidebar .
And now i would like to give my users the option to expand and fold the sidebar like here -> http://www.webdevforum.de/forum/index.php


//excuse my bad english :D

Brian
01-23-2006, 03:10 AM
I haven't seen any other sites with an option like that, so I would guess that it's custom coded. You could always try contacting the admin of that web site and see if they would be willing to share. :)

Our Sponsors
 

Phlex
01-23-2006, 08:21 AM
I haven't seen any other sites with an option like that, so I would guess that it's custom coded. You could always try contacting the admin of that web site and see if they would be willing to share. :)
I tried 2 weeks ago ,but he didn't answer :(,therefore i asked here if somebody could code it.

Another idea would be to make an if function in the index.php , which dis/enables the Sidebar depending on a profil field
l
something like that
if ($vbulletin->userinfo['field13'] == 'enabeld')
define('VBA_PORTAL', true);
define('VBA_PAGE', 'include');
....

Brian
01-23-2006, 01:55 PM
You should be able to add some code like that somewhere in your global.php file just before the call to the vba_cmps_include_top.php file.

Our Sponsors
 

Milad
01-23-2006, 03:06 PM
There is a java script, you can open and close the sidebar, try it.

Milad
01-23-2006, 03:11 PM
The sidebar is hidden and could be extended in any page.

Phlex
01-23-2006, 03:13 PM
You should be able to add some code like that somewhere in your global.php file just before the call to the vba_cmps_include_top.php file.
How is the correct code ? ( i am not a coder :) ,just know some basics )


js vom hte site
<script type="text/javascript">
<!--
function my_toggle_sidebar()
{
obj = fetch_object('left_sidebar');
obj2 = fetch_object('fold_left_sidebar');

if (!obj)
{
return false;
}

if (obj.style.display == 'none')
{
obj.style.display = '';
save_collapsed('left_sidebar', false);
obj2.className = 'sidebar_is';
}
else
{
obj.style.display = 'none';
save_collapsed('left_sidebar', true);
obj2.className = 'sidebar_is_collapsed';
}
return false;
}

function my_hover_sidebar()
{
obj = fetch_object('fold_left_sidebar');

if (!obj)
{
return false;
}

if (obj.className == 'sidebar_is_collapsed')
{
obj.className = 'sidebar_is_hover_collapsed';
}
else if (obj.className == 'sidebar_is')
{
obj.className = 'sidebar_is_hover';
}
return false;
}

function my_out_sidebar()
{
obj = fetch_object('fold_left_sidebar');

if (!obj)
{
return false;
}

if (obj.className == 'sidebar_is_hover')
{
obj.className = 'sidebar_is';
}
else if (obj.className == 'sidebar_is_hover_collapsed')
{
obj.className = 'sidebar_is_collapsed';
}
return false;
}
// -->
</script>
i included it in the headinclude template ,but it doesn't work

Phlex
01-24-2006, 11:32 AM
no idea ???

Brian
01-24-2006, 04:34 PM
Sorry, but my knowledge about javascript is very limited.

Phlex
01-25-2006, 08:16 AM
doesn't matter , and how's about this:

Originally Posted by Brian
You should be able to add some code like that somewhere in your global.php file just before the call to the vba_cmps_include_top.php file.
How is the correct code ? ( i am not a coder ,just know some basics )

Brian
01-25-2006, 02:35 PM
Try adding the code just below this line in your global.php file.

require_once(CWD . '/includes/init.php');

Phlex
01-26-2006, 05:24 AM
it doesn't work ....

Brian
01-26-2006, 04:09 PM
if ($vbulletin->userinfo['field13'] == 'enabeld')

Is field13 the id for the custom field you enabled? And did you spell 'enabeld' incorrectly in the setting as well? ;)