SDK
[ class tree: SDK ] [ index: SDK ] [ all elements ]

Procedural File: common_func.php

Source Location: /common_func.php



Page Details:

Description : This file contains all the main functions of the MesDiscussions.net forum.

To use those functions, just add in your php file :

include "include/initialize.php";

include "include/common_func.php";

You have access to a list of usefull variables :

http://www.mesdiscussions.net/doc/sdk/html/ch02.html#lesvariablesimportantesfourniesparinitialize




Includes:

include(include_path.'common_internal_func.php') [line 45]






md_activate_mail [line 3674]

bool md_activate_mail( string $current_forum, bool $use_current_db, int $topic_id, int $cat, int $idu, resource $dbhr, resource $dbhw)

Description : Activate the mail notification for the given user and topic



Tags:

return:  // return true if the notification status has been changed


Parameters

string   $current_forum   // db name of the forum
bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
int   $topic_id   // topic id
int   $cat   // id cat
int   $idu   // id user
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_activate_mail_private [line 3700]

bool md_activate_mail_private( int $topic_id, int $idu, resource $dbhr, resource $dbhw)

Description : Activate the mail notification for the given user and private topic



Tags:

return:  // return true if the notification status has been changed


Parameters

int   $topic_id   // topic id
int   $idu   // user id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_add_post [line 4854]

int md_add_post( bool $use_current_db, string $current_forum, int $idsite, int $cat, int $topic_id, int $MsgIcon, string $safe_content, string $safe_pseudo, int $id, bool $signature, string $remote, string $current_ip, bool $apriori, resource $dbhr, resource $dbhw, [ $subcat = 0])

Description : Add a post inside a topic



Tags:

return:  // id of the added post


Parameters

bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
string   $current_forum   // db name of the forum
int   $idsite   // forum id
int   $cat   // cat id
int   $topic_id   // topic id
int   $MsgIcon   // icon #
string   $safe_content   // text of the post (need to be passed through md_mysqlw_real_escape_string)
string   $safe_pseudo   // name of the author (need to be passed through md_mysqlw_real_escape_string)
int   $id   // id_pseudo
bool   $signature   // enable the signature display
string   $remote   // ip 1
string   $current_ip   // ip 2
bool   $apriori   // if set to 1, insert the posts in the queue of posts to be validated apriori
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
   $subcat  
[ Top ]



md_add_starpoint [line 407]

void md_add_starpoint( int $id_user, int $nb_point, int $ponderation, resource $dbhr, resource $dbhw)

Description : Add point for the star system



Parameters

int   $id_user   // user id
int   $nb_point   // number of point
  • + 30p for a topic creation
  • + 10p for a small post
  • + 20p for a big post
  • - 40p for each SMS detection
int   $ponderation   // number of day of registration. Pass NULL if no ponderation is needed.
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_add_topic [line 559]

array md_add_topic( bool $use_current_db, string $current_forum, int $id_forum, int $cat, int $subcat, int $sticky, string $subject, string $content, array $poll, int $MsgIcon, int $user_id, string $pseudo, date $date, bool $signature, array $toread, string $remote, string $current_ip, int $topicParPage, resource $dbhr, resource $dbhw, [bool $stickyallowed = 0], [bool $apriori = 0], [array $expire = array(0,0,0,0,0)])

Description : Create a topic (do not use for a private message)



Tags:

return:  // return array($topic_id, $post_id)


Parameters

bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
string   $current_forum   // db name of the forum
int   $id_forum   // id of the forum
int   $cat   // cat number
int   $subcat   // subcat number
int   $sticky   // set to 1 to create as sticky
string   $subject   // title of the topic (needs to be protected by md_mysqlw_real_escape_string)
string   $content   // content of the topic (needs to be protected by md_mysqlw_real_escape_string)
array   $poll   // poll answer; 0 => poll title; 1-10 => poll choices; 99 => max number of votes
int   $MsgIcon   // icone associated with the topic
int   $user_id   // id of the user which create the topic
string   $pseudo   // pseudo of the user which create the topic (needs to be protected by md_mysqlw_real_escape_string)
date   $date   // date of creation of the topic
bool   $signature   // activate the signature of the user
array   $toread   // array of topic id (max 5 elements) which could be associated with this topic
string   $remote   // ip of the sender (behind a firewall if any)
string   $current_ip   // ip of the sender
int   $topicParPage   // number of topic per page listed on the topic list.
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
bool   $stickyallowed   // default 0, set to 1 if sticky creation is allowed
bool   $apriori   // default 0, set to 1 if you want to create the topic as a topic to be moderated a priori
array   $expire   // default (0,0,0,0,0), expiration date of a poll (Y,m,d,H,m)
[ Top ]



md_alerter_mp_mail [line 140]

void md_alerter_mp_mail( bool $mp, string $to, string $replyto, string $title, string $content, int $id_author, string $author, int $id_recipient, string $recipient, string $remote, string $current_ip, resource $dbhw, [bool $skip_author = 0])

Description : Send either an email or a Private Message to inform a user an action has occured.



Parameters

bool   $mp   // if set to 1, contact by PM, otherwise contact by mail
string   $to   // email of the recipient
string   $replyto   // email of the sender
string   $title   // title of the mail / PM
string   $content   // content of the mail / PM
int   $id_author   // id of the sender
string   $author   // name of the sender
int   $id_recipient   // id of the recipient
string   $recipient   // name of the recipient
string   $remote   // ip of the sender (behind a firewall if any)
string   $current_ip   // ip of the sender
resource   $dbhw   // db link for master servers
bool   $skip_author   // if set to 1, do not send a PM to the sender
[ Top ]



md_aposteriori_nb_delete [line 4698]

int md_aposteriori_nb_delete( int $id_author, bool $use_current_db, date $begin, date $end, resource $dbhr, resource $dbhw)

Description : Get the number of deleted 'aposteriori' posts by a given moderator between given dates



Tags:

return:  // nb of deleted 'aposteriori' posts


Parameters

int   $id_author   // moderator id
bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
date   $begin   // begin date (YYYY-MM-DD)
date   $end   // end date (YYYY-MM-DD)
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_aposteriori_nb_edited [line 4725]

int md_aposteriori_nb_edited( int $id_author, bool $use_current_db, date $begin, date $end, resource $dbhr, resource $dbhw)

Description : Get the number of edited 'aposteriori' posts by a given moderator between given dates



Tags:

return:  // nb of deleted 'aposteriori' posts


Parameters

int   $id_author   // moderator id
bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
date   $begin   // begin date (YYYY-MM-DD)
date   $end   // end date (YYYY-MM-DD)
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_apriori_nb_delete [line 4613]

int md_apriori_nb_delete( int $id_author, bool $use_current_db, date $begin, date $end, resource $dbhr, resource $dbhw)

Description : Get the number of deleted 'apriori' posts by a given moderator between given dates



Tags:

return:  // nb of deleted 'apriori' posts


Parameters

int   $id_author   // moderator id
bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
date   $begin   // begin date (YYYY-MM-DD)
date   $end   // end date (YYYY-MM-DD)
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_apriori_nb_messages [line 4639]

int md_apriori_nb_messages( bool $use_current_db, date $begin, date $end, resource $dbhr, resource $dbhw)

Description : Get the total number of 'apriori' posts between given dates



Tags:

return:  // nb of 'apriori' posts


Parameters

bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
date   $begin   // begin date (YYYY-MM-DD)
date   $end   // end date (YYYY-MM-DD)
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_apriori_nb_publie [line 4586]

int md_apriori_nb_publie( int $id_author, bool $use_current_db, date $begin, date $end, resource $dbhr, resource $dbhw)

Description : Get the number of 'apriori' posts published by a given moderator between given dates



Tags:

return:  // nb of 'apriori' posts published


Parameters

