Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Description of the keys  (Read 6691 times)

0 Members and 1 Guest are viewing this topic.

serg5777

  • Coppermine frequent poster
  • ***
  • Country: ru
  • Offline Offline
  • Gender: Male
  • Posts: 171
    • Широкоформатные обои для рабочего стола
Description of the keys
« on: June 28, 2016, 08:54:23 am »

Hello Αndré. I need to output meta description to set: site.com/thumbnails.php?album=search&keywords=on&search=keyword
Code: [Select]
<title>keywords - gallery name</title>
<meta name="description" content="All photos on request: keywords" />
How can I display this field?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Description of the keys
« Reply #1 on: June 30, 2016, 09:14:47 pm »

I haven't checked the current behavior. What exactly needs to be added/adjusted? Just the meta tag, the title tag or both?
Logged

serg5777

  • Coppermine frequent poster
  • ***
  • Country: ru
  • Offline Offline
  • Gender: Male
  • Posts: 171
    • Широкоформатные обои для рабочего стола
Re: Description of the keys
« Reply #2 on: July 01, 2016, 08:23:46 am »

Just a meta tag to "keywords"  :)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Description of the keys
« Reply #3 on: July 12, 2016, 03:38:15 pm »

Copy the function pageheader from themes/sample/theme.php to your theme's theme.php file, if it doesn't already exist there. Then, find
Code: [Select]
global $template_header, $lang_charset, $lang_text_dir;and below, add
Code: [Select]
    global $CPG_PHP_SELF, $USER;
    $superCage = Inspekt::makeSuperCage();
    if ($CPG_PHP_SELF == 'thumbnails.php' && $superCage->get->getAlpha('album') == 'search') {
        $meta .= '<meta name="description" content="All photos on request: '.$USER['search']['search'].'" />';
    }
Logged

serg5777

  • Coppermine frequent poster
  • ***
  • Country: ru
  • Offline Offline
  • Gender: Male
  • Posts: 171
    • Широкоформатные обои для рабочего стола
Re: Description of the keys
« Reply #4 on: July 13, 2016, 01:39:34 pm »

Working! Many thanks!  ;)
Logged

serg5777

  • Coppermine frequent poster
  • ***
  • Country: ru
  • Offline Offline
  • Gender: Male
  • Posts: 171
    • Широкоформатные обои для рабочего стола
Re: Description of the keys
« Reply #5 on: July 18, 2016, 08:58:14 am »

Αndré by your example did the description for the last image:
Code: [Select]
global $CPG_PHP_SELF, $USER;
    $superCage = Inspekt::makeSuperCage();
    if ($CPG_PHP_SELF == 'thumbnails.php' && $superCage->get->getAlpha('album') == 'lastup') {
        $meta.= '<meta name="description" content="Last image - '.$page_num['lastup']['lastup'].'" />';
    }
But something does not work  :-\
$page_num - unsuitable  :-\
Logged

serg5777

  • Coppermine frequent poster
  • ***
  • Country: ru
  • Offline Offline
  • Gender: Male
  • Posts: 171
    • Широкоформатные обои для рабочего стола
Re: Description of the keys
« Reply #6 on: July 18, 2016, 09:12:37 am »

Code: [Select]
if ($page > 0)  {
$page_num = '. Page' . ' ' . $page;
    } else  {
        $page_num = '';
    }

global $CPG_PHP_SELF, $USER, $page_num;
    $superCage = Inspekt::makeSuperCage();
    if ($CPG_PHP_SELF == 'thumbnails.php' && $superCage->get->getAlpha('album') == 'lastup') {
        $meta.= '<meta name="description" content="Last image - '.$page_num['lastup']['lastup'].'" />';
    }
Also, it is impossible...
Logged

serg5777

  • Coppermine frequent poster
  • ***
  • Country: ru
  • Offline Offline
  • Gender: Male
  • Posts: 171
    • Широкоформатные обои для рабочего стола
Re: Description of the keys
« Reply #7 on: July 18, 2016, 09:33:23 am »

I solved a problem addition. Thank you  :)
Code: [Select]
$section.($page > 1 ? ' - Страница '.$page : '')
Logged

