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.
oops
in ex2
sample should be http://www.photo.net.ph/search.php
OPEN
thumbnails.php
FIND (line 163)
pageheader(isset($CURRENT_ALBUM_DATA) ? $CURRENT_ALBUM_DATA['title'] : $lang_meta_album_names[$album]);
REPLACE WITH
$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
Thank you for the quick response!
Perfect exactly what I wanted to do! :)
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"
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
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.
That's standard behaviour...
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
Try this replace, instead of the one above:
$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);
With the new code the hack is not working anymore. I just get "search resultes".