Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization:
Please Help: Need songs listed side by side / where to edit?
discopimp



Joined: 10 Dec 2004
Posts: 16

Posted: 12/11/04 05:35 
Hi,

i am taking my first steps with chnaging the layout of the pages. I am working on the Cobalt Them for the moment to understand what's going on.

Here is what i would like to do:

For the moment, the songs on the music page are listed successively in rows spanning the whole width of the pagetable. I managed to find the attribute that sets the width of the table to 50% so that now 2 song listings would fit side by side.

I can't seem to find where the layout of the song listing of the music page is ... where could i set up a template table with two columns so that the songs are displayed in pairs side by side ....

Have a look:



thanks for any help, i checked all available info on themedesign/jamroom and played around a lot with it but couldn't figure this out ... Question[/img]

Back to top
rekrapt



Joined: 02 Oct 2004
Posts: 308
Location: Gulfport, MS

Posted: 12/11/04 13:21 
I've put quite a few hours in trying to figure out how to do this. I could be wrong, but I'm fairly sure that this can't be done. The music page is created using the template files in this order:

music_header.tpl
song_header.tpl
song_hifi_stream.tpl
song_lofi_stream.tpl
song_hifi_download.tpl
song_lofi_download.tpl
song_lyrics.tpl
song_information.tpl
song_footer.tpl
common_footer.tpl

The table row that contains the list of songs starts in song_header.tpl and ends in song_footer.tpl. The first file contains the info for the name of the song, the song image and the song length/ratings code (I moved that somewhere else in the template I use.) The second file contains the genre, credits, etc. The files in-between generate the links for hifi/lofi download and streaming and the lyrics/info popup links.

The song_header.tpl on through the list to the song_footer.tpl is re-processed for every song in the database for that artist. Because of the linear and modular nature of the way the song list is generated, there doesn't seem to be anywhere you can properly start a row, place two cells with a song in each cell and end the table row then repeating the process. Even if you could, I think there would have to be some extra PHP coding in one of those files (probably song_header.tpl) to tell JamRoom how many songs you want in the first and second column... based arbitrarily on how many songs exist in the artist's database. Confused

As I said, I could be wrong... Very Happy If I'm not, though, I hope someone here can enlighten us, because I would love to be able to do this too.

Tom
http://www.tparker.net

Back to top
djmerlyn
Jamroom Ustad


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

Posted: 12/11/04 16:10 
I had that almost working at one time for a theme I wanted to release. But I got stuck.

I got the tables to layout nice and everything using php's explode function so that I could sort the songs the way I wanted them. But I got stuck with integrating it into the template. I'm not sure how to run the php I need in the template...thats a question for bigguy I guess...

I had something like this:

Quote:
while(list($key,$val) = each($con_song_print)) {
$title_values = explode(" - ", $val);
echo " <font face=\"$font\" size=\"1\" color=\"$tbl2text1\">$con_song_print[$key] <a href=\"{SONG_IMAGE}" class=\"SongTitle\">$con_songname_print[$key]<br></font>\n";
}
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";


Anyways, that's what I have from memory... There's more to it, but I couldn't figure out how to run it in the tpl's

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
rekrapt



Joined: 02 Oct 2004
Posts: 308
Location: Gulfport, MS

Posted: 12/11/04 16:45 
So, you got it working as a stand-alone PHP page? I was going to try that next... I was thinking it would be a major pain to get it to work in the templates... even if I could get it to work as a straight page.

bummer... Crying or Very sad

Tom
http://www.tparker.net

Back to top
Brian
Jamroom Team


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

Posted: 12/11/04 17:03 

discopimp:
Hi,

i am taking my first steps with chnaging the layout of the pages. I am working on the Cobalt Them for the moment to understand what's going on.

Here is what i would like to do:

For the moment, the songs on the music page are listed successively in rows spanning the whole width of the pagetable. I managed to find the attribute that sets the width of the table to 50% so that now 2 song listings would fit side by side.

I can't seem to find where the layout of the song listing of the music page is ... where could i set up a template table with two columns so that the songs are displayed in pairs side by side ....

Have a look:



thanks for any help, i checked all available info on themedesign/jamroom and played around a lot with it but couldn't figure this out ... Question[/img]


One thing to always remember is that the template files for themes are themselves PHP files - therefore you can always "embed" PHP logic into the templates to test things before rendering.

I haven't tested this, its off the top of my head, but it should work. If you open the song_footer.tpl file, you'll see this at the bottom:


Code

</table>
</td>
</tr>


We'll add some PHP if/else checking in here to ONLY go to the next table row if the number of songs done so far is divisible by two:


Code

</table>
</td>
<?php
if (($SONG_NUMBER} % 2) == 0)
{
     echo '</tr>';
}
?>


We're using the "modulus" (%) operator here which returns the remainder after a division operation - if it equals zero we know that we have evenly divided our song total by 2 and can start our next row.

