Author Topic: Need a customized search.php  (Read 23330 times)

0 Members and 1 Guest are viewing this topic.

Offline batu544

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Free Celebrity wallpapers
Need a customized search.php
« on: February 27, 2010, 05:47:05 AM »
Hi,
     I want to modify the existing search.php or create a new search.php to put in my homepage. Currently my homepage lists all the categories, but I want to change it. Now    want to provide a search function, so that user can search their favorite celebrities only by typing the names.

In other words, Can we change the search.php to search only category names ?? No other variables required as a input to the search_new.php script..


Thanks,


 

Offline batu544

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Free Celebrity wallpapers
Re: Need a customized search.php
« Reply #1 on: March 24, 2010, 01:22:45 PM »
Hi,
     Anyone have any idea..   :roll: 


thanks,

Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Re: Need a customized search.php
« Reply #2 on: March 24, 2010, 03:56:07 PM »
hey batu.. did u try the Cool SEARCH IN THIS FORUM   :mrgreen:   ?

i saw some topics related to ur problem ....
even i like it..i also had this in mind for a long time  :wink:
I'm Back :)

Rembrandt

  • Guest
Re: Need a customized search.php
« Reply #3 on: March 24, 2010, 06:31:26 PM »
Hi!
...., Can we change the search.php to search only category names ?? No other variables required as a input to the search_new.php script....

instead the quick search or advanced, and need you a dropdown field with category name?

mfg Andi

Offline batu544

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Free Celebrity wallpapers
Re: Need a customized search.php
« Reply #4 on: March 25, 2010, 10:42:20 AM »

instead the quick search or advanced, and need you a dropdown field with category name?

mfg Andi

Hi Rembrandt,
   Thanks for reply.. but I am looking for a different kind of search..this search is not for images, its for categories..

   Let me explain the search little bit more here..

... lets say,  I have following categories in my gallery
      1. Rembrandt  Sharma
      2. Rembrandt  sahoo
      3. Rembrandt  Jack
      4. Gayan
      5. xxxxx
   
and now I am looking for "Rembrandt Sahoo"  , so I entered Rembrandt in the search field .. The search result should return  all three category names so that I can select the correct one..

  and if I will enter the category name correctly ..like "Rembrandt Sahoo"... then it should take me directly to the "Rembrandt Sahoo" category..



Does this explanation make sense now ??



