inherit
245375
0
Feb 4, 2023 21:24:41 GMT -8
queenfoxy
273
June 2017
queenfoxy
|
Post by queenfoxy on Sept 5, 2017 15:42:40 GMT -8
Is there code to make "Edited By" not show for admin?
I had code for this at my old Yuku board, but fear it would not work here.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,781
January 2015
msg
|
Post by Lynx on Sept 5, 2017 18:50:58 GMT -8
Try this in your global footer:
<script> $(document).ready(function() { if (pb.data('user').id == 1 && pb.data('route').name == "thread") { $('.edited_by').hide(); } }); </script>
|
|
inherit
245375
0
Feb 4, 2023 21:24:41 GMT -8
queenfoxy
273
June 2017
queenfoxy
|
Post by queenfoxy on Sept 5, 2017 20:25:44 GMT -8
Thanks MSG. I will give it a try.
<script>
$(document).ready(function() {
if (pb.data('user').id == 1 && pb.data('route').name == "thread") {
$('.edited_by').hide();
}
});
</script>
Is this (blue text) where I add the user name(s) for whom I do not want ediit to show? I am so sorry that I know but little about coding.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,781
January 2015
msg
|
Post by Lynx on Sept 5, 2017 20:34:20 GMT -8
queenfoxy, No. What that does is get the current user's ID number. In the case of the root admin (forum owner), this is 1. To add others, you will need to add their user ID (go to their profile and it will be the number after /user/. In my case on this forum, my profile is at support.proboards.com/user/217348 - so my user ID would be 217348. To modify the code to add another, just change this line: if (pb.data('user').id == 1 && pb.data('route').name == "thread") {
to this: if ((pb.data('user').id == 1 || pb.data('user').id == 2) && pb.data('route').name == "thread") {
this would check for users with the ID of 1 or 2. Say you wanted to hide the Edited By for users with ID's of: 1, 3, and 6. That code line would look like this: if ((pb.data('user').id == 1 || pb.data('user').id == 3 || pb.data('user').id == 6) && pb.data('route').name == "thread") {
Please take note that there is an extra set of ( ) in there when adding additional users, as highlighted here:
|
|
inherit
245375
0
Feb 4, 2023 21:24:41 GMT -8
queenfoxy
273
June 2017
queenfoxy
|
Post by queenfoxy on Sept 5, 2017 20:48:38 GMT -8
Hi MSG, I found footer below, but I did not find global footer. Could you be more specific on how to find where I need to go and how to get there? Sure would appreciate it. This is all still new to me.
/* Footer */
|
|
Kami
Forum Cat
Posts: 40,038
Mini-Profile Theme: Kami's Mini-Profile
#f35f71
156500
0
Offline
Jul 24, 2021 11:48:29 GMT -8
Kami
40,038
July 2010
kamiyakaoru
Kami's Mini-Profile
|
Post by Kami on Sept 5, 2017 20:48:43 GMT -8
You can also edit the templates directly by putting a negative conditional (if the user is not [ID number(s)]) though the caveat is that it would manually have to be done for each theme you have.
|
|
inherit
245375
0
Feb 4, 2023 21:24:41 GMT -8
queenfoxy
273
June 2017
queenfoxy
|
Post by queenfoxy on Sept 5, 2017 20:55:07 GMT -8
Oh thanks MSG. Didn't see your post before I posted my last one. I have to study this to make sure I know what I am doing before I do something wrong..
|
|
inherit
245375
0
Feb 4, 2023 21:24:41 GMT -8
queenfoxy
273
June 2017
queenfoxy
|
Post by queenfoxy on Sept 5, 2017 21:03:43 GMT -8
Thanks Kami. LOL!! I gota get this sorted out in my mind. I didn't think it would be this confusing and difficult. Will look at it again tomorrow,
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,781
January 2015
msg
|
Post by Lynx on Sept 5, 2017 23:43:37 GMT -8
Hi MSG, I found footer below, but I did not find global footer. Could you be more specific on how to find where I need to go and how to get there? Sure would appreciate it. This is all still new to me.
/* Footer */ Go to Admin > Structure > Header & Footer. Click on Global Headers & Footers. You'll get 2 boxes, the top is for Global Header and the bottom is Global Footer - you'll want the Global Footer.
You can also edit the templates directly by putting a negative conditional (if the user is not [ID number(s)]) though the caveat is that it would manually have to be done for each theme you have.
If done as a negative conditional for the user ID, remember that the OR's ( || ) need to be changed to AND's ( && ) in the ID comparison part - or it won't work properly.
|
|
inherit
245375
0
Feb 4, 2023 21:24:41 GMT -8
queenfoxy
273
June 2017
queenfoxy
|
Post by queenfoxy on Sept 6, 2017 8:21:32 GMT -8
Thanks MSG. With that kind of instruction, I feel sure I can do it. I do appreciate you greatly. Thanks again,
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,781
January 2015
msg
|
Post by Lynx on Sept 6, 2017 21:11:50 GMT -8
queenfoxy, Please let me know if that works for you or if you need further help.
|
|
inherit
Official Code Helper
65613
0
1
Apr 15, 2024 17:01:41 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,870
December 2005
horace
|
Post by Chris on Sept 7, 2017 19:32:57 GMT -8
Perhaps it is just me but I read the request as when the admin and cohorts makes an edit to any post nobody else but the admin and cohorts can see the "edited by" when viewing that post (naturally the original author should also be able to see it as well). The code you created Lynx interprets the request as when the admin and cohorts views a post "they" (the admin or any other userID included in the code) won't see the "edited by" but everyone else not included in the code would be able to see it just fine ??
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,781
January 2015
msg
|
Post by Lynx on Sept 8, 2017 1:01:18 GMT -8
Interesting point, Chris. Re-reading it now, with what's given, now it seems a bit vague as to whether it's when editing or viewing a post. Maybe I should just leave this stuff to you pros so I don't give anyone the wrong answer, as I had not even thought about when editing. EDIT: The only thing I can say as to how I saw it that way is because the field is labeled Edit Reason when editing a post and Edited by when viewing a post - so I had (maybe incorrectly) assumed it was when viewing a post.
|
|
inherit
Official Code Helper
65613
0
1
Apr 15, 2024 17:01:41 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,870
December 2005
horace
|
Post by Chris on Sept 8, 2017 1:13:52 GMT -8
You have proven yourself more than capable numerous times Lynx, it is just a matter of semantics here. However the request gets interpreted can lead to totally different approaches. To me it just makes more sense that the OP means they don't want others to see the admin's edits rather than they don't want the admin to see any edits (but others can see edits just fine)
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,781
January 2015
msg
|
Post by Lynx on Sept 8, 2017 8:21:56 GMT -8
queenfoxy, Chris brings up a good point. Which "Edited by" are you referring to: When EDITING a post: When VIEWING a post: The code I gave you hides when VIEWING a post. If you want it for when EDITING a post, that would be different code. So, which one were you looking to have hidden from the admin (and others)?
|
|