| @@ 52-62 (lines=11) @@ | ||
| 49 | * @param int $totaldays |
|
| 50 | * @return int|string |
|
| 51 | */ |
|
| 52 | public function AvgMsgDay($totaldays) |
|
| 53 | { |
|
| 54 | global $xoopsDB; |
|
| 55 | $sql = 'SELECT count( * ) / ' . $totaldays . ' AS averg FROM ' . $xoopsDB->prefix('smallworld_messages') . ''; |
|
| 56 | $result = $xoopsDB->queryF($sql); |
|
| 57 | while (false !== ($sqlfetch = $xoopsDB->fetchArray($result))) { |
|
| 58 | $avg = number_format($sqlfetch['averg'], 2, '.', ','); |
|
| 59 | } |
|
| 60 | ||
| 61 | return $avg; |
|
| 62 | } |
|
| 63 | ||
| 64 | /** |
|
| 65 | * total users using smallworld |
|
| @@ 217-229 (lines=13) @@ | ||
| 214 | * @param $check |
|
| 215 | * @return bool |
|
| 216 | */ |
|
| 217 | function smallworld_isset_or($check) |
|
| 218 | { |
|
| 219 | global $xoopsDB, $xoopsUser; |
|
| 220 | $query = 'SELECT * FROM ' . $xoopsDB->prefix('smallworld_user') . " WHERE username = '" . $check . "'"; |
|
| 221 | $result = $xoopsDB->queryF($query); |
|
| 222 | while (false !== ($row = $xoopsDB->fetchArray($result))) { |
|
| 223 | if ('' == $row['userid']) { |
|
| 224 | return false; |
|
| 225 | } |
|
| 226 | ||
| 227 | return $row['userid']; |
|
| 228 | } |
|
| 229 | } |
|
| 230 | ||
| 231 | //Srinivas Tamada http://9lessons.info |
|
| 232 | //Loading Comments link with load_updates.php |
|