inherit
208636
0
Sept 7, 2020 9:37:44 GMT -8
s54smg2
72
April 2014
s54smg2
|
Post by s54smg2 on Jan 20, 2015 15:55:26 GMT -8
Forum URL: m3support.netIs there a way I can change this text? ("you do not have permission to access this board.") Id like it to say ("This area is exclusively for members. Sign up today for full access to the site!")
|
|
inherit
(??_?)
181912
RIP RIP RIP Almost RIP - Why does this social section still exist?
0
1
Jul 6, 2015 20:35:17 GMT -8
CheatAreZee
56,804
March 2005
zyvoloski
Ricky's Mini-Profile
|
Post by CheatAreZee on Jan 20, 2015 16:03:50 GMT -8
|
|
inherit
208636
0
Sept 7, 2020 9:37:44 GMT -8
s54smg2
72
April 2014
s54smg2
|
Post by s54smg2 on Jan 20, 2015 16:07:13 GMT -8
thank you very much
|
|
inherit
(??_?)
181912
RIP RIP RIP Almost RIP - Why does this social section still exist?
0
1
Jul 6, 2015 20:35:17 GMT -8
CheatAreZee
56,804
March 2005
zyvoloski
Ricky's Mini-Profile
|
Post by CheatAreZee on Jan 20, 2015 16:12:25 GMT -8
You're welcome! Hope it helps
|
|
inherit
208636
0
Sept 7, 2020 9:37:44 GMT -8
s54smg2
72
April 2014
s54smg2
|
Post by s54smg2 on Jan 20, 2015 16:16:14 GMT -8
I actually cannot get it to function.
|
|
inherit
208636
0
Sept 7, 2020 9:37:44 GMT -8
s54smg2
72
April 2014
s54smg2
|
Post by s54smg2 on Jan 20, 2015 16:26:12 GMT -8
any suggestions?
|
|
inherit
(??_?)
181912
RIP RIP RIP Almost RIP - Why does this social section still exist?
0
1
Jul 6, 2015 20:35:17 GMT -8
CheatAreZee
56,804
March 2005
zyvoloski
Ricky's Mini-Profile
|
Post by CheatAreZee on Jan 20, 2015 16:34:35 GMT -8
That was the only one that I personally knew of, if it didn't work out then the code may need updating. I'll have a look around to see if there are any other solutions people have used to accomplish the same thing and will report back (if anyone reading knows of a solution off hand, feel free to post it)
|
|
Former Member
inherit
guest@proboards.com
181302
0
Nov 25, 2024 15:22:03 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jan 20, 2015 16:43:21 GMT -8
CheatAreZee, I have tried this on one of my sites, and it does not work for me. Any ideas on why it would not work? EDIT: Forget getting ninja'd, I done got double ninja'd...LOL
|
|
inherit
208636
0
Sept 7, 2020 9:37:44 GMT -8
s54smg2
72
April 2014
s54smg2
|
Post by s54smg2 on Jan 20, 2015 16:45:48 GMT -8
Looking at the code: Is this for members that are logged in and do not have permission? I am hoping to change this message for NON- MEMBERS only, those who are not signed up with the site
<!-- start of permissions message to guests -->
<script>
$(document).ready(function() {
if(proboards.data('route').name == "user" && proboards.data('user').is_logged_in != 1) {
$('div.container.show-user').html('<div class="title-bar"><h2>YOUR TITLE BAR TEXT HERE</h2></div><div class="content cap-bottom" style="padding:5px;">YOUR ERROR TEXT HERE</div>');
}
});
</script>
<!-- end of permissions message to guests -->
|
|
inherit
(??_?)
181912
RIP RIP RIP Almost RIP - Why does this social section still exist?
0
1
Jul 6, 2015 20:35:17 GMT -8
CheatAreZee
56,804
March 2005
zyvoloski
Ricky's Mini-Profile
|
Post by CheatAreZee on Jan 20, 2015 16:58:19 GMT -8
I did a test with the Swap It code and that appears to be able to replace the message. Use this and it should work out
|
|
inherit
208636
0
Sept 7, 2020 9:37:44 GMT -8
s54smg2
72
April 2014
s54smg2
|
Post by s54smg2 on Jan 20, 2015 17:06:08 GMT -8
no thanks. Didnt work the first time and Im not a programmer. Seems a bit much, and how do I know this wont affect random similar text in the future.
If anyone else that knows how to do it properly can help Id greatly appreciate it. Id hate to have this thread lost and marked solved with no follow up
|
|
inherit
(??_?)
181912
RIP RIP RIP Almost RIP - Why does this social section still exist?
0
1
Jul 6, 2015 20:35:17 GMT -8
CheatAreZee
56,804
March 2005
zyvoloski
Ricky's Mini-Profile
|
Post by CheatAreZee on Jan 20, 2015 17:17:54 GMT -8
I went ahead and added it in for you. Your custom message should appear now And for ease of mind, the switch it code only replaces the full string. So unless you plan on posting the full "You do not have permission to access this board." text on the forum, you don't have to worry about other words being affected.
|
|
Former Member
inherit
guest@proboards.com
181302
0
Nov 25, 2024 15:22:03 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jan 20, 2015 17:21:11 GMT -8
s54smg2, I tested, and works great for me. This is what I added to my Global Footer: <script>
var swap = (function(){ return { it: function(a, b){ if(document.createTreeWalker){ var walker = document.createTreeWalker($("#content")[0], NodeFilter.SHOW_TEXT, function(n){ return n.data.match(new RegExp(a, "gi"))? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; }, false);
while(walker.nextNode()){ walker.currentNode.data = walker.currentNode.data.replace(new RegExp(a, "gi"), b); } } else if(document.body.createTextRange){ var r = document.body.createTextRange(); r.collapse(true);
while(r.findText(a)){ r.text = b; r.collapse(false); } } } }; })();
</script>
<script>
swap.it("Oops, there was an error!", "Unable to comply..."); swap.it("You do not have permission to access this board.", "Unauthorized Access to this section is prohibited.");
</script> Yes, I know... The lines I changed to, show it's for my Star Trek site.....LOL
|
|
inherit
208636
0
Sept 7, 2020 9:37:44 GMT -8
s54smg2
72
April 2014
s54smg2
|
Post by s54smg2 on Jan 20, 2015 17:38:55 GMT -8
It works. . . Just not a fantastic solution IMO.
Using this method means that anyone who types the original text will display the new text. . even if its just a reply to a post. I do understand that the chances of this happening in this case(with the error message) are slim, but still possible. ( just a note to anyone who might use it)
I am absolutely appreciative of the time spent figuring this out. I will use it temporarily, although I am hoping for a solid script like the one shown by David Clark specifically made for non member traffic. One that will not affect future "text" on the forum.
|
|
Former Member
inherit
guest@proboards.com
188474
0
Nov 25, 2024 15:22:03 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Jan 20, 2015 18:03:58 GMT -8
Then why don't you do something like
if(proboards.data('route').name == "board" && proboards.data('user').is_logged_in > 0) { swap.it("You do not have permission to access this board", "Login or Register to view this board"); } Just change "board" to where ever your are alerting your members.
I'm not really seeing how an error could happen with this
|
|