Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
User Documentation and How To's:
How To: Integrate Jamroom with Mambo CMS : UPDATED 03/19/05
buyourweb



Joined: 29 May 2004
Posts: 152

Posted: 07/15/04 18:50 
<?
//werkkrew_totals//
// Version: 1.0
// Author : Bryan Chain

///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";

$database->setQuery( $query );
$rows = $database->loadObjectList();

echo "<table cellpadding='1' border='0'>";
foreach($rows as $row) {

echo "<tr>";
echo "<td><img src='".$bullet_img."' /></td>";
echo "<td><b><a href='".http://www.mosiq.com/jamroom/bands/."".$row->band_id."/music.php' target='_blank'>".$row->song_name."</a></b>";
echo "</td></tr>";
}
echo "</table>";
?>

Back to top
werkkrew



Joined: 20 Feb 2004
Posts: 126
Location: Phildadelphia, PA USA

Posted: 07/16/04 13:54 
I dont see what that last post is referring to...

Im thinking the problem you guys are having is related to the query.

Are you all using the default jamroom database structure, and are the tables on the same database as your mambo tables...

If not, youll have to customize the script to connect to a different database.


_________________
My Site:
www.werkkrew.com
Affordable Web Design and Site Hosting:
www.werktheweb.com

Back to top
buyourweb



Joined: 29 May 2004
Posts: 152

Posted: 07/16/04 13:58 
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

Back to top
buyourweb



Joined: 29 May 2004
Posts: 152

Posted: 07/16/04 14:51 
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?

Back to top
werkkrew



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]


_________________
My Site:
www.werkkrew.com
Affordable Web Design and Site Hosting:
www.werktheweb.com

Back to top
ejcdke



Joined: 20 Jun 2004
Posts: 49

Posted: 07/17/04 12:06 
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.

Back to top
buyourweb



Joined: 29 May 2004
Posts: 152

Posted: 07/17/04 12:19 
I also merge my databases together ( took 2 minutes) now I'm heading over to the Mambo Forum to find out how to ad a user with Admin powers.

Back to top
buyourweb



Joined: 29 May 2004
Posts: 152

Posted: 07/19/04 10:16 

Quote:
You can use the built in mambo class to connect to the jamroom db, or just use php to do it manually


How do I do that, I can not get mamboserver working with the other database that I created for Jamroom?

Thanks

Back to top
buyourweb



Joined: 29 May 2004
Posts: 152

Posted: 07/19/04 10:31 
Thanks for everyones help, All is working fine now.
Peace

Back to top
musicmaker



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?

Thanks
musicmaker

Back to top
buyourweb



Joined: 29 May 2004
Posts: 152

Posted: 07/24/04 14:14 
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

Back to top
johnypneumo



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 Wink

Back to top
johnypneumo



Joined: 15 Jan 2004
Posts: 954
Location: united kingdom

Posted: 07/27/04 02:14 
oh, i just noticed - do i have to merge databases ? = gutted.

Back to top
werkkrew



Joined: 20 Feb 2004
Posts: 126
Location: Phildadelphia, PA USA

Posted: 07/29/04 11:12 
You dont have to merge the DB's, but if you want the code to work as is, you do. Otherwise just connect to the other DB and modify the query.

To all those having trouble with the Random spotlight...

I never noticed that issue because I always choose my spotlighted artists, I never let jamroom choose, so I guess I never noticed.

I took the query from the actual jamroom spotlight file...It shouldnt be too hard to find the problem...

If you look at the query I believe it takes the band with the most recent downloads and selects them from the DB.


_________________
My Site:
www.werkkrew.com
Affordable Web Design and Site Hosting:
www.werktheweb.com

Back to top
buyourweb



Joined: 29 May 2004
Posts: 152

Posted: 07/29/04 15:37 

Quote:
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.


<?
//werkkrew_totals//
// Version: 1.0
// Author : Bryan Chain

//Your jamroom URL: *NO TRAILING SLASH*
$jamroom_url = "http://www.mydomain.com/jamroom";

$params = mosParseParams($module->params);

$band_id = 9;

defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

$query = "SELECT i.band_id, i.band_time, i.band_name, i.band_location, i.band_story, i.band_website, i.band_influence, i.band_soundlike, q.quota_id, q.quota_name, h.hifi_size, h.hifi_download, h.hifi_extension, l.lofi_size, l.lofi_download, l.lofi_extension, s.song_id, s.song_time, s.song_name, s.song_album, s.song_label, s.song_lyrics, s.song_history, SUM( c.hifi_scount_total + 0 ) AS hifi_streams, SUM( c.lofi_scount_total + 0 ) AS lofi_streams, SUM( c.hifi_dcount_total + 0 ) AS hifi_downloads, SUM( c.lofi_dcount_total + 0 ) AS lofi_downloads, 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_band_info AS i"
."\nLEFT JOIN jamroom_quota AS q ON q.quota_id = i.band_quota"
."\nLEFT JOIN jamroom_band_image AS m ON m.band_id = i.band_id"
."\nLEFT JOIN jamroom_song_info AS s ON s.band_id = i.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_song_genre AS g ON g.genre_id = s.song_genre"
."\nWHERE i.band_update != 99 AND q.quota_spot = 'yes' AND s.song_show != 'no' AND (h.hifi_size > 0 OR l.lofi_size > 0)"
."\nAND m.image_size > 0";
if (is_numeric($band)){
$query .= "\nAND i.band_id = $band_id";
}
$query .= "\nGROUP BY s.song_id LIMIT 1";

$database->setQuery( $query );
$rows = $database->loadObjectList();

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 &quot;".$_row->song_name."&quot; in HIFI mode\" title=\"click here to stream &quot;".$_row->song_name."&quot; 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 &quot;".$_row->song_name."&quot;\" title=\"click here to download a HIFI version of &quot;".$_row->song_name."&quot;\"></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 &quot;".$_row->song_name."&quot; in LOFI mode\" title=\"click here to stream &quot;".$_row->song_name."&quot; 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 &quot;".$_row->song_name."&quot;\" title=\"click here to download a HIFI version of &quot;".$_row->song_name."&quot;\"></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}'] = '-';
}

$_rep2 = array(
'{MODE}' => 'spotlight',
'{BAND_ID}' => $_row->band_id,
'{BAND_CREATED}' => $_row->band_time,
'{BAND_NAME}' => $_row->band_name,
'{BAND_INFO}' => $_row->band_story,
'{BAND_LOCATION}' => $_row->band_location,
'{BAND_WEBSITE}' => $_row->band_website,
'{BAND_INFLUENCE}' => $_row->band_influence,
'{BAND_SOUNDLIKE}' => $_row->band_soundlike,
'{BAND_IMAGE}' => $jamroom_url."/image.php?band_id=".$_row->band_id."&mode=band_image",
'{QUOTA_ID}' => $_row->quota_id,
'{QUOTA_NAME}' => $_row->quota_name,
'{SONG_ID}' => $_row->song_id,
'{SONG_CREATED}' => $_row->song_time,
'{SONG_NAME}' => $_row->song_name,
'{SONG_ALBUM}' => $_row->song_album,
'{SONG_LABEL}' => $_row->song_label,
'{SONG_GENRE}' => $_row->genre_name,
'{SONG_GENRE_URL}' => urlencode($_row->genre_name),
'{SONG_IMAGE}' => $jamroom_url."/image.php?band_id=".$_row->band_id."&song_id=".$_row->song_id."&mode=song_image",
'{SONG_HIFI_EXTENSION}' => $_row->hifi_extension,
'{SONG_LOFI_EXTENSION}' => $_row->lofi_extension,
'{SONG_HIFI_SCOUNT}' => $_row->hifi_streams,
'{SONG_LOFI_SCOUNT}' => $_row->lofi_streams,
'{SONG_HIFI_DCOUNT}' => $_row->hifi_downloads,
'{SONG_LOFI_DCOUNT}' => $_row->lofi_downloads,
'{SONG_STREAM_COUNT}' => $_row->total_stream,
'{SONG_DOWNLOAD_COUNT}' => $_row->total_download,
'{SONG_TOTAL_COUNT}' => $_row->total_count
);
}

echo "<center>\n<table cellpadding=0 cellspacing=2>";

echo "<tr>";
echo "<td colspan=5><font size='+1'<a href='".$jamroom_url."/bands/{$_rep2['{BAND_ID}']}/' target=_blank>{$_rep2['{BAND_NAME}']}</a></td>";
echo "</tr>";
echo "<tr>";
echo "<td width=05% colspan=5>";
echo "<table width=100% cellpadding=0 cellspacing=0 border=0><tr>";
echo "<td width=02%><a href='".$jamroom_url."/bands/{$_rep2['{BAND_ID}']}/' target=_blank>";
echo "<img src='{$_rep2['{BAND_IMAGE}']}&width=196&height=128' width=196 height=128 border=0></a></td>";
echo "<td width=98% align=center>{$_rep2['{BAND_INFO}']}</td>";
echo "</tr></table>";
echo "</td>";
echo "</tr>";
echo "<tr bgcolor='#999999'>";
echo "<td width=01%><b>Hi</b></td>
<td width=01%><b>Lo</b></td>
<td width=55%><b>Song Name</b></td>
<td width=25%><b>Genre</b></td>
<td width=18%><b>Plays</b></td>
</tr>";

echo "
<tr>
<td width=01%><center>{$_rep['{SONG_HIFI_PLAY_IMAGE}']}</center></td>
<td width=01%><center>{$_rep['{SONG_LOFI_PLAY_IMAGE}']}</center></td>
<td width=55%>&quot;{$_rep2['{SONG_NAME}']}&quot;</td>
<td width=25%>{$_rep2['{SONG_GENRE}']}</td>
<td width=18%>{$_rep2['{SONG_STREAM_COUNT}']}</td>
</tr>";



echo "</table>";

?>

Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
User Documentation and How To's

< Previous12345...1112131415Next >
 
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.