inc/filter/rallye_filter.php svneol=native#text/plain
inc/filter/register_filter.php svneol=native#text/plain
inc/filter/removeip_filter.php svneol=native#text/plain
+inc/filter/surfbar_filter.php svneol=native#text/plain
inc/filter/theme_filter.php svneol=native#text/plain
inc/filter/timezone_filter.php svneol=native#text/plain
inc/filter/uberwach_filter.php svneol=native#text/plain
case '0.9.5': // SQL queries for v0.9.5
// Register filter
- registerFilter('generate_admin_mail_links', 'GENERATE_BONUS_MAIL_LINKS', true, isExtensionDryRun());
+ registerFilter('generate_admin_mail_links', 'GENERATE_BONUS_MAIL_LINKS', false, true, isExtensionDryRun());
// Update notes
setExtensionUpdateNotes("Filter zum Generieren von Admin-Links für Bonus-Mails hinzugefügt.");
// Register module
addModuleSql('surfbar', 'Y', 'Y', 'N', 'N');
+
+ // Register filter
+ registerFilter('post_change_surfbar_url_status', 'SURFBAR_CHANGE_URL_STATUS', false, true, isExtensionDryRun());
break;
case 'remove': // Do stuff when removing extension
// Unregister module
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `module`='surfbar' LIMIT 1");
+
+ // Unregister filter
+ unregisterFilter(__FUNCTION__, __LINE__, 'post_change_surfbar_url_status', 'SURFBAR_CHANGE_URL_STATUS', true, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
case '0.3.9': // SQL queries for v0.3.9
// Register new filters for gathering points
- registerFilter(__FUNCTION__, __LINE__, 'get_total_points', 'USER_POINTS', true, isExtensionDryRun());
- registerFilter(__FUNCTION__, __LINE__, 'get_own_points', 'USER_POINTS', true, isExtensionDryRun());
+ registerFilter('get_total_points', 'USER_POINTS', false, true, isExtensionDryRun());
+ registerFilter('get_own_points', 'USER_POINTS', false, true, isExtensionDryRun());
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter registriert, die das eigene {?POINTS?}-Guthaben des Mitgliedes zurückliefern.");
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'REGISTER: filterName=' . $filterName . ',filterFunction=' . $filterFunction);
$GLOBALS['cache_array']['filter']['chains'][$filterName][$filterFunction] = 'A';
$GLOBALS['cache_array']['filter']['counter'][$filterName][$filterFunction] = '0';
- } // END - if
+ } elseif (($silentAbort === false) && (!function_exists($filterFunction))) {
+ // Please report them all!
+ debug_report_bug(__FUNCTION__, __LINE__, 'filterName=' . $filterName . ',filterFunction=' . $filterFunction . ',silentAbort=false,force=' . intval($force) . ',dry_run=' . intval($dry_run) . ' - NOT FOUND!');
+ }
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ENTRY: filterName=' . $filterName . ',filterFunction=' . $filterFunction . ' - EXIT!');
}
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 07/11/2011 *
+ * =================== Last change: 07/11/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : surfbar_filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext-surfbar *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext-surfbar *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2011 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();
+} // END - if
+
+// Filter for changing URL status
+function FILTER_SURFBAR_CHANGE_URL_STATUS ($filterData) {
+ die('<pre>'.print_r($filterData, true).'</pre>');
+ // Return filter data
+ return $filterData;
+}
+
+// [EOF]
+?>
}
// Register the new URL
+ die('limit='.$limit);
return SURFBAR_REGISTER_URL($url, getMemberId(), 'PENDING', 'reg', array('limit' => $limit));
}
));
// Is limit/reload set?
- if (!isset($config['limit'])) {
+ if (!isset($content['limit'])) {
$content['limit'] = '0';
} // END - if
- if (!isset($config['reload'])) {
+ if (!isset($content['reload'])) {
$content['reload'] = '0';
} // END - if
// Changes the status of an URL from given to other
function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus, $data=array()) {
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',prevStatus=' . $prevStatus . ',newStatus=' . $newStatus . ' - ENTERED!');
// Make new status always lower-case
$newStatus = strtolower($newStatus);
// Is the new status set?
if ((!is_string($newStatus)) || (empty($newStatus))) {
// Abort here, but fine!
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'newStatus[' . gettype($newStatus) . ']=' . $newStatus . ' - EXIT!');
return true;
} // END - if
// Is the status like prevStatus is saying?
if ($data[$urlId]['url_status'] != $prevStatus) {
// No, then abort here
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, $data[$urlId]['url_status'] . '!=' . $prevStatus . ' - EXIT!');
return false;
} // END - if
//} // END - if
// ---------- Comment out for debugging/developing member actions! ---------
+ // Prepare array
+ $filterData = array(
+ 'url_id' => $urlId,
+ 'prev_status' => $prevStatus,
+ 'new_status' => $newStatus,
+ 'data' => $data
+ );
+
+ // Run post filter chain
+ $filterData = runFilterChain('post_change_surfbar_url_status', $filterData);
+
+ // Extract data from it again
+ $data = $filterData['data'];
+
// Prepare content for notification routines
$data[$urlId]['url_userid'] = $data[$urlId]['url_userid'];
$data[$urlId]['frametester'] = '{%pipe,generateFrametesterUrl=' . $data[$urlId]['url'] . '%}';
} // END - if
// Send admin notification
- SURFBAR_NOTIFY_ADMIN('url_' . $data[$urlId]['url_status'] . '_' . $newStatus, $data[$urlId]);
+ SURFBAR_NOTIFY_ADMIN('url_' . strtolower($data[$urlId]['url_status']) . '_' . $newStatus, $data[$urlId]);
// Send user notification
- SURFBAR_NOTIFY_USER('url_' . $data[$urlId]['url_status'] . '_' . $newStatus, $data[$urlId]);
+ SURFBAR_NOTIFY_USER('url_' . strtolower($data[$urlId]['url_status']) . '_' . $newStatus, $data[$urlId]);
// All done!
+ /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',prevStatus=' . $prevStatus . ',newStatus=' . $newStatus . ' - EXIT!');
return true;
}
$message = '{--MEMBER_SURFBAR_URL_NOT_ADDED--}';
// Register the new URL
+ die(postRequestParameter('limit').'=<pre>'.print_r($_POST,true).'</pre>');
$insertId = SURFBAR_MEMBER_ADD_URL(postRequestParameter('url'), postRequestParameter('limit'));
// Was this fine?
// Prepare eval() command, other output doesn't like entities, maybe
$GLOBALS['template_eval'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeQuotes($GLOBALS['tpl_content'][$template]), false, true, true, $compileCode) . '");';
}
- } else {
+ } elseif (isHtmlOutputMode()) {
// Add surrounding HTML comments to help finding bugs faster
$ret = '<!-- Template ' . $template . ' - Start //-->' . $GLOBALS['tpl_content'][$template] . '<!-- Template ' . $template . ' - End //-->';
$GLOBALS['template_eval'][$template] = '$ret = "' . getColorSwitchCode($template) . compileRawCode(escapeQuotes($ret), false, true, true, $compileCode) . '";';
+ } else {
+ // JavaScript again
+ $GLOBALS['template_eval'][$template] = '$ret = decodeEntities("' . compileRawCode(escapeJavaScriptQuotes($GLOBALS['tpl_content'][$template]), false, true, true, $compileCode) . '");';
} // END - if
} elseif ((isAdmin()) || ((isInstalling()) && (!isInstalled()))) {
// Only admins shall see this warning or when installation mode is active
Hallo Administrator,
-Ein Administrator hat soeben eine URL in der Surfbar hinzugefügt bzw. freigegeben.
+ein Administrator hat soeben eine URL in der Surfbar hinzugefügt bzw. freigegeben.
Hier sind alle Daten aus der Mail:
------------------------------------------
-var limit = document.getElementById('limit');
-var span = document.getElementById('span_limit');
-var old_limit = 0;
+var limit = document.getElementById('limit');
+var span = document.getElementById('span_limit');
+var limited_no = document.getElementById('limited_no');
+var limited_yes = document.getElementById('limited_yes');
-function FocusLimitedNo () {
+var old_limit = 0;
+
+function focusLimitedNo () {
if ((limit.value > 0) && (limit.value != '-')) {
old_limit = limit.value;
}
+ limited_no.focus();
+ limited_yes.blur();
limit.disabled = true;
limit.setAttribute('class', 'disabled');
- limit.style.textAlign = 'center';
limit.value = '-';
+ return true;
}
-function FocusLimitedYes () {
+function focusLimitedYes () {
limit.disabled = false;
limit.setAttribute('class', 'form_field');
limit.style.textAlign = 'left';
limit.value = '';
}
limit.focus();
+ return true;
+}
+
+function changeLimited () {
+ if ((limit.value == '') || (limit.value == 0)) {
+ focusLimitedNo();
+ }
+ return true;
+}
+
+function focusLimit () {
+ limited_yes.focus();
+ limited_no.blur();
+ limit.focus();
+ if (limit.value == '-') {
+ limit.value = '';
+ }
+ return true;
+}
+
+function blurLimit () {
+ if ((limit.value == '') || (limit.value == 0)) {
+ limit.value = '-';
+ }
+ return true;
}
-function SubmitForm () {
+function submitForm () {
if (limit.value == '-') {
limit.value = 0;
}
return true;
}
-function ResetForm () {
+function resetForm () {
old_limit = 0;
- FocusLimitedNo();
+ focusLimitedNo();
return true;
}
-FocusLimitedNo();
+focusLimitedNo();
-<form accept-charset="UTF-8" id="book" action="{%url=modules.php?module=login&what=surfbar_book%}" method="post" onsubmit="return SubmitForm()" onreset="return ResetForm()">
+<form accept-charset="UTF-8" id="book" action="{%url=modules.php?module=login&what=surfbar_book%}" method="post" onsubmit="return submitForm()" onreset="return resetForm()">
<div class="table dashed" style="width:600px;margin-top:10px">
<div class="table_header bottom" style="padding-top:5px;padding-bottom:5px">
<strong>URL in Surfbar buchen - Dynamisch:</strong>
<div class="member_input" style="padding-top:5px;padding-bottom:5px">
Soll die Anzahl Aufrufe begrenzt werden?<br />
- <input type="radio" id="limited_no" onfocus="return FocusLimitedNo()" name="limited" value="N" checked="checked" /> {--NO--}
- <input type="radio" id="limited_yes" onfocus="return FocusLimitedYes()" name="limited" value="Y" /> {--YES--}
+ <input type="radio" id="limited_no" onclick="return focusLimitedNo()" name="limited" value="N" checked="checked" /> {--NO--}
+ <input type="radio" id="limited_yes" onclick="return focusLimitedYes()" name="limited" value="Y" /> {--YES--}
</div>
<div class="member_input bottom" style="padding-top:5px;padding-bottom:5px">
- Aufrufe begrenzen auf: <input type="text" class="form_field" id="limit" name="limit" size="7" maxlength="20" value="-" />
+ Aufrufe begrenzen auf: <input type="text" onchange="return changeLimited()" onclick="return focusLimit()" onblur="return blurLimit()" class="form_field" id="limit" name="limit" size="7" maxlength="20" value="-" />
</div>
<div class="member_input" style="padding-top:5px;padding-bottom:5px">
<div class="member_input" style="padding-top:5px;padding-bottom:5px">
Soll die Anzahl Aufrufe begrenzt werden?<br />
- <input type="radio" id="limited_no" onfocus="return FocusLimitedNo()" name="limited" value="N" checked="checked" /> {--NO--}
- <input type="radio" id="limited_yes" onfocus="return FocusLimitedYes()" name="limited" value="Y" /> {--YES--}
+ <input type="radio" id="limited_no" onclick="return focusLimitedNo()" name="limited" value="N" checked="checked" /> {--NO--}
+ <input type="radio" id="limited_yes" onclick="return focusLimitedYes()" name="limited" value="Y" /> {--YES--}
</div>
<div class="member_input bottom" style="padding-top:5px;padding-bottom:5px">
- Aufrufe begrenzen auf: <input type="text" class="form_field" id="limit" name="limit" size="7" maxlength="20" value="-" />
+ Aufrufe begrenzen auf: <input type="text" class="form_field" onchange="return changeLimited()" onclick="return focusLimit()" onblur="return blurLimit()" id="limit" name="limit" size="7" maxlength="20" value="-" />
</div>
<div class="member_input" style="padding-top:5px;padding-bottom:5px">