Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons

Reply
 
Thread Tools
[AJAX] Drop Down Message Display / Selector Details »»
[AJAX] Drop Down Message Display / Selector
Version: 1.0.1, by harmor19 harmor19 is offline
Developer Last Online: May 2023 Show Printable Version Email this Page

Category: Mini Mods - Version: 3.6.0 Rating:
Released: 08-25-2006 Last Update: 08-26-2006 Installs: 21
DB Changes Uses Plugins Template Edits
Additional Files  
No support by the author.

File Edits: 0
Template Edits: 2
Difficulty: Easy

Description
This hack adds a drop down menu underneath your navbar.
When someone selects an option it'll load a table with the contents you put in it (without reloading the page).

You can use HTML when you add a new message.

I have added a new hook for the use of replacing text.
I have hardcoded two replacements.

[username] - This will display the username of the user browsing
[userid] - This will display the userid of the user browsing.


F.A.Q.
Q: How can I add my own replacements?
A: Add a new plugin under the hook "ajax_drop_menu_start".
In the Plugin PHP code use this format: $cm['text'] = str_replace("find", "replace", $cm['text']);

Example:
PHP Code:
$cm['text'] = str_replace("[username]"$vbulletin->userinfo['username'], $cm['text']); 
Q: Can I use the hook for other things besides replacing text?
A: Yes. You can use it for almost anything. If you'd like to query the database for the lastest 5 threads and display them in the drop down menu you can.


On the demo you'll see a drop down menu with the text "Select Message".
View The Demo

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 08-26-2006, 03:51 PM
DPSR DPSR is offline
 
Join Date: Aug 2006
Posts: 154
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by acidburn0520
Make a new plugin in 'cache_templates' with this:
PHP Code:
$globaltemplates[]  = 'custom_messages'
Thanks buddy
Reply With Quote
  #23  
Old 08-26-2006, 07:01 PM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry about the uncached template. It'll be fix in the next release.
Reply With Quote
  #24  
Old 08-26-2006, 11:21 PM
therocks therocks is offline
 
Join Date: Mar 2006
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Barakat
from where can i add messeges ?
i was wondering this too... i created the new hook (ajax_drop_menu_start) but it's not showing up in the dropdown...
Reply With Quote
  #25  
Old 08-26-2006, 11:58 PM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by therocks
i was wondering this too... i created the new hook (ajax_drop_menu_start) but it's not showing up in the dropdown...
Can you explain what you've done?
Reply With Quote
  #26  
Old 08-27-2006, 12:50 AM
therocks therocks is offline
 
Join Date: Mar 2006
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by harmor19
Can you explain what you've done?
i went into my plugin manager and added a plugin under ajax_drop_menu_start. i used the code from one of your examples to show the last 5 threads from a specific forum as the plugin PHP code and made sure that the plugin is set to active.. for the execution order i put 1, it was at 5 by default..

is that all you need to do to add something into the dropdown menu or am i missing something??

heres a screenshot..
Reply With Quote
  #27  
Old 08-27-2006, 12:56 AM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I can barely see it.
You don't need to [you] tag. It already has [username] which does the same thing.
Reply With Quote
  #28  
Old 08-27-2006, 12:59 AM
therocks therocks is offline
 
Join Date: Mar 2006
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by harmor19
I can barely see it.
You don't need to [you] tag. It already has [username] which does the same thing.
Not sure what you're talking about... I just copied and pasted the code from your example.. changing only the forumid to pull the new threads from... nothing's showing up in the dropdown menu... just the "Select Message".. so is this the only step you need to take to make a new drop down menu selection or am I missing something?

this is the code from the screenshot:
PHP Code:
$getthreads $db->query_read("SELECT * FROM thread WHERE forumid='23' ORDER BY threadid DESC LIMIT 10");    
while(
$lt $db->fetch_array($getthreads))
{
   
$latestthreads .= "Title: <a href='showthread.php?t=$lt[threadid]'>".$lt['title']."</a> | Posted By: <a href='member.php?u=$lt[postuserid]'>".$lt['lastposter']."</a><br />";

}

$cm['text'] = str_replace("[latestthreads]"$latestthreads$cm['text']); 
Reply With Quote
  #29  
Old 08-27-2006, 01:03 AM
harmor19 harmor19 is offline
 
Join Date: Apr 2005
Posts: 1,324
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by therocks
Not sure what you're talking about... I just copied and pasted the code from your example.. changing only the forumid to pull the new threads from... nothing's showing up in the dropdown menu... just the "Select Message".. so is this the only step you need to take to make a new drop down menu selection or am I missing something?
You posted up a screen shot where it looks like you were trying to use the the [you] tag.

Go to Admin CP --> Custom Messages --> [Add] or [Modify]
In the text area use [latestthreads]
Reply With Quote
  #30  
Old 08-27-2006, 01:10 AM
therocks therocks is offline
 
Join Date: Mar 2006
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by harmor19
You posted up a screen shot where it looks like you were trying to use the the [you] tag.

Go to Admin CP --> Custom Messages --> [Add] or [Modify]
In the text area use [latestthreads]
ok i did that... it's now showing in the drop down menu.. however, when i select it i get this:

Code:
Database error in vBulletin 3.6.0:

Invalid SQL:
SELECT * FROM custom_messages WHERE display_order='1';

MySQL Error  : Table '*****.custom_messages' doesn't exist
Error Number : 1146
Date         : Saturday, August 26th 2006 @ 07:09:37 PM
Script       : http://******.com/boards/custom_messages.php?display_order=1
Referrer     : 
IP Address   : *******
Username     : therocks
Classname    : vb_database
Reply With Quote
  #31  
Old 08-27-2006, 01:14 AM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You forgot to add table prefixes Harmor.

I do that all the time too, lol.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:14 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04989 seconds
  • Memory Usage 2,313KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (3)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete