The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How I get realusername i hybrid mode
Helo ,
In the thread shall be show real username in hybrid mode. How can I this make? My first try was make a plugin Plugins & Products --> Plugin Manager Product: vBulletin Hook Location: showthread_start Titel: Realname Execution Order: 5 Plugin PHP Code: PHP Code:
In the file showthread.php in line 1176 following i found variables: PHP Code:
It seems as if the hook was not passed to the file showthread.php What is the error? Vbulletin 4.1.4 forum. Greeting userform3 |
#2
|
|||
|
|||
Did you try using hook location showthread_query_postids_threaded? It's after line 1176, and if you want to set $hook_query_fields and $hook_query_joins it must be after that line.
Also, I believe that PHP Code:
will cause an error. I don't think you need to set $hook_query_where at all. |
#3
|
|||
|
|||
How I get username form userid
Hi, Yes, I don't need $hook_query_where. I try something else, hook location: showthread_query and I get immediately this error: PHP Code:
Not unique table/alias: 'userfield' Hm, the table 'userfield' is exists in the databas? I think the query is not ok, what do you think? |
#4
|
|||
|
|||
It looks like the userfield table and fields are already being included, so maybe you don't need to do it at all.
Code:
Database error in vBulletin 4.1.4: Invalid SQL: SELECT post.*, post.username AS postusername, post.ipaddress AS ip, IF(post.visible = 2, 1, 0) AS isdeleted, user.*, userfield.*, usertextfield.*, spamlog.postid AS spamlog_postid, deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason, editlog.userid AS edit_userid, editlog.username AS edit_username, editlog.dateline AS edit_dateline, editlog.reason AS edit_reason, editlog.hashistory, postparsed.pagetext_html, postparsed.hasimages, sigparsed.signatureparsed, sigparsed.hasimages AS sighasimages, sigpic.userid AS sigpic, sigpic.dateline AS sigpicdateline, sigpic.width AS sigpicwidth, sigpic.height AS sigpicheight, IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid , userfield.* FROM post AS post LEFT JOIN user AS user ON(user.userid = post.userid) LEFT JOIN userfield AS userfield ON(userfield.userid = user.userid) LEFT JOIN usertextfield AS usertextfield ON(usertextfield.userid = user.userid) LEFT JOIN spamlog AS spamlog ON(spamlog.postid = post.postid) LEFT JOIN deletionlog AS deletionlog ON(post.postid = deletionlog.primaryid AND deletionlog.type = 'post') LEFT JOIN editlog AS editlog ON(editlog.postid = post.postid) LEFT JOIN postparsed AS postparsed ON(postparsed.postid = post.postid AND postparsed.styleid = 1 AND postparsed.languageid = 1) LEFT JOIN sigparsed AS sigparsed ON(sigparsed.userid = user.userid AND sigparsed.styleid = 1 AND sigparsed.languageid = 1) LEFT JOIN sigpic AS sigpic ON(sigpic.userid = post.userid) LEFT JOIN userfield AS userfield ON(userfield.userid = thread.postuserid) WHERE post.postid IN (205497,205518,205576) post.threadid; MySQL-Error : Not unique table/alias: 'userfield' Error-Nr. : 1066 Error-time : Wednesday, 13.07.2011 @ 15:31:21 Date : Wednesday, 13.07.2011 @ 15:31:21 |
#5
|
|||
|
|||
yes, it's unnecessary
In the table userfield are only two fields what I need: PHP Code:
|
#6
|
|||
|
|||
That's a good question and I don't know the answer. I think it should be {vb:raw post.userfield.field5} but that probably doesn't work because the template curly tags use '.' for array access.
Edit: no, I'm wrong - I see from your post below that you figured out it's just 'field5' and 'field6'. |
#7
|
|||
|
|||
Hi,
Your idea was deciding, thanks, I change the Hook Location to showthread_postbit_create I found in tempalte showthread_list the location where are "bulid" the usernick name, this nickname I want to change to realname, I try this with following code in this hook: PHP Code:
If I change this code to PHP Code:
PHP Code:
What make I wrong? |
#8
|
|||
|
|||
I see now - I was wrong and the field names were just 'field5' and 'field6' - that makes it easier .
I think you would want to use template postbit, or (postbit_legacy is you are using that one instead). |
#9
|
|||
|
|||
I have implemented your suggestion and expand the php code:
PHP Code:
The Hook Location is the same. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|