Revision 1294
Added by Luisehahne over 15 years ago
| branches/2.8.x/CHANGELOG | ||
|---|---|---|
| 12 | 12 |  | 
| 13 | 13 | ------------------------------------- 2.8.1 ------------------------------------- | 
| 14 | 14 | 19-Feb-2010 Dietmar Woellbrink (Luisehahne) | 
| 15 | ! update headerinfo | |
| 16 | ! change $search_pattern for check if Javascript mailto encryption is enabled | |
| 17 | ! module output_filter set to version 0.12 | |
| 18 | 19-Feb-2010 Dietmar Woellbrink (Luisehahne) | |
| 15 | 19 | ! change show_menu2 to correct modul version 4.9 | 
| 16 | 20 | 19-Feb-2010 Dietmar Woellbrink (Luisehahne) | 
| 17 | 21 | ! insert $wb->preprocess($output), preprocess no longer needed in modules | 
| branches/2.8.x/wb/admin/interface/version.php | ||
|---|---|---|
| 52 | 52 |  | 
| 53 | 53 | // check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled) | 
| 54 | 54 | if(!defined('VERSION')) define('VERSION', '2.8.x');
 | 
| 55 | if(!defined('REVISION')) define('REVISION', '1293');
 | |
| 55 | if(!defined('REVISION')) define('REVISION', '1294');
 | |
| 56 | 56 |  | 
| 57 | 57 | ?> | 
| branches/2.8.x/wb/modules/droplets/example/EmailFilter.php | ||
|---|---|---|
| 36 | 36 | $output_filter_mode = ($filter_settings['email_filter'] == '1') ? 1 : 0; // 0|1 | 
| 37 | 37 |  | 
| 38 | 38 | // check if mailto mail addresses needs to be filtered | 
| 39 | if($filter_settings['mailto_filter'] == '1') {
 | |
| 39 | if($filter_settings['mailto_filter'] == '1') | |
| 40 | {
 | |
| 40 | 41 | $output_filter_mode = $output_filter_mode + 2; // 0|2 | 
| 41 | 42 |  | 
| 42 | // check if Javascript mailto encryption is enabled (call register_frontend_functions in the template) | |
| 43 | $search = '<script src="' .WB_URL .'/modules/droplets/js/mdcr.js" type="text/javascript"></script>'; | |
| 44 | 	if(strpos($wb_page_data, $search) !== false) { 
 | |
| 45 | $output_filter_mode = $output_filter_mode + 4; // 0|4 | |
| 46 | } | |
| 43 | // check if Javascript mailto encryption is enabled (call register_frontend_functions in the template) | |
| 44 | $search_pattern = '/<.*src=\".*\/mdcr.js.*>/iU'; | |
| 45 | if(preg_match($search_pattern, $wb_page_data)) | |
| 46 |         {
 | |
| 47 | $output_filter_mode = $output_filter_mode + 4; // 0|4 | |
| 48 | } | |
| 47 | 49 | } | 
| 48 | 50 |  | 
| 49 | 51 | // define some constants so we do not call the database in the callback function again | 
| 50 | 52 | |
| branches/2.8.x/wb/modules/output_filter/uninstall.php | ||
|---|---|---|
| 1 | <?php | |
| 2 |  | |
| 3 | // $Id$ | |
| 4 |  | |
| 5 | /* | |
| 6 |  | |
| 7 | Website Baker Project <http://www.websitebaker.org/> | |
| 8 | Copyright (C) 2004-2009, Ryan Djurovich | |
| 9 |  | |
| 10 | Website Baker is free software; you can redistribute it and/or modify | |
| 11 | it under the terms of the GNU General Public License as published by | |
| 12 | the Free Software Foundation; either version 2 of the License, or | |
| 13 | (at your option) any later version. | |
| 14 |  | |
| 15 | Website Baker is distributed in the hope that it will be useful, | |
| 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 18 | GNU General Public License for more details. | |
| 19 |  | |
| 20 | You should have received a copy of the GNU General Public License | |
| 21 | along with Website Baker; if not, write to the Free Software | |
| 22 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 23 |  | |
| 24 | */ | |
| 25 |  | |
| 26 | // prevent this file from being accessed directly | |
| 27 | if(!defined('WB_PATH')) die(header('Location: ../index.php'));
 | |
| 28 |  | |
| 29 | $table = TABLE_PREFIX .'mod_output_filter'; | |
| 30 | $database->query("DROP TABLE IF EXISTS `$table`");
 | |
| 31 |  | |
| 1 | <?php | |
| 2 | /** | |
| 3 | * | |
| 4 | * @category modules | |
| 5 | * @package output_filter | |
| 6 | * @author WebsiteBaker Project | |
| 7 | * @copyright 2004-2009, Ryan Djurovich | |
| 8 | * @copyright 2009-2010, Website Baker Org. e.V. | |
| 9 | * @link http://www.websitebaker2.org/ | |
| 10 | * @license http://www.gnu.org/licenses/gpl.html | |
| 11 | * @platform WebsiteBaker 2.8.x | |
| 12 | * @requirements PHP 4.4.9 and higher | |
| 13 | * @version $Id$ | |
| 14 | * @filesource $HeadURL$ | |
| 15 | * @lastmodified $Date$ | |
| 16 | * | |
| 17 | */ | |
| 18 |  | |
| 19 | // prevent this file from being accessed directly | |
| 20 | if(!defined('WB_PATH')) die(header('Location: ../index.php'));
 | |
| 21 |  | |
| 22 | $table = TABLE_PREFIX .'mod_output_filter'; | |
| 23 | $database->query("DROP TABLE IF EXISTS `$table`");
 | |
| 24 |  | |
| 32 | 25 | ?> | 
| 33 | 26 | |
| branches/2.8.x/wb/modules/output_filter/filter-routines.php | ||
|---|---|---|
| 1 | 1 | <?php | 
| 2 | /** | |
| 3 | * | |
| 4 | * @category modules | |
| 5 | * @package output_filter | |
| 6 | * @author WebsiteBaker Project | |
| 7 | * @copyright 2004-2009, Ryan Djurovich | |
| 8 | * @copyright 2009-2010, Website Baker Org. e.V. | |
| 9 | * @link http://www.websitebaker2.org/ | |
| 10 | * @license http://www.gnu.org/licenses/gpl.html | |
| 11 | * @platform WebsiteBaker 2.8.x | |
| 12 | * @requirements PHP 4.4.9 and higher | |
| 13 | * @version $Id$ | |
| 14 | * @filesource $HeadURL$ | |
| 15 | * @lastmodified $Date$ | |
| 16 | * | |
| 17 | */ | |
| 2 | 18 |  | 
| 3 | // $Id$ | |
| 4 |  | |
| 5 | /* | |
| 6 |  | |
| 7 | Website Baker Project <http://www.websitebaker.org/> | |
| 8 | Copyright (C) 2004-2009, Ryan Djurovich | |
| 9 |  | |
| 10 | Website Baker is free software; you can redistribute it and/or modify | |
| 11 | it under the terms of the GNU General Public License as published by | |
| 12 | the Free Software Foundation; either version 2 of the License, or | |
| 13 | (at your option) any later version. | |
| 14 |  | |
| 15 | Website Baker is distributed in the hope that it will be useful, | |
| 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 18 | GNU General Public License for more details. | |
| 19 |  | |
| 20 | You should have received a copy of the GNU General Public License | |
| 21 | along with Website Baker; if not, write to the Free Software | |
| 22 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 23 | * @category frontend | |
| 24 | * @package outputfilter | |
| 25 | * @author(s) Dietmar W?llbrink <Luisehahne>, Dietrich Roland Pehlke <Aldus> | |
| 26 | * @platform WB 2.8.0 | |
| 27 | * @require PHP 5.2.x | |
| 28 | * @license http://www.gnu.org/licenses/gpl.html | |
| 29 | * @link http://project.websitebaker2.org/browser/branches/2.8.x/wb/modules/output_filter/filter-routines.php | |
| 30 | * @changeset 2009/12/03 change searchstring mdcr.js, workout crypt emails | |
| 31 |  | |
| 32 | */ | |
| 33 |  | |
| 34 | 19 | // prevent this file from being accessed directly | 
| 35 | 20 | if(!defined('WB_PATH')) die(header('Location: ../index.php'));
 | 
| 36 | 21 |  | 
| ... | ... | |
| 83 | 68 | // check if mailto mail addresses needs to be filtered | 
| 84 | 69 | 		if($filter_settings['mailto_filter'] == '1') {
 | 
| 85 | 70 | $output_filter_mode = $output_filter_mode + 2; // 0|2 | 
| 86 |  | |
| 71 |  | |
| 87 | 72 | // check if Javascript mailto encryption is enabled (call register_frontend_functions in the template) | 
| 73 | $search_pattern = '/<.*src=\".*\/mdcr.js.*>/iU'; | |
| 74 | if(preg_match($search_pattern, $content)) | |
| 75 |            {
 | |
| 76 | $output_filter_mode = $output_filter_mode + 4; // 0|4 | |
| 77 | } | |
| 78 | /* | |
| 88 | 79 | $search = '<script src="' .WB_URL .'/modules/output_filter/js/mdcr.js" type="text/javascript"></script>'; | 
| 89 | 80 | $search_droplet = '<script src="' .WB_URL .'/modules/droplets/js/mdcr.js" type="text/javascript"></script>'; | 
| 90 | 			if(strpos($content, $search) !== false || strpos($content, $search_droplet) !== false) { 
 | |
| 81 | 			if(strpos($content, $search) !== false || strpos($content, $search_droplet) !== false) {
 | |
| 91 | 82 | $output_filter_mode = $output_filter_mode + 4; // 0|4 | 
| 92 | 83 | } | 
| 84 | */ | |
| 93 | 85 | } | 
| 94 | 86 |  | 
| 95 | 87 | // define some constants so we do not call the database in the callback function again | 
| 96 | 88 | |
| branches/2.8.x/wb/modules/output_filter/info.php | ||
|---|---|---|
| 1 | <?php | |
| 2 |  | |
| 3 | // $Id$ | |
| 4 |  | |
| 5 | /* | |
| 6 |  | |
| 7 | Website Baker Project <http://www.websitebaker.org/> | |
| 8 | Copyright (C) 2004-2009, Ryan Djurovich | |
| 9 |  | |
| 10 | Website Baker is free software; you can redistribute it and/or modify | |
| 11 | it under the terms of the GNU General Public License as published by | |
| 12 | the Free Software Foundation; either version 2 of the License, or | |
| 13 | (at your option) any later version. | |
| 14 |  | |
| 15 | Website Baker is distributed in the hope that it will be useful, | |
| 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 18 | GNU General Public License for more details. | |
| 19 |  | |
| 20 | You should have received a copy of the GNU General Public License | |
| 21 | along with Website Baker; if not, write to the Free Software | |
| 22 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 23 |  | |
| 24 | ----------------------------------------------------------------------------------------- | |
| 25 | Output Filter tool for Website Baker v2.7 | |
| 26 | Licencsed under GNU, written by Christian Sommer (Doc) | |
| 27 | ----------------------------------------------------------------------------------------- | |
| 28 | v0.11 (Chritian Sommer; 06 Feb, 2008) | |
| 29 | ~ renamed module to output filter, splitted email filter in two functions (text emails, mailto links) | |
| 30 |  | |
| 31 | v0.10 (Christian Sommer; 21 Jan, 2008) | |
| 32 | ~ initial module release (Note: requires WB 2.7 core file changes to work) | |
| 33 |  | |
| 34 | */ | |
| 35 |  | |
| 36 | $module_directory = 'output_filter'; | |
| 37 | $module_name = 'Frontend Output Filter'; | |
| 38 | $module_function = 'tool'; | |
| 39 | $module_version = '0.11'; | |
| 40 | $module_platform = '2.7 | 2.8.x'; | |
| 41 | $module_author = 'Christian Sommer (doc)'; | |
| 42 | $module_license = 'GNU General Public License'; | |
| 43 | $module_description = 'This module allows to filter the output before displaying it on the frontend. Support for filtering mailto links and mail addresses in strings.'; | |
| 44 |  | |
| 1 | <?php | |
| 2 | /** | |
| 3 | * | |
| 4 | * @category modules | |
| 5 | * @package output_filter | |
| 6 | * @author WebsiteBaker Project | |
| 7 | * @copyright 2004-2009, Ryan Djurovich | |
| 8 | * @copyright 2009-2010, Website Baker Org. e.V. | |
| 9 | * @link http://www.websitebaker2.org/ | |
| 10 | * @license http://www.gnu.org/licenses/gpl.html | |
| 11 | * @platform WebsiteBaker 2.8.x | |
| 12 | * @requirements PHP 4.4.9 and higher | |
| 13 | * @version $Id$ | |
| 14 | * @filesource $HeadURL$ | |
| 15 | * @lastmodified $Date$ | |
| 16 | * | |
| 17 | */ | |
| 18 |  | |
| 19 |  | |
| 20 | $module_directory = 'output_filter'; | |
| 21 | $module_name = 'Frontend Output Filter'; | |
| 22 | $module_function = 'tool'; | |
| 23 | $module_version = '0.12'; | |
| 24 | $module_platform = '2.7 | 2.8.x'; | |
| 25 | $module_author = 'Christian Sommer (doc)'; | |
| 26 | $module_license = 'GNU General Public License'; | |
| 27 | $module_description = 'This module allows to filter the output before displaying it on the frontend. Support for filtering mailto links and mail addresses in strings.'; | |
| 28 |  | |
| 45 | 29 | ?> | 
| 46 | 30 | |
| branches/2.8.x/wb/modules/output_filter/tool.php | ||
|---|---|---|
| 1 | <?php | |
| 2 |  | |
| 3 | // $Id$ | |
| 4 |  | |
| 5 | /* | |
| 6 |  | |
| 7 | Website Baker Project <http://www.websitebaker.org/> | |
| 8 | Copyright (C) 2004-2009, Ryan Djurovich | |
| 9 |  | |
| 10 | Website Baker is free software; you can redistribute it and/or modify | |
| 11 | it under the terms of the GNU General Public License as published by | |
| 12 | the Free Software Foundation; either version 2 of the License, or | |
| 13 | (at your option) any later version. | |
| 14 |  | |
| 15 | Website Baker is distributed in the hope that it will be useful, | |
| 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 18 | GNU General Public License for more details. | |
| 19 |  | |
| 20 | You should have received a copy of the GNU General Public License | |
| 21 | along with Website Baker; if not, write to the Free Software | |
| 22 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 23 |  | |
| 24 | */ | |
| 25 |  | |
| 26 | // prevent this file from being accessed directly | |
| 27 | if(!defined('WB_PATH')) die(header('Location: ../index.php'));
 | |
| 28 |  | |
| 29 | // check if module language file exists for the language set by the user (e.g. DE, EN) | |
| 30 | $MOD_MAIL_FILTER['WARNING'] = '<p style="color: red; line-height:1.5em;"><strong>Warning: </strong>This function is now available as a Droplet. The next major release of website baker will not include this filter anymore. Please concider using the <a href="?tool=droplets">Droplet</a> [[EmailFilter]]</p>'; | |
| 31 | if(!file_exists(WB_PATH .'/modules/output_filter/languages/'.LANGUAGE .'.php')) {
 | |
| 32 | // no module language file exists for the language set by the user, include default module language file EN.php | |
| 33 | require_once(WB_PATH .'/modules/output_filter/languages/EN.php'); | |
| 34 | } else {
 | |
| 35 | // a module language file exists for the language defined by the user, load it | |
| 36 | require_once(WB_PATH .'/modules/output_filter/languages/'.LANGUAGE .'.php'); | |
| 37 | } | |
| 38 | // check if data was submitted | |
| 39 | if(isset($_POST['save_settings'])) {
 | |
| 40 | // get overall output filter settings | |
| 41 | $email_filter = (isset($_POST['email_filter']) && $_POST['email_filter'] == '1') ? '1' : '0'; | |
| 42 | $mailto_filter = (isset($_POST['mailto_filter']) && $_POST['mailto_filter'] == '1') ? '1' : '0'; | |
| 43 |  | |
| 44 | // get email replacement settings | |
| 45 | $at_replacement = isset($_POST['at_replacement']) ?strip_tags($_POST['at_replacement']) : ''; | |
| 46 | $at_replacement = (strlen(trim($at_replacement)) > 0) ? $admin->add_slashes($at_replacement) : '(at)'; | |
| 47 | $dot_replacement = isset($_POST['dot_replacement']) ?strip_tags($_POST['dot_replacement']) : ''; | |
| 48 | $dot_replacement = (strlen(trim($dot_replacement)) > 0) ? $admin->add_slashes($dot_replacement) : '(dot)'; | |
| 49 |  | |
| 50 | // update database settings | |
| 51 | 	$database->query("UPDATE " .TABLE_PREFIX ."mod_output_filter SET email_filter = '$email_filter', 
 | |
| 52 | mailto_filter = '$mailto_filter', at_replacement = '$at_replacement', dot_replacement = '$dot_replacement'"); | |
| 53 |  | |
| 54 | // check if there is a database error, otherwise say successful | |
| 55 | 	if($database->is_error()) {
 | |
| 56 | $admin->print_error($database->get_error(), $js_back); | |
| 57 | 	} else {
 | |
| 58 | $admin->print_success($MESSAGE['PAGES']['SAVED'], ADMIN_URL.'/admintools/tool.php?tool=output_filter'); | |
| 59 | } | |
| 60 |  | |
| 61 | } else {
 | |
| 62 | // write out heading | |
| 63 | echo '<h2>' .$MOD_MAIL_FILTER['HEADING'] .'</h2>'; | |
| 64 |  | |
| 65 | // include filter functions | |
| 66 | require_once(WB_PATH .'/modules/output_filter/filter-routines.php'); | |
| 67 |  | |
| 68 | // read the mail filter settings from the database | |
| 69 | $data = get_output_filter_settings(); | |
| 70 |  | |
| 71 | // output the form with values from the database | |
| 72 | echo '<p>' .$MOD_MAIL_FILTER['HOWTO'] .'</p>'; | |
| 73 | echo $MOD_MAIL_FILTER['WARNING']; | |
| 74 | ?> | |
| 75 | <form name="store_settings" action="<?php echo $_SERVER['REQUEST_URI'];?>" method="post"> | |
| 76 | <table width="98%" cellspacing="0" cellpadding="5px" class="row_a"> | |
| 77 | <tr><td colspan="2"><strong><?php echo $MOD_MAIL_FILTER['BASIC_CONF'];?>:</strong></td></tr> | |
| 78 | <tr> | |
| 79 | <td width="35%"><?php echo $MOD_MAIL_FILTER['EMAIL_FILTER'];?>:</td> | |
| 80 | <td> | |
| 81 | <input type="radio" <?php echo ($data['email_filter']=='1') ?'checked="checked"' :'';?> | |
| 82 | name="email_filter" value="1"><?php echo $MOD_MAIL_FILTER['ENABLED'];?> | |
| 83 | <input type="radio" <?php echo (($data['email_filter'])=='0') ?'checked="checked"' :'';?> | |
| 84 | name="email_filter" value="0"><?php echo $MOD_MAIL_FILTER['DISABLED'];?> | |
| 85 | </td> | |
| 86 | </tr> | |
| 87 | <tr> | |
| 88 | <td><?php echo $MOD_MAIL_FILTER['MAILTO_FILTER'];?>:</td> | |
| 89 | <td> | |
| 90 | <input type="radio" <?php echo ($data['mailto_filter']=='1') ?'checked="checked"' :'';?> | |
| 91 | name="mailto_filter" value="1"><?php echo $MOD_MAIL_FILTER['ENABLED'];?> | |
| 92 | <input type="radio" <?php echo (($data['mailto_filter'])=='0') ?'checked="checked"' :'';?> | |
| 93 | name="mailto_filter" value="0"><?php echo $MOD_MAIL_FILTER['DISABLED'];?> | |
| 94 | </td> | |
| 95 | </tr> | |
| 96 | <tr><td colspan="2"><br /><strong><?php echo $MOD_MAIL_FILTER['REPLACEMENT_CONF'];?>:</strong></td></tr> | |
| 97 | <tr> | |
| 98 | <td><?php echo $MOD_MAIL_FILTER['AT_REPLACEMENT'];?>:</td> | |
| 99 | <td><input type="text" style="width: 160px" value="<?php echo $data['at_replacement'];?>" | |
| 100 | name="at_replacement"/></td> | |
| 101 | </tr> | |
| 102 | <tr> | |
| 103 | <td><?php echo $MOD_MAIL_FILTER['DOT_REPLACEMENT'];?>:</td> | |
| 104 | <td><input type="text" style="width: 160px" value="<?php echo $data['dot_replacement'];?>" | |
| 105 | name="dot_replacement"/></td> | |
| 106 | </tr> | |
| 107 | </table> | |
| 108 | <input type="submit" name="save_settings" style="margin-top:10px; width:140px;" value="<?php echo $TEXT['SAVE']; ?>" /> | |
| 109 | </form> | |
| 110 | <?php | |
| 111 | } | |
| 112 |  | |
| 113 | ?> | |
| 1 | <?php | |
| 2 | /** | |
| 3 | * | |
| 4 | * @category modules | |
| 5 | * @package output_filter | |
| 6 | * @author WebsiteBaker Project | |
| 7 | * @copyright 2004-2009, Ryan Djurovich | |
| 8 | * @copyright 2009-2010, Website Baker Org. e.V. | |
| 9 | * @link http://www.websitebaker2.org/ | |
| 10 | * @license http://www.gnu.org/licenses/gpl.html | |
| 11 | * @platform WebsiteBaker 2.8.x | |
| 12 | * @requirements PHP 4.4.9 and higher | |
| 13 | * @version $Id$ | |
| 14 | * @filesource $HeadURL$ | |
| 15 | * @lastmodified $Date$ | |
| 16 | * | |
| 17 | */ | |
| 18 |  | |
| 19 | // prevent this file from being accessed directly | |
| 20 | if(!defined('WB_PATH')) die(header('Location: ../index.php'));
 | |
| 21 |  | |
| 22 | // check if module language file exists for the language set by the user (e.g. DE, EN) | |
| 23 | $MOD_MAIL_FILTER['WARNING'] = '<p style="color: red; line-height:1.5em;"><strong>Warning: </strong>This function is now available as a Droplet. The next major release of website baker will not include this filter anymore. Please concider using the <a href="?tool=droplets">Droplet</a> [[EmailFilter]]</p>'; | |
| 24 | if(!file_exists(WB_PATH .'/modules/output_filter/languages/'.LANGUAGE .'.php')) {
 | |
| 25 | // no module language file exists for the language set by the user, include default module language file EN.php | |
| 26 | require_once(WB_PATH .'/modules/output_filter/languages/EN.php'); | |
| 27 | } else {
 | |
| 28 | // a module language file exists for the language defined by the user, load it | |
| 29 | require_once(WB_PATH .'/modules/output_filter/languages/'.LANGUAGE .'.php'); | |
| 30 | } | |
| 31 | // check if data was submitted | |
| 32 | if(isset($_POST['save_settings'])) {
 | |
| 33 | // get overall output filter settings | |
| 34 | $email_filter = (isset($_POST['email_filter']) && $_POST['email_filter'] == '1') ? '1' : '0'; | |
| 35 | $mailto_filter = (isset($_POST['mailto_filter']) && $_POST['mailto_filter'] == '1') ? '1' : '0'; | |
| 36 |  | |
| 37 | // get email replacement settings | |
| 38 | $at_replacement = isset($_POST['at_replacement']) ?strip_tags($_POST['at_replacement']) : ''; | |
| 39 | $at_replacement = (strlen(trim($at_replacement)) > 0) ? $admin->add_slashes($at_replacement) : '(at)'; | |
| 40 | $dot_replacement = isset($_POST['dot_replacement']) ?strip_tags($_POST['dot_replacement']) : ''; | |
| 41 | $dot_replacement = (strlen(trim($dot_replacement)) > 0) ? $admin->add_slashes($dot_replacement) : '(dot)'; | |
| 42 |  | |
| 43 | // update database settings | |
| 44 | 	$database->query("UPDATE " .TABLE_PREFIX ."mod_output_filter SET email_filter = '$email_filter', 
 | |
| 45 | mailto_filter = '$mailto_filter', at_replacement = '$at_replacement', dot_replacement = '$dot_replacement'"); | |
| 46 |  | |
| 47 | // check if there is a database error, otherwise say successful | |
| 48 | 	if($database->is_error()) {
 | |
| 49 | $admin->print_error($database->get_error(), $js_back); | |
| 50 | 	} else {
 | |
| 51 | $admin->print_success($MESSAGE['PAGES']['SAVED'], ADMIN_URL.'/admintools/tool.php?tool=output_filter'); | |
| 52 | } | |
| 53 |  | |
| 54 | } else {
 | |
| 55 | // write out heading | |
| 56 | echo '<h2>' .$MOD_MAIL_FILTER['HEADING'] .'</h2>'; | |
| 57 |  | |
| 58 | // include filter functions | |
| 59 | require_once(WB_PATH .'/modules/output_filter/filter-routines.php'); | |
| 60 |  | |
| 61 | // read the mail filter settings from the database | |
| 62 | $data = get_output_filter_settings(); | |
| 63 |  | |
| 64 | // output the form with values from the database | |
| 65 | echo '<p>' .$MOD_MAIL_FILTER['HOWTO'] .'</p>'; | |
| 66 | echo $MOD_MAIL_FILTER['WARNING']; | |
| 67 | ?> | |
| 68 | <form name="store_settings" action="<?php echo $_SERVER['REQUEST_URI'];?>" method="post"> | |
| 69 | <table width="98%" cellspacing="0" cellpadding="5px" class="row_a"> | |
| 70 | <tr><td colspan="2"><strong><?php echo $MOD_MAIL_FILTER['BASIC_CONF'];?>:</strong></td></tr> | |
| 71 | <tr> | |
| 72 | <td width="35%"><?php echo $MOD_MAIL_FILTER['EMAIL_FILTER'];?>:</td> | |
| 73 | <td> | |
| 74 | <input type="radio" <?php echo ($data['email_filter']=='1') ?'checked="checked"' :'';?> | |
| 75 | name="email_filter" value="1"><?php echo $MOD_MAIL_FILTER['ENABLED'];?> | |
| 76 | <input type="radio" <?php echo (($data['email_filter'])=='0') ?'checked="checked"' :'';?> | |
| 77 | name="email_filter" value="0"><?php echo $MOD_MAIL_FILTER['DISABLED'];?> | |
| 78 | </td> | |
| 79 | </tr> | |
| 80 | <tr> | |
| 81 | <td><?php echo $MOD_MAIL_FILTER['MAILTO_FILTER'];?>:</td> | |
| 82 | <td> | |
| 83 | <input type="radio" <?php echo ($data['mailto_filter']=='1') ?'checked="checked"' :'';?> | |
| 84 | name="mailto_filter" value="1"><?php echo $MOD_MAIL_FILTER['ENABLED'];?> | |
| 85 | <input type="radio" <?php echo (($data['mailto_filter'])=='0') ?'checked="checked"' :'';?> | |
| 86 | name="mailto_filter" value="0"><?php echo $MOD_MAIL_FILTER['DISABLED'];?> | |
| 87 | </td> | |
| 88 | </tr> | |
| 89 | <tr><td colspan="2"><br /><strong><?php echo $MOD_MAIL_FILTER['REPLACEMENT_CONF'];?>:</strong></td></tr> | |
| 90 | <tr> | |
| 91 | <td><?php echo $MOD_MAIL_FILTER['AT_REPLACEMENT'];?>:</td> | |
| 92 | <td><input type="text" style="width: 160px" value="<?php echo $data['at_replacement'];?>" | |
| 93 | name="at_replacement"/></td> | |
| 94 | </tr> | |
| 95 | <tr> | |
| 96 | <td><?php echo $MOD_MAIL_FILTER['DOT_REPLACEMENT'];?>:</td> | |
| 97 | <td><input type="text" style="width: 160px" value="<?php echo $data['dot_replacement'];?>" | |
| 98 | name="dot_replacement"/></td> | |
| 99 | </tr> | |
| 100 | </table> | |
| 101 | <input type="submit" name="save_settings" style="margin-top:10px; width:140px;" value="<?php echo $TEXT['SAVE']; ?>" /> | |
| 102 | </form> | |
| 103 | <?php | |
| 104 | } | |
| 105 |  | |
| 106 | ?> | |
| 114 | 107 | |
| branches/2.8.x/wb/modules/output_filter/install.php | ||
|---|---|---|
| 1 | <?php | |
| 2 |  | |
| 3 | // $Id$ | |
| 4 |  | |
| 5 | /* | |
| 6 |  | |
| 7 | Website Baker Project <http://www.websitebaker.org/> | |
| 8 | Copyright (C) 2004-2009, Ryan Djurovich | |
| 9 |  | |
| 10 | Website Baker is free software; you can redistribute it and/or modify | |
| 11 | it under the terms of the GNU General Public License as published by | |
| 12 | the Free Software Foundation; either version 2 of the License, or | |
| 13 | (at your option) any later version. | |
| 14 |  | |
| 15 | Website Baker is distributed in the hope that it will be useful, | |
| 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 18 | GNU General Public License for more details. | |
| 19 |  | |
| 20 | You should have received a copy of the GNU General Public License | |
| 21 | along with Website Baker; if not, write to the Free Software | |
| 22 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 23 |  | |
| 24 | */ | |
| 25 |  | |
| 26 | // prevent this file from being accessed directly | |
| 27 | if(!defined('WB_PATH')) die(header('Location: ../index.php'));
 | |
| 28 |  | |
| 29 | $table = TABLE_PREFIX .'mod_output_filter'; | |
| 30 | $database->query("DROP TABLE IF EXISTS `$table`");
 | |
| 31 |  | |
| 32 | $database->query("CREATE TABLE `$table` (
 | |
| 33 | `email_filter` VARCHAR(1) NOT NULL DEFAULT '0', | |
| 34 | `mailto_filter` VARCHAR(1) NOT NULL DEFAULT '0', | |
| 35 | `at_replacement` VARCHAR(255) NOT NULL DEFAULT '(at)', | |
| 36 | `dot_replacement` VARCHAR(255) NOT NULL DEFAULT '(dot)' | |
| 37 | )" | |
| 38 | ); | |
| 39 |  | |
| 40 | // add default values to the module table | |
| 41 | $database->query("INSERT INTO ".TABLE_PREFIX
 | |
| 42 | 	."mod_output_filter (email_filter, mailto_filter, at_replacement, dot_replacement) VALUES ('0', '0', '(at)', '(dot)')");
 | |
| 43 |  | |
| 1 | <?php | |
| 2 | /** | |
| 3 | * | |
| 4 | * @category modules | |
| 5 | * @package output_filter | |
| 6 | * @author WebsiteBaker Project | |
| 7 | * @copyright 2004-2009, Ryan Djurovich | |
| 8 | * @copyright 2009-2010, Website Baker Org. e.V. | |
| 9 | * @link http://www.websitebaker2.org/ | |
| 10 | * @license http://www.gnu.org/licenses/gpl.html | |
| 11 | * @platform WebsiteBaker 2.8.x | |
| 12 | * @requirements PHP 4.4.9 and higher | |
| 13 | * @version $Id$ | |
| 14 | * @filesource $HeadURL$ | |
| 15 | * @lastmodified $Date$ | |
| 16 | * | |
| 17 | */ | |
| 18 |  | |
| 19 | // prevent this file from being accessed directly | |
| 20 | if(!defined('WB_PATH')) die(header('Location: ../index.php'));
 | |
| 21 |  | |
| 22 | $table = TABLE_PREFIX .'mod_output_filter'; | |
| 23 | $database->query("DROP TABLE IF EXISTS `$table`");
 | |
| 24 |  | |
| 25 | $database->query("CREATE TABLE `$table` (
 | |
| 26 | `email_filter` VARCHAR(1) NOT NULL DEFAULT '0', | |
| 27 | `mailto_filter` VARCHAR(1) NOT NULL DEFAULT '0', | |
| 28 | `at_replacement` VARCHAR(255) NOT NULL DEFAULT '(at)', | |
| 29 | `dot_replacement` VARCHAR(255) NOT NULL DEFAULT '(dot)' | |
| 30 | )" | |
| 31 | ); | |
| 32 |  | |
| 33 | // add default values to the module table | |
| 34 | $database->query("INSERT INTO ".TABLE_PREFIX
 | |
| 35 | 	."mod_output_filter (email_filter, mailto_filter, at_replacement, dot_replacement) VALUES ('0', '0', '(at)', '(dot)')");
 | |
| 36 |  | |
| 44 | 37 | ?> | 
| 45 | 38 | |
| branches/2.8.x/wb/modules/output_filter/index.php | ||
|---|---|---|
| 1 | <?php | |
| 2 |  | |
| 3 | // $Id$ | |
| 4 |  | |
| 5 | /* | |
| 6 |  | |
| 7 | Website Baker Project <http://www.websitebaker.org/> | |
| 8 | Copyright (C) 2004-2009, Ryan Djurovich | |
| 9 |  | |
| 10 | Website Baker is free software; you can redistribute it and/or modify | |
| 11 | it under the terms of the GNU General Public License as published by | |
| 12 | the Free Software Foundation; either version 2 of the License, or | |
| 13 | (at your option) any later version. | |
| 14 |  | |
| 15 | Website Baker is distributed in the hope that it will be useful, | |
| 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 18 | GNU General Public License for more details. | |
| 19 |  | |
| 20 | You should have received a copy of the GNU General Public License | |
| 21 | along with Website Baker; if not, write to the Free Software | |
| 22 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 23 |  | |
| 24 | */ | |
| 25 |  | |
| 26 | header('Location: ../index.php');
 | |
| 27 |  | |
| 1 | <?php | |
| 2 | /** | |
| 3 | * | |
| 4 | * @category modules | |
| 5 | * @package output_filter | |
| 6 | * @author WebsiteBaker Project | |
| 7 | * @copyright 2004-2009, Ryan Djurovich | |
| 8 | * @copyright 2009-2010, Website Baker Org. e.V. | |
| 9 | * @link http://www.websitebaker2.org/ | |
| 10 | * @license http://www.gnu.org/licenses/gpl.html | |
| 11 | * @platform WebsiteBaker 2.8.x | |
| 12 | * @requirements PHP 4.4.9 and higher | |
| 13 | * @version $Id$ | |
| 14 | * @filesource $HeadURL$ | |
| 15 | * @lastmodified $Date$ | |
| 16 | * | |
| 17 | */ | |
| 18 |  | |
| 19 | header('Location: ../index.php');
 | |
| 20 |  | |
| 28 | 21 | ?> | 
| 29 | 22 | |
Also available in: Unified diff
update headerinfo
change $search_pattern for check if Javascript mailto encryption is enabled
module output_filter set to version 0.12