-Options -Indexes\r
-DirectoryIndex index.php\r
-\r
-<IfModule mod_rewrite.c>\r
- RewriteEngine On\r
- RewriteRule ^cms/(.*)/wht/(.*)$ modules.php?module=$1&what=$2 [L]\r
- RewriteRule ^cms/(.*)/act/(.*)$ modules.php?module=$1&action=$2 [L]\r
- RewriteRule ^cms/(.*)$ modules.php?module=$1 [L]\r
-</IfModule>\r
+Options -Indexes
+DirectoryIndex index.php
+
+<IfModule mod_rewrite.c>
+ RewriteEngine On
+ RewriteRule ^cms/(.*)/wht/(.*)$ modules.php?module=$1&what=$2 [L]
+ RewriteRule ^cms/(.*)/act/(.*)$ modules.php?module=$1&action=$2 [L]
+ RewriteRule ^cms/(.*)$ modules.php?module=$1 [L]
+</IfModule>
require($INC);
}
-//
+// Checks wether the nickname is active
function NICKNAME_IS_ACTIVE ($uidNick) {
// By default nothing is found...
$ret = false;
// Increment cache counter
incrementConfigEntry('cache_hits');
} else {
- // Search in database
- // @TODO Can we replace this with GET_TOTAL_DATA() ?
- $result = SQL_QUERY_ESC("SELECT userid FROM `{!_MYSQL_PREFIX!}_user_data` WHERE userid=%s OR nickname='%s' LIMIT 1",
- array(bigintval($uidNick), $uidNick), __FUNCTION__, __LINE__);
+ // Init result
+ $result = false;
+
+ // Nickname or userid used?
+ if (($uidNick + 0) == $uidNick) {
+ // Userid given
+ $result = SQL_QUERY_ESC("SELECT `userid` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `userid` =%s LIMIT 1",
+ array(bigintval($uidNick)), __FUNCTION__, __LINE__);
+ } else {
+ // Nickname given
+ $result = SQL_QUERY_ESC("SELECT `userid` FROM `{!_MYSQL_PREFIX!}_user_data` WHERE `nickname`='%s' LIMIT 1",
+ array($uidNick), __FUNCTION__, __LINE__);
+ }
// Check existence of nickname
$ret = (SQL_NUMROWS($result) == 1);
return $ret;
}
-//
+// "Getter" for nickname for specfied userid
function NICKNAME_GET_NICK ($userid) {
// If not found...
$ret = '';