Public Method Details |
Comments |
public void Comments( [ mixed $w ] )
|
|
Constructor
|
Parameter |
|
mixed |
$w |
= >>""<< |
|
if not empty, bypasses intitialization |
|
Returns |
void |
|
init |
public integer init( [ integer $res_id, integer $com_id, integer $res_type ] )
|
|
Will be used to preload few things ...
|
Parameter |
|
integer |
$res_id |
= >>0<< |
|
ID of the ressource to which the comments are attached |
|
|
integer |
$com_id |
= >>0<< |
|
ID of the only comment to get. |
|
|
integer |
$res_type |
= >>1<< |
|
the type of resource commented |
|
Returns |
integer 0 if $new_id is empty. |
|
com_print2 |
public string com_print2( [ integer $comm_id, integer $com_parent, integer $score, string $type ] )
|
|
New function which will print comment, have to be used with init()
Creates the HTML for all the comments, or a subtree, and make coffee
|
Parameter |
|
integer |
$comm_id |
= >>0<< |
|
of the first comment |
|
|
integer |
$com_parent |
= >>0<< |
|
of the parent comment |
|
|
integer |
$score |
= >>0<< |
|
threshold |
|
|
string |
$type |
= >>"thread"<< |
|
(one out of 'thread', 'thread' and thread' :) ) |
|
Returns |
string the HTML for the comments |
|
set_score |
public void set_score( [ string $comments_id_tmp, string $news_id_tmp, string $score_id, string $localuserid ] )
|
|
This function will set the score. This is when you use system 2
FIXME: can someone explain why all these bloody strings
Calls Exit if user cannot vote, or pb with user, or DB problem
|
Parameter |
|
string |
$comments_id_tmp |
= >>""<< |
|
of comment we want to set score |
|
|
string |
$news_id_tmp |
= >>""<< |
|
news Id but whuy a bloody string??? |
|
|
string |
$score_id |
= >>""<< |
|
score to set |
|
|
string |
$localuserid |
= >>""<< |
|
ID |
|
Returns |
void |
|
ac |
public string ac( array $c, integer $res_id, integer $res_type, [ string $mode ] )
|
|
This will display comment
FIXME: public cos used in SubmitComment::preview, but shall it not be private?
|
Parameter |
|
array |
$c |
|
|
the row of the comment, as build by init |
|
|
integer |
$res_id |
|
|
the ressource ID to which it is attached |
|
|
integer |
$res_type |
|
|
the type of the ressource |
|
|
string |
$mode |
= >>"full"<< |
|
"full" to print the comment, "scoredown" to print only the title |
|
Returns |
string the HTML representation of the comments to display |
|
get_hrefs |
public void get_hrefs( )
|
|
This will return all the urls from comments
Works on Comments::com_url array
|
Returns |
void |
|
get_subject |
public string get_subject( integer $id )
|
|
Gets the subject...
FIXME: But why is ID considered a string ?!
|
Parameter |
|
integer |
$id |
|
|
Id of the comment |
|
Returns |
string the subject |
|
mod_score |
public void mod_score( array $row )
|
|
Function to modify score
Calls exit on DB problem
|
Parameter |
|
array |
$row |
|
|
row in comments_scored table |
|
Returns |
void |
|
show_branch |
public string show_branch( integer $res_id, integer $com_id, integer $res_type, [ string $list ] )
|
|
Create the HTML to show all the ancestors of a comment
|
Parameter |
|
integer |
$res_id |
|
|
ID of the resource |
|
|
integer |
$com_id |
|
|
ID of the comment |
|
|
integer |
$res_type |
|
|
type of the resource (see Config::resources) |
|
|
string |
$list |
= >>'all'<< |
|
how the comments are listed (last | all (default)) |
|
Returns |
string the HTML |
|
show_subtree |
public string show_subtree( integer $res_id, integer $res_type, integer $com_id )
|
|
Creates the HTML for the subtree of $com_id (all heirs of $com_id)
|
Parameter |
|
integer |
$res_id |
|
|
of the resource |
|
|
integer |
$res_type |
|
|
of the resource (see Config::resources) |
|
|
integer |
$com_id |
|
|
of the comment |
|
Returns |
string HTML for the subtree |
|
count_comments |
public void count_comments( integer $res_id, [ integer $res_type, string $score ] )
|
|
Returns the number of comments
|
Parameter |
|
integer |
$res_id |
|
|
the ID of the ressource to which the commetns are attached |
|
|
integer |
$res_type |
= >>1<< |
|
the type of the ressource |
|
|
string |
$score |
= >>"-2"<< |
|
the threshold for counting comments. -2 => default. |
|
Returns |
void |
|
count_comments_array |
public array count_comments_array( array $res_id, [ integer $res_type ] )
|
|
Returns the number of comments in an hash array
=> array [$res_id]["s".$score]
|
Parameter |
|
array |
$res_id |
|
|
the ids to which the comments are attached |
|
|
integer |
$res_type |
= >>1<< |
|
the ressource type |
|
Returns |
array |
|
mypost |
public string mypost( [ string $order, string $user_id ] )
|
|
This mypost function is used to get info on yours recents Posts.
Some useful info on your post will be displayed.
And there is a link to the view of each post :
href=comments/thread.php3
|
Parameter |
|
string |
$order |
= >>"id"<< |
|
The order comments should be displayed |
|
|
string |
$user_id |
= >>""<< |
|
The (option) user_id to be displayed |
|
Returns |
string HTML code |
|
numberOfComments |
public void numberOfComments( integer $resId, integer $resType, [ integer $score ] )
|
|
This function determines the number of comments in a human-readable way
(that is, returns n comments, taking care of plural.)
Subsidiary question: this is adapted for most (all?) european laguages. What
happens with arabic, chinese or whatever?
|
Parameter |
|
integer |
$resId |
|
|
ID of the ressource |
|
|
integer |
$resType |
|
|
type of the resource |
|
|
integer |
$score |
= >>-2<< |
|
minimal score for counting comments, -2 to get default score. |
|
Returns |
void |
|