List of loop functions
The $res loop
This loop is available in the categories. It is used to display the last resources of a category. For example:
<?php while (!$res->EOF() ): ?>
<div class="resource">
<h2><a href="<?php pxResPath(); ?>"><?php pxResTitle(); ?></a></h2>
<?php pxResDescription(); ?>
</div>
<?php
$res->moveNext();
endwhile; ?>
pxResTitle
pxResTitle( $s )
Parameters
- $s - Substitution string ('%s')
Display the title of the resource.
pxResPath
pxResPath( $type )
Parameters
- $type - 'full' give path with http:// ('relative')
Display the path to the resource.
pxResDescription
pxResDescription( $s, $limit )
Parameters
- $s - Substitution string ('%s')
- $limit - Number of words (characters for the moment) to limit the description
Display the description of the resource.
If a limit is given, the description is converted into raw text and then the limit is applied.
pxResCategories
pxResCategories( $s, $p1, $p2 )
Parameters
- $s - Substitution string ('%s')
- $p1 - First delimiters (', ')
- $p2 - Last delimiter (' and ')
Display the list of categories in which the ressource is.
The list is not an HTML list, it is to be used as sentence like "Category one, category two and category tree" The category names are linked to the category pages.
pxResAuthor
pxResAuthor( )
Display the name of the author
pxResAuthorEmail
pxResAuthorEmail( $s, $encoding )
Parameters
- $s - Substitution string ('%s')
- $encoding - Encoding for a mailto ('link') or for display 'text'
Display the author public email if available.
pxResDateModification
pxResDateModification( $dateformat )
Parameters
- $dateformat - Format of the date ('%Y-%d-%mT%T+00:00')
Display the modification date of the resource.
pxResSearchScore
pxResSearchScore( $s )
Parameters
- $s - Substitution string ('%01.2f%%')
Display the score of the resource for this research.
To be used only in the search template.
The $last loop
This loop is available in all the templates, you just have to initialize it before use:
<?php pxGetLastResources(); ?>
<?php while (!$last->EOF() ): ?>
<p><a href="<?php pxLastResPath(); ?>"><?php pxLastResTitle(); ?></a></p>
<?php
$last->moveNext();
endwhile; ?>
pxGetLastResources
pxGetLastResources( $limit, $type, $category )
Parameters
- $limit - Number of last resources (5)
- $type - Type of resources ('') for all, 'news' or 'articles'
- $category - Category id ('')
Get the list of last resources and put them in $last Must be run before using the $last loop
pxLastResTitle
pxLastResTitle( $s )
Parameters
- $s - Substitution string ('%s')
Display the title of the resource.
pxLastResPath
pxLastResPath( $type )
Parameters
- $type - If 'full' give path with http:// ('relative')
Display the path to the resource.
pxLastResDescription
pxLastResDescription( )
Display the description of the resource.
pxLastResAuthor
pxLastResAuthor( )
Display the name of the author
pxLastResAuthorEmail
pxLastResAuthorEmail( $s, $encoding )
Parameters
- $s - Substitution string ('%s')
- $encoding - Encoding for a mailto ('link') or for display 'text'
Display the author public email if available.
pxLastResDateModification
pxLastResDateModification( $dateformat )
Parameters
- $dateformat - Format of the date ('%Y-%d-%mT%T+00:00')
Display the modification date of the resource.
pxLastResAssociatedLink
pxLastResAssociatedLink( $s )
Parameters
- $s - Substitution string ('link:%1$s title:%2$s')
Display the associated link and title if available. When getting the last resources, if the 'news' type is chose as link can be associated to news, this is the way to get it back if available.
pxLastResCategories
pxLastResCategories( $s, $p1, $p2 )
Parameters
- $s - Substitution string ('%s')
- $p1 - First delimiters (', ')
- $p2 - Last delimiter (' and ')
Display the list of categories in which the last ressource is.
The list is not an HTML list, it is to be used as sentence like "Category one, category two and category tree" The category names are linked to the category pages.
Share your ideas about this article.


