Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
User Documentation and How To's:
Advance Search - Multiple Fields
bodawg



Joined: 27 Mar 2007
Posts: 1091
Location: On my knees begging DJ for help...again

Posted: 02/26/09 22:02 
Is there not any way to apply user fields with this???

I hope there is 'cause all of a persons info is situated in their account info I.e.- real name, email address, gender, birthdate, address... I mean as far as searching for an individual, these are all user fields..

Thanks for any info on this!

-Rob


_________________
Got Kyle? "When a comfortable computer chair just isn't enough to save your a**"
Back to top
Douglas
Jamroom Team


Joined: 08 Oct 2004
Posts: 6639
Location: Tornado Alley!

Posted: 02/27/09 07:15 

whodaniel:
Any working examples to see?


PromoFM.Com

Hope this helps Smile


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


Joined: 08 Oct 2004
Posts: 6639
Location: Tornado Alley!

Posted: 02/27/09 07:18 

bodawg:
Is there not any way to apply user fields with this???

I hope there is 'cause all of a persons info is situated in their account info I.e.- real name, email address, gender, birthdate, address... I mean as far as searching for an individual, these are all user fields..

Thanks for any info on this!

-Rob


You would have to modify the ranking call and templates to use "User" mode instead of "Artist" mode.

Hope this helps Smile


_________________
Douglas Hackney
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
jimmyk
Beta Team


Joined: 27 Jun 2007
Posts: 275
Location: Bethlehem, PA USA

Posted: 03/02/09 13:37 
I think I figured this out for the Nova skin....

My Nova skin is modified, so this isn't for the "exact" Nova, but it should get you started. This example if for the artist section:


Code
{assign var="search_string_adv" value="_searchstring"}
{assign var="search_area_adv" value="_searcharea"}
{assign var="search_mode_adv" value="artist"}



Code
{if isset($search_area) && is_array($search_area)}

  {foreach from=$search_area key="num" item="s_area"}

    {if $s_area == "band_name" && strlen($search_string.$num) > 1}
      {jr_array name="_searcharea" key="0" value="band_name"}
      {jr_array name="_searchstring" key="0" value=$search_string.$num}

    {elseif $s_area == "band_members" && strlen($search_string.$num) > 1}
      {jr_array name="_searcharea" key="1" value="band_members"}
      {jr_array name="_searchstring" key="1" value=$search_string.$num}

    {elseif $s_area == "band_influence" && strlen($search_string.$num) > 1}
      {jr_array name="_searcharea" key="2" value="band_influence"}
      {jr_array name="_searchstring" key="2" value=$search_string.$num}

    {/if}

  {/foreach}

{/if}



Code
<form name="adv_search" method="post" onclick="var ss=document.adv_search.search_string_adv.value;sa=document.adv_search.search_area_adv.value;jrLoad('#rank','{$JAMROOM_URL}/ranking.php?mode={$search_mode_adv}&search_area='+ jrEscape(sa) +'&search_string='+ jrEscape(ss) +'&pagebreak={$smarty.config.default_pagebreak}&row_template=artists_directory_row.tpl&footer_template=no_search_results.tpl');return false;">

<input type="hidden" name="search_area[0]" value="band_name">
<div class="side_search_title">Artist Name</div>
<input type="text" name="search_string[0]" class="search">

<input type="hidden" name="search_area[1]" value="band_members">
<div class="side_search_title">Members</div>
<input type="text" name="search_string[1]" class="search">
           
<input type="hidden" name="search_area[2]" value="band_influence">
<div class="side_search_title">Influences</div>
<input type="text" name="search_string[2]" class="search">

<input type="submit" value="Search" class="cart_price">
</form>


[Add the output area and the footer page here]


_________________
Web Development
Back to top
equinoxtrish



Joined: 11 Apr 2009
Posts: 61
Location: Peterborough, UK

Posted: 05/28/09 06:37 
I'm having a little trouble with this search, everything seems to work fine, except the select option list from my custom form fields doesn't come up.

I have used the script exactly as described in the first post - just replacing the search area values with those on my site.

Have i missed out a step somewhere?

Back to top
Douglas
Jamroom Team


Joined: 08 Oct 2004
Posts: 6639
Location: Tornado Alley!

Posted: 05/28/09 06:45 

equinoxtrish:
I'm having a little trouble with this search, everything seems to work fine, except the select option list from my custom form fields doesn't come up.

I have used the script exactly as described in the first post - just replacing the search area values with those on my site.

