Пример #1
0
function sec_section_list($message = '')
{
    pagetop(gTxt('sections'), $message);
    global $wlink;
    $pageslist = safe_column("name", "txp_page", "1=1");
    $styleslist = safe_column("name", "txp_css", "1=1");
    $out[] = tr(tdcs(strong(gTxt('section_head')) . popHelp('section_category'), 3));
    $out[] = tr(tdcs(form(fInput('text', 'name', '', 'edit', '', '', 10) . fInput('submit', '', gTxt('Create'), 'smallerbox') . eInput('section') . sInput('section_create')), 3));
    $defrow = safe_row("page, css", "txp_section", "name like 'default'");
    $out[] = form(tr(td(gTxt('default')) . td(startTable('edit', 'left', '') . tr(fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pageslist, $defrow['page']) . popHelp('section_uses_page'), '', 'noline')) . tr(fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styleslist, $defrow['css']) . popHelp('section_uses_css'), '', 'noline')) . tr(tda(fInput('submit', '', gTxt('save_button'), 'smallerbox'), ' colspan="2" style="border:0"')) . endTable()) . td()) . eInput('section') . sInput('section_save') . hInput('name', 'default'));
    $rs = safe_rows_start("*", "txp_section", "name!='' order by name");
    if ($rs) {
        while ($a = nextRow($rs)) {
            extract($a);
            if ($name == 'default') {
                continue;
            }
            $deletelink = dLink('section', 'section_delete', 'name', $name, '', 'type', 'section');
            $form = startTable('edit') . stackRows(fLabelCell(gTxt('section_name') . ':') . fInputCell('name', $name, 1, 20), fLabelCell(gTxt('section_longtitle') . ':') . fInputCell('title', $title, 1, 20), fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pageslist, $page) . popHelp('section_uses_page'), '', 'noline'), fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styleslist, $css) . popHelp('section_uses_css'), '', 'noline'), fLabelCell(gTxt('selected_by_default') . '?') . td(yesnoradio('is_default', $is_default) . popHelp('section_is_default'), '', 'noline'), fLabelCell(gTxt('on_front_page') . '?') . td(yesnoradio('on_frontpage', $on_frontpage) . popHelp('section_on_frontpage'), '', 'noline'), fLabelCell(gTxt('syndicate') . '?') . td(yesnoradio('in_rss', $in_rss) . popHelp('section_syndicate'), '', 'noline'), fLabelCell(gTxt('include_in_search') . '?') . td(yesnoradio('searchable', $searchable) . popHelp('section_searchable'), '', 'noline'), tda(fInput('submit', '', gTxt('save_button'), 'smallerbox'), ' colspan="2" style="border:0"')) . endTable() . eInput('section') . sInput('section_save') . hInput('old_name', $name);
            $form = form($form);
            $out[] = tr(td($name) . td($form) . td($deletelink));
        }
    }
    echo startTable('list') . join('', $out) . endTable();
}
Пример #2
0
function css_edit_raw()
{
    global $event, $step;
    $default_name = safe_field('css', 'txp_section', "name = 'default'");
    extract(gpsa(array('name', 'newname', 'copy', 'savenew')));
    if ($step == 'css_delete' || empty($name) && $step != 'pour' && !$savenew) {
        $name = $default_name;
    } elseif (($copy || $savenew) && trim(preg_replace('/[<>&"\']/', '', $newname))) {
        $name = $newname;
    }
    if (empty($name)) {
        $buttons = '<div class="edit-title">' . gTxt('name_for_this_style') . ': ' . fInput('text', 'newname', '', 'edit', '', '', 20) . hInput('savenew', 'savenew') . '</div>';
        $thecss = gps('css');
    } else {
        $buttons = '<div class="edit-title">' . gTxt('you_are_editing_css') . sp . strong(htmlspecialchars($name)) . '</div>';
        $thecss = fetch("css", 'txp_css', 'name', $name);
    }
    if (!empty($name)) {
        $copy = '<span class="copy-as"><label for="copy-css">' . gTxt('copy_css_as') . '</label>' . sp . fInput('text', 'newname', '', 'edit', '', '', '', '', 'copy-css') . sp . fInput('submit', 'copy', gTxt('copy'), 'smallerbox') . '</span>';
    } else {
        $copy = '';
    }
    $right = '<div id="content_switcher">' . hed(gTxt('all_stylesheets'), 2) . graf(sLink('css', 'pour', gTxt('create_new_css')), ' class="action-create smallerbox"') . css_list($name, $default_name) . '</div>';
    echo '<div id="' . $event . '_container" class="txp-container txp-edit">' . startTable('edit') . tr(td(form('<div id="main_content">' . $buttons . '<textarea id="css" class="code" name="css" cols="78" rows="32">' . htmlspecialchars($thecss) . '</textarea>' . br . fInput('submit', '', gTxt('save'), 'publish') . eInput('css') . sInput('css_save') . hInput('name', $name) . $copy . '</div>', '', '', 'post', 'edit-form', '', 'style_form'), '', 'column') . tdtl($right, ' class="column"')) . endTable() . '</div>';
}
Пример #3
0
function plugin_edit_form($name = '')
{
    $sub = fInput('submit', '', gTxt('save'), 'publish');
    $code = $name ? fetch('code', 'txp_plugin', 'name', $name) : '';
    $thing = $code ? $code : '';
    $textarea = '<textarea id="plugin-code" class="code" name="code" rows="28" cols="90">' . htmlspecialchars($thing) . '</textarea>';
    return form(startTable('edit') . tr(td($textarea)) . tr(td($sub)) . endTable() . sInput('plugin_save') . eInput('plugin') . hInput('name', $name));
}
Пример #4
0
function plugin_edit_form($name = '')
{
    $sub = fInput('submit', '', gTxt('save'), 'publish');
    $code = $name ? fetch('code', 'txp_plugin', 'name', $name) : '';
    $thing = $code ? $code : '';
    $textarea = '<textarea id="plugin-code" class="code" name="code" rows="28" cols="90">' . htmlspecialchars($thing) . '</textarea>';
    return form(startTable('edit') . tr(td($textarea)) . tr(td($sub)) . endTable() . sInput('plugin_save') . eInput('plugin') . hInput('name', $name)) . n . '<script type="text/javascript">' . n . 'if(jQuery.browser.mozilla){$("#plugin-code").attr("spellcheck", false);}' . n . '</script>';
}
Пример #5
0
function doLoginForm($message)
{
    global $txpcfg;
    include $txpcfg['txpath'] . '/lib/txplib_head.php';
    pagetop('log in');
    echo form(startTable('edit') . tr(td() . td(graf($message))) . tr(fLabelCell('name') . fInputCell('p_userid')) . tr(fLabelCell('password') . td(fInput('password', 'p_password', '', 'edit'))) . tr(td() . td(graf(checkbox('stay', 1, 1) . gTxt('stay_logged_in') . popHelp('remember_login')))) . tr(fLabelCell('') . td(fInput('submit', '', gTxt('log_in_button'), 'publish'))) . endTable());
    exit("</div></body></html>");
}
Пример #6
0
function doLoginForm($message)
{
    global $txpcfg;
    include txpath . '/lib/txplib_head.php';
    pagetop(gTxt('login'));
    $stay = !(cs('txp_nostay') == 1);
    echo form(startTable('edit') . n . n . tr(n . td() . td(graf($message))) . n . n . tr(n . fLabelCell('name', '', 'name') . n . fInputCell('p_userid', '', 1, '', '', 'name')) . n . n . tr(n . fLabelCell('password', '', 'password') . n . td(fInput('password', 'p_password', '', 'edit', '', '', '', 2, 'password'))) . n . n . tr(n . td() . td(graf(checkbox('stay', 1, $stay, 3, 'stay') . '<label for="stay">' . gTxt('stay_logged_in') . '</label>' . sp . popHelp('remember_login')))) . n . n . tr(n . td() . td(fInput('submit', '', gTxt('log_in_button'), 'publish', '', '', '', 4))) . endTable() . (gps('event') ? eInput(gps('event')) : '')) . n . '</div>' . n . n . '</body>' . n . '</html>';
    exit(0);
}
Пример #7
0
function plugin_list($message = '')
{
    global $event;
    pagetop(gTxt('tab_plugins'), $message);
    echo '<h1 class="txp-heading">' . gTxt('tab_plugins') . '</h1>';
    echo '<div id="' . $event . '_control" class="txp-control-panel">';
    echo n . plugin_form() . n . '</div>';
    extract(gpsa(array('sort', 'dir')));
    if ($sort === '') {
        $sort = get_pref('plugin_sort_column', 'name');
    }
    if ($dir === '') {
        $dir = get_pref('plugin_sort_dir', 'asc');
    }
    $dir = $dir == 'desc' ? 'desc' : 'asc';
    if (!in_array($sort, array('name', 'status', 'author', 'version', 'modified', 'load_order'))) {
        $sort = 'name';
    }
    $sort_sql = $sort . ' ' . $dir;
    set_pref('plugin_sort_column', $sort, 'plugin', 2, '', 0, PREF_PRIVATE);
    set_pref('plugin_sort_dir', $dir, 'plugin', 2, '', 0, PREF_PRIVATE);
    $switch_dir = $dir == 'desc' ? 'asc' : 'desc';
    $rs = safe_rows_start('name, status, author, author_uri, version, description, length(help) as help, abs(strcmp(md5(code),code_md5)) as modified, load_order, flags', 'txp_plugin', '1 order by ' . $sort_sql);
    if ($rs and numRows($rs) > 0) {
        echo n . '<div id="' . $event . '_container" class="txp-container">';
        echo '<form action="index.php" id="plugin_form" class="multi_edit_form" method="post" name="longform">' . n . '<div class="txp-listtables">' . n . startTable('', '', 'txp-list') . n . '<thead>' . tr(n . hCell(fInput('checkbox', 'select_all', 0, '', '', '', '', '', 'select_all'), '', ' title="' . gTxt('toggle_all_selected') . '" class="multi-edit"') . n . column_head('plugin', 'name', 'plugin', true, $switch_dir, '', '', ('name' == $sort ? "{$dir} " : '') . 'name') . n . column_head('author', 'author', 'plugin', true, $switch_dir, '', '', ('author' == $sort ? "{$dir} " : '') . 'author') . n . column_head('version', 'version', 'plugin', true, $switch_dir, '', '', ('version' == $sort ? "{$dir} " : '') . 'version') . n . column_head('plugin_modified', 'modified', 'plugin', true, $switch_dir, '', '', ('modified' == $sort ? "{$dir} " : '') . 'modified') . n . hCell(gTxt('description'), '', ' class="description"') . n . column_head('active', 'status', 'plugin', true, $switch_dir, '', '', ('status' == $sort ? "{$dir} " : '') . 'status') . n . column_head('order', 'load_order', 'plugin', true, $switch_dir, '', '', ('load_order' == $sort ? "{$dir} " : '') . 'load-order') . n . hCell(gTxt('manage'), '', ' class="manage actions"')) . n . '</thead>';
        echo '<tbody>';
        while ($a = nextRow($rs)) {
            foreach ($a as $key => $value) {
                ${$key} = txpspecialchars($value);
            }
            // Fix up the description for clean cases
            $description = preg_replace(array('#&lt;br /&gt;#', '#&lt;(/?(a|b|i|em|strong))&gt;#', '#&lt;a href=&quot;(https?|\\.|\\/|ftp)([A-Za-z0-9:/?.=_]+?)&quot;&gt;#'), array('<br />', '<$1>', '<a href="$1$2">'), $description);
            $help = !empty($help) ? '<a class="plugin-help" href="?event=plugin' . a . 'step=plugin_help' . a . 'name=' . urlencode($name) . '">' . gTxt('help') . '</a>' : '';
            $plugin_prefs = $flags & PLUGIN_HAS_PREFS ? '<a class="plugin-prefs" href="?event=plugin_prefs.' . urlencode($name) . '">' . gTxt('plugin_prefs') . '</a>' : '';
            $manage = array();
            if ($help) {
                $manage[] = $help;
            }
            if ($plugin_prefs) {
                $manage[] = $plugin_prefs;
            }
            $manage_items = $manage ? join(tag(sp . '&#124;' . sp, 'span'), $manage) : '-';
            $edit_url = eLink('plugin', 'plugin_edit', 'name', $name, $name);
            echo tr(n . td(fInput('checkbox', 'selected[]', $name), '', 'multi-edit') . td($edit_url, '', 'name') . td(href($author, $author_uri, ' rel="external"'), '', 'author') . td($version, '', 'version') . td($modified ? '<span class="warning">' . gTxt('yes') . '</span>' : '', '', 'modified') . td($description, '', 'description') . td(status_link($status, $name, yes_no($status)), '', 'status') . td($load_order, '', 'load-order') . td($manage_items, '', 'manage'), $status ? ' class="active"' : '');
            unset($name, $page, $deletelink);
        }
        echo '</tbody>', n, endTable(), n, '</div>', n, plugin_multiedit_form('', $sort, $dir, '', ''), n, tInput(), n, '</form>', n, '</div>';
        // Show/hide "Options" link by setting the appropriate class on the plugins TR
        echo script_js(<<<EOS
textpattern.Relay.register('txpAsyncHref.success', function(event, data) {
\t\$(data['this']).closest('tr').toggleClass('active');
});
EOS
);
    }
}
Пример #8
0
function plugin_edit_form($name = '')
{
    $sub = fInput('submit', '', gTxt('save'), 'publish');
    $code = $name ? fetch('code', 'txp_plugin', 'name', $name) : '';
    $help = $name ? fetch('help', 'txp_plugin', 'name', $name) : '';
    $thing = $code ? $code : '';
    $textarea = '<textarea name="code" rows="30" cols="90">' . $thing . '</textarea>';
    return form(startTable('edit') . tr(td($textarea)) . tr(td($sub)) . tr(td($help)) . endTable() . sInput('plugin_save') . eInput('plugin') . hInput('name', $name));
}
Пример #9
0
function page_list($current)
{
    $rs = safe_rows_start("name", "txp_page", "name != '' order by name");
    while ($a = nextRow($rs)) {
        extract($a);
        $dlink = $name != 'default' ? dLink('page', 'page_delete', 'name', $name) : '';
        $link = '<a href="?event=page' . a . 'name=' . $name . '">' . $name . '</a>';
        $out[] = $current == $name ? tr(td($name) . td($dlink)) : tr(td($link) . td($dlink));
    }
    return startTable('list') . join(n, $out) . endTable();
}
Пример #10
0
function doLoginForm($message)
{
    global $txpcfg;
    include txpath . '/lib/txplib_head.php';
    pagetop(gTxt('login'));
    $stay = (cs('txp_login') and !gps('logout') ? 1 : 0);
    $reset = gps('reset');
    list($name) = split(',', cs('txp_login'));
    echo form(startTable('edit') . n . n . tr(n . td() . td(graf($message))) . n . n . tr(n . fLabelCell('name', '', 'name') . n . fInputCell('p_userid', $name, 1, '', '', 'name')) . ($reset ? '' : n . n . tr(n . fLabelCell('password', '', 'password') . n . td(fInput('password', 'p_password', '', 'edit', '', '', '', 2, 'password')))) . ($reset ? '' : n . n . tr(n . td() . td(graf(checkbox('stay', 1, $stay, 3, 'stay') . '<label for="stay">' . gTxt('stay_logged_in') . '</label>' . sp . popHelp('remember_login'))))) . n . n . tr(n . td() . td(($reset ? hInput('p_reset', 1) : '') . fInput('submit', '', gTxt($reset ? 'password_reset_button' : 'log_in_button'), 'publish', '', '', '', 4) . ($reset ? '' : graf('<a href="?reset=1">' . gTxt('password_forgotten') . '</a>')))) . endTable() . (gps('event') ? eInput(gps('event')) : '')) . n . '</body>' . n . '</html>';
    exit(0);
}
Пример #11
0
function page_list($current)
{
    $protected = safe_column('DISTINCT page', 'txp_section', '1=1') + array('error_default');
    $rs = safe_rows_start('name', 'txp_page', "1 order by name asc");
    while ($a = nextRow($rs)) {
        extract($a);
        $link = eLink('page', '', 'name', $name, $name);
        $dlink = !in_array($name, $protected) ? dLink('page', 'page_delete', 'name', $name) : '';
        $out[] = $current == $name ? tr(td($name) . td($dlink)) : tr(td($link) . td($dlink));
    }
    return startTable('list') . join(n, $out) . endTable();
}
Пример #12
0
function image_edit($message = '', $id = '')
{
    if (!$id) {
        $id = gps('id');
    }
    global $path_from_root, $txpcfg, $img_dir;
    pagetop('image', $message);
    $categories = getTree("root", "image");
    $rs = safe_row("*", "txp_image", "id='{$id}'");
    if ($rs) {
        extract($rs);
        echo startTable('list'), tr(td('<img src="' . $path_from_root . $img_dir . '/' . $id . $ext . '" height="' . $h . '" width="' . $w . '" alt="" />' . br . upload_form(gTxt('replace_image'), 'replace_image_form', 'image_replace', $id))), tr(td(join('', array($thumbnail ? '<img src="' . $path_from_root . $img_dir . '/' . $id . 't' . $ext . '" alt="" />' . br : '', upload_form(gTxt('upload_thumbnail'), 'upload_thumbnail', 'thumbnail_insert', $id))))), tr(td(form(graf(gTxt('image_name') . br . fInput('text', 'name', $name)) . graf(gTxt('image_category') . br . treeSelectInput('category', $categories, $category)) . graf(gTxt('alt_text') . br . fInput('text', 'alt', $alt, '', '', '', 50)) . graf(gTxt('caption') . br . text_area('caption', '100', '400', $caption)) . graf(fInput('submit', '', gTxt('save'))) . hInput('id', $id) . eInput('image') . sInput('image_save')))), endTable();
    }
}
Пример #13
0
function cat_category_list($message = "")
{
    pagetop(gTxt('categories'), $message);
    $out = array('<h1 class="txp-heading">' . gTxt('tab_organise') . '</h1>', '<div id="category_container" class="txp-container">', '<table class="category-list">', '<tr>', tdtl('<div id="categories_article">' . cat_article_list() . '</div>', ' class="categories article"'), tdtl('<div id="categories_link">' . cat_link_list() . '</div>', ' class="categories link"'), tdtl('<div id="categories_image">' . cat_image_list() . '</div>', ' class="categories image"'), tdtl('<div id="categories_file">' . cat_file_list() . '</div>', ' class="categories file"'), '</tr>', endTable(), '</div>', script_js(<<<EOS
\t\t\t\$(document).ready(function() {
\t\t\t\t\$('.category-tree').txpMultiEditForm({
\t\t\t\t\t'row' : 'p',
\t\t\t\t\t'highlighted' : 'p'
\t\t\t\t});
\t\t\t});
EOS
));
    echo join(n, $out);
}
Пример #14
0
function showAddNew($lang)
{
    iniTable();
    $langFile = "lang." . $lang . ".php";
    echo "<h1>{$langFile}</h1>";
    echo "Your new languange file will be created from the english template! <br>";
    echo "<form action='" . $_SERVER['PHP_SELF'] . "'  method='post'>";
    echo "<input type='hidden' name='strSource' value='lang.en.php' />";
    echo "<input type='hidden' name='strDest' value='{$langFile}' /><br>";
    echo "<input type='text' size='4' name='strCode' value='Code' onkeyup='return upBtn(this);'>";
    echo "<input type='submit' id='Save' disabled='true' value='Create File' />";
    echo "</form>";
    endTable();
}
Пример #15
0
function element_list($event, $step)
{
    $message = '';
    pagetop(gTxt('element'), $message);
    echo startTable('list') . assHead('element', 'version', 'date', 'active', 'checksum');
    $rs = safe_rows('*', 'txp_element', '1=1');
    foreach ($rs as $row) {
        extract($row);
        if ($hash) {
            $checksum = md5_file(txpath . '/elements/' . $name . '.php') == $hash ? gTxt('ok') : gTxt('modified');
        } else {
            $checksum = gTxt('unknown');
        }
        echo tr(td($name) . td($version) . td($modified) . td($status ? gTxt('yes') : gTxt('no')) . td($checksum));
    }
    echo endTable();
}
Пример #16
0
function sec_section_list($message = '')
{
    global $wlink;
    pagetop(gTxt('sections'), $message);
    $default = safe_row('page, css', 'txp_section', "name = 'default'");
    $pages = safe_column('name', 'txp_page', "1 = 1");
    $styles = safe_column('name', 'txp_css', "1 = 1");
    echo n . n . startTable('list') . n . n . tr(tda(n . n . hed(gTxt('section_head') . sp . popHelp('section_category'), 1) . n . n . form(fInput('text', 'name', '', 'edit', '', '', 10) . fInput('submit', '', gTxt('create'), 'smallerbox') . eInput('section') . sInput('section_create')), ' colspan="3"')) . n . n . tr(td(gTxt('default')) . td(form('<table>' . tr(fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pages, $default['page']) . sp . popHelp('section_uses_page'), '', 'noline')) . tr(fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styles, $default['css']) . sp . popHelp('section_uses_css'), '', 'noline')) . tr(tda(fInput('submit', '', gTxt('save_button'), 'smallerbox') . eInput('section') . sInput('section_save') . hInput('name', 'default'), ' colspan="2" class="noline"')) . endTable())) . td());
    $rs = safe_rows_start('*', 'txp_section', "name != 'default' order by name");
    if ($rs) {
        while ($a = nextRow($rs)) {
            extract($a);
            echo n . n . tr(n . td($name) . n . td(form('<table>' . n . n . tr(fLabelCell(gTxt('section_name') . ':') . fInputCell('name', $name, 1, 20)) . n . n . tr(fLabelCell(gTxt('section_longtitle') . ':') . fInputCell('title', $title, 1, 20)) . n . n . tr(fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pages, $page) . sp . popHelp('section_uses_page'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styles, $css) . sp . popHelp('section_uses_css'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('selected_by_default')) . td(yesnoradio('is_default', $is_default, '', $name) . sp . popHelp('section_is_default'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('on_front_page')) . td(yesnoradio('on_frontpage', $on_frontpage, '', $name) . sp . popHelp('section_on_frontpage'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('syndicate')) . td(yesnoradio('in_rss', $in_rss, '', $name) . sp . popHelp('section_syndicate'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('include_in_search')) . td(yesnoradio('searchable', $searchable, '', $name) . sp . popHelp('section_searchable'), '', 'noline')) . n . n . tr(tda(fInput('submit', '', gTxt('save_button'), 'smallerbox') . eInput('section') . sInput('section_save') . hInput('old_name', $name), ' colspan="2" class="noline"')) . endTable(), '', '', 'post', '', 'section-' . $name)) . td(dLink('section', 'section_delete', 'name', $name, '', 'type', 'section')), " id=\"section-{$name}\"");
        }
    }
    echo n . n . endTable();
}
Пример #17
0
function sec_section_list($message = '')
{
    global $wlink;
    pagetop(gTxt('sections'), $message);
    $default = safe_row('page, css', 'txp_section', "name = 'default'");
    $home = safe_row('page, css', 'txp_section', "name = 'home'");
    $pages = safe_column('name', 'txp_page', "1 = 1");
    $styles = safe_column('name', 'txp_css', "1 = 1");
    echo n . n . startTable('list') . n . n . tr(tda(n . n . hed(gTxt('section_head') . sp . popHelp('section_category'), 1) . n . n . form(fInput('text', 'name', '', 'edit', '', '', 10) . fInput('submit', '', gTxt('create'), 'smallerbox') . eInput('section') . sInput('section_create')), ' colspan="3"')) . n . n . tr(tda(gTxt('home'), ' onclick="toggleDisplay(\'section_home\'); return false;"') . td(form('<table id="section_home">' . tr(fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pages, $home['page']) . sp . popHelp('section_uses_page'), '', 'noline')) . tr(fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styles, $home['css']) . sp . popHelp('section_uses_css'), '', 'noline')) . pluggable_ui('section_ui', 'extend_detail_form', '', $home) . tr(tda(fInput('submit', '', gTxt('save_button'), 'smallerbox') . eInput('section') . sInput('section_save') . hInput('name', 'home'), ' colspan="2" class="noline"')) . endTable())) . td()) . n . n . tr(tda(gTxt('default'), ' onclick="toggleDisplay(\'section_default\'); return false;"') . td(form('<table id="section_default">' . tr(fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pages, $default['page']) . sp . popHelp('section_uses_page'), '', 'noline')) . tr(fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styles, $default['css']) . sp . popHelp('section_uses_css'), '', 'noline')) . pluggable_ui('section_ui', 'extend_detail_form', '', $default) . tr(tda(fInput('submit', '', gTxt('save_button'), 'smallerbox') . eInput('section') . sInput('section_save') . hInput('name', 'default'), ' colspan="2" class="noline"')) . endTable())) . td());
    $rs = safe_rows_start('*', 'txp_section', "name != 'default' AND name != 'home' order by name");
    if ($rs) {
        while ($a = nextRow($rs)) {
            extract($a);
            echo n . n . tr(n . tda($name, ' onclick="toggleDisplay(\'section_' . $name . '\'); return false;"') . n . td(form('<table id="section_' . $name . '">' . n . n . tr(fLabelCell(gTxt('section_name') . ':') . fInputCell('name', $name, 1, 20)) . n . n . tr(fLabelCell(gTxt('section_longtitle') . ':') . fInputCell('title', $title, 1, 20)) . n . n . tr(fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pages, $page) . sp . popHelp('section_uses_page'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styles, $css) . sp . popHelp('section_uses_css'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('selected_by_default')) . td(yesnoradio('is_default', $is_default, '', $name) . sp . popHelp('section_is_default'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('on_front_page')) . td(yesnoradio('on_frontpage', $on_frontpage, '', $name) . sp . popHelp('section_on_frontpage'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('syndicate')) . td(yesnoradio('in_rss', $in_rss, '', $name) . sp . popHelp('section_syndicate'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('include_in_search')) . td(yesnoradio('searchable', $searchable, '', $name) . sp . popHelp('section_searchable'), '', 'noline')) . n . n . tr(fLabelCell(gTxt('section_descr') . ':') . fTextCell('descr', $descr, 1, 4, 20)) . n . n . tr(fLabelCell(gTxt('section_metakey') . ':') . fInputCell('metakey', $metakey, 1, 20)) . n . n . tr(fLabelCell(gTxt('section_metadesc') . ':') . fTextCell('metadesc', $metadesc, 1, 4, 20)) . pluggable_ui('section_ui', 'extend_detail_form', '', $a) . n . n . tr(tda(fInput('submit', '', gTxt('save_button'), 'smallerbox') . eInput('section') . sInput('section_save') . hInput('old_name', $name), ' colspan="2" class="noline"')) . endTable(), '', '', 'post', '', 'section-' . $name)) . td(dLink('section', 'section_delete', 'name', $name, '', 'type', 'section')), " id=\"section-{$name}\" class=\"jsection\" ");
        }
    }
    echo n . n . endTable();
}
Пример #18
0
 static function listbyaccount($AccountID, $pagenum = 1)
 {
     global $DB, $LANG;
     $page_posts = 25;
     $spos = ($pagenum - 1) * $page_posts;
     $result = $DB->query_adv("SELECT SQL_CALC_FOUND_ROWS * FROM `History` LEFT JOIN `Users` USING (`UserID`) WHERE `AccountID`={$AccountID} ORDER BY `HistoryID` DESC LIMIT {$spos},{$page_posts}");
     $FOUND_ROWS = $DB->row($DB->query_adv('SELECT FOUND_ROWS()'));
     $count = $FOUND_ROWS['FOUND_ROWS()'];
     $show = beginTable($LANG['History'] . ' ' . $count . ' записей');
     $show .= makeTH($LANG['Actions'], $LANG['Description'], $LANG['User'], 'Время', 'IP');
     while ($row = $DB->row($result)) {
         $show .= makeTD($row['action'], '<pre>' . $row['text'] . '</pre>', empty($row['username']) ? '---' : $row['username'], $row['time'], $row['ip']);
     }
     $show .= '<tr><td colspan="3" class="nob">';
     $show .= makePageNav($pagenum, $page_posts, $count, iSELF . '?object=account&amp;action=history&amp;AccountID=' . $AccountID . '&amp;');
     $show .= '</td></tr>';
     $show .= endTable();
     return $show;
 }
Пример #19
0
function log_list()
{
    pagetop(gTxt('visitor_logs'));
    extract(get_prefs());
    safe_delete("txp_log", "`time` < date_sub(now(),interval " . $expire_logs_after . " day)");
    safe_optimize("txp_log");
    safe_repair("txp_log");
    $page = gps('page');
    $total = getCount('txp_log', "1");
    $limit = 50;
    $numPages = ceil($total / $limit);
    $page = !$page ? 1 : $page;
    $offset = ($page - 1) * $limit;
    $nav[] = $page > 1 ? PrevNextLink("log", $page - 1, gTxt('prev'), 'prev') : '';
    $nav[] = sp . small($page . '/' . $numPages) . sp;
    $nav[] = $page != $numPages ? PrevNextLink("log", $page + 1, gTxt('next'), 'next') : '';
    $rs = safe_rows_start("*, unix_timestamp(time) as stamp", "txp_log", "1 order by time desc limit {$offset},{$limit}");
    if ($rs) {
        echo startTable('list'), assHead('time', 'host', 'page', 'referrer');
        $stamp = '';
        while ($a = nextRow($rs)) {
            extract($a);
            if ($refer) {
                $referprint = preg_replace("/^www\\./", "", chunk(htmlspecialchars($refer), 50));
                $referprint = '<a href="http://' . htmlspecialchars($refer) . '">' . $referprint . '</a>';
            } else {
                $referprint = '&#160;';
            }
            $pageprint = preg_replace('/\\/$/', '', htmlspecialchars(substr($page, 1)));
            $pageprint = $pageprint == '' ? '' : '<a href="' . htmlspecialchars($page) . '" target="_blank">' . chunk($pageprint, 50) . '</a>';
            if ($method == 'POST') {
                $pageprint = '<b>' . $pageprint . '</b>';
            }
            $fstamp = date("n/j g:i a", $stamp + tz_offset());
            $hostprint = chunk($host, 40);
            echo tr(td($fstamp) . td($hostprint) . td($pageprint) . td($referprint));
            unset($refer, $referprint, $page, $pageprint);
        }
        echo '<tr><td colspan="4" align="right" style="padding:10px">', join('', $nav), "</td></tr>", endTable();
    } else {
        echo graf(gTxt('no_refers_recorded'), ' align="center"');
    }
}
Пример #20
0
function sec_section_list($message = '')
{
    global $wlink, $event;
    pagetop(gTxt('sections'), $message);
    $default = safe_row('page, css', 'txp_section', "name = 'default'");
    $pages = safe_column('name', 'txp_page', "1 = 1");
    $styles = safe_column('name', 'txp_css', "1 = 1");
    echo n . '<div id="' . $event . '_container" class="txp-container txp-list">';
    echo n . n . startTable('list') . n . n . tr(tda(n . n . hed(gTxt('section_head') . sp . popHelp('section_category'), 2) . n . '<div id="' . $event . '_control" class="txp-control-panel">' . n . n . form(fInput('text', 'name', '', 'edit', '', '', 10) . fInput('submit', '', gTxt('create'), 'smallerbox') . eInput('section') . sInput('section_create'), '', '', 'post', 'edit-form', '', 'section_create') . n . '</div>', ' colspan="3"')) . n . n . tr(td(gTxt('default'), '', 'label') . td(form('<table>' . tr(fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pages, $default['page']) . sp . popHelp('section_uses_page'), '', 'noline'), ' class="uses-page"') . tr(fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styles, $default['css']) . sp . popHelp('section_uses_css'), '', 'noline'), ' class="uses-style"') . pluggable_ui('section_ui', 'extend_detail_form', '', $default) . tr(tda(fInput('submit', '', gTxt('save_button'), 'smallerbox') . eInput('section') . sInput('section_save') . hInput('name', 'default'), ' colspan="2" class="noline"')) . endTable())) . td(), ' class="section default"');
    $rs = safe_rows_start('*', 'txp_section', "name != 'default' order by name");
    if ($rs) {
        $ctr = 1;
        while ($a = nextRow($rs)) {
            extract($a);
            echo n . n . tr(n . td($name, '', 'label') . n . td(form('<table>' . n . n . tr(fLabelCell(gTxt('section_name') . ':') . fInputCell('name', $name, 1, 20), ' class="name"') . n . n . tr(fLabelCell(gTxt('section_longtitle') . ':') . fInputCell('title', $title, 1, 20), ' class="title"') . n . n . tr(fLabelCell(gTxt('uses_page') . ':') . td(selectInput('page', $pages, $page) . sp . popHelp('section_uses_page'), '', 'noline'), ' class="uses-page"') . n . n . tr(fLabelCell(gTxt('uses_style') . ':') . td(selectInput('css', $styles, $css) . sp . popHelp('section_uses_css'), '', 'noline'), ' class="uses-style"') . n . n . tr(fLabelCell(gTxt('selected_by_default')) . td(yesnoradio('is_default', $is_default, '', $name) . sp . popHelp('section_is_default'), '', 'noline'), ' class="option is-default"') . n . n . tr(fLabelCell(gTxt('on_front_page')) . td(yesnoradio('on_frontpage', $on_frontpage, '', $name) . sp . popHelp('section_on_frontpage'), '', 'noline'), ' class="option on-frontpage"') . n . n . tr(fLabelCell(gTxt('syndicate')) . td(yesnoradio('in_rss', $in_rss, '', $name) . sp . popHelp('section_syndicate'), '', 'noline'), ' class="option in-rss"') . n . n . tr(fLabelCell(gTxt('include_in_search')) . td(yesnoradio('searchable', $searchable, '', $name) . sp . popHelp('section_searchable'), '', 'noline'), ' class="option is-searchable"') . pluggable_ui('section_ui', 'extend_detail_form', '', $a) . n . n . tr(tda(fInput('submit', '', gTxt('save_button'), 'smallerbox') . eInput('section') . sInput('section_save') . hInput('old_name', $name), ' colspan="2" class="noline"')) . endTable(), '', '', 'post', '', 'section-' . $name), '', 'main') . td(dLink('section', 'section_delete', 'name', $name, '', 'type', 'section'), '', 'actions'), ' id="section-' . $name . '" class="section ' . ($ctr % 2 == 0 ? 'even' : 'odd') . '"');
            $ctr++;
        }
    }
    echo n . n . endTable() . '</div>';
}
Пример #21
0
function form_edit($message = '')
{
    global $step;
    pagetop(gTxt('edit_forms'), $message);
    extract(gpsa(array('Form', 'name', 'type')));
    if ($step == 'form_create') {
        $Form = '';
        $name = '';
        $type = '';
        $inputs = fInput('submit', 'savenew', gTxt('save_new'), 'publish') . eInput("form") . sInput('form_save');
    } else {
        $name = (!$name or $step == 'form_delete') ? 'default' : $name;
        $rs = safe_row("*", "txp_form", "name='{$name}'");
        if ($rs) {
            extract($rs);
            $inputs = fInput('submit', 'save', gTxt('save'), 'publish') . eInput("form") . sInput('form_save') . hInput('oldname', $name);
        }
    }
    $out = startTable('edit') . tr(tdtl(hed(gTxt('useful_tags'), 2) . graf(gTxt('articles') . sp . popHelp('form_place_article') . br . popTagLinks('article')) . graf(gTxt('links') . sp . popHelp('form_place_link') . br . popTagLinks('link')) . graf(gTxt('displayed_comments') . sp . popHelp('form_place_comment') . br . popTagLinks('comment')) . graf(gTxt('comment_form') . sp . popHelp('form_place_input') . br . popTagLinks('comment_form')) . graf(gTxt('search_input_form') . sp . popHelp('form_place_search_input') . br . popTagLinks('search_input')) . graf(gTxt('search_results_form') . sp . popHelp('form_place_search_results') . br . popTagLinks('search_result')) . graf(tag('<strong>' . gTxt('file_download_tags') . '</strong>', 'a', ' href="#" onclick="toggleDisplay(\'downloadtags\');"') . sp . popHelp('form_file_download_tags')) . graf(popTagLinks('file_download'), ' style="display:none;" id="downloadtags"')) . tdtl('<form action="index.php" method="post">' . input_textarea($Form) . graf(gTxt('form_name') . br . fInput('text', 'name', $name, 'edit', '', '', 15)) . graf(gTxt('form_type') . br . formtypes($type)) . graf(gTxt('only_articles_can_be_previewed')) . fInput('submit', 'preview', gTxt('preview'), 'smallbox') . graf($inputs) . '</form>') . tdtl(form_list($name))) . endTable();
    echo $out;
}
Пример #22
0
function link_edit($message = "")
{
    global $vars, $step;
    extract(gpsa($vars));
    pagetop(gTxt('edit_links', $message));
    $id = gps('id');
    if ($id && $step == 'link_edit') {
        extract(safe_row("*", "txp_link", "id = {$id}"));
    }
    if ($step == 'link_save' or $step == 'link_post') {
        foreach ($vars as $var) {
            ${$var} = '';
        }
    }
    $textarea = '<textarea name="description" cols="40" rows="7" tabindex="4">' . $description . '</textarea>';
    $selects = linkcategory_popup($category);
    $editlink = ' [' . eLink('category', 'list', '', '', gTxt('edit')) . ']';
    $out = startTable('edit') . tr(fLabelCell('title') . fInputCell('linkname', $linkname, 1, 30)) . tr(fLabelCell('sort_value') . fInputCell('linksort', $linksort, 2, 15)) . tr(fLabelCell('url', 'link_url') . fInputCell('url', $url, 3, 30)) . tr(fLabelCell('link_category', 'link_category') . td($selects . $editlink)) . tr(fLabelCell('description', 'link_description') . tda($textarea, ' valign="top"')) . tr(td() . td(fInput("submit", '', gTxt('save'), "publish"))) . endTable() . eInput('link') . sInput($step == 'link_edit' ? 'link_save' : 'link_post') . hInput('id', $id);
    echo form($out);
    echo link_list();
}
Пример #23
0
function tc_shopping_cart_detail($atts)
{
    session_start();
    extract(lAtts(array('checkout_section' => 'checkout'), $atts));
    $cart = $_SESSION['cart'];
    if (empty($cart)) {
        $cart = new bckCart();
    }
    if (isset($_REQUEST['empty_cart'])) {
        $cart->empty_cart();
        $_SESSION['cart'] = $cart;
    }
    $cartHTML = startTable("shopping_cart") . tr(n . hCell("Item") . n . hCell("Quantity") . n . hCell("Price") . n . hCell("Subtotal"));
    foreach ($cart->items as $product) {
        $image = '<img src="' . product_image_display($product['image'], "small") . '" alt="Product Detail" class="thumb"/>';
        $link = "<a href='" . permlinkurl_id($product['ID']) . "' title='View product detail'>" . $product['name'] . "</a>";
        $cartHTML .= tr(n . td($image . $link) . n . td($product['qty']) . n . td(_tc_price_format($product['price'])) . n . td(_tc_price_format($product['price'])));
    }
    $cartHTML .= endTable();
    $cartHTML .= tag(tag(tag("Empty Cart", "a", " href='?empty_cart=true' class='cartAction' id='emptyCart'"), "li") . tag(tag("Continue Shopping", "a", " href='#' class='cartAction' id='continueShopping'"), "li") . tag(tag("Checkout", "a", " href='/{$checkout_section}/' class='cartAction' id='checkout'"), "li") . tag(tag(_tc_price_format($cart->total), "span", " class='cartTotal'"), "li"), "ul");
    return $cartHTML;
}
function rss_admin_editlink($event, $step)
{
    global $rss_ae_cookie;
    include txpath . '/include/txp_prefs.php';
    if (!isset($rss_ae_cookie)) {
        $rss_ae_cookie = "rss_article_edit";
        $rs = safe_insert('txp_prefs', "name='rss_ae_cookie', val='{$rss_ae_cookie}', prefs_id='1'");
    }
    if (gps("add")) {
        safe_update("txp_prefs", "val = '" . addslashes(ps('rss_ae_cookie')) . "'", "name = 'rss_ae_cookie' and prefs_id ='1'");
        setcookie($rss_ae_cookie, $rss_ae_cookie, time() + 31536000, "/");
        header("Location: index.php?event=editlink");
    } else {
        if (gps("rem")) {
            safe_update("txp_prefs", "val = '" . addslashes(ps('rss_ae_cookie')) . "'", "name = 'rss_ae_cookie' and prefs_id ='1'");
            setcookie($rss_ae_cookie, $rss_ae_cookie, time() - 3600, "/");
            header("Location: index.php?event=editlink");
        }
    }
    pagetop("Edit Link");
    $aeset = isset($_COOKIE[$rss_ae_cookie]) ? "" : " not";
    $tdaStyle = ' style="text-align:right;vertical-align:middle"';
    echo form(startTable("list") . tr(tdcs(hed("Add/Remove Public Site Article Edit Link", 1), 2)) . tr(tda(graf('Cookie ' . $rss_ae_cookie . ' is' . $aeset . ' set.', ' align="center"'), ' colspan="2"')) . tr(tda(gTxt('Cookie Name:'), ' style="text-align:right;vertical-align:middle"') . tda(text_input("rss_ae_cookie", $rss_ae_cookie, '20'), ' ')) . tr(tda(graf(fInput("submit", "add", gTxt("Add Edit Link"), "publish") . fInput("submit", "rem", gTxt("Remove Edit Link"), "publish") . eInput("editlink"), ' align="center"'), ' colspan="2"')) . endTable());
}
Пример #25
0
 public function audit()
 {
     global $DB, $error_ar;
     // Проверять сужествование связей обьектов.
     // Массив связей. (проверяемый ключ => таблица которая отвечет за него)
     $LINKS['Orders'] = array('AccountID' => 'Accounts', 'ResellerID' => 'Resellers');
     $LINKS['Accounts'] = array('ResellerID' => 'Resellers', 'PackageID' => 'Packages', 'ServerID' => 'Servers');
     $LINKS['Pool'] = array('AccountID' => 'Accounts');
     $LINKS['History'] = array('AccountID' => 'Accounts');
     //$LINKS['Tarifs'] = array(
     //'ResellerID' => 'Resellers'
     //);
     foreach ($LINKS as $test_table => $links) {
         //$primary_key = substr($test_table,0,-1).'ID';
         $primary_key = '';
         $res = $DB->query_adv("SELECT k.column_name FROM information_schema.key_column_usage k WHERE k.constraint_name = 'PRIMARY' AND k.table_schema = 'billing_db' AND k.table_name = '{$test_table}'");
         while ($data = $DB->row($res)) {
             $primary_key .= "{$data['column_name']}";
         }
         //raw($primary_key);
         echo "Cheking {$test_table} table consistency...";
         foreach ($links as $link_key => $link_table) {
             echo "{$link_key}...";
             $res = $DB->query_adv("SELECT `{$test_table}`.`{$primary_key}` as {$primary_key}, `{$test_table}`.`{$link_key}` as {$link_key} FROM `{$test_table}` LEFT OUTER JOIN `{$link_table}` ON `{$test_table}`.`{$link_key}` = `{$link_table}`.`{$link_key}` WHERE (`{$test_table}`.`{$link_key}`) AND `{$link_table}`.`{$link_key}` IS NULL");
             while ($data = $DB->row($res)) {
                 echo "\n Missing object `{$link_table}`.`{$link_key}`={$data[$link_key]} for lost object `{$test_table}`.`{$primary_key}`={$data[$primary_key]}\n";
             }
         }
         echo "OK\n";
     }
     // Проверка на потеренные тарифы
     /*
     $res = $DB->query_adv('SELECT * FROM `Tarifs` LEFT OUTER JOIN `Resellers` ON `Tarifs`.`ResellerID` = `Resellers`.`ResellerID` WHERE `Resellers`.`ResellerID` IS NULL');
     while($data = $DB->row($res)) {
     	echo "Lost Tarif $data[ResellerID].$data[PackageID]\n";
     }
     */
     /*
     Нормализация сервисов:
     1)проверки на opentime<closetime
     2)проверка на непересекаемость периодов сервисов.
     */
     /*
     $acct_result = $DB->make_select("SELECT * FROM whmaccts a ,whmaccts b WHERE a.Domain=b.Domain AND a.server!=b.server");
     $acct_row = $DB->row($acct_result);
     $acct_count = $DB->count($acct_result);
     echo beginTable("$acct_count Accounts");
     if ($acct_row) {
     	do {
     echo "<tr>
     <td>$acct_row[domain]</td>
     <td>$acct_row[server]</td>
     <td>$acct_row[username]</td>
     <td>$acct_row[email]</td>
     <td>$acct_row[quota]</td>
     <td>$acct_row[package]</td>
     <td>$acct_row[theme]</td>
     <td>$acct_row[ResellerID]</td>
     </tr>\n";
     	} while ($acct_row = $DB->row($acct_result));
     }
     echo endTable();
     echo "Finished Step , found $acct_count doublicated accounts. Time ".intval((microtime(1) - $start_time)*1000)."ms.<br><br>\n\n";
     */
     /*
     $start_time = microtime(1);
     echo "Chech for identical count of acoounts in biling and on servers...<br>\n";
     $acct_result = $DB->make_select("SELECT * FROM (SELECT domain, server, username, ResellerID, 'no in Billing' as System FROM `whmaccts`) UNION  (SELECT domain, ServerID, username, ResellerID, 'no on Server' as System FROM `Accounts`  WHERE Accounts.status!='Deleted') GROUP by domain HAVING COUNT(domain)!=2");
     $acct_row = $DB->row($acct_result);
     $acct_count = $DB->count($acct_result);
     echo beginTable("$acct_count Accounts");
     if ($acct_row) {
     	do {
     echo "<tr>
     <td>$acct_row[domain]</td>
     <td>$acct_row[server]</td>
     <td>$acct_row[username]</td>
     <td>$acct_row[ResellerID]</td>
     <td>$acct_row[System]</td>
     </tr>\n";
     	} while ($acct_row = $DB->row($acct_result));
     }
     
     echo endTable();
     echo "Finished Step, found $acct_count lost accounts. Time ".intval((microtime(1) - $start_time)*1000)."ms.<br><br>\n\n";
     */
     $start_time = microtime(1);
     echo "Chech acoounts info servers on servers...<br>\n";
     echo " !Фукция не рабочая и результаты не следует считать верными ...<br>\n";
     #
     $acct_result = $DB->make_select('whmaccts`, `Accounts', "whmaccts.domain, whmaccts.username, Accounts.username as username2, whmaccts.ResellerID, Accounts.ResellerID as ResellerID2, whmaccts.email, 'email' as email2, whmaccts.package, Accounts.PackageID as package2, whmaccts.theme, Accounts.ServerID", 'whmaccts.domain=Accounts.domain', 'domain');
     $acct_row = $DB->row($acct_result);
     echo beginTable();
     echo '<tr><th>Warning</th><th>wrong value</th><th>true value</th><th>Domain</th><tr>';
     if ($acct_row) {
         do {
             $equal = true;
             if ($acct_row['username'] != $acct_row['username2']) {
                 echo "<tr><td>Incorect Username in Billing</td><td>{$acct_row['username2']}</td><td>{$acct_row['username']}</td><td>{$acct_row['domain']}</td></tr>";
             }
             //if($acct_row['ResellerID']!=$acct_row['ResellerID2']) {echo "ResellerID: Server - $acct_row[ResellerID], Billing - $acct_row[ResellerID2]<br>";$equal=false;
             //echo whmreq("/scripts/dochangeowner?user=$acct_row[Username]&owner=$acct_row[ResellerID2]",$acct_row['Server'],$SERVER[$acct_row['Server']]['hash']);
             //}
             if ($acct_row['theme'] != 'x3') {
                 echo "<tr><td>Incorect Theme on Server</td><td>{$acct_row['theme']}</td><td>x3</td><td>{$acct_row['domain']}</td></tr>";
             }
             //if(!preg_match("/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i", $acct_row['email'])){
             //	echo "<tr><td>Incorrect Email on Server</td><td>$acct_row[email]</td><td>$acct_row[email2]</td><td>$acct_row[domain]</td></tr>";
             //whmreq("/scripts2/dochangeemail?user=$acct_row[Username]&email=$acct_row[Email2]",$acct_row['Server'],$SERVER[$acct_row['Server']]['hash']);
             //}
             //if($acct_row['package']!=$acct_row['package2']) {
             //echo "<tr><td>Incorrect Tarif on Server</td><td>$acct_row[package2]</td><td>$acct_row[package]</td><td>$acct_row[domain]</td></tr>";
             //$Tarif = $acct_row['package2'];
             //echo whmreq("/scripts2/upacct?user=$acct_row[Username]&pkg=$Tarif",$acct_row['Server'],$SERVER[$acct_row['Server']]['hash']);
             //echo whmreq("/scripts/saveedituser?BWLIMIT=10485760000&FEATURELIST=default&OWNER=$acct_row[ResellerID2]&user=$acct_row[Username]&DNS=$acct_row[Domain]&PLAN=$Tarif&newuser=$acct_row[Username]&RS=x2&MAXSQL={$TARIF[$Tarif]['SQL']}&MAXADDON={$TARIF[$Tarif]['AddonDomains']}&LANG=russian&seeshell=0&MAXPOP=1000&MAXFTP=1000&MAXLST=1000&MAXSUB=1000&MAXPARK=1000&HASCGI=1&shell=0",$acct_row['Server'],$SERVER[$acct_row['Server']]['hash']);
             //echo whmreq("/scripts/editquota?user=$acct_row[Username]&quota={$TARIF[$Tarif]['Quota']}",$acct_row['Server'],$SERVER[$acct_row['Server']]['hash']);
             //whmreq("/scripts2/domanageshells?user=$acct_row[Username]&shell=Disable",$acct_row['Server'],$SERVER[$acct_row['Server']]['hash']);
             //}
         } while ($acct_row = $DB->row($acct_result));
     }
     echo "</td></tr>";
     echo endTable();
     echo "Finished Step. Time " . intval((microtime(1) - $start_time) * 1000) . "ms.<br><br>\n\n";
 }
