Public Method Details |
Resource |
|
public void Resource( )
|
| |
Constructor without arguments.
|
| Returns |
void |
|
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. |
|
viewResource |
|
public string viewResource( int $res_id )
|
| |
Preview the item selected.
|
| Parameter |
|
| int |
$res_id |
|
|
the id of the item |
|
| Returns |
string the HTML for the item |
|
viewShort |
|
public string viewShort( integer $res_id )
|
| |
Abreviated view of the resource (eg the title)
|
| Parameter |
|
| integer |
$res_id |
|
|
the id of the item |
|
| Returns |
string the short view, HTML-escaped. |
|
checkResource |
|
public mixed checkResource( integer $res_id )
|
| |
Checks wether the item selected is "commentable"
|
| Parameter |
|
| integer |
$res_id |
|
|
the ID of the item |
|
| Returns |
mixed a string (an error message) if the item is not to be commented, NULL otherwise. |
|
getTopicUrl |
|
public string getTopicUrl( integer $res_id, [ integer $absolute, integer $score, mixed $order, integer $theme ] )
|
| |
Returns the URL where the comment can be found
|
| Parameter |
|
| integer |
$res_id |
|
|
the ID of resource viewed |
|
|
| integer |
$absolute |
= >>1<< |
|
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. |
|