July 18th, 2008
To use it, you’ll have to first download the GeoIP Free Country file and extract it into a directory in your Web server. Then you’ll have to pick which language API to use with the database file. For simplicity, we’re going to use the pure PHP version because it doesn’t require any additional configuration or Apache modules. Remember to read the license terms before installing these on your Web site to ensure you are in compliance.
The code in Listing A demonstrates the basics of using the module (geoip.inc) to access the GeoIP Free Country database (GeoIP.dat). The example assumes both the PHP include and the country database file are in the same directory as the PHP file itself. You’ll have to change the paths as needed if this is not the case in your installation.
The sample code is pretty straightforward. After including the GeoIP PHP function library, the first step is to open the GeoIP database file with the geoip_open() function. This function accepts two arguments: the path to the database file and the type of database.
We then use the handle returned by the call to geoip_open() to obtain the two-letter country code and human-friendly name corresponding to the given IP address, via the geoip_country_code_by_addr() and geoip_country_code_by_name() functions, respectively. Both functions accept two arguments: the handle returned by geoip_open() and the IP address to resolve.
Once the required information is obtained, we close the database file with a call to geoip_close(). Simple as that.
No Comments » |
Uncategorized |
Permalink
Posted by admin
July 16th, 2008
Firefox 3 does not use cookies.txt but rather cookies.sqlite.
Solution: Uses a python script to extract the data from cookies.sqlite.
http://blog.schlunzen.org/2008/06/19/firefox-3-und-cookiestxt/
#!/usr/bin/python
import sqlite3 as db
import sys
cookiedb = '/home/USENAME/.mozilla/firefox/PROFIL/cookies.sqlite'
targetfile = '/home/USERNAME/cookies.txt'
what = sys.argv[1]
connection = db.connect(cookiedb)
cursor = connection.cursor()
contents = “host, path, isSecure, expiry, name, value”
cursor.execute(”SELECT ” +contents+ ” FROM moz_cookies WHERE host LIKE ‘%”
+what+ “%’”)
file = open(targetfile, ‘w’)
index = 0
for row in cursor.fetchall():
file.write(”%s\tTRUE\t%s\t%s\t%d\t%s\t%s\n” % (row[0], row[1],
str(bool(row[2])).upper(), row[3], str(row[4]), str(row[5])))
index += 1
print “Gesucht nach: %s” % what
print “Exportiert: %d” % index
file.close()
connection.close()
No Comments » |
Uncategorized |
Permalink
Posted by admin
July 8th, 2008
There are heroes… there are superheroes… and then there\’s Hancock. With great power comes great responsibility — everyone knows that — everyone, that is, but Hancock. Edgy, conflicted, sarcastic, and misunderstood, Hancock\’s well-intentioned heroics might get the job done and save countless lives, but always seem to leave jaw-dropping damage in their wake. The public has finally had enough — as grateful as they are to have their local hero, the good citizens of Los Angeles are wondering what they ever did to deserve this guy. Hancock isn\’t the kind of man who cares what other people think — until the day that he saves the life of PR executive Ray Embrey, and the sardonic superhero begins to realize that he may have a vulnerable side after all. Facing that will be Hancock\’s greatest challenge yet — and a task that may prove impossible as Ray\’s wife, Mary, insists that he\’s a lost cause.
No Comments » |
Movies |
Permalink
Posted by admin
July 8th, 2008
Loosely based on the comic book miniseries of the same by Mark Millar and J.G. Jones, WANTED, directed by Timur Bekmambetov, follows anxiety-prone office drone Wesley Gibson (James McAvoy) as he is inducted into the Fraternity, a clan of powerful killers that counted his father as a member. Pursued by rogue agent Cross (Thomas Kretschmann), Wesley is trained by the sleek, sexy Fox (Angelina Jolie) and the charismatic Sloan (Morgan Freeman), among others, to be just as proficient and deadly as his father. Once Wesley becomes a master assassin, he must confront Cross, and contend with the stunning ramifications of that encounter.<br><br>Straying rather far from the WANTED comic\’s supervillain-centric premise, WANTED runs with the edgy Eastern European aesthetic of Russian helmer Bekmambetov, who garnered international recognition with the stylish vampire epic NIGHT WATCH. While Jolie is a gleefully destructive presence in her action-heavy scenes, the film belongs to McAvoy, who transforms from milquetoast to manhunter with verve and charm. And like the similarly themed THE MATRIX before it, WANTED also showcases some eye-catching special effects, most notably in the loopy concept of “curving bullets.” Though devotees of the WANTED comic may be dismayed with the many liberties taken with the story, the movie is undeniably energetic and entertaining, making it fun summer blockbuster fare.
No Comments » |
Movies |
Permalink
Posted by admin
July 7th, 2008
http://area51.phpbb.com/docs/coding-guidelines.html
4. Templating
File naming
Variables
Blocks/Loops
Including files
PHP
Conditionals/Control structures
Extended syntax for Blocks/Loops
No Comments » |
Uncategorized |
Permalink
Posted by admin
July 4th, 2008
Hooks a function on to a specific action. See Plugin API for a list of hooks for action.
Usage
Examples
To email some friends whenever an entry is posted on your blog:
function email_friends($post_ID) {
$friends = ‘bob@example.org, susie@example.org’;
mail($friends, “sally’s blog updated” , ‘I just put something on my blog: http://blog.example.com’);
return $post_ID;
}
add_action(’publish_post’, ‘email_friends’);
Parameters
$tag
(string) The name of the action you wish to hook onto.
$function_to_add
(callback) The name of the function you wish to be called. Note: any of the syntaxes explained in the PHP documentation for the ‘callback’ type are valid.
$priority
How important your function is. Alter this to make your function be called before or after other functions. The default is 10, so (for example) setting it to 5 would make it run earlier and setting it to 12 would make it run later.
$accepted_args
How many arguments your function takes. In WordPress 1.5.1+, hooked functions can take extra arguments that are set when the matching do_action() or apply_filters() call is run. For example, the action comment_id_not_found will pass any functions that hook onto it the ID of the requested comment.
No Comments » |
Uncategorized |
Permalink
Posted by admin
July 3rd, 2008
Diablo III is an action role-playing game currently in development and the third installment of Blizzard’s Diablo franchise. It was unveiled on June 28, 2008 at the 2008 Blizzard Entertainment Worldwide Invitational in Paris, France.
StarCraft II is a military science fiction real-time strategy video game currently under development by Blizzard Entertainment as a sequel to the award-winning 1998 video game StarCraft. First announced on May 19, 2007, in Seoul, South Korea,[5][6] StarCraft II is being developed for concurrent release on Windows XP, Windows Vista, and Mac OS X. The game has no certain release date[4] although a multiplayer demonstration was playable at BlizzCon 2007
No Comments » |
Uncategorized |
Permalink
Posted by admin