News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

PageRank BBCode v1.3

Started by karlbenson, September 27, 2007, 06:53:21 PM

Previous topic - Next topic

karlbenson


Compatibility
For SMF 1.1.x ONLY

Introduction
Enables you to show the pagerank of urls in posts using either
[pagerank=http://www.mortons-solicitors.co.uk]Mortons-Solicitors.co.uk[/pagerank]
or
[pagerank]http://www.mortons-solicitors.co.uk[/pagerank]

Features
o Admin setting [via Admin > Features & Options]
- Enable PageRank on Profiles (for users websites)
o BBCode Button
o Caches pageranks in the database for 7 days
- For faster performance (and since PR changes very rarely)
- Automatically clears old pageranks for efficiency
o Supports Languages
- English/English-utf8
- English_British/English_British-utf8
- Turkish/Turkish-utf8 (Thanks to Kapadokyali)
I welcome translations for other languages. Please post the translated language strings in the Support Topic.

Installation
Simply install the package to install on the SMF Default Core Theme ONLY.

Manual edits will be required for ALL themes (other than SMF Default Core Theme) which have a custom Profile.template.php and/or Post.template.php.

To add the BBCode button to the Post.template.php (IF the theme has a custom Post.template.php)
Open Post.template.php
FIND
'list' => array('code' => 'list', 'before' => '[list]\n[li]', 'after' => '[/li]\n[li][/li]\n[/list]', 'description' => $txt[261]),
ADD AFTER
array(),
'pagerank' => array('code' => 'pagerank', 'before' => '[pagerank]', 'after' => '[/pagerank]','description' => $txt['pagerank_desc']),


To add the PageRank to members profiles for their website (IF the theme has a custom Profile.template.php)
Open Profile.template.php
FIND
<td><a href="', $context['member']['website']['url'], '" target="_blank">', $context['member']['website']['title'], '</a>
ADD AFTER
<br/>';
// Show pagerank of Members Websites on their profile (if enabled)
if(($modSettings['usepagerankonprofiles']) && (!empty($context['member']['website']['url'])))
echo pagerank($context['member']['website']['url']);

echo '

      
You will also need to place a copy of the pagerank.gif in the images/bbc folder of EACH of your themes (eg Themes/{themename}/images/bbc)
(Note the rest of the images are called from the images folder of the SMF Default Core Theme)

If your theme has its own versions of the language files Modifications.english.php and/or Modifications.english-utf8.php, OR if your using a language other than those supported (listed above) by the mod then you will need to copy the language strings into each custom version of those files.

FIND
?>
ADD BEFORE (and translate as necessary the language strings)
$txt['usepagerankonprofiles'] = 'Use PageRank on Profiles';
$txt['pr'] = 'PR:';
$txt['pagerank'] = 'PageRank #';
$txt['pagerank_desc'] = 'Google PageRank';
$txt['pagerank_outof'] = 'out of 10';


Useful Links
SMF Package Parser
Manual Installation Of Mods
How Do I Modify Files?

Donate
Has this modification helped you? Support the developer by Donating

Support
Please use the modification thread for support with this modification.
(Please don't ask me to do the edits for you)

Credit
The PageRank code/API is modified from original public domain code/api
http://www.devpapers.com/article/326
http://www.googlecommunity.com/scripts/google-pagerank.php
http://www.searchengineengine.com/files/pagerank-code.txt
http://www.hm2k.com/projects/pagerank

Changelog
1.0 - 17th August 2007
o Initial release.
1.1 - 9th October 2007
o Added Turkish/Turkish-utf8 language support (Thanks to Kapadokyali)
1.2 - 8th December 2007
o Added table to cache pagerank data for 7 days
o Changed to use smf fetch_web_data to try to overcome host restrictions
o Added script to drop the pagerank cache table on uninstall
o Re-wrote most of the pagerank functions
1.3 - 9th January 2008
o New readme
o Fixed a minor error

karlbenson

uploaded v1.1.  No need for anyone using 1.0 to upgrade.
The only change is that I've added Turkish language support (Thanks to Kapadokyali)

Tidea

I don't understand what this mod does.  Care to clarify?

karlbenson

It enables users to post a link and have its Google PageRank shown.
Basically it finds out the pagerank of links using the pagerank bbcode.  Pagerank can affect search engine positioning in google and is an algorithm that includes how popular/how many links back to that link there is in google.
Eg
[pagerank]http://www.simplemachines.org[/pagerank]

would come back
http://www.simplemachines.org PR:8 {imagebar representing 8/10}

For more information on google pagerank see http://en.wikipedia.org/wiki/Pagerank

karlbenson

1.2 - 8th December 2007
o Added table to cache pagerank data for 7 days
o Changed to use smf fetch_web_data to try to overcome host restrictions
o Added script to drop the pagerank cache table on uninstall
o Re-wrote most of the pagerank functions

karlbenson

1.3 - 9th January 2008
o New readme
o Fixed a minor error

karlbenson

I have reuploaded this mod and screenshots for it.

I am in the process of doing it for ALL my other mods aswell.  Please bear with me.

Apllicmz

Update portuguese and brazilian

<file name="$themedir/languages/Modifications.portuguese.php" error="skip">
<operation>
<search position="after"><![CDATA[?>]]></search>
<add><![CDATA[
//Pagerank* Portuguese translation by Candidosa2*
$txt['usepagerankonprofiles'] = 'Use PageRank sobre perfil';
$txt['pr'] = 'PR:';
$txt['pagerank'] = 'PageRank #';
$txt['pagerank_desc'] = 'Google PageRank';
$txt['pagerank_outof'] = 'fora de 10';
]]></add>
</operation>
</file>

<file name="$themedir/languages/Modifications.brazilian.php" error="skip">
<operation>
<search position="after"><![CDATA[?>]]></search>
<add><![CDATA[
//Pagerank* Portuguese translation by Candidosa2*
$txt['usepagerankonprofiles'] = 'Use PageRank sobre perfil';
$txt['pr'] = 'PR:';
$txt['pagerank'] = 'PageRank #';
$txt['pagerank_desc'] = 'Google PageRank';
$txt['pagerank_outof'] = 'fora de 10';
]]></add>
</operation>
</file>



Advertisement: