Example #1
0
function setupMaiOptions($data)
{
    $xf = new jNews_Config();
    $return = '<br />' . _JNEWS_INSTALL_CONFIG . ' : ';
    $config = array();
    $exist = jnews::checkExisting();
    if ($exist['news1'] == 0) {
        $config['news1'] = '0';
    }
    if ($exist['news2'] == 0) {
        $config['news2'] = '0';
    }
    if ($exist['news3'] == 0) {
        $config['news3'] = '0';
    }
    $conf = JFactory::getConfig();
    $config['emailmethod'] = $conf->get('config.mailer');
    $config['sendmail_path'] = $conf->get('config.sendmail');
    $config['sendmail_from'] = $conf->get('config.mailfrom');
    $config['sendmail_email'] = $conf->get('config.mailfrom');
    $config['sendmail_name'] = $conf->get('config.fromname');
    $config['smtp_host'] = $conf->get('config.smtphost');
    $config['smtp_auth_required'] = $conf->get('config.smtpauth');
    $config['smtp_secure'] = $conf->get('config.smtpsecure');
    $config['smtp_username'] = $conf->get('config.smtpuser');
    $config['smtp_password'] = $conf->get('config.smtppass');
    $config['confirm_fromname'] = $conf->get('config.fromname');
    $config['confirm_fromemail'] = $conf->get('config.mailfrom');
    //		$config['confirm_return'] = $conf->get('config.mailfrom');
    $config['max_queue'] = $conf->get('max_queue');
    $config['max_attempts'] = $conf->get('max_attempts');
    $config['date_update'] = jnews::getNow();
    for ($index = 0; $index < $data['nblist']; $index++) {
        $xf->insert('listname' . $index, '', 0);
        $xf->insert('listnames' . $index, '', 0);
        $xf->insert('listype' . $index, '', 0);
        $xf->insert('listshow' . $index, '', 0);
        $xf->insert('classes' . $index, '', 0);
        $xf->insert('listlogo' . $index, '', 0);
        $xf->insert('totallist' . $index, '', 0);
        $xf->insert('act_totallist' . $index, '', 0);
        $xf->insert('totalmailing' . $index, '', 0);
        $xf->insert('totalmailingsent' . $index, '', 0);
        $xf->insert('act_totalmailing' . $index, '', 0);
        $xf->insert('totalsubcribers' . $index, '', 0);
        $xf->insert('act_totalsubcribers' . $index, '', 0);
    }
    //line to be changed code #73099111
    $activeList = '1';
    $config['classes1'] = 'jNews_Newsletter';
    $config['classes2'] = 'jNews_Autoresponder';
    $config['classes7'] = 'jNews_Autonews';
    $xf->insert('activelist', $activeList, 0, true);
    $config['listype0'] = '1';
    $config['listname0'] = '';
    $config['listnames0'] = _JNEWS_MAILING_ALL;
    $config['listshow0'] = '1';
    $config['listlogo0'] = 'subscribers.png';
    $config['classes0'] = '';
    $config['listype1'] = '1';
    $config['listname1'] = '_JNEWS_NEWSLETTER';
    $config['listnames1'] = '_JNEWS_MENU_NEWSLETTERS';
    $config['listshow1'] = '1';
    $config['listlogo1'] = 'newsletter.png';
    $nb = explode(',', $activeList);
    $size = sizeof($nb);
    for ($k = 0; $k < $size; $k++) {
        $index = $nb[$k];
        if (class_exists($config['classes' . $index])) {
            $classConfig = new $config['classes' . $index]();
            $config = array_merge($config, $classConfig->getActive());
        }
    }
    if ($xf->saveConfig($config)) {
        jnews::displayInfo(_JNEWS_INSTALL_SUCCESS, 'success');
    } else {
        jnews::displayInfo('Configuration file not updated', 'error');
    }
}
Example #2
0
 public static function _upgrade()
 {
     $config['news1'] = false;
     $config['news2'] = false;
     $config['news3'] = false;
     $exist = jnews::checkExisting();
     if (!empty($exist['news1'])) {
         $config['news1'] = true;
     }
     if (!empty($exist['news2'])) {
         $config['news2'] = true;
     }
     if (!empty($exist['news3'])) {
         $config['news3'] = true;
     }
     $mess = '';
     if ($config['news1'] or $config['news2'] or $config['news3']) {
         $mess = jnews::printM('blue', _JNEWS_UPGRADE_MESS) . '<br />';
     }
     if ($config['news1']) {
         $mess .= '<a href="index.php?option=' . JNEWS_OPTION . '&act=update&task=new1">';
         $mess .= jnews::printM('ok', _JNEWS_UPGRADE_FROM . 'Anjel');
         $mess .= '</a><br />';
     }
     if ($config['news2']) {
         $mess .= '<a href="index.php?option=' . JNEWS_OPTION . '&act=update&task=new2">';
         $mess .= jnews::printM('ok', _JNEWS_UPGRADE_FROM . 'Letterman');
         $mess .= '</a><br />';
     }
     if ($config['news3']) {
         $mess .= '<a href="index.php?option=' . JNEWS_OPTION . '&act=update&task=new3">';
         $mess .= jnews::printM('ok', _JNEWS_UPGRADE_FROM . 'YaNC');
         $mess .= '</a><br />';
     }
     echo $mess;
 }