Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 11-25-2002, 03:55 AM
Paul Paul is offline
 
Join Date: Jan 2002
Posts: 211
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Turning standarderror's output into a variable

Hi,

I'm wondering how difficult/feasible it would be to change the standarderror function to display error messages within existing vb pages instead of on a separate error page.

My concern is that with no-cache headers enabled if someone attempts to post and has an error, pressing back will cause them to lose their changes. What I'd like to do instead is put $error at the top of newpost/reply pages and should there be an error, display it there, but pass any submitted variables to the newreply/newtopic pages (i.e. username/password/subject/message/etc).

I've been toying with this idea for a while and wanted to get some feedback. I know vB3 uses a similar system, but I've had a lot of users complain about lost posts and I'd like to devise a workaround until then.

Thanks,
Paul
Reply With Quote
  #2  
Old 11-27-2002, 05:56 PM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

good thinking..

I didn't apply it, but as an idea, it seems quite practical to me.. You just need to hack vb so that instead of jumping into standarterror function, forward user to the back to the referring script with "preview" variable on. (applies to newthread.php, editpost.php and newreply.php).

In other words:
If user made a mistake say in newthread.php, hack that script so that it will call itself with $preview variable and edit "*****_postpreview" template to include the error message on top or better in a java alert to get attention.

I don't think it's a hard to code hack. But its just tiring since you need to modify many parts of the code for all possible errors and if you want to apply the idea into all vb, you have to hack many scripts like private.php, register.php, editpost.php etc.

So it's your call to decide whether it's worth trying instead of waiting for vb3. :classic:
Reply With Quote
  #3  
Old 11-28-2002, 05:55 AM
Paul Paul is offline
 
Join Date: Jan 2002
Posts: 211
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

My thoughts exactly. The number of instaces that would need to be changed are a bit overwhelming.

I think I might give it a go on a few errors and see how it goes. This is the kind of hack that one needs a development forum to work with.

I'll stop putting off setting that up and then try modifying a few errors and see what I come up with.

Thanks,
Paul
Reply With Quote
  #4  
Old 11-28-2002, 11:20 AM
Logician's Avatar
Logician Logician is offline
 
Join Date: Nov 2001
Location: inside vb code
Posts: 4,449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok since you told you'll take a look at it, here is an algortihm you may found useful: :glasses:

Maybe you would consider hacking "standarderror function" and make it accept a few outside variables as parameters. If parameters are not sent, it will act default. But if some variables sent, it will process them and instead of displaying the default template it would take user to the requested (via a variable) page.

Then inside the function you can apply a "case" tree which will evaluate incoming parameters and redirect user. (with header() command.)

This approach will save a lot of modifications in a lot of vb scripts and take the core of the hack inside one function. You still need to edit "stardarderror" callings inside vb but I guess it would be easier than handle eveything inside seperate scripts.

Another issue to handle would be modifying many templates to insert vb error message. And for this you can assign a variable into header function and in global.php set its value if script is called from your new standarderror function. This would save you editing tens of templates for this hack..

Just a thought. :glasses:
Reply With Quote
  #5  
Old 12-04-2002, 06:25 PM
Paul Paul is offline
 
Join Date: Jan 2002
Posts: 211
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Logician,

Thanks for the comments. This is exactly how I handled incorporating the Today/Yesterday hack on our forums and the vbdate() function--sending a third variable to vbdate() (although in that case, the third variable is not processed--it's mere inclusion triggers the case) will prevent the date from being replaced with "Yesterday" or "Today" (we chose this method since there were more instances where we were changing the date than that we were keeping the original vbdate() output.

I'm about to sit down with this. I'll post progress updates here.

Best wishes,
Paul
Reply With Quote
Reply

Thread Tools
Display Modes

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 01:09 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.04472 seconds
  • Memory Usage 2,193KB
  • Queries Executed 13 (?)
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)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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_postinfo_query
  • fetch_postinfo
  • 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