当前位置: 首页>>代码示例>>PHP>>正文


PHP tdcs函数代码示例

本文整理汇总了PHP中tdcs函数的典型用法代码示例。如果您正苦于以下问题:PHP tdcs函数的具体用法?PHP tdcs怎么用?PHP tdcs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了tdcs函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: section_list

function section_list($message = '')
{
    pagetop(gTxt('sections'), $message);
    global $url_mode, $txpac, $wlink;
    $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));
    $pageslist = safe_column("name", "txp_page", "1");
    $styleslist = safe_column("name", "txp_css", "1");
    $rs = safe_rows("*", "txp_section", "name!='' order by name");
    if ($rs) {
        foreach ($rs as $a) {
            extract($a);
            if ($name == 'default') {
                continue;
            }
            if ($url_mode) {
                $wlink = !check_sections($name) ? sp . wLink('section', 'missing_section_file', 'name', $name) : '';
            }
            $deletelink = dLink('section', 'section_delete', 'name', $name, '', 'type', 'section');
            $form = startTable('edit') . stackRows(fLabelCell(gTxt('section_name') . ':') . fInputCell('name', $name, 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 . $wlink) . td($form) . td($deletelink));
        }
    }
    echo startTable('list') . join('', $out) . endTable();
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:26,代码来源:txp_section.php

示例2: sec_section_list

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();
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:25,代码来源:txp_section.php

示例3: getDbInfo

function getDbInfo()
{
    $temp_txpath = dirname(__FILE__);
    $temp_doc_root = $_SERVER['DOCUMENT_ROOT'];
    echo '<form action="setup.php" method="post">', '<table id="setup" cellpadding="0" cellspacing="0" border="0">', tr(tda(hed('Welcome to Textpattern', 3) . graf('Inevitably, we need a few details.', ' style="margin-bottom:3em"') . hed('MySQL', 3) . graf('Note that the database you specify must exist; 
			  		Textpattern won&#8217;t create it for you.'), ' width="400" height="50" colspan="4", align="left"')), tr(fLabelCell('MySQL login') . fInputCell('duser', '', 1) . fLabelCell('MySQL password') . fInputCell('dpass', '', 2)), tr(fLabelCell('MySQL server') . fInputCell('dhost', '', 3) . fLabelCell('MySQL database') . fInputCell('ddb', '', 4)), tr(fLabelCell('Table prefix') . fInputCell('dprefix', '', 5) . tdcs(small('(Use ONLY for multiple installations in one database)'), 2)), tr(tdcs('&nbsp;', 4)), tr(tdcs(hed('Site Paths', 3) . graf('Please confirm the following paths to your site root and to the Textpattern directory.'), 4)), tr(fLabelCell('Full path to server\'s web root') . tdcs(fInput('text', 'doc_root', $temp_doc_root, 'edit', '', '', 40) . popHelp('doc_root'), 3)), tr(fLabelCell('Full path to Textpattern') . tdcs(fInput('text', 'txpath', $temp_txpath, 'edit', '', '', 40) . popHelp('full_path'), 3));
    echo tr(td() . td(fInput('submit', 'Submit', 'Next', 'publish')) . td() . td());
    echo endTable(), sInput('printConfig'), '</form>';
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:9,代码来源:setup.php

示例4: getDbInfo

function getDbInfo()
{
    $lang = isPost('lang');
    $GLOBALS['textarray'] = setup_load_lang($lang);
    @(include './config.php');
    if (!empty($txpcfg['db'])) {
        exit(graf(gTxt('already_installed')));
    }
    $temp_txpath = dirname(__FILE__);
    if (@$_SERVER['SCRIPT_NAME'] && (@$_SERVER['SERVER_NAME'] || @$_SERVER['HTTP_HOST'])) {
        $guess_siteurl = @$_SERVER['SERVER_NAME'] ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'];
        $guess_siteurl .= rtrim(dirname(dirname($_SERVER['SCRIPT_NAME'])), '/');
    } else {
        $guess_siteurl = 'mysite.com';
    }
    echo '<form action="setup.php" method="post">', '<table id="setup" cellpadding="0" cellspacing="0" border="0">', tr(tda(hed(gTxt('welcome_to_textpattern'), 3) . graf(gTxt('need_details'), ' style="margin-bottom:3em"') . hed('MySQL', 3) . graf(gTxt('db_must_exist')), ' width="400" height="50" colspan="4" align="left"')), tr(fLabelCell(gTxt('mysql_login')) . fInputCell('duser', '', 1) . fLabelCell(gTxt('mysql_password')) . fInputCell('dpass', '', 2)), tr(fLabelCell(gTxt('mysql_server')) . fInputCell('dhost', '', 3) . fLabelCell(gTxt('mysql_database')) . fInputCell('ddb', '', 4)), tr(fLabelCell(gTxt('table_prefix')) . fInputCell('dprefix', '', 5) . tdcs(small(gTxt('prefix_warning')), 2)), tr(tdcs('&nbsp;', 4)), tr(tdcs(hed(gTxt('site_path'), 3) . graf(gTxt('confirm_site_path')), 4)), tr(fLabelCell(gTxt('full_path_to_txp')) . tdcs(fInput('text', 'txpath', $temp_txpath, 'edit', '', '', 40) . popHelp('full_path'), 3)), tr(tdcs('&nbsp;', 4)), tr(tdcs(hed(gTxt('site_url'), 3) . graf(gTxt('please_enter_url')), 4)), tr(fLabelCell('http://') . tdcs(fInput('text', 'siteurl', $guess_siteurl, 'edit', '', '', 40) . popHelp('site_url'), 3));
    echo tr(td() . td(fInput('submit', 'Submit', gTxt('next'), 'publish')) . td() . td());
    echo endTable(), hInput('lang', $lang), sInput('printConfig'), '</form>';
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:19,代码来源:setup.php

示例5: getDbInfo

function getDbInfo()
{
    $GLOBALS['textarray'] = setup_load_lang(ps('lang'));
    @(include txpath . '/config.php');
    if (!empty($txpcfg['db'])) {
        exit(graf(gTxt('already_installed', array('{txpath}' => txpath))));
    }
    if (@$_SERVER['SCRIPT_NAME'] && (@$_SERVER['SERVER_NAME'] || @$_SERVER['HTTP_HOST'])) {
        $guess_siteurl = @$_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];
        $guess_siteurl .= $GLOBALS['rel_siteurl'];
    } else {
        $guess_siteurl = 'mysite.com';
    }
    echo '<form action="' . $GLOBALS['rel_siteurl'] . '/textpattern/setup/index.php" method="post">', '<table id="setup" cellpadding="0" cellspacing="0" border="0">', tr(tda(hed(gTxt('welcome_to_textpattern'), 3) . graf(gTxt('need_details'), ' style="margin-bottom:3em"') . hed('MySQL', 3) . graf(gTxt('db_must_exist')), ' width="400" height="50" colspan="4" align="left"')), tr(fLabelCell(gTxt('mysql_login')) . fInputCell('duser', '', 1) . fLabelCell(gTxt('mysql_password')) . fInputCell('dpass', '', 2)), tr(fLabelCell(gTxt('mysql_server')) . fInputCell('dhost', 'localhost', 3) . fLabelCell(gTxt('mysql_database')) . fInputCell('ddb', '', 4)), tr(fLabelCell(gTxt('table_prefix')) . fInputCell('dprefix', '', 5) . tdcs(small(gTxt('prefix_warning')), 2)), tr(tdcs('&nbsp;', 4)), tr(tdcs(hed(gTxt('site_url'), 3) . graf(gTxt('please_enter_url')), 4)), tr(fLabelCell('http://') . tdcs(fInput('text', 'siteurl', $guess_siteurl, 'edit', '', '', 40) . popHelp('siteurl'), 3));
    if (!is_callable('mail')) {
        echo tr(tdcs(gTxt('warn_mail_unavailable'), 3, null, '" style="color:red;text-align:center'));
    }
    echo tr(td() . td(fInput('submit', 'Submit', gTxt('next'), 'publish')) . td() . td());
    echo endTable(), hInput('lang', LANG), sInput('printConfig'), '</form>';
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:20,代码来源:index.php

示例6: image_list

function image_list($message = '')
{
    global $txpcfg, $extensions, $path_from_root, $img_dir;
    $pfr = $path_from_root;
    extract($txpcfg);
    extract(get_prefs());
    pagetop(gTxt('image'), $message);
    echo pageby_form('image', $article_list_pageby);
    echo startTable('list'), tr(tda(upload_form(gTxt('upload_file'), gTxt('upload'), 'image_insert'), ' colspan="4" style="border:0"')), tr(hCell(ucfirst(gTxt('name'))) . hCell(gTxt('image_category')) . hCell(gTxt('tags')) . hCell(gTxt('author')) . hCell(gTxt('thumbnail')) . hCell());
    $page = gps('page');
    $total = getCount('txp_image', "1");
    $limit = 15;
    $numPages = ceil($total / $limit);
    $page = !$page ? 1 : $page;
    $offset = ($page - 1) * $limit;
    $nav[] = $page > 1 ? PrevNextLink("image", $page - 1, gTxt('prev'), 'prev') : '';
    $nav[] = sp . small($page . '/' . $numPages) . sp;
    $nav[] = $page != $numPages ? PrevNextLink("image", $page + 1, gTxt('next'), 'next') : '';
    $rs = safe_rows("*", "txp_image", "1 order by category,name limit {$offset},{$limit}");
    if ($rs) {
        foreach ($rs as $a) {
            extract($a);
            $thumbnail = $thumbnail ? '<img src="' . $pfr . $img_dir . '/' . $id . 't' . $ext . '" />' : gTxt('no');
            $elink = eLink('image', 'image_edit', 'id', $id, $name);
            $txtilelink = '<a target="_blank" href="?event=tag' . a . 'name=image' . a . 'id=' . $id . a . 'ext=' . $ext . a . 'alt=' . $alt . a . 'h=' . $h . a . 'w=' . $w . a . 'type=textile" onclick="window.open(this.href, \'popupwindow\', \'width=400,height=400,scrollbars,resizable\'); return false;">Textile</a>';
            $txplink = '<a target="_blank" href="?event=tag' . a . 'name=image' . a . 'id=' . $id . a . 'type=textpattern" onclick="window.open(this.href, \'popupwindow\', \'width=400,height=400,scrollbars,resizable\'); return false;">Textpattern</a>';
            $xhtmlink = '<a target="_blank" href="?event=tag' . a . 'name=image' . a . 'id=' . $id . a . 'ext=' . $ext . a . 'h=' . $h . a . 'w=' . $w . a . 'type=xhtml" onclick="window.open(this.href, \'popupwindow\', \'width=400,height=400,scrollbars,resizable\'); return false;">XHTML</a>';
            $dlink = dLink('image', 'image_delete', 'id', $id);
            echo tr(td($elink) . td($category) . td($txtilelink . ' / ' . $txplink . ' / ' . $xhtmlink) . td($author) . td($thumbnail) . td($dlink, 10));
        }
        echo tr(tdcs(graf(join('', $nav)), 4));
    }
    echo endTable();
    $imgdir = $doc_root . $path_from_root . $img_dir;
    if (!is_dir($imgdir) or !is_writeable($imgdir)) {
        echo graf(str_replace("{imgdir}", $imgdir, gTxt('img_dir_not_writeable')), ' style="text-align:center;color:red"');
    }
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:38,代码来源:txp_image.php

示例7: discuss_list

function discuss_list($message = '')
{
    global $timeoffset;
    pagetop(gTxt('list_discussions'), $message);
    extract(doSlash(gpsa(array('page', 'crit'))));
    extract(get_prefs());
    $total = safe_count('txp_discuss', "1");
    $limit = $comment_list_pageby;
    $numPages = ceil($total / $limit);
    $page = !$page ? 1 : $page;
    $offset = ($page - 1) * $limit;
    $nav[] = $page > 1 ? PrevNextLink("discuss", $page - 1, gTxt('prev'), 'prev') : '';
    $nav[] = sp . small($page . '/' . $numPages) . sp;
    $nav[] = $page != $numPages ? PrevNextLink("discuss", $page + 1, gTxt('next'), 'next') : '';
    $criteria = $crit ? "message like '%{$crit}%'" : '1';
    $rs = safe_rows("*, unix_timestamp(posted) as uPosted", "txp_discuss", "{$criteria} order by posted desc limit {$offset},{$limit}");
    echo pageby_form('discuss', $comment_list_pageby);
    if ($rs) {
        echo '<form action="index.php" method="post" onsubmit="return verify(\'' . gTxt('are_you_sure') . '\')">', startTable('list'), assHead('date', 'name', 'message', 'parent', '');
        foreach ($rs as $a) {
            extract($a);
            $dmessage = $message;
            $name = !$visible ? '<span style="color:red">' . $name . '</span>' : $name;
            $date = "" . date("M d, g:ia", $uPosted + $timeoffset) . "";
            $editlink = eLink('discuss', 'discuss_edit', 'discussid', $discussid, $date);
            $cbox = fInput('checkbox', 'selected[]', $discussid);
            $tq = fetch('Title', 'textpattern', 'ID', $parentid);
            $parent = !$tq ? gTxt('article_deleted') : $tq;
            echo assRow(array($editlink => 100, $name => 100, $dmessage => 250, $parent => 100, $cbox => 20));
        }
        echo tr(tda(discuss_multiedit_form(), ' colspan="5" style="text-align:right;border:0px"'));
        echo endTable() . '</form>';
        echo startTable('edit'), tr(tda(graf('<a href="index.php?event=discuss' . a . 'step=ipban_list">' . gTxt('list_banned_ips') . '</a>'), ' valign="middle"') . td(form(fInput('text', 'crit', '', 'edit') . fInput('submit', 'search', gTxt('search'), 'smallbox') . eInput("discuss") . sInput("list"))) . tdcs(graf(join('', $nav)), 2)), endTable();
    } else {
        echo graf(gTxt('no_comments_recorded'), ' align="center"');
    }
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:37,代码来源:txp_discuss.php

示例8: rss_admin_editlink

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());
}
开发者ID:netcarver,项目名称:rss_article_edit,代码行数:24,代码来源:rss_article_edit.php

示例9: list_languages

function list_languages($message = '')
{
    global $prefs;
    require_once txpath . '/lib/IXRClass.php';
    pagetop(gTxt('update_languages'), $message);
    $client = new IXR_Client('http://rpc.textpattern.com');
    #$client->debug = true;
    echo startTable('list'), tr(tdcs(hed(gTxt('update_languages'), 1), 3)), tr(tdcs(sLink('prefs', 'prefs_list', gTxt('site_prefs')) . sp . sLink('prefs', 'advanced_prefs', gTxt('advanced_preferences')), '3'));
    if (!$client->query('tups.listLanguages', $prefs['blog_uid'])) {
        $files = get_lang_files();
        if (is_array($files) && !empty($files)) {
            foreach ($files as $file) {
                if ($fp = @fopen(txpath . '/lang/' . $file, 'r')) {
                    $firstline = fgets($fp, 4069);
                    fclose($fp);
                    if (strpos($firstline, '#@version') !== false) {
                        # Looks like: "#@version id;unixtimestamp"
                        @(list($fversion, $ftime) = explode(';', trim(substr($firstline, strpos($firstline, ' ', 1)))));
                        $note = "({$fversion} " . date("d. F Y", $ftime) . ")";
                    } else {
                        $note = "(outdated)";
                    }
                } else {
                    $note = '';
                }
                $code = substr($file, 0, 5);
                echo tr(tda(eLink('prefs', 'get_language', 'lang_code', $code, $code) . sp, ' style="text-align:right;vertical-align:middle"') . tda(eLink('prefs', 'get_language', 'lang_code', $code, gTxt('install'))) . tda($note));
            }
        }
        echo endTable();
        echo tag(gTxt('error') . ': could not connect to RPC server to check for updated languages. Please, try it again later.<br /> 
			If problem connecting to the RPC server persists, you can go to <a href="http://rpc.textpattern.com/lang/">http://rpc.textpattern.com/lang/</a>, download the
			desired language file and place it in the /lang/ directory of your textpattern install. Textpattern will try do the install using that file.', 'p', ' colspan="3" style="color:red;width:50%;margin: auto"');
    } else {
        $response = $client->getResponse();
        if (is_array($response)) {
            foreach ($response as $language) {
                # I'm affraid we need a value here for the language itself, not for each one of the rows
                $db_lastmod = safe_field('UNIX_TIMESTAMP(lastmod)', 'txp_lang', "lang='{$language['language']}' ORDER BY lastmod DESC");
                $updating = $db_lastmod ? 1 : 0;
                $remote_mod = gmmktime($language['lastmodified']->hour, $language['lastmodified']->minute, $language['lastmodified']->second, $language['lastmodified']->month, $language['lastmodified']->day, $language['lastmodified']->year);
                $updated = $updating && $db_lastmod >= $remote_mod ? 1 : 0;
                if ($updated) {
                    echo tr(tda(gTxt($language['language']) . sp, ' style="text-align:right;vertical-align:middle"') . tda(gTxt('updated')));
                } else {
                    echo tr(tda(gTxt($language['language']) . sp, $updating ? ' style="text-align:right;vertical-align:middle;color:red;"' : ' style="text-align:right;vertical-align:middle;"') . td(eLink('prefs', 'get_language', 'lang_code', $language['language'], $updating ? gTxt('update') : gTxt('install'), 'updating', "{$updating}")));
                }
            }
        }
        echo endTable();
    }
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:52,代码来源:txp_prefs.php

示例10: render_prefs

 /**
  * Render options page
  * @param  string $event the event being called
  * @param  string $step  the step being called
  */
 public function render_prefs($event, $step)
 {
     if ($step === 'update') {
         $this->update_prefs();
     }
     pageTop(gTxt('Multiple Image Upload'));
     // todo: show preflight/sanity errors if any
     // Generate Preferences Table
     $out = hed(gTxt('Multiple Image Upload - Preferences'), 1);
     $out .= startTable($this->prefix('preferences'), 'center', 5);
     foreach (self::$preferences as $key => $pref) {
         $out .= $this->render_pref($key, $pref);
     }
     // render save button
     $out .= tr(tdcs(eInput('plugin_prefs.' . self::$slug) . sInput('update') . fInput('submit', 'save', gTxt('save_button'), 'publish'), 3, '', 'nolin'));
     $out .= endtable();
     echo form($out);
 }
开发者ID:jbach,项目名称:jbx_multiple_image_upload,代码行数:23,代码来源:jbx_multiple_image_upload.php

示例11: tag_link_feed_link

function tag_link_feed_link()
{
    global $step, $endform, $name;
    $invars = gpsa(array('label', 'category', 'limit', 'wraptag'));
    extract($invars);
    $label = !$label ? 'XML' : $label;
    $out = form(startTable('list') . tr(tdcs(hed('Link to XML Feed of Links', 3), 2)) . tagRow('label', fInput('text', 'label', $label, 'edit', '', '', 25)) . tagRow('wraptag', fInput('text', 'wraptag', $wraptag, 'edit', '', '', 2)) . tagRow('category', link_category_pop($category)) . tagRow('limit', fInput('text', 'limit', $limit, 'edit', '', '', 2)) . $endform);
    $out .= $step == 'build' ? tdb(tb($name, $invars)) : '';
    return $out;
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:10,代码来源:txp_tag.php

示例12: list_languages

function list_languages($message = '')
{
    global $prefs, $locale, $txpcfg, $textarray;
    require_once txpath . '/lib/IXRClass.php';
    // Select and save active language
    if (!$message && ps('step') == 'list_languages' && ps('language')) {
        $locale = doSlash(getlocale(ps('language')));
        safe_update("txp_prefs", "val='" . doSlash(ps('language')) . "'", "name='language'");
        safe_update("txp_prefs", "val='" . $locale . "'", "name='locale'");
        $textarray = load_lang(doSlash(ps('language')));
        $locale = setlocale(LC_ALL, $locale);
        $message = gTxt('preferences_saved');
    }
    $active_lang = safe_field('val', 'txp_prefs', "name='language'");
    $lang_form = tda(form(gTxt('active_language') . '&nbsp;&nbsp;' . languages('language', $active_lang) . '&nbsp;&nbsp;' . fInput('submit', 'Submit', gTxt('save_button'), '') . eInput('prefs') . sInput('list_languages'), 'display:inline;'), ' style="text-align:center" colspan="3"');
    $client = new IXR_Client(RPC_SERVER);
    #$client->debug = true;
    $available_lang = array();
    $rpc_connect = false;
    $show_files = false;
    # Get items from RPC
    @set_time_limit(90);
    if (gps('force') != 'file' && $client->query('tups.listLanguages', $prefs['blog_uid'])) {
        $rpc_connect = true;
        $response = $client->getResponse();
        foreach ($response as $language) {
            $available_lang[$language['language']]['rpc_lastmod'] = gmmktime($language['lastmodified']->hour, $language['lastmodified']->minute, $language['lastmodified']->second, $language['lastmodified']->month, $language['lastmodified']->day, $language['lastmodified']->year);
        }
    } elseif (gps('force') != 'file') {
        $msg = gTxt('rpc_connect_error') . "<!--" . $client->getErrorCode() . ' ' . $client->getErrorMessage() . "-->";
    }
    # Get items from Filesystem
    $files = get_lang_files();
    if (gps('force') == 'file' || !$rpc_connect) {
        $show_files = true;
    }
    if ($show_files && is_array($files) && !empty($files)) {
        foreach ($files as $file) {
            if ($fp = @fopen(txpath . DS . 'lang' . DS . $file, 'r')) {
                $name = str_replace('.txt', '', $file);
                $firstline = fgets($fp, 4069);
                fclose($fp);
                if (strpos($firstline, '#@version') !== false) {
                    @(list($fversion, $ftime) = explode(';', trim(substr($firstline, strpos($firstline, ' ', 1)))));
                } else {
                    $fversion = $ftime = NULL;
                }
                $available_lang[$name]['file_note'] = isset($fversion) ? $fversion : 0;
                $available_lang[$name]['file_lastmod'] = isset($ftime) ? $ftime : 0;
            }
        }
    }
    # Get installed items from the database
    # I'm affraid we need a value here for the language itself, not for each one of the rows
    $rows = safe_rows('lang, UNIX_TIMESTAMP(MAX(lastmod)) as lastmod', 'txp_lang', "1 GROUP BY lang ORDER BY lastmod DESC");
    foreach ($rows as $language) {
        $available_lang[$language['lang']]['db_lastmod'] = $language['lastmod'];
    }
    $list = '';
    # Show the language table
    foreach ($available_lang as $langname => $langdat) {
        $file_updated = isset($langdat['db_lastmod']) && @$langdat['file_lastmod'] > $langdat['db_lastmod'];
        $rpc_updated = @$langdat['rpc_lastmod'] > @$langdat['db_lastmod'];
        $rpc_install = tda(strong(eLink('prefs', 'get_language', 'lang_code', $langname, isset($langdat['db_lastmod']) ? gTxt('update') : gTxt('install'), 'updating', isset($langdat['db_lastmod']))) . br . safe_strftime('%d %b %Y %X', @$langdat['rpc_lastmod']), isset($langdat['db_lastmod']) ? ' style="color:red;text-align:center;background-color:#FFFFCC;"' : ' style="color:#667;vertical-align:middle;text-align:center"');
        $list .= tr(tda(gTxt($langname) . tag(isset($langdat['db_lastmod']) ? br . '&nbsp;' . safe_strftime('%d %b %Y %X', $langdat['db_lastmod']) : '', 'span', ' style="color:#aaa;font-style:italic"'), isset($langdat['db_lastmod']) && $rpc_updated ? ' nowrap="nowrap" style="color:red;background-color:#FFFFCC;"' : ' nowrap="nowrap" style="vertical-align:middle"') . n . ($rpc_updated ? $rpc_install : tda(isset($langdat['rpc_lastmod']) ? gTxt('updated') : '-', ' style="vertical-align:middle;text-align:center"')) . n . ($show_files ? tda(tag(isset($langdat['file_lastmod']) ? eLink('prefs', 'get_language', 'lang_code', $langname, $file_updated ? gTxt('update') : gTxt('install'), 'force', 'file') . br . '&nbsp;' . safe_strftime($prefs['archive_dateformat'], $langdat['file_lastmod']) : ' &nbsp; ', 'span', $file_updated ? ' style="color:#667;"' : ' style="color:#aaa;font-style:italic"'), ' class="langfile" style="text-align:center;vertical-align:middle"') . n : '')) . n . n;
    }
    // Output Table + Content
    pagetop(gTxt('update_languages'), $message);
    if (isset($msg) && $msg) {
        echo tag($msg, 'p', ' style="text-align:center;color:red;width:50%;margin: 2em auto"');
    }
    echo startTable('list'), tr(tdcs(hed(gTxt('manage_languages'), 1), 3)), tr(tdcs(sLink('prefs', 'prefs_list', gTxt('site_prefs'), 'navlink') . sp . sLink('prefs', 'advanced_prefs', gTxt('advanced_preferences'), 'navlink') . sp . sLink('prefs', 'list_languages', gTxt('manage_languages'), 'navlink-active'), '3')), tr(tda('&nbsp;', ' colspan="3" style="font-size:0.25em"')), tr($lang_form), tr(tda('&nbsp;', ' colspan="3" style="font-size:0.25em"')), tr(tda(gTxt('language')) . tda(gTxt('from_server')) . ($show_files ? tda(gTxt('from_file')) : ''), ' style="font-weight:bold"');
    echo $list;
    if (!$show_files) {
        $linktext = gTxt('from_file') . ' (' . gTxt('experts_only') . ')';
        echo tr(tda('&nbsp;', ' colspan="3" style="font-size:0.25em"')) . tr(tda(strong(eLink('prefs', 'list_languages', 'force', 'file', $linktext)), ' colspan="3" style="text-align:center"'));
    } elseif (gps('force') == 'file') {
        echo tr(tda('&nbsp;', ' colspan="3" style="font-size:0.25em"')) . tr(tda(sLink('prefs', 'list_languages', strong(gTxt('from_server'))), ' colspan="3" style="text-align:center"'));
    }
    echo endTable();
    $install_langfile = gTxt('install_langfile', array('{url}' => strong('<a href="' . RPC_SERVER . '/lang/">' . RPC_SERVER . '/lang/</a>')));
    if ($install_langfile == 'install_langfile') {
        $install_langfile = 'To install new languages from file you can download them from <b><a href="' . RPC_SERVER . '/lang/">' . RPC_SERVER . '/lang/</a></b> and place them inside your ./textpattern/lang/ directory.';
    }
    echo tag($install_langfile, 'p', ' style="text-align:center;width:50%;margin: 2em auto"');
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:86,代码来源:txp_prefs.php

示例13: start_import

function start_import()
{
    global $vars;
    extract(psa($vars));
    $insert_into_section = $Section;
    $insert_with_status = $type;
    $default_comment_invite = $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, $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, $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);
            rebuild_tree('root', 1, 'article');
            break;
        case 'blogger':
            $file = check_import_file();
            if (!empty($file)) {
                $out = doImportBLOGGER($file, $insert_into_section, $insert_with_status, $comments_invite);
            } else {
                $out = gTxt('import_file_not_found');
            }
            break;
    }
    $out = tag('max_execution_time = ' . ini_get('max_execution_time'), 'p', ' style="color:red;"') . $out;
    pagetop(gTxt('txp_import'));
    $content = startTable('list');
    $content .= tr(tdcs(hed(gTxt('txp_import'), 3), 2));
    $content .= tr(td($out));
    $content .= endTable();
    echo $content;
}
开发者ID:bgarrels,项目名称:textpattern,代码行数:49,代码来源:txp_import.php

示例14: getDbInfo

 function getDbInfo()
 {
     $lang = $this->vars['lang'] = ps('lang');
     $GLOBALS['textarray'] = $this->_load_lang();
     @(include txpath . '/config.php');
     # this should be on the top most method of the controller!
     if (!empty($txpcfg['db'])) {
         $this->setup_error(gTxt('already_installed', array('{txpath}' => txpath)));
     }
     $temp_txpath = txpath;
     if (@$_SERVER['SCRIPT_NAME'] && (@$_SERVER['SERVER_NAME'] || @$_SERVER['HTTP_HOST'])) {
         $guess_siteurl = @$_SERVER['HTTP_HOST'] ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];
         $guess_siteurl .= $this->rel_siteurl;
     } else {
         $guess_siteurl = 'mysite.com';
     }
     #$this->_step_view = '<form action="'.$this->rel_siteurl.'/textpattern/setup/index.php" method="post">'.
     $this->_step_view = '<form action="' . $this->rel_siteurl . '/textpattern/setup/install.php" method="post">' . '<table id="setup" cellpadding="0" cellspacing="0" border="0">' . tr(tda(hed(gTxt('welcome_to_textpattern'), 3) . graf(gTxt('need_details'), ' style="margin-bottom:3em"') . hed(gTxt('database'), 3) . graf(gTxt('db_must_exist')), ' width="400" height="50" colspan="4" align="left"')) . tr(fLabelCell(gTxt('setup_db_login')) . fInputCell('duser', '', 1) . fLabelCell(gTxt('setup_db_password')) . fInputCell('dpass', '', 2)) . tr(fLabelCell(gTxt('setup_db_server')) . fInputCell('dhost', 'localhost', 3) . fLabelCell(gTxt('setup_db_database')) . fInputCell('ddb', '', 4)) . tr(fLabelCell(gTxt('table_prefix')) . fInputCell('dprefix', '', 5) . tdcs(small(gTxt('prefix_warning')), 2)) . tr(fLabelCell(gTxt('database_engines')) . td($this->_availableDBDrivers()) . tdcs('&nbsp;', 2)) . tr(tdcs('&nbsp;', 4)) . tr(tdcs(hed(gTxt('site_path'), 3) . graf(gTxt('confirm_site_path')), 4)) . tr(fLabelCell(gTxt('full_path_to_txp')) . tdcs(fInput('text', 'txpath', $temp_txpath, 'edit', '', '', 40) . popHelp('full_path'), 3)) . tr(tdcs('&nbsp;', 4)) . tr(tdcs(hed(gTxt('site_url'), 3) . graf(gTxt('please_enter_url')), 4)) . tr(fLabelCell('http://') . tdcs(fInput('text', 'siteurl', $guess_siteurl, 'edit', '', '', 40) . popHelp('siteurl'), 3));
     if (!is_callable('mail')) {
         $this->_step_view .= tr(tdcs(gTxt('warn_mail_unavailable'), 3, null, '" style="color:red;text-align:center'));
     }
     $this->_step_view .= tr(td() . td(fInput('submit', 'Submit', gTxt('next'), 'publish')) . td() . td());
     $this->_step_view .= endTable() . hInput('lang', $lang) . sInput('printConfig') . '</form>';
 }
开发者ID:bgarrels,项目名称:textpattern,代码行数:24,代码来源:controller.php

示例15: rss_db_bk


//.........这里部分代码省略.........
                    if (filesize($backup_path) == 0) {
                        unlink($backup_path);
                        pagetop("DB Manager", "BACKUP FAILED.  ERROR NO: " . $error);
                    } else {
                        pagetop("DB Manager", "Backed Up: " . $DB->db . " to " . $filename);
                    }
                }
            }
        } else {
            if (gps("download")) {
                $fn = gps("download");
                $file_path = $bkpath . '/' . $fn;
                header("Pragma: public");
                header("Expires: 0");
                header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
                header("Content-Type: application/force-download");
                header("Content-Type: application/octet-stream");
                header("Content-Type: application/download");
                if (substr($fn, -2) == "gz") {
                    header("Content-Type: application/zip");
                }
                header("Content-Disposition: attachment; filename=" . basename($file_path) . ";");
                header("Content-Transfer-Encoding: binary");
                header("Content-Length: " . filesize($file_path));
                @readfile($file_path);
            } else {
                if (gps("restore")) {
                    if (stristr(gps("restore"), '.gz')) {
                        $backup_cmd = 'gunzip < ' . $bkpath . '/' . gps("restore") . ' | ' . $rss_dbbk_mysql . $mysql_hup . ' ' . $DB->db;
                    } else {
                        $backup_cmd = $rss_dbbk_mysql . $mysql_hup . ' ' . $DB->db . ' < ' . $bkpath . '/' . gps("restore");
                    }
                    $bkdebug = $rss_dbbk_debug ? $backup_cmd : '';
                    $error = "";
                    if (function_exists('passthru')) {
                        passthru($backup_cmd, $error);
                    } else {
                        $dumpIt = popen($backup_cmd, 'r');
                        pclose($dumpIt);
                    }
                    if ($error) {
                        pagetop("DB Manager", "FAILED TO RESTORE: " . $error);
                    } else {
                        pagetop("DB Manager", "Restored: " . gps("restore") . " to " . $DB->db);
                    }
                } else {
                    if (gps("delete")) {
                        if (is_file($bkpath . '/' . gps("delete"))) {
                            if (!unlink($bkpath . '/' . gps("delete"))) {
                                pagetop("DB Manager", "Unable to Delete: " . gps("delete"));
                            } else {
                                pagetop("DB Manager", "Deleted: " . gps("delete"));
                            }
                        } else {
                            pagetop("DB Manager", "Unable to Delete: " . gps("delete"));
                        }
                    } else {
                        pagetop("DB Backup");
                    }
                }
            }
        }
    }
    $gzp = !$iswin ? " | " . href('gzipped file', "index.php?event=rss_db_bk&amp;bk={$DB->db}&amp;gzip=1") : "";
    $sqlversion = getRow("SELECT VERSION() AS version");
    $sqlv = explode("-", $sqlversion['version']);
    $allownologs = (double) $sqlv[0] >= (double) "4.1.9" ? tda(gTxt('Include txp_log:'), ' style="text-align:right;vertical-align:middle"') . tda(yesnoRadio("rss_dbbk_txplog", $rss_dbbk_txplog), ' style="text-align:left;vertical-align:middle"') : '';
    if (isset($bkdebug) && $bkdebug) {
        echo '<p align="center">' . $bkdebug . '</p>';
    }
    echo startTable('list') . form(tr(tda(gTxt('Lock Tables:'), ' style="text-align:right;vertical-align:middle"') . tda(yesnoRadio("rss_dbbk_lock", $rss_dbbk_lock), ' style="text-align:left;vertical-align:middle"') . $allownologs . tda(gTxt('Debug Mode:'), ' style="text-align:right;vertical-align:middle"') . tda(yesnoRadio("rss_dbbk_debug", $rss_dbbk_debug), ' style="text-align:left;vertical-align:middle"') . tda(fInput("submit", "save", gTxt("save_button"), "publish") . eInput("rss_db_bk") . sInput('saveprefs'), " colspan=\"2\" class=\"noline\"")) . tr(tda(gTxt('Backup Path:'), ' style="text-align:right;vertical-align:middle"') . tda(text_input("rss_dbbk_path", $rss_dbbk_path, '50'), ' colspan="15"')) . tr(tda(gTxt('mysqldump Path:'), ' style="text-align:right;vertical-align:middle"') . tda(text_input("rss_dbbk_dump", $rss_dbbk_dump, '50'), ' colspan="15"')) . tr(tda(gTxt('mysql Path:'), ' style="text-align:right;vertical-align:middle"') . tda(text_input("rss_dbbk_mysql", $rss_dbbk_mysql, '50'), ' colspan="15"'))) . endTable() . startTable("list") . tr(tda(hed('Create a new backup of the ' . $DB->db . ' database' . br . href('.sql file', "index.php?event=rss_db_bk&amp;bk={$DB->db}") . $gzp, 3), ' colspan="7" style="text-align:center;"')) . tr(tdcs(hed("Previous Backup Files", 1), 7)) . tr(hcell("No.") . hcell("Backup File Name") . hcell("Backup Date/Time") . hcell("Backup File Size") . hcell("") . hcell("") . hcell(""));
    $totalsize = 0;
    $no = 0;
    if (!is_folder_empty($bkpath)) {
        if ($handle = opendir($bkpath)) {
            $database_files = array();
            while (false !== ($file = readdir($handle))) {
                if ($file != '.' && $file != '..' && (substr($file, -4) == ".sql" || substr($file, -7) == ".sql.gz")) {
                    $database_files[] = $file;
                }
            }
            closedir($handle);
            for ($i = sizeof($database_files) - 1; $i > -1; $i--) {
                $no++;
                $style = $no % 2 == 0 ? ' style="background-color: #eee;"' : '';
                $database_text = substr($database_files[$i], 11);
                $date_text = strftime("%A, %B %d, %Y [%H:%M:%S]", substr($database_files[$i], 0, 10));
                $size_text = filesize($bkpath . '/' . $database_files[$i]);
                $totalsize += $size_text;
                echo tr(td($no) . td($database_text) . td($date_text) . td(prettyFileSize($size_text)) . '<td><a href="index.php?event=rss_db_bk&amp;download=' . $database_files[$i] . '">Download</a></td>' . '<td><a href="index.php?event=rss_db_bk&amp;restore=' . $database_files[$i] . '"  onclick="return verify(\'' . gTxt('are_you_sure') . '\')">Restore</a></td>' . '<td><a href="index.php?event=rss_db_bk&amp;delete=' . $database_files[$i] . '"  onclick="return verify(\'' . gTxt('are_you_sure') . '\')">Delete</a></td>', $style);
            }
            echo tr(tag($no . " Backup File(s)", "th", ' colspan="3"') . tag(prettyFileSize($totalsize), "th", ' colspan="4"'));
        } else {
            echo tr(tda(hed('You have no database backups' . br . 'Create a new backup of the ' . $DB->db . ' database' . br . href('.sql file', "index.php?event=rss_db_bk&amp;bk={$DB->db}") . $gzp, 3), ' colspan="7" style="text-align:center;"'));
        }
    } else {
        echo tr(tda(hed('You have no database backups' . br . 'Create a new backup of the ' . $DB->db . ' database' . br . href('.sql file', "index.php?event=rss_db_bk&amp;bk={$DB->db}") . $gzp, 3), ' colspan="7" style="text-align:center;"'));
    }
    echo endTable();
}
开发者ID:netcarver,项目名称:rss_admin_db_manager,代码行数:101,代码来源:rss_admin_db_manager.php


注:本文中的tdcs函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。