function getMailingDropList($listId, $listType, $order) { $lists = ''; $i = 0; $flag = array(); $lists[0]->name = _ACA_SEL_ALL; $lists[0]->id = '0-0'; $nb = explode(',', $GLOBALS[ACA . 'activelist']); $size = sizeof($nb); for ($k = 0; $k < $size; $k++) { $index = $nb[$k]; if ($listType == $index or $GLOBALS[ACA . 'listype' . $index] == 1 and $GLOBALS[ACA . 'totallist' . $index] > 0) { $i++; $lists[$i]->name = _ACA_ALL . ' ' . @constant($GLOBALS[ACA . 'listnames' . $index]); $lists[$i]->id = $index . '-0'; $flag[$index] = 0; } } if ($listId > 0) { $i++; $getList = lists::getLists($listId, 0, 1, $order, false, false, false); $lists[$i]->name = $getList[0]->list_name; $lists[$i]->id = $getList[0]->list_type . '-' . $getList[0]->id; } else { if ($listType == 0) { $getLists = lists::getLists(0, 0, 1, 'listype_name', false, false, false); } else { $getLists = lists::getLists(0, $listType, 1, $order, false, false, false); } foreach ($getLists as $getList) { $size = sizeof($nb); for ($k = 0; $k < $size; $k++) { $index = $nb[$k]; if ($getList->list_type == $index and !$flag[$index] and $GLOBALS[ACA . 'listype' . $index] == 1 and $GLOBALS[ACA . 'totallist' . $index] > 0) { $i++; $lists[$i]->name = '-- ' . @constant($GLOBALS[ACA . 'listnames' . $index]) . ' --'; $lists[$i]->id = $index . '-0'; $flag[$index] = true; } } if ($GLOBALS[ACA . 'listype' . $getList->list_type]) { $i++; $lists[$i]->name = $getList->list_name; $lists[$i]->id = $getList->list_type . '-' . $getList->id; } } } return $lists; }
function showMailings($task, $action, $listId, $listType, $message, $showHeader, $title) { $start = mosGetParam($_REQUEST, 'start', 0); //ADRIEN //$limit = mosGetParam($_REQUEST, 'limit', $GLOBALS['mosConfig_list_limit']); $limit = -1; $emailsearch = mosGetParam($_REQUEST, 'emailsearch', ''); $dropList = mosGetParam($_REQUEST, 'droplist', 'ZZZZ'); if ($dropList == 'ZZZZ') { $dropList = $listType . '-' . $listId; } $total = 0; $dropListValues = explode('-', $dropList); $listType = $dropListValues[0]; $listId = $dropListValues[1]; if ($listId > 0) { $listTypeM = 0; } else { $listTypeM = $listType; } $orddef = 'idD'; if ($listType == 2) { $orddef = 'idA'; } $order = mosGetParam($_REQUEST, 'order', $orddef); if ($listId == 0) { $lists['title'] = lisType::chooseType($task, $action, $listType, 'titles', '', $title); } else { $listing = lists::getLists($listId, 0, 1, '', false, false, true); $lists['title'] = $title . "<span style='color: rgb(51, 51, 51);'>" . $listing[0]->list_name . "</span>"; } $dropDownList = lisType::getMailingDropList($listId, $listType, $order); $lists['droplist'] = mosHTML::selectList($dropDownList, 'droplist', 'class="inputbox" size="1" onchange="document.AcajoomFilterForm.submit();"', 'id', 'name', $dropList); $mailings = xmailing::getMailings($listId, $listTypeM, $start, $limit, $emailsearch, $total, $order, false, false); $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n\r"; $forms['select'] = " <form action='index2.php' method='post' name='AcajoomFilterForm'> \n\r"; $show = lisType::showType($listType, 'showMailings'); if ($showHeader) { xmailing::_header($task, $action, $listType, $message, ''); } backHTML::formStart('show_mailing', 0, ''); mailingsHTML::showMailingList($mailings, $lists, $start, $limit, $total, $emailsearch, $listId, $listType, $forms, $show, $action); backHTML::formEnd(); }
function subject($mailingEdit, $lists, $show) { ?> <fieldset class="acajoomcss"> <legend><?php echo _ACA_LIST_T_GENERAL; ?> </legend> <table class="acajoomtable" cellspacing="1"> <tbody> <tr> <td width="110px" class="key"> <span class="editlinktip"> <?php $tip = _ACA_INFO_LIST_SUBJET; $title = _ACA_SUBJECT; echo compa::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0); ?> </span> </td> <td> <?php $text = str_replace('"', '"', $mailingEdit->subject); if (function_exists('htmlspecialchars_decode')) { $text = htmlspecialchars_decode($text, ENT_NOQUOTES); } elseif (function_exists('html_entity_decode')) { $text = html_entity_decode($text, ENT_NOQUOTES); } echo ' <input type="text" name="subject" class="inputbox" size="50" maxlength="64" value="' . $text . '" />'; ?> </td> </tr> <?php if ($show['issuenb']) { ?> <tr> <td class="key"> <span class="editlinktip"> <?php $tip = _ACA_ISSUE_NB_TIPS; $title = @constant($GLOBALS[ACA . 'listname' . $mailingEdit->list_type]) . ' #'; echo compa::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0); ?> </span> </td> <td> <?php echo $mailingEdit->issue_nb; ?> </td> </tr> <?php } else { echo ' <input type="hidden" name="issue_nb" value="' . $mailingEdit->issue_nb . '" />'; } ?> <?php if ($show['delay']) { ?> <tr> <td class="key"> <span class="editlinktip"> <?php $tip = _ACA_INFO_LIST_DELAY; $title = _ACA_AUTO_DELAY; echo compa::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0); ?> </span> </td> <td> <?php $delay = $mailingEdit->delay / 1440; ?> <input type="text" name="delay" class="inputbox" size="5" maxlength="10" value="<?php echo $delay; ?> " /> </td> </tr> <?php } ?> <?php if ($show['pub_date'] and $GLOBALS[ACA . 'listype2'] == '1' and class_exists('auto')) { ?> <tr> <td class="key"> <span class="editlinktip"> <?php $tip = _ACA_INFO_LIST_DATE; $title = _ACA_LIST_DATE; $tip .= '<br/>(Actual server time is ' . acajoom::getNow() . ' )'; echo compa::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0); ?> </span> </td> <td> <input type="text" name="senddate" class="inputbox" size="25" maxlength="25" value="<?php echo $mailingEdit->send_date; ?> " /> </td> </tr> <?php } ?> <tr> <td class="key"> <span class="editlinktip"> <?php $tip = ''; $title = _ACA_LIST_NAME; echo compa::toolTip($tip, '', 280, 'tooltip.png', $title, '', 0); ?> </span> </td> <td> <?php $name = lists::getLists($mailingEdit->list_id, 0, null, '', false, false, true); echo $name[0]->list_name; ?> </td> </tr> </tbody> </table> </fieldset> <?php }
function lists($action, $task, $listId, $listType) { global $database, $my; $message = ''; $xf = new xonfig(); $erro = new xerr(__FILE__, __FUNCTION__); $erro->show(); $showLists = true; switch ($task) { case 'new': if ($listType < 1) { $listType = 1; } $filename = $GLOBALS['mosConfig_absolute_path'] . '/components/com_acajoom/templates/default/default.html'; $handle = fopen($filename, "rb"); $template = fread($handle, filesize($filename)); fclose($handle); $template = str_replace('src="', 'src="' . $GLOBALS['mosConfig_live_site'] . '/', $template); $subscriber = subscribers::getSubscriberInfoFromUserId($my->id); $showLists = false; $newList->id = ''; $newList->html = 1; $newList->new_letter = 1; $newList->list_name = ''; $newList->list_desc = ''; $newList->sendername = $subscriber->name; $newList->senderemail = $subscriber->email; $newList->bounceadres = $subscriber->email; $newList->layout = $template; $newList->template = 0; $newList->hidden = 1; $newList->auto_add = 0; $newList->list_type = $listType; $newList->delay_min = 1; $newList->delay_max = 7; $newList->user_choose = 0; $newList->cat_id = 0; $newList->follow_up = ''; $newList->notify_id = 0; $newList->owner = $my->id; $newList->acc_level = 25; $newList->acc_id = 29; $newList->published = 0; $newList->start_date = date('Y-m-d', time()); $newList->next_date = time(); $newList->subscribemessage = _ACA_DEFAULT_SUBSCRIBE_MESS; $newList->unsubscribemessage = _ACA_DEFAULT_UNSUBSCRIBE_MESS; $newList->unsubscribesend = 1; $newList->footer = 1; $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n "; $show = lisType::showType($newList->list_type, 'editlist'); backHTML::_header(_ACA_NEW . ' ' . _ACA_LIST, $GLOBALS[ACA . 'listlogo0'], $message, $task, $action); backHTML::formStart('listedit', $newList->html, ''); listsHTML::editList($newList, $forms, $show); $go[] = acajoom::makeObj('act', $action); $go[] = acajoom::makeObj('listid', $newList->id); backHTML::formEnd($go); break; case 'doNew': $listname = mosGetParam($_REQUEST, 'list_name', ''); $listType = mosGetParam($_REQUEST, 'list_type', 0); $now = acajoom::getNow(); $query = "SELECT `id` FROM `#__acajoom_lists` WHERE `list_name`= '{$listname}' "; $database->setQuery($query); $lId = $database->loadResult(); $erro->err = $database->getErrorMsg(); $erro->E(__LINE__, '1091', $database); if ($lId > 0) { echo "<script> alert(' This list already exist, please choose another name. '); window.history.go(-1);</script>\n"; return false; } else { $query = "INSERT INTO `#__acajoom_lists` (`list_name`,`createdate`) VALUES ( '" . addslashes($listname) . "' , '{$now}' )"; $database->setQuery($query); $database->query(); $erro->err = $database->getErrorMsg(); } if ($erro->E(__LINE__, '1001', $database)) { $query = "SELECT * FROM `#__acajoom_lists` WHERE `list_name`= '{$listname}' "; $database->setQuery($query); $database->loadObject($mynewlist); $mynewlist->list_name = stripslashes($mynewlist->list_name); $mynewlist->list_desc = stripslashes($mynewlist->list_desc); $mynewlist->layout = stripslashes($mynewlist->layout); $mynewlist->subscribemessage = stripslashes($mynewlist->subscribemessage); $mynewlist->unsubscribemessage = stripslashes($mynewlist->unsubscribemessage); $erro->err = $database->getErrorMsg(); $erro->E(__LINE__, '1005'); $listId = $mynewlist->id; $message = acajoom::printYN(lists::updateListFromEdit($listId, '', true), _ACA_LIST_ADDED, _ACA_ERROR); $xf->plus('totallist0', 1); $xf->plus('act_totallist0', 1); $xf->plus('totallist' . $listType, 1); $xf->plus('act_totallist' . $listType, 1); } break; case 'edit': if ($listId == 0) { echo "<script> alert('" . addslashes(_ACA_SELECT_LIST) . "'); window.history.go(-1);</script>\n"; return false; } else { $showLists = false; $query = 'SELECT * FROM `#__acajoom_lists` WHERE `id` = ' . intval($listId); $database->setQuery($query); $database->loadObject($listEdit); $erro->err = $database->getErrorMsg(); if (!$erro->E(__LINE__, '1002')) { return false; } else { $listEdit->list_name = stripslashes($listEdit->list_name); $listEdit->list_desc = stripslashes($listEdit->list_desc); $listEdit->layout = stripslashes($listEdit->layout); $listEdit->subscribemessage = stripslashes($listEdit->subscribemessage); $listEdit->unsubscribemessage = stripslashes($listEdit->unsubscribemessage); $listEdit->new_letter = 0; $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n "; $show = lisType::showType($listEdit->list_type, 'editlist'); backHTML::_header(_ACA_EDIT_A . @constant($GLOBALS[ACA . 'listname' . $listEdit->list_type]) . ' ' . _ACA_LIST, $GLOBALS[ACA . 'listlogo0'], $message, $task, $action); backHTML::formStart('listedit', $listEdit->html, ''); listsHTML::editList($listEdit, $forms, $show); $go[] = acajoom::makeObj('act', $action); $go[] = acajoom::makeObj('listid', $listEdit->id); backHTML::formEnd($go); } } break; case 'update': $message = acajoom::printYN(lists::updateListFromEdit($listId, '', false), _ACA_LIST_UPDATED, _ACA_ERROR); break; case 'delete': $message = acajoom::printYN(lists::deleteList($listId), _ACA_LIST . _ACA_SUCCESS_DELETED, _ACA_ERROR); break; case 'copy': $message = acajoom::printYN(lists::copyList($listId), _ACA_LIST_COPY, _ACA_ERROR); break; case 'publish': $message = acajoom::printYN(lists::updateListFromList($listId, true, false), _ACA_PUBLISHED, _ACA_ERROR); break; case 'unpublish': $message = acajoom::printYN(lists::updateListFromList($listId, false, false), _ACA_UNPUBLISHED, _ACA_ERROR); break; case 'forms': case 'make': if (class_exists('createForm')) { createForm::taskOptions($task); $showLists = false; } else { $showLists = true; } break; case 'cpanel': backHTML::controlPanel(); return true; break; } if ($showLists) { backHTML::_header(_ACA_MENU_LIST, $GLOBALS[ACA . 'listlogo0'], $message, $task, $action); $show = lisType::showType(0, 'showListsBack'); $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n"; backHTML::formStart('show_mailing', '', ''); $listing = lists::getLists(0, 0, 1, '', false, false, false); if ($show['list_type']) { $show['list_type'] = lisType::checkOthers(); } listsHTML::showListingLists($listing, $action, 'edit', $forms, $show); $go[] = acajoom::makeObj('act', $action); backHTML::formEnd($go); return true; } }
function showMailingsFront($task, $action, $subscriberId, $listId, $listType, $viewArchive, $pageTile) { global $Itemid; if (ACA_CMSTYPE) { // joomla 15 $start = JRequest::getVar('start', '0'); $emailsearch = JRequest::getVar('emailsearch', ''); $order = JRequest::getVar('order', 'idD'); $dropList = JRequest::getVar('droplist', 'ZZZZ'); } else { //joomla 1x $start = intval(mosGetParam($_REQUEST, 'start', 0)); $emailsearch = mosGetParam($_REQUEST, 'emailsearch', ''); $order = mosGetParam($_REQUEST, 'order', 'idD'); $dropList = mosGetParam($_REQUEST, 'droplist', 'ZZZZ'); } //endif //ADRIEN //$limit = intval(mosGetParam($_REQUEST, 'limit', $GLOBALS['mosConfig_list_limit'])); $limit = -1; $total = 0; if ($dropList == 'ZZZZ') { $dropList = $listType . '-' . $listId; } $total = 0; $dropListValues = explode('-', $dropList); $listType = $dropListValues[0]; $listId = $dropListValues[1]; if (class_exists('pro') && $listId > 0) { $list = lists::getOneList($listId); $accessGrant = acajoom::checkPermissions('hello', 0, $list->acc_level); } else { $accessGrant = acajoom::checkPermissions('admin'); } if ($accessGrant) { if ($listId > 0) { $mailings = xmailing::getMailings($listId, 0, $start, $limit, $emailsearch, $total, $order, false, $viewArchive); } else { $mailings = xmailing::getMailings($listId, $listType, $start, $limit, $emailsearch, $total, $order, false, $viewArchive); } } else { if ($listType == 1 or $listType == 2 or $listType == 7) { $mailings = xmailing::getMailings($listId, 0, $start, $limit, $emailsearch, $total, $order, true, $viewArchive); } elseif ($listType == 0) { $mailings1 = xmailing::getMailings($listId, 1, $start, $limit, $emailsearch, $total, $order, true, $viewArchive); $mailings2 = xmailing::getMailings($listId, 2, $start, $limit, $emailsearch, $total, $order, true, $viewArchive); $mailings7 = xmailing::getMailings($listId, 7, $start, $limit, $emailsearch, $total, $order, true, $viewArchive); $mailings = array_merge($mailings1, $mailings2, $mailings7); } else { $mailings = ''; } } if ($listId == 0) { $lists['title'] = lisType::chooseType($task, $action, $listType, 'titles', '', _ACA_MENU_MAILING); } else { $listing = lists::getLists($listId, 0, $subscriberId, '', false, false, true); $listType = $listType > 0 ? $listType : '0'; $lists['title'] = $pageTile . @constant($GLOBALS[ACA . 'listname' . $listType]); } $dropDownList = lisType::getMailingDropList($listId, $listType, $order); if (ACA_CMSTYPE) { // joomla 15 $lists['droplist'] = JHTML::_('select.genericlist', $dropDownList, 'droplist', 'class="inputbox" size="1" onchange="document.AcajoomFilterForm.submit();"', 'id', 'name', $dropList); } else { //joomla 1x $lists['droplist'] = mosHTML::selectList($dropDownList, 'droplist', 'class="inputbox" size="1" onchange="document.AcajoomFilterForm.submit();"', 'id', 'name', $dropList); } //endif $linkMain = '.php?option=com_acajoom&act=' . $action; compa::completeLink($linkMain, false); $forms['main'] = '<form method="post" action="' . $linkMain . '" onsubmit="submitbutton();return false;" name="mosForm" >' . "\n\r"; $forms['select'] = '<form method="post" action="' . $linkMain . '" name="AcajoomFilterForm">' . "\n\r"; $forms['main'] .= '<input type="hidden" name="Itemid" value="' . $Itemid . '" />'; $forms['select'] .= '<input type="hidden" name="Itemid" value="' . $Itemid . '" />'; $show = lisType::showType($listType, 'showMailings'); $show['index'] = 'index'; $show['select'] = false; $show['buttons'] = true; if (class_exists('pro') && !$viewArchive) { $show['admin'] = true; $show['status'] = true; } frontHTML::formStart($lists['title'], 0, 'show_mailing'); mailingsHTML::showMailingList($mailings, $lists, $start, $limit, $total, $emailsearch, $listId, $listType, $forms, $show, $action); frontHTML::formEnd(); return true; }
/** * @copyright Copyright (C) 2009 Joobi Limited All rights reserved. * @license This file is released under the GPL license (http://www.gnu.org/licenses ) * @link http://www.ijoobi.com */ function subscribers($action, $task, $userid, $listId, $cid) { $erro = new xerr(__FILE__, __FUNCTION__); if (ACA_CMSTYPE) { // joomla 15 $subscriberId = intval(JRequest::getVar('subscriber_id', '')); $message = JRequest::getVar('message', ''); } else { //joomla 1x $subscriberId = intval(mosGetParam($_REQUEST, 'subscriber_id', '')); $message = mosGetParam($_REQUEST, 'message', ''); } //endif $doShowSubscribers = true; subscribers::updateSubscribers(); switch ($task) { case 'updateOneSub': $doShowSubscribers = true; $message = acajoom::printYN(subscribers::updateOneSubscriber(), _ACA_UPDATED_SUCCESSFULLY, _ACA_ERROR); backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action); break; case 'deleteOneSub': $doShowSubscribers = true; $message = acajoom::printYN(subscribers::deleteOneSubscriber($subscriberId), _ACA_SUBSCRIBER_DELETED, _ACA_ERROR); backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action); break; case 'cancelSub': $doShowSubscribers = true; backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action); break; case 'edit': foreach ($cid as $id) { compa::redirect('index2.php?option=com_acajoom&act=subscribers&task=show&userid=' . $id); } break; case 'show': $doShowSubscribers = false; $qid[0] = $userid; $subscriber = subscribers::getSubscribersFromId($qid, false); $lists = lists::getLists(0, 0, 1, '', false, false); $queues = queue::getSubscriberLists($userid); $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n"; backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action); backHTML::formStart('', 0, ''); echo subscribersHTML::editSubscriber($subscriber, $lists, $queues, $forms, acajoom::checkPermissions('admin'), false, false); $go[] = acajoom::makeObj('act', $action); $go[] = acajoom::makeObj('subscriber_id', $subscriber->id); $go[] = acajoom::makeObj('user_id', $subscriber->user_id); backHTML::formEnd($go); break; case 'new': case 'add': $doShowSubscribers = false; $newSubscriber->id = ''; $newSubscriber->user_id = 0; $newSubscriber->name = ''; $newSubscriber->email = ''; $newSubscriber->receive_html = 1; $newSubscriber->confirmed = 1; $newSubscriber->blacklist = 0; $newSubscriber->timezone = '00:00:00'; $newSubscriber->language_iso = 'eng'; $newSubscriber->params = ''; $newSubscriber->subscribe_date = acajoom::getNow(); $lists = lists::getLists(0, 0, 1, '', false, false); $queues = ''; $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n"; backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action); backHTML::formStart('', 0, ''); echo subscribersHTML::editSubscriber($newSubscriber, $lists, $queues, $forms, acajoom::checkPermissions('admin'), false, false); $go[] = acajoom::makeObj('act', $action); $go[] = acajoom::makeObj('subscriber_id', $newSubscriber->id); $go[] = acajoom::makeObj('user_id', $newSubscriber->user_id); backHTML::formEnd($go); break; case 'doNew': $doShowSubscribers = true; $message = acajoom::printYN(subscribers::insertOneSubscriber(), _ACA_UPDATED_SUCCESSFULLY, _ACA_ERROR); backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action); break; case 'delete': if (!is_array($cid) || count($cid) < 1) { echo "<script> alert('Select an item to delete'); window.history.go(-1);</script>\n"; return false; } else { $status = true; foreach ($cid as $id) { $erro->ck = subscribers::deleteOneSubscriber($id); if (!$erro->ck) { $status = false; } } $message = acajoom::printYN($status, _ACA_SUBSCRIBER_DELETED, _ACA_ERROR); backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action); } break; case 'update': if (!is_array($cid) || count($cid) < 1) { echo "<script> alert('Select an item to update'); window.history.go(-1);</script>\n"; return false; } else { foreach ($cid as $id) { if (ACA_CMSTYPE) { // joomla 15 $changes = JRequest::getVar($id, array(0)); } else { //joomla 1x $changes = mosGetParam($_REQUEST, $id, array(0)); } //endif if (!isset($changes['receive_html'])) { $changes['receive_html'] = 0; } if (!isset($changes['confirmed'])) { $changes['confirmed'] = 0; } } } $message = acajoom::print_message(_ACA_UPDATED_SUCCESSFULLY, 1); break; case 'export': $doShowSubscribers = false; subscribersHTML::export($action, $listId); break; case 'doExport': $message = acajoom::printYN(subscribers::export($listId), _EXPORT, _ACA_ERROR); backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action); break; case 'import': $doShowSubscribers = false; $lists = lists::getLists(0, 0, 1, 'listnameA', false, false, true); subscribersHTML::import($action, $lists); break; case 'doImport': $message = acajoom::printYN(subscribers::import($listId), _ACA_IMPORT_FINISHED, _ACA_ERROR); backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action); break; break; case 'subscribeAll': break; case 'unsubscribeAll': break; case 'cancel': if ($listId != 0) { $listId = 0; } else { compa::redirect('index2.php?option=com_acajoom'); } backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action); break; case 'cpanel': backHTML::controlPanel(); $doShowSubscribers = 0; break; default: backHTML::_header(_ACA_MENU_SUBSCRIBERS, 'addusers.png', $message, $task, $action); break; } if ($doShowSubscribers) { if (ACA_CMSTYPE) { // joomla 15 $start = intval(JRequest::getVar('start', 0)); $conf =& JFactory::getConfig(); $mail->Mailer = $conf->getValue('config.mailer'); // $GLOBALS['mosConfig_mailer']; $limit = intval(JRequest::getVar('limit', $conf->getValue('config.list_limit'))); $emailsearch = JRequest::getVar('emailsearch', ''); } else { //joomla 1x $mail->Mailer = $GLOBALS['mosConfig_mailer']; $start = intval(mosGetParam($_REQUEST, 'start', 0)); $limit = intval(mosGetParam($_REQUEST, 'limit', $GLOBALS['mosConfig_list_limit'])); $emailsearch = mosGetParam($_REQUEST, 'emailsearch', ''); } //endif $total = 0; $subscribers = subscribers::getSubscribers($start, $limit, $emailsearch, $total, $listId, '', '', '', 'sub_dateD'); if ($listId != 0) { $showAdmin = true; } else { $showAdmin = false; } $dropDownList = lisType::getListsDropList(0, '', ''); if (ACA_CMSTYPE) { // joomla 15 $lists['listid'] = JHTML::_('select.genericlist', $dropDownList, 'listid', 'class="inputbox" size="1" onchange="document.AcajoomFilterForm.submit();"', 'id', 'list_name', $listId); } else { //joomla 1x $lists['listid'] = mosHTML::selectList($dropDownList, 'listid', 'class="inputbox" size="1" onchange="document.AcajoomFilterForm.submit();"', 'id', 'list_name', $listId); } //endif $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n"; $forms['select'] = " <form action='index2.php' method='post' name='AcajoomFilterForm'> \n"; backHTML::formStart('show_mailing', 0, ''); subscribersHTML::showSubscribers($subscribers, $action, $listId, $lists, $start, $limit, $total, $showAdmin, $listId, $emailsearch, $forms); } return true; }
function showSubscribers($subscribers, $action, $listId, &$lists, $start, $limit, $total, $showAdmin, $theLetterId, $emailsearch, $forms) { global $my; echo $forms['select']; ?> <input type="hidden" name="option" value="com_acajoom" /> <input type="hidden" name="act" value="<?php echo $action; ?> " /> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="listid" value="<?php echo $listId; ?> " /> <input type="hidden" name="limit" value="<?php echo $limit; ?> " /> <table style="text-align: left; width: 100%;" border="0" cellpadding="2" cellspacing="0"><tbody><tr> <td style="text-align: left; padding-left: 20px;"><span class="sectionname"> <?php if ($listId == 0) { echo _ACA_SUSCRIB_LIST; } else { $lt_name = lists::getLists($listId, 0, null, '', false, false, true); echo _ACA_SUSCRIB_LIST_UNIQUE . "<span style='color: rgb(51, 51, 51);'>" . $lt_name[0]->list_name . "</span>"; } ?> </span> </td> <td style="text-align: right;"> <?php echo _ACA_SEL_LIST . ' : ' . $lists['listid'] . " "; ?> <?php echo _ACA_FILTER; ?> : <input type="text" name="emailsearch" value="<?php echo $emailsearch; ?> " class="inputbox" onChange="document.AcajoomFilterForm.submit();" /> </td></tr></tbody></table> </form> <?php echo $forms['main']; ?> <input type="hidden" name="option" value="com_acajoom" /> <input type="hidden" name="act" value="<?php echo $action; ?> " /> <input type="hidden" name="task" value="" /> <input type="hidden" name="userid" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="listid" value="<?php echo $listId; ?> " /> <input type="hidden" name="start" value="<?php echo $start; ?> " /> <input type="hidden" name="limit" value="<?php echo $limit; ?> " /> <input type="hidden" name="emailsearch" value="<?php echo $emailsearch; ?> " /> <table width="100%" border="0" cellspacing="0" cellpadding="4" class="adminlist"> <tr> <th class="title">#</th> <th class="title"> </th> <th class="title"><?php echo _ACA_INPUT_NAME; ?> </th> <th class="title"><?php echo _ACA_INPUT_EMAIL; ?> </th> <th class="title"><?php echo _ACA_SIGNUP_DATE; ?> </th> <th class="title"><center><?php echo _ACA_REGISTERED; ?> ?</center></th> <th class="title"><center><?php echo _ACA_CONFIRMED; ?> ?</center></th> <th class="title"><center><?php echo _ACA_HTML; ?> ?</center></th> <?php if ($my->usertype == 'Administrator' or $my->usertype == 'Super Administrator') { ?> <th class="title">id#</th> <?php } ?> </tr> <?php $i = 0; if (!empty($subscribers)) { foreach ($subscribers as $subscriber) { if ($subscriber->user_id != 0) { $img = 'tick.png'; $alt = 'Registered'; } else { $img = 'publish_x.png'; $alt = 'Unregistered'; } if ($subscriber->confirmed == 1) { $imgC = 'tick.png'; $altC = 'Confirmed'; } else { $imgC = 'publish_x.png'; $altC = 'Not confirmed'; } if ($subscriber->receive_html == 1) { $imgH = 'tick.png'; $altH = 'HTML'; } else { $imgH = 'publish_x.png'; $altH = 'TEXT'; } ?> <tr class="row<?php echo ($i + 1) % 2; ?> "> <td><?php echo $i + 1 + $start; ?> </td> <td> <input type="checkbox" name="cid[<?php echo $i; ?> ]" value="<?php echo $subscriber->id; ?> " onclick="isChecked(this.checked);" /> </td> <td> <a href="index2.php?option=com_acajoom&act=<?php echo $action; ?> &task=show&userid=<?php echo $subscriber->id; ?> " > <?php echo $subscriber->name; ?> </a></td> <td><?php echo $subscriber->email; ?> </td> <td><?php echo $subscriber->subscribe_date; ?> </td> <td align="center"> <img src="images/<?php echo $img; ?> " width="12" height="12" border="0" alt="<?php echo $alt; ?> " /> </td> <td align="center"> <img src="images/<?php echo $imgC; ?> " width="12" height="12" border="0" alt="<?php echo $altC; ?> " /> </td> <td align="center"> <img src="images/<?php echo $imgH; ?> " width="12" height="12" border="0" alt="<?php echo $altH; ?> " /> </td> <?php $i++; if ($my->usertype == 'Administrator' or $my->usertype == 'Super Administrator') { echo '<td align="center">' . $subscriber->id . '</td>'; } } } ?> </tr> </table> </form> <?php backHTML::footerCounts($start, $limit, $emailsearch, $total, 9, $action, $listId, ''); }
function controlPanel() { //hack for JOomla 13 ADRIEN unset($GLOBALS["task"]); unset($_REQUEST["task"]); ?> <link rel="stylesheet" href="components/com_acajoom/cssadmin/acajoom.css" type="text/css" > <div align="center" class="centermain"> <div id="acajoom"> <table class="acajoomcss"> <tr> <td width="58%" valign="top"> <?php echo backHTML::iconsPanel(); ?> </td> <td width="42%" valign="top"> <div style="width=100%;"> <form action="index2.php" method="post" name="adminForm"> <?php $tabs = new mosTabs(1); $tabs->startPane('acaControlPanel'); $tabs->startTab(_ACA_MENU_TAB_SUM, "acaControlPanel.Summary"); ?> <table class="acajoom_stats" style="text-align: left; width: 100%; " cellpadding="2" cellspacing="0"> <tbody> <tr> <th style="text-align: center;"><?php echo '#'; ?> </th> <th style="text-align: center;"><?php echo _ACA_MENU_TAB_LIST; ?> </th> <th style="text-align: center;"><?php echo _ACA_MENU_MAILING_TITLE; ?> </th> <th style="text-align: center;"><?php echo _ACA_SENT_MAILING; ?> </th> <th style="text-align: center;"><?php echo _ACA_DESC_SUBSCRIBERS; ?> </th> </tr> <?php $html = ''; $totalist = 0; $totalmail = 0; $totalsub = 0; $totalsent = 0; $nb = explode(',', $GLOBALS[ACA . 'activelist']); $size = sizeof($nb); for ($i = 0; $i < $size; $i++) { $index = $nb[$i]; if ($GLOBALS[ACA . 'listshow' . $index] > 0 and $GLOBALS[ACA . 'listype' . $index] == 1) { $html .= '<tr>'; $html .= '<td><b>' . @constant($GLOBALS[ACA . 'listnames' . $index]) . '</b></td>'; $html .= '<td style="text-align: center; ">' . $GLOBALS[ACA . 'act_totallist' . $index] . ' </td>'; $html .= '<td style="text-align: center; ">' . $GLOBALS[ACA . 'act_totalmailing' . $index] . ' </td>'; $html .= '<td style="text-align: center; ">' . $GLOBALS[ACA . 'totalmailingsent' . $index] . ' </td>'; $html .= '<td style="text-align: center; ">' . $GLOBALS[ACA . 'act_totalsubcribers' . $index] . ' </td>'; $html .= '</tr>'; $totalist = $totalist + $GLOBALS[ACA . 'act_totallist' . $index]; $totalmail = $totalmail + $GLOBALS[ACA . 'act_totalmailing' . $index]; $totalsent = $totalsent + $GLOBALS[ACA . 'totalmailingsent' . $index]; if ($GLOBALS[ACA . 'act_totalsubcribers' . $index] < $totalsub) { $totalsub = $GLOBALS[ACA . 'act_totalsubcribers' . $index]; } } } $html .= '<tr>'; $html .= '<td><b>' . _ACA_CP_TOTAL . '</b></td>'; $html .= '<td style="text-align: center; ">' . $totalist . ' </td>'; $html .= '<td style="text-align: center; ">' . $totalmail . ' </td>'; $html .= '<td style="text-align: center; ">' . $totalsent . ' </td>'; $html .= '<td style="text-align: center; ">' . $totalsub . ' </td>'; $html .= '</tr>'; echo $html; ?> </tbody></table> <br /> <?php if (class_exists('auto')) { echo auto::showQueue(); } $tabs->endTab(); $tabs->startTab(_ACA_MENU_SUBSCRIBERS, "acaControlPanel.Subscribers"); $emailsearch = ''; $listId = 0; $start = mosGetParam($_REQUEST, 'start', 0); $limit = mosGetParam($_REQUEST, 'limit', 15); $order = mosGetParam($_REQUEST, 'order', 'date'); $total = 0; $subscribers = subscribers::getSubscribers($start, $limit, $emailsearch, $total, $listId, '', 1, 1, 'sub_dateD'); mosCommonHTML::loadOverlib(); ?> <script type="text/javascript"> function checkcid(myField) { myField.checked = true; isChecked(true); } </script> <!-- <div id="overDiv" style="position:absolute; visibility:hidden; z-index:10000;"></div> --> <form action="index2.php" method="post" name="adminForm"> <input type="hidden" name="option" value="com_acajoom" /> <input type="hidden" name="act" value="acajoom" /> <input type="hidden" name="task" value="" /> <input type="hidden" name="userid" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="listid" value="<?php echo $listId; ?> " /> <input type="hidden" name="start" value="<?php echo $start; ?> " /> <input type="hidden" name="limit" value="<?php echo $limit; ?> " /> <input type="hidden" name="emailsearch" value="<?php echo $emailsearch; ?> " /> <table width="100%" border="0" cellspacing="0" cellpadding="4" class="adminlist"> <tr> <th class="title">#</th> <th class="title" style="text-align: left;"><?php echo _ACA_INPUT_NAME; ?> </th> <th class="title" style="text-align: left;"><?php echo _ACA_INPUT_EMAIL; ?> </th> <th class="title" style="text-align: center;"><?php echo _ACA_SIGNUP_DATE; ?> </th> </tr> <?php $i = 0; foreach ($subscribers as $subscriber) { ?> <tr class="row<?php echo $i++ % 2; ?> "> <td><?php echo $i + $start; ?> </td> <td style="text-align: left;"> <a href="index2.php?option=com_acajoom&act=subscribers&task=show&userid=<?php echo $subscriber->id; ?> " > <?php echo $subscriber->name; ?> </a></td> <td style="text-align: left;"><?php echo $subscriber->email; ?> </td> <td style="text-align: center;"><?php echo mosFormatDate($subscriber->subscribe_date, '%x'); ?> </td> </tr> <?php } ?> </table> </form> <?php backHTML::footerCounts($start, $limit, $emailsearch, $total, 4, '', $listId, ''); $tabs->endTab(); $tabs->startTab(_ACA_MENU_TAB_LIST, "acaControlPanel.Lists"); $lists = lists::getLists(0, 0, 1, '', false, false, false); ?> <table class="adminlist"> <tr> <th class="title">#</th> <th class="title" width="65%" style="text-align: left;"><?php echo _ACA_LIST_NAME; ?> </th> <th class="title" width="25%" style="text-align: left;"><?php echo _ACA_LIST_TYPE; ?> </th> <th class="title" style="text-align: center;">#id</th> </tr> <?php $i = 0; foreach ($lists as $list) { $i++; $link = 'index2.php?option=com_acajoom&act=mailing&task=show&listid=' . $list->id; ?> <tr> <td><?php echo $i; ?> </td> <td style="text-align: left;"> <a href="<?php echo $link; ?> "> <?php echo $list->list_name; ?> </a> </td> <td style="text-align: left;"><a href='index2.php?option=com_acajoom&act=mailing&listype=<?php echo $list->list_type; ?> '><?php echo @constant($GLOBALS[ACA . 'listname' . $list->list_type]); ?> </a></td> <td style="text-align: center;"><?php echo $list->id; ?> </td> </tr> <?php } ?> <tr> <th colspan="4"> </th> </tr> </table> <?php $tabs->endTab(); $tabs->endPane(); ?> </form> </div> <div style="clear:both; float:left;"> <?php echo acajoom::printM('blue', _ACA_SERVER_LOCAL_TIME . ' :' . mosFormatDate(acajoom::getNow(), '%A, %d %B %Y %H:%M', 0)); ?> </div> <td> </tr> </table> </div> </div> <?php }
function showPanel() { global $Itemid; if (ACA_CMSTYPE) { $database =& JFactory::getDBO(); $acl =& JFactory::getACL(); $my =& JFactory::getUser(); } else { global $my, $database, $acl; } //endif if (isset($my->id) && $my->id > 0) { if (!empty($my->username)) { $greeting_message = _HI . ' ' . $my->username; } else { $greeting_message = ''; } backHTML::controlPanelBottonStart(_UCP_USER_MENU, 'cpanel.png'); $link = '.php?option=com_acajoom&act=show&Itemid=' . $Itemid; compa::completeLink($link, false); backHTML::quickiconButton($link, 'addusers.png', _UCP_USER_CONTACT, false, 'Registered', false); if (class_exists('pro')) { $aro_id = isset($my->id) && $my->id > 0 ? $acl->get_object_id('users', $my->id, 'ARO') : 1; $qacl = "SELECT `group_id` FROM `#__core_acl_groups_aro_map` WHERE `aro_id` =" . $aro_id; $database->setQuery($qacl); $usergid = $database->loadResult(); $gidAdmin = $acl->get_group_id('Administrator', 'ARO'); $ex_groups = $acl->get_group_children($gidAdmin, 'ARO', 'RECURSE'); $ex_groups[] = $gidAdmin; if (in_array($usergid, $ex_groups)) { $link = '.php?option=com_acajoom&act=list&Itemid=' . $Itemid; compa::completeLink($link, false); backHTML::quickiconButton($link, 'addedit.png', _ACA_MENU_LIST, false, 'admin', false); } else { $lists = lists::getLists(0, 0, true); $access = false; foreach ($lists as $list) { $bit = acajoom::checkPermissions('hello', 0, $list->acc_level); if ($bit) { $access = true; break; } } $link = '.php?option=com_acajoom&act=list&Itemid=' . $Itemid; compa::completeLink($link, false); if ($access) { backHTML::quickiconButton($link, 'addedit.png', _ACA_MENU_LIST, false, 'Registered', false); } } } else { $link = '.php?option=com_acajoom&act=list&Itemid=' . $Itemid; compa::completeLink($link, false); backHTML::quickiconButton($link, 'addedit.png', _ACA_MENU_LIST, false, 'admin', false); } backHTML::controlPanelBottomEnd(); if (class_exists('auto')) { auto::otherPanel(); } } }
function NEWMAILING() { // // // // // mosMenuBar::endTable(); JToolBarHelper::spacer(); JToolBarHelper::custom('savePreview', 'preview.png', 'preview_f2.png', _ACA_MENU_PREVIEW, false); $listype = 0; if (isset($_GET['listype'])) { $listype = $_GET['listype']; } elseif (isset($_POST['droplist'])) { $maliste = explode('-', $_POST['droplist']); $listype = $maliste[0]; } elseif (isset($_POST['listype'])) { $listype = $_POST['listype']; } elseif (isset($_GET['listid'])) { $maliste = lists::getLists($_GET['listid'], 0, null, 'listnameA', false, false, false, false); $listype = $maliste[0]->list_type; } if ($listype == 1) { JToolBarHelper::spacer(50); JToolBarHelper::custom('saveSend', 'forward.png', 'forward_f2.png', _ACA_MENU_SEND, false); } JToolBarHelper::spacer(50); JToolBarHelper::save(); JToolBarHelper::spacer(); JToolBarHelper::spacer(50); JToolBarHelper::cancel('show'); JToolBarHelper::spacer(); JToolBarHelper::custom('cpanel', 'tool.png', 'tool_f2.png', _ACA_MENU_CPANEL, false); // // mosMenuBar::endTable(); }
function updateUserstoAcajoom($force = false) { global $database; $time = isset($GLOBALS[ACA . 'last_sub_update']) && $GLOBALS[ACA . 'last_sub_update'] > 0 ? $GLOBALS[ACA . 'last_sub_update'] : 10000; $newTask = mktime(date("H") - 1, date("i"), date("s"), date("m"), date("d") - 1, date("Y")); if ($force or $newTask > $GLOBALS[ACA . 'last_sub_update']) { $erro = new xerr(__FILE__, __FUNCTION__, __CLASS__); $xf = new xonfig(); $newtime = mktime(date("H", $time) - 1, date("i", $time), date("s", $time), date("m", $time), date("d", $time), date("Y", $time)); $oneDay = date('Y-m-d H:i:s', $newtime); $query = 'SELECT M.* FROM `#__users` AS M ' . ' LEFT JOIN `#__acajoom_subscribers` AS N ON M.id = N.user_id OR M.email = N.email '; $query .= ' WHERE M.registerDate > \'' . $oneDay . '\''; $query .= ' AND N.id IS NULL AND M.block=0 '; $database->setQuery($query); $rows = $database->loadObjectList(); $erro->err = $database->getErrorMsg(); $erro->E(__LINE__, '8638', $database); if ($erro->result and !empty($rows)) { foreach ($rows as $row) { $query = "INSERT INTO `#__acajoom_subscribers` (`user_id`,`subscribe_date`, `name`,`email`,`confirmed`)"; $query .= " VALUES ( {$row->id} , '{$row->registerDate}', '{$row->name}', '{$row->email}' , 1 ) "; $database->setQuery($query); $database->query(); $erro->err = $database->getErrorMsg(); $xf->plus('totalsubcribers0', 1); $xf->plus('act_totalsubcribers0', 1); $lists = lists::getLists(0, 0, null, '', true, false, false); if (!empty($lists)) { foreach ($lists as $list) { $qid[0] = subscribers::getSubscriberId($row->registerDate); $subscriber = subscribers::getSubscribersFromId($qid, false); $subId = array(); $subId[0] = $subscriber->id; $erro->ck = queue::updateQueues($subId, '', $list->id, @$list->acc_id, true); $erro->Eck(__LINE__, '8640'); } } } } } }
function getEditTab($tab, $user, $ui) { global $Itemid; if (ACA_CMSTYPE) { // joomla 15 $my =& JFactory::getUser(); if ($my->get('id') < 1) { echo JText::_('ALERTNOTAUTH'); echo "<br />" . JText::_('You need to login.'); return false; } } else { //joomla 1x global $my; if (intval($my->id) < 1) { mosNotAuth(); return false; } } //endif if (!getAcajoomTab::checkInstalled()) { return _UE_NEWSLETTERNOTINSTALLED; } $html = ''; require_once ACA_JPATH_ROOT_NO_ADMIN . '/administrator/components/com_acajoom/classes/class.acajoom.php'; require_once ACA_JPATH_ROOT_NO_ADMIN . '/administrator/components/com_acajoom/subscribers.acajoom.html.php'; if (!empty($user->id)) { $userId = $user->id; $subscriber = subscribers::getSubscriberInfoFromUserId($userId); if (empty($subscriber)) { subscribers::syncSubscribers(true); $subscriber = subscribers::getSubscriberInfoFromUserId($userId); } $subscriberId = $subscriber->id; $queues = queue::getSubscriberLists($subscriberId); $access = acajoom::checkPermissions('admin', $my->id); } else { $userId = 0; $queues = ''; $access = false; $subscriberId = 0; $subscriber->id = ''; $subscriber->user_id = 0; $subscriber->name = ''; $subscriber->email = ''; $subscriber->receive_html = 1; $subscriber->confirmed = 1; $subscriber->blacklist = 0; $subscriber->timezone = '00:00:00'; $subscriber->language_iso = 'eng'; $subscriber->params = ''; $subscriber->subscribe_date = acajoom::getNow(); } $lists = lists::getLists(0, 0, $subscriberId, '', false, true, false); $doShowSubscribers = false; $mainLink = '.php?option=com_acajoom'; $selectLink = '.php?option=com_acajoom&act=subscriber'; compa::completeLink($mainLink, false); compa::completeLink($selectLink, false); $forms['main'] = '<form method="post" action="' . $mainLink . '" onsubmit="submitbutton();return false;" name="mosForm" >' . "\n\r"; $forms['select'] = '<form method="post" action="' . $selectLink . '" name="AcajoomFilterForm">'; $html .= subscribersHTML::editSubscriber($subscriber, $lists, $queues, $forms, $access, false, true); //$html .= '<input type="hidden" name="Itemid" value="'.$Itemid.'" />'; $html .= '<input type="hidden" name="subscriber_id" value="' . $subscriber->id . '" />'; return $html; }
function getEditTab($tab, $user, $ui) { global $my, $Itemid; if (intval($my->id) < 1) { mosNotAuth(); return false; } if (!getAcajoomTab::checkInstalled()) { return _UE_NEWSLETTERNOTINSTALLED; } $html = ''; require_once $GLOBALS['mosConfig_absolute_path'] . '/administrator/components/com_acajoom/classes/class.acajoom.php'; require_once $GLOBALS['mosConfig_absolute_path'] . '/administrator/components/com_acajoom/subscribers.acajoom.html.php'; if (!empty($user->id)) { $userId = $user->id; $subscriber = subscribers::getSubscriberInfoFromUserId($userId, false); $subscriberId = $subscriber->id; $queues = queue::getSubscriberLists($subscriberId); $access = acajoom::checkPermissions('admin', $my->id); } else { $userId = 0; $queues = ''; $access = false; $subscriberId = 0; $subscriber->id = ''; $subscriber->user_id = 0; $subscriber->name = ''; $subscriber->email = ''; $subscriber->receive_html = 1; $subscriber->confirmed = 1; $subscriber->blacklist = 0; $subscriber->timezone = '00:00:00'; $subscriber->language_iso = 'eng'; $subscriber->params = ''; $subscriber->subscribe_date = acajoom::getNow(); } $lists = lists::getLists(0, 0, $subscriberId, '', false, true, false); $doShowSubscribers = false; if ($ui == 1 and $GLOBALS[ACA . 'use_sef'] and function_exists('sefRelToAbs')) { $forms['main'] = '<form method="post" action="' . sefRelToAbs('index.php?option=com_acajoom') . '" onsubmit="submitbutton();return false;" name="mosForm" >' . "\n\r"; $forms['select'] = '<form method="post" action="' . sefRelToAbs('index.php?option=com_acajoom&act=subscriber') . '" name="AcajoomFilterForm">'; } else { $forms['main'] = '<form method="post" action="index.php?option=com_acajoom" onsubmit="submitbutton();return false;" name="mosForm" >' . "\n\r"; $forms['select'] = '<form method="post" action="index.php?option=com_acajoom&act=subscriber" name="AcajoomFilterForm">'; } $html .= subscribersHTML::editSubscriber($subscriber, $lists, $queues, $forms, $access, false, true); //$html .= '<input type="hidden" name="Itemid" value="'.$Itemid.'" />'; $html .= '<input type="hidden" name="subscriber_id" value="' . $subscriber->id . '" />'; return $html; }