Ajax software
Free javascripts
↑
Main Page
curl_close($ch);
$_ = preg_match(‘#<h3 id=”title”><a href=”(.*?)“>#is’, $http_result, $cap
tures);
return ($captures[1] == $the_permalink);
}
function digg_this()
{
global $id;
$digg_link = get_post_meta($id, ‘DIGG_CLASS_digg_link’, true);
if (is_single() && !$digg_link && preg_match(‘#^http://(www\.)?digg\.com/
.+#i’, $_SERVER[‘HTTP_REFERER’]) && !preg_match(‘#^http://(www\.)?digg\.com/(
view|users)#i’, $_SERVER[‘HTTP_REFERER’]) && _scrape_check_digg($_SERVER[‘HTT
P_REFERER’], get_permalink())) {
add_post_meta($id, ‘DIGG_CLASS_digg_link’, $_SERVER[‘HTTP_REFERER’]);
$digg_link = $_SERVER[‘HTTP_REFERER’];
}
if ($digg_link) {
?><iframe src=’http://digg.com/api/diggthis.php?u=<?php echo
urlencode($digg_link)?>’ height=’82’ width=’55’ frameborder=’0’ scrolling=’no
’></iframe><?php
}
}
?>
2.
Load the admin page (
http://seophp.example.com/blog/wp-admin/
), go to the Plugins
section, and activate the Digg plugin.
3.
Call the
digg_this()
function from your templates, in the place where you want your Digg
button to show up. For example, you can place this code in the
index.php
file of your template,
at the place you want the Digg button to show up:
<?php digg_this(); ?>
Pagerfix Plugin
In Chapter 2 you learned about the problems that pages deeply buried within your web site may present —
and one cause of this problem is pagination. You can implement a plugin that fixes the default pagina-
tion links, that is, “< prev” and “next >” to link to the individual pages as well. Figure 16-16 shows this
in action at
http://www.seoegghead.com
.
Note that the Digg button will only start to appear if a user visits a permalink post
page from a Digg page that refers to it in HTTP_REFERER.
305
Chapter 16: : Creating an SE-Friendly Blog
c16.qxd:c16 11:04 305
Ajax software
Free javascripts
→