Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest sNews - sNews 1.7 - with its own forums - for discussion and user mods.

Pages: 1 [2] 3

Author Topic: home,archive,sitemap,contact risk a duplicate content !!  (Read 15369 times)

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: home,archive,sitemap,contact risk a duplicate content !!
« Reply #15 on: May 06, 2008, 08:19:24 AM »

Thanks again Mr Fun. 8)

Dom

  • Full Member
  • ***
  • Karma: 5
  • Posts: 163
    • domdelimar.com
Re: home,archive,sitemap,contact risk a duplicate content !!
« Reply #16 on: May 26, 2008, 07:22:26 AM »

Hey Mr. Fun! Thanks for the code. I was just about to post my solution for this but you long beat me to it (and with a better one than I had...).

And I didn't think of giving category main pages custom tags - great thinking!

That's now a complete mod!  ;D
Karma to you, my mate!

BTW, do the title tags on article pages become titles of categories for you? Changing all those if statements back to elseif's corrected things for me. But I don't have any other mods on this function so YMMV.
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: home,archive,sitemap,contact risk a duplicate content !!
« Reply #17 on: June 27, 2008, 08:56:11 AM »

Hello pals,
back to this Mod. Google isn't pleased with:
Quote
[    if (!empty($categoryName)) {  //<-- new addition, like NaEnr mod...
      $title = $categoryName;
      $dmeta='All articles under '.$title.' category';
      $kmeta=$title;     
   }
It seems Google would prefer to have the meta description I have in the DB for each category.
What should I put there to display its content:
Quote
$dmeta=...
???

Trying, $dmeta = $r['description_meta'];
returns Website description  ::)
« Last Edit: June 27, 2008, 03:14:29 PM by Sven »
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: home,archive,sitemap,contact risk a duplicate content !!
« Reply #18 on: July 19, 2008, 06:19:56 PM »

A little better Title() function:
_SITE must be replaced with db('website');
Code: [Select]
<?php
// TITLE
function title() {
echo '<base href="'._SITE.'" />';
$categorySEF get_id('category'); 
$articleSEF get_id('article');
$categoryName retrieve('name''categories''seftitle'$categorySEF);
$articleTitle retrieve('title''articles''seftitle'$articleSEF);
$search dashstrip($_GET['search']);

//DOM-MOD(
   
if ($categorySEF == "") {$title s('website_title')." : "."Home";}
   if (
$categorySEF == "blog") { 
      
$currentPage strpos($articleSEFl('paginator')) === str_replace(l('paginator'), ''$articleSEF) : '';    
      if(
$currentPage){
      
$title s('website_title')." : "."Blog, Page number $currentPage";
      
$dmeta='The Blog page number '.$currentPage.' of '._SITE;
      }
      else{
      
$title s('website_title')." : "."Blog";
      
$dmeta='The Blog page of '._SITE;      
      }
      
$kmeta='blog, journal, jurnal';
   }
   if (
$categorySEF == "contact") {
      
$title s('website_title')." : "."Contact";
      
$dmeta='The Contact page of '._SITE;
      
$kmeta='contact, information';
   }
   if (
$categorySEF == "blade") {
      
$title s('website_title')." : "."Blade design";
      
$dmeta='The Blade page of '._SITE;
      
$kmeta='blade, propeller, windmill';
   }
   if (
$categorySEF == "archive") {
      
$title s('website_title')." : "."Archive";
      
$dmeta='The Archive page of '._SITE;
      
$kmeta='archive';
   }
   if (
$categorySEF == "sitemap") {
      
$title s('website_title')." : "."Sitemap";
      
$dmeta='The Sitemap page of '._SITE;
      
$kmeta='sitemap, google, index';
   }
   if (!empty(
$categoryName) and empty($articleTitle)) {
      
$query "SELECT description FROM ".db(prefix)."categories WHERE name = '$categoryName'";
      
$result mysql_query($query);
      while (
$r mysql_fetch_array($result)) {$vmeta $r['description'];}
      
$currentPage strpos($articleSEFl('paginator')) === str_replace(l('paginator'), ''$articleSEF) : '';
      if(
$currentPage){
      
$title s('website_title')." : ".$categoryName' category, Page number '.$currentPage;
      
$dmeta$vmeta.', Page number '.$currentPage;
      }
      else{
      
$title s('website_title')." : ".$categoryName' category';
      
$dmeta=$vmeta;
      }
      
$kmeta=$categoryName;      
   }
   if (!empty(
$articleTitle)) {$title $articleTitle;}
   if (!empty(
$search)) {
      
$title s('website_title')." : ".$search;
      
$dmeta='Looking for '.$search.' tag on '._SITE;
      
$kmeta=$search;      
   }

//)
echo '<title>'.$title.'</title>';
echo '<meta http-equiv="Content-Type" content="text/html; charset='.s('charset').'" />';
if (!empty($articleSEF)) {
//$query = "SELECT * FROM ".db(prefix)."articles WHERE seftitle = '$articleSEF'";
    
$query "SELECT description_meta,keywords_meta FROM ".db(prefix)."articles WHERE seftitle = '$articleSEF'";
$result mysql_query($query);
while ($r mysql_fetch_array($result)) {$dmeta $r['description_meta']; $kmeta $r['keywords_meta'];}
}
echo '<meta name="description" content="'.(!empty($dmeta) ? $dmeta s('website_description')).'" />';
echo '<meta name="keywords" content="'.(!empty($kmeta) ? $kmeta s('website_keywords')).'" />';
  
js_global();

//whizzywig editor MOD ( - MOD DISABLED
if ($_SESSION[_SITE.'Logged_In'] == token()) {js();}
  
//if ($_SESSION[_SITE.'Logged_In'] == token()) {js();
  //  echo '<script type="text/javascript" src="whizzywig.js"></script>';
  //  echo '<script type="text/javascript" src="xhtml.js"></script>';
  //}
//)
//smilies buttons in comments form by Rui Mendes(
//js1();
//)
}


Duplicate title, dmeta, for category pages... (page 1, 2, 3, ..n)
This function solve somehow the problem...

UPDATE:
Code updated for Mr.Sven (dmeta =  category description).



« Last Edit: August 14, 2008, 02:28:32 AM by funlw65 »
Logged

Joost

  • Guest
Re: home,archive,sitemap,contact risk a duplicate content !!
« Reply #19 on: July 19, 2008, 07:15:47 PM »

Although I always welcome improvements, I think the the title of this thread is a bit overdone, not to say; hysterical. Perhaps it is the exclamation marks.
Does anyone really think that search-engines nowadays, judge content simply by looking at description, keywords and title? Can a modern,  21th century, well designed and therefore popular search-engine mistake 'home' for 'contact' or visa versa?  I don't buy that.
The opposite, for all I know, is true: Use a different title, different keywords and different description. Use content 'borrowed' from somewhere else on the internet. That's duplicate content.
This thread is about duplicate titles and metadata. ;)
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: home,archive,sitemap,contact risk a duplicate content !!
« Reply #20 on: July 19, 2008, 07:44:03 PM »

Yes Joost, is about duplicate title and meta description...
You get warnings for this in Google Webmaster Tools. With this "groso-modo" mastered tilte() function you can solve that.

There are still problems with duplicate title and metadata such as:
1)
sitename.com/category/
sitename.com/category

2)
sitename.com/category/article/
sitename.com/category/article

................
etc.

Google complains about that. 
« Last Edit: July 19, 2008, 07:59:26 PM by funlw65 »
Logged

Joost

  • Guest
Re: home,archive,sitemap,contact risk a duplicate content !!
« Reply #21 on: July 19, 2008, 08:16:23 PM »

Yes Joost, is about duplicate title and meta description...
You get warnings for this in Google Webmaster Tools. With this "groso-modo" mastered tilte() function you can solve that.

There are still problems with duplicate title and metadata such as:
1)
sitename.com/category/
sitename.com/category

2)
sitename.com/category/article/
sitename.com/category/article

................
etc.

Google complains about that.

That's something else. I see no relationship with this thread's topic.
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: home,archive,sitemap,contact risk a duplicate content !!
« Reply #22 on: July 19, 2008, 08:21:22 PM »

Don't look only at the title of this thread.  Maxou is referring at title and description because home, archive and contact pages are different in content.
Logged

Joost

  • Guest
Re: home,archive,sitemap,contact risk a duplicate content !!
« Reply #23 on: July 19, 2008, 09:03:30 PM »

Let me rephrase then. You won't solve trailing slash issues with any code found in this thread. The trailing slash issue is a genuine duplicate content issue. The issue described at the top this thread, (if any), is not.
Logged

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: home,archive,sitemap,contact risk a duplicate content !!
« Reply #24 on: July 19, 2008, 10:56:12 PM »

I saw I can't solve that.. is the general problem of pretty URL's ?
Then, on normal URL's like index.php?category= .... we don't have that problem...
Logged

Joost

  • Guest
Re: home,archive,sitemap,contact risk a duplicate content !!
« Reply #25 on: July 20, 2008, 01:49:48 AM »

It doesn't matter what type of uri is used.
$_GET['category'] is broken down into pieces (elements) through function explode, like:
category/article/
$url[0] = 'category';
$url[1] = 'article';
$url[2] = '';

So to solve this issue, sNews needs to check the existence of a trailing slash, after the existence of the page is verified.
If a trailing slash is not present, sNews should invoke a permanent redirect to an url with a trailing slash. That way, Google doesn't index two pages with the same content.
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: home,archive,sitemap,contact risk a duplicate content !!
« Reply #26 on: July 20, 2008, 04:32:35 PM »

(...)

UPDATE:
Code updated for Mr.Sven (dmeta =  category description).
who want to thank you warmly for this attention, dear Mr Fun.
Waiter please? One karma for my friend Vasile.
Thanks.

EDITION: just noticed that Mr Joost has 69 karmas at this moment. Is this Karma Sutra? ;D
« Last Edit: July 20, 2008, 04:36:18 PM by Sven »
Logged

Joost

  • Guest
Re: home,archive,sitemap,contact risk a duplicate content !!
« Reply #27 on: July 20, 2008, 04:59:01 PM »

EDITION: just noticed that Mr Joost has 69 karmas at this moment. Is this Karma Sutra? ;D
No, I am stuck at chapter one :-[
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: home,archive,sitemap,contact risk a duplicate content !!
« Reply #28 on: July 20, 2008, 05:25:11 PM »

Hidden text:
maybe you can have some lessons (theorical may I suggest) with Dr Ruth?

 ;D

Joost

  • Guest
Re: home,archive,sitemap,contact risk a duplicate content !!
« Reply #29 on: July 20, 2008, 06:11:09 PM »

Definitely no. She looks like my mother:You don't discuss sex with your parents. Parents don't have had sex ever. The don't know what it is. Period.
At least, its a comfortable thought. Let's keep it that way
  ;D

ps: we are messing up a thread (again).
« Last Edit: July 20, 2008, 06:12:49 PM by Joost »
Logged
Pages: 1 [2] 3