serg5777

  • Coppermine frequent poster
  • ***
  • Country: ru
  • Offline Offline
  • Gender: Male
  • Posts: 171
    • Широкоформатные обои для рабочего стола
Re: Description of the keys
« Reply #8 on: July 18, 2016, 09:34:24 am »

P.S. "Страница" - this "page" in rus)
Logged

serg5777

  • Coppermine frequent poster
  • ***
  • Country: ru
  • Offline Offline
  • Gender: Male
  • Posts: 171
    • Широкоформатные обои для рабочего стола
Re: Description of the keys
« Reply #9 on: July 18, 2016, 09:34:59 am »

I solved a problem addition. Thank you  :)
Code: [Select]
$section.($page > 1 ? ' - Page '.$page : '')
Logged

serg5777

  • Coppermine frequent poster
  • ***
  • Country: ru
  • Offline Offline
  • Gender: Male
  • Posts: 171
    • Широкоформатные обои для рабочего стола
Re: Description of the keys
« Reply #10 on: July 18, 2016, 10:02:57 am »

I'm sorry that so much writing, just try the options)
In general, faced with such a problem:
Quote
global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;
    global $CPG_PHP_SELF, $USER;
    $superCage = Inspekt::makeSuperCage();
    if ($CPG_PHP_SELF == 'thumbnails.php' && $superCage->get->getAlpha('album') == 'search') {
        $meta .= '<meta name="description" content="All photos on request: '.$USER['search']['search']. $section.($page > 1 ? ' - Page '.$page : '').'" />';
    }

Thus duplicated keyword in the description.
Code: [Select]
<meta name="description" content="All photos on request: keywordkeyword - Страница 7" />
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Description of the keys
« Reply #11 on: July 18, 2016, 10:09:57 am »

Try to remove $section (for whatever reason you added it). I also don't know how
Code: [Select]
($page > 1 ? ' - Page '.$page : '')should work, as I cannot that the variable $page is currently set/accessible inside pageheader().
Logged

serg5777

  • Coppermine frequent poster
  • ***
  • Country: ru
  • Offline Offline
  • Gender: Male
  • Posts: 171
    • Широкоформатные обои для рабочего стола
Re: Description of the keys
« Reply #12 on: July 18, 2016, 10:18:22 am »

I added this section for the reason that you have previously advised it to me. In other topics  :)
Logged

serg5777

  • Coppermine frequent poster
  • ***
  • Country: ru
  • Offline Offline
  • Gender: Male
  • Posts: 171
    • Широкоформатные обои для рабочего стола
Re: Description of the keys
« Reply #13 on: July 18, 2016, 10:24:14 am »

In thumbnails.php:
Code: [Select]
pageheader($section.($page > 1 ? ' - Page '.$page : ''), $meta_keywords);
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Description of the keys
« Reply #14 on: July 18, 2016, 10:30:49 am »

As I said, try to remove $section to get rid of the keyword dupes.
Logged

serg5777

  • Coppermine frequent poster
  • ***
  • Country: ru
  • Offline Offline
  • Gender: Male
  • Posts: 171
    • Широкоформатные обои для рабочего стола
Re: Description of the keys
« Reply #15 on: July 18, 2016, 10:31:31 am »

Happened! Simply remove '$USER'
Code: [Select]
global $CONFIG, $THEME_DIR;
    global $template_header, $lang_charset, $lang_text_dir;
    global $CPG_PHP_SELF;
    $superCage = Inspekt::makeSuperCage();
    if ($CPG_PHP_SELF == 'thumbnails.php' && $superCage->get->getAlpha('album') == 'search') {
        $meta .= '<meta name="description" content="All photos on request: '.$USER['search']['search'].$section.($page > 1 ? ' - Page '.$page : '').'" />';
    }
Thank you Αndré! ;)
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Description of the keys
« Reply #16 on: July 18, 2016, 10:35:43 am »

Well, usually $section contains more than just the keyword, e.g. here's the output of a search in my testbed:
Quote
Image search results - "keyword1 keyword2 keyword3"

So you probably have also edited the content of $section somewhere else in your code.
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 20 queries.