Have i missed out a step somewhere?


Can you post what the code you have so far?

Thanks Smile


_________________
Douglas Hackney
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
equinoxtrish



Joined: 11 Apr 2009
Posts: 61
Location: Peterborough, UK

Posted: 05/28/09 09:33 
advanced search.tpl


Code
{jr_lang id="69" default="advanced search" assign="title"}
{include file="$SKIN_DIR/jr_overall_header.tpl"}


<div class="head_2_search">{jr_lang id="69" default="advanced search"}</div>
<div class="body_3_search">

{if isset($search_area) && is_array($search_area)}

  {foreach from=$search_area key="num" item="s_area"}

    {if $s_area == "band_name" && strlen($search_string.$num) > 1}
      {jr_array name="_searcharea" key="0" value="band_name"}
      {jr_array name="_searchstring" key="0" value=$search_string.$num}

    {elseif $s_area == "band_members" && strlen($search_string.$num) > 1}
      {jr_array name="_searcharea" key="1" value="band_members"}
      {jr_array name="_searchstring" key="1" value=$search_string.$num}

    {elseif $s_area == "band_influence" && strlen($search_string.$num) > 1}
      {jr_array name="_searcharea" key="2" value="band_influence"}
      {jr_array name="_searchstring" key="2" value=$search_string.$num}

    {elseif $s_area == "band_soundlike" && strlen($search_string.$num) > 1}
      {jr_array name="_searcharea" key="3" value="band_soundlike"}
      {jr_array name="_searchstring" key="3" value=$search_string.$num}

    {elseif $s_area == "band_location" && strlen($search_string.$num) > 1}
      {jr_array name="_searcharea" key="4" value="band_location"}
      {jr_array name="_searchstring" key="4" value=$search_string.$num}

    {/if}

  {/foreach}

{/if}


<form method="post" action="{$JAMROOM_URL}/index.php">
<input type="hidden" name="template" value="advanced_search.tpl">

<input type="hidden" name="search_area[0]" value="band_name">
Artist Name: <input type="text" name="search_string[0]" style="width:195px">

<input type="hidden" name="search_area[1]" value="band_members">
Members: <input type="text" name="search_string[1]" style="width:195px">

<input type="hidden" name="search_area[2]" value="band_influence">
Influences: <input type="text" name="search_string[2]" style="width:195px">

<input type="hidden" name="search_area[3]" value="band_soundlike">
Artist Genre: <input type="text" name="search_string[3]" style="width:195px">

<input type="hidden" name="search_area[4]" value="band_location">
Location: <input type="text" name="search_string[4]" style="width:195px">

<input type="submit" value="Search" class="button" style="width:60px">

</form>


{if isset($_searcharea) && isset($_searchstring)}
 <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
  {jr_ranking mode="artist" pagebreak="9" pagenum=$p footer_template="advanced_search_footer.tpl" search_area=$_searcharea search_string=$_searchstring}
 </table>
{/if}
</div>


{include file="$SKIN_DIR/jr_overall_footer.tpl"}




advanced search footer.tpl


Code

{* see if we have displayed any results - if not show message *}
{if $RANK_COUNT == 0}
<tr>
  <td width="100%" colspan="4">
    <h2>{jr_lang id="25" default="there are no results to show"}</h2>
  </td>
</tr>
{/if}