int   $id_author   // moderator id
bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
date   $begin   // begin date (YYYY-MM-DD)
date   $end   // end date (YYYY-MM-DD)
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_auto_marking_as_old [line 1400]

void md_auto_marking_as_old( string $current_forum, int $id_cat, int $user_id, int $user_delay, bool $use_current_db, date $date, resource $dbhr, resource $dbhw)

Description : Automatically mark topics as old if the delay specified after the last marking is reached



Parameters

string   $current_forum   // db name of the forum
int   $id_cat   // cat number
int   $user_id   // check topics of the given user_id
int   $user_delay   // number of hour between the last check
bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
date   $date   // current date in the user timezone
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_casier_judiciaire [line 1185]

void md_casier_judiciaire( bool $use_current_db, string $current_forum, int $user_id, int $ban, int $cat, date $dateban, resource $dbhw)

Description : Insert a sanction into the moderation log



Parameters

bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
string   $current_forum   // db name of the forum
int   $user_id   // id of the user to punish
int   $ban   // sanction type :
  • 1 => teletubbies
  • 2 => ban
  • 3 => images forbidden
  • 4 => signature forbidden
  • 5 => smilies forbidden
  • 6 => blabla
int   $cat   // cat number
date   $dateban   // date of the sanction
resource   $dbhw   // db link for master servers
[ Top ]



md_check_allow_search_on_all_forum [line 3395]

bool md_check_allow_search_on_all_forum( resource $dbhr, resource $dbhw)

Description : Check if the search is allowed on the whole board



Tags:

return:  // return 1 if the search is allowed


Parameters

resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_check_apriori [line 3025]

bool md_check_apriori( string $current_forum, bool $use_current_db, resource $dbhr, resource $dbhw)

Description : Check if the apriori moderation is activated in one cat of the given forum



Tags:

return:  // return 1 if the apriori moderation is activated


Parameters

string   $current_forum   // db name of the forum
bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_check_charte [line 1741]

bool md_check_charte( int $id_site, resource $dbhr, resource $dbhw)

Description : Check if the charter should be displayed for the given forum



Tags:

return:  // 1 => display, 0 otherwise


Parameters

int   $id_site   // forum id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_check_closed_board [line 2712]

bool md_check_closed_board( bool $up, int $stat, string $text)

Description : Display the given text if the forum is closed



Tags:

return:  // return 1 if closed, 0 otherwise


Parameters

bool   $up   // set to 0 if the forum is closed
int   $stat   // status of the user
string   $text   // text to be displayed if the board is closed
[ Top ]



md_check_display_stats_on_home [line 3130]

bool md_check_display_stats_on_home( int $id_site, resource $dbhr, resource $dbhw)

Description : Check if the stats should be displayed on the current forum



Tags:

return:  // return 1 if the stats should be displayed


Parameters

int   $id_site   // id of the forum
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_check_edit_right [line 4751]

bool md_check_edit_right( bool $use_current_db, string $current_forum, int $cat, int $post_id, resource $dbhr)

Description : Check if the owner of a given post has the proper right to edit it



Tags:

return:  // return 1 if the user has the right


Parameters

bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
string   $current_forum   // db name of the forum
int   $cat   // cat id
int   $post_id   // post id
resource   $dbhr   // db link for slave servers (if any)
[ Top ]



md_check_identification [line 1562]

array md_check_identification( resource $dbhr, resource $dbhw, [int $get_nb_mp = '0'])

Description : Check the user identification is correct from COOKIE user and passs



Tags:

return:  // array(int user_id, int new_pm_numbers)


Parameters

resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
int   $get_nb_mp   // default 0 ; if set to 1, return the number of new PMs
[ Top ]



md_check_keyword_notification [line 192]

void md_check_keyword_notification( int $cat, int $topic_id, string $forum_rewritten_name, string $subject, int $id_author, string $author, string $path1, string $dir_install, bool $modrewrite, bool $default, string $categorie, string $forum_name, &$parsed_string_array, string $remote, resource $dbhw, resource $dbhr, [ $subcat = 0], [ $souscategorie = ''], string $email_sender, array $parsed_string_array)

Description : send an email / PM if an user want to be warned when a keyword appears in a topic title



Parameters

int   $cat   // current cat number
int   $topic_id   // topic id
string   $forum_rewritten_name   // rewritten name of the forum
string   $subject   // title of the mail / PM
int   $id_author   // id of the sender
string   $author   // name of the sender
string   $path1   // domaine name of the forum
string   $dir_install   // subdirectory where the forum is install (empty string if install at the root of the domaine name)
bool   $modrewrite   // set to 1 to use rewritten url
bool   $default   // set to 1 if the current forum is the default one
string   $categorie   // categorie name
string   $forum_name   // name of the current forum
string   $email_sender   // email of the sender
array   $parsed_string_array   // array of keyword part of the topic title
string   $remote   // ip of the sender (behind a firewall if any)
resource   $dbhw   // db link for master servers
resource   $dbhr   // db link for slave servers (if any)
   &$parsed_string_array  
   $subcat  
   $souscategorie  
[ Top ]



md_check_modo_right [line 1140]

bool md_check_modo_right( bool $use_current_db, string $current_forum, int $user_id, int $ban, int $cat, string $user, int $stat, resource $dbhr)

Description : Check if the current moderator has enough right to punish a give user



Tags:

return:  // 1 enough right, 0 otherwise


Parameters

bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
string   $current_forum   // db name of the forum
int   $user_id   // id of the user to punish
int   $ban   // sanction type :
  • 1 => teletubbies
  • 2 => ban
  • 3 => images forbidden
  • 4 => signature forbidden
  • 5 => smilies forbidden
  • 6 => blabla
int   $cat   // cat number
string   $user   // moderator name
int   $stat   // status of the moderator (
  • 1 => modo
  • 2 => admin
  • 3 => supadmin
  • 4 => god assistant
  • 5 => god)
resource   $dbhr   // db link for slave servers (if any)
[ Top ]



md_check_moved_topic [line 4331]

array md_check_moved_topic( int $idsite, int $cat, $post, resource $dbhr, resource $dbhw, int $topic_id)

Description : Check if the topic id has been moved



Tags:

return:  // (moved forum id, moved cat id, moved post id)


Parameters

int   $idsite   // current id of site
int   $cat   // current cat number
int   $topic_id   // topic id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
   $post  
[ Top ]



md_check_mp_right [line 3559]

int md_check_mp_right( int $id, int $topic_id, resource $dbhr, resource $dbhw)

Description : Check if the user has the right to read a private message



Tags:

return:  // return the max post_id of the given topic if ok, display a message and exit otherwise


Parameters

int   $id   // user id
int   $topic_id   // topic id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_check_mp_user_ignored [line 3583]

int md_check_mp_user_ignored( int $id, int $topic_id, resource $dbhr, resource $dbhw)

Description : Check if a user on the given topic is part of the ignore list of another user



Tags:

return:  // return the ignored id, if it exists, 0 otherwise


Parameters

int   $id   // user id
int   $topic_id   // topic id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_check_multi [line 425]

void md_check_multi( int $idu, int $id, resource $dbhr, resource $dbhw)

Description : Link together (multipseudo) the two given ids



Parameters

int   $idu   // id user 1
int   $id   // id user 2
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_check_poll_participation [line 2546]

bool md_check_poll_participation( string $current_forum, bool $use_current_db, int $cat, int $topic_id, int $iduser, resource $dbhr, resource $dbhw)

Description : Check if the given user has already participated to the given poll



Tags:

return:  // 1 if he has already participated in


Parameters

string   $current_forum   // db name of the forum
bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
int   $cat   // current cat number
int   $topic_id   // topic id
int   $iduser   // pseudo id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_check_right_and_get_mp_infos [line 3650]

array md_check_right_and_get_mp_infos( int $id, int $topic_id, resource $dbhr, resource $dbhw)

Description : Return mp infos and check access



Tags:

return:  // ($recipient,$author,$date,$title,$open,$nbrep,$max_post_id)


