![]() |
[AJAX] Drop Down Message Display / Selector
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:
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 |
Examples of what you can do with the plugin are listed below.
Add the code to the hook "ajax_drop_menu_start" Example 1 You can have the latest 5 threads from a specific forum PHP Code:
Example 2 This will display the top five users with the highest post count PHP Code:
Example 3 This will display the latest 5 threads in every forum the user can access PHP Code:
|
great mod!! ... would there be a way to pull 5 or 10 of the latest threads from a specific forum into one of those boxes????
|
Quote:
|
Quote:
|
Interesting idea. What would be the ideal use for this?
|
Quote:
|
I've updated my hack. I hope you like it.
|
Quote:
If you need help coding the query I can assist you. |
I am using the first post to post examples. What other examples would you like to see posted?
|
Thanks buddy for the hack, i think i can make a good use of it ;)
*installed |
The last 5 threads with replys ?
C?dric :rolleyes: |
Quote:
I hope it's the latter. |
Quote:
|
Quote:
|
Thanks harmor19 beautiful hack, i am using fo rthe purpose i want ;)
But can you please resolve this issue: Code:
(1 queries for uncached templates) |
from where can i add messeges ?
|
Quote:
PHP Code:
|
Quote:
Thanks, C?dric ;) |
Quote:
|
Quote:
|
Sorry about the uncached template. It'll be fix in the next release.
|
Quote:
|
Quote:
|
Quote:
is that all you need to do to add something into the dropdown menu or am i missing something?? heres a screenshot.. http://img84.imageshack.us/img84/3808/1si7.png |
I can barely see it.
You don't need to [you] tag. It already has [username] which does the same thing. |
Quote:
this is the code from the screenshot: PHP Code:
|
Quote:
Go to Admin CP --> Custom Messages --> [Add] or [Modify] In the text area use [latestthreads] |
Quote:
Code:
Database error in vBulletin 3.6.0: |
You forgot to add table prefixes Harmor. ;)
I do that all the time too, lol. :p |
I see what I did wrong. I forgot to add " . TABLE_PREFIX . " to the query.
I'll reupload the hack in a minute. Edit: acidburn beat me to it. |
Yay... do I win anything? :)
|
therocks,
Download the hack and overwrite "custom_messages.php". Import the product and select "Allow Overwrite". acidburn, You get a reply from me. |
Well, I guess that's good enough.
|
wow , now it works thanks
|
Really nice mod, thanks :D
|
u need a delete option for the messeges also !!1
|
Quote:
If you create three messages then go into the database and delete the second one the drop down menu doesn't work properly. In the database change the last entry's display_order from "3" to "2" and it works fine. |
Quote:
Sorry, I am very confused and need visual guidance to understand this thing fully. :confused: |
I cannot show you in a screen shot. You can view it in action here
you'll see a drop down menu with the text "Select Message". |
All times are GMT. The time now is 08:04 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|