The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
What i am attempting to do is make it so i can change a bit of text depnding if the user in question was the original poster of the thread.
I am doing this in cyb advanced forum statistics i have edited it and want it to change if the post in latest posts was created by the user it should say {username} posted in {forumname} but if they are not the thread creator it should read {username} replied in {forumname} I've gotten everything except the text change i was thinking an if statement should be used but for the life of me i cant figure out how to do it. Can anyone advise how to get this working? |
#2
|
|||
|
|||
![]()
I'm not sure I'm following - are any of the users you mention the logged in user (the user viewing the stats), or do you just want to compare the thread creator with the user who made the latest post in that thread?
|
#3
|
|||
|
|||
![]()
yes they are all logged in users, i just want it to check and if they are the thread creator it will say the posted in that forum otherwise it would say they replied in that forum
|
#4
|
|||
|
|||
![]()
I'm sorry I guess I didn't ask that right. In your first post, the first sentence refers to "the user in question" - which user is that exactly? Is it the "current" user who is viewing the stats, or the user who wrote the "latest post"? And is that the same as "the user" in the second sentence?
Sorry, maybe I'm being stupid or something. |
#5
|
|||
|
|||
![]()
It would be the user that wrote the latest post. all im trying to do is change "replied in" to "posted in" if that user is post number 1 in that preticular thread. hope thats worded better.
|
#6
|
|||
|
|||
![]()
OK, well hopefully I get it now. I think the problem is that when the plugin reads the latest post info from the db it doesn't get enough info to do what you want. But if you're willing to edit the plugin you can add it pretty easily. The plugin is "Cyb - Advanced Forum Statistics - FH", and you want to find this section (pretty near the top)
Code:
$get_stats_newposts = $vbulletin->db->query_read(" SELECT thread.threadid, thread.title, thread.lastpost, thread.lastpostid, thread.forumid, thread.lastposter, thread.dateline, thread.views, thread.replycount, thread.visible, thread.open, thread.prefixid, user.username, user.userid, user.usergroupid, user.displaygroupid FROM " . TABLE_PREFIX . "thread AS thread LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.username = thread.lastposter) then add ", thread.postuserid" to the end of the list of fields, so it looks like this (you have to scroll right to see what I added): Code:
$get_stats_newposts = $vbulletin->db->query_read(" SELECT thread.threadid, thread.title, thread.lastpost, thread.lastpostid, thread.forumid, thread.lastposter, thread.dateline, thread.views, thread.replycount, thread.visible, thread.open, thread.prefixid, user.username, user.userid, user.usergroupid, user.displaygroupid, thread.postuserid FROM " . TABLE_PREFIX . "thread AS thread LEFT JOIN " . TABLE_PREFIX . "user AS user ON (user.username = thread.lastposter) Then, I assume you're editing the template cyb_topstats_newposts, you should be able to use this condition: Code:
<if condition="$get_new_posts[postuserid] == $get_new_posts[userid]"> // user started thread <else /> // user didn't start thread </if> |
#7
|
|||
|
|||
![]()
Thank you, that worked like a charm it was actually in "Cyb - Advanced Forum Statistics - MN" but i bow down to you.
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|