NGPriest's Blog

NGPriest's Blog

Facebook

As i checked the logs, 20% of all NGPriest.com visitors are referred by facebook.com
Referring Sites = (35.96%)
Search Engines = (33.18%)
Direct Traffic = (30.86%)

And under Referring Sites
facebook.com 57.51%
forums.asiasoft.net 12.9%

I noticed a small problem after enabling another cache
Which was, our cool dynamic image became static?
The one that says: Our Mobile Site
Which links 100% of the time back to http://www.NGPriest.com

So, to make it work, i attempted to bypass it using
[sourcecode language=”php”]<!– mfunc wpmp_barcode_widget() –>
<?php wpmp_barcode_widget(); ?>
<!– /mfunc–>[/sourcecode]

As well as including a function
[sourcecode language=”php”]<!– mclude /wp-content/plugins/wordpress-mobile-pack/plugins/wpmp_barcode/wpmp_barcode.php –>
<?php require_once(ABSPATH . ‘/wp-content/plugins/wordpress-mobile-pack/plugins/wpmp_barcode/wpmp_barcode.php’); ?>
<!– /mclude –>

<!– mfunc wpmp_barcode_widget() –>
<?php wpmp_barcode_widget(); ?>
<!– /mfunc–>[/sourcecode]

Which mainly took the site down and made it look ugly

Anyways, after taking all the codes out, i decided to approach it from a different angle?
If i couldn’t make the code work, how could i make facebook work?
As a Facebook Developer, i started going through the developer notes again
And i found this!
[sourcecode language=”html”]<link rel=’image_src’ href=” />[/sourcecode]
Which doesn’t look much to most people

But when i added my first PHP function
[sourcecode language=”php”]<?php
function curPageURL() {
$pageURL = ‘http’;
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>[/sourcecode]

And combined it using this
[sourcecode language=”php”]<?php
$CurrentURL = curPageURL();
echo " <link rel=’image_src’ href=’http://chart.apis.google.com/chart?chs=190×190&cht=qr&choe=UTF-8&chl=" . $CurrentURL . "’ />";
?>[/sourcecode]
It works! 😀

So, that’s how i spent 2 hours reading manuals and screwing NGPriest.com

The end 😀

Leave a Reply