MyBB Community Forums

Full Version: JavaScript Dropdown Menus Explained
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8
this what I am looking for.. The Built-in Wink
(2010-12-09, 12:13 AM)AJS Wrote: [ -> ]
(2010-12-08, 11:11 PM)adbrad Wrote: [ -> ]On your forum where the user name is in the posts you have certain options listed there what would the code for that be.

There's a plugin for that on the mods site. Smile

What would that be then i'll see if i can find it.
(2010-12-09, 12:13 AM)AJS Wrote: [ -> ]
(2010-12-08, 05:21 PM)BreadTM Wrote: [ -> ]edit: i was able to find a work around, sorta. it works for now.

Care to share? I'd be interested to see what you've done.

what i did was, i created a new language variable, opt_menu.
so this what opt_menu contained.
<script type="text/javascript">
document.write("Options");
</script>
<noscript>List menu item links here for non javascript users</noscript>

if javascript is enabled Options will be shown, if it is not, you put whatever links you want to be shown.
the dropdown menu calls the opt_menu like this now...
<p class="panel" id="ucp_menu">{$opt_menu}</p>
i'm not sure if that's how you call a language bit, i'm just guessing since i don't have access to my template right now.

this may be a bit confusing, but trust me it works, if you want to test it out i'll help you out if needed.
Found this plugin
http://mods.mybb.com/archive/view/postbit-dropdown-menu
changed compatiability to 16* but how can i get it to deplay the username instead of just user.
(2010-12-09, 08:02 PM)adbrad Wrote: [ -> ]Found this plugin
http://mods.mybb.com/archive/view/postbit-dropdown-menu
changed compatiability to 16* but how can i get it to deplay the username instead of just user.

You'll have to edit the plugin. Smile

Find:
User

Replace with:
'.$post['username'].'
kind of gathered that but don't know what to enter {username} doesn't work so i've no idea.
Just edited my post. Smile
Thanks worked perfect.
I am trying to add a dropdown link called My Content to the postbit just under the warn level but when I add my code, it only works for the first poster in a thread. All the rest of the posters call up an error screen when the link is clicked. I already have the postbit user profile menu installed. Is there a chance of interference? Here is the code i am trying to insert into postbit_author_user

{$lang->postbit_posts} {$post['postnum']}<br />
	{$lang->postbit_joined} {$post['userregdate']}<br />{$post['fid1']}
	{$post['replink']}<br /><br /><b><a href="somepage.php" id="content_menu">My Content</a></b>{$post['warninglevel']}<br /><br /><!-- AWARDS -->


<div id="content_menu_popup" class="popup_menu" style="display: none;">
<div class="popup_item_container"><a href="ezgallery.php?action=myimages&u={$post['uid']}" class="popup_item">My Images</a></div>
<div class="popup_item_container"><a href="forumdisplay.php?fid=41&amp;filterxt_uid={$post['uid']}" class="popup_item">My Garage</a></div>
<div class="popup_item_container"><a href="forumdisplay.php?fid=33&amp;filterxt_uid={$post['uid']}" class="popup_item">My Blog and Wiki Posts</a></div>
<div class="popup_item_container"><a href="forumdisplay.php?fid=39&amp;filterxt_uid={$post['uid']}" class="popup_item">My Videos</a></div>
</div>
<script type="text/javascript">
// <!--
if(use_xmlhttprequest == "1")
{
new PopupMenu("content_menu");
}
// -->
</script>

ETA: I tried deactivating postbit dropdown plugin and my code still did not work.

ETAx2: I ended up editing the postbit dropdown plugin to add my links and it works great, but I am still curious to know the answer to my original problem!
Because each dropdown would be using the same ID, it has to be unique.
Pages: 1 2 3 4 5 6 7 8