Parameters

int   $id   // user id
int   $topic_id   // topic id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_check_subcat [line 5187]

bool md_check_subcat( string $current_forum, int $subcat, bool $use_current_db, resource $dbhr, resource $dbhw)

Description : Check if a subcat exists in the current forum



Tags:

return:  // return true if the subcat exists


Parameters

string   $current_forum   // db name of the forum
int   $subcat   // subcat id
bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_check_topic_has_vip [line 4116]

bool md_check_topic_has_vip( string $current_forum, bool $use_current_db, int $cat, int $topic_id, resource $dbhr, resource $dbhw)

Description : Check if a topic contains VIP posts



Tags:

return:  // return 1 if it contains VIP posts


Parameters

string   $current_forum   // db name of the forum
bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
int   $cat   // current cat number
int   $topic_id   // topic id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_check_vip [line 3169]

bool md_check_vip( int $idu, int $target_cat, bool $use_current_db, string $forum_name, resource $dbhr, resource $dbhw)

Description : Check if the given user is allowed to enter into a VIP cat



Tags:

return:  // return 1 if access if granted


Parameters

int   $idu   // user id
int   $target_cat   // vip cat id
bool   $use_current_db   // change the current db to forum_$forum_name if set to 0
string   $forum_name   // db name of the forum
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_check_vip_exist [line 3190]

bool md_check_vip_exist( int $target_cat, bool $use_current_db, string $forum_name, resource $dbhr, resource $dbhw)

Description : Check if the given cat is restricted to VIP members



Tags:

return:  // return 1 if it's restricted to VIP


Parameters

int   $target_cat   // cat id
bool   $use_current_db   // change the current db to forum_$forum_name if set to 0
string   $forum_name   // db name of the forum
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_check_wysiwyg [line 1697]

bool md_check_wysiwyg( int $idu, resource $dbhr, resource $dbhw)

Description : Check if the wysiwyg is allowed for the given user



Tags:

return:  // 1 => allowed, 0 otherwise


Parameters

int   $idu   // user id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_close_poll [line 237]

void md_close_poll( bool $use_current_db, string $current_forum, int $cat, int $topic_id, resource $dbhr, resource $dbhw)

Description : Close the poll associated with the given topic id



Parameters

bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
string   $current_forum   // db name of the forum
int   $cat   // current cat number
int   $topic_id   // topic id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_convert_numreponse_to_offset [line 4181]

int md_convert_numreponse_to_offset( bool $use_current_db, string $current_forum, int $cat, int $numreponse, int $topic_id, resource $dbhr, resource $dbhw)

Description : Convert a post_id to an offset



Tags:

return:  // return the offset


Parameters

bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
string   $current_forum   // db name of the forum
int   $cat   // current cat number
int   $numreponse   // post id
int   $topic_id   // topic id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_convert_offset_to_numreponse [line 4209]

int md_convert_offset_to_numreponse( bool $use_current_db, string $current_forum, int $cat, int $offset, int $topic_id, resource $dbhr, resource $dbhw)

Description : Convert an offset to a post_id



Tags:

return:  // return the post id


Parameters

bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
string   $current_forum   // db name of the forum
int   $cat   // current cat number
int   $offset   // the post offset
int   $topic_id   // topic id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_count_alerts [line 5046]

int md_count_alerts( bool $use_current_db, string $current_forum, int $id_cat, int $status, resource $dbhr, resource $dbhw, bool $is_admin)

Description : Get the number of alerts of a given status



Tags:

return:  // nb of pending alerts


Parameters

bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
string   $current_forum   // db name of the forum
int   $id_cat   // cat id
int   $status   // count the number of alerts with this status (0 : pending; 1 : in progress; 2 : done; NULL : all)
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
bool   $is_admin   // set to 1 if the user is admin
[ Top ]



md_count_multi [line 2581]

int md_count_multi( int $idu, resource $dbhr, resource $dbhw)

Description : Get the number of multi a pseudo have



