Very lightweight PHP Templating system





ranking Sort Sort   |   date Sort Sort   |   member Sort Sort
Syndication

« Previous 1 2 3 4 5 6 7 8 9  ...  13 14 Next »
0
Date Submitted Fri. Nov. 28th, 2008 3:12 AM
Revision 1
Beginner RB
Tags PHP | xoops
Comments 0 comments
auto create and check token with different xoops versio
1
Date Submitted Tue. Nov. 4th, 2008 8:32 AM
Revision 1
Beginner cicero
Tags identify | Key | PHP | Random | unique
Comments 1 comments
This php script provides a unique random key with 32 characters and can be used to avoid the system to pass some primary keys across the url, by example.
0
Date Submitted Wed. Oct. 29th, 2008 11:26 AM
Revision 1
Helper Celebhir
Tags Directory | File | PHP | Recursive | search
Comments 0 comments
This function tries to locate a file in a give folder (either single level, or in any sub folder). Returns the relative file and path, or FALSE if not found. Skips over "." and "..".
0
Date Submitted Wed. Oct. 29th, 2008 10:51 AM
Revision 1
Helper Celebhir
Tags Directory | find | Folder | PHP | Recursive | search
Comments 1 comments
This function takes a directory, and a "folder" search parameter.
If it finds the directory (either in single level, or any sub folder) it will return the relative path of that folder. "FALSE" if not found. Skips over files and "." and ".." directories. Recursive by default.
0
Date Submitted Wed. Oct. 29th, 2008 9:21 AM
Revision 1
Helper Celebhir
Tags Directory | Files | PHP | Recursive | structure | tree
Comments 0 comments
Takes a given directory and lists all the files and folders under it, including sub folders. Resulting array contains associative (folders) and indexed (files) elements. Doesn't return "." and ".."
1
Date Submitted Thu. Aug. 28th, 2008 9:33 AM
Revision 1
Scripter Fordiman
Tags buffering | errors | Output | PHP | template
Comments 0 comments
Best use of ob_, custom error handling, and variable variales evar: simple templating.

_parse($filename[,$locals])
includes $filename and renders its output to the return value. $locals, if used, will add a set of variables to the included context.

Parse($template[,$locals])
Same as above, but allows you to define a base template folder and omit the .php - just for cleaner code.

t($template[,$obj])
...
t()
Same as Parse, but any output between the opening call and the closing call (no arguments) will be buffered intot he $content variable of the template.

Play around with t(..) to find out more; I don't feel like documenting it.
2
Date Submitted Wed. Aug. 13th, 2008 11:34 PM
Revision 1
Scripter Fordiman
Tags easy | mysql | PHP
Comments 0 comments
My previous entry on an easy to use SQLite interface for XUL/JS got me thinking: how many times have I had to write functions that were just wrappers for a little SQL?

Below is the fruits of that little query (excuse the pun). Forgive the dbXXX functions; my implementation depended on a small portion of a larger mysql library that I've grown accustomed to coding with.
3
Date Submitted Thu. Mar. 6th, 2008 3:09 AM
Revision 1
Scripter Fordiman
Tags JavaScript | parse_url | PHP
Comments 0 comments
Simple. It's parse_url, from PHP, implemented in Javascript. Seen a lot of similar ones around the web, but they were all bulky code and none of them took advantage of the RegEx parser in JS.

Applied as a member of the String prototype, so just call as myURL.parseURL(); Will return a named object with naming identical to that of PHP's function.

Additional: if first argument is present, will break the querystring up into name/value pairs, unescaped, and return that instead of the raw querystriing.
3
Date Submitted Tue. Nov. 13th, 2007 12:37 PM
Revision 1
Beginner cyberhitesh
Tags Online | PHP | PHP5 | Storage | Unlimited
Comments 0 comments
Software Requirements:

Crypt_HMAC:
http://pear.php.net/package/Crypt_HMAC
HTTP_REQUEST:
http://pear.php.net/package/HTTP_Request
PEAR:
http://pear.php.net/
2
Date Submitted Wed. Nov. 7th, 2007 2:45 PM
Revision 1
Helper Idlemind
Tags PHP
Comments 2 comments
If it's a .php page, you can simply include this file where you want a hit counter to appear.

One file - text output. Very simple, very easy. Based off the filename of the page (creates a pagename.counter file to hold the count).
(No use for it myself - made it for a friend).
« Previous 1 2 3 4 5 6 7 8 9  ...  13 14 Next »