Friday, 25 May 2007

GMapbook single user

GMapbook(the Software) is a guestbook base on Google Maps API.
***Get It***
You don't have to pay, we can share some code. I wish I can get an XSLT to parse OOXML to XHTML(very greedy, I know that). Or you can provide something else to attract me. Be careful, GMapbook was ugly coded. If you decided to share some code with me, write to kuan.jiang@yahoo.com to describe your works, then I will decide whether to accept it. Don't send me your code directly, it is dangerous :D.

Click the button below to pay, you will get the package in the other day by Email (The one you use for your paypal account). If you requires other features, write to kuan.jiang@yahoo.com, a customerized version will also be available though the price may goes a little higher.





***Features***
1. Automatically locate visitors on Google Maps;
2. Fully AJAX operation, no refresh or reload needed;
3. Spam protection;
4. Easy installation, 30 seconds is enough.

***Version***
2.0

***Demo***
http://www.gmap2.net/guestbook/

***Requirement***
1. MySQL 4.3 or above required(only one table is needed);
2. PHP 5 or above with XMLDOM required;
3. PHP GD2 lirary required.

***Installation***
1. Upload all the files to your server. If the server is Linux, make /include/config.inc.php writable for all users;
2. Nagivate to /install.php, just follow the instructions to finished all the blanks;
3. If everything is OK, delete /install.php and enjoy it!


***EULA***
This License governs use of the accompanying Software.

After purchasing, you can:
1. Use this Software for any non-commercial purpose;

2. Modify the source code(not copyright notices) to suit your own need;

3. Free upgrade in major version(you can upgrade to 2.xx freely. For higher version you can get a discount).

In return, we simply require that you agree:

1. You CANNOT remove any copyright notices from the Software.

2. Without the author's permission, you CANNOT redistribute the Software
and its derivatives(including your modified version) in any form.

3. That the Software(including its updates) comes "as is", with no warranties. Use at your own risk.

4. That your rights under the License end automatically if you breach it in any way, and you must remove all the files of the Software.

Support : http://gmapbook.blogspot.com
Author : kukukuan (kuan.jiang@yahoo.com)
Copyright (c) 2006-2007 All rights reserved

Wednesday, 18 April 2007

My demo GMapbook Failed to Work

My demo failed to work, Because ifastnet.com use an FRAME to load my page.

Unfortunately, this method blocked AJAX communication between the server and the client.

That's why it always shows a purple-blue box but never loading completely.

Here is a new Demo here
http://gmap2.net/guestbook/

That demo is in Chinese, so don't download that one.

The file in this blog is OK. Sorry for inconvinience.

Currently, I am working on a multi-user system at http://gmapbook.gmap2.net
It is in Chinese, too. But other language suppor will be added in the future.

Friday, 9 February 2007

GMapbook v1.2 is released

GMapbook v1.2 is available now!

1. What is GMapbook?
GMapbook is a guestbook based on Google Maps API. Now it is fully based on the popular AJAX technology. It is simple, steady and easy to use. Why not make it on your site? Now I can provide single-user version for downloading. And from now on, I will made it a serious software, not just a toy.

2. Requirment
PHP 5.0 or above, MySQL 3.3 or above
If you don't have a server meeting the requirement, you can simply apply a free webspace at http://www.ifastnet.com as I did.

3. Downloading
Not available now. Due to a harddisk error, Javascript source code lost, development stopped.
Please refer to version 2.0

4. Installation
For new users, read "readme.txt" first, and install it following the instructions. Or simply visit the "http://your gmapbook path/install.php
You must have a Google Maps API key, and I already give a link in the installing page. You can follow it and get your own key.

If you can install Wordpress, I think it won't be hard for you to install it.

5. BUG Reporting
Just visit here and post a comment. That's OK!

6. Change Log
v1.2 Add a interface for manually locating
v1.1 Fix the IE7's incompatibility
v1.1 First release

7. TO-DO List:
a. Recently, some function is a little inconvenient, more javascript is needed to improve that;
b. Now only PHP+MySQL platform is supported, ASP+MSACCESS version may be available, too(since it is fully based on AJAX, it should be easy);
c. An plugin for WordPress may be developed;

Saturday, 3 February 2007

How to Increase Pagerank

Here, I am not telling you to promote the quality of your webpages, to exchange links with high ranked site, and to do some cheating. Just look at the picture below:

 

What I have done is just adjusting the RSS links' position, and the pagerank goes from 1 to 5.

Amazing!?

But just kidding, it's because Google Toolbar is awful, which malfunctions easily, and even make firefox unstable. Yet, it's so convinient that I could bear to restart the browser again and again.

 

I wrote this bullshit just because I was wondering which place MS Live Writer will upload that picture to. But the fact told me it couldn't do that and asked me to upload it to an FTP server.  It cannot upload it to picasa.

Friday, 2 February 2007

Compress Webpage Even the Server doesn't support GZIP

Use gzip compression, you can save a lot of band width and your visitors also get better loading speed. But some odd servers do not enable this function. Now here is method to do it manually with php code.

First, save the highlighted code in the end of the page
Then, make your page like this

<?php?
include('gzipOut.php'); //first include our functions
?>
..................
..................//Put your content here
..................
<?php?
doGzipout(); //finally call gzip function
?>