You may need to play aruond with it a bit, but let me know if that helps out. Thanks!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
discopimp



Joined: 10 Dec 2004
Posts: 16

Posted: 12/11/04 18:17 
Hi thanks for the replies, at least it looks like it's not impossible ... Smile Laughing

i tried this and get a :


Code
Parse error: parse error, unexpected '}' in .../bandsites/artists/2/index.php on line 92


i can totally see the logic of this but i'm not very good in php ...



Last edited by discopimp on 12/12/04 10:55; edited 1 time in total
Back to top
rekrapt



Joined: 02 Oct 2004
Posts: 308
Location: Gulfport, MS

Posted: 12/11/04 20:45 
What is on line 92 in
/home/csadmin/public_html/pornogamynet/bandsites/artists/2/index.php ?

I'm going to try this myself tomorrow. Right now, I'm going to play Quake 3. Very Happy

Tom
http://www.tparker.net

Back to top
dniMTheory



Joined: 23 Nov 2003
Posts: 320
Location: Durham, NC

Posted: 12/11/04 20:48 
There has to be away to do it. I tried this a while back also but came up with notta. Oddly enough, I don't need it anymore so I stopped playing around with it.


_________________
Visit UrbanHype.org
Listen to UrbanHype Radio!
Back to top
Brian
Jamroom Team


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

Posted: 12/11/04 20:54 

discopimp:
Hi thanks for the replies, at least it looks like it's not impossible ... Smile Laughing

i tried this and get a :


Code
Parse error: parse error, unexpected '}' in /home/csadmin/public_html/pornogamynet/bandsites/artists/2/index.php on line 92


i can totally see the logic of this but i'm not very good in php ...


Sorry - forgot a { in the code - try this:


Code

</table>
</td>
<?php
if (({SONG_NUMBER} % 2) == 0)
{
     echo '</tr>';
}
?>


Hope this helps!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
discopimp



Joined: 10 Dec 2004
Posts: 16

Posted: 12/12/04 10:52 
thanks brian, but now i get this:


Code
Parse error: parse error, unexpected T_STRING in .../bandsites/artists/2/index.php on line 93


here are lines 88-95 of my index.php genratet after the mod you suggested:


Code
 </table>
 </td>
 <?php
 if ((1 % 2) == 0)
 {
      echo '</tr>';
 }
 ?>


Back to top
rekrapt



Joined: 02 Oct 2004
Posts: 308
Location: Gulfport, MS

Posted: 12/12/04 11:35 
could it be that this:


Code
{
      echo '</tr>';
 }


Should be this:


Code
{
      echo "</tr>";
 }


Hell, I don't know... just a guess. Rolling Eyes

Tom
http://www.tparker.net

Back to top
discopimp



Joined: 10 Dec 2004
Posts: 16

Posted: 12/20/04 02:51 
hi again,

does anyone have any news on this, it's still not working .... since there seems to be quite some interest for this, it would be great if you could have a closer look brian ...

if only i knew more php i would try to do this myself, but unfortunately i'm stuck here ....

any help is greatly appreciated !

Back to top
Brian
Jamroom Team


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

Posted: 12/20/04 06:30 

discopimp:
hi again,

does anyone have any news on this, it's still not working .... since there seems to be quite some interest for this, it would be great if you could have a closer look brian ...

if only i knew more php i would try to do this myself, but unfortunately i'm stuck here ....

any help is greatly appreciated !


That code above looks correct, I'm not sure why it is given you that error. I'll do some testing in a theme and see if I can figure a way to do this.

Thanks!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
Brian
Jamroom Team


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

Posted: 12/26/04 15:30 
This is (basically) how to do it, although you'll need to do some customizations on the header/footer section to the get the cells to flow "over top" of the middle section (i.e. colspan).

Using jm_cobalt_2.2 as an example, you'll see this at the bottom o the song_footer.tpl:


Code

</table>
</td>
</tr>


Change to:

Code

</table>
</td>
<?php
if (({SONG_NUMBER} % 2) == 0)
{
     echo '</tr><tr>';
}
?>


and then modify the song_header.tpl, which the top of currently looks like this:

Code

<tr>
  <td colspan="2" width="100%">


to be this:

Code

  <td colspan="2" width="100%">

(i.e. remove the "<tr>").

I've tested this on my dev system here and it works (or at least it works in concept - the HTML will need to be cleaned up to handle the new cells).

Hope this helps!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
discopimp



Joined: 10 Dec 2004
Posts: 16

Posted: 12/27/04 06:07 
hi again brian,

i must be doing sth wrong, but i can't figure out what ... i have even re-installed the cobalt theme just to be sure that we are working on the same base ...

when i make the mods you suggest i still get the 'unexpected T-String' error ....

i will now re-install a fresh copy of Jamroom on another server, just to make sure i didn't change anything from the original that mught prevent this from happening ...

i'll keep you posted ...

Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
User Site Design, Integration and Customization

12Next >
 
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.