Пример #1
0
 public static function showSubscriberLists($subscriberId, $action)
 {
     $lists = jNews_Lists::getLists(0, 0, $subscriberId, '', false, true, false);
     if ($subscriberId == 0) {
         $subscriber = '';
         $queues = '';
         jNews_SubscribersHTML::showSubscriberLists($subscriber, $lists, $queues, true);
     } else {
         frontEnd::subscriptions('', $subscriberId, 0, 'save');
     }
     return true;
 }
Пример #2
0
 public static function showPanel($pageUsed = 'main')
 {
     $Itemid = JRequest::getInt('Itemid');
     if (empty($Itemid)) {
         $Itemid = $GLOBALS[JNEWS . 'itemidAca'];
     }
     $database = JFactory::getDBO();
     $acl = JFactory::getACL();
     $my = JFactory::getUser();
     $ex_groups = array();
     $gid = @$GLOBALS[JNEWS . 'list_creatorfe'];
     if (!empty($my->id)) {
         if (!empty($my->username)) {
             $greeting_message = _HI . ' ' . $my->username;
         } else {
             $greeting_message = '';
         }
         $doc6 = JFactory::getDocument();
         $doc6->addStyleSheet(JNEWS_JPATH_LIVE . '/components/' . JNEWS_OPTION . '/css/menu.css');
         $gid = !empty($GLOBALS[JNEWS . 'list_creatorfe']) ? $GLOBALS[JNEWS . 'list_creatorfe'] : 0;
         frontHTML::FEmenu();
         backHTML::controlPanelBottonStart(_JNEWS_UCP_USER_MENU, 'usermenu.png');
         switch ($pageUsed) {
             case 'list':
                 $listId = JRequest::getVar('listid');
                 // newsletter button
                 //			    	$link = 'option='.JNEWS_OPTION.'&act=mailing&listid='. $listId .'&listype=1&Itemid='.$Itemid;
                 //alex pagination
                 $link = 'option=' . JNEWS_OPTION . '&act=mailing&listid=' . $listId . '&listype=1';
                 $link = jNews_Tools::completeLink($link, false);
                 backHTML::quickiconButton($link, 'newsletterFE.png', _JNEWS_NEWSLETTER, false, 'all', false);
                 // smart newsletter button
                 //			    	$link = 'option='.JNEWS_OPTION.'&act=mailing&listid='. $listId .'&listype=7&Itemid='.$Itemid;
                 //alex pagination
                 $link = 'option=' . JNEWS_OPTION . '&act=mailing&listid=' . $listId . '&listype=7';
                 $link = jNews_Tools::completeLink($link, false);
                 backHTML::quickiconButton($link, 'smartnewsletterFE.png', _JNEWS_AUTONEWS, false, 'all', false);
                 break;
             default:
                 //					$link = 'option='.JNEWS_OPTION.'&act=show&Itemid='.$Itemid;
                 //alex pagination
                 $link = 'option=' . JNEWS_OPTION . '&act=show';
                 $link = jNews_Tools::completeLink($link, false);
                 backHTML::quickiconButton($link, 'my_subscriptions48.png', _JNEWS_UCP_USER_CONTACT, false, 'all', false);
                 //come back here
                 //$proceedToCheck = true;
                 break;
         }
         if (class_exists('jNews_Pro')) {
             $my = JFactory::getUser();
             $ownedlists = jNews_Lists::getOwnedlists($my->id);
             if (version_compare(JVERSION, '1.6.0', '<')) {
                 //j15
                 $usergid = $my->gid;
             } else {
                 //j16
                 $usergid = JAccess::getGroupsByUser($my->id, false);
             }
             $ex_groups = explode(',', $gid);
             if (is_array($usergid)) {
                 $canAccess = array_intersect($usergid, $ex_groups);
             }
             if (in_array($usergid, $ex_groups) || !empty($canAccess)) {
                 if ($GLOBALS[JNEWS . 'level'] > 2 && version_compare(JVERSION, '1.6.0', '>')) {
                     //					    $link = 'option='.JNEWS_OPTION.'&act=list&mid=1&listype=1&Itemid='.$Itemid;
                     //alex pagination
                     $link = 'option=' . JNEWS_OPTION . '&act=list&mid=1&listype=1';
                     $link = jNews_Tools::completeLink($link, false);
                     backHTML::quickiconButton($link, 'addedit.png', _JNEWS_MENU_LIST, false, 'all', false);
                 }
                 $listId = JRequest::getVar('listid');
                 $act = JRequest::getVar('act', '', '', 'WORD');
                 $task = JRequest::getVar('task');
                 if (empty($listId) || $act == 'mailing' && $task == 'save') {
                     // list button
                     $link = 'option=' . JNEWS_OPTION . '&act=list&listype=1&mid=1&Itemid=' . $Itemid;
                     $link = jNews_Tools::completeLink($link, false);
                     backHTML::quickiconButton($link, 'addedit.png', _JNEWS_MENU_LIST, false, $usergid, false);
                     if (empty($listId)) {
                         if ($GLOBALS[JNEWS . 'enable_jsub']) {
                             if (!empty($my->id)) {
                                 $ownedlists = jNews_Lists::getOwnedlists($my->id);
                             }
                             if (!empty($ownedlists)) {
                                 $listId = $ownedlists[0];
                             } else {
                                 $listId = jNews_Lists::getIDacclevel(18, $my->id);
                             }
                         } else {
                             $listId = jNews_Lists::getIDacclevel(18, $my->id);
                         }
                         frontHTML::cpanelHTML($listId, $Itemid);
                     }
                 }
             } else {
                 $lists = jNews_Lists::getLists(0, 0, true);
                 $access = false;
                 $id = 0;
                 if ($GLOBALS[JNEWS . 'enable_jsub']) {
                     if (!empty($my->id)) {
                         $ownedlists = jNews_Lists::getOwnedlists($my->id);
                     }
                     if (!empty($ownedlists)) {
                         $id = $my->id;
                     }
                 }
                 foreach ($lists as $list) {
                     $bit = jnews::checkPermissions($list->acc_level);
                     if ($bit) {
                         $access = true;
                         break;
                     }
                 }
                 $link = 'option=' . JNEWS_OPTION . '&act=list&mid=1&listype=1&Itemid=' . $Itemid;
                 $link = jNews_Tools::completeLink($link, false);
                 if (!empty($my->id)) {
                     $ownedlists = jNews_Lists::getOwnedlists($my->id);
                 }
                 if (empty($listId)) {
                     if ($GLOBALS[JNEWS . 'enable_jsub']) {
                         if (!empty($my->id)) {
                             $ownedlists = jNews_Lists::getOwnedlists($my->id);
                         }
                         if (!empty($ownedlists)) {
                             $listId = $ownedlists[0];
                         } else {
                             $listId = jNews_Lists::getIDacclevel(18, $my->id);
                         }
                     } else {
                         $listId = jNews_Lists::getIDacclevel(18, $my->id);
                     }
                 }
                 if ($GLOBALS[JNEWS . 'enable_jsub']) {
                     if ($access && !empty($ownedlists)) {
                         backHTML::quickiconButton($link, 'addedit.png', _JNEWS_MENU_LIST, false, 'all', false);
                         frontHTML::cpanelHTML($listId, $Itemid);
                     }
                 } else {
                     $creatorFe = jnews::checkPermissions($gid);
                     //traces
                     if ($access || $creatorFe) {
                         backHTML::quickiconButton($link, 'addedit.png', _JNEWS_MENU_LIST, false, 'all');
                         frontHTML::cpanelHTML($listId, $Itemid);
                     }
                 }
             }
         } else {
             if ($GLOBALS[JNEWS . 'level'] > 2) {
                 $link = 'option=' . JNEWS_OPTION . '&act=list&mid=1&listype=1&Itemid=' . $Itemid;
                 $link = jNews_Tools::completeLink($link, false);
                 backHTML::quickiconButton($link, 'addedit.png', _JNEWS_MENU_LIST, false, 'all', false);
             }
         }
         backHTML::controlPanelBottomEnd();
         if (class_exists('jNews_Auto')) {
             jNews_Auto::otherPanel();
         }
     } elseif ($GLOBALS[JNEWS . 'show_lists']) {
         $subscriberId = JRequest::getInt('subscriber');
         $subscriber = jNews_Subscribers::getSubscribersFromId(array($subscriberId), false);
         frontEnd::changeSubscriptions($subscriberId, md5($subscriber->email), '', 'save');
     }
 }
Пример #3
0
                            } else {
                                //j16
                                $db->setQuery("SELECT `enabled` FROM `#__extensions` WHERE `type` = 'plugin' AND `element`='cache' ");
                            }
                            $published = $db->loadResult();
                            if ($published) {
                                jNews::printM('warning', 'ONLY IF YOU USE YOUR OWN SERVER CRON TASK!');
                                jNews::printM('warning', 'You NEED to reduce the cache time on your website in order for the cron task to work properly!');
                                jNews::printM('warning', 'You need to put the cache time less than :' . $GLOBALS[JNEWS . 'cron_max_freq'] * 0.8 . ' minutes');
                                jNews::printM('warning', 'Or increase your jNews scheduler to :' . $cacheTime * 1.2 . ' minutes');
                            }
                        }
                    } else {
                        jnews::printM('error', _JNEWS_NOCRON_USED);
                    }
                    break;
                default:
                    $showPanel = true;
                    break;
            }
        } else {
            $showPanel = true;
        }
        break;
}
echo $message;
if ($showPanel) {
    frontEnd::introduction($subscriberId, $listId, $lisType);
}
frontHTML::_footer();
echo "\n\r" . '<!--  End : ' . jnews::version() . '   -->' . "\n\r";