Example #1
0
/**
* @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 com_install()
{
    @ini_set('max_execution_time', 0);
    @ini_set('memory_limit', '128M');
    if (defined('JPATH_ROOT') and class_exists('JFactory')) {
        // joomla 15
        define('ACA_JPATH_ROOT', JPATH_ROOT);
    } else {
        define('ACA_JPATH_ROOT', $GLOBALS['mosConfig_absolute_path']);
    }
    //endif
    require_once ACA_JPATH_ROOT . '/components/com_acajoom/defines.php';
    require_once WPATH_ADMIN . 'config.acajoom.php';
    require_once WPATH_ADMIN . 'admin.acajoom.html.php';
    require_once WPATH_CLASS . 'class.acajoom.php';
    $update = new wupdate();
    $xf = new xonfig();
    $return = '';
    if (ACA_CMSTYPE) {
        $database =& JFactory::getDBO();
    } else {
        global $database;
    }
    //endif
    if (!is_writable(ACA_JPATH_ROOT_NO_ADMIN . $acajoomConfigFile['upload_url'])) {
        @chmod(ACA_JPATH_ROOT_NO_ADMIN . $acajoomConfigFile['upload_url'], 0777);
    }
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../administrator/components/com_acajoom/images/acajoom_icon.png'\n\t  WHERE admin_menu_link='option=com_acajoom'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/edit.png',\n\t  name='" . _ACA_MENU_LIST . "',\n\t  admin_menu_alt='" . _ACA_MENU_LIST . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=list'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/users_add.png' ,\n\t  name='" . _ACA_MENU_SUBSCRIBERS . "',\n\t  admin_menu_alt='" . _ACA_MENU_SUBSCRIBERS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=subscribers'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/messaging_inbox.png' ,\n\t  name='" . _ACA_MENU_NEWSLETTERS . "',\n\t  admin_menu_alt='" . _ACA_MENU_NEWSLETTERS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=mailing&listype=1'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/messaging_config.png' ,\n\t  name='" . _ACA_MENU_AUTOS . "',\n\t  admin_menu_alt='" . _ACA_MENU_AUTOS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=mailing&listype=2'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/query.png' ,\n\t   name='" . _ACA_MENU_STATS . "',\n\t   admin_menu_alt='" . _ACA_MENU_STATS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=statistics'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/menus.png' ,\n\t   name='" . _ACA_MENU_CONF . "',\n\t   admin_menu_alt='" . _ACA_MENU_CONF . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=configuration'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/restore.png' ,\n\t  name='" . _ACA_MENU_UPDATE . "',\n\t  admin_menu_alt='" . _ACA_MENU_UPDATE . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=update'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/credits.png' ,\n\t  name='" . _ACA_MENU_ABOUT . "',\n\t  admin_menu_alt='" . _ACA_MENU_ABOUT . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=about'";
    $q = " SELECT `text` FROM `#__acajoom_xonfig` WHERE `akey` = 'version' ";
    $database->setQuery($q);
    $vers = $database->loadResult();
    $err = $database->getErrorMsg();
    if (!empty($err)) {
        $q = " SELECT `text` FROM `#__acajoom_xonfig` WHERE `key` = 'version' ";
        $database->setQuery($q);
        $vers = $database->loadResult();
        if (!empty($vers) and $update->checkVersion($vers, '1.0.6')) {
            ### UPDATE database if before 1.0.7
            $query[] = "ALTER TABLE `#__acajoom_mailings` CHANGE `images` `images` TEXT NOT NULL ";
            $query[] = "ALTER TABLE `#__acajoom_lists` ADD `footer` TINYINT( 1 ) NOT NULL DEFAULT '1' ";
            $query[] = "ALTER TABLE `#__acajoom_lists` ADD `notify_id` INT( 10 ) NOT NULL DEFAULT '0' ";
            $query[] = "ALTER TABLE `#__acajoom_xonfig` DROP INDEX `key` ";
            $query[] = "ALTER TABLE `#__acajoom_xonfig` CHANGE `key` `akey` VARCHAR( 32 ) NOT NULL ";
            $query[] = "ALTER TABLE `#__acajoom_xonfig` CHANGE `value` `value` INT( 11 ) NOT NULL ";
            $query[] = "ALTER TABLE `#__acajoom_stats_global` DROP `listid`  ";
            $query[] = "ALTER TABLE `#__acajoom_stats_global` DROP INDEX `listid` ";
            $query[] = "ALTER TABLE `#__acajoom_stats_global` ADD PRIMARY KEY ( `mailing_id` ) ";
            $query[] = "ALTER TABLE `#__acajoom_stats_details` DROP `listid` ";
            $query[] = "ALTER TABLE `#__acajoom_stats_details` DROP INDEX `listid` ";
            $query[] = "ALTER TABLE `#__acajoom_stats_details` ADD PRIMARY KEY ( `mailing_id` , `subscriber_id` ) ";
            ### 1.0.9
            $query[] = " ALTER TABLE `#__acajoom_mailings` CHANGE `fromname` `fromname` VARCHAR( 64 ) NOT NULL  ";
            $query[] = " ALTER TABLE `#__acajoom_lists` CHANGE `sendername` `sendername` VARCHAR( 64 ) NOT NULL  ";
        }
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.0.8')) {
        $query[] = " ALTER TABLE `#__acajoom_mailings` CHANGE `fromname` `fromname` VARCHAR( 64 ) NOT NULL  ";
        $query[] = " ALTER TABLE `#__acajoom_lists` CHANGE `sendername` `sendername` VARCHAR( 64 ) NOT NULL  ";
        ### upgrade path for new versions
        $xf->insert('wait_for_user', '0', 0);
        $xf->insert('report_site', 'http://www.ijoobi.com', 0);
        $xf->insert('use_sef', '0', 0);
        $xf->insert('send_error', '1', 0);
        $xf->insert('report_error', '1', 0);
        $xf->insert('wait_for_user', '0', 0);
        $xf->insert('show_archive', '1', 0);
        $xf->insert('update_notification', '1', 0);
        $xf->update('send_log_address', '@ijoobi.com');
        $xf->update('update_url', 'http://www.ijoobi.com/update/');
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.1.0')) {
        $query[] = "ALTER TABLE `#__acajoom_lists` ADD `notification` INT( 10 ) NOT NULL DEFAULT '0' ";
        $xf->update('listname1', '_ACA_NEWSLETTER');
        $xf->update('listnames1', '_ACA_MENU_NEWSLETTERS');
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.1.4')) {
        $xf->insert('last_sub_update', '', 0);
        $xf->insert('level', '1', 0);
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.3.0')) {
        $xf->insert('show_author', '0', 0);
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.5.5')) {
        $xf->insert('addEmailRedLink', '0', 0);
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.5.5')) {
        $query[] = " ALTER TABLE `#__acajoom_subscribers` ADD INDEX `subscribe_date` ( `subscribe_date` )   ";
        $query[] = " ALTER TABLE `#__acajoom_queue` CHANGE `subscriber_id` `subscriber_id` INT( 11 ) DEFAULT '0' NOT NULL  ";
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.6.4')) {
        $xf->insert('show_jcalpro', '0', 0);
        $xf->insert('redirectconfirm', '', 0);
        $xf->insert('itemidAca', '99', 0);
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '3.2.0')) {
        $xf->insert('fullcheck', '0', 0);
    }
    $query2 = "SHOW COLUMNS FROM `#__acajoom_lists` ";
    $database->setQuery($query2);
    $columns = $database->loadResultArray();
    if (!in_array('cat_id', $columns)) {
        $query[] = "ALTER TABLE `#__acajoom_lists` CHANGE `choose_time` `cat_id` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'";
    }
    if (!in_array('next_date', $columns)) {
        $query[] = "ALTER TABLE `#__acajoom_lists` ADD `next_date` INT( 11 ) NOT NULL AFTER `notify_id` ";
    }
    if (!in_array('start_date', $columns)) {
        $query[] = "ALTER TABLE `#__acajoom_lists` ADD `start_date` DATE NOT NULL AFTER `next_date`";
    }
    $query[] = 'UPDATE `#__acajoom_lists` SET `acc_level` = 24 WHERE `acc_level` = 0';
    foreach ($acajoomConfigFile as $key => $val) {
        if (!isset($GLOBALS[ACA . $key])) {
            $xf->insert($key, $val, 0);
        }
    }
    if (!empty($vers) and $update->checkVersion($vers, '1.2.2')) {
        $query[] = "UPDATE `#__acajoom_lists` SET `acc_id` = '29' WHERE `acc_id` = '25' ";
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '3.0.0')) {
        $xf->insert('disabletooltip', '0', 0);
        $xf->insert('minisendmail', '0', 0);
    }
    $query[] = "ALTER TABLE `#__acajoom_lists` CHANGE `cat_id` `cat_id` VARCHAR( 250 ) NOT NULL DEFAULT ''";
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '3.2.3')) {
        $xf->insert('embed_images', '0', 0);
        $xf->insert('clean_stats', '90', 0);
        $xf->insert('word_wrap', '0', 0);
        $query[] = "UPDATE `#__acajoom_lists` SET `cat_id`  = CONCAT(`cat_id`,':',`notify_id`), `notify_id`= 0 WHERE `list_type` = 7 AND `notify_id` > 0";
    }
    //Query to quickly synchronise all your subscribers during the install!
    $query[] = "INSERT IGNORE INTO `#__acajoom_subscribers` ( `user_id` , `name` , `email` , `receive_html` , `confirmed` , `blacklist` , `subscribe_date` )" . "SELECT U.id, U.name, U.email, '1', '1', U.block , U.registerDate from `#__users` as U;";
    if (!defined('WADMIN')) {
        define('WADMIN', 'administrator' . DS . 'components' . DS . 'com_acajoom' . DS);
    }
    if (!defined('WFRONT')) {
        define('WFRONT', 'components' . DS . 'com_acajoom' . DS);
    }
    $file[] = 'templates';
    $file[] = 'templates/default';
    $file[] = 'templates/index.html';
    $file[] = 'templates/default/default.html';
    $file[] = 'templates/default/tpl0_abovefooter.jpg';
    $file[] = 'templates/default/tpl0_powered_by.gif';
    $file[] = 'templates/default/tpl0_spacer.gif';
    $file[] = 'templates/default/tpl0_top_header.jpg';
    $file[] = 'templates/default/tpl0_underban.jpg';
    $file[] = 'templates/default/index.html';
    foreach ($file as $key5 => $ins) {
        if (!file_exists(ACA_JPATH_ROOT . DS . WFRONT . $ins) && file_exists(ACA_JPATH_ROOT . DS . WADMIN . $ins)) {
            @rename(ACA_JPATH_ROOT . DS . WADMIN . $ins, ACA_JPATH_ROOT . DS . WFRONT . $ins);
        }
    }
    $size = sizeof($query);
    for ($index = 0; $index < $size; $index++) {
        $database->setQuery($query[$index]);
        $database->query();
    }
    if (empty($vers)) {
        $xf->filetoDatabase($acajoomConfigFile);
    }
    $return .= setupMaiOptions($acajoomConfigFile);
    $return .= installBots();
    $return .= installModule();
    if (acajoom::checkCB()) {
        $return .= installPlugin();
    }
    subscribers::updateSubscribers(true, true);
    require_once WPATH_ADMIN . 'version.php';
    $xf->update('component', $localVersion['component']);
    $xf->update('type', $localVersion['type']);
    $xf->update('version', $localVersion['version']);
    $xf->update('level', $localVersion['level']);
    $message = acajoom::printM('noimage', _ACA_THANKYOU);
    backHTML::_header(_ACA_MENU_INSTALL, 'install.png', $message, '', '');
    if ($acajoomConfigFile['type'] == 'PRO') {
        backHTML::about();
    } elseif ($acajoomConfigFile['type'] == 'Plus') {
        backHTML::installPRO();
    } else {
        backHTML::installPlus();
    }
    $link = 'index2.php?option=com_acajoom&act=start';
    echo '<table style="width: 100%; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="0" cellspacing="0"><tbody><tr>' . '<td style=" width: 140px;">&nbsp;</td><td style="text-align: center; vertical-align: middle; width: 140px;"><div id="cpanel">';
    backHTML::quickiconButton($link, 'inbox.png', _ACA_GET_STARTED, false, 'admin');
    echo '</div><td></td></td></tr></tbody></table>' . '<div style="clear:both;"></div>';
    echo '<br/><br/><br/><br/>';
    echo '<a href="http://www.ijoobi.com/index.php?option=com_content&view=article&id=7871:installation-errors&catid=29:acajoom&Itemid=72" target="_blank">If you have any error during the install process, please refer to our documentation at http://www.ijoobi.com/index.php?option=com_content&view=article&id=7871:installation-errors&catid=29:acajoom&Itemid=72</a>';
    echo '<br/><br/>';
    echo $return;
    return $return;
}
Example #2
0
 public static function cpanelHTML($listId, $Itemid)
 {
     if (empty($Itemid)) {
         $Itemid = $GLOBALS[JNEWS . 'itemidAca'];
     }
     $gid = !empty($GLOBALS[JNEWS . 'list_creatorfe']) ? $GLOBALS[JNEWS . 'list_creatorfe'] : 0;
     if (jnews::checkPermissions('admin') || jnews::checkPermissions($gid)) {
         //subscribers button
         //		$link = 'option='.JNEWS_OPTION.'&act=subscribers&mid=2&Itemid='.$Itemid;//.'&listid='.$listId;
         //alex pagination
         $link = 'option=' . JNEWS_OPTION . '&act=subscribers&mid=2';
         $link = jNews_Tools::completeLink($link, false);
         backHTML::quickiconButton($link, 'addusers.png', _JNEWS_SUBSCRIBERS, false, 'all', false);
     }
     //add the newsletter button and smartnewsletter button in the cpanel
     // newsletter button
     //    	$link = 'option='.JNEWS_OPTION.'&act=mailing&mid=3&listype=1&Itemid='.$Itemid;
     //alex pagination
     $link = 'option=' . JNEWS_OPTION . '&act=mailing&mid=3&listype=1';
     $link = jNews_Tools::completeLink($link, false);
     backHTML::quickiconButton($link, 'newsletterFE.png', _JNEWS_NEWSLETTER, false, 'all', false);
     // smart newsletter button
     if ($GLOBALS[JNEWS . 'allow_sn']) {
         $link = 'option=' . JNEWS_OPTION . '&act=mailing&mid=4&listid=' . $listId . '&listype=7&Itemid=' . $Itemid;
         $link = jNews_Tools::completeLink($link, false);
         backHTML::quickiconButton($link, 'smartnewsletterFE.png', _JNEWS_AUTONEWS, false, 'all', false);
     }
     //		88744551 - auto-responder action should be list not mailing
     //autoresponder button
     if (@(include_once JNEWSPATH_ADMIN . 'social' . DS . 'class.social.php')) {
         if (class_exists('jNews_Social') && $GLOBALS[JNEWS . 'allow_fe_autoresponder']) {
             //8254465
             if (jnews::checkPermissions('admin') || jnews::checkPermissions($gid)) {
                 $link = 'option=' . JNEWS_OPTION . '&act=list&mid=5&listype=2&Itemid=' . $Itemid;
                 $link = jNews_Tools::completeLink($link, false);
                 backHTML::quickiconButton($link, 'autoresponderFE.png', _JNEWS_MENU_AUTOS, false, 'all', false);
             }
         }
     }
     if (jnews::checkPermissions('admin') || jnews::checkPermissions($gid)) {
         //statistics and reports button
         //    		$link = 'option='.JNEWS_OPTION.'&act=statistics&mid=6&listype=1&listid='. $listId .'&Itemid='.$Itemid;
         //alex pagination
         $link = 'option=' . JNEWS_OPTION . '&act=statistics&mid=6&listype=1&listid=' . $listId;
         $link = jNews_Tools::completeLink($link, false);
         backHTML::quickiconButton($link, 'statistics.png', _JNEWS_MENU_STATS_REPORTS, false, 'all', false);
     }
     return true;
 }
 function iconsPanel()
 {
     global $my;
     echo '<div id="cpanel">';
     $link = 'index2.php?option=com_acajoom&act=list';
     backHTML::quickiconButton($link, 'addedit.png', _ACA_MENU_LIST, false, 'admin');
     $link = 'index2.php?option=com_acajoom&act=subscribers';
     backHTML::quickiconButton($link, 'addusers.png', _ACA_MENU_SUBSCRIBERS, false, 'admin');
     $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) {
             $link = 'index2.php?option=com_acajoom&act=mailing&listype=' . $index;
             backHTML::quickiconButton($link, $GLOBALS[ACA . 'listlogo' . $index], @constant($GLOBALS[ACA . 'listnames' . $index]), false, 'admin');
         }
     }
     $link = 'index2.php?option=com_media';
     backHTML::quickiconButton($link, 'mediamanager.png', _ACA_MENU_MEDIA, false, 'admin');
     $link = 'index2.php?option=com_acajoom&act=statistics';
     backHTML::quickiconButton($link, 'query.png', _ACA_MENU_STATS, false, 'admin');
     $link = 'index2.php?option=com_acajoom&act=configuration';
     backHTML::quickiconButton($link, 'menu.png', _ACA_MENU_CONF, false, 'admin');
     //$link = 'index2.php?option=com_acajoom&act=update';
     //backHTML::quickiconButton( $link, 'backup.png', _ACA_MENU_UPDATE ,false, 'admin'  );
     $link = "http://www.acajoom.com/index.php?option=com_joomlaboard&Itemid=26&task=listcat&catid=22";
     backHTML::quickiconButton($link, 'support.png', _ACA_MENU_HELP, true, 'Registered');
     $link = 'http://www.acajoom.com/index.php?option=com_content&task=blogsection&id=5&Itemid=68';
     backHTML::quickiconButton($link, 'impressions.png', _ACA_MENU_LEARN, true, 'Registered');
     $link = "http://www.acajoom.com/index.php?option=com_content&task=blogcategory&id=29&Itemid=82";
     backHTML::quickiconButton($link, 'browser.png', _ACA_MENU_VIDEO, true, 'Registered');
     $link = 'index2.php?option=com_acajoom&act=about';
     backHTML::quickiconButton($link, 'credits.png', _ACA_MENU_ABOUT, false, 'Registered');
     echo '</div>';
 }
Example #4
0
 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();
         }
     }
 }
Example #5
0
 public static function iconsPanel()
 {
     $my = JFactory::getUser();
     echo '<div id="cpanel">';
     $link = 'index.php?option=' . JNEWS_OPTION . '&act=list&pg=20';
     backHTML::quickiconButton($link, 'header/lists.png', _JNEWS_MENU_LIST, false, 'admin');
     $link = 'index.php?option=' . JNEWS_OPTION . '&act=subscribers&pg=20';
     backHTML::quickiconButton($link, 'header/subscribers.png', _JNEWS_MENU_SUBSCRIBERS, false, 'admin');
     $nb = explode(',', $GLOBALS[JNEWS . 'activelist']);
     $size = sizeof($nb);
     for ($i = 0; $i < $size; $i++) {
         $index = $nb[$i];
         if ($GLOBALS[JNEWS . 'listshow' . $index] > 0 and $GLOBALS[JNEWS . 'listype' . $index] == 1 and $index != 2) {
             $link = 'index.php?option=' . JNEWS_OPTION . '&act=mailing&listype=' . $index . '&pg=20';
             //$index
             backHTML::quickiconButton($link, 'header/' . $GLOBALS[JNEWS . 'listlogo' . $index], @constant($GLOBALS[JNEWS . 'listname' . $index]), false, 'admin');
         }
     }
     if ($GLOBALS[JNEWS . 'level'] > 1) {
         $link = 'index.php?option=' . JNEWS_OPTION . '&act=arlist&listype=2&pg=20';
         backHTML::quickiconButton($link, 'header/' . $GLOBALS[JNEWS . 'listlogo2'], @constant($GLOBALS[JNEWS . 'listnames2']), false, 'admin');
     }
     $link = 'index.php?option=com_media';
     backHTML::quickiconButton($link, 'header/media_manager.png', _JNEWS_MENU_MEDIA, false, 'admin');
     $link = 'index.php?option=' . JNEWS_OPTION . '&act=statistics';
     if ($GLOBALS[JNEWS . 'level'] > 1) {
         backHTML::quickiconButton($link, 'header/statistics.png', _JNEWS_MENU_STATS, false, 'admin');
     } else {
         backHTML::quickiconButton($link, 'header/statistics.png', _JNEWS_MENU_STATS_REPORTS, false, 'admin');
     }
     $link = 'index.php?option=' . JNEWS_OPTION . '&act=queue&pg=20';
     backHTML::quickiconButton($link, 'header/queue.png', _JNEWS_MENU_QUEUE, false, 'admin');
     $link = 'index.php?option=' . JNEWS_OPTION . '&act=templates&pg=20';
     backHTML::quickiconButton($link, 'header/templates.png', _JNEWS_MENU_TEMPLATE, false, 'admin');
     $link = 'index.php?option=' . JNEWS_OPTION . '&act=configuration';
     backHTML::quickiconButton($link, 'header/configuration.png', _JNEWS_MENU_CONF, false, 'admin');
     $link = JNEWS_HOME_SITE . "/index.php?option=com_jlinks&controller=redirect&link=support_jnews";
     backHTML::quickiconButton($link, 'header/help.png', _JNEWS_MENU_HELP, true, 'Registered');
     $link = 'http://demo.joobi.co/';
     backHTML::quickiconButton($link, 'header/education_center.png', _JNEWS_MENU_LEARN, true, 'Registered');
     $link = JNEWS_HOME_SITE . "/index.php?option=com_jlinks&controller=redirect&link=live-chat";
     backHTML::quickiconButton($link, 'header/live_support.gif', _JNEWS_MENU_LIVE_SUPPORT, true, 'Registered');
     $link = 'index.php?option=' . JNEWS_OPTION . '&act=about';
     backHTML::quickiconButton($link, 'header/about.png', _JNEWS_MENU_ABOUT, false, 'Registered');
     echo '</div>';
 }
Example #6
0
 function iconsPanel()
 {
     if (ACA_CMSTYPE) {
         // joomla 15
         $my =& JFactory::getUser();
     } else {
         //joomla 1x
         global $my;
     }
     //endif
     echo '<div id="cpanel">';
     $link = 'index2.php?option=com_acajoom&act=list';
     backHTML::quickiconButton($link, 'addedit.png', _ACA_MENU_LIST, false, 'admin');
     $link = 'index2.php?option=com_acajoom&act=subscribers';
     backHTML::quickiconButton($link, 'addusers.png', _ACA_MENU_SUBSCRIBERS, false, 'admin');
     $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) {
             $link = 'index2.php?option=com_acajoom&act=mailing&listype=' . $index;
             backHTML::quickiconButton($link, $GLOBALS[ACA . 'listlogo' . $index], @constant($GLOBALS[ACA . 'listnames' . $index]), false, 'admin');
         }
     }
     $link = 'index2.php?option=com_media';
     backHTML::quickiconButton($link, 'mediamanager.png', _ACA_MENU_MEDIA, false, 'admin');
     $link = 'index2.php?option=com_acajoom&act=statistics';
     backHTML::quickiconButton($link, 'query.png', _ACA_MENU_STATS, false, 'admin');
     $link = 'index2.php?option=com_acajoom&act=configuration';
     backHTML::quickiconButton($link, 'menu.png', _ACA_MENU_CONF, false, 'admin');
     //$link = 'index2.php?option=com_acajoom&act=update';
     //backHTML::quickiconButton( $link, 'backup.png', _ACA_MENU_UPDATE ,false, 'admin'  );
     $link = "http://www.ijoobi.com/index.php?option=com_agora&Itemid=60";
     backHTML::quickiconButton($link, 'support.png', _ACA_MENU_HELP, true, 'Registered');
     $link = 'http://www.ijoobi.com/index.php?option=com_content&view=category&layout=blog&id=29&Itemid=72';
     backHTML::quickiconButton($link, 'impressions.png', _ACA_MENU_LEARN, true, 'Registered');
     $link = "http://www.ijoobi.com/index.php?option=com_content&view=category&layout=blog&id=29&Itemid=72";
     backHTML::quickiconButton($link, 'browser.png', _ACA_MENU_VIDEO, true, 'Registered');
     $link = 'index2.php?option=com_acajoom&act=about';
     backHTML::quickiconButton($link, 'credits.png', _ACA_MENU_ABOUT, false, 'Registered');
     echo '</div>';
 }
function com_install()
{
    global $database;
    global $_VERSION;
    require_once $GLOBALS['mosConfig_absolute_path'] . '/components/com_acajoom/defines.php';
    require_once WPATH_ADMIN . 'config.acajoom.php';
    require_once WPATH_ADMIN . 'admin.acajoom.html.php';
    require_once WPATH_CLASS . 'class.acajoom.php';
    $update = new wupdate();
    $xf = new xonfig();
    $return = '';
    if (!is_writable($GLOBALS['mosConfig_absolute_path'] . $acajoomConfigFile['upload_url'])) {
        @chmod($GLOBALS['mosConfig_absolute_path'] . $acajoomConfigFile['upload_url'], 0777);
    }
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../administrator/components/com_acajoom/images/acajoom_icon.png'\n\t  WHERE admin_menu_link='option=com_acajoom'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/edit.png',\n\t  name='" . compa::encodeutf(_ACA_MENU_LIST) . "',\n\t  admin_menu_alt='" . _ACA_MENU_LIST . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=list'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/users_add.png' ,\n\t  name='" . compa::encodeutf(_ACA_MENU_SUBSCRIBERS) . "',\n\t  admin_menu_alt='" . _ACA_MENU_SUBSCRIBERS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=subscribers'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/messaging_inbox.png' ,\n\t  name='" . compa::encodeutf(_ACA_MENU_NEWSLETTERS) . "',\n\t  admin_menu_alt='" . _ACA_MENU_NEWSLETTERS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=mailing&listype=1'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/messaging_config.png' ,\n\t  name='" . compa::encodeutf(_ACA_MENU_AUTOS) . "',\n\t  admin_menu_alt='" . _ACA_MENU_AUTOS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=mailing&listype=2'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/query.png' ,\n\t   name='" . compa::encodeutf(_ACA_MENU_STATS) . "',\n\t   admin_menu_alt='" . _ACA_MENU_STATS . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=statistics'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/menus.png' ,\n\t   name='" . compa::encodeutf(_ACA_MENU_CONF) . "',\n\t   admin_menu_alt='" . _ACA_MENU_CONF . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=configuration'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/restore.png' ,\n\t  name='" . compa::encodeutf(_ACA_MENU_UPDATE) . "',\n\t  admin_menu_alt='" . _ACA_MENU_UPDATE . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=update'";
    $query[] = "UPDATE #__components\n\t  SET admin_menu_img='../includes/js/ThemeOffice/credits.png' ,\n\t  name='" . compa::encodeutf(_ACA_MENU_ABOUT) . "',\n\t  admin_menu_alt='" . _ACA_MENU_ABOUT . "'\n\t  WHERE admin_menu_link='option=com_acajoom&act=about'";
    $q = " SELECT `text` FROM `#__acajoom_xonfig` WHERE `akey` = 'version' ";
    $database->setQuery($q);
    $vers = $database->loadResult();
    $err = $database->getErrorMsg();
    if (!empty($err)) {
        $q = " SELECT `text` FROM `#__acajoom_xonfig` WHERE `key` = 'version' ";
        $database->setQuery($q);
        $vers = $database->loadResult();
        if (!empty($vers) and $update->checkVersion($vers, '1.0.6')) {
            ### UPDATE database if before 1.0.7
            $query[] = "ALTER TABLE `#__acajoom_mailings` CHANGE `images` `images` TEXT NOT NULL ";
            $query[] = "ALTER TABLE `#__acajoom_lists` ADD `footer` TINYINT( 1 ) NOT NULL DEFAULT '1' ";
            $query[] = "ALTER TABLE `#__acajoom_lists` ADD `notify_id` INT( 10 ) NOT NULL DEFAULT '0' ";
            $query[] = "ALTER TABLE `#__acajoom_xonfig` DROP INDEX `key` ";
            $query[] = "ALTER TABLE `#__acajoom_xonfig` CHANGE `key` `akey` VARCHAR( 32 ) NOT NULL ";
            $query[] = "ALTER TABLE `#__acajoom_xonfig` CHANGE `value` `value` INT( 11 ) NOT NULL ";
            $query[] = "ALTER TABLE `#__acajoom_stats_global` DROP `listid`  ";
            $query[] = "ALTER TABLE `#__acajoom_stats_global` DROP INDEX `listid` ";
            $query[] = "ALTER TABLE `#__acajoom_stats_global` ADD PRIMARY KEY ( `mailing_id` ) ";
            $query[] = "ALTER TABLE `#__acajoom_stats_details` DROP `listid` ";
            $query[] = "ALTER TABLE `#__acajoom_stats_details` DROP INDEX `listid` ";
            $query[] = "ALTER TABLE `#__acajoom_stats_details` ADD PRIMARY KEY ( `mailing_id` , `subscriber_id` ) ";
            ### 1.0.9
            $query[] = " ALTER TABLE `#__acajoom_mailings` CHANGE `fromname` `fromname` VARCHAR( 64 ) NOT NULL  ";
            $query[] = " ALTER TABLE `#__acajoom_lists` CHANGE `sendername` `sendername` VARCHAR( 64 ) NOT NULL  ";
        }
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.0.8')) {
        $query[] = " ALTER TABLE `#__acajoom_mailings` CHANGE `fromname` `fromname` VARCHAR( 64 ) NOT NULL  ";
        $query[] = " ALTER TABLE `#__acajoom_lists` CHANGE `sendername` `sendername` VARCHAR( 64 ) NOT NULL  ";
        ### upgrade path for new versions
        $xf->insert('wait_for_user', '0', 0);
        $xf->insert('report_site', 'http://www.acajoom.com', 0);
        $xf->insert('use_sef', '0', 0);
        $xf->insert('send_error', '1', 0);
        $xf->insert('report_error', '1', 0);
        $xf->insert('wait_for_user', '0', 0);
        $xf->insert('show_archive', '1', 0);
        $xf->insert('update_notification', '1', 0);
        $xf->update('send_log_address', '@acajoom.com');
        $xf->update('update_url', 'http://www.acajoom.com/update/');
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.1.0')) {
        $query[] = "ALTER TABLE `#__acajoom_lists` ADD `notification` INT( 10 ) NOT NULL DEFAULT '0' ";
        $xf->update('listname1', '_ACA_NEWSLETTER');
        $xf->update('listnames1', '_ACA_MENU_NEWSLETTERS');
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.1.4')) {
        $xf->insert('last_sub_update', '', 0);
        $xf->insert('level', '1', 0);
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.3.0')) {
        $xf->insert('show_author', '0', 0);
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.5.5')) {
        $xf->insert('addEmailRedLink', '0', 0);
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.5.5')) {
        $query[] = " ALTER TABLE `#__acajoom_subscribers` ADD INDEX `subscribe_date` ( `subscribe_date` )   ";
        $query[] = " ALTER TABLE `#__acajoom_queue` CHANGE `subscriber_id` `subscriber_id` INT( 11 ) DEFAULT '0' NOT NULL  ";
    }
    if (empty($err) and !empty($vers) and $update->checkVersion($vers, '1.6.4')) {
        $xf->insert('show_jcalpro', '0', 0);
        $xf->insert('redirectconfirm', '', 0);
        $xf->insert('itemidAca', '99', 0);
    }
    $query2 = "SHOW COLUMNS FROM `#__acajoom_lists` ";
    $database->setQuery($query2);
    $columns = $database->loadResultArray();
    if (!in_array('cat_id', $columns)) {
        $query[] = "ALTER TABLE `#__acajoom_lists` CHANGE `choose_time` `cat_id` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0'";
    }
    if (!in_array('next_date', $columns)) {
        $query[] = "ALTER TABLE `#__acajoom_lists` ADD `next_date` INT( 11 ) NOT NULL AFTER `notify_id` ";
    }
    if (!in_array('start_date', $columns)) {
        $query[] = "ALTER TABLE `#__acajoom_lists` ADD `start_date` DATE NOT NULL AFTER `next_date`";
    }
    $query[] = 'UPDATE `#__acajoom_lists` SET `acc_level` = 24 WHERE `acc_level` = 0';
    foreach ($acajoomConfigFile as $key => $val) {
        if (!isset($GLOBALS[ACA . $key])) {
            $xf->insert($key, $val, 0);
        }
    }
    if (!empty($vers) and $update->checkVersion($vers, '1.2.2')) {
        $query[] = "UPDATE `#__acajoom_lists` SET `acc_id` = '29' WHERE `acc_id` = '25' ";
    }
    if (!defined('WADMIN')) {
        define('WADMIN', 'administrator' . DS . 'components' . DS . 'com_acajoom' . DS);
    }
    if (!defined('WFRONT')) {
        define('WFRONT', 'components' . DS . 'com_acajoom' . DS);
    }
    $file[] = 'templates';
    $file[] = 'templates/default';
    $file[] = 'templates/index.html';
    $file[] = 'templates/default/default.html';
    $file[] = 'templates/default/tpl0_abovefooter.jpg';
    $file[] = 'templates/default/tpl0_powered_by.gif';
    $file[] = 'templates/default/tpl0_spacer.gif';
    $file[] = 'templates/default/tpl0_top_header.jpg';
    $file[] = 'templates/default/tpl0_underban.jpg';
    $file[] = 'templates/default/index.html';
    foreach ($file as $key5 => $ins) {
        if (!file_exists($GLOBALS['mosConfig_absolute_path'] . DS . WFRONT . $ins) && file_exists($GLOBALS['mosConfig_absolute_path'] . DS . WADMIN . $ins)) {
            @rename($GLOBALS['mosConfig_absolute_path'] . DS . WADMIN . $ins, $GLOBALS['mosConfig_absolute_path'] . DS . WFRONT . $ins);
        }
    }
    $size = sizeof($query);
    for ($index = 0; $index < $size; $index++) {
        $database->setQuery($query[$index]);
        $database->query();
    }
    if (empty($vers)) {
        $xf->filetoDatabase($acajoomConfigFile);
    }
    $return .= setupMaiOptions($acajoomConfigFile);
    $return .= installBots();
    $return .= installModule();
    if (acajoom::checkCB()) {
        $return .= installPlugin();
    }
    subscribers::updateSubscribers(true, true);
    require_once WPATH_ADMIN . 'version.php';
    $xf->update('component', $localVersion['component']);
    $xf->update('type', $localVersion['type']);
    $xf->update('version', $localVersion['version']);
    $xf->update('level', $localVersion['level']);
    $message = acajoom::printM('noimage', _ACA_THANKYOU);
    backHTML::_header(_ACA_MENU_INSTALL, 'install.png', $message, '', '');
    if ($acajoomConfigFile['type'] == 'PRO') {
        backHTML::about();
    } elseif ($acajoomConfigFile['type'] == 'Plus') {
        backHTML::installPRO();
    } else {
        backHTML::installPlus();
    }
    $link = 'index2.php?option=com_acajoom&act=start';
    echo '<table style="width: 100%; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="0" cellspacing="0"><tbody><tr>' . '<td style=" width: 140px;">&nbsp;</td><td style="text-align: center; vertical-align: middle; width: 140px;"><div id="cpanel">';
    backHTML::quickiconButton($link, 'inbox.png', _ACA_GET_STARTED, false, 'admin');
    echo '</div><td></td></td></tr></tbody></table>' . '<div style="clear:both;"></div>';
    echo '<br/><br/><br/><br/>';
    echo compa::encodeutf($return);
    return $return;
}