Sign Up! Login: Password: New User? Forgot? Support
Code 
 
 
Forums 
Forums : Calendar & Events > Adding Signup Total
Mottie (SuperAdmin) 4/1/2011 1:52 PM EST : Adding Signup Total
ACK!
Mottie
Posts: 3883

0
Like

0
Dislike

Adding Signup Total

GuildPortal admin site link to original post

This code adds a total number ("Total: #" in the right upper corner) of signups for an event



Code

Add this code to a free form text/HTML widget on the same page as your calendar:
<script type="text/javascript">
$(document).ready(function(){
 var t = $('table[class*=signupsTable]');
 if (t.length){
  t.find('tr:first td').append('<span style="float:right">Total: ' + t.find('.NormGridRow,.AltGridRow').length + '</span>');
 }
});
</script>
Change the text in blue to customize the total text... also it's set to float right and you can modify that as well.

If you want to put the total somewhere else in the table, just tell me where and I'll modify the code.
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

Lakshmii (Applicant) 6/28/2011 7:13 AM EST : RE: Adding Signup Total
Lakshmii
Posts: 5066

0
Like

0
Dislike

This is now displaying on my site but the total is just showing at 0 for all events, so it doesnt seem to be reading the number of signs


http://soulcrusaders.guildportal.com
TopBottom

Mottie (SuperAdmin) 6/28/2011 10:14 AM EST : RE: Adding Signup Total
ACK!
Mottie
Posts: 3883

0
Like

0
Dislike

Hi Lakshmii!

The "NormGridRow" and "AltGridRow" was accidentally removed from the signup tables... I've been told they should be added back today, so just be patient and the code should start working again... if you are impatient, then find this line in the code:
t.find('tr:first td').append('<span style="float:right">Total: ' + t.find('.NormGridRow,.AltGridRow').length + '</span>');
and replace the part in red so you end up with this:
t.find('tr:first td').append('<span style="float:right">Total: ' + t.find('tr').length + '</span>');
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

Lakshmii (Applicant) 6/28/2011 11:57 AM EST : RE: Adding Signup Total
Lakshmii
Posts: 5066

0
Like

0
Dislike

Ah, great, thanks for the feedback!

Ill give it a few days and see if GP fix their side of things before i fiddle around too much 

Thanks again
TopBottom

Lakshmii (Applicant) 6/29/2011 2:32 AM EST : RE: Adding Signup Total
Lakshmii
Posts: 5066

0
Like

0
Dislike

Ok well this still isnt working this morning so i am impatient lol

I changed the bit you said in your reply, and it is working now but it seems to be showing the wrong numbers lol.

For a previous event, it is showing 24 signs when there are only 22 signs and for an event set for tonight, we have 7 signs but its showing 8

I doubt its from people signing up and removing their sign later as I am constantly checking the signs and have not noticed any missing - plus we ask our guildies to not remove their signs but to cancel them rather, to avoid the organisers thinking they are going crazy or cant count
TopBottom

Mottie (SuperAdmin) 6/29/2011 8:49 AM EST : RE: Adding Signup Total
ACK!
Mottie
Posts: 3883

0
Like

0
Dislike

Hi Lakshmii!

DOH, I forgot to subtract out the "signups" row and the header row... so you can subtract 2 from the total.
<script type="text/javascript">
$(document).ready(function(){
 var t = $('table[class*=signupsTable]');
 if (t.length){
  t.find('tr:first td').append('<span style="float:right">Total: ' + (t.find('tr').length - 2) + '</span>');
 }
});
</script>
But maybe it would be better if the total was only for confirmed?
<script type="text/javascript">
$(document).ready(function(){
 var t = $('table[class*=signupsTable]');
 if (t.length){
  t.find('tr:first td').append('<span style="float:right">Total: ' + t.find('td:contains(Confirmed)').length + '</span>');
 }
});
</script>
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

Lakshmii (Applicant) 6/29/2011 11:20 AM EST : RE: Adding Signup Total
Lakshmii
Posts: 5066

0
Like

0
Dislike

haha thanks

Sticking with number of all signed  as it makes it easier to do a quick overview when there are loads of signs
TopBottom

Shatarg (Applicant) 6/30/2011 12:36 PM EST : RE: Adding Signup Total

Shatarg
Posts: 108

0
Like

0
Dislike

Is it possible to get this "total" information into the weekly calender popout "window" thing.
Not realy sure what its called. But when you have your mouse over the weekly event, it shows you the date in a little window close to the mouse. Where it tells you which time the event start.

Also did some ghetto coding (since i know none) but couldn't get it to look nice.
So guess there is a better way to do this.


<script type="text/javascript">
$(document).ready(function(){
 var t = $('table[class*=signupsTable]');
  if (t.length){
  t.find('tr:first td').append('<span style="float:right">Tentative: ' + t.find('td:contains(Tentativ)').length + '</span>');
 }
 if (t.length){
  t.find('tr:first td').append('<span style="float:right">Available: ' + t.find('td:contains(Available)').length + '</span>');
 }
});
</script>
WWW.viking-alliance.guildportal.com

TopBottom

Mottie (SuperAdmin) 7/2/2011 10:45 AM EST : RE: Adding Signup Total
ACK!
Mottie
Posts: 3883

0
Like

0
Dislike

Hi Shatarg!

Ok I've updated the event tooltip script, basically just set the "showTotal" option to true.
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

 
 
Key 
New posts No new posts
New posts ( popular ) No new posts ( popular )
New posts ( sticky ) No new posts ( sticky )
New posts ( locked ) No new posts ( locked )
 
 
Who's Online 
There are   members online.
 
 
So-and-so has logged on!
%title%
%message%