// Do we have a call-back? Should always be there!
if (!empty($data['callback'])) {
// Parse it through this function
- $replacer = '{DQUOTE} . ' . $data['callback'] . "('" . $replacer . "') . {DQUOTE}";
+ $replacer = '{DQUOTE} . ' . $data['extra_func'] . '(' . $data['callback'] . "('" . $replacer . "')) . {DQUOTE}";
} // END - if
// Replace the config entry
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 10/20/2009 *
+ * =================== Last change: 10/20/2009 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : js-surfbar_stopped.php *
+ * -------------------------------------------------------------------- *
+ * Short description : JavaScript tag for ext-surfbar.php *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : JavaScript-Tag fuer ext-surfbar.php *
+ * -------------------------------------------------------------------- *
+ * $Revision:: 1910 $ *
+ * $Date:: 2010-06-29 06:00:23 +0200 (Tue, 29 Jun 2010) $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: quix0r $ *
+ * Needs to be in all Files and every File needs "svn propset *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team *
+ * For more information visit: http://www.mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+ die();
+} elseif (!isExtensionActive('surfbar')) {
+ return;
+}
+
+// Init surfbar
+SURFBAR_INIT();
+
+// Init data
+SURFBAR_DETERMINE_NEXT_ID(getRequestParameter('url_id'));
+
+// Check reload-locks
+SURFBAR_CHECK_RELOAD_FULL();
+
+// Update stats
+SURFBAR_UPDATE_SALT_STATS();
+
+// Prepare content
+$content = array(
+ 'url_id' => bigintval(getRequestParameter('url_id'))
+);
+
+// Load template
+loadTemplate('js_surfbar_frame_top', false, $content);
+
+// [EOF]
+?>
// Check if the "reload lock" of the current user is full, call this function
// before you call SURFBAR_CHECK_RELOAD_LOCK().
-function SURFBAR_CHECK_RELOAD_FULL() {
+function SURFBAR_CHECK_RELOAD_FULL () {
// Default is full!
$isFull = true;
// Free result
SQL_FREERESULT($result);
+ // Debug message
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'cnt=' . $cnt);
+
// Return result
return $cnt;
}
// Update statistics record
SURFBAR_UPDATE_INSERT_STATS_RECORD();
+ // Update salt
+ SURFBAR_GENERATE_VALIDATION_CODE(SURFBAR_GET_ID());
+
// Simply store the salt from cache away in database...
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(
if ($nextId > 0) {
// Then prepare other content
$content = array(
- 'url_id' => $nextId,
- 'xxx' => str_repeat('X', strlen(SURFBAR_GET_RELOAD_TIME($nextId)))
+ 'url_id' => $nextId,
+ 'xxx' => str_repeat('X', strlen(SURFBAR_GET_RELOAD_TIME($nextId))),
);
// Update salt (double-call lock!) and statistics
loadIncludeOnce('inc/header.php');
// Load that template
- //* DEBUG: */ die("templateName={$templateName}<br />\n<strong>content</strong>=<pre>".print_r($content, true)."</pre>");
+ //* DEBUG: */ die('templateName=' . $templateName . '<br /><strong>content</strong>=<pre>' . print_r($content, true) . '</pre>');
loadTemplate($templateName, false, $content);
}
--- /dev/null
+var currCounter = "{%pipe,SURFBAR_GET_RELOAD_TIME=$content[url_id]%}";
+var maxCounter = "{%pipe,SURFBAR_GET_RELOAD_TIME=$content[url_id]%}";
+var counter = document.getElementById("surfbar_counter");
+var points = document.getElementById("surfbar_points");
+var reload = document.getElementById("surfbar_reload");
+var max = document.getElementById("surfbar_max");
+var countDown = null;
+
+function startStopCounter () {
+ if (countDown == null) {
+ // Start counter
+ document.getElementById("start").innerHTML = "{--MEMBER_SURFBAR_ACTION_PAUSE_SUBMIT--}";
+ countDown = window.setInterval("startCounter()", 1000);
+ } else {
+ document.getElementById("start").innerHTML = "{--MEMBER_SURFBAR_ACTION_UNPAUSE_SUBMIT--}";
+ window.clearInterval(countDown);
+ countDown = null;
+ }
+ return false;
+}
+
+function init () {
+ countDown = window.setInterval("startCounter()", 1000);
+ window.setTimeout("initCounter()", 500);
+}
+
+function confirm () {
+ if (parent.surfbar_url != null) {
+ // Is in right frameset
+ parent.surfbar_url.location.href = "{%url=surfbar.php?id=$content[url_id]&check={%pipe,SURFBAR_GENERATE_VALIDATION_CODE=$content[url_id]%}&salt={%pipe,SURFBAR_GET_SALT%}%}";
+ } else {
+ // Called frame=top directly
+ window.location.href = "{%url=surfbar.php%}";
+ }
+}
+
+function reloadSurfbar () {
+ if (parent.surfbar_stats != null) {
+ // Is in right frameset
+ parent.surfbar_stats.location.reload();
+ } else {
+ // Called frame=top directly
+ window.location.href = "{%url=surfbar.php%}";
+ }
+ this.location.reload();
+}
+
+function initCounter () {
+ if (parent.surfbar_url != null) {
+ // Is in right frameset
+ parent.surfbar_url.location.href = '{%pipe,SURFBAR_GET_URL=$content[url_id]%}';
+ } else {
+ // Called frame=top directly
+ window.location.href = "{%url=surfbar.php%}";
+ }
+
+ counter.innerHTML = "{%pipe,SURFBAR_GET_RELOAD_TIME=$content[url_id]%}";
+ points.innerHTML = "{%pipe,SURFBAR_GET_REWARD,translateComma=$content[url_id]%}";
+ reload.innerHTML = "{%pipe,SURFBAR_GET_USER_LOCKS%}";
+ max.innerHTML = "{%pipe,SURFBAR_GET_TOTAL_URLS%}";
+}
+
+function startCounter () {
+ if (currCounter < 1) {
+ return false;
+ }
+
+ currCounter--;
+ counter.innerHTML = currCounter;
+
+ if (currCounter == 0) {
+ clearInterval(countDown);
+ confirm();
+ window.setTimeout("reloadSurfbar()", 500);
+ }
+}
+
+init();
<tr>
<td id="surfbar_td">
<div>
- »<span id="surfbar_points">$content[xxx]=$content[xxx] {?POINTS?}</span> in
- <span class="surfbar_counter">$content[xxx]</span>
+ »<span id="surfbar_points">$content[xxx]</span> {?POINTS?} in
+ <span id="surfbar_counter" class="surfbar_counter">$content[xxx]</span>
<span id="surfbar_counter_word">Sekunden</span>«
»<span id="surfbar_reload">X</span> von
<span id="surfbar_max">X</span> im Reload«
»<a href="{%pipe,SURFBAR_GET_URL=$content[url_id]%}" target="_blank">Aktuelle Seite in neuem
Fenster öffnen</a>«
<span id="surfbar_navi">[<a href="#" onclick="return startStopCounter();"
- id="start">Anhalten</a>|<a target="_parent"
+ id="start">{--MEMBER_SURFBAR_ACTION_PAUSE_SUBMIT--}</a>|<a target="_parent"
href="{%url=login.php%}">Loginbereich</a>|<a target="_parent"
href="{%url=modules.php?module=login&what=logout%}">Ausloggen</a>|<a
href="javascript:window.close()">Schliessen</a>]</span>
</tr>
</table>
</div>
-<script type="text/javascript">
-<!--
-// @TODO Try to rewrite this JavaScript to js.php?js=surfbar_frame_top (wouldn't be easy)
-var currCounter = "$content[reload]";
-var maxCounter = "$content[reload]";
-var counter = document.getElementById("surfbar_counter");
-var points = document.getElementById("surfbar_points");
-var reload = document.getElementById("surfbar_reload");
-var max = document.getElementById("surfbar_max");
-var countDown = null;
-function startStopCounter () {
- if (countDown == null) {
- // Start counter
- document.getElementById("start").innerHTML = "Anhalten";
- countDown = window.setInterval("startCounter()", 1000);
- } else {
- document.getElementById("start").innerHTML = "Weiter";
- window.clearInterval(countDown);
- countDown = null;
- }
- return false;
-}
-
-function init () {
- countDown = window.setInterval("startCounter()", 1000);
- window.setTimeout("initCounter()", 500);
-}
-
-function confirm () {
- parent.surfbar_url.location="{%url=surfbar.php?id=$content[url_id]&check={%pipe,SURFBAR_GENERATE_VALIDATION_CODE=$content[url_id]%}&salt={%pipe,SURFBAR_GET_SALT%}%}";
-}
-
-function reloadSurfbar () {
- parent.surfbar_stats.location.reload();
- this.location.reload();
-}
-
-function initCounter () {
- parent.surfbar_url.location.href = '{%pipe,SURFBAR_GET_URL=$content[url_id]%}';
- counter.innerHTML = '{%pipe,SURFBAR_GET_RELOAD_TIME=$content[url_id]%}';
- points.innerHTML = '{%pipe,SURFBAR_GET_REWARD,translateComma=$content[url_id]%}';
- reload.innerHTML = '{%pipe,SURFBAR_GET_USER_LOCKS%}';
- max.innerHTML = '{%pipe,SURFBAR_GET_TOTAL_URLS%}';
-}
-
-function startCounter () {
- if (currCounter < 1) {
- return false;
- }
-
- currCounter--;
- counter.innerHTML = currCounter;
-
- if (currCounter == 0) {
- clearInterval(countDown);
- confirm();
- window.setTimeout("reloadSurfbar()", 500);
- }
-}
-
-init();
-
-//-->
-</script>
+<script type="text/javascript"
+ src="{%url=js.php?js=surfbar_frame_top&url_id=$content[url_id]%}"></script>