PDA

View Full Version : php code question


stevehof
11th of February 2003 (Tue), 11:17
Hi, I'd like to to have listings page display something like the following text:

22 photos found in category "lions" by your search.

The following code prints out the selected category ID number. Naturally, I'd like it to print the category NAME. Admittedly, I'm only a novice php hacker...:^)

if ($s_simplenavigation_search == "1") {
print " in the category " . "$category" . " by your search.";
}
else { print " in the category . "$category" . ";



Thanks,

Pekka
11th of February 2003 (Tue), 12:30
To avoid an extra query, alter categorylist dropdown code to

---------



---------


and then the code you mentioned to

-------

print "" . $results_available . " photos found";
print " in the category '" . $current_category_name . "'.";
print " This exhibition has " . $max_available . " photos in total. ";

--------

I took the simplenavigation check off as it is not valid in all cases now.

stevehof
11th of February 2003 (Tue), 19:05
Pekka,

Thank You for taking the time to help me out!! I had a little trouble with the last three lines of code you provided. I got an error to the effect that $max_available was an undefined varible. Maybe I didn't get something right in the copy paste or it had to to with the fact that I'm using EE 1.22? In any case, I had success by just replacing the line below in the proper place in the original code


print " in the category '" . $current_category_name . "'.";