Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
[How-To] Add Messages to the Admin Message System
derekivey
Join Date: Apr 2005
Posts: 1,186

 

Pennsylvania, USA
Show Printable Version Email this Page Subscription
derekivey derekivey is offline 09-22-2006, 10:00 PM

[How-To] Add Messages to the Admin Message System

This how-to explains how you can insert a message to the new admin message system feature that was introduced in vBulletin 3.6.0 Beta 2.

I wanted to add this to a few of my hacks with a message on what to do when installed, so I looked in vB's files to see how they did it. It is actually done with a simple SQL query.

PHP Code:
$db->hide_errors();
 
$db->query_write("INSERT INTO " TABLE_PREFIX "adminmessage
   (varname, dismissable, script, action, execurl, method, dateline, status)
  VALUES
   ('varname_of_phrase', 1, 'script.php', 'some_action', 'script.php?do=some_action', 'get', " 
TIMENOW ", 'undone')
"
);
 
$db->show_errors(); 
  • varname - varname of the phrase that is to be shown for the message. It looks like vB is using an error phrase for this.
  • dismissable - whether or not to allow the user to dismiss the message without addressing it (1 = yes, 0 = no).
  • script - the script that the user will be redirected to when they address the issue.
  • action - the "do" action that will be used.
  • execurl - the url to the file that the user is redirected to (script.php?do=some_action).
  • method - get or post.
  • dateline - date message was added, you can add the current date/time with the TIMENOW constant.
  • status - status of message (undone, done, dismissed), this should be set to undone most of the time.
You should be able to add the above code into your product install code, just remember that these messages will only show if the user installing your product has at least 3.6.0 beta 2 running.

Hope this helps some people. I know it will definitely be useful for me!

Derek
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 07:54 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.03262 seconds
  • Memory Usage 2,180KB
  • Queries Executed 14 (?)
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_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit_onlinestatus
  • (1)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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete