Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
User Documentation and How To's:
Help with custom form field and ranking
nixt



Joined: 08 Jan 2010
Posts: 131

Posted: 10/26/12 10:04 
I created a custom form field "song_software" as a "select choice" menu. I updated my language file and now I would like to have a menu in my shop to select the software type.
So I put this code on my store :

Code
<select class="jr_select" style="width:100%;" id="song_software" onchange="setOrder('song','20')">
              <option value="">{jr_lang id="" default="Software"}</option>
             {jr_array name="gs" key="0" value=$g}   
         {jr_ranking mode='song_software' order='6' row_template='select_genre.tpl' replace=$gs}
            </select></td>

And I also upadted my "select_genre.tpl", adding this :

Code
{elseif $MODE == 'song'}
<option {if $REPLACE_0 == $SONG_SOFTWARE} selected="selected"{/if} value="{$SONG_SOFTWARE}">{$SONG_SOFTWARE}</option>


But it doesn't work. I get an HTTP 500 error when trying to access the store.

What did I do wrong ?

Thanks ...

Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 10/26/12 17:14 
there is no ranking mode song_software.

Not sure what the onchange is for, but your select needs a name="song_software" to start.

Im not following what you expect the results to be, could you show me the wanted html output please?

as a guess i would think your wanting something like:

Code

<select name="song_software">
<option value="1">First Software</option>
<option value="2">Second Piece of Software</option>
<option value="3">Third type of Software</option>
</select>


You can put a {debug} in the template and see if there is an array of items your wanting for the options in there. If there is you can use a {foreach} loop to create the options.


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



Joined: 08 Jan 2010
Posts: 131

Posted: 10/26/12 18:03 
That's my problem, can I create a ranking for this custom form field ?
If you go to the first page of my site (I'll send you the logins by PM) you see 3 drop down menus used to change the order of the list. I would like to add this 4th one "software"

Here is the code for the 3 dropdown menus :

Code
<div id="songs_wrap" class="jr_media">
  <div class="jr_head">{jr_lang id="642" default="Buy, Download and Share"}</div>
  <div class="jr_box">
    <div class="jr_search">
      <table cellpadding="3" width="100%">
        <tr>
          <td width="28%" align="right"><select name="rank_quota" class="jr_select" id="rank_quota" style="width:100%;" onchange="setOrder('song','20')">
            <option value="">{jr_lang id=&quot;87&quot; default=&quot;Type&quot;}</option>
           
             
          {jr_array name="qs" key="0" value=$q}       
          {jr_ranking mode='quota' order='3' quota_type='artist' row_template='select_quota.tpl' replace=$qs}
         
           
          </select></td>
          <td width="28%"><select class="jr_select" style="width:100%;" id="rank_genre" onchange="setOrder('song','20')">
              <option value="">{jr_lang id="" default="Genres"}</option>
             
         {jr_array name="gs" key="0" value=$g}   
         {jr_ranking mode='song' order='6' row_template='select_genre.tpl' replace=$gs}
         
            </select></td>
          <td width="29%"><select class="jr_select" style="width:100%;" id="rank_order" onchange="setOrder('song','20')">
              <option value="">{jr_lang id="587" default="Order"}</option>
              <option value="1">{jr_lang id="230" default="Alphabetically"}</option>
              <option value="17">{jr_lang id="236" default="Most Friends"}</option>
              <option value="5">{jr_lang id="235" default="Most Streams"}</option>
              <option value="3">{jr_lang id="238" default="Newest"}</option>
            </select></td>
          <td nowrap="nowrap">&nbsp;</td>
        </tr>
      </table>
    </div>


Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 10/26/12 18:31 
Looks like you've got it figured out. seams to be working in there now.

--edit--
ah, a 4th column. You want to add these terms to the URL you are creating:
www.getthatsound.net/ranking.php?mode=artist&tpl_dir=skin&skin=ISkin&pagebreak=20&order=&quota=&genre=Techno (Hardcore / Gabber)&search_string=SOME_SOFTWARE_NAME&search_area=song_software

so it the same as you have, but add

Code
&search_string=SOME_SOFTWARE_NAME&search_area=song_software



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

Last edited by Michael on 10/26/12 18:35; edited 1 time in total
Back to top
nixt



Joined: 08 Jan 2010
Posts: 131

Posted: 10/26/12 18:35 
Well no, I'm still missing the 4th dropdown "software" ...

Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 10/26/12 18:36 
Your too quick for me. Thought I would edit the post i just made.

here it is again:

ah, a 4th column. You want to add these terms to the URL you are creating:
www.getthatsound.net/ranking.php?mode=artist&tpl_dir=skin&skin=ISkin&pagebreak=20&order=&quota=&genre=Techno (Hardcore / Gabber)&search_string=SOME_SOFTWARE_NAME&search_area=song_software

so it the same as you have, but add

Code
&search_string=SOME_SOFTWARE_NAME&search_area=song_software


--edit--
search_area and search_string are documented on this page:
http://www.jamroom.net/Jamroom4_Ranking_System


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



Joined: 08 Jan 2010
Posts: 131

Posted: 10/26/12 18:46 
Thanks a lot but I don't understand where I should paste this code...

Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 10/26/12 19:13 
You're using drop down menus to retrieve some pages via ajax.

When you change the menu items on the genre, the genre gets added to the URL that you call, so do it in the same location where genre is set and in the same way.

My first guess would be your doing that in the setOrder() javascript function?


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



Joined: 08 Jan 2010
Posts: 131

Posted: 10/26/12 19:38 
I put this code for a 4th dropdown :

Code


 <td nowrap="nowrap"><select class="jr_select" style="width:100%;" onchange="setOrder('&search_string=SOME_SOFTWARE_NAME&search_area=song_software')">
            <option value="">{jr_lang id="" default="Software"}</option>
           
         {jr_array name="gs" key="0" value=$g}   
         {jr_ranking mode='song_software' order='6' row_template='select_genre.tpl' replace=$gs}

But I'm probably not understanding yet. I have the menu but no item inside.

In the select_genre.tpl file, I added :

Code

{elseif $MODE == 'song'}
<option {if $REPLACE_0 == $SONG_SOFTWARE} selected="selected"{/if} value="{$SONG_SOFTWARE}">{$SONG_SOFTWARE}</option>


Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 10/26/12 20:02 
seams like your trying to create the dropdown menu list.

I would get the URL working first. What song software is there in your system?


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



Joined: 08 Jan 2010
Posts: 131

Posted: 10/26/12 20:11 
There are currently 2 "songs" that have a software assigned : Pro Tools for one and Ableton Live for the other.

I see what you mean, I should try and get the results from a link first. Well I still can't...

I guess I'll keep trying Smile

I suppose it's no use trying to modify ranking related files ?

Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 10/26/12 21:16 
there are a few steps to what your trying to do.

* add a custom form field to allow the users to choose something from a list. DONE
* update a few songs so there is data in the database.
* setup a URL to check for that data in the database.
* add a dropdown list to call that URL.

Just do one at a time or you'll get lost.

So if you have songs in the database that have had that software option selected, then they can be searched for.

--edit--
This is the base url:
http://www.getthatsound.net/ranking.php?mode=song&tpl_dir=skin&skin=ISkin&pagebreak=20&order=&quota=4&genre=


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


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 10/26/12 21:20 
here is a search for 'pro tools'
http://www.getthatsound.net/ranking.php?mode=song&tpl_dir=skin&skin=ISkin&pagebreak=20&order=&quota=4&genre=&search_area=song_software&search_string=Pro+tools

and here is one for 'albeton live'
http://www.getthatsound.net/ranking.php?mode=song&tpl_dir=skin&skin=ISkin&pagebreak=20&order=&quota=4&genre=&search_area=song_software&search_string=Ableton+Live

so the URL is working. (although you are not displaying the software anywhere on the actual result.)


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



Joined: 08 Jan 2010
Posts: 131

Posted: 10/26/12 21:23 
That's what I thought I had understood, so if I type
http://www.getthatsound.net/ranking.php?mode=song&tpl_dir=skin&skin=ISkin&pagebreak=20&song_software=Pro%20Tools
I should normally get the songs that have "Pro Tools" selected. Am I right ?
Because unfortunately I see a lot of songs that don't have "Pro Tools" selected.

Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 10/26/12 21:24 
so your html in your template will look like this:

Code
<select class="jr_select" style="width:100%;" id="song_software onchange="setOrder('song','20')">
              <option value="">{jr_lang id="587" default="Order"}</option>
              <option value="pro+tools">Pro Tools</option>
              <option value="albeton+live">Albeton Live</option>
            </select>


Then you need to change the setOrder function itself. That will be in some other javascript file. Probably in the iSkin skins directory.


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
User Documentation and How To's

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.