But wanted to implement the Google Plus author links to show your author profile on Google if your using G+.
http://www.google.com/support/webmaster ... er=1408986
Please note, any privacy concerns etc are completely up to the person on G+ to manage. This simply links to their designated profile.
This is sample idea for those who can actually write components etc. Anyone can use this code if they feel like it but if your going to use it, at least credit me in your work please.
If you want an example of it, then you can check it out at:
http://www.weirynet.com
This is not a module or a component, because i couldn't be bothered. It is a patch to com_content tmpl files. Therefore i am not using Joomla's in build database query functions etc. If you want that, then someone can rewrite it to work off that.
If you use this, then you it won't let you use Joomla's default contact details page. However you could still link it if you really wanted to by adding the location of the contact page into the contact's webpage field.
Step 1.
Put the vNetWebAuthor class file in the components/com_content/helpers/ directory. (attached to this post)
Step 2.
For each view of articles, find the <dd class="createdby"> and look inside there for JText::sprintf('COM_CONTENT_WRITTEN_BY' ...
Replace the "COM_CONTENT_WRITTEN_BY" sprintf function with this:
Code: Select all
require_once JPATH_COMPONENT.'/helpers/vNetWebAuthor.php';
$vnet = new vNetWebAuthor();
$cntlink = $vnet->getWebLink($this->item->contactid);
echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', JRoute::_($cntlink), $author)); ?>
Add your user contact details to Joomla's Contact section and link it to your user.
For the web page field, make this your G+ profile URL.
vNetWebAuthor Class
Code: Select all
<?php
/*
* @file vNetWebAuthor.php
* @description Author link to contact webpage
* @author James Weir
* @website www.weirynet.com
*/
class vNetWebAuthor extends JConfig{
private $link;
public function __construct(){
$this->link = mysql_connect($this->host, $this->user, $this->password) or die("MySQL Error: ".mysql_error());
mysql_select_db($this->db, $this->link);
}
public function getWebLink($userID){
$q = sprintf("SELECT `webpage` FROM `".$this->dbprefix."contact_details` WHERE `id` = '%s'",
mysql_real_escape_string($userID));
$r = mysql_query($q,$this->link);
if(mysql_num_rows($r) == 1){
$arr = mysql_fetch_assoc($r);
return $arr['webpage'].'?rel=author';
}
return false;
}
}
?>
Thoughts or comments?
Try to leave some constructive feedback if you see fit, keeping in mind my obvious explanations posted above.
I may not check this afterwards, however i thought it would be useful for people to see.