Gayan,
           I did a search .. but there is no modified search like this..  :(


Rembrandt

  • Guest
Re: Need a customized search.php
« Reply #5 on: March 25, 2010, 11:34:26 AM »
...
Does this explanation make sense now ??....

ahh ..ok, i think this is not so easy...

Offline batu544

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Free Celebrity wallpapers
Re: Need a customized search.php
« Reply #6 on: March 25, 2010, 01:18:07 PM »
ahh ..ok, i think this is not so easy...

I agree.. its not easy.. but I think if we can remove the 2nd criteria.. ( directly going to the exact category name) then it could be little bit easier..


Rembrandt

  • Guest
Re: Need a customized search.php
« Reply #7 on: March 27, 2010, 05:07:00 PM »
Quote
and now I am looking for "Rembrandt Sahoo"  , so I entered Rembrandt in the search field .. The search result should return  all three category names so that I can select the correct one..
done..  :D
Quote
and if I will enter the category name correctly ..like "Rembrandt Sahoo"... then it should take me directly to the "Rembrandt Sahoo" category..
done..   :D


so, i hope i have all...

create a new file, call it "search_cat.php" and store in your root:

<?php
 
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: search_cat.php                                       *
 *        Copyright: (C) 2002-2009 Jan Sorgalla                           *
 *            Email: jan@4homepages.de                                    * 
 *              Web: http://www.4homepages.de                             * 
 *    Scriptversion: 1.7.7                                                *
 *     File Version: 1.0.0 (by Rembrandt www.vienna-pictures.com)         *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/

$main_template 'search_cat';

define('GET_CACHES'1);
define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

//-----------------------------------------------------
//--- Show Categories ---------------------------------
//-----------------------------------------------------
$categories get_categories(0);
  if (!
$categories)  {
    
$categories $lang['no_categories'];
  }
  
$site_template->register_vars("categories"$categories);
  unset(
$categories);

  
$cattable_width ceil((intval($config['cat_table_width'])) / $config['cat_cells']);
    if ((
substr($config['cat_table_width'],-1)) == "%") {
      
$cattable_width .= "%";
  }

  if (!isset(
$HTTP_POST_VARS['cat_name'])){
    
redirect($site_sess->url(ROOT_PATH."search.php?search_keywords=".$HTTP_POST_VARS['search_keywords']));
  }

  if (isset(
$HTTP_GET_VARS['search_keywords']) || isset($HTTP_POST_VARS['search_keywords'])) {
      
$search_category = isset($HTTP_POST_VARS['search_keywords']) ? $HTTP_POST_VARS['search_keywords'] : $HTTP_GET_VARS['search_keywords'];
  }
  else {
    
$search_category "";
  }
  
  
$search_category str_replace('*''%'trim($search_category));
  
   
$sql "SELECT cat_id,cat_name
          FROM "
.CATEGORIES_TABLE."
          WHERE cat_id NOT IN ("
.get_auth_cat_sql("auth_viewcat""NOTIN").") AND cat_name = '$search_category'
          ORDER BY cat_name ASC
         "
;
  
$result $site_db->query($sql);
  
$row mysql_fetch_object($result);
  if(
strtolower($search_category) == strtolower($row->cat_name)){
  
//print_r("gefunden");
  
redirect($site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$row->cat_id));
  }
  
 
$sql "SELECT c.cat_id,c.cat_name,i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file
        FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        WHERE i.image_active = 1 AND i.cat_id = c.cat_id AND c.cat_id NOT IN ("
.get_auth_cat_sql("auth_viewcat""NOTIN").")  AND c.cat_name LIKE '$search_category
        GROUP BY c.cat_name
        ORDER BY c.cat_name ASC 
        "
;
  
$result $site_db->query($sql);
  
$cat_list "<table width=\"".$config['cat_table_width']."\" border=\"0\" cellpadding=\"".$config['cat_table_cellpadding']."\" cellspacing=\"".$config['cat_table_cellspacing']."\">";
  
$count 0;
  
  while (
$image_row $site_db->fetch_array($result)) {
    if (
$count == 0) {
     
$cat_list .= "<tr >\n";
    }
    
$cat_list .= "<td width=\"".$cattable_width."\"valign=\"top\">\n";
    
$show_image($image_row);
    
$site_template->register_vars(array(
      
"cat_url"=> $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$image_row['cat_id']),
      
"cat_name"=> $image_row['cat_name']
    ));
    
    
$cat_list .= $site_template->parse_template("search_cat_bit");
    
$cat_list .= "\n</td>\n";
    
$count++;
    if (
$count == $config['cat_cells']) {
      
$cat_list .= "</tr>\n";
      
$count 0;
    }      
  } 
//while
  
   
if ($count 0)  {
    
$leftover = ($config['cat_cells'] - $count);
    if (
$leftover >= 1) {
      for (
$f 0$f $leftover$f++) {
        
$cat_list .= "<td width=\"".$cattable_width."\">\n&nbsp;\n</td>\n";
      }
      
$cat_list .= "</tr>\n";
    }
  }
  
$cat_list .= "</table>\n";

  
$site_template->register_vars(array(
    
"search_category" => format_text(stripslashes($org_search_category), 2),
    
"cat_list" => $cat_list,
    ));
unset(
$cat_list);

//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];
if (
$cat_id && isset($cat_cache[$cat_id])) {
  
$clickstream .= get_category_path($cat_id1).$config['category_separator'];
}
$clickstream .= $lang['search']."</span>";

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------

$site_template->register_vars(array(
  
"msg" => $msg,
  
"clickstream" => $clickstream,
));
$site_template->print_template($site_template->parse_template($main_template));

include(
ROOT_PATH.'includes/page_footer.php');
?>



create a new file, call it "search_cat.html" and store in your template folder:
Code: [Select]
{header}
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tablehead">
        <tr>
          <td width="100%" colspan="4"><table cellpadding="0" cellspacing="0" width="100%">
        <tr>
        <td width="6"><img src="{template_url}/images/header_top_left.gif" width="6" height="6" alt=""></td>
        <td width="100%"><img src="{template_url}/images/header_top.gif" width="100%" height="6" alt=""></td>
        <td width="6"><img src="{template_url}/images/header_top_right.gif" width="6" height="6" alt=""></td>
    </tr>
</table>
      </td>
        </tr>
          <tr>
          <td width="6"><img src="{template_url}/images/header_left.gif" width="6" height="60" alt=""></td>
          <td width="100%"><img src="{template_url}/images/header_logo.gif" width="405" height="60" alt=""></td>
          <td width="225" align="right">
            <form method="post" action="search_cat.php">
              <table border="0" cellspacing="0" cellpadding="1">
               <tr valign="top">
                 <td><input type="checkbox" name="cat_name" value="cat_name" >{lang_categories}</td>
                </tr>
                <tr>
                  <td>
                    <input type="text" name="search_keywords" size="15" class="searchinput" />
                  </td>
                  <td>
                    <input type="submit" value="{lang_search}" class="button" name="submit" />
                  </td>
                </tr>
                <tr valign="top">
                <td colspan="2"><a href="{url_search}" class="smalltext">{lang_advanced_search}</a></td>
                </tr>
              </table>
            </form>
          </td>
          <td align="right" width="6"><img src="{template_url}/images/header_right.gif" width="6" height="60" alt=""></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bordercolor">
      <table width="100%" border="0" cellspacing="1" cellpadding="0">
        <tr>
          <td class="tablebgcolor">
            <table width="100%" border="0" cellspacing="1" cellpadding="0">
              <tr>
                <td class="navbar" height="23">
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="">{clickstream}</td>
                      <td align="right">
                        <a href="{url_top_images}"><b>{lang_top_images}</b></a>&nbsp;
                        <a href="{url_new_images}"><b>{lang_new_images}</b></a>&nbsp;
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="150" valign="top" class="row2">
                  <table width="150" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head2" height="20"><img src="{template_url}/images/spacer.gif" alt="" width="4" height="4">{lang_registered_user}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1"></td>
                    </tr>
                    <tr>
                      <td align="center" class="row1">{user_box} </td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1"></td>
                    </tr>
                  </table>
                  {if random_image}
                  <table width="150" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td class="head2" height="20"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4">{lang_random_image}</td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1"></td>
                    </tr>
                    <tr>
                      <td align="center" class="row1">
                      <br>
                        {random_image}
                      <br>
                        <br>
                      </td>
                    </tr>
                    <tr>
                      <td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1"></td>
                    </tr>
                  </table>
                  {endif random_image}
                </td>
                <td width="1" class="bordercolor" valign="top"><img src="{template_url}/images/spacer.gif" width="1" height="1" alt=""></td>
                <td width="18" valign="top"><img src="{template_url}/images/spacer.gif" width="18" height="18" alt=""></td>
                <td valign="top"><br>
                  <b class="title">{lang_categories}</b>
                  <hr size="1">
                  {if msg}<b>{msg}</b><br><br>{endif msg}
              
                  <table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="head1">
                        <table width="100%" border="0" cellspacing="0" cellpadding="3">
                          <tr>
                            <td class="head1" valign="top">{lang_categories}</td>
                          </tr>
                          <tr>
                            <td class="row2" valign="top">{cat_list}</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
                  <br>
                  
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td>{category_dropdown_form}</td>
                      <td align="right">{setperpage_dropdown_form}</td>
                    </tr>
                  </table>
                  <p>&nbsp;</p>
                </td>
                <td width="20" valign="top"><img src="{template_url}/images/spacer.gif" width="19" height="19" alt=""></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tablebottom">
        <tr>
          <td width="6" nowrap><img src="{template_url}/images/footer_left.gif" width="6" height="19" alt=""></td>
          <td width="100%"></td>
          <td width="6" nowrap><img src="{template_url}/images/footer_right.gif" width="6" height="19" alt=""></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
{footer}                  


create a new file, call it "search_cat_bit.html" and store in your template folder:
Code: [Select]
{thumbnail}<a href="{cat_url}">{cat_name}</a><br><br>

search in your template/home.html:
Code: [Select]
           <form method="post" action="{url_search}">
              <table border="0" cellspacing="0" cellpadding="1">
                <tr>
                  <td>
                    <input type="text" name="search_keywords" size="15" class="searchinput" />
                  </td>
                  <td>
                    <input type="submit" value="{lang_search}" class="button" name="submit" />
                  </td>
                </tr>
                <tr valign="top">
                  <td colspan="2"><a href="{url_search}" class="smalltext">{lang_advanced_search}</a></td>
                </tr>
              </table>
            </form>
replace it:
Code: [Select]
<form method="post" action="search_cat.php">
              <table border="0" cellspacing="0" cellpadding="1">
               <tr valign="top">
                 <td><input type="checkbox" name="cat_name" value="cat_name" >{lang_categories}</td>
                </tr>
                <tr>
                  <td>
                    <input type="text" name="search_keywords" size="15" class="searchinput" />
                  </td>
                  <td>
                    <input type="submit" value="{lang_search}" class="button" name="submit" />
                  </td>
                </tr>
                <tr valign="top">
                <td colspan="2"><a href="{url_search}" class="smalltext">{lang_advanced_search}</a></td>
                </tr>
              </table>
            </form>

mfg Andi


« Last Edit: March 29, 2010, 08:33:57 AM by Rembrandt »

Offline batu544

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Free Celebrity wallpapers
Re: Need a customized search.php
« Reply #8 on: March 28, 2010, 06:15:21 PM »
Hi Rembrandt,
                      Many many thanks for creating this files for me. I was also, trying to develop these files myself. but as you know, I have no idea on php :)  .. so I don't know how efficient my code is..

   I will implement your code today.. !! before that .. is it possible to  make the changes  to display one thumbnail for the category list, when the search result returns more than one category ??


