// SQL commands to run (surfbar URLs)
addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_urls`");
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_urls` (
-`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`url_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`url_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`url` VARCHAR(255) NOT NULL DEFAULT '',
-`last_salt` VARCHAR(255) NOT NULL DEFAULT '',
-`views_total` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`views_max` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`views_allowed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NOT NULL DEFAULT 'PENDING',
-`registered` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-`last_locked` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
-`lock_reason` VARCHAR(255) NOT NULL DEFAULT '',
-`reject_reason` VARCHAR(255) NOT NULL DEFAULT '',
-`fixed_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-PRIMARY KEY (`id`),
-UNIQUE KEY `userid_url` (`userid`,`url`),
-INDEX `status_userid` (`status`,`userid`)
+`url_last_salt` VARCHAR(255) NOT NULL DEFAULT '',
+`url_views_total` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`url_views_max` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`url_views_allowed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`url_status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NOT NULL DEFAULT 'PENDING',
+`url_registered` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+`url_last_locked` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
+`url_lock_reason` VARCHAR(255) NOT NULL DEFAULT '',
+`url_reject_reason` VARCHAR(255) NOT NULL DEFAULT '',
+`url_fixed_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+PRIMARY KEY (`url_id`),
+UNIQUE KEY `userid_url` (`url_userid`,`url`),
+INDEX `status_userid` (`url_status`,`url_userid`)
) TYPE={?_TABLE_TYPE?} COMMENT='Surfbar URLs'");
// Reload locks
addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_locks`");
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_locks` (
-`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`last_surfed` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-PRIMARY KEY (`id`),
-UNIQUE KEY `userid_url` (`userid`,`url_id`),
-INDEX (`url_id`)
+`locks_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`locks_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`locks_url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`locks_last_surfed` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+PRIMARY KEY (`locks_id`),
+UNIQUE KEY `userid_url` (`locks_userid`,`locks_url_id`),
+INDEX (`locks_url_id`)
) TYPE={?_TABLE_TYPE?} COMMENT='Surfbar reload locks'");
// Surfbar salts
addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_salts`");
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_salts` (
-`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`last_salt` VARCHAR(255) NOT NULL DEFAULT '',
-PRIMARY KEY (`id`),
-UNIQUE KEY `userid_url` (`userid`,`url_id`),
-INDEX (`url_id`)
+`salts_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`salts_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`salts_url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`salts_last_salt` VARCHAR(255) NOT NULL DEFAULT '',
+PRIMARY KEY (`salts_id`),
+UNIQUE KEY `salts_userid_url` (`salts_userid`,`salts_url_id`),
+INDEX (`salts_url_id`)
) TYPE={?_TABLE_TYPE?} COMMENT='Surfbar last used salts'");
// Statistics
addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_stats`");
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_stats` (
-`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`last_surfed` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-PRIMARY KEY (`id`),
-UNIQUE KEY `userid_url` (`userid`,`url_id`),
-INDEX (`url_id`)
+`stats_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`stats_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`stats_url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`stats_count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`stats_last_surfed` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+PRIMARY KEY (`stats_id`),
+UNIQUE KEY `userid_url` (`stats_userid`,`stats_url_id`),
+INDEX (`stats_url_id`)
) TYPE={?_TABLE_TYPE?} COMMENT='Surfbar Statistics'");
// Member actions pending on status
addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_actions`");
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_actions` (
-`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NULL DEFAULT NULL,
-`action` ENUM('EDIT','DELETE','PAUSE','UNPAUSE','FRAMETEST','RETREAT','RESUBMIT','BOOKNOW') NULL DEFAULT NULL,
-`new_status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NULL DEFAULT NULL,
-PRIMARY KEY (`id`),
-UNIQUE KEY `status_action` (`status`,`action`)
+`actions_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`actions_status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NULL DEFAULT NULL,
+`actions_action` ENUM('EDIT','DELETE','PAUSE','UNPAUSE','FRAMETEST','RETREAT','RESUBMIT','BOOKNOW') NULL DEFAULT NULL,
+`actions_new_status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NULL DEFAULT NULL,
+PRIMARY KEY (`actions_id`),
+UNIQUE KEY `status_action` (`actions_status`,`actions_action`)
) TYPE={?_TABLE_TYPE?} COMMENT='Surfbar Member Actions'");
// Member actions
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('PENDING','RETREAT','DELETED')");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('PENDING','FRAMETEST',NULL)");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('PENDING','EDIT',NULL)");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('ACTIVE','EDIT','PENDING')");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('ACTIVE','DELETE','DELETED')");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('ACTIVE','PAUSE','STOPPED')");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('ACTIVE','FRAMETEST',NULL)");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('LOCKED','DELETE','DELETED')");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('LOCKED','FRAMETEST',NULL)");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('LOCKED','RESUBMIT','PENDING')");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('STOPPED','EDIT','PENDING')");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('STOPPED','DELETE','DELETED')");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('STOPPED','UNPAUSE','PENDING')");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('DEPLETED','EDIT','PENDING')");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('DEPLETED','DELETE','DELETED')");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('REJECTED','EDIT','PENDING')");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('REJECTED','DELETE','DELETED')");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('REJECTED','FRAMETEST',NULL)");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('REJECTED','RESUBMIT','PENDING')");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('MIGRATED','EDIT','MIGRATED')");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('MIGRATED','DELETE','DELETED')");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('MIGRATED','FRAMETEST',NULL)");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('MIGRATED','BOOKNOW','PENDING')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('PENDING','RETREAT','DELETED')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('PENDING','FRAMETEST',NULL)");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('PENDING','EDIT',NULL)");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('ACTIVE','EDIT','PENDING')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('ACTIVE','DELETE','DELETED')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('ACTIVE','PAUSE','STOPPED')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('ACTIVE','FRAMETEST',NULL)");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('LOCKED','DELETE','DELETED')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('LOCKED','FRAMETEST',NULL)");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('LOCKED','RESUBMIT','PENDING')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('STOPPED','EDIT','PENDING')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('STOPPED','DELETE','DELETED')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('STOPPED','UNPAUSE','PENDING')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('DEPLETED','EDIT','PENDING')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('DEPLETED','DELETE','DELETED')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('REJECTED','EDIT','PENDING')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('REJECTED','DELETE','DELETED')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('REJECTED','FRAMETEST',NULL)");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('REJECTED','RESUBMIT','PENDING')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('MIGRATED','EDIT','MIGRATED')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('MIGRATED','DELETE','DELETED')");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('MIGRATED','FRAMETEST',NULL)");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`,`actions_action`,`actions_new_status`) VALUES ('MIGRATED','BOOKNOW','PENDING')");
// Config entries
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_pay_model` ENUM('STATIC','DYNAMIC') NOT NULL DEFAULT 'STATIC'");
'ADMIN_NO_POINTS_REPAYED' => "Die Mailbuchung hatte keine {?POINTS?} zum zurückbuchen.",
'ADMIN_POINTS_SHREDDED' => "Es wurden <span class=\"data\">%s {?POINTS?}</span> geschrettert.",
'EXTENSION_PROBLEM_EXT_INACTIVE' => "Kann nicht fortfahren! Fehler: Erweiterung <span class=\"data\">%s</span> deaktiviert.",
- 'ADMIN_EXTENSION_PROBLEM_EXT_INACTIVE' => "Die Erweiterung <span class=\"data\">%s</span> ist derzeit deaktiviert. <a href=\"{%url=modules.php?module=admin&what=extensions%}\">Hier</a> können Sie diese aktivieren.",
+ 'ADMIN_EXTENSION_PROBLEM_EXT_INACTIVE' => "Die Erweiterung <span class=\"data\">%s</span> ist derzeit deaktiviert. <a href=\"{%%url=modules.php?module=admin&what=extensions%%}\">Hier</a> können Sie diese aktivieren.",
'EXTENSION_PROBLEM_EXT_NOT_INSTALLED' => "Kann nicht fortfahren! Fehler: Erweiterung <span class=\"data\">%s</span> nicht installiert.",
'ADMIN_EXTENSION_PROBLEM_EXT_NOT_INSTALLED' => "Die Erweiterung <span class=\"data\">%s</span> ist derzeit nicht installiert. <a href=\"{%%url=modules.php?module=admin&what=extensions%%}\">Hier</a> können Sie diese aktivieren.",
'EXTENSION_PROBLEM_NOT_INSTALLED' => "Erweiterung <span class=\"data\">%s</span> nicht installiert.",
// Fix missing entry for template
$urlData['edit'] = $urlData['unpause'];
$urlData['edit']['url'] = $urlData['url'];
- $urlData['edit']['limit'] = $urlData['views_max'];
+ $urlData['edit']['limit'] = SURFBAR_GET_VIEWS_MAX();
// Return status change
return SURFBAR_CHANGE_STATUS($urlData['id'], $urlData['url_status'], $urlData['new_status'], array($urlData['id'] => $urlData));
// Display selected "action form"
function SURFBAR_MEMBER_DISPLAY_ACTION_FORM ($action, $urlData) {
- // Translate some data
- $urlData['url_registered'] = generateDateTime($urlData['url_registered'], 2);
- $urlData['views_total'] = translateComma($urlData['views_total']);
- $urlData['views_max'] = translateComma($urlData['views_max']);
- $urlData['views_allowed'] = translateComma($urlData['views_allowed']);
- $urlData['url_last_locked'] = generateDateTime($urlData['url_last_locked'], 2);
+ // Translate some data if present
+ $content = SURFBAR_PREPARE_CONTENT_FOR_TEMPLATE($content);
// Is the lock reason empty?
if (empty($urlData['lock_reason'])) {
$urlData['limited'] = 'false';
// Is this URL limited?
- if ($urlData['views_max'] > 0) {
+ if (SURFBAR_GET_VIEWS_MAX() > 0) {
// Then rewrite form data
$urlData['limited_y'] = ' checked="checked"';
$urlData['limited_n'] = '';
// Construct function name
$functionName = sprintf("SURFBAR_MEMBER_EXECUTE_%s_ACTION", strtoupper($action));
- // Is 'userid' set and not 'userid' ?
- if ((!isset($urlData['userid'])) && (isset($urlData['userid']))) {
- // Auto-fix this
- $urlData['userid'] = $urlData['userid'];
- } // END - if
-
// Is that function there?
if (function_exists($functionName)) {
// Execute the function
// Has the URL or limit changed?
if (true) {
- //if (($urlData['views_allowed'] != $urlData['edit']['limit']) || ($url1 != $url2)) {
+ //if (($urlData['url_views_allowed'] != $urlData['edit']['limit']) || ($url1 != $url2)) {
// Run the query
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_surfbar_urls` SET url='%s', views_allowed=%s, views_max=%s WHERE `id`=%s AND `status`='%s' LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_surfbar_urls` SET `url`='%s', `url_views_allowed`=%s, `url_views_max`=%s WHERE `url_id`=%s AND `status`='%s' LIMIT 1",
array($urlData['url'], $urlData['edit']['limit'], $urlData['edit']['limit'], $urlData['id'], $urlData['url_status']), __FUNCTION__, __LINE__);
// All fine
// Handle URLs which limit has depleted
function SURFBAR_HANDLE_DEPLETED_VIEWS () {
// Get all URLs
- $urlArray = SURFBAR_GET_URL_DATA(0, 'views_max', 'id', 'ASC', 'id', " AND views_allowed>0 AND `status`='ACTIVE'");
+ $urlArray = SURFBAR_GET_URL_DATA(0, 'url_views_max', 'url_id', 'ASC', 'url_id', " AND `url_views_allowed` > 0 AND `url_status`='ACTIVE'");
// Do we have some entries?
if (count($urlArray) > 0) {
SURFBAR_NOTIFY_USER('low_points', $content);
// Update last notified
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET surfbar_low_notified=NOW() WHERE `userid`=%s LIMIT 1",
- array($userid), __FUNCTION__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `surfbar_low_notified`=NOW() WHERE `userid`=%s LIMIT 1",
+ array($userid), __FUNCTION__, __LINE__);
} // END - if
} // END - foreach
}
// Looks up by an URL
function SURFBAR_LOOKUP_BY_URL ($url, $userid) {
// Now lookup that given URL by itself
- $urlArray = SURFBAR_GET_URL_DATA($url, 'url', 'id', 'ASC', 'id', sprintf(" AND `userid`=%s", bigintval($userid)));
+ $urlArray = SURFBAR_GET_URL_DATA($url, 'url', 'url_id', 'ASC', 'url_id', sprintf(" AND `url_userid`=%s", bigintval($userid)));
// Was it found?
return (count($urlArray) > 0);
}
// Load URL data by given search term and column
-function SURFBAR_GET_URL_DATA ($searchTerm, $column = 'id', $order = 'id', $sort = 'ASC', $group = 'id', $add = '') {
+function SURFBAR_GET_URL_DATA ($searchTerm, $column = 'url_id', $order = 'url_id', $sort = 'ASC', $group = 'url_id', $add = '') {
// By default nothing is found
$GLOBALS['last_url_data'] = array();
// Is the column an id number?
- if (($column == 'id') || ($column == 'userid')) {
+ if (($column == 'url_id') || ($column == 'url_userid')) {
// Extra secure input
$searchTerm = bigintval($searchTerm);
} // END - if
// Look up the record
$result = SQL_QUERY_ESC("SELECT
- `id`, `userid`, `url`,
- `views_total`, `views_max`, `views_allowed`, `status` AS `url_status`,
- UNIX_TIMESTAMP(`registered`) AS `url_registered`, UNIX_TIMESTAMP(`last_locked`) AS `url_last_locked`, `lock_reason`,
- `views_max`, `views_allowed`, `fixed_reload`
+ `url_id`,
+ `url_userid`,
+ `url`,
+ `url_views_total`,
+ `url_views_max`,
+ `url_views_allowed`,
+ `url_status`,
+ UNIX_TIMESTAMP(`url_registered`) AS `url_registered`,
+ UNIX_TIMESTAMP(`url_last_locked`) AS `url_last_locked`,
+ `url_lock_reason`,
+ `url_views_max`,
+ `url_views_allowed`,
+ `url_fixed_reload`
FROM
`{?_MYSQL_PREFIX?}_surfbar_urls`
WHERE
// Then load all!
while ($dataRow = SQL_FETCHARRAY($result)) {
// Shall we group these results?
- if ($group == 'id') {
+ if ($group == 'url_id') {
// Add the row by id as index
- $GLOBALS['last_url_data'][$dataRow['id']] = $dataRow;
+ $GLOBALS['last_url_data'][$dataRow['url_id']] = $dataRow;
} else {
// Group entries
- $GLOBALS['last_url_data'][$dataRow[$group]][$dataRow['id']] = $dataRow;
+ $GLOBALS['last_url_data'][$dataRow[$group]][$dataRow['url_id']] = $dataRow;
}
} // END - while
} // END - if
$content = merge_array($extraFields, array(
'url' => $url,
'frametester' => generateFrametesterUrl($url),
- 'userid' => $userid,
+ 'url_userid' => $userid,
'url_status' => $status,
));
// If in reg-mode we notify admin
if (($addMode == 'reg') || (getConfig('surfbar_notify_admin_unlock') == 'Y')) {
// Notify admin even when he as unlocked an email
- SURFBAR_NOTIFY_ADMIN("url_{$addMode}", $content);
+ SURFBAR_NOTIFY_ADMIN('url_' . $addMode, $content);
} // END - if
// Send mail to user
- SURFBAR_NOTIFY_USER("url_{$addMode}", $content);
+ SURFBAR_NOTIFY_USER('url_' . $addMode, $content);
// Return the insert id
return $content['insert_id'];
// Inserts an url by given data array and return the insert id
function SURFBAR_INSERT_URL_BY_ARRAY ($urlData) {
// Get userid
- $userid = bigintval($urlData['userid']);
+ $userid = bigintval($urlData['url_userid']);
// Is the id set?
if (empty($userid)) $userid = '0';
// Just run the insert query for now
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_urls` (userid,url,status,views_max,views_allowed,fixed_reload) VALUES (%s,'%s','%s',%s,%s,%s)",
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_urls` (`url_userid`,`url`,`url_status`,`url_views_max`,`url_views_allowed`,`url_fixed_reload`) VALUES (%s,'%s','%s',%s,%s,%s)",
array(
$userid,
$urlData['url'],
} // END - if
// Translate some data if present
- if (isset($content['url_status'])) $content['url_status'] = translateSurfbarUrlStatus($content['url_status']);
- if (isset($content['url_registered'])) $content['url_registered'] = generateDateTime($content['url_registered'], 2);
- if (isset($content['url_last_locked'])) $content['url_last_locked'] = generateDateTime($content['url_last_locked'], 2);
- if (isset($content['views_total'])) $content['views_total'] = translateComma($content['views_total']);
- if (isset($content['views_allowed'])) $content['views_allowed'] = translateComma($content['views_allowed']);
- if (isset($content['views_max'])) $content['views_max'] = translateComma($content['views_max']);
+ $content = SURFBAR_PREPARE_CONTENT_FOR_TEMPLATE($content);
// Send the notification out
return sendAdminNotification($subject, $templateName, $content, $content['userid']);
// Prepare subject
$subject = getMessage(sprintf("MEMBER_SURFBAR_NOTIFY_%s_SUBJECT",
- strtoupper($messageType)
+ strtoupper($messageType)
));
// Is the subject line there?
} // END - if
// Translate some data if present
- if (isset($content['url_status'])) $content['url_status'] = translateSurfbarUrlStatus($content['url_status']);
- if (isset($content['url_registered'])) $content['url_registered'] = generateDateTime($content['url_registered'], 2);
- if (isset($content['url_last_locked'])) $content['url_last_locked'] = generateDateTime($content['url_last_locked'], 2);
- if (isset($content['views_total'])) $content['views_total'] = translateComma($content['views_total']);
- if (isset($content['views_allowed'])) $content['views_allowed'] = translateComma($content['views_allowed']);
- if (isset($content['views_max'])) $content['views_max'] = translateComma($content['views_max']);
+ $content = SURFBAR_PREPARE_CONTENT_FOR_TEMPLATE($content);
// Load template
$mailText = loadEmailTemplate($templateName, $content, $content['userid']);
return sendEmail($content['userid'], $subject, $mailText);
}
+// Translates some data for template usage
+// @TODO Can't we use our new expression language instead of this ugly code?
+function SURFBAR_PREPARE_CONTENT_FOR_TEMPLATE ($content) {
+ // Prepare some code
+ if (isset($content['url_status'])) $content['url_status'] = translateSurfbarUrlStatus($content['url_status']);
+ if (isset($content['url_registered'])) $content['url_registered'] = generateDateTime($content['url_registered'], 2);
+ if (isset($content['url_last_locked'])) $content['url_last_locked'] = generateDateTime($content['url_last_locked'], 2);
+ if (isset($content['url_views_total'])) $content['url_views_total'] = translateComma($content['url_views_total']);
+ if (isset($content['url_views_allowed'])) $content['url_views_allowed'] = translateComma($content['url_views_allowed']);
+ if (isset($content['views_max'])) $content['views_max'] = translateComma($content['views_max']);
+
+ // Return translated content
+ return $content;
+}
+
// Translates the limit
function translateSurfbarLimit ($limit) {
// Is this zero?
// Ask the database
$result = SQL_QUERY_ESC("SELECT
- COUNT(l.id) AS cnt
+ COUNT(l.locks_id) AS cnt
FROM
`{?_MYSQL_PREFIX?}_surfbar_locks` AS l
INNER JOIN
`{?_MYSQL_PREFIX?}_surfbar_urls` AS u
ON
- u.id=l.url_id
+ u.url_id=l.locks_url_id
WHERE
- l.userid=%s AND
- (UNIX_TIMESTAMP() - ".SURFBAR_GET_SURF_LOCK().") < UNIX_TIMESTAMP(l.last_surfed) AND
+ l.locks_userid=%s AND
+ (UNIX_TIMESTAMP() - ".SURFBAR_GET_SURF_LOCK().") < UNIX_TIMESTAMP(l.locks_last_surfed) AND
(
- ((UNIX_TIMESTAMP(l.last_surfed) - u.fixed_reload) < 0 AND u.fixed_reload > 0) OR
- u.fixed_reload = '0'
+ ((UNIX_TIMESTAMP(l.locks_last_surfed) - u.url_fixed_reload) < 0 AND u.url_fixed_reload > 0) OR
+ u.url_fixed_reload = '0'
)
LIMIT 1",
array(getMemberId()), __FUNCTION__, __LINE__
} // END - if
// Get amount from database
- $result = SQL_QUERY_ESC("SELECT COUNT(`id`) AS cnt
-FROM `{?_MYSQL_PREFIX?}_surfbar_urls`
-WHERE `userid` NOT IN (".implode(', ', $userids['userid']).") AND `status`='%s'",
+ $result = SQL_QUERY_ESC("SELECT
+ COUNT(`url_id`) AS cnt
+FROM
+ `{?_MYSQL_PREFIX?}_surfbar_urls`
+WHERE
+ `url_userid` NOT IN (".implode(', ', $userids['userid']).") AND
+ `url_status`='%s'
+LIMIT 1",
array($status), __FUNCTION__, __LINE__
);
}
// Get total amount of URLs of given status for current user
-function SURFBAR_GET_TOTAL_USER_URLS ($userid = '0', $status = '',$exclude = '') {
+function SURFBAR_GET_TOTAL_USER_URLS ($userid = '0', $status = '', $exclude = '') {
// Is the user 0 and user is logged in?
if (($userid == '0') && (isMember())) {
// Then use this userid
// Is the status set?
if (is_array($status)) {
// Only URLs with these status
- $add = sprintf(" AND `status` IN('%s')", implode("','", $status));
+ $add = sprintf(" AND `url_status` IN('%s')", implode("','", $status));
} elseif (!empty($status)) {
// Only URLs with this status
- $add = sprintf(" AND `status`='%s'", $status);
+ $add = sprintf(" AND `url_status`='%s'", $status);
} elseif (is_array($exclude)) {
// Exclude URLs with these status
- $add = sprintf(" AND `status` NOT IN('%s')", implode("','", $exclude));
+ $add = sprintf(" AND `url_status` NOT IN('%s')", implode("','", $exclude));
} elseif (!empty($exclude)) {
// Exclude URLs with this status
- $add = sprintf(" AND `status` != '%s'", $exclude);
+ $add = sprintf(" AND `url_status` != '%s'", $exclude);
}
// Get amount from database
- $cnt = countSumTotalData($userid, 'surfbar_urls', 'id', 'userid', true, $add);
+ $cnt = countSumTotalData($userid, 'surfbar_urls', 'url_id', 'url_userid', true, $add);
// Return result
return $cnt;
// Return result of checking hashes and salts
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '---'.$code.'|'.$check.'---', false);
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '+++'.$salt.'|'.SURFBAR_GET_DATA('last_salt').'+++', false);
- return (($code == $check) && ($salt == SURFBAR_GET_DATA('last_salt')));
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '+++'.$salt.'|'.SURFBAR_GET_DATA('salts_last_salt').'+++', false);
+ return (($code == $check) && ($salt == SURFBAR_GET_DATA('salts_last_salt')));
}
// Lockdown the userid/id combination (reload lock)
//* DEBUG: */ outputHtml('LOCK!');
///* DEBUG: */ return;
// Just add it to the database
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_locks` (`userid`, `url_id`) VALUES (%s, %s)",
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_locks` (`locks_userid`, `locks_url_id`) VALUES (%s, %s)",
array(getMemberId(), bigintval($urlId)), __FUNCTION__, __LINE__);
// Remove the salt from database
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_surfbar_salts` WHERE `url_id`=%s AND `userid`=%s LIMIT 1",
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_surfbar_salts` WHERE `salts_url_id`=%s AND `salts_userid`=%s LIMIT 1",
array(bigintval($urlId), getMemberId()), __FUNCTION__, __LINE__);
}
} // END - if
// Update URL stats
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_surfbar_urls` SET `views_total`=`views_total`+1".$add." WHERE `id`=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_surfbar_urls` SET `url_views_total`=`url_views_total`+1".$add." WHERE `url_id`=%s LIMIT 1",
array(SURFBAR_GET_ID()), __FUNCTION__, __LINE__);
// Update the stats entry
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_surfbar_stats` SET `count`=`count`+1 WHERE `userid`=%s AND `url_id`=%s LIMIT 1",
- array(getMemberId(), SURFBAR_GET_ID()), __FUNCTION__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_surfbar_stats` SET `stats_count`=`stats_count`+1 WHERE `stats_userid`=%s AND `stats_url_id`=%s LIMIT 1",
+ array(
+ getMemberId(),
+ SURFBAR_GET_ID()
+ ), __FUNCTION__, __LINE__);
// Was that update okay?
if (SQL_AFFECTEDROWS() < 1) {
// No, then insert entry
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_stats` (userid,url_id,count) VALUES (%s,%s,1)",
- array(getMemberId(), SURFBAR_GET_ID()), __FUNCTION__, __LINE__);
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_stats` (`stats_userid`, `stats_url_id`, `stats_count`) VALUES (%s,%s,1)",
+ array(
+ getMemberId(),
+ SURFBAR_GET_ID()
+ ), __FUNCTION__, __LINE__);
} // END - if
// Update total/daily/weekly/monthly counter
SURFBAR_UPDATE_INSERT_STATS_RECORD();
// Simply store the salt from cache away in database...
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_surfbar_salts` SET `last_salt`='%s' WHERE `url_id`=%s AND `userid`=%s LIMIT 1",
- array(SURFBAR_GET_SALT(), SURFBAR_GET_ID(), getMemberId()), __FUNCTION__, __LINE__);
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_surfbar_salts` SET `salts_last_salt`='%s' WHERE `salts_url_id`=%s AND `salts_userid`=%s LIMIT 1",
+ array(
+ SURFBAR_GET_SALT(),
+ SURFBAR_GET_ID(),
+ getMemberId()
+ ), __FUNCTION__, __LINE__);
// Debug message
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'salt='.SURFBAR_GET_SALT().',id='.SURFBAR_GET_ID().',userid='.getMemberId().'', false);
// Was that okay?
if (SQL_AFFECTEDROWS() < 1) {
// Insert missing entry!
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_salts` (`url_id`, `userid`, `last_salt`) VALUES (%s, %s, '%s')",
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_salts` (`salts_url_id`, `salts_userid`, `salts_last_salt`) VALUES (%s, %s, '%s')",
array(SURFBAR_GET_ID(), getMemberId(), SURFBAR_GET_SALT()), __FUNCTION__, __LINE__);
} // END - if
function SURFBAR_CHECK_RELOAD_LOCK ($urlId) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'id=' . $urlId . '', false);
// Ask the database
- $result = SQL_QUERY_ESC("SELECT COUNT(`id`) AS cnt
+ $result = SQL_QUERY_ESC("SELECT COUNT(`locks_id`) AS cnt
FROM
`{?_MYSQL_PREFIX?}_surfbar_locks`
WHERE
- `userid`=%s AND `url_id`=%s AND (UNIX_TIMESTAMP() - ".SURFBAR_GET_SURF_LOCK().") < UNIX_TIMESTAMP(`last_surfed`)
+ `locks_userid`=%s AND
+ `locks_url_id`=%s AND
+ (UNIX_TIMESTAMP() - ".SURFBAR_GET_SURF_LOCK().") < UNIX_TIMESTAMP(`locks_last_surfed`)
ORDER BY
- `last_surfed` ASC
+ `locks_last_surfed` ASC
LIMIT 1",
array(getMemberId(), bigintval($urlId)), __FUNCTION__, __LINE__
);
// Get all userid except logged in one
$result = SQL_QUERY_ESC("SELECT
- u.userid, UNIX_TIMESTAMP(d.surfbar_low_notified) AS notified
+ u.url_userid, UNIX_TIMESTAMP(d.surfbar_low_notified) AS notified
FROM
`{?_MYSQL_PREFIX?}_surfbar_urls` AS u
INNER JOIN
`{?_MYSQL_PREFIX?}_user_data` AS d
ON
- u.userid=d.userid
+ u.url_userid=d.userid
WHERE
- u.userid NOT IN (%s,0) AND u.`status`='ACTIVE'
+ u.url_userid NOT IN (%s,0) AND u.url_status='ACTIVE'
GROUP BY
- u.userid
+ u.url_userid
ORDER BY
- u.userid ASC",
+ u.url_userid ASC",
array(getMemberId()), __FUNCTION__, __LINE__);
} else {
// Get all userid
$result = SQL_QUERY("SELECT
- u.userid, UNIX_TIMESTAMP(d.surfbar_low_notified) AS notified
+ u.url_userid, UNIX_TIMESTAMP(d.surfbar_low_notified) AS notified
FROM
`{?_MYSQL_PREFIX?}_surfbar_urls` AS u
INNER JOIN
`{?_MYSQL_PREFIX?}_user_data` AS d
ON
- u.userid=d.userid
+ u.url_userid=d.userid
WHERE
- u.`status`='ACTIVE'
+ u.url_status='ACTIVE'
GROUP BY
- u.userid
+ u.url_userid
ORDER BY
- u.userid ASC", __FUNCTION__, __LINE__);
+ u.url_userid ASC", __FUNCTION__, __LINE__);
}
// Load all userid
function SURFBAR_DETERMINE_TOTAL_ONLINE () {
// Count all users in surfbar modue and return the value
$result = SQL_QUERY("SELECT
- `id`
+ `stats_id`
FROM
`{?_MYSQL_PREFIX?}_surfbar_stats`
WHERE
- (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`last_surfed`)) <= {?online_timeout?}
+ (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`stats_last_surfed`)) <= {?online_timeout?}
GROUP BY
- `userid` ASC", __FUNCTION__, __LINE__);
+ `stats_userid` ASC", __FUNCTION__, __LINE__);
// Fetch count
$cnt = SQL_NUMROWS($result);
$ignored = array();
// Get all id from locks within the timestamp
- $result = SQL_QUERY_ESC("SELECT `id`, `url_id`, UNIX_TIMESTAMP(`last_surfed`) AS last_surfed
+ $result = SQL_QUERY_ESC("SELECT `locks_id`, `locks_url_id`, UNIX_TIMESTAMP(`locks_last_surfed`) AS last_surfed
FROM
`{?_MYSQL_PREFIX?}_surfbar_locks`
WHERE
- `userid`=%s
+ `locks_userid`=%s
ORDER BY
- `id` ASC", array(getMemberId()),
+ `locks_id` ASC", array(getMemberId()),
__FUNCTION__, __LINE__);
// Load all entries
function SURFBAR_GET_MAX_RANDOM ($userids, $add) {
// Count max availabe entries
$result = SQL_QUERY("SELECT
- sbu.id AS cnt
+ sbu.url_id AS cnt
FROM
`{?_MYSQL_PREFIX?}_surfbar_urls` AS sbu
LEFT JOIN
`{?_MYSQL_PREFIX?}_surfbar_salts` AS sbs
ON
- sbu.id=sbs.url_id
+ sbu.url_id=sbs.salts_url_id
LEFT JOIN
`{?_MYSQL_PREFIX?}_surfbar_locks` AS l
ON
- sbu.id=l.url_id
+ sbu.url_id=l.locks_url_id
WHERE
- sbu.userid NOT IN (".implode(',', $userids).") AND
- (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0)) AND
- sbu.`status`='ACTIVE'
+ sbu.url_userid NOT IN (".implode(',', $userids).") AND
+ (sbu.url_views_allowed=0 OR (sbu.url_views_allowed > 0 AND sbu.url_views_max > 0)) AND
+ sbu.url_status='ACTIVE'
".$add."
GROUP BY
- sbu.id ASC", __FUNCTION__, __LINE__);
+ sbu.url_id ASC", __FUNCTION__, __LINE__);
// Log last query
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'lastQuery='.getConfig('db_last_query').'|numRows='.SQL_NUMROWS($result).'|Affected='.SQL_AFFECTEDROWS().'', false);
// Begin the query
$result = SQL_QUERY_ESC("SELECT
- u.id, u.userid, u.url, u.status,
- u.views_total, u.views_max, u.views_allowed,
- UNIX_TIMESTAMP(u.registered) AS url_registered,
- UNIX_TIMESTAMP(u.last_locked) AS url_last_locked,
- u.lock_reason AS lock_reason
+ u.url_id,
+ u.url_userid,
+ u.url,
+ u.url_status,
+ u.url_views_total,
+ u.url_views_max,
+ u.url_views_allowed,
+ UNIX_TIMESTAMP(u.url_registered) AS `url_registered`,
+ UNIX_TIMESTAMP(u.url_last_locked) AS `url_last_locked`,
+ u.url_lock_reason
FROM
`{?_MYSQL_PREFIX?}_surfbar_urls` AS u
WHERE
- u.userid=%s AND
- u.status != 'DELETED'
+ u.url_userid=%s AND
+ u.url_status != 'DELETED'
ORDER BY
- u.id ASC",
+ u.url_id ASC",
array(getMemberId()), __FUNCTION__, __LINE__);
// Are there entries?
$returnArray = array();
// Get all assigned actions
- $result = SQL_QUERY_ESC("SELECT `action` FROM `{?_MYSQL_PREFIX?}_surfbar_actions` WHERE `status`='%s' ORDER BY `id` ASC",
+ $result = SQL_QUERY_ESC("SELECT `action` FROM `{?_MYSQL_PREFIX?}_surfbar_actions` WHERE `actions_status`='%s' ORDER BY `actions_id` ASC",
array($status), __FUNCTION__, __LINE__);
// Some entries there?
$add = '';
if (count($USE) > 0) {
// Ignore some!
- $add = " AND sbu.id NOT IN (";
+ $add = " AND sbu.url_id NOT IN (";
foreach ($USE as $url_id => $lid) {
// Add URL id
$add .= $url_id.',';
// And query the database
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'randNum='.$randNum.',maxRand='.$maxRand.',surfLock='.SURFBAR_GET_SURF_LOCK().'', false);
- $result = SQL_QUERY_ESC("SELECT sbu.id, sbu.userid, sbu.url, sbs.last_salt, sbu.views_total, sbu.views_max, sbu.views_allowed, UNIX_TIMESTAMP(l.last_surfed) AS last_surfed, sbu.fixed_reload
-FROM `{?_MYSQL_PREFIX?}_surfbar_urls` AS sbu
-LEFT JOIN `{?_MYSQL_PREFIX?}_surfbar_salts` AS sbs
-ON sbu.id=sbs.url_id
-LEFT JOIN `{?_MYSQL_PREFIX?}_surfbar_locks` AS l
-ON sbu.id=l.url_id
-WHERE sbu.userid NOT IN (".implode(',', $userids['userid']).") AND sbu.`status`='ACTIVE' AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0))".$add."
-GROUP BY sbu.id
-ORDER BY l.last_surfed ASC, sbu.id ASC
+ $result = SQL_QUERY_ESC("SELECT
+ sbu.url_id,
+ sbu.url_userid,
+ sbu.url,
+ sbs.salts_last_salt,
+ sbu.url_views_total,
+ sbu.url_views_max,
+ sbu.url_views_allowed,
+ UNIX_TIMESTAMP(l.locks_last_surfed) AS last_surfed,
+ sbu.url_fixed_reload
+FROM
+ `{?_MYSQL_PREFIX?}_surfbar_urls` AS sbu
+LEFT JOIN
+ `{?_MYSQL_PREFIX?}_surfbar_salts` AS sbs
+ON
+ sbu.url_id=sbs.salts_url_id
+LEFT JOIN
+ `{?_MYSQL_PREFIX?}_surfbar_locks` AS l
+ON
+ sbu.url_id=l.locks_url_id
+WHERE
+ sbu.url_userid NOT IN (".implode(',', $userids['userid']).") AND
+ sbu.url_status='ACTIVE' AND
+ (sbu.url_views_allowed=0 OR (sbu.url_views_allowed > 0 AND sbu.url_views_max > 0))
+ ".$add."
+GROUP BY
+ sbu.url_id
+ORDER BY
+ l.locks_last_surfed ASC,
+ sbu.url_id ASC
LIMIT %s,1",
array($randNum), __FUNCTION__, __LINE__
);
} else {
// Get data from specified id number
- $result = SQL_QUERY_ESC("SELECT sbu.id, sbu.userid, sbu.url, sbs.last_salt, sbu.views_total, sbu.views_max, sbu.views_allowed, UNIX_TIMESTAMP(l.last_surfed) AS last_surfed, sbu.fixed_reload
-FROM `{?_MYSQL_PREFIX?}_surfbar_urls` AS sbu
-LEFT JOIN `{?_MYSQL_PREFIX?}_surfbar_salts` AS sbs
-ON sbu.id=sbs.url_id
-LEFT JOIN `{?_MYSQL_PREFIX?}_surfbar_locks` AS l
-ON sbu.id=l.url_id
-WHERE sbu.userid != %s AND sbu.`status`='ACTIVE' AND sbu.id=%s AND (sbu.views_allowed=0 OR (sbu.views_allowed > 0 AND sbu.views_max > 0))
+ $result = SQL_QUERY_ESC("SELECT
+ sbu.url_id,
+ sbu.url_userid,
+ sbu.url,
+ sbs.salts_last_salt,
+ sbu.url_views_total,
+ sbu.url_views_max,
+ sbu.url_views_allowed,
+ UNIX_TIMESTAMP(l.locks_last_surfed) AS last_surfed,
+ sbu.url_fixed_reload
+FROM
+ `{?_MYSQL_PREFIX?}_surfbar_urls` AS sbu
+LEFT JOIN
+ `{?_MYSQL_PREFIX?}_surfbar_salts` AS sbs
+ON
+ sbu.url_id=sbs.salts_url_id
+LEFT JOIN
+ `{?_MYSQL_PREFIX?}_surfbar_locks` AS l
+ON
+ sbu.url_id=l.locks_url_id
+WHERE
+ sbu.url_userid != %s AND
+ sbu.url_status='ACTIVE' AND
+ sbu.url_id=%s AND
+ (sbu.url_views_allowed=0 OR (sbu.url_views_allowed > 0 AND sbu.url_views_max > 0))
LIMIT 1",
array(getMemberId(), bigintval($urlId)), __FUNCTION__, __LINE__
);
$GLOBALS['surfbar_cache']['time'] = SURFBAR_DETERMINE_WAIT_TIME();
// Is the last salt there?
- if (is_null($GLOBALS['surfbar_cache']['last_salt'])) {
+ if (is_null($GLOBALS['surfbar_cache']['salts_last_salt'])) {
// Then repair it wit the static!
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'last_salt - FIXED!', false);
- $GLOBALS['surfbar_cache']['last_salt'] = '';
+ $GLOBALS['surfbar_cache']['salts_last_salt'] = '';
} // END - if
// Fix missing last_surfed
// Getter for id from cache
function SURFBAR_GET_ID () {
// Get data element and return its contents
- return SURFBAR_GET_DATA('id');
+ return SURFBAR_GET_DATA('url_id');
}
// Getter for userid from cache
function SURFBAR_GET_USERID () {
// Get data element and return its contents
- return SURFBAR_GET_DATA('userid');
+ return SURFBAR_GET_DATA('url_userid');
}
// Getter for user reload locks
// Getter for allowed views
function SURFBAR_GET_VIEWS_ALLOWED () {
// Get data element and return its contents
- return SURFBAR_GET_DATA('views_allowed');
+ return SURFBAR_GET_DATA('url_views_allowed');
+}
+
+// Getter for maximum views
+function SURFBAR_GET_VIEWS_MAX () {
+ // Get data element and return its contents
+ return SURFBAR_GET_DATA('url_views_max');
}
// Getter for fixed reload
function SURFBAR_GET_FIXED_RELOAD () {
// Get data element and return its contents
- return SURFBAR_GET_DATA('fixed_reload');
+ return SURFBAR_GET_DATA('url_fixed_reload');
}
// Getter for surf lock
if (isExtensionActive('surfbar')) {
// List all URLs in surfbar
- addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_surfbar_urls` ORDER BY `id` ASC");
+ addSql("SELECT `url_id` FROM `{?_MYSQL_PREFIX?}_surfbar_urls` ORDER BY `url_id` ASC");
$WHATs[] = 'list_surfbar_urls';
$DESCRs[] = getMessage('ADMIN_TASK_LIST_SURFBAR_URLS_ALL');
$TITLEs[] = getMessage('ADMIN_TASK_LIST_SURFBAR_URLS_ALL_TITLE');
// List all pending URLs in surfbar
- addSql("SELECT `id` FROM `{?_MYSQL_PREFIX?}_surfbar_urls` WHERE `status`='PENDING' ORDER BY `id` ASC");
+ addSql("SELECT `url_id` FROM `{?_MYSQL_PREFIX?}_surfbar_urls` WHERE `url_status`='PENDING' ORDER BY `url_id` ASC");
$WHATs[] = 'unlock_surfbar_urls';
$DESCRs[] = getMessage('ADMIN_TASK_LIST_SURFBAR_URLS_PENDING');
$TITLEs[] = getMessage('ADMIN_TASK_LIST_SURFBAR_URLS_PENDING_TITLE');
// Load all actions
$result = SQL_QUERY("SELECT
- `id`, `status`, `action`, `new_status`
+ `actions_id`,
+ `actions_status`,
+ `actions_action`,
+ `actions_new_status`
FROM
`{?_MYSQL_PREFIX?}_surfbar_actions`
ORDER BY
- `status` ASC,
- `action` ASC", __FILE__, __LINE__);
+ `actions_status` ASC,
+ `actions_action` ASC", __FILE__, __LINE__);
// Entries found?
if (SQL_NUMROWS($result) > 0) {
$OUT = ''; $SW = 2;
while ($content = SQL_FETCHARRAY($result)) {
// "Translate" some data
- $content['status'] = translateSurfbarUrlStatus($content['status']);
- $content['action'] = getMessage(sprintf("MEMBER_SURFBAR_ACTION_%s_SUBMIT", $content['action']));
+ $content['actions_status'] = translateSurfbarUrlStatus($content['actions_status']);
+ $content['actions_action'] = getMessage(sprintf("MEMBER_SURFBAR_ACTION_%s_SUBMIT", $content['actions_action']));
// New status set?
- if (!is_null($content['new_status'])) {
+ if (!is_null($content['actions_new_status'])) {
// Translate it
- $content['new_status'] = translateSurfbarUrlStatus($content['new_status']);
+ $content['actions_new_status'] = translateSurfbarUrlStatus($content['actions_new_status']);
} else {
// "Do nothing" status
- $content['new_status'] = getMessage('SURFBAR_URL_STATUS_NONE');
+ $content['actions_new_status'] = getMessage('SURFBAR_URL_STATUS_NONE');
}
// Add color
// List all URLs
$result = SQL_QUERY("SELECT
- `id`, `userid`, `url`, `views_total`, `status` AS `url_status`,
- UNIX_TIMESTAMP(`registered`) AS url_registered,
- UNIX_TIMESTAMP(`last_locked`) AS url_last_locked,
- `lock_reason`
+ `url_id`, `url_userid`, `url`, `url_views_total`, `url_status`,
+ UNIX_TIMESTAMP(`url_registered`) AS `url_registered`,
+ UNIX_TIMESTAMP(`url_last_locked`) AS `url_last_locked`,
+ `url_lock_reason`
FROM
`{?_MYSQL_PREFIX?}_surfbar_urls`
ORDER BY
- `id` ASC", __FILE__, __LINE__);
+ `url_id` ASC", __FILE__, __LINE__);
// Do we have some URLs left?
if (SQL_NUMROWS($result) > 0) {
while ($content = SQL_FETCHARRAY($result)) {
// "Translate"/add content
$content['sw'] = $SW;
- $content['userid'] = generateUserProfileLink($content['userid']);
+ $content['url_userid'] = generateUserProfileLink($content['url_userid']);
$content['url'] = generateFrametesterUrl($content['url']);
- $content['views_total'] = translateComma($content['views_total']);
+ $content['views_total'] = translateComma($content['url_views_total']);
$content['url_status'] = translateSurfbarUrlStatus($content['url_status']);
$content['url_registered'] = generateDateTime($content['url_registered'], 2);
$content['url_last_locked'] = generateDateTime($content['url_last_locked'], 2);
// Is the 'url_id' set?
if (isGetRequestParameterSet(('url_id'))) {
// Generate general statistics
- $result = SQL_QUERY_ESC("SELECT `userid`,`count` AS `total_visits`, UNIX_TIMESTAMP(`last_surfed`) AS `last_surfed`
-FROM `{?_MYSQL_PREFIX?}_surfbar_stats`
-WHERE `url_id`=%s
-ORDER BY `userid` ASC",
- array(bigintval(getRequestParameter('url_id'))), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT
+ `stats_userid`,
+ `stats_count` AS `total_visits`,
+ UNIX_TIMESTAMP(`stats_last_surfed`) AS `last_surfed`
+FROM
+ `{?_MYSQL_PREFIX?}_surfbar_stats`
+WHERE
+ `stats_url_id`=%s
+ORDER BY
+ `stats_userid` ASC",
+ array(bigintval(getRequestParameter('url_id'))), __FILE__, __LINE__);
// Entries found?
if (SQL_NUMROWS($result) > 0) {
$visits += $content['total_visits'];
// "Translate" some data
- $content['userid'] = generateUserProfileLink($content['userid']);
+ $content['stats_userid'] = generateUserProfileLink($content['stats_userid']);
$content['total_visits'] = translateComma($content['total_visits']);
$content['last_surfed'] = generateDateTime($content['last_surfed'], 2);
$content['sw'] = $SW;
} else {
// Generate general statistics
$result = SQL_QUERY("SELECT
- `userid`, COUNT(`url_id`) AS `visited_urls`, SUM(`count`) AS `total_visits`
+ `stats_userid`,
+ COUNT(`stats_url_id`) AS `visited_urls`,
+ SUM(`stats_count`) AS `total_visits`
FROM
`{?_MYSQL_PREFIX?}_surfbar_stats`
GROUP BY
- `userid`
+ `stats_userid`
ORDER BY
- `userid` ASC", __FILE__, __LINE__);
+ `stats_userid` ASC", __FILE__, __LINE__);
// Entries found?
if (SQL_NUMROWS($result) > 0) {
$visits += $content['total_visits'];
// "Translate" some data
- $content['userid'] = generateUserProfileLink($content['userid']);
+ // @TODO Can't all these translation blocks moved into templates? This code looks ugly.
+ $content['stats_userid'] = generateUserProfileLink($content['stats_userid']);
$content['visited_urls'] = translateComma($content['visited_urls']);
$content['total_visits'] = translateComma($content['total_visits']);
$content['sw'] = $SW;
// List all URLs
$result = SQL_QUERY("SELECT
- `id`, `userid`, `url`, UNIX_TIMESTAMP(`registered`) AS url_registered
+ `url_id`,
+ `url_userid`,
+ `url`,
+ UNIX_TIMESTAMP(`url_registered`) AS `url_registered`
FROM
`{?_MYSQL_PREFIX?}_surfbar_urls`
WHERE
- `status`='PENDING'
+ `url_status`='PENDING'
ORDER BY
- `id` ASC", __FILE__, __LINE__);
+ `url_id` ASC", __FILE__, __LINE__);
// Do we have some URLs left?
if (SQL_NUMROWS($result) > 0) {
if ($nextId > 0) {
// Then prepare other content
$content = array(
- 'id' => $nextId,
+ 'url_id' => $nextId,
'check' => SURFBAR_GENERATE_VALIDATION_CODE($nextId),
'salt' => SURFBAR_GET_SALT(),
'reward' => translateComma(SURFBAR_GET_REWARD($nextId)),
------------------------------------------
Sperrgrund: $content[lock_reason]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
Mit freundlichen Grüßen,
------------------------------------------
Angemeldet: $content[url_registered]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
Mit freundlichen Grüßen,
------------------------------------------
Angemeldet: $content[url_registered]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
Mit freundlichen Grüßen,
------------------------------------------
Angemeldet: $content[url_registered]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
Mit freundlichen Grüßen,
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Kosten/Aufruf: $content[costs] {?POINTS?}
------------------------------------------
-ID in der Surfbar: $content[id]
-------------------------------------------
Mit freundlichen Grüßen,
Ihr {?MAIN_TITLE?} Script
------------------------------------------
Gebuchte URL: $content[url] (Neu: $content[edit][url])
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Status: $content[url_status]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
Mit freundlichen Grüßen,
------------------------------------------
Kosten/Aufruf: $content[costs] {?POINTS?}
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
Mit freundlichen Grüßen,
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Kosten/Aufruf: $content[costs] {?POINTS?}
------------------------------------------
-ID in der Surfbar: $content[id]
-------------------------------------------
Mit freundlichen Grüßen,
Ihr {?MAIN_TITLE?} Script
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Gebuchte URL: $content[url] (Neu: $content[edit][url])
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Kosten/Aufruf: $content[costs] {?POINTS?}
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
Mit freundlichen Grüßen,
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Kosten/Aufruf: $content[costs] {?POINTS?}
------------------------------------------
-ID in der Surfbar: $content[id]
-------------------------------------------
Mit freundlichen Grüßen,
Ihr {?MAIN_TITLE?} Script
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Kosten/Aufruf: $content[costs] {?POINTS?}
------------------------------------------
-ID in der Surfbar: $content[id]
-------------------------------------------
Mit freundlichen Grüßen,
Ihr {?MAIN_TITLE?} Script
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Kosten/Aufruf: $content[costs] {?POINTS?}
------------------------------------------
-ID in der Surfbar: $content[id]
-------------------------------------------
Mit freundlichen Grüßen,
Ihr {?MAIN_TITLE?} Script
------------------------------------------
Status: $content[url_status]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
Mit freundlichen Grüßen,
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Kosten/Aufruf: $content[costs] {?POINTS?}
------------------------------------------
-ID in der Surfbar: $content[id]
-------------------------------------------
Mit freundlichen Grüßen,
Ihr {?MAIN_TITLE?} Script
------------------------------------------
Gebuchte URL: $content[url] (Neu: $content[edit][url])
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Angemeldet: $content[url_registered]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
Mit freundlichen Grüßen,
------------------------------------------
Angemeldet: $content[url_registered]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
Mit freundlichen Grüßen,
------------------------------------------
Ihre Mitglieder-Id: $content[userid]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
Mit freundlichen Grüßen,
------------------------------------------
Ihre Mitglieder-Id: $content[userid]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
Mit freundlichen Grüßen,
------------------------------------------
Ihre Mitglieder-Id: $content[userid]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
Mit freundlichen Grüßen,
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Gebuchte URL: $content[url] (Neu: $content[edit][url])
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Status: $content[url_status]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
Mit freundlichen Grüßen,
------------------------------------------
Kosten/Aufruf: $content[costs] {?POINTS?}
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
Wenn Sie die URL dennoch weiterlaufen wollen, so loggen Sie sich bitte im Mitgliedsbereich ein und stellen Sie erneut Einblendungen oder auf unendlich ein.
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Gebuchte URL: $content[url] (Neu: $content[edit][url])
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Kosten/Aufruf: $content[costs] {?POINTS?}
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
Wir werden Ihre URL bald kontrollieren und dann freigeben.
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Status: $content[url_status]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
Mit freundlichen Grüßen,
------------------------------------------
Gebuchte URL: $content[url] (Neu: $content[edit][url])
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Gebuchte URL: $content[url]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Gebuchte URL: $content[url] (Neu: $content[edit][url])
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
URL angemeldet: $content[url_registered]
------------------------------------------
------------------------------------------
Ihre Mitglieder-Id: $content[userid]
------------------------------------------
-ID in der Surfbar: $content[id]
+ID in der Surfbar: $content[url_id]
------------------------------------------
Mit freundlichen Grüßen,
<tr>
<td align="center" class="bottom right switch_sw$content[sw]">
- <input type="hidden" name="id[$content[id]]" value="1" />
- <input type="hidden" name="userid_raw[$content[id]]" value="$content[userid_raw]" />
- $content[userid]
+ <input type="hidden" name="id[$content[url_id]]" value="1" />
+ <input type="hidden" name="userid_raw[$content[url_id]]" value="$content[userid_raw]" />
+ $content[url_userid]
</td>
<td align="center" class="bottom right switch_sw$content[sw]">
<a href="$content[url]" target="_blank" title="{--ADMIN_TEST_URL--}">{--ADMIN_TEST_URL--}</a>
<tr>
<td align="center" class="bottom right switch_sw$content[sw]">
- <input type="hidden" name="id[$content[id]]" value="1" />
- <input type="hidden" name="userid_raw[$content[id]]" value="$content[userid_raw]" />
- $content[userid]
+ <input type="hidden" name="id[$content[url_id]]" value="1" />
+ <input type="hidden" name="userid_raw[$content[url_id]]" value="$content[userid_raw]" />
+ $content[url_userid]
</td>
<td align="center" class="bottom right switch_sw$content[sw]">
- <input type="text" name="url[$content[id]]" size="20" maxlength="255" value="$content[url]" />
+ <input type="text" name="url[$content[url_id]]" size="20" maxlength="255" value="$content[url]" />
</td>
</tr>
<tr>
<td align="center" class="bottom right switch_sw$content[sw]">
- <input type="checkbox" class="admin_normal" title="{--ID_SELECT--} $content[id]" name="id[$content[id]]" value="1" />
+ <input type="checkbox" class="admin_normal" title="{--ID_SELECT--} $content[actions_id]" name="id[$content[actions_id]]" value="1" />
</td>
<td align="center" class="bottom right switch_sw$content[sw]">
- $content[status]
+ $content[actions_status]
</td>
<td align="center" class="bottom right switch_sw$content[sw]">
- $content[action]
+ $content[actions_action]
</td>
<td align="center" class="bottom switch_sw$content[sw]">
- $content[new_status]
+ $content[actions_new_status]
</td>
</tr>
<tr>
<td align="center" class="bottom right switch_sw$content[sw]">
- <input type="checkbox" class="admin_normal" title="{--ID_SELECT--} $content[id]" name="id[$content[id]]" value="1" />
+ <input type="checkbox" class="admin_normal" title="{--ID_SELECT--} $content[url_id]" name="id[$content[url_id]]" value="1" />
</td>
<td align="center" class="bottom right switch_sw$content[sw]">
- $content[userid]
+ $content[url_userid]
</td>
<td align="center" class="bottom right switch_sw$content[sw]">
<a href="$content[url]" target="_blank" title="{--ADMIN_TEST_URL--}">{--ADMIN_TEST_URL--}</a>
</td>
<td align="center" class="bottom right switch_sw$content[sw]">
- <a href="{%url=modules.php?module=admin&what=surfbar_stats&url_id=$content[id]%}">$content[views_total]</a>
+ <a href="{%url=modules.php?module=admin&what=surfbar_stats&url_id=$content[url_id]%}">$content[views_total]</a>
</td>
<td align="center" class="bottom right switch_sw$content[sw]">
$content[url_status]
<tr>
<td align="center" class="bottom right switch_sw$content[sw]">
- <input type="hidden" name="id[$content[id]]" value="1" />
- <input type="hidden" name="userid_raw[$content[id]]" value="$content[userid_raw]" />
- <input type="hidden" name="last_locked[$content[id]]" value="NOW()" />
- $content[userid]
+ <input type="hidden" name="id[$content[url_id]]" value="1" />
+ <input type="hidden" name="userid_raw[$content[url_id]]" value="$content[url_userid_raw]" />
+ <input type="hidden" name="last_locked[$content[url_id]]" value="NOW()" />
+ $content[url_userid]
</td>
<td align="center" class="bottom right switch_sw$content[sw]">
<a href="$content[url]" target="_blank" title="{--ADMIN_TEST_URL--}">{--ADMIN_TEST_URL--}</a>
</td>
<td align="center" class="bottom right switch_sw$content[sw]">
- $content[status]
+ $content[url_status]
</td>
<td align="center" class="bottom right switch_sw$content[sw]">
- $content[registered]
+ $content[url_registered]
</td>
<td align="center" class="bottom switch_sw$content[sw]">
Bitte angeben:<br />
- <textarea name="lock_reason[$content[id]]" rows="2" cols="15"></textarea>
+ <textarea name="lock_reason[$content[url_id]]" rows="2" cols="15"></textarea>
</td>
</tr>
<tr>
- <td align="center" class="switch_$content[sw] bottom right">[<strong>$content[userid]</strong>]</td>
+ <td align="center" class="switch_$content[sw] bottom right">$content[stats_userid]</td>
<td align="center" class="switch_$content[sw] bottom right">$content[visited_urls]</td>
<td align="center" class="switch_$content[sw] bottom">$content[total_visits]</td>
</tr>
<tr>
- <td align="center" class="switch_$content[sw] bottom right">[<strong>$content[userid]</strong>]</td>
+ <td align="center" class="switch_$content[sw] bottom right">[<strong>$content[url_userid]</strong>]</td>
<td align="center" class="switch_$content[sw] bottom right">$content[total_visits]</td>
<td align="center" class="switch_$content[sw] bottom">$content[last_surfed]</td>
</tr>
<tr>
<td align="center" class="bottom right switch_sw$content[sw]">
- <input type="hidden" name="id[$content[id]]" value="1" />
- <input type="hidden" name="userid_raw[$content[id]]" value="$content[userid_raw]" />
- $content[userid]
+ <input type="hidden" name="id[$content[url_id]]" value="1" />
+ <input type="hidden" name="userid_raw[$content[url_id]]" value="$content[url_userid_raw]" />
+ $content[url_userid]
</td>
<td align="center" class="bottom right switch_sw$content[sw]">
<a href="$content[url]" target="_blank" title="{--ADMIN_TEST_URL--}">{--ADMIN_TEST_URL--}</a>
</td>
<td align="center" class="bottom right switch_sw$content[sw]">
- $content[status]
+ $content[url_status]
</td>
<td align="center" class="bottom switch_sw$content[sw]">
- $content[registered]
+ $content[url_registered]
</td>
</tr>
<tr>
<td align="center" class="bottom right switch_sw$content[sw]">
- <input type="checkbox" class="admin_normal" title="{--ID_SELECT--} $content[id]" name="id[$content[id]]" value="1" />
+ <input type="checkbox" class="admin_normal" title="{--ID_SELECT--} $content[url_id]" name="id[$content[url_id]]" value="1" />
</td>
<td align="center" class="bottom right switch_sw$content[sw]">
- $content[userid]
+ $content[url_userid]
</td>
<td align="center" class="bottom right switch_sw$content[sw]">
$content[url]
<div class="member_title top" style="padding-top:5px;padding-bottom:5px">
<input type="reset" class="member_reset" value="{--CLEAR_FORM--}" />
- <input type="hidden" name="id" value="$content[id]" />
+ <input type="hidden" name="id" value="$content[url_id]" />
<input type="hidden" name="action" value="delete" />
<input type="hidden" name="execute" value="1" />
<input type="submit" class="member_submit" name="ok" value="{--MEMBER_SURFBAR_ACTION_DELETE_NOW_SUBMIT--}" />
<div class="member_title top" style="padding-top:5px;padding-bottom:5px">
<input type="reset" class="member_reset" value="{--CLEAR_FORM--}" />
- <input type="hidden" name="id" value="$content[id]" />
+ <input type="hidden" name="id" value="$content[url_id]" />
<input type="hidden" name="action" value="edit" />
<input type="hidden" name="execute" value="1" />
<input type="submit" class="member_submit" name="ok" value="{--MEMBER_SURFBAR_ACTION_EDIT_NOW_SUBMIT--}" />
<td align="center" width="$content[width]%%">
<form accept-charset="utf-8" action="{%url=modules.php?module=login&what=surfbar_list%}" method="post">
- <input type="hidden" name="id" value="$content[id]" />
+ <input type="hidden" name="id" value="$content[url_id]" />
<input type="hidden" name="action" value="$content[action]" />
<input type="submit" class="member_submit" name="ok" title="$content[title]" value="$content[submit]" />
</form>
}
function Confirm() {
- parent.surfbar_url.location="{%url=surfbar.php?id=$content[id]&check=$content[check]&salt=$content[salt]%}";
+ parent.surfbar_url.location="{%url=surfbar.php?id=$content[url_id]&check=$content[check]&salt=$content[salt]%}";
}
function ReloadThis() {