The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Hooking into registration process. Check for validity
Hey guys!
I'm the owner of an upcoming german Minecraft community and I'm the web developer for our main site, running on the newest vBulletin 4. My problem explained: I need to check a custom field (field5, MC-Account) for validity with the following url (http://www.minecraft.net/haspaid.jsp?user=minifisch") - if the answer from the request ist true, the registration is complete. If the answer from the minecraft.net site is false, the user cant register and some error message is showing up. So, my question is: Is there a documentation about the registration process? I'm very new to PHP and its very difficult for me to learn new script languages. Can someone help me with my "minecraft-user-validation" code? |
#2
|
|||
|
|||
There isn't much in the way of detailed documentation. You can look in the article section for somethign related to registration, but the best way (IMHO) is to look at register.php and see what's going on.
In your case, I think you could create a plugin using hook register_addmember_process and something like this: Code:
if (!empty($vbulletin->GPC['userfield']['field5'])) { $url = 'http://www.xminecraft.net/haspaid.jsp?user=' . urlencode($vbulletin->GPC['userfield']['field5']); $reply = @file_get_contents($url); if ($reply === 'false') { // hasn't paid eval(standard_error(fetch_error('not_paid', $vbulletin->GPC['userfield']['field7']))); } else if ($reply !== 'true') { // couldn't complete check (site is down or whatever) eval(standard_error(fetch_error('check_failed'))); } } and then you'd have to create the phrases 'not_paid' and 'check_failed' (you can chnage those varnames to whatever you want, of course). |
#3
|
|||
|
|||
*Looking for any kind of thank button :3*
Thank you very much! This help us alot from preventing trolls und fakers. Now, there is only one thing left to check for: field5 should be unique in our database, if any one have already the same content in field5 (MC-User) there should show up a message like: "The Minecraft.net account is already in use by: <nameofuser>" Edit: Got it to work, now there is another problem: Could not find phrase 'account_in_use'. Phrase "account_in_use" is created and filled with text. |
#4
|
|||
|
|||
Quote:
Code:
$result = $vbulletin->db->query_first("SELECT userid FROM " . TABLE_PREFIX . "userfield WHERE field5='" . $vbulletin->db->escape_string($vbulletin->GPC['userfield']['field5']) . "' LIMIT 1"); if ($result) { eval(standard_error(fetch_error('account_in_use'))); } Quote:
|
#5
|
|||
|
|||
I tried it with type GLOBAL and type "Benutzeroberfl?che: Registrierung" - userinterface: register
I have set up the field text and the transation field for german. Still showing me that he cant find the correct phrases. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|