Website Page Rank?

gsharpe1964

Member
Is there any way we could incorporate the websites page rank to each one on the topsite lists??
I think more people would sign up if they saw pageranks

Perhaps we could insert an external page rank into each listing?
 

Basti

Administrator
Staff member
If you want to integrate an external pagerank service, its dead easy.
The code they provide you useually have a part which look like url=your_website.com

You place that code into table_top_row and replace your_website.com with {$url}
 

gsharpe1964

Member
Thanks Basti, I'll check out a few page rank codes and see if i can add them. ll that add the page rank code on each member as they join??
 

Basti

Administrator
Staff member
Correct. since {$url} in table_top_row.html represent each members website url, you are able to display their pagerank by just placing the code once. By the way, it does function the same way in stats.html
 

gsharpe1964

Member
Ok Mate, thanks Basti i appriate your help, Look i've found this code

Code:
<!-- DisplayPageRank.com Start Code -->
<a href="http://www.displaypagerank.com"><img src="http://www.displaypagerank.com/pr.jpeg?site=www.yoursite.com" border="0" alt="PageRank Checker"></a>
<!-- DisplayPageRank.com End Code -->
what would i have to change?? I got the code from here http://www.displaypagerank.com/

I can't see how that would add the page rank on all the members??

Thanks again
 

Mark

Administrator
Staff member
that service appears to be broken (a common problem with these since as far as I can recall its a violation of Google policy to use pagerank outside of the toolbar)
http://www.displaypagerank.com/pr.jpeg?site=www.google.com

unless google has a pagerank of 0 :)

when you find one that works, all you need to do is swap the yoursite.com bit with {$url} and paste in table_top_row template as Basti mentioned above.
 

gsharpe1964

Member
Ok I've upoaded the PHP file to my server root, i've made a directory called pagerant and downloaded a set of 10 page rank images now the call up code see below

Code:
<?php
 
  // content of somefile.php
 
  include('pagerank.php');
 
  $pr = getPageRank('http://www.pagerankcode.com');
 
  echo 'pagerankcode.com has PR '.$pr;
 
?>
Where do i put the {$url}

Is it here

Code:
<?php
 
  // content of somefile.php
 
  include('pagerank.php');
 
  $pr = getPageRank('http://www.pagerankcode.com');
 
  echo '  {$url} has PR '.$pr;
 
?>
Thanks again
 

Mark

Administrator
Staff member
{$url} is a template variable and as such will only work in the html templates. For PHP like this, you need to make a plugin.

if you want this to show up in rankings you will want to place your PHP code in a plugin file called: rankings_compile_stats.php

basically you need to replace this line:
PHP:
  $pr = getPageRank('http://www.pagerankcode.com');
 
  echo '  {$url} has PR '.$pr;
with this:
PHP:
  include('pagerank.php');
  
  $pr = getPageRank("{$TMPL['url']}");
      $TMPL['pr'] = $TMPL['url']. ' has PR '.$pr;
now in your table_top_row.html template you can add {$pr} for the output.

check this tutorial on how to make a plugin:
http://visiolist.com/community/threads/how-to-create-a-plugin.20/

hope that gets you going :) if you have any questions feel free to ask
 

Mark

Administrator
Staff member
Just a heads up, make sure you get that pagerank script working on your server as a standlone product first, I was not able to get it working on my test server.

If it does work for you let me know and I'll send you the files to make this a plugin, I made the mistake of making a plugin for it before testing the script :confused:
 

gsharpe1964

Member
Still not managed to get a PR code to work, Tried on my testsite with no luck, I think i may just wait for you to finish your plugin ;)
 

Mark

Administrator
Staff member
Well my work on the plugin is done, the problem is the script (from pagerankcode.com) that scrapes the pagerank from Google does not work.
 

gsharpe1964

Member
Well my work on the plugin is done, the problem is the script (from pagerankcode.com) that scrapes the pagerank from Google does not work.
So i'll see if i can find a code that works and you'll use it in the plugin ;)

Thanks mate, i'll take another look tonight
 

Mark

Administrator
Staff member
thats a 5 year old thread ;) most posts seems to indicate it didnt work then, at a glance I am 99.9% sure it doesnt work now.

If you find a script that you can just upload to your server and it actually works, then we can move forward.
 

Mark

Administrator
Staff member
Great, did you confirm it works on your server?

Also reading through the comments it looks like Google will block you for making too many requests... which is the reason I dont bother scraping Google data anymore, if they dont provide an API you will find yourself in a wild goose chase.

Anyway, confirm this works on your server and we can move forward.
 

gsharpe1964

Member
Mark I tried and it didn't , But i tried with this other one and it works
::removed::


I uploaded the small code (1st one) to my server and call it and it came up Only the Number, the bottom one has the pictures but try it here
::removed::


Pretty quick too You have a PR of 3 here
::removed::
 

Mark

Administrator
Staff member
awesome, for a method like this you will want to cache the pagerank instead of looking up every site, every time your rankings page loads. That makes this mod a bit bigger as we need to setup DB table to store the PR value, and pseudo cron to grab the PR every X seconds. Not hard, but quite a bit more time consuming that the original method. The bigger problem is the Google terms violation which means this is not something I can post for our other members to use making this is one off project. Are you ok paying a nominal fee $15 for this plugin creation? If not, thats alright too I just cant give it priority at the moment.
 
Top