(X)HTML
Removing WordPress post revisions feature
Friday, March 13th, 2009WordPress 2.6 and above’s new feature of post revisions only slows WordPress down and makes it less usable. So here is how to disable post revisions:
Open wp-config.php in your wordpress installation directory with a text editor.
Add the line “define(’WP_POST_REVISIONS’, false);” anywhere in the file in a new line after the <?php header.
Save it and upload [...]
Simple Template Engine - your lightweight templating engine in PHP
Monday, February 2nd, 2009The Simple Template Engine is a very lightweight template engine to use in PHP if your webhost does not allow you to run something like Smarty. It is simple, lightweight and fast.
To parse a file:
<?php
// include simple template engine
include(“tpl.class.php”);
$tpl = new template();
$tpl->assign(Array(‘content’=>“Hello World from Simple Template Engine!”));
// If you want to display it directly
$tpl->display(‘example.tpl’);
// If you want to send it to another function/class for more processing
some_function($tpl->parse(‘example.tpl’));
?>
example.tpl is:
<html><head><title>{content}</title></head><body><h1>{content}</h1></body></html>
If you found this article useful or helpful, please help Compdigitec spread the word. Don’t forget to subscribe [...]
Enabling and in MediaWiki
Sunday, September 14th, 2008
If you have a MediaWiki installation and decide to make it Wikipedia-like, you will find that the <ref> tags and the <references /> tags don’t work like they do in Wikipedia. Below is a screenshot of the citation tags not working:
To fix this problem, you need to install the Cite extenstion for MediaWiki. Below is [...]
SimpleXML - solution for XML manipulation in PHP
Sunday, September 7th, 2008If you ever do get the need to manipulate (read/write) XML, you could try using the PHP DOM API, but it’s very difficult to use the DOM. An good extension-less way to access and manipulate XML instead is SimpleXML. It’s very easy to use compared to DOM and features a easy way to access attributes [...]
