-// This removes code duplication in other queries - don't call it direct unless you really know what you're up to.
+/**
+ * This handles actually pulling post info. Called from other functions to eliminate duplication.
+ * @param string $query_where The WHERE clause for the query
+ * @param array $query_where_params An array of parameters for the WHERE clause
+ * @param int $query_limit The maximum number of rows to return
+ * @param string $query_order The ORDER BY clause for the query
+ * @param string $output_method The output method. If 'echo', displays the posts, otherwise returns an array of info about them.
+ * @param bool $limit_body If true, will only show the first 384 characters of the post rather than all of it
+ * @param bool|false $override_permissions Whether or not to ignore permissions. If true, will show all posts regardless of whether the user can actually see them
+ * @return void|array Displays the posts or returns an array of info about them, depending on output_method
-// Show a link to the latest member: Please welcome, Someone, out latest member.
+/**
+ * Show a link to the latest member: Please welcome, Someone, our latest member.
+ * @param string $output_method The output method. If 'echo', returns a string with a link to the latest member's profile, otherwise returns an array of info about them.
+ * @return void|array Displays a "welcome" message for the latest member or returns an array of info about them, depending on output_method.
+ */
functionssi_latestMember($output_method='echo')
{
global$txt, $context;
@@ -785,7 +863,12 @@ function ssi_latestMember($output_method = 'echo')
return$context['common_stats']['latest_member'];
}
-// Fetch a random member - if type set to 'day' will only change once a day!
+/**
+ * Fetches a random member.
+ * @param string $random_type If 'day', only fetches a new random member once a day.
+ * @param string $output_method The output method. If 'echo', displays a link to the member's profile, otherwise returns an array of info about them.
+ * @return void|array Displays a link to a random member's profile or returns an array of info about them depending on output_method.
+ * @param array $member_ids The IDs of the members to fetch
+ * @param string $output_method The output method. If 'echo', displays a list of links to the members' profiles, otherwise returns an array of info about them.
+ * @return void|array Displays links to the specified members' profiles or returns an array of info about them, depending on output_method.
+ * @param string $output_method The output method. If 'echo', displays the stats, otherwise returns an array of info about them
+ * @return void|array Doesn't return anything if the user can't view stats. Otherwise either displays the stats or returns an array of info about them, depending on output_method.
+ */
functionssi_boardStats($output_method='echo')
{
global$txt, $scripturl, $modSettings, $smcFunc;
@@ -980,7 +1085,11 @@ function ssi_boardStats($output_method = 'echo')
-// Just like whosOnline except it also logs the online presence.
+/**
+ * Just like whosOnline except it also logs the online presence.
+ * @param string $output_method The output method. If 'echo', displays a list, otherwise returns an array of info about the online users.
+ * @return void|array Either displays a list of online users or returns an aray of info about them, depending on output_method.
+ */
functionssi_logOnline($output_method='echo')
{
writeLog();
@@ -1037,6 +1150,12 @@ function ssi_logOnline($output_method = 'echo')
}
// Shows a login box.
+/**
+ * Shows a login box
+ * @param string $redirect_to The URL to redirect the user to after they login
+ * @param string $output_method The output method. If 'echo' and the user is a guest, displays a login box, otherwise returns whether the user is a guest
+ * @return void|bool Either displays a login box or returns whether the user is a guest, depending on whether the user is logged in and output_method.
+ * @param string $output_method The output method. If 'echo', displays a search box, otherwise returns the URL of the search page.
+ * @return void|string Displays a search box or returns the URL to the search page depending on output_method. If you don't have permission to search, the function won't return anything.
+ */
functionssi_quickSearch($output_method='echo')
{
global$scripturl, $txt, $context;
@@ -1509,7 +1651,11 @@ function ssi_quickSearch($output_method = 'echo')
</form>';
}
-// Show what would be the forum news.
+/**
+ * Show a random forum news item
+ * @param string $output_method The output method. If 'echo', shows the news item, otherwise returns it.
+ * @return void|string Shows or returns a random forum news item, depending on output_method.
+ */
functionssi_news($output_method='echo')
{
global$context;
@@ -1522,7 +1668,11 @@ function ssi_news($output_method = 'echo')
echo$context['random_news_line'];
}
-// Show today's birthdays.
+/**
+ * Show today's birthdays.
+ * @param string $output_method The output method. If 'echo', displays a list of users, otherwise returns an array of info about them.
+ * @return void|array Displays a list of users or returns an array of info about them depending on output_method.
+ * Shows the most recent attachments that the user can see
+ * @param int $num_attachments How many to show
+ * @param array $attachment_ext Only shows attachments with the specified extensions ('jpg', 'gif', etc.) if set
+ * @param string $output_method The output method. If 'echo', displays a table with links/info, otherwise returns an array with information about the attachments
+ * @return void|array Displays a table of attachment info or returns an array containing info about the attachments, depending on output_method.
@@ -784,10 +784,10 @@ function phpBB3_password_check($passwd, $passwd_hash)
* This protects against brute force attacks on a member's password.
* Importantly, even if the password was right we DON'T TELL THEM!
*
- * @param $id_member
- * @param $password_flood_value = false
- * @param $was_correct = false
- * @param $tfa = false;
+ * @paramint $id_member The ID of the member
+ * @parambool|string $password_flood_value False if we don't have a flood value, otherwise a string with a timestamp and number of tries separated by a |
+ * @parambool $was_correct Whether or not the password was correct
+ * @parambool $tfa Whether we're validating for two-factor authentication
+ * @paramint|string $renewal 0 if we're forcing start/end time, otherwise a string indicating how long to renew the subscription for ('D', 'W', 'M' or 'Y')
+ * @param int $forceStartTime If set, forces the subscription to start at the specified time
+ * @param int $forceEndTime If set, forces the subscription to end at the specified time
+ * @return array|string|void An array containing the file to include and name of function to call, the name of a function to call or dies with a fatal_lang_error if we couldn't find anything to do.