|
|
| Topie: Hide Statistics for guests, display for members * |
|
|
|
|
| Sage |
so, yeah...I just coded this up. :)
*warning*
this will only work if you did not edit the login form (Username, or Password), and that you stats still have "A total of # posts have been made. "
you can have it 2 ways...
have the statistics hidden...

which the code would be:
Quote:
<script language="javascript">
<!--
//Hide Statistics for Guests, display for members
//Written by Dranew <http://s2.excoboard.com/exco/index.php?boardid=13054>
//Place in footer
var td = document.getElementsByTagName('td')
for(i=0;i<td.length;i++) {
for(s=0;s<td.length;s++) {
if(td[s].className=="FirstAlt" && td[s].width=="100%" && td[s].innerHTML.indexOf('posts have been made') != -1) {
if(td[i].innerHTML.indexOf('Username' || 'Password') != -1) {
td[s].style.display = "none"
}
}
}
}
//-->
</script>
|
or have it with a message:

and that code would be:
Quote:
<script language="javascript">
<!--
//Hide Statistics for Guests and display message, display for members
//Written by Dranew <http://s2.excoboard.com/exco/index.php?boardid=13054>
//Place in footer
var td = document.getElementsByTagName('td')
for(i=0;i<td.length;i++) {
for(s=0;s<td.length;s++) {
if(td[s].className=="FirstAlt" && td[s].width=="100%" && td[s].innerHTML.indexOf('posts have been made') != -1) {
if(td[i].innerHTML.indexOf('Username' || 'Password') != -1) {
td[s].innerHTML = "<span class=NormalText>You must Login to view the statistics!</span>"
}
}
}
}
//-->
</script>
|
and as always...
Live Preview
(Edited by Sage)
(Edited by Sage)
(Edited by Sage) |
|
|
| fin24000 |
Cool I relly like the 2nd one :) |
|
|
| Sage |
:) thanks!
The second onw is my favorite :) |
|
|
| Princess29 |
I like the 2rd but where do I stick the code? |
|
|
| Sage |
Feature settings > Footer :) |
|
|
| Koyana Nuva |
Very nice, Sage. I'm gonna have to top that! |
|
|
| Sage |
are we compeating? :S hehe ^_^ thanks! :) |
|
|
| Princess29 |
Thanks.. |
|
|
| Koyana Nuva |
Quote: Sage wrote:
are we competing? :S hehe ^_^ thanks! :)
|
Okay, Sage. I'm coming up with a script that should blow your pink programming socks off! ^^D You're gonna be impressed, at least that's what I'm going for... |
|
|
| fin24000 |
Can you tell me how I would add a login and Register link to it? |
|
|
| Koyana Nuva |
Quote:
<a href="register.php?boardid={boardid}">Register</a> | <a href="profile.php?boardid={boardid}">My Account</a>
|
|
|
|
| Koyana Nuva |
OR this...
Quote:
<script language="javascript">
<!--
//Hide Statistics for Guests and display message, display for members
//Written by Dranew <http://s2.excoboard.com/exco/index....p?boardid=13054>
//Place in footer
var td = document.getElementsByTagName('td')
for(i=0;i<td.length;i++) {
for(s=0;s<td.length;s++) {
if(td[s].className=="FirstAlt" && td[s].width=="100%" && td[s].innerHTML.indexOf('posts have been made') != -1) {
if(td[i].innerHTML.indexOf('Username' || 'Password') != -1) {
td[s].innerHTML = "<span class=NormalText>You must Login to view the statistics!</span>"
}
}
}
}
<tr>
<td class="FirstAlt"><!-- BEGIN iftrue_logincode -->
<table border="0" cellpadding="0" cellspacing="2"><form action="index.php" method="post">
<tr>
<td><span class="SmallText"><b>Username</b></span></td>
<td><span class="SmallText"><b>Password</b></span></td>
<td rowspan="2" valign="bottom"><input type="submit" class="SubmitButtons" value="Login" name="B1"></td>
</tr>
<tr>
<td><input type="text" class="TextInputField" name="fieldusername" size="10"></td>
<td><input type="password" class="TextInputField" name="fieldpassword" size="10"></td>
</tr>
<input type="hidden" name="action" value="login"><input type="hidden" name="boardid" value="{boardid}"></form></table>
<!-- END iftrue_logincode -->
<!-- BEGIN newpm -->
<span class="SmallText">
<a href="pm.php?boardid={boardid}"><b>Private Messages</b></a>: You have <b>{newpm.newpms}</b> unread messages</span>
<!-- END newpm -->
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<a href="register.php?boardid={boardid}">Register</a>
//-->
</script>
|
|
|
|
| Catchow |
Dranew,
Very nice! I especially like how you have provided two options. I hope that you added it to the index.
Koyana Nuva
There is no need for competion here. Dranew (Sage) has been here from near the beginning of Exco and has always been of the mind to help improve Exco. He simply isn't the competitive type and we don't really need or want "competions" here. If you can improve the coding, by all means feel free to do that but there is no need to blow your own horn. There is also no need for all your double and triple postings. Please use the edit button.
|
|
|
| rodent |
Nice code Dranew :) no need for competition people. Just work for the communiy :) i would love to beable to do what you guys can do, i know some of the basics, keep up the good work you two :) and the rest of you theres some really good scripts around :) |
|
|
| Koyana Nuva |
I know. The whole competition was a joke that went a little too far. Sorry, guys! ^^D ... But it did kinda work out. We got more scripts faster. I apologize to Sage if I offended him or anything...
Man, I'm breakin' the rules today! ^^D |
|
|
| KsTornado11 |
I tried the second one, but I ended up w/ the "you must log in" although I WAS logged in.. where did I screw up? |
|
|
| Sage |
Quote: Koyana Nuva wrote:
I know. The whole competition was a joke that went a little too far. Sorry, guys! ^^D ... But it did kinda work out. We got more scripts faster. I apologize to Sage if I offended him or anything...
Man, I'm breakin' the rules today! ^^D
|
haha none taken :) the joke was actually amusing :p
KsTornado11: may I see a preview of the script you used?
(Edited by Sage) |
|
|