new layout classes
download
- php-aulib.zip (22.7 k)
description
this package is a complete rewrite of my previous layout classes, with the goal that i would be able to use the same classes for all of the sites i work on (to the greatest extent possible). you should actually be able to use these classes without modifying them -- auUser and auPage are intended be extended with site-specific code though. all of the classes in this package are currently used by track7. more extensive documentation can be found in the auWiki under auLib. the classes in this package use some features that were added with php version 5, so if you are running an older version of php you will need to modify these files to avoid errors.
i recommend making a single include file that can be included from every page, and sets up the objects that every page is going to need. here's the relevant code from the include file track7 uses:
<?require_once 'auDB.mysql.php';
$db = new auDB(_DB_USER, _DB_PASS, _DB_HOST, _DB_NAME);
require_once 'auUser.track7.php';
$user = new auUserTrack7($db);
require_once 'auPage.track7.php';
$page = new auPageTrack7($db, $user, $getvars);
$db->SetReport($page);
?>
the _DB_* values are defined to the correct values for my mysql database. auUser.track7.php and auPage.track7.php are the customized user and page classes for track7. they extend auUser and auPage. there are a number of functions in auUser and auPage that should be overridden in a site-specific class, so make sure to look through the documentation or the files themselves.
also included are classes for displaying and validating forms, manipulating text, building rss feeds, and timing code execution.
requirements
the following are required in order for this script package to work as intended. if a website does not meet all of the listed requirements, it is possible that the script can be modified to still work, though possibly with less functionality than intended.
comments / complaints / compliments
|
bs0d
television
|
posted: 8:30:26 pm, feb 10, 2010
I have a question. Can you explain the timer? Why would you want to delay code execution for layouts? Thanks! -bs0d | AllSyntax.com |
|
misterhaan
radar
|
posted: 6:20:35 am, feb 11, 2010
timer is more like a stopwatch or a clock, or even a kitchen timer so i can get the word timer in there :). when you create a timer object it grabs the current time, then you can call functions to see how long it’s been since you created it or since you last checked the time. i use it to get the number for my “generated in ___ milliseconds” message at the bottom left of every page — it’s created before i even connect to the database, then i check it when writing out the page footer. the only thing not included in the time is spitting out my copyright line and the hidden login form. please note that the above post is likely made up in its entirety. |
|
bs0d
television
|
posted: 6:06:37 pm, feb 11, 2010
Hey I love the login! It uses a bit of AJAX coding, right? Now I see what you're taking about and how it can be used. For some reason I was thinking you wanted to delay execution of code. -bs0d | AllSyntax.com |
|
misterhaan
radar
|
posted: 9:03:48 am, feb 12, 2010
yeah it sends the login request asynchronously and gets back an xml result. if the login worked it reloads the current page and if it didn’t it shows you the error with a javascript alert(). i just fixed it to stop saying error saving your vote if you got your password wrong :). please note that the above post is likely made up in its entirety. |

pm
www



