inherit
First Contributor
66253
0
Mar 18, 2024 11:09:20 GMT -8
aRMY83
2,925
December 2005
army83
|
Post by aRMY83 on Jul 25, 2016 15:37:33 GMT -8
|
|
inherit
235129
0
Jul 28, 2016 9:48:55 GMT -8
elaine26
2
July 2016
elaine26
|
Post by elaine26 on Jul 27, 2016 21:21:41 GMT -8
I would like to see this too.
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Jul 28, 2016 9:06:29 GMT -8
Here ya go... Just change the red as in the previous code.. Put it in your Global Footer. <script type="text/javascript"> <!-- var cellHTML='Please <a href="?&action=login">Login</a> or <a href="?&action=register">Register</a> to view';
if(pb.data('user').is_logged_in != 1) { $('.latest,. last').each(function(){ $(this).html(cellHTML); }); } //--> </script>
|
|
inherit
First Contributor
66253
0
Mar 18, 2024 11:09:20 GMT -8
aRMY83
2,925
December 2005
army83
|
Post by aRMY83 on Jul 28, 2016 10:05:32 GMT -8
Thank you Todge and it works perfect! Edit: i changed the red above to this:Please <a href="https://army83.forums.net/login">Login</a> or <a href="https://army83.forums.net/register">Register</a> to view this board.
|
|
inherit
First Contributor
66253
0
Mar 18, 2024 11:09:20 GMT -8
aRMY83
2,925
December 2005
army83
|
Post by aRMY83 on Jul 28, 2016 10:19:11 GMT -8
Hello TodgeWell I spoke to darn soon as it's not working as should be. (sorry) Here is my main site and I'm running forums.net army83.forums.net/This code should apply to guest only.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,846
January 2015
msg
|
Post by Lynx on Jul 28, 2016 11:13:50 GMT -8
aRMY83, I'm probably going to regret this (as my coding skills are "eh" at best), but I'll take a stab at this. Try changing this line (in Todge's code): $('.latest,. last').each(function(){
to this: $('.latest.last td').each(function(){
I don't think the comma needs to be there (inspect element showed both classes for that) and the td should leave the column headers (which are th) alone. I also saw a space between the dot and last (as seen in the first code box - which was a C&P), so I removed the space. ::crosses fingers::
|
|
inherit
First Contributor
66253
0
Mar 18, 2024 11:09:20 GMT -8
aRMY83
2,925
December 2005
army83
|
Post by aRMY83 on Jul 28, 2016 13:41:12 GMT -8
Hello Lynx Your "coding skills" are a hole lot better than mine. Having said... I made your changes: and now it's not showing the var cellHTML for guests. Edit: is it possible that somewhere there needs to indicate guest:
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,846
January 2015
msg
|
Post by Lynx on Jul 28, 2016 13:54:21 GMT -8
Let me grab part of ®i©hie's code from his template post that may help. I'll just post the entire code below to use: <script type="text/javascript"> <!-- var fid = pb.data('forum_id'); var cellHTML='Please <a href="https://login.proboards.com/login/" + fid + "/1">Login</a> or <a href="https://login.proboards.com/register/" + fid + ">Register</a> to view';
if(pb.data('user').is_logged_in != 1) { $('.latest.last td').each(function(){ $(this).html(cellHTML); }); }
//--> </script>
Hopefully that will fix it. Being a forums.net, though, I'm not sure. You may need to replace this: var cellHTML='Please <a href="https://login.proboards.com/login/" + fid + "/1">Login</a> or <a href="https://login.proboards.com/register/" + fid + ">Register</a> to view';
with this: var cellHTML='Please <a href="https://army83.forums.net/login">Login</a> or <a href="https://army83.forums.net/register">Register</a> to view';
Let me know how that goes.
|
|
inherit
First Contributor
66253
0
Mar 18, 2024 11:09:20 GMT -8
aRMY83
2,925
December 2005
army83
|
Post by aRMY83 on Jul 28, 2016 14:20:07 GMT -8
Sorry Lynx as that made no difference.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,846
January 2015
msg
|
Post by Lynx on Jul 28, 2016 14:46:11 GMT -8
Sorry, aRMY83. I'm all out of ideas.
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Jul 28, 2016 14:50:36 GMT -8
It's the selectors that are wrong.. I originally never told the code to only grab the <td> cells with the classnames. so it grabbed the <tr> cells too. So.... Change this line... $('.latest.last td').each(function(){To this.... $('td.latest, td.last').each(function(){That will then select the correct cells. Lynx, you do need the comma as we are searching for separate classnames. Good catch on the misplaced space though.
|
|
inherit
First Contributor
66253
0
Mar 18, 2024 11:09:20 GMT -8
aRMY83
2,925
December 2005
army83
|
Post by aRMY83 on Jul 28, 2016 15:30:32 GMT -8
No problem Lynx and thank you for valued assistance here. That is working in part now Todge and maybe I have not explained correctly what I would like to have. In Board Properties > Permissions > Who can access the board which it set for Members & Staff and because of this, when Guests view the forum, they will see Please Login or Register to view this text in the Last Post cell. When the Board Properties > Permissions > Who can access the board is set for Everyone, then Guests will access this board. Example: In red is set for Everyone to access. In yellow is set for Members & Staff only when logged in.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,846
January 2015
msg
|
Post by Lynx on Jul 28, 2016 16:21:09 GMT -8
aRMY83, I've got an idea or 2, but I won't be able to do anything tonight. I'll take a crack at this tomorrow if Todge doesn't get to it first. Just so I'm clear on this: - Boards that are accessible by Everyone should have the actual Last Post listed; - Boards that require login to access are the ones that should have the "Please Login or Register" statement. Also, would it bother you if you were to select which boards the Please Login ... should show up in if they were selectable in a plugin's UI? I don't know how to check permissions if trying to do this from a footer code - but I can take a look at that tomorrow too. There might be something in proboards.dataHash that might help on that.
|
|
inherit
First Contributor
66253
0
Mar 18, 2024 11:09:20 GMT -8
aRMY83
2,925
December 2005
army83
|
Post by aRMY83 on Jul 28, 2016 18:17:55 GMT -8
Hello Lynx Correct on these: and Here are a few boards: Member Introduction The Daily Thread Just Checking In Again, thank you for the assistance once again and greatly appreciated. Get some rest and see you tomorrow sometime.
|
|
inherit
140147
0
Nov 19, 2024 5:07:22 GMT -8
Nscalerr
Throw me to the wolves and I'll return leading the pack!
3,043
May 2009
nscalerr
|
Post by Nscalerr on Jul 29, 2016 3:10:39 GMT -8
I would be interested in this as well.
|
|