Template

A very small PHP contest

Seems no one come up with anything...
so here is the solution
first, I create a counter class

class it_count{
	var $counter = array();
	var $x = -1;
	function start(){
		$this->counter[] = 0;
		++$this->x;
	}
	function end(){
		unset($this->counter[$this->x]);
		--$this->x;
	}
	function run(){
		++$this->counter[$this->x];
	}
	function output(){
		return $this->counter[$this->x];
	}
}

Then I just need to write a regex convert this:

while ($foo){
 
	{while $bar}
		bar
	{/while}
foo
{/while}

into

A image template system I'm working on

I haven't post much these days because I'm busying working on a php project that was made to make image creation easy
For now, I is named Imarty.
It reads a XML file like this one:

<image w="10" h="10">
<frame>
	<layer w="10" h="10" x="0" y="0" opacity="100">
		<line x1="1" y1="1" x2="5" y2="5" color="#FF33FF" opacity="100" />
	</layer>
	<layer w="10" h="10" x="0" y="0" opacity="50">
		<line x1="5" y1="5" x2="10" y2="10" color="#FFFFFF" opacity="100" />
	</layer>
	</frame>
</image>

and turn it into a image.
Here is the output:
Imarty

The system is quite easy.
1. Read the XML
2. Break down into frames
3. Break down into layers
4. Do operation to layers, all operations are plug-ins(but it comes with a Imarty standard drawing Library)
5. Combine layers into individual frame(image)
6. Merge frames into gif animation (does not work now)

I have uploaded the first alpha release, it have many flaws, for instance:
1. There are no validation module present
2. The standard drawing library can only draw lines
3. Too many type casting
4. Plugin system can only use methods from the imarty standard drawing library

You can find it on my Imarty SVN here.
and I quite want to know..
is it possible for anyone to read my code though SVN in google code? or I have to assign members first?

Syndicate content
Honey Pot that kill bots