PDA

View Full Version : Popup Menu Question


Virtex-II
Mon 25th Sep '06, 6:16am
Can I create a popup menu next to the forum name? My idea is to put an image next to the forum name and when I click on that image a menu popups like it happens when you click on a username in a post. If this is possible how can I do it?

Thanks in advance!!!

Virtex-II
Tue 26th Sep '06, 4:36am
Anyone, please!!! :(

Virtex-II
Wed 27th Sep '06, 6:20am
Does anyone of the developers know if this is possible?

chewbacca
Sat 30th Sep '06, 6:25pm
You should search through the Manual first.

What you want to do is explained on the vBMenu (http://www.vbulletin.com/docs/html/main/templates_vbmenu) page.

Virtex-II
Sun 1st Oct '06, 5:20am
Thank you chewbacca, the point is that I have already tried that but it doesn't work on forumhome_level1&2_post templates.

chewbacca
Sun 1st Oct '06, 2:44pm
Yes, it does work.

Make sure you understand the points that the manual states:

The constituents of a vBMenu control, as seen in the code above are:
A block-level tag (<td>, <div> etc.) with an id attribute using the vBMenu identifying name (in this case, MyMENU).
A hyperlink (the href attribute of which should point somewhere relevant to the menu).
A Javascript block containing a call to the vbmenu_register() function, using the vBMenu identifying name as the argument to the function.If you would like to prevent the small menu image from appearing next to the text in the control, you can achieve this by adding a second argument of true to the vbmenu_register Javascript function.Since you want the arrow, don't use the second argument in vbmenu_register.

This is the sample code adapated to the default forumhome_forumbit_level1_post template:

<tbody>
<tr align="center">
<td class="alt1Active" colspan="2" align="$stylevar[left]" id="f$forum[forumid]">

<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]" /></td>
<td><img src="$vboptions[cleargifurl]" alt="" width="9" height="1" border="0" /></td>
<td>
<div>
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]" id="MyMENU"><strong>$forum[title]</strong></a> <script type="text/javascript">vbmenu_register("MyMENU");</script>
<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
</div>
<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]" rel="nofollow">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
</td>
</tr>
</table>

</td>
<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
<td class="alt1">$forum[threadcount]</td>
<td class="alt2">$forum[replycount]</td>
<if condition="$vboptions['showmoderatorcolumn']">
<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
</if>
</tr>
</tbody>
<if condition="$childforumbits">
<tbody>
$childforumbits
</tbody>
</if>
<div class="vbmenu_popup" id="MyMENU_menu" style="display:none">
Your Content
</div>

Virtex-II
Mon 2nd Oct '06, 5:09am
Maybe I did something wrong then. Will try this at home. Thank you for your care, I'll let you know what I come up with ;)



Regards :)

Virtex-II
Mon 2nd Oct '06, 5:34pm
Well I tried this and it works as long as you don't want to popup a table (like the one you get when you click on the Quick Links button in the navbar). The problem is that I do need to popup a table :(

What can I do?

Thanks for your time ;)

chewbacca
Mon 2nd Oct '06, 6:21pm
Just copy the other menus. For example:
Instead of the

<div class="vbmenu_popup" id="MyMENU_menu" style="display:none">
Your Content
</div>

make it

<div class="vbmenu_popup" id="MyMENU_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td class="thead">Title</td>
</tr>
<tr><td class="vbmenu_option"><a href="#">Item</a></td></tr>
</table>
</div>

Virtex-II
Tue 3rd Oct '06, 5:16am
Thanks chewbacca, I did it but the page became ruined :(


Regards ;)

chewbacca
Tue 3rd Oct '06, 10:33am
I'm sorry, that shouldn't happen if you're doing it right. I don't know how to help you out any more than I have already. :(

Virtex-II
Tue 3rd Oct '06, 10:40am
I'm sorry, that shouldn't happen if you're doing it right. I don't know how to help you out any more than I have already. :(

Thanks, I used the exact code you gave me but it seems that this:

style="display:none"

gets overridden... :(


Regards ;)

chewbacca
Tue 3rd Oct '06, 10:42am
I don't know what you mean. It gets overridden once you click the menu, but otherwise the style attribute overrides any other styling.

Virtex-II
Wed 4th Oct '06, 4:19am
Well I just used your exact code (copied and pasted from the above posts) but this is the result I get...

chewbacca
Wed 4th Oct '06, 12:58pm
From the looks of it you pasted it into the wrong template.

Virtex-II
Thu 5th Oct '06, 6:15am
From the looks of it you pasted it into the wrong template.

The template is the correct one unfortunately :(

That's what you see when you click on a category name :( If I change the table code with "Your Content" everything is ok...

chewbacca
Thu 5th Oct '06, 12:18pm
Post your code here.

Virtex-II
Fri 6th Oct '06, 12:07pm
On forumhome_forumbit_level1_post template.

This one works just fine:

<tbody>
<tr align="center">
<td class="alt1Active" colspan="2" align="$stylevar[left]" id="f$forum[forumid]">

<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]" /></td>
<td><img src="$vboptions[cleargifurl]" alt="" width="9" height="1" border="0" /></td>
<td>
<div>
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]" id="MyMENU"><strong>$forum[title]</strong></a> <script type="text/javascript">vbmenu_register("MyMENU");</script>
<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
</div>
<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]" rel="nofollow">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
</td>
</tr>
</table>

