Author Topic: [MOD] Search Result Category Listing  (Read 43147 times)

0 Members and 1 Guest are viewing this topic.

Offline Fragezeichen

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Re: [MOD] Search Result Category Listing
« Reply #15 on: July 21, 2007, 12:54:33 AM »
 :evil:
It want work with Version 1.7.4!

Did anybody make some experience with this Version?

Offline m.a

  • Jr. Member
  • **
  • Posts: 83
    • View Profile
Re: [MOD] Search Result Category Listing
« Reply #16 on: July 21, 2007, 01:18:52 AM »
Hi CHOICEANOTHERNAME,

i use version 1.7.4!
it works perfectly ... ([MOD]  Search Result Category Listing)!

m.a



:evil:
It want work with Version 1.7.4!

Did anybody make some experience with this Version?

Offline kowalski

  • Newbie
  • *
  • Posts: 17
    • View Profile
Re: [MOD] Search Result Category Listing
« Reply #17 on: August 07, 2007, 08:12:30 AM »
Hi - I installed this mod yesterday and got the same error as ivan (on a new 1.7.4 gallery I'm building)

The error was occuring whenever a search returned no images (or if you made a blank search)..
eg. do a search for "xyzhrlodgahsd;gsajhfdag" and it returns no images, but also gives that error at the top


hello, wenn i report on global on
comes a error message

Notice: Undefined variable: catlist in E:\Localserver\httpdocs\bildergallery1.7.4\search.php on line 368

365   "lang_search" => $lang['search'],
366   "lang_search_catlist" => $lang['search_catlist'], // Result category list
367   "catlist" => $catlist // Result category list
368    ));

this is a fresh install of 1.7.4
the {if catlist} is not correct on advanced search (see image)

the error comes in vers. 1.7.1 etc. with error reporting on global.php




Using the updated fix by m.a below this solved the problem :) thank you


hi jasmine,
when a new version (1.7.4) with this mod, comes this error
im use a offline xampp software to preview on my website

Hi Ivan,

Try in Setup 3 with this:
Code: [Select]
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
if(!isset($catlist)){
$catlist = '';
}
$site_template->register_vars(array(
/*#########[MOD] Search Result Category Listing ##################*/
"catlist" => $catlist, // Result category list
/*#########Ende Search Result Category Listing ##################*/

Notice: Undefined variable: catlist in E:\Localserver\httpdocs\bildergallery1.7.4\search.php on line 368
That is one problem with php without isset check!

Best Regards
m.a

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [MOD] Search Result Category Listing
« Reply #18 on: August 07, 2007, 02:23:47 PM »
change:

Quote
"catlist" => $catlist

for:

Quote
"catlist" => (isset($catlist)) ? $catlist : ""
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [MOD] Search Result Category Listing
« Reply #19 on: April 26, 2009, 08:26:18 PM »
Any way to say how many images were found in each of the categories listed with a number?

Great mod thanks!
As long as I can finish my site before I die.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD] Search Result Category Listing
« Reply #20 on: April 27, 2009, 12:16:47 AM »
in step 1 use this code:
Code: [Select]
  $catlist_ary = array(); // Result category list

  while ($image_row = $site_db->fetch_array( $result )) {

    $key = get_category_path( $image_row['cat_id'], 1 ).$config['category_separator'].format_text(stripslashes($org_search_keywords), 2);
    $catlist_ary[$key] = (isset($catlist_ary[$key])) ?  $catlist_ary[$key] + 1 : 1; // Result category list

In step 2 this:
Code: [Select]
  ksort($catlist_ary); // Result category list
  $catlist = "";
  foreach($catlist_ary as $key => $val)
  {
    $catlist .= $lang['searchresult_catlist_sep'] . $key . " (".$val.")";
  }
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline AntiNSA2

  • Hero Member
  • *****
  • Posts: 774
  • As long as I can finish my site before I die.
    • View Profile
    • http://www.thelifephotography.com
Re: [MOD] Search Result Category Listing
« Reply #21 on: May 03, 2009, 09:16:00 AM »
Thank you V@no... Works great...

2 quick questions...

1) If you have a lot of different search results within categories it only shows a limited number of results... how to increase this...

and
2) even after replacing the code in step three with
Code: [Select]
//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
if(!isset($catlist)){
$catlist = '';
}
$site_template->register_vars(array(
/*#########[MOD] Search Result Category Listing ##################*/
"catlist" => $catlist, // Result category list
/*#########Ende Search Result Category Listing ##################*/

I m still receiving an undefined catlist error... Anyway to get reid of the error with 1.7.6 ?
As long as I can finish my site before I die.