MyBB Community Forums

Full Version: Show Image for Thread Creator and posts in his thread?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Im using template conditionals.

And i am using the below code to display the text op next to a thread author and his posts. But it assigns all guests as the same op when they are not because the user id is 0.

<if $thread['uid'] == $post['uid'] then>(OP)</if>

Can i change the above code to work for guests too, maybe base it on ip?
not sure whether i understood correctly....

you mean, guests are allowed to post in your forums... and those posts have the OP text... that shouldnt happen, the code that you have used should take care of that... $thread['uid'] will not be equal to $post['uid'] for posts by a guest...
(2015-01-25, 07:56 AM)mmadhankumar Wrote: [ -> ]not sure whether i understood correctly....

you mean, guests are allowed to post in your forums... and those posts have the OP text... that shouldnt happen, the code that you have used should take care of that... $thread['uid'] will not be equal to $post['uid'] for posts by a guest...

It works for users.

But if a guest makes a thread, The op text shows, but regardless of if its the same guest or not it shows the op text.

It assigns guests it because all guest id's are 0 so it shows op text.
you allow guests to make new threads in your forum... i didnt expect that... Toungue

yeah thats an issue... and a difficult one to address... because ip address is not a reliable one as it can vary for every session...
(2015-01-25, 10:28 AM)mmadhankumar Wrote: [ -> ]you allow guests to make new threads in your forum... i didnt expect that... Toungue

yeah thats an issue... and a difficult one to address... because ip address is not a reliable one as it can vary for every session...

Do you have any suggestions on any way i could accomplish this? Or should i give up?

Oh yeah its the backbone of my userbase Big Grin
I hate to say it, but I'd just give up with that idea. You don't know if the guest will have a different ip each time they go online.
(2015-01-26, 01:14 PM)dragonexpert Wrote: [ -> ]I hate to say it, but I'd just give up with that idea.  You don't know if the guest will have a different ip each time they go online.

Well most of the guests that visit my site are going to be hit and runs, not to mention they use a lot of proxies.

It would not matter so much about the ip always changing because of the type of userbase.