Public Method Details |
Tips |
public void Tips( )
|
|
Constructor
|
Returns |
void |
|
checkResource |
public mixed checkResource( int $tip_id )
|
|
Checks wether the item selected is "commentable"
|
Parameter |
|
int |
$tip_id |
|
|
the ID of the item |
|
Returns |
mixed a string (an error message) if the item is not to be commented, NULL otherwise. |
|
viewResource |
public string viewResource( int $tips_id )
|
|
Preview the item selected.
|
Parameter |
|
int |
$tips_id |
|
|
ID of the tip to display |
|
Returns |
string the HTML for the item |
|
getTopicUrl |
public string getTopicUrl( integer $tip_id, integer $absolute, [ integer $score, mixed $order, integer $theme ] )
|
|
Returns the URL where the tip && comments can be found
|
Parameter |
|
integer |
$tip_id |
|
|
the ID of tip viewed |
|
|
integer |
$absolute |
|
|
URL is absolute or not. |
|
|
integer |
$score |
= >>-2<< |
|
the threshold for displaying comments |
|
|
mixed |
$order |
= >>""<< |
|
TODO |
|
|
integer |
$theme |
= >>0<< |
|
TODO |
|
Returns |
string the URL where to view it. Not HTML-escaped! |
|
loadResources |
public bool loadResources( array $res_ids )
|
|
Preloads some infos about the resources. For optimizatiuon only.
FIXME: maybe other stuff neede here...
Implementation details: shall cache as much info as needed.
Everything needed to produced a 'short view' shall be cached,
plus ids, timpstamps & that kind of stuff.
|
Parameter |
|
array |
$res_ids |
|
|
the list of IDs of the resouces to preload |
|
Returns |
bool true if SQL succeeded, false otherwise. |
|
get_random |
public string get_random( )
|
|
Select a random tip
|
Returns |
string the sidebox with the selected tip. |
|
tips_list |
public string tips_list( integer $nb_tips, string $tip_section, integer $tip_index )
|
|
Creates o list of tips on 2 columns
|
Parameter |
|
integer |
$nb_tips |
|
|
of tips to display |
|
|
string |
$tip_section |
|
|
of to=ips section (an integer) |
|
|
integer |
$tip_index |
|
|
of start of tip list |
|
Returns |
string the list of tips |
|
tips_to_moderate |
public string tips_to_moderate( )
|
|
Creates HTML code for the list of tips to moderate
|
Returns |
string HTML code |
|
show_tips_to_moderate |
public string show_tips_to_moderate( integer $id )
|
|
Creates the moderation form for a tip
|
Parameter |
|
|
Returns |
string the HTML code |
|
do_moderate |
public void do_moderate( array $row )
|
|
Take moderator's choices into account
May call echo on failure, may return a string on failure
|
Parameter |
|
|
Returns |
void |
|
tips_sections |
public string tips_sections( )
|
|
Creates the list of of tips sections
|
Returns |
string |
|
formNewTip |
public void formNewTip( )
|
|
Creates the form to submit a new tip
@retrun string
|
Returns |
void |
|
addNewTip |
public void addNewTip( array $row )
|
|
Add a new tip in DB
calls exit and echo on failure
calls header ot redirect to main page and exits on success
|
Parameter |
|
array |
$row |
|
|
from form submission |
|
Returns |
void |
|