function showMailingList($mailings, &$lists, $start, $limit, $total, $emailsearch, $listId, $listType, $forms, $show, $action) { global $Itemid; if (ACA_CMSTYPE) { // joomla 15 $my =& JFactory::getUser(); } else { //joomla 1x global $my; } //endif $item = !empty($Itemid) ? '&Itemid=' . $Itemid : ''; if ($show['dropdown']) { echo $forms['select']; ?> <input type="hidden" name="option" value="com_acajoom" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="act" value="<?php echo $action; ?> " /> <input type="hidden" name="task" value="show" /> <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 echo $lists['title']; ?> </td> <td style="text-align: right;"> <?php echo _ACA_SEL_LIST . ' : ' . $lists['droplist'] . " "; ?> <?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']; ?> <table width="100%" cellpadding="4" cellspacing="0" border="0" align="center" class="adminlist"> <th width="40" height="20" align="center" class="title"><center>#</center></th> <?php if ($show['select']) { ?> <th width="32" align="center" class="title"> </th> <?php } if ($show['status']) { ?> <th width="40" class="title" align="center"><center><?php echo _ACA_PUBLISHED; ?> </center></th> <?php } if ($show['delay']) { ?> <th width="80" class="title" align="center"><center><?php echo _ACA_LIST_DELAY; ?> </center></th> <?php } if ($show['sentdate']) { ?> <th width="140" class="title"><?php echo _ACA_LIST_DATE; ?> </th> <?php } if ($show['issue']) { ?> <th width="60" class="title"><?php echo _ACA_LIST_ISSUE; ?> </th> <?php } ?> <th class="title" align="left"><?php echo _ACA_LIST_SUB; ?> </th> <?php if ($show['status']) { ?> <th width="40" class="title" align="center"><center><?php echo _ACA_VISIBLE; ?> </center></th> <?php } if ($show['id']) { ?> <th width="40" class="title"><center>id #</center></th> <?php } ?> </tr> <?php if (!empty($mailings)) { $i = 0; foreach ($mailings as $mailing) { ?> <tr> <td height="20" align="center"><center><?php echo $i + 1 + $start; ?> </center></td> <?php if ($show['select']) { ?> <td align="center"><input type="radio" id="cb<?php echo $i; ?> " name="mailingid" value="<?php echo $mailing->id; ?> " onclick="isChecked(this.checked);" /></td> <?php } if ($show['status']) { switch ($mailing->published) { case '1': $img = 'publish_g.png'; break; case '2': $img = 'publish_y.png'; break; default: $img = 'publish_r.png'; break; } ?> <td align="center"><center><img src="<?php echo ACA_JPATH_LIVE; ?> /administrator/images/<?php echo $img; ?> " width="12" height="12" border="0" alt="" /></center></td> <?php } if ($show['delay']) { $delay = $mailing->delay / 1440; ?> <td align="center"><?php echo $delay; ?> </td> <?php } if ($show['sentdate']) { ?> <td ><?php echo $mailing->send_date; ?> </td> <?php } if ($show['issue']) { ?> <td align="center"><center><?php echo $mailing->issue_nb; ?> </center></td> <?php } if (!isset($mailing->list_id) or $mailing->list_id < 1) { $mailing->list_id = 0; } $backendLink = $show['index'] == 'index' ? false : true; if (!$show['admin'] or $mailing->published == 1 and ($mailing->list_type == 1 or $mailing->list_type == 7 or $mailing->list_type == 2)) { $link = '.php?option=com_acajoom&act=' . $action . '&task=view&listid=' . $mailing->list_id . '&mailingid=' . $mailing->id . $item; compa::completeLink($link, $backendLink); } else { $link = '.php?option=com_acajoom&act=' . $action . '&task=edit&mailingid=' . $mailing->id . '&listid=' . $mailing->list_id . '&listype=' . $mailing->list_type . $item; compa::completeLink($link, $backendLink); } ?> <td align="left"><a href="<?php echo $link; ?> " > <?php echo $mailing->subject; ?> </a></td> <?php if ($show['status']) { if ($mailing->visible == 1) { $img = 'tick.png'; } else { $img = 'publish_x.png'; } ?> <td align="center"><center><img src="<?php echo ACA_JPATH_LIVE; ?> /administrator/images/<?php echo $img; ?> " width="12" height="12" border="0" alt="" /></center></td> <?php } if ($show['id']) { ?> <td align="center"><center><?php echo $mailing->id; ?> </center></td> <?php } ?> </tr> <?php $i++; } } ?> </table> <input type="hidden" name="act" value="<?php echo $action; ?> " /> <input type="hidden" name="listid" value="<?php echo $listId; ?> " /> <input type="hidden" name="listype" value="<?php echo $listType; ?> " /> <?php }
function replaceTags($content, $subscriber, $list, $mailingId, $html, $tags = null) { /* $content = str_replace('href="mailto:' , '9aca7aca5', $content); // mailto tag good ones $content = str_replace('@', '9aca4aca1', $content); // mailto tag good ones */ $Itemid = $GLOBALS[ACA . 'itemidAca']; $listId = $list->id; $subscriptionslink = '.php?option=com_acajoom&Itemid=' . $Itemid . '&act=change&subscriber=' . $subscriber->id . '&cle=' . md5($subscriber->email) . '&listid=' . $listId; $unsubscribelink = '.php?option=com_acajoom&Itemid=' . $Itemid . '&act=unsubscribe&subscriber=' . $subscriber->id . '&cle=' . md5($subscriber->email) . '&listid=' . $listId; compa::completeLink($subscriptionslink, false, $GLOBALS[ACA . 'use_sef']); compa::completeLink($unsubscribelink, false, $GLOBALS[ACA . 'use_sef']); if ($html) { $subscriptionslink = '<a href="' . $subscriptionslink . '" target="_blank"><span class="subscriptionlink_nws">' . _ACA_CHANGE_EMAIL_SUBSCRIPTION . '</span></a>'; $unsubscribelink = '<a href="' . $unsubscribelink . '" target="_blank"><span class="subscriptionlink_nws">' . _ACA_UNSUBSCRIBE . '</span></a>'; $subscriptionstext = '<p>' . $subscriptionslink . '<br />' . $unsubscribelink . '</p>'; } else { $subscriptionslink = _ACA_CHANGE_EMAIL_SUBSCRIPTION . ' ( ' . $subscriptionslink . ' )'; $unsubscribelink = _ACA_UNSUBSCRIBE . ' ( ' . $unsubscribelink . ' )'; $subscriptionstext = "\r\n" . $subscriptionslink . "\r\n" . $unsubscribelink; } if ($GLOBALS[ACA . 'show_signature'] == 1) { if ($html) { $signatureText = '<a href="http://www.ijoobi.com" target="_blank">'; $signatureText .= '<br /><center><span style="color:#666666; font-size: .8em; text-align: center; ">Powered by Joobi</span></center>'; $signatureText .= '</a>'; } else { $signatureText = 'Powered by Joobi ( http://www.ijoobi.com )'; } $subscriptionstext .= "\r\n\r\n" . $signatureText; } $confirmlink = '.php?option=com_acajoom&act=confirm&listid=' . $listId . '&cle=' . md5($subscriber->email) . '&subscriber=' . $subscriber->id . '&Itemid=' . $Itemid; compa::completeLink($confirmlink, false, $GLOBALS[ACA . 'use_sef']); if ($html) { $confirmlink = '<a href="' . $confirmlink . '" target="_blank">' . _ACA_CONFIRM_LINK . '</a>'; } else { $confirmlink = _ACA_CONFIRM_LINK . "\n" . $confirmlink; } $tname = explode(" ", $subscriber->name); $firstname = $tname[0]; $username = empty($subscriber->username) ? $firstname : $subscriber->username; $archiveLink = '.php?option=com_acajoom&act=mailing&task=view&mailingid=' . $mailingId . '&Itemid=' . $Itemid; compa::completeLink($archiveLink, false, $GLOBALS[ACA . 'use_sef']); $archiveAll = '<a href="' . $archiveLink . '">' . _ACA_VIEWARCHIVE . '</a>'; $replaceWhat = array('[CONFIRM]', '[NAME]', '[FIRSTNAME]', '[EMAIL]', '[DATE]', '[USERNAME]', '[LINK]', '[ARCHIVE]'); if (ACA_CMSTYPE) { $replaceBy = array($confirmlink, $subscriber->name, $firstname, $subscriber->email, JHTML::_('date', acajoom::getNow(), JText::_('DATE_FORMAT_LC1'), 0), $username, $archiveLink, $archiveAll); } else { $replaceBy = array($confirmlink, $subscriber->name, $firstname, $subscriber->email, mosFormatDate(acajoom::getNow(), '', 0), $username, $archiveLink, $archiveAll); } $content = str_replace($replaceWhat, $replaceBy, $content); if (class_exists('auto')) { auto::tags($content, $tags); } if ($list->footer == '0') { $content = str_replace('[SUBSCRIPTIONS]', '', $content); } else { $content = str_replace('[SUBSCRIPTIONS]', $subscriptionstext, $content); } if (class_exists('aca_tags') and $tags) { aca_tags::replace($content, $tags); } if (!empty($mailingId) and $GLOBALS[ACA . 'enable_statistics'] == 1) { if ($GLOBALS[ACA . 'statistics_per_subscriber'] == 1) { if ($html) { $content .= '<img src="' . ACA_JPATH_LIVE_NO_HTTPS . '/index.php?option=com_acajoom&Itemid=' . $Itemid . '&act=log&listid=' . $listId . '&mailingid=' . $mailingId . '&subscriber=' . $subscriber->id . '" border="0" width="1" height="1" />'; } } else { if ($html) { $content .= '<img src="' . ACA_JPATH_LIVE_NO_HTTPS . '/index.php?option=com_acajoom&Itemid=' . $Itemid . '&act=log&listid=' . $listId . '&mailingid=' . $mailingId . '" border="0" width="1" height="1" />'; } } } // replace for images // put the good mailto tag back (replaced before the content mambot) $replaceTag = array('href="mailto:', '@', 'href="#'); $replaceBy = array('9aca7aca5', '9aca4aca1', '9aca12aca3'); $content = str_replace($replaceTag, $replaceBy, $content); $content = preg_replace('#src[ ]*=[ ]*\\"(?!https?://)(?:\\.\\./|\\./|/)?#', 'src="' . ACA_JPATH_LIVE_NO_HTTPS . '/', $content); $content = preg_replace('#href[ ]*=[ ]*\\"(?!https?://)(?:\\.\\./|\\./|/)?#', 'href="' . ACA_JPATH_LIVE_NO_HTTPS . '/', $content); $content = str_replace($replaceBy, $replaceTag, $content); $content = preg_replace('#\\.(jpg|gif|jpeg|png)(?:(?!").)?"#', '.\\1"', $content); if (!$html) { $content = str_replace('&', '&', $content); } return $content; }
function showListingLists($lists, $action, $task, $forms, $show) { global $Itemid, $mainframe, $my; $loggedin = false; if ($my->id > 0) { $loggedin = true; } if (!$mainframe->isAdmin() and !empty($GLOBALS[ACA . 'itemidAca'])) { $Itemid = $GLOBALS[ACA . 'itemidAca']; $item = '&Itemid=' . $Itemid; } else { $item = ''; } echo $forms['main']; echo '<table cellpadding="4" cellspacing="0" border="0" width="100%" class="adminlist"><tr>'; if ($show['id']) { echo '<th width="2%" class="title">id#</td>'; } if ($show['select']) { echo '<th width="3%" class="title"></th>'; } if ($show['published']) { echo '<th width="5%" class="title">' . _ACA_PUBLISHED . '</th>'; } echo '<th width="30%" class="title">' . _ACA_LIST_NAME . '</th>'; if ($show['sender']) { echo '<th width="20%" class="title">' . _ACA_LIST_SENDER . ' </th>'; } if ($show['sender_email']) { echo ' <th width="15%" class="title">' . _ACA_SENDER_EMAIL . '</th>'; } if ($show['mailings_link']) { echo '<th width="17%" class="title">' . _ACA_MENU_MAILING_TITLE . '</th>'; } if ($show['mailings_sub']) { echo '<th width="17%" class="title">' . _ACA_SUBSCRIBER_CONFIG . '</th>'; } if ($show['list_type']) { echo '<th width="10%" class="title">' . _ACA_LIST_TYPE . '</th>'; } if ($show['visible']) { echo '<th width="5%" class="title">' . _ACA_VISIBLE . '</th>'; } if ($show['buttons']) { if ($GLOBALS[ACA . 'allow_unregistered'] or $loggedin) { echo '<th class="title" width="90"><center>' . _ACA_SUBSCRIB . '</center></th>'; } if ($GLOBALS[ACA . 'show_archive'] == '1') { echo '<th class="title" width="90"><center>' . _ACA_VIEW_ARCHIVE . '</center></th>'; } } echo '</tr>'; $i = 0; foreach ($lists as $list) { $i++; if ($list->list_type == 1 or $list->list_type == 7) { $linkArchive = '.php?option=com_acajoom&act=mailing&listid=' . $list->id . '&listype=' . $list->list_type . '&task=archive' . $item; } else { $linkArchive = '#'; } if ($list->published == 1) { $img = 'publish_g.png'; $alt = 'Published'; } else { if ($list->published == 2) { $img = 'publish_y.png'; $alt = 'Scheduled'; } else { $img = 'publish_x.png'; $alt = 'Unpublished'; } } ?> <tr class="row<?php echo $i % 2; ?> "> <?php if ($show['id']) { echo '<td width="2%" class="title"><center>' . $list->id . '<center></td>'; } ?> <?php if ($show['select']) { ?> <td><input type="radio" name="listid" value="<?php echo $list->id; ?> " onClick="isChecked(this.checked);" /></td> <?php } if ($show['published']) { ?> <td align="center"><center> <img src="<?php echo $GLOBALS['mosConfig_live_site']; ?> /administrator/images/<?php echo $img; ?> " width="12" height="12" border="0" alt="<?php echo $alt; ?> " /> </center></td> <?php } if ($show['index'] == 'index') { if (acajoom::checkPermissions('admin')) { $link = '.php?option=com_acajoom&act=' . $action . '&task=' . $task . '&listid=' . $list->id . $item; } else { $link = $linkArchive; } compa::completeLink($link, false); } else { $link = '.php?option=com_acajoom&act=' . $action . '&task=' . $task . '&listid=' . $list->id; compa::completeLink($link); } ?> <td> <span class="aca_letter_names" <?php if ($link == "#" or $link == "administrator/#") { echo " onClick='return false;' "; } ?> > <?php echo compa::toolTip($list->list_desc, $list->list_name, '', '', $list->list_name, $link, 1); ?> </span> </td> <?php if ($show['sender']) { echo '<td>' . $list->sendername . '</td>'; } if ($show['sender_email']) { echo ' <td width="20%" class="title">' . $list->senderemail . '</td>'; } if ($show['mailings_link']) { if ($show['index'] == 'index') { $link = '.php?option=com_acajoom&act=mailing&task=show&listid=' . $list->id . '&listype=' . $list->list_type . $item; compa::completeLink($link, false); } else { $link = '.php?option=com_acajoom&act=mailing&task=show&listid=' . $list->id . '&listype=' . $list->list_type; compa::completeLink($link); } ?> <td><a href="<?php echo $link; ?> "> <?php echo _ACA_MALING_EDIT_VIEW; ?> </a></td> <?php } if ($show['mailings_sub']) { if ($show['index'] == 'index') { $link = '.php?option=com_acajoom&act=subscribers&listid=' . $list->id . $item; compa::completeLink($link, false); } else { $link = '.php?option=com_acajoom&act=subscribers&listid=' . $list->id; compa::completeLink($link); } ?> <td><a href="<?php echo $link; ?> "> <?php echo _ACA_SUBCRIBERS_VIEW; ?> </a></td> <?php } if ($show['list_type']) { if ($show['index'] == 'index') { $link = '.php?option=com_acajoom&act=mailing&listype=' . $list->list_type . $item; compa::completeLink($link, false); } else { $link = '.php?option=com_acajoom&act=mailing&listype=' . $list->list_type; compa::completeLink($link); } ?> <td><a href="<?php echo $link; ?> " ><?php echo @constant($GLOBALS[ACA . 'listname' . $list->list_type]); ?> </a></td> <?php } if ($show['visible']) { if ($list->hidden == 1) { $img = 'tick.png'; } else { $img = 'publish_x.png'; } ?> <td height="20"><center><img src="<?php echo $GLOBALS['mosConfig_live_site']; ?> /administrator/images/<?php echo $img; ?> " width="12" height="12" border="0" alt="" /></center></td> <?php } ?> <?php if ($show['buttons']) { if ($GLOBALS[ACA . 'allow_unregistered'] or $loggedin) { if (function_exists('sefRelToAbs') and $GLOBALS[ACA . 'use_sef']) { $link = sefRelToAbs($show['index'] . '.php?option=com_acajoom&act=subone&listid=' . $list->id . $item); } else { $link = $show['index'] . '.php?option=com_acajoom&act=subone&listid=' . $list->id . $item; } $img = 'folder_add_f2.png'; echo '<td align="center" height="24"><center>'; echo '<a href="' . $link . '" >' . "\n\r"; echo '<img src="components/com_acajoom/images/' . $img . '" width="20" height="20" border="0" alt="" /></a></center></td>' . "\n\r"; } if (($list->list_type == 1 or $list->list_type == 7) && $GLOBALS[ACA . 'show_archive'] == '1') { if (function_exists('sefRelToAbs') and $GLOBALS[ACA . 'use_sef']) { $linkArchive = sefRelToAbs($show['index'] . '.php?option=com_acajoom&act=mailing&listid=' . $list->id . '&listype=' . $list->list_type . '&task=archive' . $item); } else { $linkArchive = $show['index'] . '.php?option=com_acajoom&act=mailing&listid=' . $list->id . '&listype=' . $list->list_type . '&task=archive' . $item; } $img = 'move_f2.png'; echo '<td height="24"><center>'; echo '<a href="' . $linkArchive . '" >' . "\n\r"; echo '<img src="components/com_acajoom/images/' . $img . '" width="20" height="20" border="0" alt="' . _ACA_VIEW_ARCHIVE . '" /></a></center></td>' . "\n\r"; } elseif ($GLOBALS[ACA . 'show_archive'] == '1') { echo '<td height="24"><center>-</center></td>' . "\n\r"; } } echo ' </tr>' . "\n\r"; } echo '</table>'; }
function acajoombot_jcalpro_transformall($html, $text) { $database =& JFactory::getDBO(); $Itemid = $GLOBALS[ACA . 'itemidAca']; preg_match_all('#{jcalevent:.{7,15}}#', $html . $text, $tags); $replace = array(); $replacebyHTML = array(); $replacebyText = array(); if (!empty($tags[0])) { foreach ($tags[0] as $tag) { $isolate = explode(':', $tag); if (count($isolate) != 2) { continue; } $parameters = explode('|', $isolate[1]); if (count($parameters) != 4) { continue; } if (!empty($replace[$tag])) { continue; } $replace[$tag] = $tag; $query = 'SELECT `title`, `description`, `end_date`, `start_date`, `extid` from #__jcalpro_events where `extid` = ' . intval($parameters[0]); $database->setQuery($query); if (ACA_CMSTYPE) { // joomla 15 $event = $database->loadObject(); } else { //joomla 1x $database->loadObject($event); } //endif if (empty($event->extid)) { $replacebyHTML[$tag] = ''; $replacebyText[$tag] = ''; continue; } if (get_magic_quotes_runtime()) { $event->title = stripslashes($event->title); $event->description = stripslashes($event->description); } $eventhtml = ''; if ($parameters[2]) { $eventhtml .= '<div class="eventpaneopen_nws">'; } $eventhtml .= '<span class="eventheading_nws">' . $event->title . '</span>'; $eventtext = strtoupper(acajoom_mail::htmlToText($event->title)); if ($parameters[1]) { $start_date_array = explode('-', $event->start_date); $start_time_array = explode(':', substr($event->start_date, 10, 15)); $date = strftime(JText::_('DATE_FORMAT_LC'), mktime($start_time_array[0], $start_time_array[1], 0, $start_date_array[1], $start_date_array[2], $start_date_array[0])); $eventhtml .= '<br/>' . $date; $eventtext .= "\r\n" . $date; } if ($parameters[2]) { $eventhtml .= '<br/>' . $event->description; $eventtext .= "\r\n" . acajoom_mail::htmlToText($event->description); } if ($parameters[3]) { $link = '.php?option=com_jcalpro&extmode=view&extid=' . $event->extid . '&Itemid=' . $Itemid; compa::completeLink($link, false, $GLOBALS[ACA . 'use_sef']); $eventhtml .= '<br/><a href="' . $link . '"><span class="readon_nws">' . _ACA_READMORE . '</span></a>'; $eventtext .= "\r\n" . ' * ' . _ACA_READMORE . ' ( ' . $link . ' )'; } if ($parameters[2]) { $eventhtml .= '</div>'; } $replacebyHTML[$tag] = $eventhtml; $replacebyText[$tag] = $eventtext; } } $html = str_replace($replace, $replacebyHTML, $html); $text = str_replace($replace, $replacebyText, $text); }
function mailingEdit($subscriberId, $mailingId, $listId, $listType, $action) { global $my, $Itemid; if (ACA_CMSTYPE) { // joomla 15 $issue_nb = JRequest::getVar('issue_nb', '0'); $my =& JFactory::getUser(); } else { //joomla 1x $issue_nb = intval(mosGetParam($_REQUEST, 'issue_nb', 0)); global $my; } //endif $accessGrant = false; $new = 0; if (class_exists('pro')) { if ($issue_nb == 0) { $issue_nb = xmailing::countMailings($listId, ''); $issue_nb++; } if ($listId > 0) { $list = lists::getOneList($listId); $mailing = xmailing::getOneMailing($list, $mailingId, $issue_nb, $new); $acc_level = $list->acc_level; } else { return false; } if (acajoom::checkPermissions('hello', 0, $acc_level)) { $accessGrant = true; } } else { if ($subscriberId != 0 and ($my->usertype == 'Administrator' or $my->usertype == 'Super Administrator')) { $accessGrant = true; } } if ($accessGrant) { if ($issue_nb == 0) { $issue_nb = xmailing::countMailings($listId, ''); $issue_nb++; } if (empty($mailing)) { if ($mailingId > 0) { $mailing = xmailing::getOneMailing('', $mailingId, $issue_nb, $new); } else { if ($listId > 0) { $list = lists::getOneList($listId); $mailing = xmailing::getOneMailing($list, $mailingId, $issue_nb, $new); } else { return false; } } } $mainLink = '.php?option=com_acajoom&act=savemailing'; compa::completeLink($mainLink, false); $forms['main'] = '<form method="post" enctype="multipart/form-data" action="' . $mainLink . '" onsubmit="submitbutton();return false;" name="adminForm" >' . "\n\r"; $forms['main'] .= '<input type="hidden" name="Itemid" value="' . $Itemid . '" />'; $show = lisType::showType($mailing->list_type, 'editmailing'); frontHTML::formStart(_ACA_EDIT_A . @constant($GLOBALS[ACA . 'listname' . $mailing->list_type]), $mailing->html, 'edit_mailing'); mailingsHTML::editMailing($mailing, $new, $listId, $forms, $show); $go[] = acajoom::makeObj('act', $action); frontHTML::formEnd(_CMN_SAVE . ' ' . @constant($GLOBALS[ACA . 'listname' . $mailing->list_type]), $go); } else { echo acajoom::printM('red', _NOT_AUTH); } return true; }
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 showSubscriberLists($subscriber, $lists, $queues, $frontEnd, $accessAdmin) { global $Itemid, $mainframe; if (ACA_CMSTYPE) { // joomla 15 $my =& JFactory::getUser(); } else { //joomla 1x global $my; } //endif if (empty($Itemid) and !$mainframe->isAdmin()) { $Itemid = $GLOBALS[ACA . 'itemidAca']; } if (!empty($Itemid)) { $item = '&Itemid=' . $Itemid; } else { $item = ''; } $html = ''; if (!empty($lists)) { $br = "\n\r"; $html = '<fieldset class="acajoomcss" style="padding: 4px; text-align: left">' . $br; $html .= '<legend><strong>' . _ACA_SUBSCRIPTIONS . '</strong></legend>' . $br; $html .= '<table width="100%" border="0" cellspacing="0" cellpadding="4" class="adminlist">' . $br; $html .= '<tr><th class="title">#</th>' . $br; $html .= '<th class="title">' . _ACA_LIST_NAME . '</th>' . $br; $html .= '<th class="title" align=center>' . _ACA_SUBSCRIB . '</th>' . $br; if ($accessAdmin) { $html .= '<th class="title"><center>id #</center></th>' . $br; } if ($frontEnd and $GLOBALS[ACA . 'show_archive'] == '1') { $html .= '<th class="title"><center>' . _ACA_VIEW_ARCHIVE . '</center></th>' . $br; } // end if $html .= '</tr>' . $br; if ($frontEnd and empty($subscriber->id)) { $forceCheck = true; } else { $forceCheck = false; } $subscribed = ''; $i = 0; foreach ($lists as $list) { $i++; $subscribed = 0; if (!empty($queues)) { foreach ($queues as $queue) { if ($queue->list_id == $list->id) { $subscribed = 1; $access = $queue->acc_level; } else { $access = 29; } } } else { $access = 29; } $html .= '<tr><td>' . $i . '</td><td>' . $br; $link = ($list->hidden and ($list->list_type == '1' or $list->list_type == '7') and $GLOBALS[ACA . 'show_archive']) ? 'index.php?option=com_acajoom&act=mailing&task=archive&listid=' . $list->id . '&listype=' . $list->list_type . $item : '#'; $html .= '<span class="aca_letter_names"'; if ($link == "#") { $html .= " onclick='return false;' "; } $html .= '>' . compa::toolTip($list->list_desc, $list->list_name, '', '', $list->list_name, $link, 1) . ' </span>' . $br; $html .= '</td><td align="center">' . $br; $html .= '<input name="subscribed[' . $i . ']" value="1"'; if ($subscribed == 1 or $forceCheck) { $html .= ' checked="checked"'; } $html .= ' type="radio">' . _CMN_YES . $br; $html .= '<input name="subscribed[' . $i . ']" value="0"'; if ($subscribed == 0 and !$forceCheck) { $html .= ' checked="checked"'; } $html .= ' type="radio">' . _CMN_NO . $br; $html .= '<input type="hidden" name="sub_list_id[' . $i . ']" value="' . $list->id . '" />' . $br; $html .= '</td>' . $br; if ($accessAdmin) { $html .= '<td><center>' . $list->id . '</center></td> '; $html .= '<input type="hidden" name="acc_level[' . $i . ']" value="' . $access . '" />'; } else { $html .= '<input type="hidden" name="acc_level[' . $i . ']" value="' . $access . '" />'; } if ($frontEnd) { if (($list->list_type == 1 or $list->list_type == 7) && $GLOBALS[ACA . 'show_archive'] == '1') { $link = '.php?option=com_acajoom&act=mailing&listid=' . $list->id . '&listype=' . $list->list_type . '&task=archive' . $item; compa::completeLink($link, false); $img = 'move_f2.png'; $html .= '<td height="20"><center>'; $html .= '<a href="' . $link . '" >' . "\n\r"; $html .= '<img src="components/com_acajoom/images/' . $img . '" width="20" height="20" align="center" border="0" alt="' . _ACA_VIEW_ARCHIVE . '" /></a></center></td>' . "\n\r"; } elseif ($GLOBALS[ACA . 'show_archive'] == '1') { $html .= '<td height="20"><center>-</center></td>'; } } } $html .= '<tr></table></fieldset>'; } return $html; }
function showCompsList($update) { $link = '.php?option=com_acajoom&act=subscribers&task=import'; compa::completeLink($link); ?> </table> If you want to import a list of subscribers from a file, <a href="<?php echo $link; ?> ">please click here.</a> <br/> <?php if ($update->otherComponent) { ?> <table width="100%" cellpadding="4" cellspacing="0" border="0" align="left" class="adminlist"> <tr> <th colspan="4"><?php echo _ACA_CHECK_COMP; ?> </th> </tr> <?php foreach ($update->otherComponent as $component) { $moreLink = '<a href="' . $component->homePath . '" traget="_blank">' . _ACA_MORE_INFO . '</a>'; $tryitLink = '<a href="' . $component->download . '" traget="_blank">' . _ACA_TRY_IT . '</a>'; ?> <tr> <td> <?php echo $component->longVersion; echo '<br />' . $component->desc; ?> </td> <td> <?php echo $tryitLink; ?> </td> <td> <?php echo $moreLink; ?> </td> </tr> <?php } ?> </table> <?php } }
function create() { if (ACA_CMSTYPE) { // joomla 15 $my =& JFactory::getUser(); } else { //joomla 1x global $my; } //endif $Itemid = $GLOBALS[ACA . 'itemidAca']; if (!empty($Itemid)) { $item = '&Itemid=' . $Itemid; } else { $item = ''; } $hidden = ''; $htmlOK = false; $h = ''; if (!empty($this->lists)) { if ($my->id > 0) { $loggedin = true; $subscriber = subscribers::getSubscriberInfoFromUserId($my->id); if (empty($subscriber)) { subscribers::syncSubscribers(true); $subscriber = subscribers::getSubscriberInfoFromUserId($my->id); } if (empty($subscriber)) { $loggedin = false; } } else { $loggedin = false; } if (!$loggedin and $GLOBALS[ACA . 'allow_unregistered']) { $h .= ' <script language="javascript" type="text/javascript"> <!-- function submitacajoommod' . $this->num . '(formname) { var form = eval(\'document.\'+formname);' . 'var place = form.email.value.indexOf("@",1);' . 'var point = form.email.value.indexOf(".",place+1);'; if ($this->shownamefield) { $h .= ' if (form.name.value == "" || form.name.value == "' . addslashes(_ACA_NAME) . '") { alert( "' . addslashes(_ACA_REGWARN_NAME) . '" );' . 'return false; } else '; } $h .= ' if (form.email.value == "" || form.email.value == "' . addslashes(_ACA_EMAIL) . '") {' . 'alert( "' . addslashes(_ACA_REGWARN_MAIL) . '" );' . 'return false; } else {' . 'if ((place > -1)&&(form.email.value.length >2)&&(point > 1)){' . 'form.submit();' . 'return true; } ' . 'else {' . 'alert( "' . addslashes(_ACA_REGWARN_MAIL) . '" );' . 'return false;' . '}' . '}' . '} //--> </script>'; } if (!$GLOBALS[ACA . 'disabletooltip']) { if (ACA_CMSTYPE) { JHTML::_('behavior.tooltip'); } else { mosCommonHTML::loadOverlib(); } //endif } if (ACA_CMSTYPE) { //Joomla 1.5 $doc =& JFactory::getDocument(); $doc->addStyleSheet('components/com_acajoom/css/acajoom.css'); } else { $h .= '<link rel="stylesheet" href="' . ACA_JPATH_LIVE . '/components/com_acajoom/css/acajoom.css" type="text/css" >'; } $linkForm = '.php?option=com_acajoom'; compa::completeLink($linkForm, false); $h .= '<form action="' . $linkForm . '" method="post" name="modacajoomForm' . $this->num . '"> <div class="' . $this->moduleclass_sfx . '" ' . (empty($this->mod_align) ? '' : 'style="text-align:' . $this->mod_align . '"') . '>'; if (!empty($this->introtext)) { $text = '<span class="pretext' . $this->moduleclass_sfx . '">' . $this->introtext . '</span>'; $h .= acajoom::printLine($this->linear, $text); } //We create the dropdown if ($this->dropdown) { $dropdown = '<input type="hidden" value="1" name="subscribed[99]" />'; $dropdown .= '<select class="aca_list_drop" name="sub_list_id[99]">'; } $i = 0; $accessLevel = 0; if ($loggedin) { $queues = queue::getSubscriberLists($subscriber->id); } else { $queues = ''; } if ($this->showListName) { foreach ($this->lists as $list) { $i++; $subscribed = 0; $accessLevel = 0; if ($loggedin) { if (!empty($queues)) { foreach ($queues as $queue) { if ($list->id == $queue->list_id) { $subscribed = 1; $accessLevel = $queue->acc_level; } } } } if ($list->html == 1) { $htmlOK = true; } $checked = 0; if ($loggedin) { $checked = $subscribed; } else { if ($this->defaultchecked) { $checked = 1; } $subscriber->blacklist = 0; } if ($checked != 0) { $checkedPrint = ' checked="checked" '; } else { $checkedPrint = ''; } if ($list->hidden == 1) { if ($this->dropdown) { $extraselect = $list->id == $this->selecteddrop ? 'selected' : ''; $dropdown .= '<option value="' . $list->id . '" ' . $extraselect . '>' . $list->list_name . '</option>'; } else { if ($subscriber->blacklist == 0) { $text = "\n" . '<input id="wz_3' . $i . '" type="checkbox" class="inputbox" value="1" name="subscribed[' . $i . ']" ' . $checkedPrint . ' />'; } else { $text = "\n" . '<input type="checkbox" class="inputbox" value="1" name="subscribedfake[' . $i . ']" ' . $checkedPrint . ' />'; $text .= "\n" . '<input type="hidden" value="0" name="subscribed[' . $i . ']" />'; } $text .= "\n" . '<input type="hidden" name="sub_list_id[' . $i . ']" value="' . $list->id . '" />'; $link = ($list->list_type == '1' or $list->list_type == '7') && $GLOBALS[ACA . 'show_archive'] ? 'index.php?option=com_acajoom' . $item . '&act=mailing&task=archive&listid=' . $list->id . '&listype=' . $list->list_type : '#'; $text .= "\n" . '<span class="aca_list_name"'; if ($link == "#") { $text .= " onclick='return false;' "; } $text .= '>' . compa::toolTip($list->list_desc, $list->list_name, '', '', $list->list_name, $link, 1) . '</span>'; $h .= acajoom::printLine($this->linear, $text); $h .= "\n" . '<input type="hidden" name="acc_level[' . $i . ']" value="' . $accessLevel . '" />' . "\n\r"; } } else { if (!$loggedin) { $h .= '<input type="hidden" value="1" name="subscribed[' . $i . ']" />'; $h .= "\n" . '<input type="hidden" name="sub_list_id[' . $i . ']" value="' . $list->id . '" />'; } } } } else { foreach ($this->lists as $list) { $i++; $subscribed = 0; $accessLevel = 0; if ($loggedin) { if (!empty($queues)) { foreach ($queues as $queue) { if ($list->id == $queue->list_id) { $subscribed = 1; $accessLevel = $queue->acc_level; } } } } if ($list->html == 1) { $htmlOK = true; } $checked = 0; if ($loggedin) { $checked = $subscribed; } else { if ($this->defaultchecked) { $checked = 1; } } $h .= '<input type="hidden" value="' . $checked . '" name="subscribed[' . $i . ']" />'; $h .= "\n" . '<input type="hidden" name="sub_list_id[' . $i . ']" value="' . $list->id . '" />'; $h .= "\n" . '<input type="hidden" name="acc_level[' . $i . ']" value="' . $accessLevel . '" />'; if ($list->html == 1) { $htmlOK = true; } } } if ($this->dropdown) { $dropdown .= '</select><br/>'; $h .= $dropdown; } if (!$loggedin) { if ($GLOBALS[ACA . 'allow_unregistered']) { if ($this->shownamefield) { $text = '<input id="wz_11" type="text" size="' . $this->fieldsize . '" value="' . addslashes(_ACA_NAME) . '" class="inputbox" name="name" onblur="if(this.value==\'\') this.value=\'' . addslashes(_ACA_NAME) . '\';" onfocus="if(this.value==\'' . addslashes(_ACA_NAME) . '\') this.value=\'\' ; " />'; $h .= acajoom::printLine($this->linear, $text); } else { $text = '<input id="wz_11" type="hidden" value="" name="name" />'; } $text = '<input id="wz_12" type="text" size="' . $this->fieldsize . '" value="' . addslashes(_ACA_EMAIL) . '" class="inputbox" name="email" onblur="if(this.value==\'\') this.value=\'' . addslashes(_ACA_EMAIL) . '\';" onfocus="if(this.value==\'' . addslashes(_ACA_EMAIL) . '\') this.value=\'\' ; " />'; $h .= acajoom::printLine($this->linear, $text); } else { $h .= acajoom::printLine($this->linear, acajoom::printM('green', _ACA_REGISTER_REQUIRED)); $text = _NO_ACCOUNT . " "; if (isset($GLOBALS[ACA . 'cb_integration']) && $GLOBALS[ACA . 'cb_integration']) { $linkme = '.php?option=com_comprofiler&task=registers'; } else { if (ACA_CMSTYPE) { //Joom1.5 $linkme = '.php?option=com_user&task=register'; } else { $linkme = '.php?option=com_registration&task=register'; } } compa::completeLink($linkme, false); $text .= '<a href="' . $linkme . '">'; $text .= _CREATE_ACCOUNT . "</a>"; $h .= acajoom::printLine($this->linear, $text); $htmlOK = false; } } if ($htmlOK) { if ($loggedin and !empty($subscriber)) { $checked = $subscriber->receive_html; } else { $checked = $this->receivehtmldefault; } if ($this->showreceivehtml) { if ($checked != 0) { $checkedPrint = ' checked="checked" '; } else { $checkedPrint = ''; } $text = '<input id="wz_2" type="checkbox" class="inputbox" value="1" name="receive_html" ' . $checkedPrint . ' />'; $text .= ' ' . _ACA_RECEIVE_HTML; $h .= acajoom::printLine($this->linear, $text); } else { $hidden .= '<input id="wz_2" type="hidden" value="' . $checked . '" name="receive_html" />' . "\n"; } } else { $hidden .= '<input id="wz_2" type="hidden" value="0" name="receive_html" />' . "\n"; } if (!empty($this->posttext)) { $text = '<span class="postext' . $this->moduleclass_sfx . '">' . $this->posttext . '</span>'; $h .= acajoom::printLine($this->linear, $text); } if (!$loggedin) { if ($GLOBALS[ACA . 'allow_unregistered']) { if (isset($this->imgUnregistered)) { $text = '<input id="aca_22" type="image" src="' . $this->imgUnregistered . '" value="' . $this->buttonUnregistered . '" alt="' . $this->buttonUnregistered . '" name="' . $this->buttonUnregistered . '" onclick="return submitacajoommod' . $this->num . '(\'modacajoomForm' . $this->num . '\');" />'; } else { $text = '<input id="aca_22" type="button" value="' . $this->buttonUnregistered . '" class="button" name="' . $this->buttonUnregistered . '" onclick="return submitacajoommod' . $this->num . '(\'modacajoomForm' . $this->num . '\');" />'; } $h .= acajoom::printLine($this->linear, $text); $h .= ' </div> <input type="hidden" name="act" value="subscribe" /> <input type="hidden" name="redirectlink" value="' . $this->redirectURL . '" /> <input type="hidden" name="listname" value="' . $this->showListName . '" /> '; } else { $h .= '</div>'; } } else { if (isset($this->notifType) and $subscribed) { if (isset($this->imgUnregistered)) { $text = '<input id="aca_22" type="image" src="' . $this->imgUnregistered . '" value="' . $this->buttonUnregistered . '" alt="' . $this->buttonUnregistered . '" name="' . $this->buttonUnregistered . '" onclick="return submitacajoommod' . $this->num . '(\'modacajoomForm' . $this->num . '\');" />'; } else { $text = '<input id="aca_22" type="button" value="' . $this->buttonUnregistered . '" class="button" name="' . $this->buttonUnregistered . '" onclick="return submitacajoommod' . $this->num . '(\'modacajoomForm' . $this->num . '\');" />'; } $h .= acajoom::printLine($this->linear, $text); $h .= ' </div> <input type="hidden" name="act" value="subscribe" /> <input type="hidden" name="redirectlink" value="' . $this->redirectURL . '" /> <input type="hidden" name="listname" value="' . $this->showListName . '" /> '; } else { if (isset($this->imgRegistered)) { $text = '<input id="aca_22" type="image" src="' . $this->imgRegistered . '" value="' . $this->buttonRegistered . '" alt="' . $this->buttonRegistered . '" name="' . $this->buttonRegistered . '">'; } else { $text = '<input id="aca_22" type="submit" value="' . $this->buttonRegistered . '" name="' . $this->buttonRegistered . '" class="button" />'; } $h .= acajoom::printLine($this->linear, $text); $h .= ' </div> <input type="hidden" name="act" value="updatesubscription" /> <input type="hidden" name="redirectlink" value="' . $this->redirectURL . '" /> <input type="hidden" name="listname" value="' . $this->showListName . '" /> '; } } $h .= '<input type="hidden" name="Itemid" value="' . $Itemid . '" />'; $h .= $hidden . '</form>'; } else { $h .= acajoom::printM('blue', _ACA_LIST_NOT_AVAIL); } $this->_content = $h; return $h; }
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; }