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 13 Jun 2010, 20:27:26

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

And one last thing that I would recommend changing is adding the following to your style sheet

Code:
#recaptcha_area table {
    width: 0px;
}


This will make the ReCAPTCHA box the same width as the comment textbox.
#2462
Makaya
Posted on 13 Jun 2010, 20:33:46

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

Thanks a lot Chris. Any idea on how to remove the "Powered by N-13 News" that appears at the top of my article page now?
#2463
Chris
Posted on 13 Jun 2010, 20:34:13

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

See here

http://network-13.com/thread/2451-1-Meta-tags#2460
#2464
Makaya
Posted on 13 Jun 2010, 20:38:42

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

Chris, you're really awesome and soooo helpful.

I'll still try to find a way to publicize your work on my site and whenever I get a chance to talk about it.

Thank you so much for your hard work, you ROCK !
#2465
Makaya
Posted on 13 Jun 2010, 21:48:28

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

Chris,

Sorry to get back to you. It seems that it is not working properly.

I currently have 2 articles and I tried to link both of them into my facebook page.

For the first article: http://www.pawpal.ca/pawpaltimes.php?id=1

What's displayed is:
Pawpal - Because they matter ! (Because they matter is supposed to be changed by the title of the article)
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. (This is not the content of the article but refers to the section "did you know" of my page)

For the second article: http://www.pawpal.ca/pawpaltimes.php?id=2

What's displayed is:
Pawpal - More dogs dying before life-expectancy. Is your dog at risk too? (in that case, the title is displayed properly)
http://www.pawpal.ca/pawpaltimes.php?id=2
Pawpal - (the content of the article here is not displayed at all)

Sorry to bother you again with that. I checked the code and it is the way you told me.

Any idea how to fix this?

Thanks
#2466
Chris
Posted on 13 Jun 2010, 23:02:11

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

You know what, scrap the method of doing it by using another include+template. Instead use this which is much more to the point and easier to use.

In the head section of your page, remove the previous code and add this

Code:
<head>
.....
<?php
if(!$_GET['id']){
    
// not viewing a single article, show normal title/description
    
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('<meta name="title" content="Pawpal - %s" />%s', $title, PHP_EOL);
    echo 
sprintf('<meta name="description" content="Pawpal - %s" />%s', $short, PHP_EOL);
}
?>
#2467
Last edited by Chris at 2010-06-13 23:04:38 Reason:
Chris
Posted on 13 Jun 2010, 23:51:31

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

Updated slightly to remove html tags

Code:
<head>
.....
<?php
if(!$_GET['id']){
    
// not viewing a single article, show normal title/description
    
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('<meta name="title" content="Pawpal - %s" />%s', $title, PHP_EOL);
    echo 
sprintf('<meta name="description" content="Pawpal - %s" />%s', strip_tags($short), PHP_EOL);
}
?>
#2469
Makaya
Posted on 14 Jun 2010, 00:02:03

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

Hi Chris,

Your new method looked very promising. My knowledge in php is pretty limited, but I can still understand what you did.

The good news:
- the title in the facebook link now displays correctly

The bad news:
- the short story still does not appear (which doesn't make any sense to me. when I look at your code, I don't see why it wouldn't work)
- the short story is displayed at the top of my webpage: http://www.pawpal.ca/pawpaltimes.php?id=1

That's very strange. I have no idea how to fix this. Thanks again for all your help!

Makaya
#2470
Chris
Posted on 14 Jun 2010, 00:04:28

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

See my previous post just above yours, I made a slight change to the code to strip out any html tags, use that code to see if the description/short story shows properly.
#2471
Makaya
Posted on 14 Jun 2010, 00:09:07

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

I just uploaded the page with the new code. The short story does not appear on top of my page anymore, but still won't appear on the share link. Really strange...

This is what I get on facebook:

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

Btw: I just sent you a small token to thank you for your help!
#2472
Last edited by Makaya at 2010-06-14 00:16:00 Reason:
1 2 3 4
Network-13.com © 2013