NGPriest: Facebook
Ξ December 9th, 2009 | → 0 Comments | ∇ Author: NGPriest |
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
<!-- mfunc wpmp_barcode_widget() --> <?php wpmp_barcode_widget(); ?> <!-- /mfunc-->
As well as including a function
<!-- 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-->
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!
<link rel='image_src' href='' />
Which doesn’t look much to most people
But when i added my first PHP function
<?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; } ?>
And combined it using this
<?php $CurrentURL = curPageURL(); echo " <link rel='image_src' href='http://chart.apis.google.com/chart?chs=190x190&cht=qr&choe=UTF-8&chl=" . $CurrentURL . "' />"; ?>
It works! 😀
So, that’s how i spent 2 hours reading manuals and screwing NGPriest.com
The end 😀