Also, I am attaching my code  ( by looking into it .. you can understand how bad I am in php..  :oops: ) .. In this code.. it displays one thumbnail for each category.
Code: [Select]
<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: searchnew.php                                       *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7.4                                                *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *   ------------------------------------------------------------------   *
 *                C H A N G E      L OG                                   *
 *   ------------------------------------------------------------------   *
 *                                                                        *
 *                                                                        *
 *************************************************************************/


$main_template 'searchnew';

define('ROOT_PATH''./');
include(
ROOT_PATH.'global.php');
require(
ROOT_PATH.'includes/sessions.php');
$user_access get_permission();
include(
ROOT_PATH.'includes/page_header.php');

if (isset(
$HTTP_GET_VARS['cat']) || isset($HTTP_POST_VARS['cat'])) {
  
$cat = isset($HTTP_POST_VARS['cat']) ? trim($HTTP_POST_VARS['cat']) : trim($HTTP_GET_VARS['cat']);
}
If (
$cat == ""){
  
$sel_cats "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  
$sel_cats .= "<b>Please enter atleast 3 letter of your Favorite Celebrity</b>";
  
$sel_cats .= "</td></tr></table>";
} else
{
$cat_search "$cat"."%" ;
$sql "SELECT c.cat_name,c.cat_id
        FROM "
.CATEGORIES_TABLE." c
        WHERE c.cat_name like '
$cat_search'
          AND c.cat_parent_id <> '110'
        ORDER BY c.cat_id ASC" 
;
$result $site_db->query($sql);
$num_rows $site_db->get_numrows($result);

if (!
$num_rows)  {
  
$sel_cats "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\"><tr class=\"imagerow1\"><td>";
  
$sel_cats .= "<b>No Celebrity Found.. Please Search again</b>";
  
$sel_cats .= "</td></tr></table>";
}
else  {
  
$sel_cats .= "<table width=\"".$config['image_table_width']."\" border=\"0\" cellpadding=\"".$config['image_table_cellpadding']."\" cellspacing=\"".$config['image_table_cellspacing']."\">";
  
$count 0;
  
$bgcounter 0;
  while (
$cat_row $site_db->fetch_array($result)){
    if (
$count == 0) {
      
$row_bg_number = ($bgcounter++ % == 0) ? 2;
      
$sel_cats .= "<tr class=\"imagerow".$row_bg_number."\">\n";
    }
    
$sel_cats .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
$cats "AND i.cat_id = ".$cat_row['cat_id']."";
    
$sql1 "SELECT i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits".$additional_sql.", c.cat_name".get_user_table_field(", u.""user_name")."
        FROM ("
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c)
        LEFT JOIN "
.USERS_TABLE." u ON (".get_user_table_field("u.""user_id")." = i.user_id)
        WHERE i.image_active = 1 AND c.cat_id = i.cat_id 
$cats
        LIMIT 1"
;
$result1 $site_db->query($sql1);
    
$image_row $site_db->fetch_array($result1);
$new_image get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode$show_link$image_row['image_description']);
$sel_cats .= "<b><a href=\"".$site_sess->url(ROOT_PATH."categories.php?cat_id=".$cat_row['cat_id'])."\" >".$new_image."".$cat_row['cat_name']."</a></b>";
    
$sel_cats .= "\n</td>\n";
    
$count++;
    if (
$count == $config['image_cells']) {
      
$sel_cats .= "</tr>\n";
      
$count 0;
    }
  } 
// end while
  
$sel_cats .= "</table>\n";
}
}
$content $sel_cats ;
unset(
$sel_cats);