Tags:

return:  // nbr of multi


Parameters

int   $idu   // pseudo id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_count_online [line 1538]

int md_count_online( resource $dbhr, resource $dbhw, [int $id_forum = '0'])

Description : Count the number of online user



Tags:

return:  // the number of online user


Parameters

resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
int   $id_forum   // default 0 : count the user on all the forums; if != 0, count the user on the given forum
[ Top ]



md_count_posts_to_check [line 4925]

int md_count_posts_to_check( bool $use_current_db, string $current_forum, int $cat, bool $apriori, resource $dbhr, resource $dbhw)

Description : Get the number of posts to be validated by the moderation



Tags:

return:  // nb of posts to be validated


Parameters

bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
string   $current_forum   // db name of the forum
int   $cat   // cat id
bool   $apriori   // if set to 1, count the nb of posts to be validated apriori
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_count_private_thread [line 3519]

int md_count_private_thread( int $topic_id, resource $dbhr, resource $dbhw)

Description : Return the number of posts of the given topic id



Tags:

return:  // number of posts


Parameters

int   $topic_id   // topic id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_count_private_topic [line 3483]

int md_count_private_topic( int $idu, bool $lu, bool $nonlu, resource $dbhr, resource $dbhw)

Description : Count the number of private topic of a kind of type



Tags:

return:  // number of posts


Parameters

int   $idu   // user id
bool   $lu   // if set to 1, return the number of read private messages
bool   $nonlu   // if set to 1, return the number of not read private messages
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_count_topics [line 3938]

int md_count_topics( int $subcat, bool $poll, string $current_forum, bool $use_current_db, int $cat, resource $dbhr, resource $dbhw, [int $index_of_first_topic = 20], [int $topicParPage = 1], [ $subcat_group = 0])

Description : Count the total number of topics into a cat/subcat (if current page < 15, is only an estimation)



Tags:

return:  // nb_topics


Parameters

int   $subcat   // return the topics from this subcat; set to NULL for no subcat filter
bool   $poll   // only return poll if set to true
string   $current_forum   // db name of the forum
bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
int   $cat   // current cat number
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
int   $index_of_first_topic   // offset of topic start
int   $topicParPage   // number of topic per page
   $subcat_group  
[ Top ]



md_count_topics_in_trash [line 3794]

int md_count_topics_in_trash( string $current_forum, bool $use_current_db, int $cat, bool $use_found_rows, bool $poll, resource $dbhr, resource $dbhw)

Description : Count the total number of topics into the trash of a cat/subcat (if $use_found_rows is set to false, is only an estimation)



Tags:

return:  // nb_topics


Parameters

string   $current_forum   // db name of the forum
bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
int   $cat   // current cat number
bool   $use_found_rows   // set to 1 if md_get_topics_in_trash has been called just before this function
bool   $poll   // only return poll if set to true
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_delete_mp [line 3534]

void md_delete_mp( int $idu, int $topic_id, resource $dbhr, resource $dbhw)

Description : Delete the reference to the given private message for the given user



Parameters

int   $idu   // user id
int   $topic_id   // topic id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_detect_sms_fr [line 685]

array md_detect_sms_fr( string $text)

Description : Detect if the given text is written in SMS style [fr only]



Tags:

return:  // return array(int sms_score)


Parameters

string   $text   // text to be analyzed
[ Top ]



md_display_mp_link [line 4798]

string md_display_mp_link( bool $modrewrite, string $forum_rewritten_name_origine, bool $defaut, int $postParPage, int $cat, int $id, resource $dbhr, resource $dbhw)

Description : Return the HTML code which displays the new MP notification



Tags:

return:  // HTML code


Parameters

bool   $modrewrite   // set to 1 to activate the modrewrite code
string   $forum_rewritten_name_origine   // rewritten name of the forum
bool   $defaut   // set to 1 if it's the default forum
int   $postParPage   // number of post per page
int   $cat   // cat id
int   $id   // user id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_display_superadmin [line 2993]