</td>
<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
<td class="alt1">$forum[threadcount]</td>
<td class="alt2">$forum[replycount]</td>
<if condition="$vboptions['showmoderatorcolumn']">
<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
</if>
</tr>
</tbody>
<if condition="$childforumbits">
<tbody>
$childforumbits
</tbody>
</if>
<div class="vbmenu_popup" id="MyMENU_menu" style="display:none">
Your Content
</div>
this next one screws the page:

<tbody>
<tr align="center">
<td class="alt1Active" colspan="2" align="$stylevar[left]" id="f$forum[forumid]">

<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]" /></td>
<td><img src="$vboptions[cleargifurl]" alt="" width="9" height="1" border="0" /></td>
<td>
<div>
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]" id="MyMENU"><strong>$forum[title]</strong></a> <script type="text/javascript">vbmenu_register("MyMENU");</script>
<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
</div>
<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]" rel="nofollow">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
</td>
</tr>
</table>

</td>
<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
<td class="alt1">$forum[threadcount]</td>
<td class="alt2">$forum[replycount]</td>
<if condition="$vboptions['showmoderatorcolumn']">
<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
</if>
</tr>
</tbody>
<if condition="$childforumbits">
<tbody>
$childforumbits
</tbody>
</if>
<div class="vbmenu_popup" id="MyMENU_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td class="thead">Title</td>
</tr>
<tr><td class="vbmenu_option"><a href="#">Item</a></td></tr>
</table>
</div>


You can see it when you click on a categoty name (like General here).

Thanks for your time and care!!!

chewbacca
Fri 6th Oct '06, 12:13pm
I didn't realize it was in a table.

Try this:
<tbody>
<tr align="center">
<td class="alt1Active" colspan="2" align="$stylevar[left]" id="f$forum[forumid]">

<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td><img src="$stylevar[imgdir_statusicon]/forum_$forum[statusicon].gif" alt="" border="0" id="forum_statusicon_$forum[forumid]" /></td>
<td><img src="$vboptions[cleargifurl]" alt="" width="9" height="1" border="0" /></td>
<td>
<div>
<a href="forumdisplay.php?$session[sessionurl]f=$forum[forumid]" id="MyMENU"><strong>$forum[title]</strong></a> <script type="text/javascript">vbmenu_register("MyMENU");</script>
<if condition="$show['browsers']"><span class="smallfont">(<phrase 1="$forum[browsers]">$vbphrase[x_viewing]</phrase>)</span></if>
</div>
<if condition="$show['forumdescription']"><div class="smallfont">$forum[description]</div></if>
<if condition="$show['forumsubscription']"><div class="smallfont"><strong><a href="subscription.php?$session[sessionurl]do=removesubscription&amp;f=$forum[forumid]" rel="nofollow">$vbphrase[unsubscribe_from_this_forum]</a></strong></div></if>
<if condition="$show['subforums']"><div class="smallfont" style="margin-top:$stylevar[cellpadding]px"><strong>$vbphrase[subforums]</strong>: $forum[subforums]</div></if>
<div class="vbmenu_popup" id="MyMENU_menu" style="display:none">
<table cellpadding="4" cellspacing="1" border="0">
<tr>
<td class="thead">Title</td>
</tr>
<tr><td class="vbmenu_option"><a href="#">Item</a></td></tr>
</table>
</div>
</td>
</tr>
</table>

</td>
<td class="alt2" nowrap="nowrap">$forum[lastpostinfo]</td>
<td class="alt1">$forum[threadcount]</td>
<td class="alt2">$forum[replycount]</td>
<if condition="$vboptions['showmoderatorcolumn']">
<td class="alt1"><div class="smallfont">$forum[moderators]&nbsp;</div></td>
</if>
</tr>
</tbody>
<if condition="$childforumbits">
<tbody>
$childforumbits
</tbody>
</if>You should probably change the spaces back into tabs. I hate how the code tag converts them.

Virtex-II
Sun 8th Oct '06, 1:48pm
Thanks a lot chewbacca that worked just great. I wanna thank you for all of your time and care.


My best regards!!!