This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!function_exists('get_geolocation')) { | |
function get_geolocation($ip) { | |
$d = file_get_contents("http://www.ipinfodb.com/ip_query.php?ip=$ip&output=xml"); | |
//Use backup server if cannot make a connection | |
if (!$d) { | |
$backup = file_get_contents("http://backup.ipinfodb.com/ip_query.php?ip=$ip&output=xml"); | |
$result = new SimpleXMLElement($backup); | |
if (!$backup) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo implode($geo_data); | |
67.160.143.219USUnited StatesOregonPortland45.5184-122.655-8-8-7 | |
echo print_r($geo_data); | |
Array ( [ip] => 67.160.143.219 [country_code] => | |
SimpleXMLElement Object ( [0] => US ) [country_name] => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
/* | |
|-------------------------------------------------------------------------- | |
| Base Site URL | |
|-------------------------------------------------------------------------- | |
| | |
| URL to your CodeIgniter root. Typically this will be your base URL, | |
| WITH a trailing slash: | |
| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.htaccess for CodeIgniter allows folders in the root folder such as css js images, etc | |
=========================================================================================== | |
Options +FollowSymLinks | |
RewriteEngine On | |
RewriteCond $1 !^(index\.php|favicon\.ico|css|js|images|robots\.txt) | |
RewriteRule ^(.*)$ index.php/$1 [L] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="lightbox" style="display: none"> | |
<div id="lightbox-header"><img src="../images/lightbox_header.jpg" border="0" /></div> | |
<div class="authorize"> | |
<div class="facebook-column"> | |
Share on Facebook | |
<%= fb_connect_javascript_tag %> | |
<%= init_fb_connect "XFBML"%> | |
<% js = update_page {|page| page.redirect_to fb_status_path}%> | |
<%= fb_login_button js%> | |
</div> |
NewerOlder