File: /var/www/vhosts/paiskincare.com/httpdocs2/monkey75/mailbeez.php
<?php
/*
MailBeez Automatic Trigger Email Campaigns
http://www.mailbeez.com
Copyright (c) 2010 MailBeez
inspired and in parts based on
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
V1.7
*/
// Before changing the code please read:
//
// the developement of mailbeez is still ongoing and months have spend so far
// feel free do adopt your code, but please be fair to link back to mailbeez.com
// or even donate if you are thinking about earning money
//
//
// Are you a Shop-Hoster, Agency or Consultant working with osCommerce, Zen Cart, CRE Loaded, xtCommerce or similar system?
//
// Do you want to become Trustpilot affiliate and receive an attractive commission for new Trustpilot Partners?
// (A Trustpilot Partner is a shop using Trustpilot to collect buyers ratings)
//
// please contact:
//
// affiliate@mailbeez.com
//
//
//
// define('STRICT_ERROR_REPORTING', true);
require('includes/application_top.php');
require_once(DIR_FS_CATALOG. 'mailhive/common/functions/compatibility.php');
// include the modules language translations
// load language file for modules.php
if (MH_PLATFORM == 'zencart') {
$current_page = basename(FILENAME_MODULES.'.php');
if (file_exists(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $current_page)) {
include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . $current_page);
}
} elseif (MH_PLATFORM == 'xtc' || MH_PLATFORM == 'gambio') {
$current_page = basename(FILENAME_MODULES);
if (file_exists(DIR_FS_LANGUAGES . $_SESSION['language'] . '/admin/'.$current_page)) {
include(DIR_FS_LANGUAGES . $_SESSION['language'] . '/admin/'. $current_page);
}
} else {
if (file_exists(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . FILENAME_MODULES)) {
include(DIR_WS_LANGUAGES . $_SESSION['language'] . '/' . FILENAME_MODULES);
}
}
if (defined('ENABLE_SSL_ADMIN')) {
// by default zencart
define('MH_CATALOG_SERVER', (ENABLE_SSL_ADMIN == 'true') ? HTTPS_CATALOG_SERVER : HTTP_CATALOG_SERVER);
} else {
define('MH_CATALOG_SERVER', (ENABLE_SSL == 'true') ? HTTPS_CATALOG_SERVER : HTTP_CATALOG_SERVER);
}
$set = (isset($_GET['set']) ? $_GET['set'] : '');
$module_type = '';
$module_directory = DIR_FS_CATALOG . 'mailhive/mailbeez/';
$module_directory_ws = DIR_WS_CATALOG . 'mailhive/mailbeez/';
$module_key = 'MAILBEEZ_INSTALLED';
$module_version_key = 'MAILBEEZ_INSTALLED_VERSIONS';
define('HEADING_TITLE', 'MailBeez - Automatic Trigger Email Campaigns');
define('TEXT_DOCUMENTATION', 'Documentation available');
define('TEXT_VIEW_ONLINE', 'View Online');
define('TEXT_UPGRADE_MAILBEEZ', 'This Module requires MailBeez Version %s or higher. Please update MailBeez.');
define('WARNING_SIMULATE', 'SIMULATION-MODE: no emails are send');
define('WARNING_OFFLINE', 'DISABLED: MailBeez are not processed');
define('MAILBEEZ_MAILHIVE_URL', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . FILENAME_HIVE . '?' . MAILBEEZ_MAILHIVE_TOKEN . '=');
// adjustments need to be done in mailbeez_check.php as well
define('MAILBEEZ_VERSION_CHECK_SERVER', 'http://www.mailbeez.com');
//define('MAILBEEZ_VERSION_CHECK_SERVER', 'http://127.0.0.1/wordpress');
define('MAILBEEZ_VERSION_CHECK_URL', MAILBEEZ_VERSION_CHECK_SERVER . '/downloads/version_check/?v='. MAILBEEZ_VERSION . '&m=' . ( defined('MAILBEEZ_INSTALLED_VERSIONS') ? MAILBEEZ_INSTALLED_VERSIONS : '') . '&p=' . urlencode(MH_PLATFORM . ' - ' . PROJECT_VERSION) );
$paypal = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="B34YLG87ZC5H8">
<input type="image" src="https://www.paypal.com/en_GB/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>';
$trustpilot_evaluate = 'http://www.trustpilot.com/evaluate/www.mailbeez.com';
$action = (isset($_GET['action']) ? $_GET['action'] : '');
$custom_app_include = '';
if (mh_not_null($action)) {
if (function_exists('tep_reset_config_cache_block')) {
tep_reset_config_cache_block('includes/config-cache.php');
}
if (function_exists('updateConfiguration')) {
updateConfiguration();
}
switch ($action) {
case 'save':
while (list($key, $value) = each($_POST['configuration'])) {
mh_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'");
}
mh_redirect(mh_href_link(FILENAME_MAILBEEZ, 'set=' . $set . '&module=' . $_GET['module']));
break;
case 'install':
case 'remove':
if ( isset($PHP_SELF) && $PHP_SELF != '' ) {
// oscommerce, zencart
$file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
} else {
// xtc
$file_extension = substr($_SERVER['PHP_SELF'], strrpos($_SERVER['PHP_SELF'], '.'));
}
$class = basename($_GET['module']);
if (file_exists($module_directory . $class . $file_extension)) {
include($module_directory . $class . $file_extension);
$module = new $class;
if ($action == 'install') {
$module->install();
} elseif ($action == 'remove') {
$module->remove();
}
}
mh_redirect(mh_href_link(FILENAME_MAILBEEZ, 'set=' . $set . '&module=' . $class));
break;
}
}
$app_include = (isset($_GET['app']) ? $_GET['app'] : '');
if ($app_include = 'load_app') {
$custom_app_include = ( isset($_GET['app_path']) ) ? $_GET['app_path'] : '';
}
if (!function_exists('sortbyintvalue')) {
function sortbyintvalue($a,$b) {
$aint = (int)$a;
$bint = (int)$b;
if ($aint == $bint) $r = 0;
if ($aint < $bint) $r = -1;
if ($aint > $bint) $r = 1;
return $r;
}
}
if (MAILBEEZ_MAILHIVE_MODE == 'simulate') {
$messageStack->reset();
$messageStack->add(WARNING_SIMULATE, 'warning');
}
if (MAILBEEZ_MAILHIVE_STATUS == 'False') {
$messageStack->reset();
//$messageStack->add(WARNING_OFFLINE, 'warning');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<?php if (MH_PLATFORM == 'zencart'): ?>
<link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
<script language="javascript" src="includes/menu.js"></script>
<?php endif ?>
<script language="javascript" src="includes/general.js"></script>
<?php if (MH_PLATFORM != 'gambio' ) :
// cut this part out for gambio
?>
<?php if (MAILBEEZ_MAILHIVE_POPUP_MODE == 'CeeBox') { ?>
<script language="javascript" src="<?php echo MH_CATALOG_SERVER . DIR_WS_CATALOG ?>/mailhive/common/js/jquery-1.3.2.min.js"></script>
<script language="javascript" src="<?php echo MH_CATALOG_SERVER . DIR_WS_CATALOG ?>/mailhive/common/js/ceebox/js/jquery.ceebox-min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery(".ceebox").ceebox({overlayOpacity:0.0, animSpeed: 100, fadeIn: 0, titles: false });
});
</script>
<?php } else { ?>
<?php } ?>
<?php
// end -cut this part out for gambio
endif; ?>
<link rel="stylesheet" type="text/css" href="<?php echo MH_CATALOG_SERVER . DIR_WS_CATALOG ?>/mailhive/common/js/ceebox/css/ceebox_mh.css" >
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
<!-- header //-->
<?php
if ( MH_PLATFORM != 'digistore') {
// cut out for digistore
require(DIR_WS_INCLUDES . 'header.php');
}
?>
<!-- header_eof //-->
<!-- body //-->
<?php if ( MH_PLATFORM == 'digistore') { ?>
<table width="1000px" border="0" align="center" cellpadding="10" cellspacing="0" bgcolor="#FFFFFF" style="border:solid 1px; border-color:#999999;">
<?php } else { ?>
<table border="0" width="100%" cellspacing="2" cellpadding="2">
<?php } ?>
<tr>
<?php if (MH_PLATFORM != 'zencart' && MH_PLATFORM != 'digistore') :
// cut this part out for ZenCart and Digistore
?>
<td
<?php if (preg_match('/xtcModified/', PROJECT_VERSION )): ?>class="columnLeft2"<?php endif; ?> width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<?php if (MAILBEEZ_MAILHIVE_POPUP_MODE == 'CeeBox' || MH_PLATFORM == 'gambio') { ?>
<script language="javascript" src="<?php echo MH_CATALOG_SERVER . DIR_WS_CATALOG ?>/mailhive/common/js/jquery-1.3.2.min.js"></script>
<?php if (MH_PLATFORM == 'gambio') :
// only for gambio
?>
<!-- gambio -->
<script type="text/javascript" src="<?php echo DIR_WS_CATALOG; ?>gm/javascript/jquery/ui.base.js"></script>
<script type="text/javascript" src="<?php echo DIR_WS_CATALOG; ?>gm/javascript/jquery/ui.draggable.js"></script>
<script type="text/javascript" src="<?php echo DIR_WS_CATALOG; ?>gm/javascript/jquery/ui.droppable.js"></script>
<script type="text/javascript">
<!--
var gmFavMaster = new GMFavMaster();
//gmFavMaster.load_favs();
var gmLeftBoxes = new GMLeftBoxes();
//gmLeftBoxes.init();
//-->
</script>
<script type="text/javascript">
<?php if(empty($_SESSION['screen_width'])) { ?>
$(document).ready(function() {
var content_width;
if(screen.width < 1280) { content_width = 980; } else { content_width = 1236; }
$.get("<?php echo xtc_href_link('gm_counter_action.php'); ?>", { screen_width: content_width, action: "gmc_user_screen" } );
$(".content_width").css({ "width": content_width + "px" });
$(".content_bg_width").css({ "width": content_width -3 + "px", "background-image": "url(images/gm_head/bluehead_" + content_width + ".png)" });
});
<?php } ?>
</script>
<!-- / gambio -->
<?php
// end -only for gambio
endif; ?>
<script language="javascript" src="<?php echo MH_CATALOG_SERVER . DIR_WS_CATALOG ?>/mailhive/common/js/ceebox/js/jquery.ceebox-min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery(".ceebox").ceebox({overlayOpacity:0.0, animSpeed: 100, fadeIn: 0, titles: false });
});
</script>
<?php
// end -cut this part out for ZenCart and Digistore
} else { ?>
<?php } ?>
<!-- left_navigation_eof //-->
</table></td>
<?php endif; ?>
<!-- body_text //-->
<td width="100%" valign="top">
<?php
if ( MH_PLATFORM == 'digistore') {
require(DIR_WS_INCLUDES . 'header.php');
}
?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr><td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading" <?php if (MH_PLATFORM == 'gambio') : ?> style="background-image:url(images/gm_icons/module.png); float: left;"<?php endif ?>>
<?php if (MAILBEEZ_MAILHIVE_STATUS == 'False') { ?> <span style="color: #ff0000">OFFLINE</span><?php } ?>
<?php echo HEADING_TITLE; ?> V. <?php if (defined('MAILBEEZ_VERSION')) echo MAILBEEZ_VERSION ?> - <?php echo MH_PLATFORM; ?>
<?php if ( defined('MAILBEEZ_MAILHIVE_MODE') ) { ?><br><div class="smallText">Mode: <?php echo MAILBEEZ_MAILHIVE_MODE ?></div><?php } ?>
</td>
<td class="pageHeading" align="right"><?php echo mh_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?>
<?php if (defined('MAILBEEZ_VERSION')) { ?><div style="float: right; margin-top: 10px;">
<?php echo mb_admin_button(MAILBEEZ_VERSION_CHECK_URL, 'Check for Update...', 'mbUpd'); ?></div><?php } ?>
</td>
</tr>
</table></td>
</tr>
<tr>
<td><?php
// start of admin screen main area
if ($custom_app_include != '') {
// load custom application
echo mb_admin_button( mh_href_link(FILENAME_MAILBEEZ, 'module=' . $_GET['module']), 'Back', '', 'link') . '<br><br>';
require_once($custom_app_include);
} else {
require_once(DIR_FS_CATALOG. 'mailhive/common/admin_application_plugins/main_mailbeez.php');
}
// end of admin screen main area
?></td>
</tr>
</table></td>
<!-- body_text_eof //-->
</tr>
</table>
<!-- body_eof //-->
<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
<?php if (MAILBEEZ_MAILHIVE_UPDATE_REMINDER == 'True' && MAILBEEZ_MAILHIVE_UPDATE_REMINDER_TIMESTAMP < time()) { ?>
<SCRIPT LANGUAGE="JavaScript" TYPE="text/javascript">
<!--
window.setTimeout("mbUpdateReminder()", 1000);
function mbUpdateReminder() {
Check = confirm("Check mailbeez.com for Updates?\n(You can always use the button upper right)\n<?php if (MAILBEEZ_MAILHIVE_POPUP_MODE == 'off') { ?>(this will redirect to the mailbeez server) <?php } ?>");
if (Check == true) {
<?php if (MAILBEEZ_MAILHIVE_POPUP_MODE == 'CeeBox') { ?>
jQuery.fn.ceebox.popup("<a rel='width:600' href='<?php echo MAILBEEZ_VERSION_CHECK_URL ?>'>link</a>", {overlayOpacity:0.0, animSpeed: 100, fadeIn: 0, titles: false });
<?php } else { ?>
document.location.href="<?php echo MAILBEEZ_VERSION_CHECK_URL ?>";
<?php } ?>
}
}
//-->
</SCRIPT>
<?php } ?>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>