1. Home Page
  2. Documentation
  3. Templates

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

Display the title of the resource.

pxResPath

pxResPath( $type )

Parameters

Display the path to the resource.

pxResDescription

pxResDescription( $s, $limit )

Parameters

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

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

Display the author public email if available.

pxResDateModification

pxResDateModification( $dateformat )

Parameters

Display the modification date of the resource.

pxResSearchScore

pxResSearchScore( $s )

Parameters

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

Get the list of last resources and put them in $last Must be run before using the $last loop

pxLastResTitle

pxLastResTitle( $s )

Parameters

Display the title of the resource.

pxLastResPath

pxLastResPath( $type )

Parameters

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

Display the author public email if available.

pxLastResDateModification

pxLastResDateModification( $dateformat )

Parameters

Display the modification date of the resource.

pxLastResAssociatedLink

pxLastResAssociatedLink( $s )

Parameters

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

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.

Back to the top of the page