The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How do I redirect from my module if query fails?
I am building a CMPS module that will let me dynamically build a page from GARS custom fields, so that I can have one page definition and generate hundreds of pages from it. I have it all working, but I need to now put in some error detection. I am passing a url value that is used to find the correct thread. If someone inputs a bogus value, then it takes me into a messy end result... here is the framework I am working with...
PHP Code:
Assuming I can do that, is there a way to also do the redirect if I return more than one row? |
#2
|
|||
|
|||
After you do the SQL query add.
PHP Code:
|
#3
|
|||
|
|||
Well, I'm not sure it is going to produce an error... by fail, I meant to say that it didn't find anything. If it doesn't find anything, then all the data for the rest of the module and templates won't exist and so the result is just a big mess. I do have some follow-on queries in some of the modules that will fail, but I'd like to catch it at the source, and redirect to another page in vbulletin. I tried a count() on the array, but it doesn't seem to work for me. I guess I'll have to stick something in the data that I can test for... I was hoping there was an easy way to determine if I didn't find any rows, and then just bale out.
Assuming that is figured out... how can I redirect out of this module? Is there some vBulletin function that would let me go elsewhere with a call? Or, do I need to call a template and build the contents with static data? I was hoping to just call a different page. |
#4
|
||||
|
||||
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|