vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: Programming & Coding :: Code Requests & Support :: Hide chat box from guests - View Topic
Topic Rating: *****
Printable View
skindstad
Junior Member
**

[Avatar]

Posts: 41
Status: Offline
Gender: Female
Location: Denmark
Joined:  
Reputation: 4%  


pmwwwtwittermsnyahoovForum
Hide chat box from guests (18th Apr 10 at 5:51pm UTC)
Resolved
I tried with the code I know from another forum

<span id="hidden_content" style="display: none;">Code for Chat Box here</span>

But then it dissapears all together even when I'm logged in. Is there another code that can be used on vforums? Or am I doing something wrong.

Image
Nick
Very Senior Member
*****

[Avatar]

Posts: 3,009
Status: Offline
Gender: Male
Location: vForums
Age: 31
Joined:  
Reputation: 62%  


pm
Re: Hide chat box from guests (18th Apr 10 at 7:15pm UTC)
First of all what chat box is it?
dog199200
Guest
Re: Hide chat box from guests (18th Apr 10 at 8:06pm UTC)
That is rather simple:

Global (If you want it to show on every page) or Main (if you only want it to show on the main page) Header:

Code:
 
  1. <script type="text/javascript">
  2. if(vf_username != "guest"){
  3. get('chatbox','id').style.display = '';
  4. }
  5. </script>
 


Put this in the header/footer where ever you want it to appear:
Code:
 
  1. <div id="chatbox" style="display:none">
  2. *Chat Box Code here*
  3. </div>
 


Just got to edit where it says *Chat Box Code here* with the code for your chat box.


This will go a check to make sure the user is actually logged in. There is NO restriction based on the type of chatbox it is outside of their own ToS {Tongue Out}

Edit: Make sure you place the first part at the very bottom of your footer. {Smile}
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Hide chat box from guests (18th Apr 10 at 10:34pm UTC)
Broken: I have updated your code to work {Smile}
dog199200
Guest
Re: Hide chat box from guests (18th Apr 10 at 10:45pm UTC)
Hmm ok, though I don't see why it wouldn't of worked before since i've done it that way for codes several times {Tongue Out}

Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Hide chat box from guests (19th Apr 10 at 3:19am UTC)
Posted By dog199200 on 18th Apr 10 at 10:45pm
 
Hmm ok, though I don't see why it wouldn't of worked before since i've done it that way for codes several times {Tongue Out}



get('chatbox','id').innerHTML;

Would do nothing, you haven't told it what to do with the innerHTML
dog199200
Guest
Re: Hide chat box from guests (19th Apr 10 at 3:58am UTC)
Thats interesting because I've bene using it in - http://www.divineshadowsonline.com/private/forum/regmodv1.js which has a coding base off of the "Extra Registration Page" code, for page creation, that you wrote {Tongue Out} And the code works great {Tongue Out} I just mimicked the system and added the login check {Tongue Out} but I could of missed something, just going off of what i've seen and done in the past {Tongue Out} my js sucks, i'll stick to PHP and .NET languages XD
skindstad
Junior Member
**

[Avatar]

Posts: 41
Status: Offline
Gender: Female
Location: Denmark
Joined:  
Reputation: 4%  


pmwwwtwittermsnyahoovForum
Re: Hide chat box from guests (19th Apr 10 at 7:19am UTC)
Thanks a million. It helped:)

Image
Michael
Moderator
*****

[Avatar]
Recoding the future

Posts: 4,043
Status: Offline
Gender: Male
Location: UK
Joined:  

Additional Groups:
Coding Team
***


Reputation: 58%  


pmtwittervForum
Re: Hide chat box from guests (19th Apr 10 at 9:35am UTC)
Posted By dog199200 on 19th Apr 10 at 3:58am
 
Thats interesting because I've bene using it in - http://www.divineshadowsonline.com/private/forum/regmodv1.js which has a coding base off of the "Extra Registration Page" code, for page creation, that you wrote {Tongue Out} And the code works great {Tongue Out} I just mimicked the system and added the login check {Tongue Out} but I could of missed something, just going off of what i've seen and done in the past {Tongue Out} my js sucks, i'll stick to PHP and .NET languages XD



Where exactly? I don't see the same syntax in your code. {Smile}
Aiken
Full Member
***

[Avatar]

Posts: 333
Status: Offline
Gender: Male
Location: In a very lonely place, the domain of despair
Age: 31
Joined:  
Reputation: 12%  


pmtwitterskypemsnyahooxfire
Re: Hide chat box from guests (19th Apr 10 at 4:57pm UTC)
The fixed code is just like the code I have been using alot on one of my forums

vF forums:
Perfect World RP
BLEACH Universe - Under Construction / Testing Phase
Xen Qarna RP - Stage I
Vyren Entar Battle Network RP - Under Construction / Maintenance Mode Enabled
the Final Anime Hideout
 Printable View

All times are GMT+0 :: The current time is 4:23am
Page generated in 3.7048 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums