Home N-13 News Forums Help Search
RegisterForgot password?
How to add image to post necklacesdiscou
Known bugs - 4.0.3 necklacesdiscou

Latest N-13 News 4.0.3

What is N-13 News?
Where can I get help?
Known bugs

Forums Help & Support Meta tags
1 2 3 4
Chris
Posted on 14 Jun 2010, 00:15:52

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Looking at the source of this page

http://www.pawpal.ca/pawpaltimes.php?id=2

The only thing I can think of is that there is a line break sort of between the meta description tag like so

Code:
<meta name="description" content="Pawpal - As the sales volume of processed food increases, the health of domesticated dogs is adversely degenerating. Processed food though convenient for the owners is actually leading dogs to the veterinarians more often.
" />


Edit that article and remove the line break from the bottom of the short story section and add it to the beginning of the story section instead to see if that makes it work.
#2473
Makaya
Posted on 14 Jun 2010, 00:27:21

Access: Member
Total Posts: 16
Joined: 2010-06-13

I did the same and you're right, the meta tags are displayed properly.

I have no clue what's going on. I have no page breaks. I just had a <div> at the beginning of the short story that I removed. But didn't change at all.

Even worse, now, for some reason, the title of the page won't appear at all!

Pawpal - Because they matter !
http://www.pawpal.ca/pawpaltimes.php?id=1


Even the "Pawpal - " before the short story won't appear. Maybe it's a facebook problem, I have no clue.

Edit:

I just put the <div> tag back, and now, here is what happen:

Pawpal - Because they matter !
http://www.pawpal.ca/pawpaltimes.php?id=1
It’s a myth that dogs are colour blind. Dogs can actually see in colours even though not see as vivid as humans; their eyesight are akin to our vision at dusk and they can see better when the light is low.

The title is wrong, and the short story is not there, but another part of the page instead...
#2474
Last edited by Makaya at 2010-06-14 00:36:49 Reason:
Chris
Posted on 14 Jun 2010, 00:35:10

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

Maybe it alternates between getting the title from the meta tag and this

Code:
<title>Pawpal - Because they matter !</title>


In that case you would need to add the <title> tags in the code as well like so

Code:
<head>
.....
<?php
if(!$_GET['id']){
    
// not viewing a single article, show normal title/description
    
echo '<title>Pawpal - Because they matter !</title>';
    echo 
'<meta name="title" content="Pawpal - Because they matter !" />';
    echo 
'<meta name="description" content="Pawpal.ca - the only professional house-call dog grooming service provider in Downtown Vancouver, operating 7 days a week. To book your home-grooming appointment, e-mail us at contact@pawpal.ca." />';
}else{
    
// viewing a single article, show the title/description for it
    
require_once('news/db.php');
    require_once(
'news/config.php');
    
$data = DataAccess::fetch(sprintf("SELECT title,shortstory FROM %s WHERE id = ?", NEWS_ARTICLES), $_GET['id']);
    
$title = $data['0']['title'];
    
$short = $data['0']['shortstory'];
    echo 
sprintf('<title>Pawpal - %s</title>', strip_tags($short), PHP_EOL);
    echo 
sprintf('<meta name="title" content="Pawpal - %s" />%s', $title, PHP_EOL);
    echo 
sprintf('<meta name="description" content="Pawpal - %s" />%s', strip_tags($short), PHP_EOL);
}
?>
#2475
Makaya
Posted on 14 Jun 2010, 00:44:53

Access: Member
Total Posts: 16
Joined: 2010-06-13

I'm still facing the same problem. As I told you, I have two articles and tried them both. Here is the result with facebook:

Article 1: http://www.pawpal.ca/pawpaltimes.php?id=1

Pawpal - Because they matter !
http://www.pawpal.ca/pawpaltimes.php?id=1
It’s a myth that dogs are colour blind. Dogs can actually see in colours even though not see as vivid as humans; their eyesight are akin to our vision at dusk and they can see better when the light is low.

The source code of this page says:

<title>Pawpal - Because they matter !</title>
<link rel="shortcut icon" type="image/x-icon" href="../images/favicon.ico">
<link rel="image_src" href="../images/Pawpal-logo-facebook.jpg" />

<title>Pawpal - Does your dog walk you or do you walk your dog? Who walks in front? Do you respond to your dog when its whines or barks at you? When you play fetch with your dog, do you stop the game or does your dog calls it a stop after it has enough? Are you always rushing to feed your dog before you have eaten yourself?When you come home from work, does your dog greet you or do you greet your dog? If your answer is yes to any of the questions, your dog is actually your pack leader. Welcome to the club of the pack followers!</title><meta name="title" content="Pawpal - Are you the pack follower of your dog?" />
<meta name="description" content="Pawpal - Does your dog walk you or do you walk your dog? Who walks in front? Do you respond to your dog when its whines or barks at you? When you play fetch with your dog, do you stop the game or does your dog calls it a stop after it has enough? Are you always rushing to feed your dog before you have eaten yourself?When you come home from work, does your dog greet you or do you greet your dog? If your answer is yes to any of the questions, your dog is actually your pack leader. Welcome to the club of the pack followers!" />


Article 2: http://www.pawpal.ca/pawpaltimes.php?id=2

Pawpal - More dogs dying before life-expectancy. Is your dog at risk too?
http://www.pawpal.ca/pawpaltimes.php?id=2
Pawpal -

Source code:
<title>Pawpal - Because they matter !</title>
<link rel="shortcut icon" type="image/x-icon" href="../images/favicon.ico">
<link rel="image_src" href="../images/Pawpal-logo-facebook.jpg" />

<title>Pawpal - Does your dog walk you or do you walk your dog? Who walks in front? Do you respond to your dog when its whines or barks at you? When you play fetch with your dog, do you stop the game or does your dog calls it a stop after it has enough? Are you always rushing to feed your dog before you have eaten yourself?When you come home from work, does your dog greet you or do you greet your dog? If your answer is yes to any of the questions, your dog is actually your pack leader. Welcome to the club of the pack followers!</title><meta name="title" content="Pawpal - Are you the pack follower of your dog?" />
<meta name="description" content="Pawpal - Does your dog walk you or do you walk your dog? Who walks in front? Do you respond to your dog when its whines or barks at you? When you play fetch with your dog, do you stop the game or does your dog calls it a stop after it has enough? Are you always rushing to feed your dog before you have eaten yourself?When you come home from work, does your dog greet you or do you greet your dog? If your answer is yes to any of the questions, your dog is actually your pack leader. Welcome to the club of the pack followers!" />

It seems that I have 2 <title> tags now. Is that normal?
Edit: I forgot to remove the first <title> tag, that's why I had two. I removed it, but still get the same result as above.
#2476
Last edited by Makaya at 2010-06-14 00:50:14 Reason:
Chris
Posted on 14 Jun 2010, 00:48:20

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

You need to remove the first <title> tag so that you only have the one that gets generated by the php code.

I'm not sure why it's not picking up the description, there's nothing wrong with the code.
#2477
Chris
Posted on 14 Jun 2010, 00:54:12

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

I 'think' I figured out why facebook isn't showing the title properly, I was playing around with inserting one of your links in facebook and having it get the title/description whilst you were updating it, I noticed you'd updated it after I had already tested one of the links, but when I tested that link again it was still using the old title of the page. So I'm thinking facebook may cache the page title/description temporarily. I logged in within a different browser and pasted the link and this time it got the title of the page correctly but not the entire description, the description was just "Pawpal - ", it cut off the second half of it. So what I would suggest then is to remove the "Pawpal - " from the description and just have it show the short story.

