Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization:
Sitewide Flash Counters/Stats
temp



Joined: 30 Aug 2004
Posts: 74

Posted: 09/02/04 05:31 
A way to incorporate site-wide stats into a Flash movie.

This specific version lets you view the total number of bands/artists. You can change the variables to show any one of the various types of count that the get_counts.php file uses - total streams, total downloads etc. I'll leave it to you to work out the other variations and associated variables.

1. Create a php file containing the following code:


Code
<?php
require('include/jamroom-include.inc.php');
checkDeepLink(0);

$rv = "SELECT COUNT(*) AS count FROM {$jamroom_db['band_info']}";
$cn = dbConnect();
$rs = dbQuery($rv);
if (mysql_num_rows($rs) > 0)
{
$_rt = mysql_fetch_assoc($rs);
$flashcount = $_rt['count'];
echo "artists=$flashcount";
}
else
{
echo '0';
}
dbClose($cn);
?>


2. Name the file artistcount.php, upload it to your jamroom directory
3. Within Flash, create a dynamic text field with the variable 'artists' (without single quotes)
4. Add the following frame action on the root timeline:

Code
loadVariables("http://www.yourdomain.com/jamroomfolder/artistcount.php", "");

5. Upload your Flash movie and run it.

All that would need to be substituted in the first section of the above code to display a different type of count is 'band_info' and 'artists'. For example you could instead use 'song_info' (an existing jamroom variable) and 'songs' (which would also be the new text field variable in flash). This would display total songs. Oh, and you'd save it to a new file with a different name that you'd reference in Flash (step 4 above).

As you all probably know, you can embed the Flash movie within a header template, on your front page or anywhere you like really.

Took me bleedin' ages to suss this out, and it's a bit long-winded, but I thought I'd pass it on. You can see it in action here, at the bottom right of the page.

Cheers.

Back to top
temp



Joined: 30 Aug 2004
Posts: 74

Posted: 09/02/04 06:13 
Ooh, just noticed a slight problem in the get_counts.php process when you're listing all songs. I have a quota which is just for advertisements and these songs are being included in the output. I'd like them to be hidden from the output as they are in the charts and ranks etc.

I'll have to delve deeper and try and work this one out.

Any ideas?

Back to top
djmerlyn
Jamroom Ustad


Joined: 18 Dec 2003
Posts: 13497
Location: Behind You

Posted: 09/02/04 11:36 
go in and modify the quota so that it's not allowed in rank.php then the songs will not show up.

Cheers!


_________________
Pro JR Hosting, now 50% off!
-100% Guaranteed

"more server and network power than any host, dedicated to your jamroom site"
Back to top
temp



Joined: 30 Aug 2004
Posts: 74

Posted: 09/02/04 18:49 
I've already got everything turned off in the advertising quota - and I don't think I'm referencing rank.php at all when I call get_counts (or my hacked versions of it).

The get_counts for artists is also displaying one too many, ie - showing the advertising artist.

Any ideas?

Cheers.

Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 09/03/04 14:42 

temp:
I've already got everything turned off in the advertising quota - and I don't think I'm referencing rank.php at all when I call get_counts (or my hacked versions of it).

The get_counts for artists is also displaying one too many, ie - showing the advertising artist.

Any ideas?

Cheers.


The "get_counts" script is a very basic script meant just to grab "numbers" from the database, without doing validation on quota, etc. Since typically it would be used on the front page of a site, etc., having it perform a complex query with every page load could be a lot on the system load.

Like you have done though, you can always create your own custom query.

Hope this helps!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.