-function GET_JACKPOT_POINTS () {
- // Default is zero
- $jackpot = '0.00000';
-
- // Read them
- $result = SQL_QUERY("SELECT `points` FROM `{!_MYSQL_PREFIX!}_jackpot` WHERE `ok`='ok' LIMIT 1", __FUNCTION__, __LINE__);
-
- // Do we have an entry?
- if (SQL_NUMROWS($result) == 0) {
- // No, so create line
- SQL_QUERY("INSERT INTO `{!_MYSQL_PREFIX!}_jackpot` (`ok`, `points`) VALUES ('ok','0.00000')", __FUNCTION__, __LINE__);
- } else {
- // Read the line
- list($jackpot) = SQL_FETCHROW($result);
- }
-
- // Free result
- SQL_FREERESULT($result);
-
- // Return them
- return $jackpot;
-}
-
-// Adds points to the jackpot
-function ADD_JACKPOT ($points) {
- // Get jackpot points for dummy
- $jackpot = GET_JACKPOT_POINTS();
-
- // Update points
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_jackpot` SET `points`=`points`+%s WHERE `ok`='ok' LIMIT 1",
- array($points), __FUNCTION__, __LINE__);
-}
-
-// Subtracts points from the jackpot
-function SUB_JACKPOT ($points) {
- // First failed
- $ret = '-1';
-
- // Get jackpot points for dummy
- $jackpot = GET_JACKPOT_POINTS();
-
- // Enougth points i jackpot?
- if ($jackpot >= $points) {
- // Update points when there are enougth points in jackpot
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_jackpot` SET `points`=`points`-%s WHERE `ok`='ok' LIMIT 1",
- array($points), __FUNCTION__, __LINE__);
- $ret = $jackpot - $points;
- } // END - if
-
- // Free memory
- SQL_FREERESULT($result);
-
- // Return the result
- return $ret;
-}
-
-// Checks wether the extension demo is actuve and the admin login is demo (password needs to be demo, too!)
-function IS_DEMO () {
- return ((EXT_IS_ACTIVE('demo')) && (getSession('admin_login') == 'demo'));
-}
-