//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream "<span class=\"clickstream\"><a title=\"".$lang['home']."\" href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."searchnew.php")."\" class=\"clickstream\">".$lang['search']."</a>".$config['category_separator'].$cat."</span>";
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars(array(
  
"content" => $content,
  
"clickstream" => $clickstream,
  
"page_title" => $page_title// MOD: Dynamic page title
));
$site_template->print_template($site_template->parse_template($main_template));
include(
ROOT_PATH.'includes/page_footer.php');
?>


and my searchnew.html contains.. below details along with other as usual code..
Code: [Select]
<!--    Members details starts here ---------------------------------------------------------->
<form method="post" action="./searchnew.php">
<table align="center">
<tr>
<td class="td_border"> <input type="text" name="cat" size="15" /></td>
<td><input type="submit" value="Search" class="button" name="submit" /></td>
</tr>
</table>
</form>
{content}



Thanks,
batu544
 

Rembrandt

  • Guest
Re: Need a customized search.php
« Reply #9 on: March 29, 2010, 08:32:06 AM »
...
 is it possible to  make the changes  to display one thumbnail for the category list, when the search result returns more than one category ?? ...

i have edit my first post.
new sql query, while and the "search_cat_bit.html"

mfg Andi

Offline batu544

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Free Celebrity wallpapers
Re: Need a customized search.php
« Reply #10 on: April 01, 2010, 07:07:01 AM »
Hi Rembrandt,
                     I added your script in my website.. and it worked with little bit correction...

