Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
question2answer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
outils
question2answer
Commits
41bdb31b
Commit
41bdb31b
authored
Jan 29, 2019
by
pupi1985
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPDoc update in db/blobs, db/hotness, db/limits and db/points
parent
d64f2ad4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
34 deletions
+36
-34
blobs.php
qa-include/db/blobs.php
+14
-14
hotness.php
qa-include/db/hotness.php
+3
-3
limits.php
qa-include/db/limits.php
+12
-12
points.php
qa-include/db/points.php
+7
-5
No files found.
qa-include/db/blobs.php
View file @
41bdb31b
...
...
@@ -27,13 +27,13 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly
/**
* Create a new blob in the database with $content and $format, other fields as provided
* @param $content
* @param $format
* @param $sourcefilename
* @param $userid
* @param $cookieid
* @param $ip
* @return mixed|
null|string
* @param
string
$content
* @param
string
$format
* @param
string|null
$sourcefilename
* @param
mixed|null
$userid
* @param
string|null
$cookieid
* @param
string|null
$ip
* @return mixed|
string|null
*/
function
qa_db_blob_create
(
$content
,
$format
,
$sourcefilename
=
null
,
$userid
=
null
,
$cookieid
=
null
,
$ip
=
null
)
{
...
...
@@ -59,8 +59,8 @@ function qa_db_blob_create($content, $format, $sourcefilename = null, $userid =
/**
* Get the information about blob $blobid from the database
* @param $blobid
* @return array|
mixed|
null
* @param
string
$blobid
* @return array|null
*/
function
qa_db_blob_read
(
$blobid
)
{
...
...
@@ -75,8 +75,8 @@ function qa_db_blob_read($blobid)
/**
* Change the content of blob $blobid in the database to $content (can also be null)
* @param $blobid
* @param $content
* @param
string
$blobid
* @param
string
$content
*/
function
qa_db_blob_set_content
(
$blobid
,
$content
)
{
...
...
@@ -89,7 +89,7 @@ function qa_db_blob_set_content($blobid, $content)
/**
* Delete blob $blobid in the database
* @param $blobid
* @param
string
$blobid
* @return mixed
*/
function
qa_db_blob_delete
(
$blobid
)
...
...
@@ -105,8 +105,8 @@ function qa_db_blob_delete($blobid)
/**
* Check if blob $blobid exists in the database
* @param $blobid
* @return bool
|mixed
* @param
string
$blobid
* @return bool
*/
function
qa_db_blob_exists
(
$blobid
)
{
...
...
qa-include/db/hotness.php
View file @
41bdb31b
...
...
@@ -46,9 +46,9 @@ function qa_db_increment_views($postid)
*
* @param int $firstpostid First post to recalculate (or only post if $lastpostid is null).
* @param int $lastpostid Last post in the range to recalculate.
* @param bool $viewincrement Deprecated - view counter is now incremented separately. Previously, would increment the
post's
*
views and include that in the hotness calculation.
* @return
voi
d
* @param bool $viewincrement Deprecated - view counter is now incremented separately. Previously, would increment the
*
post's
views and include that in the hotness calculation.
* @return
mixe
d
*/
function
qa_db_hotness_update
(
$firstpostid
,
$lastpostid
=
null
,
$viewincrement
=
false
)
{
...
...
qa-include/db/limits.php
View file @
41bdb31b
...
...
@@ -28,9 +28,9 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly
/**
* Get rate limit information for $action from the database for user $userid and/or IP address $ip, if they're set.
* Return as an array with the limit type in the key, and a labelled array of the period and count.
* @param $userid
* @param $ip
* @param $action
* @param
mixed
$userid
* @param
string|null
$ip
* @param
string
$action
* @return array
*/
function
qa_db_limits_get
(
$userid
,
$ip
,
$action
)
...
...
@@ -50,7 +50,7 @@ function qa_db_limits_get($userid, $ip, $action)
$arguments
[]
=
$action
;
}
if
(
count
(
$selects
))
{
if
(
!
empty
(
$selects
))
{
$query
=
qa_db_apply_sub
(
implode
(
' UNION ALL '
,
$selects
),
$arguments
);
return
qa_db_read_all_assoc
(
qa_db_query_raw
(
$query
),
'limitkey'
);
...
...
@@ -61,10 +61,10 @@ function qa_db_limits_get($userid, $ip, $action)
/**
* Increment the database rate limit count for user $userid and $action by $count within $period
* @param $userid
* @param $action
* @param $period
* @param $count
* @param
mixed
$userid
* @param
string
$action
* @param
int
$period
* @param
int
$count
*/
function
qa_db_limits_user_add
(
$userid
,
$action
,
$period
,
$count
)
{
...
...
@@ -78,10 +78,10 @@ function qa_db_limits_user_add($userid, $action, $period, $count)
/**
* Increment the database rate limit count for IP address $ip and $action by $count within $period
* @param $ip
* @param $action
* @param $period
* @param $count
* @param
string
$ip
* @param
string
$action
* @param
int
$period
* @param
int
$count
*/
function
qa_db_limits_ip_add
(
$ip
,
$action
,
$period
,
$count
)
{
...
...
qa-include/db/points.php
View file @
41bdb31b
...
...
@@ -27,6 +27,7 @@ if (!defined('QA_VERSION')) { // don't allow this page to be requested directly
/**
* Returns an array of option names required to perform calculations in userpoints table
* @return mixed
*/
function
qa_db_points_option_names
()
{
...
...
@@ -49,6 +50,7 @@ function qa_db_points_option_names()
* The element 'formula' contains the SQL fragment that calculates the columns value for one or more users,
* where the ~ symbol within the fragment is substituted for a constraint on which users we are interested in.
* The element 'multiple' specifies what to multiply each column by to create the final sum in the points column.
* @return mixed
*/
function
qa_db_points_calculations
()
{
...
...
@@ -156,10 +158,10 @@ function qa_db_points_calculations()
/**
* Update the userpoints table in the database for $userid and $columns, plus the summary points column.
* Set $columns to true for all,
empty
for none, an array for several, or a single value for one.
* Set $columns to true for all,
false
for none, an array for several, or a single value for one.
* This dynamically builds some fairly crazy looking SQL, but it works, and saves repeat calculations.
* @param $userid
* @param $columns
* @param
mixed
$userid
* @param
bool|string|array
$columns
* @return mixed
*/
function
qa_db_points_update_ifuser
(
$userid
,
$columns
)
...
...
@@ -217,8 +219,8 @@ function qa_db_points_update_ifuser($userid, $columns)
/**
* Set the number of explicit bonus points for $userid to $bonus
* @param $userid
* @param $bonus
* @param
mixed
$userid
* @param
int
$bonus
*/
function
qa_db_points_set_bonus
(
$userid
,
$bonus
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment