The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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 |
#2
|
||||
|
||||
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: |
#3
|
|||
|
|||
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 |
#4
|
||||
|
||||
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: |
#5
|
|||
|
|||
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 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|