I often visit to some blog and give a comment and back visit come back for 1 or 2
.
One of my friend ask :
"I want to add php snippet in my wordpress, is it possible?"
Yes, I just modify my cwlis wordpress theme (index.php) file and integrate rthanks plugin inside index.php for say hi to visitor from reference site/blog like google, problogger, johnchow etc.
More fun but might be not suitable for person who like to change wordpress theme easily since they must edit index.php each time they change template
The point I wanna tell is adding manual php code also possible to other engine like joomla. Make sure You know where to put it and doing little trial error to make it really work
For example :
I add this code :
<?php get_header(); ?>
<?
if (preg_match(‘/^http:\/\/(\w+\.)?(google|johnchow|yahoo|
blogspot|doshdosh|problogger|cosaaranda|vavai)\./’,$_SERVER['HTTP_REFERER']) == 1)
{
// get host name from URL
preg_match(‘@^(?:http://)?([^/]+)@i’,$_SERVER['HTTP_REFERER'], $matches);
$host = $matches[1];
// get last two segments of host name
preg_match(‘/[^.]+\.[^.]+$/’, $host, $matches);
//echo "domain name is: {$matches[0]}\n";
echo "<p style=’border:thin dotted black; padding:3mm;’>Welcome <b>{$matches[0]}</b> user . Thanks for visiting my Blog
</p>";
?>
<?
}
?>
in index.php before this :
<div id="leftside">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
same output with wordpress plugin.
Just change "google|johnchow|yahoo|blogspot|doshdosh|problogger|cosaaranda|vavai" into some domain that often send visitor to your site/blog.
For some level by write this code directly to php code of engine will decrease load of plugin call
About
One comment
So a timeboxed meeting will provide an hour to discuss a topic, the discussion is over hen the time runs out. ,