The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
Group Messagebit Plugin Query
Right this one has me totally baffled and I can't fix it.
On vB3 I was able to query custom user fields (at the hook group_messagebit_display_complete) so the data could be used in the template group_message as follows: Code:
$username = $message['username']; $sql = "SELECT user.userid, user.usergroupid, userfield.field14, userfield.field13, userfield.field15 FROM user AS user LEFT JOIN userfield AS userfield ON (userfield.userid = user.userid) WHERE user.username = '" . mysql_real_escape_string($username) . "' LIMIT 1"; $query = mysql_query($sql); // Do our error checking first... if(!$query) { echo 'Username: Invalid'; } else { // Use mysql_fetch_assoc to return [field] => [value] array result $data = mysql_fetch_assoc($query); $message['field14'] = $data['field14']; $message['field13'] = $data['field13']; $message['field15'] = $data['field15']; } Anyway this worked fine on vB3. Now that I have reopened my groups on vB4 I thought I'd use the same code but it simply doesn't work. Some diagnostics have revealed that the hook itself works, the problem seems to be that the variable $message is no longer recognised at this hook. My test for that has been to add the following line: Code:
$template_hook['field15'] = "Test"; But if I try: Code:
$template_hook['field15'] = $message['username']; It can't be a variable registration issue as $message is definitely available in the template, it is already used throughout. Therefore, I'm finally stumped. Anyone got any idea how I can plug this code in? Even if it means editing a file I don't mind. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|