search "tag" title search "tag" title
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

search "tag" title

Started by togi, February 10, 2009, 03:56:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

togi

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.


togi


Ludo

#2
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

togi

Thank you for the quick response!

Perfect exactly what I wanted to do! :)

togi

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"

Ludo

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

fotografi

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.

Ludo

That's standard behaviour...

fotografi

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

Ludo

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);

fotografi

With the new code the hack is not working anymore. I just get "search resultes".