Announcement

#1 2010-10-03 22:09:54

sergix
Member
2010-08-18
24

changes in the index head

Is there any way to change the description and add keywords on the meta-head in the index?

Offline

 

#2 2010-10-10 18:31:54

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: changes in the index head

For change keywords on the meta-head you can use [extension by ddtddt] Meta


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#3 2010-10-10 18:46:00

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: changes in the index head

For 'home' of the <title> you want to put something else instead or just remove 'home'


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#4 2010-10-13 11:30:20

sergix
Member
2010-08-18
24

Re: changes in the index head

On the META HEADS title and description are the same..

example:

<title>Home / Carnevale di Venezia</title>
<meta name="description" content="Home / Carnevale di Venezia">

it is possible that the description of the category or the album will be like the individual photos?

like this (example):

<title>Carnevale di Venezia</title>
<meta name="description" content="Fotografie del Carnevale di Venezia del 2009, 2008 e 2007. Documentazione dei costumi e delle maschere.">


- I tried to change the "Templates" as indicated by LucMorizur, then the problem is that all pages of the photos will all have the same title and description with the result of being penalized by search engines


- the plugin "Meta" that you suggested add the same description in all pages.
would be very important that the most important page of the platform can be modified (title, description and keywords)


* My opinion is that "Home /" should be removed from the meta
Home is an indication and not a title! That indication might confuse the search engines to the main content of an album or category

Offline

 

#5 2010-10-13 16:45:04

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: changes in the index head

Can you test

add_event_handler('loc_end_page_header', 'simptitle' );

function simptitle ()
{global $template, $page, $title2, $conf;

$title2 = array();
$title2['page'] = $template->get_template_vars('PAGE_TITLE');

$array = explode($conf['level_separator'], $title2['page']);
$count = count($array);

if (!empty($array[$count-1]))
{
$template->assign('PAGE_TITLE', $array[$count-1]);
}
}


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#6 2010-10-14 08:36:09

sergix
Member
2010-08-18
24

Re: changes in the index head

thanks, can you tell me where to place the code

Offline

 

#7 2010-10-19 08:48:15

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: changes in the index head

With plugin LocalFilesEditor tab 'personal plugin'

(you must active and install personal plugin)


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#8 2010-10-21 11:39:27

sergix
Member
2010-08-18
24

Re: changes in the index head

I tried to upload the code that you gave (see attached image) but the platform crashes :-(

Last edited by sergix (2010-10-21 11:40:59)

Offline

 

#9 2010-10-21 11:46:31

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: changes in the index head

Can you give me link by e-mail


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#10 2010-10-21 12:10:36

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: changes in the index head

We must put the code in the tab 'Personal plugin'


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#11 2010-10-21 12:28:11

sergix
Member
2010-08-18
24

Re: changes in the index head

Done! But I see no changes :-(

Offline

 

#12 2010-10-21 13:35:58

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: changes in the index head

sergix wrote:

Done! But I see no changes :-(

have you install and active plugin ?


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

Notice: Undefined offset: 116691 in /var/www/piwigo.org/forum/include/parser.php on line 459

#13 2010-10-31 22:50:52

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: changes in the index head

For the purposes of the description tag, I suggest you [Forum, topic 116691]


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#14 2010-11-05 15:17:54

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: changes in the index head

If I understand your request

a plugin for you

(you must desactive meta/metasimple ans simpletitle)

<?php
/*
Plugin Name: sergix
Version: auto
Description:
Plugin URI: http://piwigo.org/ext/extension_view.php?eid=
Author: ddtddt
Author URI: http://piwigo.org/
*/

if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');

add_event_handler('loc_begin_page_header', 'Change_sergix',10 );
add_event_handler('loc_end_page_header', 'gensergix',53);
add_event_handler('loc_end_page_header', 'sergixacc',55);
add_event_handler('loc_end_page_header', 'sergixcat',60);
add_event_handler('loc_end_page_header', 'sergiximg',70);
add_event_handler('loc_end_page_header', 'set_sergix_back',80);


function Change_sergix()
{
    global $template;
    $template->set_prefilter('header', 'upmatasergix');
    $template->set_prefilter('header', 'uptitlesergix');
}


function upmatasergix ($content, &$smarty)
{
  $search = '#<meta name="description" content=".*?">#';
 
  $replacement = '<meta name="description" content="{$SERGIX_META}">';

  return preg_replace($search, $replacement, $content);
}


function uptitlesergix($content, &$smarty)
{
  $search = '#<title>.*?</title>#';
 
  $replacement = '<title>{$SERGIX_TITLE}</title>';

  return preg_replace($search, $replacement, $content);
}


function gensergix()
{
    global $template, $page, $conf;

        $titlegen = & $conf['titlesergix'];       
         if (!empty($titlegen))
            {
                $template->assign('SERGIX_TITLE', $titlegen);
            }
         else
            {
                $titlegen = & $conf['gallery_title'];       
                $template->assign('SERGIX_TITLE', $titlegen);
            }



function sergixacc()
    {
    global $template, $page, $meta_infosdesc, $conf;
    $meta_infosdesc = array();
    $meta_infosdesc['info'] = $template->get_template_vars('INFO_FILE');
    $meta_infosdesc['page'] = $template->get_template_vars('PAGE_TITLE');
    $meta_infosdesc['comment'] = $template->get_template_vars('COMMENT_IMG');
    $meta_infos['title'] = $template->get_template_vars('GALLERY_TITLE');
      
      if (isset($page['section']) and $page['section'] == 'categories' and empty($page['category']['id']))
        {
        $titleindex = & $conf['titleexgix_accueil'];       
        $template->assign('SERGIX_TITLE', $titleindex. ' - ' .$meta_infos['title']);
       
        $descindex = & $conf['metasergixacc'];       
          $template->assign('SERGIX_META', $descindex);
        }
   
    }

function sergixcat()
    {
    global $template, $page, $meta_infosdesc, $conf;
    $meta_infosdesc = array();
    $meta_infosdesc['info'] = $template->get_template_vars('INFO_FILE');
    $meta_infosdesc['page'] = $template->get_template_vars('PAGE_TITLE');
    $meta_infosdesc['comment'] = $template->get_template_vars('COMMENT_IMG');
    $meta_infos['title'] = $template->get_template_vars('GALLERY_TITLE');
        
         if (!empty($page['category']['id']) )   
                {
    $query = '
    select id,name,comment
      FROM ' . CATEGORIES_TABLE . '
      WHERE id = \''.$page['category']['id'].'\'
      ;';
    $result = pwg_query($query);
    $row = mysql_fetch_array($result);
        if (!empty($row['name']))
            {
                $template->assign('SERGIX_TITLE', $row['name']);
            }
        if (!empty($row['comment']))
            {
                $template->assign('SERGIX_META', $row['comment']);
            }
                }
    }

function sergiximg()
    {
    global $template, $page, $meta_infosdesc, $conf;
    $meta_infosdesc = array();
    $meta_infosdesc['info'] = $template->get_template_vars('INFO_FILE');
    $meta_infosdesc['page'] = $template->get_template_vars('PAGE_TITLE');
    $meta_infosdesc['comment'] = $template->get_template_vars('COMMENT_IMG');
    $meta_infos['title'] = $template->get_template_vars('GALLERY_TITLE');
   
             if ( !empty($page['image_id']) )   
                {
    $query = '
    select id,name,storage_category_id
      FROM ' . IMAGES_TABLE . '
      WHERE id = \''.$page['image_id'].'\'
      ;';
    $result = pwg_query($query);
    $row = mysql_fetch_array($result);
   
        if (!empty($row['name']))
            {
                $template->assign('SERGIX_TITLE', $row['name']. ' - ' .$meta_infos['title']);
            }           
        else
            {
                $template->assign('SERGIX_TITLE', $meta_infosdesc['info']. ' - ' .$meta_infos['title']);
            }           
           
        $descindex = & $conf['metasergixacc'];   
                $template->assign('SERGIX_META', $descindex.' - ' .$row['name']);
                }
    }

function set_sergix_back()
    {
        global $template, $meta_infosdesc;
 
        $template->assign
            (array
                (
        'INFO_FILE'    => $meta_infosdesc['info'],
        'COMMENT_IMG'    => $meta_infosdesc['comment']
                )
            );
    }
   
?>


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#15 2010-11-08 11:10:03

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7201

Re: changes in the index head

for personal title
with local file editor

$conf['titlesergix']='your personal title';


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact