SMF For Free Support Forum
Signup For Free Forum
November 22, 2008, 01:25:22 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Welcome to SMF For Free. The best free SMF Host
 
   Home   Help Search Arcade Gallery Login Register  

Pages: [1]
  Print  
Author Topic: [REQ] Hide Tab From Guests  (Read 406 times)
0 Members and 1 Guest are viewing this topic.
Stitch
SMF For Free Full Member
*
Offline Offline

Posts: 215


VMK will always remain in my heart.


View Profile WWW
« on: September 04, 2008, 07:53:29 pm »

Hey can someone either point me to a code or make a code that allows me to hide certain tabs from guests?
Logged

Agent Moose
Moderator
*****
Offline Offline

Posts: 666


Do not PM me for Code Support or Request


View Profile
« Reply #1 on: September 04, 2008, 08:04:51 pm »

Try this:
(Footers)
Code:
<script>
function HideFromG(Tab){
//Created by Agent Moose
var name = document.getElementsByTagName("span");
for(v=0;v<name.length;v++){
if(!name[v].innerHTML.match(/Hello <b>(.*)<\/b>/i)){
$("td.maintab_back").each(function(){if(this.innerHTML == Tab) this.style.display = "none"})
};};};
HideFromG("TAB");
</script>

TAB = the Tab Name

To hide more tabs from guests, add more of these lines:
Code:
HideFromG("TAB");
Logged



SMC Code Index - The best Code Index for all your Needs!  Includes a bunch of codes not on Support.[/cen
Stitch
SMF For Free Full Member
*
Offline Offline

Posts: 215


VMK will always remain in my heart.


View Profile WWW
« Reply #2 on: September 04, 2008, 08:13:19 pm »

Forum Url: http://disneydreams.smfforfree4.com
Hmm i dont think it is working

Try it it should hide the Arcade Tab
Logged

Agent Moose
Moderator
*****
Offline Offline

Posts: 666


Do not PM me for Code Support or Request


View Profile
« Reply #3 on: September 04, 2008, 08:26:41 pm »

try this:
Code:
<script>
function HideFromG(Tab){
//Created by Agent Moose
var name = document.getElementsByTagName("span");
for(v=0;v<name.length;v++){
if(name[v].innerHTML.match(/Guest/i)){
$("td.maintab_back").each(function(){if(this.innerHTML == Tab) this.style.display = "none"})
};};};
HideFromG("TAB");
</script>
Logged



SMC Code Index - The best Code Index for all your Needs!  Includes a bunch of codes not on Support.[/cen
Stitch
SMF For Free Full Member
*
Offline Offline

Posts: 215


VMK will always remain in my heart.


View Profile WWW
« Reply #4 on: September 04, 2008, 08:33:28 pm »

hmm sorry no Sad
Logged

Celebrus
SMF For Free Hero
*
Offline Offline

Posts: 818


Previously known as Omikron


View Profile WWW
« Reply #5 on: September 05, 2008, 01:12:01 am »

Code:
<script>
if(!$('td.titlebg2 span b').not($("td.titlebg2 span b:contains(News)")).html())
{
$("table tbody tr td.maintab_back:contains(Help)").hide();
}
</script>

? Works for me.
Logged


||
Stitch
SMF For Free Full Member
*
Offline Offline

Posts: 215


VMK will always remain in my heart.


View Profile WWW
« Reply #6 on: September 05, 2008, 03:11:59 pm »

Thanks that one did the trick Smiley thanks this will help out alot!
Logged

Agent Moose
Moderator
*****
Offline Offline

Posts: 666


Do not PM me for Code Support or Request


View Profile
« Reply #7 on: September 05, 2008, 07:53:13 pm »

I wasn't trying to use jquery cele Tongue  Oh well.  I don't code nearly as much as i used to Tongue
Logged



SMC Code Index - The best Code Index for all your Needs!  Includes a bunch of codes not on Support.[/cen
Stitch
SMF For Free Full Member
*
Offline Offline

Posts: 215


VMK will always remain in my heart.


View Profile WWW
« Reply #8 on: September 05, 2008, 08:16:54 pm »

yea well me either actually i never coded erm let me get back to reading my book >_< -goes to corner and reads coding for dummies-  buck2
Logged

Celebrus
SMF For Free Hero
*
Offline Offline

Posts: 818


Previously known as Omikron


View Profile WWW
« Reply #9 on: September 05, 2008, 08:45:57 pm »

I don't like using pure javascript in situations like this where you have no control over the source code, it just makes it longer.
Logged


||
Stitch
SMF For Free Full Member
*
Offline Offline

Posts: 215


VMK will always remain in my heart.


View Profile WWW
« Reply #10 on: September 05, 2008, 09:39:09 pm »

*gets out javascript for dummies and looks for source code* umm sure yea...O_o
Logged



Pages: [1]
  Print  
 
Jump to:  

cheap low cost web hosting reviews

Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
ServerBeach Coupon
Page created in 0.401 seconds with 17 queries.