Thread OP not matching IP Address
#262413
02/26/2019 1:34 PM
|
Joined: Mar 2015
Posts: 90
M4TT
OP
Journeyman
|
OP
Journeyman
Joined: Mar 2015
Posts: 90 |
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
|
|
|
Re: Thread OP not matching IP Address
[Re: M4TT]
#262414
02/26/2019 2:05 PM
|
Joined: Mar 2015
Posts: 90
M4TT
OP
Journeyman
|
OP
Journeyman
Joined: Mar 2015
Posts: 90 |
I logged out and it makes me appear as the OP. Could it have something to do with an unregistered post?
|
|
|
Re: Thread OP not matching IP Address
[Re: M4TT]
#262415
02/26/2019 3:17 PM
|
Joined: Dec 2003
Posts: 5,998
Ruben
|
Joined: Dec 2003
Posts: 5,998 |
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
|
|
|
Re: Thread OP not matching IP Address
[Re: M4TT]
#262416
02/26/2019 4:39 PM
|
Joined: Apr 2004
Posts: 1,549
isaac
|
Joined: Apr 2004
Posts: 1,549 |
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.
|
|
|
Re: Thread OP not matching IP Address
[Re: isaac]
#262417
02/26/2019 4:58 PM
|
Joined: Mar 2015
Posts: 90
M4TT
OP
Journeyman
|
OP
Journeyman
Joined: Mar 2015
Posts: 90 |
[...]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?
|
|
|
Re: Thread OP not matching IP Address
[Re: M4TT]
#262418
02/26/2019 5:26 PM
|
Joined: Apr 2004
Posts: 1,549
isaac
|
Joined: Apr 2004
Posts: 1,549 |
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.
|
|
|
Re: Thread OP not matching IP Address
[Re: M4TT]
#262419
02/26/2019 5:45 PM
|
Joined: Jun 2006
Posts: 15,852
Gizmo
|
Joined: Jun 2006
Posts: 15,852 |
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}]
|
|
|
Re: Thread OP not matching IP Address
[Re: M4TT]
#262420
02/26/2019 5:45 PM
|
Joined: Apr 2004
Posts: 1,549
isaac
|
Joined: Apr 2004
Posts: 1,549 |
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}
|
|
|
Re: Thread OP not matching IP Address
[Re: M4TT]
#262421
02/26/2019 6:00 PM
|
Joined: Apr 2004
Posts: 1,549
isaac
|
Joined: Apr 2004
Posts: 1,549 |
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.
|
|
|
Re: Thread OP not matching IP Address
[Re: M4TT]
#262422
02/26/2019 6:20 PM
|
Joined: Mar 2015
Posts: 90
M4TT
OP
Journeyman
|
OP
Journeyman
Joined: Mar 2015
Posts: 90 |
Excellent, thanks everyone! By change future unregistered/anonymous posts can utilize the OP feature via IP address?
|
|
|
Re: Thread OP not matching IP Address
[Re: M4TT]
#262423
02/26/2019 6:22 PM
|
Joined: Jun 2006
Posts: 15,852
Gizmo
|
Joined: Jun 2006
Posts: 15,852 |
No, the feature is unavailable to anonymous users as it utilizes the UserID vs IP Address (as IP addresses are generally non-static).
|
|
|
Re: Thread OP not matching IP Address
[Re: M4TT]
#262424
02/26/2019 9:18 PM
|
Joined: Mar 2015
Posts: 90
M4TT
OP
Journeyman
|
OP
Journeyman
Joined: Mar 2015
Posts: 90 |
Hey Gizmo,
I replaced the code in each file, it worked! However, the style for OP is missing.
|
|
|
Re: Thread OP not matching IP Address
[Re: M4TT]
#262425
02/26/2019 10:58 PM
|
Joined: Apr 2004
Posts: 1,549
isaac
|
Joined: Apr 2004
Posts: 1,549 |
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'}
|
|
|
3 registered members (Ruben, JAISP, Gizmo),
69
guests, and 379
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|