05-Mar-2013, 06:55 PM
This is the community forum. For a developer response use the Client Area.
14-Mar-2013, 07:34 AM
I'm solvnig it like this:
- some php code after session_start();
- new php variable is created
- variable has got value of $_GET['cmtx_page']
- and it is printed at the end of a description and a title.
I can't see any other solution. Commentics code is included later. Could it become a plugin?
(By the way - I'm preparing plugins for a 'Separate stars feed' and 'Next/Prew in head', http://www.commentics.org/forum/showthread.php?tid=453 . I've found that plugins are welcome after a Commentics page is redisigned.)
lp
stariocek
<?php
session_start();
ob_start();
$tr_stra=1 ;
if ((isset($_GET['cmtx_page'])) && (ctype_digit($_GET['cmtx_page'])) && ($_GET['cmtx_page'] != ""))
{
$tr_stra = htmlspecialchars($tr_stra, ENT_QUOTES, 'UTF-8');
$tr_stra = (int) $_GET['cmtx_page'];
}
else
{
}
?>
...
Title an description:
<head>
<title>Motorni in električni skiroji Go-Ped. Ocene in komentarji, stran <?php echo $tr_stra ; ?>.</title>
<meta name="description" content="Električni skiroji! Motorni skiroji! Ocene in komentarji, stran <?php echo $tr_stra ; ?>." />
</head>
- some php code after session_start();
- new php variable is created
- variable has got value of $_GET['cmtx_page']
- and it is printed at the end of a description and a title.
I can't see any other solution. Commentics code is included later. Could it become a plugin?
(By the way - I'm preparing plugins for a 'Separate stars feed' and 'Next/Prew in head', http://www.commentics.org/forum/showthread.php?tid=453 . I've found that plugins are welcome after a Commentics page is redisigned.)
lp
stariocek
<?php
session_start();
ob_start();
$tr_stra=1 ;
if ((isset($_GET['cmtx_page'])) && (ctype_digit($_GET['cmtx_page'])) && ($_GET['cmtx_page'] != ""))
{
$tr_stra = htmlspecialchars($tr_stra, ENT_QUOTES, 'UTF-8');
$tr_stra = (int) $_GET['cmtx_page'];
}
else
{
}
?>
...
Title an description:
<head>
<title>Motorni in električni skiroji Go-Ped. Ocene in komentarji, stran <?php echo $tr_stra ; ?>.</title>
<meta name="description" content="Električni skiroji! Motorni skiroji! Ocene in komentarji, stran <?php echo $tr_stra ; ?>." />
</head>
14-Mar-2013, 08:13 AM
About solution with 'Canonical' ... my plugin for 'Next/Prew in head', 'Next/Prew in head, http://www.commentics.org/forum/showthread.php?tid=453 ', is also handling a 'Canonical' issue.
I'm testing it on htt://www.moto-skiro.si :
<head>
...
<link rel="canonical" href="http://www.moto-skiro.si/komentarji-ocene-go-ped.php?cmtx_page=1" />
<link rel="next" href="/komentarji-ocene-go-ped.php?cmtx_page=2" />
...
</head>
The "cmtx_sort" can be handled by it, too.
lp
stariocek
I'm testing it on htt://www.moto-skiro.si :
<head>
...
<link rel="canonical" href="http://www.moto-skiro.si/komentarji-ocene-go-ped.php?cmtx_page=1" />
<link rel="next" href="/komentarji-ocene-go-ped.php?cmtx_page=2" />
...
</head>
The "cmtx_sort" can be handled by it, too.
lp
stariocek
14-Mar-2013, 09:34 AM
On every "cmtx_page=XX":
- <link rel="canonical" href="http://www.xxxxxx.xx/comment.php cmtx_page=XX" />
Should be enought! Why? When page is called with a 'cmtx_sort' or any other further parameter missing, a canonical version is returned! All parameters are set by default and this can be treated as a canonical version. Solution is 'future proof' and simple, ... ?
lp
stariocek
- <link rel="canonical" href="http://www.xxxxxx.xx/comment.php cmtx_page=XX" />
Should be enought! Why? When page is called with a 'cmtx_sort' or any other further parameter missing, a canonical version is returned! All parameters are set by default and this can be treated as a canonical version. Solution is 'future proof' and simple, ... ?
lp
stariocek
(14-Mar-2013, 08:13 AM)stariocek Wrote: About solution with 'Canonical' ... my plugin for 'Next/Prew in head', 'Next/Prew in head, http://www.commentics.org/forum/showthread.php?tid=453 ', is also handling a 'Canonical' issue.
I'm testing it on htt://www.moto-skiro.si :
<head>
...
<link rel="canonical" href="http://www.moto-skiro.si/komentarji-ocene-go-ped.php?cmtx_page=1" />
<link rel="next" href="/komentarji-ocene-go-ped.php?cmtx_page=2" />
...
</head>
The "cmtx_sort" can be handled by it, too.
lp
stariocek
14-Mar-2013, 03:44 PM
I'm not sure about <meta name="robots" content="noindex"/> and cmtx_sort :
- it could help with smaller server load
- but crawlers should be clever enough, hope so, to eliminate non-canonical URLs without scanning
- 'noindex' solution is, technically equivalent, but logically exactly opposite to solution with only parameter 'cmtx_page' + 'canonical'
- 'cmtx_page' + 'canonical' is easier to implement and maintain then 'noindex' solution.
I vote for 'cmtx_page' + 'canonical', if crawlers are smart enough. Some kind of test could answer this question ...
lp, stariocek
- it could help with smaller server load
- but crawlers should be clever enough, hope so, to eliminate non-canonical URLs without scanning
- 'noindex' solution is, technically equivalent, but logically exactly opposite to solution with only parameter 'cmtx_page' + 'canonical'
- 'cmtx_page' + 'canonical' is easier to implement and maintain then 'noindex' solution.
I vote for 'cmtx_page' + 'canonical', if crawlers are smart enough. Some kind of test could answer this question ...
lp, stariocek
15-Mar-2013, 07:10 PM
Hi stariocek,
Yes, I forgot to include the "ctype_digit($_GET['cmtx_page']", that's important.
I think this would be a very good add-on (plugin). If it works well, I could recommend it in the integration guide.
Yes, cmtx_page + canonical seems better than noindex.
So, what would happen in the following cases?
Yes, I forgot to include the "ctype_digit($_GET['cmtx_page']", that's important.
I think this would be a very good add-on (plugin). If it works well, I could recommend it in the integration guide.
Yes, cmtx_page + canonical seems better than noindex.
So, what would happen in the following cases?
- commentics.org/project.php
- commentics.org/project.php?cmtx_page=xx
- commentics.org/project.php?cmtx_perm=xx#cmtx_perm_xx
- commentics.org/project.php?cmtx_sort=xx
- commentics.org/project.php?cmtx_page=xx&cmtx_sort=xx
15-Mar-2013, 10:14 PM
(15-Mar-2013, 07:10 PM)Steven Wrote: Hi stariocek,
Yes, I forgot to include the "ctype_digit($_GET['cmtx_page']", that's important.
I think this would be a very good add-on (plugin). If it works well, I could recommend it in the integration guide.
Yes, cmtx_page + canonical seems better than noindex.
So, what would happen in the following cases?
- commentics.org/project.php
- commentics.org/project.php?cmtx_page=xx
- commentics.org/project.php?cmtx_perm=xx#cmtx_perm_xx
- commentics.org/project.php?cmtx_sort=xx
- commentics.org/project.php?cmtx_page=xx&cmtx_sort=xx
[*]commentics.org/project.php
====================================
<link rel="canonical" href="http://www.moto-skiro.si/komentarji-ocene-go-ped.php?cmtx_page=1" />
<link rel="next" href="/komentarji-ocene-go-ped.php?cmtx_page=2" />
[*]commentics.org/project.php?cmtx_page=xx
====================================
<link rel="canonical" href="http://www.moto-skiro.si/komentarji-ocene-go-ped.php?cmtx_page=2" />
<link rel="prev" href="/komentarji-ocene-go-ped.php?cmtx_page=1" />
[*]commentics.org/project.php?cmtx_perm=xx#cmtx_perm_xx
===============================================
<link rel="canonical" href="http://www.moto-skiro.si/komentarji-ocene-go-ped.php?cmtx_page=2" />
<link rel="prev" href="/komentarji-ocene-go-ped.php?cmtx_page=1" />
[*]commentics.org/project.php?cmtx_sort=xx
==========================================
<link rel="canonical" href="http://www.moto-skiro.si/komentarji-ocene-go-ped.php?cmtx_page=1" />
<link rel="next" href="/komentarji-ocene-go-ped.php?cmtx_page=2" />
[*]commentics.org/project.php?cmtx_page=xx&cmtx_sort=xx
=================================================
<link rel="canonical" href="http://www.moto-skiro.si/komentarji-ocene-go-ped.php?cmtx_page=2" />
<link rel="prev" href="/komentarji-ocene-go-ped.php?cmtx_page=1" />
That is it, it works like this now. It looks good to me. I think it should work.
lp, stariocek
15-Mar-2013, 11:02 PM
Here it is, my script next/prew + canonical. It is quick written and unpolished, but it works.
It has got one SERIOUS problem. It is using a die("Sorry, ..."); ... And it can block a http protocol in case of PHP failure ... It was a quick testing script, never polished.
I'm working on new version without die(); - 'just move on if something is wrong' style.
I don't have large enough sample page to test it well. A better coded plug-in is to be finished soon.
lp, stariocek
It has got one SERIOUS problem. It is using a die("Sorry, ..."); ... And it can block a http protocol in case of PHP failure ... It was a quick testing script, never polished.
I'm working on new version without die(); - 'just move on if something is wrong' style.
I don't have large enough sample page to test it well. A better coded plug-in is to be finished soon.
lp, stariocek
17-Mar-2013, 03:25 PM
Hi,
Thanks, I received your add-on. Regarding the name and description, I was thinking that these would be suitable:
Name: SEO Optimizer
Version: 0.7
Author: stariocek
Description: Adds canonical and prev/next links inside the <head> tag of the page.
Date: 16-Mar-2013
Status: Experimental
Compatible: v2.1, v2.2, v2.3
Are you happy with that?
Thanks, I received your add-on. Regarding the name and description, I was thinking that these would be suitable:
Name: SEO Optimizer
Version: 0.7
Author: stariocek
Description: Adds canonical and prev/next links inside the <head> tag of the page.
Date: 16-Mar-2013
Status: Experimental
Compatible: v2.1, v2.2, v2.3
Are you happy with that?
17-Mar-2013, 06:54 PM
(17-Mar-2013, 03:25 PM)Steven Wrote: Hi,
Thanks, I received your add-on. Regarding the name and description, I was thinking that these would be suitable:
Name: SEO Optimizer
Version: 0.7
Author: stariocek
Description: Adds canonical and prev/next links inside the <head> tag of the page.
Date: 16-Mar-2013
Status: Experimental
Compatible: v2.1, v2.2, v2.3
Are you happy with that?
Of course!
lp, stariocek
« Next Oldest | Next Newest »
Possibly Related Threads…
Thread / Author
Replies
Views
Last Post
Users browsing this thread: 4 Guest(s)