string md_display_superadmin( bool $modrewrite, string $current_forum, bool $default, resource $dbhr, resource $dbhw)

Description : Return the supadmin list with the proper links



Tags:

return:  // supadmin list (HTML)


Parameters

bool   $modrewrite   // set to 1 to activate the modrewrite
string   $current_forum   // db name of the forum
bool   $default   // set to 1 if it's the default forum
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_forbidden_word [line 4546]

string md_forbidden_word( string $content, string $current_forum, bool $use_current_db, resource $dbhr, resource $dbhw)

Description : Update the given string according to the forbidden rules set



Tags:

return:  // updated string


Parameters

string   $content   // input string
string   $current_forum   // db name of the forum
bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_forum_sig_must_validate [line 3080]

booleen md_forum_sig_must_validate( $idforum, resource $dbhr, int $id_site)

Description : Return if the forum want validate signature



Tags:

return:  // 0 = non / 1 = Yes


Parameters

int   $id_site   // id of the forum; set to NULL if you want the list for all the forums
resource   $dbhr   // db link for slave servers (if any)
   $idforum  
[ Top ]



md_get_awaiting_pictures [line 3044]

int md_get_awaiting_pictures( int $id_site, resource $dbhr, resource $dbhw)

Description : Return the number of pictures which should be validated



Tags:

return:  // number of waiting pictures


Parameters

int   $id_site   // id of the forum; set to NULL if you want the list for all the forums
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_get_awaiting_registration [line 3112]

int md_get_awaiting_registration( int $id_site, resource $dbhr, resource $dbhw)

Description : Return the number of registrations which should be validated



Tags:

return:  // number of waiting registrations


Parameters

int   $id_site   // id of the forum; set to NULL if you want the list for all the forums
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_get_awaiting_signature [line 3062]

int md_get_awaiting_signature( int $id_site, resource $dbhr, resource $dbhw)

Description : Return the number of signature which should be validated



Tags:

return:  // number of waiting signature


Parameters

int   $id_site   // id of the forum; set to NULL if you want the list for all the forums
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_get_awaiting_smilies [line 3094]

int md_get_awaiting_smilies( int $id_site, resource $dbhr, resource $dbhw)

Description : Return the number of smileys which should be validated



Tags:

return:  // number of waiting smileys


Parameters

int   $id_site   // id of the forum; set to NULL if you want the list for all the forums
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_get_cat_moderateur [line 5109]

resource md_get_cat_moderateur( string $current_forum, string $user, bool $use_current_db, resource $dbhr, resource $dbhw)

Description : Return the list of cat of the given forum where the user is moderator



Tags:

return:  // use md_mysqlw_fetch_row/md_mysqlw_fetch_array to get the results list


Parameters

string   $current_forum   // db name of the forum
string   $user   // user name (should be protected by md_mysqlw_real_escape_string)
bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_get_cat_name [line 4993]

string md_get_cat_name( bool $use_current_db, int $id_forum, int $id_cat, resource $dbhr, resource $dbhw)

Description : Get the cat name associated with the given id_forum and id_cat



Tags:

return:  // name of the cat


Parameters

bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
int   $id_forum   // forum id
int   $id_cat   // cat id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_get_cat_status [line 3148]

void md_get_cat_status( bool $use_current_db, string $current_forum_origine, int $numero, &$locke, &$visible, resource $dbhr, resource $dbhw, bool $locke, bool $visible)

Description : Check if the given cat is locked or visible



Parameters

bool   $use_current_db   // change the current db to forum_$current_forum_origine if set to 0
string   $current_forum_origine   // db name of the forum
int   $numero   // cat number
bool   $locke   // return 0 if the cat is locked, 1 otherwise
bool   $visible   // return 0 if the cat is not visible, 1 otherwise
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
   &$locke  
   &$visible  
[ Top ]



md_get_count_private_unread [line 2678]

int md_get_count_private_unread( int $idu, resource $dbhr, resource $dbhw)

Description : Return the number of unread private topic for the given user id



Tags:

return:  // number of unread topic


Parameters

int   $idu   // user id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_get_custom_endmail [line 5221]

string md_get_custom_endmail( int $idsite, resource $dbhr)

Description : Get customized email's end



Tags:

return:  // Get customized email's end


Parameters

int   $idsite   // actual forum id (if any)
resource   $dbhr   // db link for slave servers (if any)
[ Top ]



md_get_email_separator [line 5249]

string md_get_email_separator( nothing 0)

Description : Get separator for multiformat email



Tags:

return:  // Text for mail


Parameters

nothing   0  
[ Top ]



md_get_firstpost_view [line 27]

string md_get_firstpost_view( bool $use_current_db, string $current_forum, string $cat, int $topic_id, int $num_char, resource $dbhr, resource $dbhw)

Description : Get the x firsts chars of the first message in the topic



Tags:

return:  // firsts chars


Parameters

bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
string   $current_forum   // db name of the forum
string   $cat   // current cat number (either an integer or 'prive' for private message)
int   $topic_id   // topic id
int   $num_char   // number of chars to get
resource   $dbhw   // db link for master servers
resource   $dbhr   // db link for slave servers (if any)
[ Top ]



md_get_flag_info [line 3998]

string md_get_flag_info( &$list_topic, &$array_numrep, &$array_position, &$array_owntopic, string $current_forum, bool $use_current_db, int $cat, int $idu, int $owntopic, resource $dbhr, resource $dbhw, string $list_topic, array $array_numrep, array $array_position, array $array_owntopic)

Description : Get the list of topics with flags



Tags:

return:  // message to print if $list_topic is empty


Parameters

string   $list_topic   // return the list of read/participated in/borkmarked post_ids separated by a comma
array   $array_numrep   // latest read post_id associated with each topic id
array   $array_position   // offset of the latest read post_id associated with each topic id
array   $array_owntopic   // status of each topic id (0 => read, 1 => participated in, 3 => bookmarked)
string   $current_forum   // db name of the forum
bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
int   $cat   // current cat number
int   $idu   // id user; use to get the flag info associated to a topic
int   $owntopic   // set to the type of topics which should be returned (1 => participated in + bookmarked, 2 => read, 3 => bookmarked only)
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
   &$list_topic  
   &$array_numrep  
   &$array_position  
   &$array_owntopic  
[ Top ]



md_get_flag_user [line 2452]

array md_get_flag_user( string $current_forum, bool $use_current_db, int $cat, int $idu, int $topic_id, resource $dbhr, resource $dbhw)

Description : Return the latest read post_id and the read status for a given topic_id and user



Tags:

return:  // array($post_id,$read_status (0 => read, 1 => participated in, 3 => bookmark)


Parameters

string   $current_forum   // db name of the forum
bool   $use_current_db   // change the current db to forum_$current_forum if set to 0
int   $cat   // current cat number
int   $idu   // user id
int   $topic_id   // topic id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
[ Top ]



md_get_flood_param_message [line 1276]

void md_get_flood_param_message( int $id_site, resource $dbhr, resource $dbhw, &$flood_message_nb, &$flood_message_time, &$flood_lastmessage_nb, &$flood_lastmessage_nb2, &$flood_lastmessage_time, int $flood_message_nb, int $flood_message_time, int $flood_lastmessage_nb, int $flood_lastmessage_nb2, int $flood_lastmessage_time)

Description : Insert a sanction into the moderation log



Parameters

int   $id_site   // forum id
resource   $dbhr   // db link for slave servers (if any)
resource   $dbhw   // db link for master servers
int   $flood_message_nb   // return the number of allowed subsequent posts
int   $flood_message_time   // return the time needed between two posts
int   $flood_lastmessage_nb   // return the number of topics taken into account to test the last author
int   $flood_lastmessage_nb2   // return the number of allowed topics with the same last author within the number of topic of $flood_lastmessage_nb
int   $flood_lastmessage_time   // return the time needed after an antiflood of last author type has been triggered