{* don't even show our footer if we only have 1 page *}
{if $TOTAL_PAGES > 1}

<tr>
  <td width="100%" colspan="10">
    <table width="100%" cellpadding="0" cellspacing="0">
      <tr>
        <td width="40%" style="text-align:right">
          {if $PAGENUM > 1}
            <a href="{$jamroom_index}?t=advanced_search{$SEARCH_AREA_URL}{$SEARCH_STRING_URL}&amp;p={$PREV_PAGE_NUM}">{jr_lang id="26" default="previous"}</a>
          {/if}
        </td>
        <td width="20%" style="text-align:center">

          {* decide if we are going to create a page jumper *}
          {if $TOTAL_PAGES <= 2}
            {$THIS_PAGE}&nbsp;/&nbsp;{$TOTAL_PAGES}
          {else}
            <form name="form" method="post" action="_self">
            <select name="pagenum" style="width:50px" onchange="var sel=this.form.pagenum.options[this.form.pagenum.selectedIndex].value;window.location='{$jamroom_index}?t=advanced_search{$SEARCH_AREA_URL}{$SEARCH_STRING_URL}&amp;p=' +sel;">
            {foreach from=$_PAGES key=page item=_pg}
              {if $page == $THIS_PAGE}
                <option selected value="{$page}"> {$page}</option>
              {else}
                <option value="{$page}"> {$page}</option>
              {/if}
            {/foreach}
            </select>&nbsp;/&nbsp;{$TOTAL_PAGES}</form>
         {/if}

        </td>
        <td width="40%">
          {if $NEXT_PAGE_NUM > 1}
            <a href="{$jamroom_index}?t=advanced_search{$SEARCH_AREA_URL}{$SEARCH_STRING_URL}&amp;p={$NEXT_PAGE_NUM}">{jr_lang id="27" default="next"}</a>
          {/if}
        </td>
      </tr>
    </table>
  </td>
</tr>

{/if}


Back to top
equinoxtrish



Joined: 11 Apr 2009
Posts: 61
Location: Peterborough, UK

Posted: 05/28/09 09:45 
Oops - sorry I don't know how to delete posts.

So, the above is what I took from the original instructions, then trying to work with that and what i could find in the demo source, this is what i came up with for my image search:

image search .tpl

Code

<html>
<head>
<title>Untitled</title>
</head>
<body>


{if isset($search_area) && is_array($search_area)}

  {foreach from=$search_area key="num" item="s_area"}

    {if $s_area == "image_category" && strlen($search_string.$num) > 1}
      {jr_array name="_searcharea" key="0" value="image_category"}
      {jr_array name="_searchstring" key="0" value=$search_string.$num}

    {elseif $s_area == "image_section" && strlen($search_string.$num) > 1}
      {jr_array name="_searcharea" key="1" value="image_section"}
      {jr_array name="_searchstring" key="1" value=$search_string.$num}

    {elseif $s_area == "image_sub_category" && strlen($search_string.$num) > 1}
      {jr_array name="_searcharea" key="2" value="image_sub_category"}
      {jr_array name="_searchstring" key="2" value=$search_string.$num}

   
    {/if}

  {/foreach}

{/if}
<table class="table" width="100%" cellpadding="0" cellspacing="0">
<tr><td>

<form method="post" action="{$JAMROOM_URL}/index.php">
<input type="hidden" name="template" value="advanced_search.tpl">
<table width="90%" cellpadding="3" cellspacing="0" border="0" align="center">
<tr>
<td width="30%" align="left" valign="middle">
Image Category:</td>
<td width="70%" align="left" valign="middle">
<input type="hidden" name="search_area[0]" value="image_category">
 <select class="select" name="search_string[0]" style="width:200px">
</td></tr><tr>
<td width="30%" align="left" valign="middle">
Image Section: </td>
<td width="70%" align="left" valign="middle">
<input type="hidden" name="search_area[1]" value="image_section">
<select class="select" name="search_string[1]" style="width:200px">
</td></tr><tr>
<td width="30%" align="left" valign="middle">
Image Sub Category: </td>
<td width="70%" align="left" valign="middle">
<input type="hidden" name="search_area[2]" value="image_sub_category">
<select class="select" name="search_string[2]" style="width:200px">
</td></tr><tr>
<td colspan="2" width="100%" align"center" valign="middle">
<input type="submit" value="Search" class="button" style="width:60px">
</td></tr></table>

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


{if isset($_searcharea) && isset($_searchstring)}
 <table width="100%" cellpadding="0" cellspacing="0" border="0" align="center">
  {jr_ranking mode="image" pagebreak="9" pagenum=$p footer_template="image_search_footer.tpl" search_area=$_searcharea search_string=$_searchstring}
 </table>
{/if}
</body>
</html>


image search footer tpl

Code

{* see if we have displayed any results - if not show message *}
{if $RANK_COUNT == 0}
<tr>
  <td width="100%" colspan="4">
    <h2>{jr_lang id="25" default="there are no results to show"}</h2>
  </td>
</tr>
{/if}

{* don't even show our footer if we only have 1 page *}
{if $TOTAL_PAGES > 1}

<tr>
  <td width="100%" colspan="10">
    <table width="100%" cellpadding="0" cellspacing="0">
      <tr>
        <td width="40%" style="text-align:right">
          {if $PAGENUM > 1}
            <a href="{$jamroom_index}?t=image_search{$SEARCH_AREA_URL}{$SEARCH_STRING_URL}&amp;p={$PREV_PAGE_NUM}">{jr_lang id="26" default="previous"}</a>
          {/if}
        </td>
        <td width="20%" style="text-align:center">

          {* decide if we are going to create a page jumper *}
          {if $TOTAL_PAGES <= 2}
            {$THIS_PAGE}&nbsp;/&nbsp;{$TOTAL_PAGES}
          {else}
            <form name="form" method="post" action="_self">
            <select name="pagenum" style="width:50px" onchange="var sel=this.form.pagenum.options[this.form.pagenum.selectedIndex].value;window.location='{$jamroom_index}?t=image_search{$SEARCH_AREA_URL}{$SEARCH_STRING_URL}&amp;p=' +sel;">
            {foreach from=$_PAGES key=page item=_pg}
              {if $page == $THIS_PAGE}
                <option selected value="{$page}"> {$page}</option>
              {else}
                <option value="{$page}"> {$page}</option>
              {/if}
            {/foreach}
            </select>&nbsp;/&nbsp;{$TOTAL_PAGES}</form>
         {/if}

        </td>
        <td width="40%">
          {if $NEXT_PAGE_NUM > 1}
            <a href="{$jamroom_index}?t=image_search{$SEARCH_AREA_URL}{$SEARCH_STRING_URL}&amp;p={$NEXT_PAGE_NUM}">{jr_lang id="27" default="next"}</a>
          {/if}
        </td>
      </tr>
    </table>
  </td>
</tr>

{/if} 


This makes the search boxes dropdown select, but doesn't return the options

Back to top
Douglas
Jamroom Team


Joined: 08 Oct 2004
Posts: 6639
Location: Tornado Alley!

Posted: 05/28/09 10:00 
What URL are you using to navigate to the page?

First your ranking mode should be photo instead of image and if you've named your template image_search.tpl then the hidden input right below the beginning form tag should be image_search.tpl instead of advanced_search.tpl.

Also, your select form tags need option tags... for example:

Code

<input type="hidden" name="search_area[1]" value="image_section">
<select class="select" name="search_string[1]" style="width:200px">


should look something like:


Code
<input type="hidden" name="search_area[1]" value="image_section">
<select class="select" name="search_string[1]" style="width:200px">
 <option value="value1">Value1</option>
 <option value="value2">Value2</option>
 <option value="value3">Value3</option>
 etc...
</select>


This link has some helpful tips on forms: http://www.w3schools.com/html/html_forms.asp

Hope this helps Smile


_________________
Douglas Hackney
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
equinoxtrish



Joined: 11 Apr 2009
Posts: 61
Location: Peterborough, UK

Posted: 05/28/09 11:17 
Thanks Six! Smile

Quote:
First your ranking mode should be photo instead of image and if you've named your template image_search.tpl then the hidden input right below the beginning form tag should be image_search.tpl instead of advanced_search.tpl.

I see i missed one out there.



Quote:
Also, your select form tags need option tags... for example:

I get it now, for some reason I assumed the script would call the file for these options saved in the config, didn't realise I needed to input them manually :S

I swear i'm brighter than this, just for some reason it's taking ages for my understanding of the jamroom setup to click, I blame years of working with joomla and elgg, wish i'd found jamroom in the first place, we would have been up and running ages ago

Back to top
Douglas
Jamroom Team


Joined: 08 Oct 2004
Posts: 6639
Location: Tornado Alley!

Posted: 05/28/09 12:29 
It takes a little time to get use to working on jamroom templates and using smarty, but once you get it, you can do almost anything with it.

Glad you got it working. Wink


_________________
Douglas Hackney
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
littlericky



Joined: 08 Feb 2007
Posts: 601

Posted: 05/28/09 13:46 
Off topic but
Quote:
PromoFM.Com


That's a nice site.

Back to top
equinoxtrish



Joined: 11 Apr 2009
Posts: 61
Location: Peterborough, UK

Posted: 06/15/09 11:27 
Would it be possible to introduce an onselect function to this? so that, on selection of the first option, the script returns the options for the next selection?

I've found a few scripts that cover this on the net, but they seem to be standalone scripts and i'm not sure how to integrate them :S

Back to top
Douglas
Jamroom Team


Joined: 08 Oct 2004
Posts: 6639
Location: Tornado Alley!

Posted: 06/24/09 07:22 
I'm sure it could possibly be done, I'd have to see the script you want to use though. I wouldn't be able to work on it right away, but maybe sometime in the near future.


_________________
Douglas Hackney
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

< Previous12
 
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.