View Full Version : Working PR.
Nefarious
06-13-2006, 05:33 PM
PR wasn't working on my server so I thought there has to be scripts out there that DO work. I found one that did, and finally got it to work for me.
After seeing one of those sites that give you a url to put on your website to show pagerank, I thought I'de do it here.
Posting this back because I've used several other mods around. One good thing is that it can be on another server and won't exactly point to you as the source.
This can work in any version I think because it doesn't use the script much, only 1 variable.
What you need:
10 page rank images. This script uses images named in this order: pr0.jpg, pr1.jpg, pr2.jpg, 03.jpg, etc. You can change the PageRank.php to use gif and other formats but you have to edit a few characters.
The scripts that have to be edited:
pagerank.php(or you can rename script)
link.tpl
Here is the main script: "PageRankXor32.php"
Content visible to registered users only.
Here is the file that you call: "PageRank.php"
You will want to edit the path to the image directory where you need to have your page rank images.
Content visible to registered users only.
Now in link.tpl you have to change one line.
Find:
Content visible to registered users only.
And replace with:
Content visible to registered users only.
Hopefully this helps some of you who want pagerank. You can see a demo here: http://www.myarticlepub.com/directory/ I don't know if I'll keep it on though but will for now until I start receiving links.
This could lead to "outside" people using your script so I would find a way to stop them by using htaccess to allow only local requests and block outside access to it. I haven't bothered with it yet, but feel free to post if you know how to restrict access to certain hosts (like if you host the script on another server and only allow your directory access the script)
Steven Myers
06-13-2006, 05:50 PM
This is a very cool addon, and thank you for posting it as I can tell many users will have this on their directory. The only thing is, will it work for the version 3?
Nefarious
06-13-2006, 06:01 PM
I dont know I'm using v2 and v2 has a link.tpl.
Does 3.0 have a link.tpl? If so then it should work by just using {$link.url} or whatever tag 3.0 uses to get the url.
It doesn't require much, just find where the link routine is(where page rank is posted if its enabled) and use the tag that gets the current url for the image.
tomzx
07-20-2006, 06:30 PM
Works great. I was about to do the same (using the PageRankXor32.php). Now I get PRs instead of N/A!
Neticus
07-20-2006, 07:28 PM
@Nefarious
Wow very good, you have done exceedingly well to find a workaround. I know a lot of people will appreciate this. Hopefully it will be added to the Complete Mod list :)
Nefarious
07-21-2006, 02:29 PM
hehe thanks.
i did this add this to try to stop people from using the script.
in .htaccess:
SetEnvIf REFERER "www\.YourDomain\.com" linked_from_here
SetEnvIf REFERER "^$" linked_from_here
<Files pagerank.php>
order Deny,Allow
Deny from all
Allow from env=linked_from_here
</Files>
instyle
07-21-2006, 08:25 PM
I have upload and update above code. For a simple test below
http://ableaffiliate.com/include/test.php
Its really slow and can't find page rank for amazon. Any hints? Thanks.
inside test.php
<?php
include('PageRankXor32.php');
$oPR=new PageRankXor32();
echo $oPR->getRank('http://www.amazon.com');
?>
Nefarious
07-22-2006, 06:15 AM
That code works for me fine. http://www.amazon.com has a PR 0
Don't know why it wouldn't work, I used that same code you pasted and worked fine.
Can't help you sorry.
matt6124
07-23-2006, 06:57 PM
Hello, i have installed the script and the test script works fine but my pagerank images will still not show up, only dead images. Any ideas
Cheers
Matt
Nefarious
07-25-2006, 05:10 AM
Wrong path?
Change this:
$filename='http://www.domain.com/path/to/images/pr'.$PageRank.'.jpg';
Change it to where you pr images are located.
Example if your images are located here:
http://www.mydomain.com/primages/pr5.jpg
Then you would change $filename to:
$filename='http://www.mydomain.com/primages/pr'.$PageRank.'.jpg';
Also it has to be jpg, unless you change the code to output gif or another format.
janinexd
07-25-2006, 05:16 AM
do you have a script like this that works on v3.5?
matt6124
07-25-2006, 05:58 PM
Excellent thank you, its works !
Me being stupid i thought the /pr was just an example directory in the /images dir, so i just had my path to /images.
Thanks alot
Matt
brazenmedia
07-25-2006, 07:45 PM
This is a great mod, but I have two problems after applying it:
1. Now I when I go to 'edit' a link and then save it, once I click on 'save' it goes to a page with one of the pagerank images showing and nothing else. It does not save the edits that I make.
2. The 'Sort by pagerank' doesn't quite work right. It sorts the majority of them correctly, but leaves one or two at the bottom that aren't in order. This may not work correctly now since I'm pulling pagerank a different way than what was included with the default phpLD. Can everyone sort their pageranks correctly using this mod, or is there something else I need to change?
The edit problem is major, I can live with the page rank sorting incorrectly, or remove the option to sort if no one has any ideas. I can revert back pre mod installation if all else fails, but I like this mod.
I'm running RC 5.2 Version 2
Thanks
Nefarious
07-26-2006, 12:53 AM
Content visible to registered users only.
This should work with any version, since it doesn't use phpld really. Your just using it as an image. Find in the script where it is suppose to display the PR, and insert the img src code.
As for brazenmedia:
Sort by pagerank should not work since the pr isn't being sent to the script. I did look for the pr routine in phpld to see if I could replace that code with the new pr script but could not find it.
For your edit problem, I have no clue. The only code to put into phpld is a simple html <img> tag. It shouldn't conflict with any other code unless it was put in the wrong place.
It sounds like you are using it in the admin section? Maybe it's in the wrong place and causing the error.
brazenmedia
07-26-2006, 10:47 PM
Thanks for the reply - I followed the directions exactly...twice. Very odd what was happening, I've applied a few other mods without any problems, maybe some other code changes are affecting this.
Anyway I ended up restoring back to my files before installing the mod, it was also pulling up the pagerank images very very slowly, even on pages that had just a few listings - (the images I created were quite small in size and optimized). Having PR on the pages isn't a big deal, this mod is cool though
janinexd
07-31-2006, 12:55 PM
hmmm.
on
Content visible to registered users only.
what if my images are on .gif format? please replace that code on the gif codes..
thanks
?>
matt6124
07-31-2006, 05:57 PM
Hello, i have another very bizzare problem, since installing this pagerank mod, when a new link is submitted instead of moving to payment page the zero pagerank image is just displayed on another page. I have no idea what is causing this can anyone help?
janinexd
07-31-2006, 10:55 PM
please help.
i need to fix it asap.
David
08-01-2006, 12:02 AM
You might want to PM nefarious and see if you would like to reply.
Nefarious
08-01-2006, 06:16 AM
Replace the last 5 lines with these new lines:
Content visible to registered users only.
As for matt6124:
No clue, did you put the the img tag where I said to put it? It should only go in link.tpl where the script makes the display listing.
matt6124
08-02-2006, 06:00 PM
Ok i have cured it now, i had to rename pagerank.php to something different and change the image path to the new name of the file which i called pr.php. for some reason it didnt like me replacing the old pagerank.php file with the updated code.
janinexd
08-04-2006, 09:42 AM
Hello.
please explain to me why is my pagerank not working on: http://linkarchive.org/index.php?list=top
please. i'm willing to pay you some $ if you can fix this.
i followed all the rules but, its not working/
Nefarious
08-05-2006, 02:56 AM
You have your paths wrong.
http://www.linkarchive.org/images/pr/pagerank.php
That is a 404.
You want:
http://www.linkarchive.org/pagerank.php
Check you <img src> code in the template.
akashif
08-09-2006, 02:21 AM
hi
Nefarious , have done a great job , and using this excellent work i have made some corrections in.
i have used Nefarious PR correction Modification and found some issues in it
1) phpLD sort the links by PR , if we add the IMAGE PR given by the method of Nefarious, PR will do show up , but will not be sorted
2) it increases the page loading time. as if there are 30 links on page it have to load 30 images as it uses GD functions and images will not be cashed
to fix these issues i have used Nefarious code , but a different approch.
phpLD saves the PAGE-RANCK in Mysql DB that is.
PLD_LINK.PAGERANK
PLD_LINK.PAGERANK is added when URL is added in the DB , that is when URL is submited to phpLD.. and next it uses the DB values to display.
usually NA is displaied when a URL is submited and phpLD is unable to determine the PR (due to any reason server blocking or any other...).
so i changed the submit code to use the Nefarious PR code and thats all
so i just changed submit.php
locate this in submit.php
Content visible to registered users only.
replace this code with following
Content visible to registered users only.
(i am asuming that PageRankXor32.php has already been created using above mentioned code, and located at same level where submit.php is placed.)
thats all.
when ever some link is added in phpLD will store the PR in DB and will use properly.
this solution will work for New links added.
now you will certainly want to update the existing links PR. her is a simple code for updating existing links PR
call this file as updatePR.php
Content visible to registered users only.
(i am asuming that PageRankXor32.php has already been created using above mentioned code, and located at same level where submit.php is placed.)
place this updatePR.php on sale level where 'PageRankXor32.php' is placed and access this from Browser
(Dont forget to change the Mysql user and pass and DB name)
this will update the PR of all links added.
you can add this script in Cronjob or manually run once in a month up get latest PR of site
all the above changes have been implemented on this site
http://www.click.pk/
, i have tried to make the solution very simpler, but if i have not explained clearly let me know AT
admin@click.pk
thanks
Ali Kashif
http://www.click.pk
Nefarious
08-09-2006, 05:14 PM
Great nice!
Could never find the code to change the pr.
Glad you got it, will implement it when I can.
Thanks again.
maxlinks
08-09-2006, 08:57 PM
Excellent work :)
Just tested it out and it seems to be working fine!
Thanks.
vBulletin® v3.8.0, Copyright ©2000-2012, Jelsoft Enterprises Ltd.