Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
Where songs.php (in profile page) is generated
dizpers



Joined: 03 Oct 2011
Posts: 15

Posted: 10/14/11 07:17 
Hi I need to have my own modified song list (like song_list.tpl in Nova theme). I copy this template and insert into my module templates set. But here is one problem. This .tpl use some specific smarty vars (such as $SONG_IMAGE_URL and others ...). Where I can see code, which generates this vars (i.e. where the code which generates data for song_list.tpl is located) ?

PS
I understand, that I can do this job myself - but it's not good to do the same job twice:)

Back to top
smith.kyle
CodeSmith


Joined: 27 Apr 2006
Posts: 22009
Location: Southern California

Posted: 10/18/11 15:34 
Are you wanting to actually modify the underlying PHP code that creates the profile pages? Or just the templates and how they look?

Kyle


_________________
kyle[at]jamroom.net

Yes...that's a soda machine...

I get bored when no one's posting...
Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 10/18/11 19:47 
$data['BAND_IMAGE_URL'] = $config['jamroom_url'] .'/image.php?mode=band_image&band_id='.$band_id;

where $data is the data that is being passed to your template.

-- edit --
oops, thats for the band image url, you wanted song image url
$data['SONG_IMAGE_URL'] = $config['jamroom_url'] .'/image.php?band_id='.$band_id.'&song_id='.$song_id.'&mode=song_image';


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
dizpers



Joined: 03 Oct 2011
Posts: 15

Posted: 10/19/11 03:19 

smith.kyle:
Are you wanting to actually modify the underlying PHP code that creates the profile pages? Or just the templates and how they look?

Kyle


Kyle, my task now is to display songs from selected album. In my module I have the following code:


Code

public function showSongs($album_id){
        global $jamroom_db;
        $req = "SELECT *
                FROM {$jamroom_db['song_info']}
                WHERE song_album LIKE \"$album_id\"";
        $temp = dbQuery($req, 'NUMERIC');
        foreach ($temp as $key => $value){
            $res = array_change_key_case($value, CASE_UPPER);
            htmlShowTemplate('myModule', 'song_myModule.tpl', $res);
        }
    }


template song_myModule.tpl I copied from /themes/Nova/song_list.tpl

And when song_info called by "Songs" link from the profile page some script passes necessary vars to display each song by this template in a correct form.

In the code I show above I generate $res array with basic information about song (which I can get from database) but some other vars I sure can generate by myself, but it's not a good idea - if they already generated by another script.

Maybe another way to do my task is exist?

Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 10/19/11 03:25 

Code

public function showSongs($album_id){
        global $jamroom_db, $config;
        $req = "SELECT *
                FROM {$jamroom_db['song_info']}
                WHERE song_album LIKE \"$album_id\"";
        $temp = dbQuery($req, 'NUMERIC');
        foreach ($temp as $key => $value){
            $res = array_change_key_case($value, CASE_UPPER);
            $res['SONG_IMAGE_URL'] = $config['jamroom_url'] .'/image.php?band_id='.$value['band_id'].'&song_id='.$value['song_id'].'&mode=song_image';
            htmlShowTemplate('myModule', 'song_myModule.tpl', $res);
        }
    }



_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
dizpers



Joined: 03 Oct 2011
Posts: 15

Posted: 10/19/11 04:13 
Thx ussher I do like this - and it works fine!Smile

And another question - how I can load to player all this songs?

Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

 
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.