Advanced search  

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

Pages: [1]   Go Down

Author Topic: search "tag" title  (Read 4006 times)

0 Members and 1 Guest are viewing this topic.

togi

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
search "tag" title
« 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.

Logged

togi

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Re: search "tag" title
« Reply #1 on: February 11, 2009, 01:01:07 am »

oops

in ex2
 sample should be http://www.photo.net.ph/search.php
Logged

Ludo

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: search "tag" title
« Reply #2 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
« Last Edit: February 11, 2009, 10:31:51 am by Ludo »
Logged

togi

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Re: search "tag" title
« Reply #3 on: February 11, 2009, 10:14:15 am »

Thank you for the quick response!

Perfect exactly what I wanted to do! :)
Logged

togi

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 61
Re: search "tag" title
« Reply #4 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"
Logged

Ludo

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: search "tag" title
« Reply #5 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
Logged

fotografi

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: search "tag" title
« Reply #6 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.
Logged

Ludo

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: search "tag" title
« Reply #7 on: October 26, 2009, 02:49:34 pm »

That's standard behaviour...
Logged

fotografi

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: search "tag" title
« Reply #8 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
Logged

Ludo

  • Contributor
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 706
    • E+GiElle
Re: search "tag" title
« Reply #9 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);
Logged

fotografi

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: search "tag" title
« Reply #10 on: October 26, 2009, 10:01:49 pm »

With the new code the hack is not working anymore. I just get "search resultes".
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.