1. I don't feel there is a need for the following part in the script.. So, I removed it.
Code: [Select]
$categories = get_categories(0);
  if (!$categories)  {
    $categories = $lang['no_categories'];
  }
  $site_template->register_vars("categories", $categories);
  unset($categories);

2. Also, I noticed that as per your code ... user needs to put a '%' at the end of the search string to get the result..

I have not modified the code to get the thumbnail in the search result page yet.. I will post the modified file.. once everything is finished .. from my side.. :) . By the mean time, if anyone would like to see how it works, then they can visit my website.. ( links are provided in signature :)  )


Thanks for your great Help.. !!!


Rembrandt

  • Guest
Re: Need a customized search.php
« Reply #11 on: April 01, 2010, 10:34:30 AM »
....
2. Also, I noticed that as per your code ... user needs to put a '%' at the end of the search string to get the result.. ....

? ähh no, in my code user needs to put a '*' at the end of the search string to get the result.
$search_category str_replace('*''%'trim($search_category));

Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Re: Need a customized search.php
« Reply #12 on: April 28, 2010, 05:15:13 PM »
hey, I went trough the demo  :roll: but i couldn't see any thumbs Appearing for the result  8O , are you guys still working on this ? This is a cool way, let me give a idea to make this more stronger and difficult to code  :mrgreen:

if we can give suggestions, it will be cool..  example

we have got 5 cats in our 4image..

1) batu
2) Rembrandt
3) Nicky
4) GaYan
5) Kurt

the user searches for the kthe word "baut" instead of batu. then at that moment without saying "no Images found" , if we can disply the suggestion ,, "" Are you Looking For BATU ? ""
it will act soo cool...

i dont know what it takes to built this.. but.. isnt this is a good idae ?  :mrgreen:
im sorry if this makes the coders feel badly..


anyway, im going to test the mod ..  :arrow: Thanks lot Rembrandt & Batu
I'm Back :)

Offline batu544

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Free Celebrity wallpapers
Re: Need a customized search.php
« Reply #13 on: April 28, 2010, 08:50:01 PM »
Hi GaYan,
                   Is your website has been hacked by someone ??

                  I am not getting time to modify my new search_cat.php file to include the thumbnails.. I will do it as soon as possible... [:)]

Thanks,
batu544

Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Re: Need a customized search.php
« Reply #14 on: April 28, 2010, 08:57:02 PM »
ohh man, tnx,, somebody has played with my .htacsess file  :( now its back :) Thanks Batu ..
I'm Back :)