I love CodeIgniter and I love how easy it is to generate static version of your website. You just have to overwrite the _write_cache function in the Output.php class and turn the caching on. Here’s my version:
-
« Home
Contents
I love CodeIgniter and I love how easy it is to generate static version of your website. You just have to overwrite the _write_cache function in the Output.php class and turn the caching on. Here’s my version:
I started to learn Kohana 3 by writing a tutorial for it. Take a look at it here if you are interested.
This is my submission for PHASE 2 of the Micro Game Coding Challenge.
rp16g
http://posterfans.com/game/rp16g.php
Size:5.1 KB
Planning and development time ~ 7 hours
rp16g is a small text based rougelike game based on Dragon Slayer. The player (@) must find and kill the dragon (+). The dragon is very strong for the player’s initial fitness so some monster killing [...]
There is competition going on in bbGameZone. I decided to participate with small Bulls and cows game:
Here is my submission “CowsNBulls”.
It’s a game I loved playing when I was younger.
Demo: http://posterfans.com/game/
Source code: http://posterfans.com/game/index.php.txt (2013 bytes)
The code can be further optimized, but let’s leave something for Phase 2 Smiley
Total planning + development + bug fixing time [...]
If you want to use GET parameters in Code igniter just for specific controller do use the following line in your Controller’s constructor:
parse_str($_SERVER[’QUERY_STRING’],$_GET);
Also make sure to call your script like this (even if you use mod_rewrite to get rid of index.php):
www.example.com/index.php/controller/method/?par1=1&par2=2
I needed a bot to quickly modify the pages of wiki.muonlinehelp.com. So I created Mutex which kind of helps do the job. It’s full of bugs with no error handling but works for me.
Usage:
<?
require ‘class.mediawiki.php’;
$mw = new mediawiki(’http://yourwikiurl/api.php’);
$mw->login(’bot_user’, ‘bot_password’);
$mw->editPage(’title’, ‘page_text’);
?>
You can get the source code from here. [...]
I use Aksimet for comment filtering in two of my projects, scenata.com and diggbg.com. It’s very useful anti spam solution and worked like a charm .. until recently when it started to break the encoding on some of the comments. Fortunately the problem is easy to solve and the solution can be found here.
Generating Perlin noise requires heavy calculation and PHP (in my opinion) is not the best language for this task but still it can be useful.
The algorithm is an adaptation form this pseudo code.
The class seems to work but I’m not if it works 100% correctly. The tricky part was to deal with the types because [...]
I looked for PHP maze generation algorithms today and couldn’t find anything. Fortunately Wikipedia has an article on Maze generation algorithm with source code written in Java. The easiest part was to transfer the code to PHP (it looks like PHP supports the same bitwise operators’ syntax as Java), and the hardest to make it [...]
A short sample on how to attach a callback function to PHP class:
<?php
function outside(&$p1, $p2){
$p1 = "This comes from the outside";
echo "Outside: $p2\n";
}
class test{
var $_events = array();
function attach($handler_name, $method_name) {
[...]