forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: togi on February 10, 2009, 03:56:24 pm

Title: search "tag" title
Post by: togi on February 10, 2009, 03:56:24 pm
How do i make the tags typed in search be part of the title of the page?

ex1. if i click on a keyword on the photo.. it bring me to a tag search where i can place the tag term which was searched as title..  - Red Car Search Results
actual example - http://www.photo.net.ph/displayimage-search-0-6.html  under keywords click iloilo - how do i make the title for that page Iloilo Search Results instead of just search results?

ex2. if i search on the search (search.php) feature of coppermine how do  i make it dynamically add the tag to the title?
http://www.photo.net.ph/displayimage-search-0-6.html if i type the same another term like "Food" how do i make the title come out as Food Search Results?

The end result I want to achieve is   = "Search term" Search Results ( as title)

I tried looking at archives and couldnt find any reference.

Title: Re: search "tag" title
Post by: togi on February 11, 2009, 01:01:07 am
oops

in ex2
 sample should be http://www.photo.net.ph/search.php
Title: Re: search "tag" title
Post by: Ludo on February 11, 2009, 10:06:24 am
OPEN
thumbnails.php

FIND (line 163)
Code: [Select]
pageheader(isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] : $lang_meta_album_names[$album]);
REPLACE WITH
Code: [Select]
$page_title = (isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] : $lang_meta_album_names[$album]);
if (isset($USER['search']['search'])) {
    $page_title = $USER['search']['search'] . " $page_title";
} elseif (isset($_POST['search'])) {
    $page_title = $_POST['search'] . " $page_title";
}
pageheader($page_title);

SAVE AND CLOSE
Title: Re: search "tag" title
Post by: togi on February 11, 2009, 10:14:15 am
Thank you for the quick response!

Perfect exactly what I wanted to do! :)
Title: Re: search "tag" title
Post by: togi on February 11, 2009, 10:19:09 am
oops it doesnt work when you click the keywords http://www.photo.net.ph/search.php

ex. keyword "aklan"
http://photo.net.ph/thumbnails-search-aklan.html

Title is still "Search the file collection"
Title: Re: search "tag" title
Post by: Ludo on February 11, 2009, 10:33:20 am
Sorry, but in my gallery I don't have keywords list (it's a mod/plugin, I suppose)
Mod code above updated, try this new version
Title: Re: search "tag" title
Post by: fotografi on October 26, 2009, 12:32:19 pm
It works very well, except that there seems to be a bug.
After I have searched for a word that word is added to every album title afterwards. It is a cookie issue, because if I delete the cookies the problem disappear.
Title: Re: search "tag" title
Post by: Ludo on October 26, 2009, 02:49:34 pm
That's standard behaviour...
Title: Re: search "tag" title
Post by: fotografi on October 26, 2009, 06:09:00 pm
Is there no way to solve this "behaviour"? I don't want to see in the title bar the word I searched in every album i visit!

Cheers
Title: Re: search "tag" title
Post by: Ludo on October 26, 2009, 06:17:02 pm
Try this replace, instead of the one above:
Code: [Select]
$page_title = (isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] : $lang_meta_album_names[$album]);
if (isset($_POST['search'])) {
    $page_title = $_POST['search'] . " $page_title";
}
pageheader($page_title);
Title: Re: search "tag" title
Post by: fotografi on October 26, 2009, 10:01:49 pm
With the new code the hack is not working anymore. I just get "search resultes".