///THIS USES THE MAMBO PARAMETER FOR LIMIT
///Call it using "limit=10" of whatever number you want
///YOUR URL TO THE BAND SITE HERE
$band_url = "http://www.mosiq.com/jamroom/bands/";
$bullet_img = "http://www.mosiq.com/images/logo.gif";
$params = mosParseParams($module->params);
$limit = @$params->limit ? $params->limit : 5;
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$query = "SELECT s.song_id, s.song_time, s.song_name, s.song_album, s.song_label, s.song_genre, s.song_lyrics, s.song_history, i.band_id, i.band_time, i.band_name, i.band_location, i.band_website, h.hifi_size, h.hifi_download, h.hifi_extension, l.lofi_size, l.lofi_download, l.lofi_extension, SUM(c.hifi_scount_total + c.lofi_scount_total) AS total_stream, SUM(c.hifi_dcount_total + c.lofi_dcount_total) AS total_download, SUM((c.hifi_scount_total + c.lofi_scount_total) + (c.hifi_dcount_total + c.lofi_dcount_total)) AS total_count, g.genre_name"
."\nFROM jamroom_song_info AS s"
."\nLEFT JOIN jamroom_band_info AS i ON i.band_id = s.band_id"
."\nLEFT JOIN jamroom_song_hifi AS h ON h.song_id = s.song_id"
."\nLEFT JOIN jamroom_song_lofi AS l ON l.song_id = s.song_id"
."\nLEFT JOIN jamroom_scounter AS c ON c.song_id = s.song_id"
."\nLEFT JOIN jamroom_quota AS q ON q.quota_id = i.band_quota"
."\nLEFT JOIN jamroom_song_genre AS g ON g.genre_id = s.song_genre"
."\nWHERE s.song_show != 'no' AND q.quota_rank = 'yes'"
."\nAND (h.hifi_size > 0 OR l.lofi_size > 0) GROUP BY s.song_id ORDER BY total_count DESC LIMIT $limit";
I have two databases running on the same server. One mySQL database for the MOS and the other mySQL database is used for Jamroom. Do you have an example of the code I would need to change to make this great Mod work.
Thanks again
I need to find my username and password for my the Jamroom database. I'm going to point my mambo site at the same database but cannot remember what username and password I used. What config file would I look these up under?
Joined: 20 Feb 2004
Posts: 126
Location: Phildadelphia, PA USA
Posted: 07/17/04 10:26
The username and password on my hosting company is the same for all of my databases, I dont believe I can specify different passwords for my DB's, but if I could, I dont imagine it would be stored blatently in some file.
You can use the built in mambo class to connect to the jamroom db, or just use php to do it manually
[/code]
Yeah, I just went and merged the mambo and jamroom db's together. Everything works great now. As Werkkrew said, you can just use the mambo or php options to have it connect to the other db, but merging the two db's took like 30 seconds and I didn't have to edit code, so that was much eaiser.
Joined: 30 Jun 2004
Posts: 14
Location: Atlanta, Ga.
Posted: 07/24/04 12:40
Ok- I am using werkkrew's module for spotlight with mambo and it seems to be displaying and working. The problem is that the spotlight band does not randomly change. Is anyone else having this problem?
I have also made the Spotlight Mod work but the band never changes. It doesn't matter what Band ID I place in the spotlight module it always shows the first band that signup with us. Does not show bands at random.
Hope this little helps.
Peace
Joined: 15 Jan 2004
Posts: 954
Location: united kingdom
Posted: 07/27/04 02:10
ive attempted aprox 20 edits of this,and it doesnt work - for the record the php file in the hottest bands is different from yours displayed werkkrew,so i even tried copy & pasting yours ,substuting all Url etc,.. still no luck/....... i have a feeling its something to do with the version im on,.im on version 1.09 stable Mambo,also maybe its something to do with some of the " when they should be ' ? id love to get this working tho
I never noticed that issue because I always choose my spotlighted artists, I never let jamroom choose, so I guess I never noticed.
First thing I would like to say is
Thank you werkkrew for all your hard work with these mods for Mambo.
I have been trying to choose my spotlight artist in the werkkrewSpotlight mod. But for some reason it always shows the same artist. Here is my code I'm using on my site.
foreach($rows AS $_row)
{
if (!empty($_row->hifi_size) && $_row->hifi_size != 0)
{
$_rep['{SONG_HIFI_PLAY_LINK}'] = $jamroom_url."/play.php?band_id=".$_row->band_id."&song_id=".$_row->song_id."&mode=song_hifi";
$_rep['{SONG_HIFI_PLAY_IMAGE}'] = "<a href=\"".$jamroom_url."/play.php?band_id=".$_row->band_id."&song_id=".$_row->song_id."&mode=song_hifi\"><img src=\"".$jamroom_url."/rank/song/images/play_hifi.gif\" border=0 alt=\"click here to stream "".$_row->song_name."" in HIFI mode\" title=\"click here to stream "".$_row->song_name."" in HIFI mode\"></a>";
if ($_row['hifi_download'] == 'yes')
{
$_rep['{SONG_HIFI_DOWNLOAD_LINK}'] = $jamroom_url."/download.php?band_id=".$_row->band_id."&song_id=".$_row->song_id."&mode=song_hifi";
$_rep['{SONG_HIFI_DOWNLOAD_IMAGE}'] = $jamroom_url."/download.php?band_id=".$_row->band_id."&song_id=".$_row->song_id."&mode=song_hifi\"><img src=\"".$jamroom_url."/rank/song/images/down_hifi.gif\" border=0 alt=\"click here to download a HIFI version of "".$_row->song_name.""\" title=\"click here to download a HIFI version of "".$_row->song_name.""\"></a>";
}
else
{
$_rep['{SONG_HIFI_DOWNLOAD_LINK}'] = '';
$_rep['{SONG_HIFI_DOWNLOAD_IMAGE}'] = '-';
}
}
else
{
$_rep['{SONG_HIFI_PLAY_LINK}'] = '';
$_rep['{SONG_HIFI_PLAY_IMAGE}'] = '-';
$_rep['{SONG_HIFI_DOWNLOAD_LINK}'] = '';
$_rep['{SONG_HIFI_DOWNLOAD_IMAGE}'] = '-';
}
if (!empty($_row->lofi_size) && $_row->lofi_size != 0)
{
$_rep['{SONG_LOFI_PLAY_LINK}'] = $jamroom_url."/play.php?band_id=".$_row->band_id."&song_id=".$_row->song_id."&mode=song_lofi";
$_rep['{SONG_LOFI_PLAY_IMAGE}'] = "<a href=\"".$jamroom_url."/play.php?band_id=".$_row->band_id."&song_id=".$_row->song_id."&mode=song_lofi\"><img src=\"".$jamroom_url."/rank/song/images/play_lofi.gif\" border=0 alt=\"click here to stream "".$_row->song_name."" in LOFI mode\" title=\"click here to stream "".$_row->song_name."" in LOFI mode\"></a>";
if ($_row->lofi_download == 'yes')
{
$_rep['{SONG_LOFI_DOWNLOAD_LINK}'] = $jamroom_url."/download.php?band_id=".$_row->band_id."&song_id=".$_row->song_id."&mode=song_lofi";
$_rep['{SONG_LOFI_DOWNLOAD_IMAGE}'] = "<a href=\"".$jamroom_url."/download.php?band_id=".$_row->band_id."&song_id=".$_row->song_id."&mode=song_lofi\"><img src=\"".$jamroom_url."/rank/song/images/down_lofi.gif\" border=0 alt=\"click here to download a HIFI version of "".$_row->song_name.""\" title=\"click here to download a HIFI version of "".$_row->song_name.""\"></a>";
}
else
{
$_rep['{SONG_LOFI_DOWNLOAD_LINK}'] = '';
$_rep['{SONG_LOFI_DOWNLOAD_IMAGE}'] = '-';
}
}
else
{
$_rep['{SONG_LOFI_PLAY_LINK}'] = '';
$_rep['{SONG_LOFI_PLAY_IMAGE}'] = '-';
$_rep['{SONG_LOFI_DOWNLOAD_LINK}'] = '';
$_rep['{SONG_LOFI_DOWNLOAD_IMAGE}'] = '-';
}