Пример #26
0
/**
 * Processes the selected import tool action.
 *
 * Basically does the importing.
 */
function start_import()
{
    global $event, $vars;
    extract(psa($vars));
    $insert_into_section = $import_section;
    $insert_with_status = $import_status;
    $default_comment_invite = $import_comments_invite;
    include_once txpath . '/include/import/import_' . $import_tool . '.php';
    $ini_time = ini_get('max_execution_time');
    @ini_set('max_execution_time', 300 + intval($ini_time));
    switch ($import_tool) {
        case 'mtdb':
            $out = doImportMTDB($importdblogin, $importdb, $importdbpass, $importdbhost, $import_blog_id, $insert_into_section, $insert_with_status, $default_comment_invite);
            rebuild_tree('root', 1, 'article');
            break;
        case 'mt':
            $file = check_import_file();
            if (!empty($file)) {
                $out = doImportMT($file, $insert_into_section, $insert_with_status, $import_comments_invite);
                // Rebuilding category tree.
                rebuild_tree('root', 1, 'article');
            } else {
                $out = 'Import file not found';
            }
            break;
        case 'b2':
            $out = doImportB2($importdblogin, $importdb, $importdbpass, $importdbhost, $insert_into_section, $insert_with_status, $default_comment_invite);
            break;
        case 'wp':
            $out = doImportWP($importdblogin, $importdb, $importdbpass, $importdbhost, $wpdbprefix, $insert_into_section, $insert_with_status, $default_comment_invite, $wpdbcharset);
            rebuild_tree('root', 1, 'article');
            break;
        case 'blogger':
            $file = check_import_file();
            if (!empty($file)) {
                $out = doImportBLOGGER($file, $insert_into_section, $insert_with_status, $import_comments_invite);
            } else {
                $out = gTxt('import_file_not_found');
            }
            break;
    }
    $out = tag('max_execution_time = ' . ini_get('max_execution_time'), 'p', ' class="highlight"') . $out;
    pagetop(gTxt('txp_import'));
    $content = '<div id="' . $event . '_container" class="txp-container">';
    $content .= startTable('', '', 'txp-list');
    $content .= tr(tdcs(hed(gTxt('txp_import'), 2), 2));
    $content .= tr(td($out));
    $content .= endTable();
    $content .= '</div>';
    echo $content;
    $rs = safe_rows_start('parentid, count(*) as thecount', 'txp_discuss', 'visible=1 group by parentid');
    if (numRows($rs) > 0) {
        while ($a = nextRow($rs)) {
            safe_update('textpattern', "comments_count=" . $a['thecount'], "ID=" . $a['parentid']);
        }
    }
}
function customers_list($event = '', $step = '', $message = '')
{
    global $statuses, $comments_disabled_after, $step, $txp_user;
    pagetop("Customers", $message);
    extract(get_prefs());
    extract(gpsa(array('page', 'sort', 'dir', 'crit', 'qty', 'search_method')));
    $sesutats = array_flip($statuses);
    $dir = $dir == 'desc' ? 'desc' : 'asc';
    switch ($sort) {
        case 'RealName':
            $sort_sql = 'RealName ' . $dir;
            break;
        case 'orders':
            $sort_sql = 'orders ' . $dir;
            break;
        default:
            $dir = 'desc';
            $sort_sql = 'user_id ' . $dir;
            break;
    }
    $switch_dir = $dir == 'desc' ? 'asc' : 'desc';
    $criteria = "privs = 0";
    if ($search_method and $crit) {
        $crit_escaped = doSlash($crit);
        $critsql = array('id' => "ID = '{$crit_escaped}'", 'title_body' => "Title rlike '{$crit_escaped}' or Body rlike '{$crit_escaped}'", 'section' => "Section rlike '{$crit_escaped}'", 'categories' => "Category1 rlike '{$crit_escaped}' or Category2 rlike '{$crit_escaped}'", 'status' => "Status = '" . @$sesutats[gTxt($crit_escaped)] . "'", 'author' => "AuthorID rlike '{$crit_escaped}'");
        if (array_key_exists($search_method, $critsql)) {
            $criteria = $critsql[$search_method];
            $limit = 500;
        } else {
            $search_method = '';
            $crit = '';
        }
    } else {
        $search_method = '';
        $crit = '';
    }
    $total = safe_count('txp_users', "{$criteria}");
    if (isset($qty)) {
        $customers_list_pageby = $qty;
    } else {
        $customers_list_pageby = 15;
    }
    $limit = max(@$customers_list_pageby, 15);
    list($page, $offset, $numPages) = pager($total, $limit, $page);
    $rs = safe_rows_start('*', 'txp_users', "{$criteria} order by {$sort_sql} limit {$offset}, {$limit}");
    $customersOnPage = $offset + $limit;
    if ($rs) {
        echo n . n . '<form name="longform" method="post" action="index.php" onsubmit="return verify(\'' . gTxt('are_you_sure') . '\')">' . n . startTable('list', '', '', '', '700') . n . tr(n . tda("Displaying {$offset} - {$customersOnPage} of {$total} customers", ' colspan="2" style="border: none; padding-bottom: 15px;"') . n . tda('<a href="?event=customers&step=edit_customer" class="navlink">Add a new customer</a> <a href="?event=customers&step=export_customer" class="navlink">Export customers</a>', ' colspan="2" style="text-align: right; border: none; padding-bottom: 15px;"')) . n . tr(n . column_head('Customer', 'RealName', 'customers', true, $switch_dir, $crit, $search_method) . column_head('Phone', 'shipping_phone', 'customers', true, $switch_dir, $crit, $search_method) . column_head('Email', 'email', 'customers', true, $switch_dir, $crit, $search_method) . column_head('Orders', 'order_num', 'customers', true, $switch_dir, $crit, $search_method));
        include_once txpath . '/publish/taghandlers.php';
        while ($a = nextRow($rs)) {
            extract($a);
            $order_num = safe_count("orders", "user_id = {$user_id}");
            $RealName = eLink('customers', 'edit_customer', 'user_id', $user_id, $RealName);
            $Orders = eLink('order', 'edit', 'customer', $name, $order_num);
            echo n . n . tr(n . td($RealName, "25%") . td($billing_phone, "25%") . td($email, "25%") . td($Orders, "25%"));
        }
        echo n . endTable() . n . '</form>' . n . nav_form('customers', $page, $numPages, $sort, $dir, $crit, $search_method) . n . pageby_form('customers', $customers_list_pageby);
    }
}
Пример #28
0
function getTxpLogin()
{
    $carry = postDecode(ps('carry'));
    extract($carry);
    $GLOBALS['textarray'] = setup_load_lang($lang);
    @(include txpath . '/config.php');
    if (!isset($txpcfg) || $txpcfg['db'] != $ddb || $txpcfg['table_prefix'] != $dprefix) {
        echo graf(strong(gTxt('before_you_proceed')) . ', ' . gTxt('create_config', array('{txpath}' => txpath))), '<textarea style="width:400px;height:200px" name="config" rows="1" cols="1">', makeConfig($carry), '</textarea>', '<form action="' . $GLOBALS['rel_siteurl'] . '/textpattern/setup/index.php" method="post">', fInput('submit', 'submit', gTxt('did_it'), 'smallbox'), sInput('getTxpLogin'), hInput('carry', postEncode($carry)), '</form>';
        return;
    }
    echo '<form action="' . $GLOBALS['rel_siteurl'] . '/textpattern/setup/index.php" method="post">', startTable('edit'), tr(tda(graf(gTxt('thanks')) . graf(gTxt('about_to_create')), ' width="400" colspan="2" align="center"')), tr(fLabelCell(gTxt('your_full_name')) . fInputCell('RealName')), tr(fLabelCell(gTxt('setup_login')) . fInputCell('name')), tr(fLabelCell(gTxt('choose_password')) . fInputCell('pass')), tr(fLabelCell(gTxt('your_email')) . fInputCell('email')), tr(td() . td(fInput('submit', 'Submit', gTxt('next'), 'publish'))), endTable(), sInput('createTxp'), hInput('lang', htmlspecialchars($lang)), hInput('siteurl', htmlspecialchars($siteurl)), '</form>';
}
Пример #29
0
function css_edit_raw()
{
    global $step;
    $name = gps('name');
    $default_name = safe_field('css', 'txp_section', "name = 'default'");
    $name = (!$name or $step == 'css_delete') ? $default_name : $name;
    if (gps('copy') && trim(preg_replace('/[<>&"\']/', '', gps('newname')))) {
        $name = gps('newname');
    }
    if ($step == 'pour') {
        $buttons = gTxt('name_for_this_style') . ': ' . fInput('text', 'newname', '', 'edit', '', '', 20) . hInput('savenew', 'savenew');
        $thecss = '';
    } else {
        $buttons = '';
        $thecss = base64_decode(fetch("css", 'txp_css', 'name', $name));
    }
    if ($step != 'pour') {
        $left = graf(gTxt('you_are_editing_css') . br . strong($name)) . graf(eLink('css', 'css_edit_form', 'name', $name, gTxt('edit_css_in_form'))) . graf(sLink('css', 'pour', gTxt('bulkload_existing_css')));
        $copy = gTxt('copy_css_as') . sp . fInput('text', 'newname', '', 'edit') . sp . fInput('submit', 'copy', gTxt('copy'), 'smallerbox');
    } else {
        $left = '&nbsp;';
        $copy = '';
    }
    $right = hed(gTxt('all_stylesheets'), 2) . css_list($name, $default_name);
    echo startTable('edit') . tr(tdtl($left) . td(form(graf($buttons) . '<textarea id="css" class="code" name="css" cols="78" rows="32">' . htmlspecialchars($thecss) . '</textarea>' . br . fInput('submit', '', gTxt('save'), 'publish') . eInput('css') . sInput('css_save') . hInput('name', $name) . $copy)) . tdtl($right)) . endTable();
}
Пример #30
0
    unset($access['Data']['td_tracking_ship_est']);
    unset($access['Data']['td_tracking_info']);
} else {
    $access['Data']['td_tracking_id']['disable'] = false;
    $access['Data']['td_tracking_link']['disable'] = false;
    $access['Data']['td_tracking_order_id']['disable'] = false;
    $access['Data']['td_tracking_company']['disable'] = false;
    $access['Data']['td_tracking_ship_date']['disable'] = false;
    $access['Data']['td_tracking_ship_est']['disable'] = false;
    $access['Data']['td_tracking_info']['disable'] = false;
}
unset($access['Data']['cd_enable_tracking']);
unset($access['Data']['td_enable_tracking']);
$access['Data']['ss_cancel_id']['DisplayName'] = 'Cancelation ID';
if (!$access['Data']['ss_cancel_id']['Value']) {
    unset($access['Data']['ss_cancel_id']);
}
if (!$access['Data']['ss_billing_state']['Value']) {
    unset($access['Data']['ss_billing_state']);
}
if (!$access['Data']['Last_Rebill_Date']['Value']) {
    unset($access['Data']['Last_Rebill_Date']);
}
$access['Columns'] = 1;
$access['Submitable'] = false;
$access['HeaderMessage'] = $msg;
beginTable();
writeAccessForm(&$access);
endTable("Transaction Info", "viewTransaction.php?{$link_info}");
?>
</body></html>