Simple, right?
It's tricky, yet at most circumstances, we don't need it.





<?php
ob_start
();//Open flush
ob_implicit_flush(0);//
//*****************************************************************//
//Name:canGzip()
//Function:Check whether the client support gzip
//Parameter:
//Return Value: "gzip", "x-gzip", False
//*****************************************************************//
function canGzip()
{
//if (headers_sent() connection_status)

//return false;

if (strpos('King'.$_SERVER["HTTP_ACCEPT_ENCODING"], 'gzip') !== false)

return
"gzip";

if (
strpos('King'.$_SERVER["HTTP_ACCEPT_ENCODING"], 'x-gzip') !== false)

return
"x-gzip";

return
false;
}

//*****************************************************************//
//Name:doGzipOut($level, $debug)
//Function:compress the data in the flush and output
//Parameter:$level-compression level, 0 = no, 9 = max
// $debug-whether to output debug information, 1 = output, 0 = no
//Return Value:
//*****************************************************************//
function doGzipOut($level = 1, $debug = 0)
{

$ENCODING = canGzip();
if (
$ENCODING)
{
echo
"n<!-- Use compress $ENCODING -->n";

$contents = ob_get_contents();
ob_end_clean();

if (
$debug)
{
$s = "<p>Not compress length: ".strlen($contents);

$s .= "<br/>Compressed length: ".strlen(gzcompress($contents,$level));

$contents .= $s;
}

header("Content-Encoding: $ENCODING");
echo
"x1fx8bx08x00x00x00x00x00"; //???

$size = strlen($contents);
$crc = crc32($contents);
$contents = gzcompress($contents, $level);

$contents = substr($contents, 0, strlen($contents) - 4); //???

echo $contents;
echo
pack('V',$crc);
echo
pack('V',$size);

exit;
}
else
{
ob_end_flush();
exit();
}
}

?>

Thursday, 1 February 2007

Google Pagerank Hacking?

Many people know Google employs some strange hash method to validate whether the input parameter is valid, especially for pageranks.
Accidentally, I just browsed the javascript file of Google Toolbar for Firefox and found something interesting. See it below:

GPR_HASH_SEED="Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE. Yes, I'm talking to you, scammer.";
GPR_toHex8=function(num){
return(num<16?"0":"")+num.toString(16)
};
GPR_hexEncodeU32=function(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)
};
GPR_awesomeHash=function(value){
var kindOfThingAnIdiotWouldHaveOnHisLuggage=16909125;
for(var i=0; i<value.length; i++){
kindOfThingAnIdiotWouldHaveOnHisLuggage^=GPR_HASH_SEED.charCodeAt(i%GPR_HASH_SEED.length)^value.charCodeAt(i);
kindOfThingAnIdiotWouldHaveOnHisLuggage=kindOfThingAnIdiotWouldHaveOnHisLuggage>>>23kindOfThingAnIdiotWouldHaveOnHisLuggage<<9
}
return GPR_hexEncodeU32(kindOfThingAnIdiotWouldHaveOnHisLuggage)
};


This is almost the original code in toolbar.js, and I made some tiny modifications to make it readable and workable. The only function that needs to be called is GPR_awesomeHash(Some_String)

The prefix GPR here must be the acronym of Google PageRank. This is the Hash method they use. It is really awesome if you read this sentence:

"Mining PageRank is AGAINST GOOGLE'S TERMS OF SERVICE. Yes, I'm talking to you, scammer."

I am not willing to disobey GTOS, so I will not give you the code to get pagerank value.

You can do that yourself. It is quite easy. Yes, I'm talking to you, scammer.

What I am interested in is actually something else, say "Google Dictionary"?
Using Google Toolbar, we can translate most English word to our own language by pointing the word. Usually, this dictionary is in some DAT files in the plugin folder which seems not too difficult to crack. You may try!

But Google also offers an online interface to retrieve word meaning. Luckily, they use the same hash method. The URL format is below:
http://www.google.com/tbproxy/dictionary?ie=UTF-8&oe=UTF-8&text=SomeEnglishWord&langpair=en%7CLanguageCode&sig=HashCode

Language code: zh-CN for simplified Chinese, fr for French, jp for japanese, etc
Hash code: "8"+GPR_awesomeHash(the english word you look up for)

The number 8 is kind of miracle. Also, in the hashmethod, the number 16909125 may have some special meaning, too. Yet, I don't know.

Here are some example links for this dictionary, the word is HAPPY
Simplified Chinese:
http://www.google.com/tbproxy/dictionary?ie=UTF-8&oe=UTF-8&text=happy&langpair=en%7Czh-CN&sig=8b0082ea0

Traditional Chinese:
http://www.google.com/tbproxy/dictionary?ie=UTF-8&oe=UTF-8&text=happy&langpair=en%7Czh-TW&sig=8b0082ea0

French:
http://www.google.com/tbproxy/dictionary?ie=UTF-8&oe=UTF-8&text=happy&langpair=en%7Cfr&sig=8b0082ea0

Korean:
http://www.google.com/tbproxy/dictionary?ie=UTF-8&oe=UTF-8&text=happy&langpair=en%7Cko&sig=8b0082ea0

How to use GMapbook

It is simple to use GMapbook, yet a friend make a video to show how to use it.
Here it is.


You Own Google Map Guestbook - video powered by Metacafe