Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Sponsored Reviews   Improve your ranking, submit to directories   V7N Directory

Reply
 
LinkBack Thread Tools Display Modes
Old 05-11-2006, 05:41 AM   #1 (permalink)
v7n Mentor
 
Sketch's Avatar
 
Join Date: 05-06-04
Location: London, UK
Posts: 1,452
iTrader: 0 / 0%
Latest Blog:
None

Sketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web pro
Javascript to PHP

I found this code on a web forum and I have been trying for the last couple of days to convert it to PHP and I haven't had any luck.

Is anyone able to help me, or even give me a few tips like, what does '>>>' mean, thats my main problem!

Code:
var GPR_HASH_SEED = "Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE. Yes, I'm talking to you, scammer."; function GPR_awesomeHash(value) { var gHash = 16909125; for(var i = 0;i < value.length;i ++ ) { gHash ^= GPR_HASH_SEED.charCodeAt(i % GPR_HASH_SEED.length) ^ value.charCodeAt(i); gHash = gHash >>> 23 | gHash << 9} return "8" + GPR_hexEncodeU32(gHash) } function GPR_hexEncodeU32(num) { var result = GPR_toHex8(num >>> 24); result += GPR_toHex8(num >>> 16 & 255); result += GPR_toHex8(num >>> 8 & 255); return result + GPR_toHex8(num & 255) } function GPR_toHex8 (num) { return(num < 16? "0" : "") + num.toString(16) } function $(id) { return document.getElementById(id) } function generate(f) { $('r').innerHTML = GPR_awesomeHash( f.q.value ) } function query(f) { var x = f.fe.selectedIndex var u = 'http://' + f.h.value + '/search?client=navclient-auto' + ( x == 0? '' : '&features=' + f.fe.options[x].value ) + '&start=' + f.s.value + '&num=' + f.n.value + '&ch=' + GPR_awesomeHash( f.q.value ) + '&q=' + ( f.i.checked || x > 0? 'info:' : '' ) + encodeURIComponent( f.q.value ) $('r').innerHTML = '<a target="blank" href="' + u +'">' + u + '</a>' return u; }
Sketch is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 05-11-2006, 06:09 AM   #2 (permalink)
Inactive
 
Mrblogs's Avatar
 
Join Date: 03-29-06
Posts: 548
iTrader: 0 / 0%
Mrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really nice
Send a message via MSN to Mrblogs Send a message via Yahoo to Mrblogs
* Left Shift (<<)
* Sign-propagating Right Shift (>>)
* Zero-fill Right shift (>>>)

Left Shift (<<)

This operator shifts the first operand the specified number of bits to the left. Excess bits shifted off to the left are discarded. Zero bits are shifted in from the right.

Sign-propagating Right Shift (>>)

This operator shifts the first operand the specified number of bits to the right. Excess bits shifted off to the right are discarded. Copies of the leftmost bit are shifted in from the left.

Zero-fill right shift (>>>)

This operator shifts the first operand the specified number of bits to the left. Excess bits shifted off to the right are discarded. Zero bits are shifted in from the left.

taken from: http://tinf2.vub.ac.be/~dvermeir/jav...ript/expr.html
Mrblogs is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-11-2006, 07:51 AM   #3 (permalink)
Contributing Member
 
Izzmo's Avatar
 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,066
iTrader: 0 / 0%
Latest Blog:
Troublesome Exhaust

Izzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to behold
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
Lol.. just from reading the first line of code, are you trying to get through Google's PageRank system so it shows that you have something like a PR:9? Lol.. interesting idea, but Google will find that and delete your site from their SERPs

My 2 cents.. although I don't know if that's what you're trying to do or not.
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Izzmo is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-11-2006, 07:54 AM   #4 (permalink)
Inactive
 
reteep's Avatar
 
Join Date: 03-20-06
Location: Germany
Posts: 526
iTrader: 0 / 0%
Latest Blog:
C# CSV Import

reteep is a name known to allreteep is a name known to allreteep is a name known to allreteep is a name known to allreteep is a name known to allreteep is a name known to allreteep is a name known to allreteep is a name known to allreteep is a name known to allreteep is a name known to allreteep is a name known to all
Send a message via ICQ to reteep
I don't think this code is possible with php, it has to be Javascript because changes happen on Clientside.
reteep is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-11-2006, 07:56 AM   #5 (permalink)
Contributing Member
 
Izzmo's Avatar
 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,066
iTrader: 0 / 0%
Latest Blog:
Troublesome Exhaust

Izzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to behold
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
Well, if it is trying to change the Google PR in say the FireFox plugin or the Google Toolbar, no it is not possible with PHP since I don't think the toolbar sets in Session IDs or cookies to record the PR data, I think it just fetches the PR data directly from their server.
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Izzmo is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-11-2006, 07:58 AM   #6 (permalink)
Inactive
 
reteep's Avatar
 
Join Date: 03-20-06
Location: Germany
Posts: 526
iTrader: 0 / 0%
Latest Blog:
C# CSV Import

reteep is a name known to allreteep is a name known to allreteep is a name known to allreteep is a name known to allreteep is a name known to allreteep is a name known to allreteep is a name known to allreteep is a name known to allreteep is a name known to allreteep is a name known to allreteep is a name known to all
Send a message via ICQ to reteep
As you mentioned before, Izzmo, it's a bad idea anyway because easy tricks like that are easily tracked down
reteep is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-11-2006, 08:01 AM   #7 (permalink)
Contributing Member
 
Izzmo's Avatar
 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,066
iTrader: 0 / 0%
Latest Blog:
Troublesome Exhaust

Izzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to behold
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
Yep, I know... because I've tried them lol. But if you think about it, only the real savvy Google Web users pay attention to the PR anyways, so why try and go through it, if the people like your site, they will go to it, PR really shouldn't be the basis on if you should go to a website or not.
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Izzmo is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-11-2006, 10:22 AM   #8 (permalink)
v7n Mentor
 
digiweb's Avatar
 
Join Date: 04-07-06
Location: Manchester, NH
Posts: 762
iTrader: 1 / 100%
digiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of light
Send a message via Yahoo to digiweb Send a message via Skype™ to digiweb
zero fill right shift
For instance, if the number shifting is 8, then this is zero fill right shift:

1111 < 8 in binary
0111 < push everything to the right 1 and fill with zero
Result is 7 binary
digiweb is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-11-2006, 02:18 PM   #9 (permalink)
v7n Mentor
 
Sketch's Avatar
 
Join Date: 05-06-04
Location: London, UK
Posts: 1,452
iTrader: 0 / 0%
Latest Blog:
None

Sketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web pro
Quote:
Originally Posted by Mrblogs
* Left Shift (<<)
* Sign-propagating Right Shift (>>)
* Zero-fill Right shift (>>>)

Left Shift (<<)

This operator shifts the first operand the specified number of bits to the left. Excess bits shifted off to the left are discarded. Zero bits are shifted in from the right.

Sign-propagating Right Shift (>>)

This operator shifts the first operand the specified number of bits to the right. Excess bits shifted off to the right are discarded. Copies of the leftmost bit are shifted in from the left.

Zero-fill right shift (>>>)

This operator shifts the first operand the specified number of bits to the left. Excess bits shifted off to the right are discarded. Zero bits are shifted in from the left.

taken from: http://tinf2.vub.ac.be/~dvermeir/jav...ript/expr.html

Thank you, that makes sence now. I should be able to convert it because that was my main problem
Sketch is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-11-2006, 02:19 PM   #10 (permalink)
v7n Mentor
 
Sketch's Avatar
 
Join Date: 05-06-04
Location: London, UK
Posts: 1,452
iTrader: 0 / 0%
Latest Blog:
None

Sketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web pro
Quote:
Originally Posted by Izzmo
Lol.. just from reading the first line of code, are you trying to get through Google's PageRank system so it shows that you have something like a PR:9? Lol.. interesting idea, but Google will find that and delete your site from their SERPs