Code:
<head>
.....
<?php
if(!$_GET['id']){
    
// not viewing a single article, show normal title/description
    
echo '<title>Pawpal - Because they matter !</title>';
    echo 
'<meta name="title" content="Pawpal - Because they matter !" />';
    echo 
'<meta name="description" content="The only professional house-call dog grooming service provider in Downtown Vancouver, operating 7 days a week. To book your home-grooming appointment, e-mail us at contact@pawpal.ca." />';
}else{
    
// viewing a single article, show the title/description for it
    
require_once('news/db.php');
    require_once(
'news/config.php');
    
$data = DataAcc! ess::fetch(sprintf("SELECT title,shortstory FROM %s WHERE id = ?", NEWS_ARTICLES), $_GET['id']);
    
$title = $data['0']['title'];
    
$short = $data['0']['shortstory'];
    echo 
sprintf('<title>Pawpal - %s</title>', strip_tags($short), PHP_EOL);
    echo 
sprintf('<meta name="title" content="Pawpal - %s"!  /& gt;%s', $title, PHP_EOL);
    echo 
sprintf('<meta name="description" content="%s" />%s', strip_tags($short), PHP_EOL);
}
?>
#2478
Makaya
Posted on 14 Jun 2010, 00:56:34

Access: Member
Total Posts: 16
Joined: 2010-06-13

I removed the first title tag, but nothing changed.

I noticed something interesting:

There these line on the code you gave me:

$title = $data['0']['title'];
echo sprintf('<title>Pawpal - %s</title>', strip_tags($short), PHP_EOL);

But if you look at the page of the first article:
http://www.pawpal.ca/pawpaltimes.php?id=1

You'll notice the title of the page:
"Pawpal - Does your dog wa..."

The "Does your dog wa..." is actually the beginning of the article, not the title.

How is that possible?
#2479
Chris
Posted on 14 Jun 2010, 00:58:05

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

My mistake, try this

Code:
<?php
if(!$_GET['id']){
    
// not viewing a single article, show normal title/description
    
echo '<title>Pawpal - Because they matter !</title>';
    echo 
'<meta name="title" content="Pawpal - Because they matter !" />';
    echo 
'<meta name="description" content="Pawpal.ca - the only professional house-call dog grooming service provider in Downtown Vancouver, operating 7 days a week. To book your home-grooming appointment, e-mail us at contact@pawpal.ca." />';
}else{
    
// viewing a single article, show the title/description for it
    
require_once('news/db.php');
    require_once(
'news/config.php');
    
$data = DataAccess::fetch(sprintf("SELECT title,shortstory FROM %s WHERE id = ?", NEWS_ARTICLES), $_GET['id']);
    
$title = $data['0']['title'];
    
$short = $data['0']['shortstory'];
    echo 
sprintf('<title>Pawpal - %s</title>', strip_tags($title), PHP_EOL);
    echo 
sprintf('<meta name="title" content="Pawpal - %s" />%s', $title, PHP_EOL);
    echo 
sprintf('<meta name="description" content="Pawpal - %s" />%s', strip_tags($short), PHP_EOL);
}
?> 
#2480
Last edited by Chris at 2010-06-14 00:59:34 Reason:
Makaya
Posted on 14 Jun 2010, 01:06:41

Access: Member
Total Posts: 16
Joined: 2010-06-13

I've updated the code and the title is now shown properly.

However, on facebook, this is still the same wrong display. I've tried with another account and have the same problem.

What I don't understand is that earlier, with one version of your code (can't remember which one...), the title of the article was displaying correctly but not the short story. Now, it's kind of back to square one.

The weird thing is that the source code of the page is correct:

<title>Pawpal - Are you the pack follower of your dog?</title><meta name="title" content="Pawpal - Are you the pack follower of your dog?"! /& gt;
><meta name="description" content="Does your dog walk you or do you walk your dog? Who walks in front? Do you respond to your dog when its whines or barks at you? When you play fetch with your dog, do you stop the game or does your dog calls it a stop after it has enough? Are you always rushing to feed your dog before you have eaten yourself?When you come home from work, does your dog greet you or do you greet your dog? If your answer is yes to any of the questions, your dog is actually your pack leader. Welcome to the club of the pack followers!" />
#2481
Chris
Posted on 14 Jun 2010, 01:09:29

Access: Admin
Total Posts: 1395
Joined: 2006-05-19

There was a tiny error in my previous code in my last message that I updated, you grabbed it before I updated it. Grab it again and it should work fine.

Here's a screenshot of what happens when I paste one of your links


[img]https://i.imgur.com/xxZI7.png[/img]
#2483
1 2 3 4
Network-13.com © 2013