|
Joined: Mar 2015
Posts: 96 Likes: 1
Journeyman
|
Journeyman
Joined: Mar 2015
Posts: 96 Likes: 1 |
Hi, Lately, I've noticed that some posters are appearing as the OP, but are from completely different IP Addresses. I've also posted on a thread and it showed that I was the OP, but wasn't the original poster... https://tinyurl.com/yxsln7zxMatt
|
|
|
|
Joined: Mar 2015
Posts: 96 Likes: 1
Journeyman
|
Journeyman
Joined: Mar 2015
Posts: 96 Likes: 1 |
I logged out and it makes me appear as the OP. Could it have something to do with an unregistered post?
|
|
|
|
Joined: Dec 2003
Posts: 6,560 Likes: 78
|
Joined: Dec 2003
Posts: 6,560 Likes: 78 |
Looks like you may have found a bug. I just tried reply to last post and reply to topic as a guest. They both show as op.
Blue Man Group There is no such thing as stupid questions. Just stupid answers
|
|
|
|
Joined: Apr 2004
Posts: 1,945 Likes: 145
|
Joined: Apr 2004
Posts: 1,945 Likes: 145 |
OP generation is not based upon IP addresses. It is based upon the topic creator of the current thread. If you've merged threads together from multiple accounts, then there will be multiple OPs, as those accounts had each been the OP of their own thread before you merged them together.
|
|
|
|
Joined: Mar 2015
Posts: 96 Likes: 1
Journeyman
|
Journeyman
Joined: Mar 2015
Posts: 96 Likes: 1 |
[...]If you've merged threads together from multiple accounts, then there will be multiple OPs, as those accounts had each been the OP of their own thread before you merged them together. Hmm, hadn't merged any threads... Could this be because I installed a testing Ubb.threads forum using the same database under a different prefix?
|
|
|
|
Joined: Apr 2004
Posts: 1,945 Likes: 145
|
Joined: Apr 2004
Posts: 1,945 Likes: 145 |
Each new topic gets a single line within the ubbt_TOPICS table.
FROM THE SCRIPT: $opid = $topic_info['USER_ID'];
$topic_info['USER_ID'] is the USER_ID stored in the ubbt_TOPICS table for that TOPIC.
FROM THE TEMPLATE: {if $postrow[post].userid eq $opid}OP{/if} $postrow[post].userid is the USER_ID of that single post from the ubbt_POSTS table.
Conclusion, if the USER_ID of that single post matches the USER_ID of the TOPIC, then "OP" is displayed.
Feel free to open up both the script (scripts/showflat.inc.php @ ~ line 205) and the template (templates/default/post_side.tpl @ ~ line 101, and ~ line 127) and read it yourself.
|
|
|
|
Joined: Jun 2006
Posts: 16,292 Likes: 116
|
Joined: Jun 2006
Posts: 16,292 Likes: 116 |
Anon users shouldn't have OP indicators, as every uid of a guest user would be uid #1. You can edit the code from: {if $postrow[post].userid eq $opid}OP{/if} To: {if $postrow[post].userid eq $opid && $postrow[post].userid neq '1'}OP{/if} In: [gremelin@vnc ~]# grep -r "opid" /home/public_html/forum/
/home/public_html/forum/templates/default/post_gallery.tpl:{if $postrow[post].userid eq $opid}<span class="lmar post-op">OP</span>{/if}
/home/public_html/forum/templates/default/post_top.tpl:{if $postrow[post].userid eq $opid}<span class="post-op">OP</span>{/if}
/home/public_html/forum/templates/default/post_side.tpl:{if $postrow[post].userid eq $opid}<span class="post-op">OP</span>{/if}
/home/public_html/forum/templates/default/post_side.tpl:{if $postrow[post].userid eq $opid}<span class="post-op fr">OP</span>{/if}]
|
|
|
|
Joined: Apr 2004
Posts: 1,945 Likes: 145
|
Joined: Apr 2004
Posts: 1,945 Likes: 145 |
Gizmo pointed out in IM, that all of your commenters are from users of the Anonymous account.
Within UBB.threads, Anonymous USER ID is always user 1 within the database.
Maybe the code should be updated to include, {if $postrow[post].userid ne '1'}OP{/if}
|
|
|
|
Joined: Apr 2004
Posts: 1,945 Likes: 145
|
Joined: Apr 2004
Posts: 1,945 Likes: 145 |
Thanks Giz for the pointer. And thanks M4TT for drawing attention to this.
The OP logic has been updated to prevent posts from anonymous users from being tagged with OP indicators.
|
|
|
|
Joined: Mar 2015
Posts: 96 Likes: 1
Journeyman
|
Journeyman
Joined: Mar 2015
Posts: 96 Likes: 1 |
Excellent, thanks everyone! By change future unregistered/anonymous posts can utilize the OP feature via IP address?
|
|
|
|
Joined: Jun 2006
Posts: 16,292 Likes: 116
|
Joined: Jun 2006
Posts: 16,292 Likes: 116 |
No, the feature is unavailable to anonymous users as it utilizes the UserID vs IP Address (as IP addresses are generally non-static).
|
|
|
|
Joined: Mar 2015
Posts: 96 Likes: 1
Journeyman
|
Journeyman
Joined: Mar 2015
Posts: 96 Likes: 1 |
Hey Gizmo,
I replaced the code in each file, it worked! However, the style for OP is missing.
|
|
|
|
Joined: Apr 2004
Posts: 1,945 Likes: 145
|
Joined: Apr 2004
Posts: 1,945 Likes: 145 |
Hey Gizmo,
I replaced the code in each file, it worked! However, the style for OP is missing. Not Gizmo, but I'm here now, and can reply for him In the first section of his post, he gave examples of what Smarty code needs to be changed. Not direct replacements for stock code. He was using my simple examples as the base of his demonstration, rather than using actual stock code. This was intentional, as to demonstrate and focus on the root cause of the issue. Modify the Smarty clauses, and keep the spans within the list as shown in the grep code window Gizmo posted. IN THESE THREE STOCK TEMPLATE FILES - templates/default/post_gallery.tpl (1x) templates/default/post_top.tpl (1x) templates/default/post_side.tpl (2x) FIND - {if $postrow[post].userid eq $opid} REPLACE WITH - {if $postrow[post].userid eq $opid && $postrow[post].userid neq '1'}
|
|
|
1 members (Havenofsobriety),
522
guests, and
99
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|