My 2 cents.. although I don't know if that's what you're trying to do or not.

Yer thats what the code does, I didn't know that google would delete my site :s Isn't this how places like http://www.pagerank.net and iwebtools get their page rank data?
Sketch is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-11-2006, 05:16 PM   #11 (permalink)
Contributing Member
 
Izzmo's Avatar
 
Join Date: 11-01-03
Location: Kansas City
Posts: 1,066
iTrader: 0 / 0%
Latest Blog:
Troublesome Exhaust

Izzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to beholdIzzmo is a splendid one to behold
Send a message via ICQ to Izzmo Send a message via AIM to Izzmo Send a message via MSN to Izzmo Send a message via Yahoo to Izzmo
Google would eventually find out, they watch their PR:8-10 sites VERY CLOSELY. So, yes, they would find out very quickly about your site.

But to answer your question, places like PageRank.net are doing it and showing the "actual" pagerank, not saying it's higher. But, I ask you then, are you trying to show your "actual" or put it up higher than it is?
__________________
Izzmo
Coding Guru Extraordinaire
ZeroWeb Hosting & Design - Customizable hosting for every type of user!
Izzmo is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-11-2006, 08:36 PM   #12 (permalink)
v7n Mentor
 
Sketch's Avatar
 
Join Date: 05-06-04
Location: London, UK
Posts: 1,452
iTrader: 0 / 0%
Latest Blog:
None

Sketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web pro
I want to show the same as what other sites do, so I guess the actual page rank.

I didn't know that the address I was requesting was different from the actual page rank.
Sketch is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-11-2006, 09:25 PM   #13 (permalink)
v7n Mentor
 
digiweb's Avatar
 
Join Date: 04-07-06
Location: Manchester, NH
Posts: 762
iTrader: 1 / 100%
digiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of lightdigiweb is a glorious beacon of light
Send a message via Yahoo to digiweb Send a message via Skype™ to digiweb
Jeeze. I didn't actually read the code, just the part that needed interpretation.

I'm an accessory to a theoretical sin.
digiweb is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-12-2006, 01:00 AM   #14 (permalink)
Inactive
 
Mrblogs's Avatar
 
Join Date: 03-29-06
Posts: 548
iTrader: 0 / 0%
Mrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really niceMrblogs is just really nice
Send a message via MSN to Mrblogs Send a message via Yahoo to Mrblogs
I think Sketch just wants to get the actual pagerank in PHP rather than in Javascript, so perhaps he can catalogue it or such?
Mrblogs is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-13-2006, 08:45 AM   #15 (permalink)
v7n Mentor
 
Sketch's Avatar
 
Join Date: 05-06-04
Location: London, UK
Posts: 1,452
iTrader: 0 / 0%
Latest Blog:
None

Sketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web pro
Correct MrBogs, that is what I'm after, I have had a look at a few scripts and none of them work correctly for me, this is the only one that I have seen that works.
Sketch is offline  
Add Post to del.icio.us
Reply With Quote
Old 05-15-2006, 02:30 PM   #16 (permalink)
v7n Mentor
 
Sketch's Avatar
 
Join Date: 05-06-04
Location: London, UK
Posts: 1,452
iTrader: 0 / 0%
Latest Blog:
None

Sketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web pro
Any ideas?
Sketch is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
javascript help mtaylor314 Coding Forum 2 05-04-2007 03:46 PM
Count-up from a particular year + Javascript within Javascript? Help! Azam.biz Coding Forum 3 06-06-2005 06:47 AM
Javascript Help. samer Coding Forum 2 09-08-2004 07:50 AM
I need some help with JavaScript. Can anyone help me please? CrAg Coding Forum 2 03-22-2004 05:56 AM
javascript webmaster@lostinteardrops Coding Forum 16 10-31-2003 08:19 AM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


Site Navigation: v7n Home .::. Graphics .::. Scripts .::. Web Designers .::. SEO Consultants .::.