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
Options +FollowSymLinks | |
RewriteEngine on | |
RewriteCond %{THE_REQUEST} ^.*\/index\.html? | |
RewriteRule ^(.*)index\.html?$ http://example.com$1 [R=301,L] | |
# More resources: | |
# | |
# http://old.justinshattuck.com/2007/01/19/apache-mod_rewrite-cheat-sheet/ | |
# http://net.tutsplus.com/tutorials/other/a-deeper-look-at-mod_rewrite-for-apache/ |
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
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase /path/to/front/of/site/under/root/directory/local_example_com/ | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /path/to/front/of/site/under/root/directory/local_example_com/index.php [L] | |
</IfModule> |
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="feedbackGadget" style="left: 359px; top: 20px; visibility: hidden; display: none; " class="gn-gaiabar-gadget"> | |
<div id="feedbackIframe"> | |
<iframe id="feedbackIframeId" name="feedbackIframeId" class="gn-gaiabar-iframe" src="https://spreadsheets.google.com/embeddedform?key=pPo2nzr1TywUz6Kp4cvV6NA&hl=en&gridId=0" frameborder="0" style="height: 320px; width: 480px;"> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>Feedback</title> |
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 | |
$url = "http://icanhascheezburger.com"; | |
$html = file_get_contents($url); | |
$dom = new DomDocument(); | |
@$dom->loadHTML($html); | |
$xpath = new DOMXPath($dom); | |
$img = $xpath->evaluate("//div[@class='entry']//img")->item(0); | |
$imgSrc = $img->getAttribute('src'); | |
print("<img src=\"$imgSrc\" />"); |
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 | |
$weather_loc = 10001; | |
function getWeather( $weather_loc ) { | |
// weather data url, location based | |
$requestAddress = 'http://www.google.com/ig/api?weather=$weather_loc&hl=en'; | |
// Parse XML | |
$xml_str = file_get_contents($requestAddress,0); |
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 | |
/** | |
* Manage WordPress contact fields. | |
* Usage: | |
require './class.TTT_Contactfields.php'; | |
$TTT_Contactfields = new TTT_Contactfields( | |
array ( | |
'Twitter' | |
, 'Facebook' |
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 | |
/** | |
* Adds a view all posts page to any archive. | |
* | |
* @author Thomas Scholz http://toscho.de | |
* @version 1.1 | |
* @license: GPL2 | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.html |
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
Using Wordpress XMLRPC services Jul 5th, 2009 | By admin | Category: Featured, PHP, Tutorials | |
(1 votes, average: 4.00 out of 5) | |
Wordpress is a great blogging platform. With tons of plugins available, Wordpress is quickly become a good choice not only for personal blogging purpose but also for making content oriented sites. There are also many sites want to add ‘blog’ feature into it and WP one more time is the chosen one. Although WP’s plugin architecture is really not good, the WP’s team have added in a really interesting tool that help integration between WP blog and hosting site easier. It’s XMLRPC services. | |
Here are some scenarios if you has a WP blog and you want to integrate it with another site, you will found XMLRPC helpful: | |
Showing latest posts/comments on the site homepage | |
Provide links to categories in your blog | |
Turning your WP blog into a collaborative environment for your site’s authors |
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 | |
/** | |
* The base configurations of the WordPress. | |
* | |
* This file has the following configurations: MySQL settings, Table Prefix, | |
* Secret Keys, WordPress Language, and ABSPATH. Get MySQL settings from web host. | |
* You can find more information by visiting the Codex page: | |
* | |
* @link http://codex.wordpress.org/Editing_wp-config.php | |
* |
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 | |
set_time_limit(0); | |
require_once("IXR_Library.php.inc"); | |
$client->debug = true; // Set it to fase in Production Environment | |
// Create the client object | |
$client = new IXR_Client('Your Blog URL/xmlrpc.php'); | |
$username = "Blog Admin/Editor/Author User Name"; |