-
PostNuke Themes Converted to Xanthia
(News)
-
The main features of the Xanthia Templating Environment are as follows:
Based on the popular PHP Smarty template system, XTE allows for the complete abstraction of application logic from content through the use of HTML templates.
XTE replaces placeholders in templates with their actual values, created in the application logic. These placeholders have been created to support popular HTML editors such as Dreamweaver.
Conditionals and loops similar to those in PHP are available to make decisions based on output.
Variable modifiers can change a particular placeholder’s content. For example, transforming a string to all capital letters.
Caching in Xanthia of whole pages is available to reduce server load and greatly improve load times. Configuration caches can also be generated, putting Xanthia theme load times on a par with the ‘Classic’ theme variants and competing products in many situations.
Online administration of a theme can change its look, templates, colours and block positioning.
We encourage theme developers and site administrators to take advantage of Xanthia’s power and flexibility in their own sites, and also submit suggestions and improvements to future versions of Xanthia at the NOC Feature Requests area.
The PostNuke Team
Generated on September 5, 2004.
-
Phoenix Template Rendering Engine Overview
(News)
-
What is a template
rendering engine?
A template rendering engine is the total separation (abstraction) of an
application business logic and rules from the content layer (output HTML, XHTML,
XML, PDF, etc.).
It includes dynamic variable substitutions
(replaces keywords or place holders with content), dynamic block substitutions
(for example the result of a record set from a query, for instance the number
of available news topics on the news index), amazing capabilities to process
unlimited nested loops among many others.
Conditional statements ( [if/elsif/else]
which allow you to make decisions based on user interaction in a easy to understand
way - optional).
The problem here is many template
solutions for PHP are based on regular expressions replacements, which highly
complicated the code and added an immense overhead into the application, this
regular expressions metaphor where hard to extend (and to adjust to taste),
and did not quite provided the complete separation of presentation and logic
(for example, to make rows of a table alternate colors, PHP code had to be adjusted).
Instead of following this route and
live with this and many other drawbacks, Phoenix takes advantage of a revolutionary
concept in template rendering engines, provided by the underlying architecture
of Smarty. The compilation of templates, which combines the speed of execution
of pure PHP code with the ease and simplicity of template syntax.
By using this approach template files
are first converted into PHP scripts before they are executed. This may sound
costly in terms of performance until you consider that this need only be done
when the template file is changed! Once a template file is compiled, they are
stored for later use (and re-use) using a caching mechanism, the end result
being a reduced overall server load. Which can be greatly enhanced (up to 500%)
by the use of PHP optimizing technologies like php-accelerator or the zend optimizer.
The second biggest advantage is extensibility,
this is what really makes it invaluable for programmers and designers a like.
How
does it work?
Basically templates work quite similar to
any ordinary HTML page, it uses template "tags" to distinguish dynamic content
(data provided from the DB for example), from the rest of the template which
is pure HTML. This tags are then automatically replaced with the result of the
requested data set. All template functions are loaded on demand this means that
even though the rendering engine is extensive in its core it will only load
the required code to perform each task.
While working with templates you have
access to a wealth of resources, among them are:
Variable modifiers (allows you to
transform on the fly the properties of your content, i.e. Caps, indentation,
upper, lower, etc)
Configurations files, this allow you
to define settings for colors, width and practically every aspect of the HTML
properties.
A wealth of Built-in functions which
you can extend, like free block/module positioning, forms, automatic clocking
and encoding of email addresses, and many more.
You can easily add and extend with
your own functions the engine by taking advantage of the plugin architecture.
Many new possibilities arise with
the capability of automatic inclusion of static content either local or remote
on the fly.
Caching Mechanisms designed with great
granularity allows you to specify how, when and how often cached content is
to be updated (turning your site as fast as static HTML) and under which conditions.
Advanced
Features:
Prefilters
Are
a set of functions that are run on the templates prior to them being compiled
with the engine. (i.e. removing unwanted comments form them)
PostFilters
This are functions that are executed after the templates have been compiled.
And
could help add valuable data to the whole of your templates if needed on the
fly.
Output Filters
This
feature allows you to apply settings to content while being executed as opposed
to the postfilters which are applied just before saving the compiled template.
Multiple Template sources
Templates
may come from a variety of sources, like file system or the database.
Debugging Tools
Intelligent
debugging console which allows one to trace all items related to any and all
templates used diring the course of a page rendering.
The pnTemplate API
This
(Template Application Programming Interface) provides a set of tools that allow
programmers to harness the full set of combined resources that PostNuke and
Smarty provide.
It follows the pnAPI naming conventions
and style and will become easy to understand and apply for module/block programming,
taking current modules and block to the next level of usability, flexibility
and power.
The Phoenix Administration (system)
Module
Its the front end for all
this power and flexibility, it manages Themes, which are composed of templates,
that in turn have interesting properties like content type (html, xhtml, csv,
rss, pdf), they also belong to a layout, each template in a theme can belong
to a different layout, lets say you create a "dual column" layout and an "art
deco", layout for theme "Postnuke", then you can switch among this with the
click of a mouse, and then apply this system wide, templates also belonge to
specific zones (header, footer, module content, block etc.)
Templates install them selfs
similar to how modules do now, you just drop in the theme, initialize and activate
it and you are done. Same goes for upgrades or removal.
In the Phoenix administration module
you can manage all aspects of the rendering engine, including but not limiting
to all properties that control the behavior of smarty, as well as create, edit,
delete templates and its related itmes online, since you can choose to use file
system templates or db templates or a combination of both, you can directly
upload new sets of templates from your computer.
You have access to CSS and many more
properties and features, the best part of it all is, that you can have the old
themes right along with the next generation and also switch back and forth among
them with ease.
Templates Programming Language
and Active Zones
While working with templates
as mentioned before you can either use the basic template "tags" and normal
HTML or go beyond the choice is yours, the rendering engine provides enough
resources to make your templates intuitive and intelligent accomplishing quite
complex task with great ease, this is done by the use of what we call the "active
zones". Active zones are special place holder areas in your templates that allow
execution of commands from the template rendering language or invocation of
plugins, filters, variable substitution, etc.
This, active zones, are easy to use
and apply and will make your life very simple and productive while customizing
and designing the site of your dreams.
In conclusion the Phoenix Template
Rendering Engine can answer the needs and requirements of both novices and
seasoned developers or graphics designer. And it supports popular HTML editors
like DreamWeaver among others allowing you to use visual tools to enhance your
experience and over-all productivity harnessing all this power in one simple
place.
For reference if you happen to read this before the principal article of this series please read the first part which you will find here:
http://news.postnuke.com/modules.php?op=modload&name=News&file=article&sid=2357
Note: [ For clarification 1st quarter refers to the 1st four (4) months [Jan-Apr] of 2003, thus the goal is to have the 0.8
Generated on February 11, 2003.
-
Modifications to the HTTP Referers
(News)
-
ALTER TABLE nuke_referer ADD count INT not nul
then in the index.php there is a referer section
replace the standard insert with (somewhere around line 120 i think)
$result = mysql_query("select * from $prefix"._referer." where url='$referer'");
if (mysql_num_rows($result) >= "1")
{
while($row=mysql_fetch_array($result))
{
$count = $row["count"];
$new_count = $count + 1;
}
mysql_query("update $prefix"._referer." set count='$new_count' where url='$referer'");
}else{
mysql_query("insert into $prefix"._referer." values (NULL, '$referer')");
}
then in the admin/modules/referer.php look for $hresult = and replace the $hresult and while loop with
$hresult = mysql_query("select rid, url, count from $prefix"._referer."");
echo "idrefererhits";
while(list($rid, $url,$count) = mysql_fetch_row($hresult)) {
echo "$rid"
."$url$count";
}
This should do it.
Matt Jezorek
http://bluelinux.sourceforge.net
Generated on July 20, 2001.
-
New Release -- Last one for a little while!
(News)
-
are working on next are some added features that we are including that are already released either as full tarballs, or as addons.
First, pkellum's advance block hack is going to be examined in the next alpha release, with his permission. We think that this will greatly expand some of the features that are wanted and needed with our little project.
You can see an example here
The other news is, we are integrating the ML-Nuke (Multi Language) Nuke into Post-Nuke. We think this will be a very big advancement with the system, that all of us could really learn to love.
You can see an example here
Seperating out more of the core and the plugins are on our list. A couple of other things that we are looking at right now is re-examining the current module system. There is some area of opportunity there, that we might be able to exploit. We are also redesigning the admin interface as well, and working out some bugs in that system as well. I wouldn't expect to see either of these at the end of the week, but they are on our list.
There is also going to be some improvement to the codebase as well, as we start to look at merging the authors and the users table. And we are getting very close to examining the database structure in general.
I hope this keeps everyone in the loop for some of our short term plans
Generated on July 7, 2001.