pagelib.php

This file is a library of routines that are shared among several pages.  It is in the pages directory rather than the lib directory because the functions here are front-end code, not back-end stuff.  For example, this file contains the shared function for adding a comment form to the page, displaying lists of comments, and handling posted comments and files, and so forth.

Summary
pagelib.phpThis file is a library of routines that are shared among several pages.
Functions
handle_commentHandles comments posted to an entry.
entry_set_templateSets variables in an entry template for display.
blog_set_templateSets template variables for display of a blog.
blog_get_post_dataGet data from the HTTP POST and put it into the blog object.
show_repliesGets the HTML for replies of the given type in a list.

Functions

handle_comment

function handle_comment(&$ent,  
$use_comm_link = false)

Handles comments posted to an entry.  This includes generating the form markup, setting appropriate cookies, and actually inserting the new comments.

Parameters

entThe entry we’re dealing with.
use_comm_linkOptional boolean, defaults to false.  If this is set to true, then the page will be redirected to the comments page after a successful comment post.  If not, then the redirect will be to the entry permalink.

Returns

The markup to be inserted into the page for the comment form.

entry_set_template

function entry_set_template(&$tpl,
&$ent)

Sets variables in an entry template for display.

Parameters

tplThe template to populate.
entthe BlogEntry or Article with which to populate the template.

blog_set_template

function blog_set_template(&$tpl,
&$blog)

Sets template variables for display of a blog.

Parameters

tplThe template to populate.
entthe BlogEntry or Article with which to populate the template.

blog_get_post_data

function blog_get_post_data(&$blog)

Get data from the HTTP POST and put it into the blog object.

Parameters

blogThe blog to populate.

show_replies

function show_replies(&$ent,
&$usr,
&$replies,
$title)

Gets the HTML for replies of the given type in a list.

Parameters

entA reference to the entry for which to get replies.
usrA reference to the current user.
repliesAn array of reply objects.
function handle_comment(&$ent,  
$use_comm_link = false)
Handles comments posted to an entry.
function entry_set_template(&$tpl,
&$ent)
Sets variables in an entry template for display.
function blog_set_template(&$tpl,
&$blog)
Sets template variables for display of a blog.
function blog_get_post_data(&$blog)
Get data from the HTTP POST and put it into the blog object.
function show_replies(&$ent,
&$usr,
&$replies,
$title)
Gets the HTML for replies of the given type in a list.
Close