The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Custom Field Check and redirect
Hello Everybody,
I have added a custom field to UserField table and would like to make is a required field. To control that I am thinking about adding a system wide plugin which could check to see for logged in user, if that field is filled in other wise redirect the user to profile page to fill it. Can any one point me the hook location I can use and how can i check the field value. Would really appreciate any help With Regards |
#2
|
|||
|
|||
You could do something like this, using hook location global_bootstrap_complete:
PHP Code:
This is checking for 'usercp', 'profile', and 'sendmessage' (the "contact us" page) so that users can get to those even if they haven't filled out the field. You may find that there are other script names you want to put in there. You can also use a phrase for the message by changing the eval line like this: PHP Code:
|
#3
|
|||
|
|||
Thank you so much, you made my day
I am so happy and appreciate your kind help Have a nice day --------------- Added [DATE]1314487515[/DATE] at [TIME]1314487515[/TIME] --------------- Your solution is working like charm, Just wanted to see what variable of THIS_SCRIPT would be for Admincp and Modcp AS now I am not able to get into above controls Please help |
#4
|
|||
|
|||
Hmm...which hook did you use? I just realized that the hook I mentioned is for vbulletin version 4. Try using global_setup_complete.
When I tried it, it had no effect on the admincp or modcp pages even if the field was not filled in. Edit: But to answer your question, the admincp and modcp pages don't set THIS_SCRIPT, but if you need to you could check if VB_AREA == 'AdminCP' or 'ModCP', like: PHP Code:
BTW, if you can't get back in to the adminCP to change the plugin, you can temporarily disable all hook code by editing includes/config.php and adding this line right under <?php PHP Code:
Edit: Also I think you need a check in there for userid != 0 so that guests (and maybe some other requests that don't check for the user beign logged in) aren't affected, like: PHP Code:
I was getting pages with the format all jumbled up, and it seems to somehow be related to this mod. I'm thinking that the request for the CSS was getting denied so that maybe this will fix it. |
Благодарность от: | ||
souperman |
#5
|
|||
|
|||
These all are very useful points to consider for this plugin.
Thanks a lot for taking your time to point these out, I will try applying these as I am going through coding Thanks a lot |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|