vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Success/Error Messages (https://vborg.vbsupport.ru/showthread.php?t=196899)

ptmuldoon 11-21-2008 09:28 PM

Success/Error Messages
 
I'm trying to learn how to add a success message when a user submits data in a plugin/product I'm working on.

I discovered the print_stop_message() But I'm not sure if there is either:

1. A function to show a success message, or
2. If there is a way to create a customized stop message.

JamesAB 11-22-2008 12:51 AM

This is what I have used for custom "no permission" error pages.

First, I created the phrase my_no_permisission_videos, with the phrase type Front-End Error Messages.

Then I've used this for cusom error pages:

Code:

eval(standard_error(fetch_error('my_no_permisission_videos')));
Good luck,
James

Dismounted 11-22-2008 08:02 AM

You can use this to display success messages (with redirect).
PHP Code:

$vbulletin->url 'myfile.php';
eval(
print_standard_redirect('redirect_myphrase')); 


ptmuldoon 11-22-2008 03:36 PM

Well, I really trying to keep all the code in one file. And really don't want to be redirecting for a success or failure message.

I just want to show a custom message if the the form was submitted sucessfully, or if not, the reason the form failed. This is was I have now, but unsure if it can be customized.
PHP Code:

define('CP_REDIRECT'"multiuser.php?do=edit&id=".$id);
    
print_stop_message('deleted_notice_successfully'); //How to customize stop message? Currently from notice.php file. 


JamesAB

I'll try and see if I can understand what you mentioned. Not sure yet on how to add custom vbphrases.

Dismounted 11-23-2008 02:54 AM

print_stop_message() is used for Admin/Mod CP messages - and not for geenral messages to the user. The code I posted above will do want you want.

ptmuldoon 11-23-2008 01:44 PM

Quote:

Originally Posted by Dismounted (Post 1671004)
print_stop_message() is used for Admin/Mod CP messages - and not for geenral messages to the user. The code I posted above will do want you want.

Right, I am creating a backend Admin product/Mod. So should I be able to create a custom stop message for the new mod I'm working on?

Dismounted 11-24-2008 04:25 AM

Yes, if you are creating an Admin/Moderator message, use print_stop_message().

ptmuldoon 11-24-2008 02:26 PM

Thanks, but thats where I'm getting stuck. How do you create that custom stop message such as:
PHP Code:

print_stop_message('My Custom Message'); 


Dismounted 11-25-2008 05:12 AM

Have a look at the vBulletin API:
http://members.vbulletin.com/api

ptmuldoon 11-25-2008 05:17 PM

Thats perfect. From there, I should be able to learn more on how the different classes and functions work.


All times are GMT. The time now is 05:17 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02223 seconds
  • Memory Usage 1,730KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete