Exemple #1
0
        $html = str_replace(array('{', '}'), array('{{', '}}'), $html);
        $newhtml = $html;
        do {
            $html = $newhtml;
            $newhtml = preg_replace('/({{literal}})(.*){{(.*)({{\\/literal}})/', '\\1\\2{\\3\\4', $html);
            $newhtml = preg_replace('/({{literal}})(.*)}}(.*)({{\\/literal}})/', '\\1\\2}\\3\\4', $newhtml);
        } while ($newhtml != $html);
        $html = str_replace(array('{{literal}}', '{{/literal}}'), '', $html);
        dbQuery('insert into online_store_vars set name="email_invoice"' . ', val="' . addslashes($html) . '"');
    }
    $email = dbOne('select value from page_vars where name="online_stores_admin_email"', 'value');
    if ($email) {
        dbQuery('insert into online_store_vars set name="email_invoice_recipient"' . ', val="' . addslashes($email) . '"');
    }
    require_once $_SERVER['DOCUMENT_ROOT'] . '/ww.incs/api-admin.php';
    Core_adminMenusAdd('Online Store>Emails', 'plugin.php?_plugin=online-store&_page=emails');
    $version = 15;
}
if ($version == 15) {
    // no longer using page_vars for export variables
    // { export_dir
    $val = dbOne('select value from page_vars where name="online_stores_exportdir"', 'value');
    dbQuery('insert into online_store_vars set name="export_dir"' . ', val="' . addslashes($val) . '"');
    // }
    // { export_customers
    $val = dbOne('select value from page_vars where name="online_stores_exportcustomers"', 'value');
    dbQuery('insert into online_store_vars set name="export_customers"' . ', val="' . addslashes($val) . '"');
    // }
    // { export_customers_filename
    $val = dbOne('select value from page_vars' . ' where name="online_stores_exportcustomers_filename"', 'value');
    dbQuery('insert into online_store_vars set name="export_customers_filename"' . ', val="' . addslashes($val) . '"');
Exemple #2
0
}
if ($version == 47) {
    // localised number formats
    $DBVARS['site_thousands_sep'] = ',';
    $DBVARS['site_dec_point'] = '.';
    $version = 48;
}
if ($version == 48) {
    // add user avatar
    dbQuery('alter table user_accounts add avatar text');
    $version = 49;
}
if ($version == 49) {
    // add emails admin area
    require_once $_SERVER['DOCUMENT_ROOT'] . '/ww.incs/api-admin.php';
    Core_adminMenusAdd('Site Options>Emails', 'javascript:Core_screen(\'CoreSiteoptions\', \'js:Emails\')');
    $version = 50;
}
if ($version == 50) {
    // change user_accounts phone into a contact field
    dbQuery('alter table user_accounts change phone contact text');
    $rs = dbAll('select id,contact from user_accounts');
    foreach ($rs as $r) {
        $c = array('phone' => $r['contact']);
        dbQuery('update user_accounts set contact="' . addslashes(json_encode($c)) . '"' . ' where id=' . $r['id']);
    }
    $version = 51;
}
if ($version == 51) {
    // add table for email templates
    dbQuery('CREATE TABLE `email_templates` (' . '`name` text, `body` text' . ') ENGINE=InnoDB DEFAULT CHARSET=utf8');
Exemple #3
0
            }
        }
        Core_cacheClear('admin');
    }
    redirect('/ww.admin/siteoptions.php?page=plugins&message=' . $msg . '&added=' . urlencode(join('|', $status['added'])));
}
if (isset($_REQUEST['added'])) {
    // adjust menus
    $added = explode('|', $_REQUEST['added']);
    foreach ($added as $plugin) {
        if (!isset($PLUGINS[$plugin]['admin']['menu'])) {
            continue;
        }
        $links = $PLUGINS[$plugin]['admin']['menu'];
        foreach ($links as $name => $link) {
            Core_adminMenusAdd($name, $link);
        }
    }
    Core_cacheClear('admin');
}
$message = @$_GET['message'];
if ($message == 'updated') {
    echo '<em>plugins updated</em>';
} elseif ($message == 'failed') {
    echo '<em>' . __('update failed') . '</em><p>' . __('failed to meet the plugin dependencies') . '</p>';
}
$installed = Core_adminPluginsGetInstalled();
$available = Core_adminPluginsGetAvailable();
// { start form
echo '
<form method="post" action="siteoptions.php?page=plugins">
Exemple #4
0
<?php

if ($version == 0) {
    dbQuery('CREATE TABLE `meetings` (' . '`id` int(11) NOT NULL auto_increment,' . '`form_id` int(11) default 0,' . '`user_id` int(11) default 0,' . '`customer_id` int(11) default 0,' . '`location` text,' . '`meeting_time` datetime default NULL,' . '`form_values` text,' . 'PRIMARY KEY  (`id`)' . ') ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8');
    dbQuery('alter table meetings add is_complete smallint default 0');
    $version = 1;
}
if ($version == 1) {
    // change menus for new forms page
    require_once $_SERVER['DOCUMENT_ROOT'] . '/ww.incs/api-admin.php';
    Core_adminMenusAdd('Meetings>Forms', 'plugin.php?_plugin=meetings&amp;_page=forms');
    $version = 2;
}
if ($version == 2) {
    dbQuery('alter table meetings change form_values form_values longtext;');
    $version = 3;
}