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


PHP check_for_update函数代码示例

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


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

示例1: theme_updater

function theme_updater($checked_data)
{
    global $wp_version;
    $bavotasan_version_check = check_for_update();
    if (empty($checked_data->checked) && !empty($bavotasan_version_check)) {
        $response = array('new_version' => $bavotasan_version_check, 'url' => THEME_HOMEPAGE, 'package' => 'http://themes.bavotasan.com/fvTHfe/wpt-' . THEME_CODE . '.zip');
        $checked_data->checked[THEME_FILE] = $bavotasan_version_check;
        $checked_data->response[THEME_FILE] = $response;
        return $checked_data;
    }
    if (!empty($bavotasan_version_check)) {
        $response = array('new_version' => $bavotasan_version_check, 'url' => THEME_HOMEPAGE, 'package' => 'http://themes.bavotasan.com/fvTHfe/wpt-' . THEME_CODE . '.zip');
        $checked_data->response[THEME_FILE] = $response;
    }
    return $checked_data;
}
开发者ID:Runemester,项目名称:PressWork,代码行数:16,代码来源:theme-updater.php

示例2: make_runtime_info

function make_runtime_info($link)
{
    $data = array();
    $result = db_query($link, "SELECT MAX(id) AS mid, COUNT(*) AS nf FROM\n\t\t\tttrss_feeds WHERE owner_uid = " . $_SESSION["uid"]);
    $max_feed_id = db_fetch_result($result, 0, "mid");
    $num_feeds = db_fetch_result($result, 0, "nf");
    $data["max_feed_id"] = (int) $max_feed_id;
    $data["num_feeds"] = (int) $num_feeds;
    $data['last_article_id'] = getLastArticleId($link);
    $data['cdm_expanded'] = get_pref($link, 'CDM_EXPANDED');
    if (file_exists(LOCK_DIRECTORY . "/update_daemon.lock")) {
        $data['daemon_is_running'] = (int) file_is_locked("update_daemon.lock");
        if (time() - $_SESSION["daemon_stamp_check"] > 30) {
            $stamp = (int) @file_get_contents(LOCK_DIRECTORY . "/update_daemon.stamp");
            if ($stamp) {
                $stamp_delta = time() - $stamp;
                if ($stamp_delta > 1800) {
                    $stamp_check = 0;
                } else {
                    $stamp_check = 1;
                    $_SESSION["daemon_stamp_check"] = time();
                }
                $data['daemon_stamp_ok'] = $stamp_check;
                $stamp_fmt = date("Y.m.d, G:i", $stamp);
                $data['daemon_stamp'] = $stamp_fmt;
            }
        }
    }
    if ($_SESSION["last_version_check"] + 86400 + rand(-1000, 1000) < time()) {
        $new_version_details = @check_for_update($link);
        $data['new_version_available'] = (int) ($new_version_details != false);
        $_SESSION["last_version_check"] = time();
        $_SESSION["version_data"] = $new_version_details;
    }
    return $data;
}
开发者ID:rclsilver,项目名称:openshift-tt-rss,代码行数:36,代码来源:functions.php

示例3: print_runtime_info

function print_runtime_info($link)
{
    print "<runtime-info>";
    $result = db_query($link, "SELECT COUNT(*) AS cf FROM\n\t\t\tttrss_feeds WHERE owner_uid = " . $_SESSION["uid"]);
    $num_feeds = db_fetch_result($result, 0, "cf");
    print "<param key=\"num_feeds\" value=\"" . (int) $num_feeds . "\"/>";
    if (ENABLE_UPDATE_DAEMON) {
        print "<param key=\"daemon_is_running\" value=\"" . (int) file_is_locked("update_daemon.lock") . "\"/>";
        if (time() - $_SESSION["daemon_stamp_check"] > 30) {
            $stamp = (int) read_stampfile("update_daemon.stamp");
            //				print "<param key=\"daemon_stamp_delta\" value=\"$stamp_delta\"/>";
            if ($stamp) {
                $stamp_delta = time() - $stamp;
                if ($stamp_delta > 1800) {
                    $stamp_check = 0;
                } else {
                    $stamp_check = 1;
                    $_SESSION["daemon_stamp_check"] = time();
                }
                print "<param key=\"daemon_stamp_ok\" value=\"{$stamp_check}\"/>";
                $stamp_fmt = date("Y.m.d, G:i", $stamp);
                print "<param key=\"daemon_stamp\" value=\"{$stamp_fmt}\"/>";
            }
        }
    }
    if (CHECK_FOR_NEW_VERSION && $_SESSION["access_level"] >= 10) {
        if ($_SESSION["last_version_check"] + 86400 + rand(-1000, 1000) < time()) {
            $new_version_details = check_for_update($link);
            print "<param key=\"new_version_available\" value=\"" . sprintf("%d", $new_version_details != "") . "\"/>";
            $_SESSION["last_version_check"] = time();
        }
    }
    //		print "<param key=\"new_version_available\" value=\"1\"/>";
    print "</runtime-info>";
}
开发者ID:wangroot,项目名称:Tiny-Tiny-RSS,代码行数:35,代码来源:functions.php

示例4: newVersion

 function newVersion()
 {
     $version_data = check_for_update($this->link);
     $version = $version_data['version'];
     $id = $version_data['version_id'];
     print "<div class='tagCloudContainer'>";
     print T_sprintf("New version of Tiny Tiny RSS is available (%s).", "<b>{$version}</b>");
     print "</div>";
     $details = "http://tt-rss.org/redmine/versions/show/{$id}";
     $download = "http://tt-rss.org/#Download";
     print "<p align='center'>" . __("You can update using built-in updater in the Preferences or by using update.php") . "</p>";
     print "<div style='text-align : center'>";
     print "<button dojoType=\"dijit.form.Button\"\n\t\t\tonclick=\"return window.open('{$details}')\">" . __("Details") . "</button>";
     print "<button dojoType=\"dijit.form.Button\"\n\t\t\tonclick=\"return window.open('{$download}')\">" . __("Download") . "</button>";
     print "<button dojoType=\"dijit.form.Button\"\n\t\t\tonclick=\"return dijit.byId('newVersionDlg').hide()\">" . __('Close this window') . "</button>";
     print "</div>";
 }
开发者ID:nvdnkpr,项目名称:Tiny-Tiny-RSS,代码行数:17,代码来源:dlg.php

示例5: hook_prefs_tab

 function hook_prefs_tab($args)
 {
     if ($args != "prefPrefs") {
         return;
     }
     if (($_SESSION["access_level"] >= 10 || SINGLE_USER_MODE) && CHECK_FOR_NEW_VERSION) {
         print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"" . __('Update Tiny Tiny RSS') . "\">";
         if ($_SESSION["pref_last_version_check"] + 86400 + rand(-1000, 1000) < time()) {
             $_SESSION["version_data"] = @check_for_update($this->link);
             $_SESSION["pref_last_version_check"] = time();
         }
         if (is_array($_SESSION["version_data"])) {
             $version = $_SESSION["version_data"]["version"];
             print_notice(T_sprintf("New version of Tiny Tiny RSS is available (%s).", "<b>{$version}</b>"));
             print "<p><button dojoType=\"dijit.form.Button\" onclick=\"return updateSelf()\">" . __('Update Tiny Tiny RSS') . "</button></p>";
         } else {
             print_notice(__("Your Tiny Tiny RSS installation is up to date."));
         }
         print "</div>";
         #pane
     }
     function updateSelf()
     {
         print "<form style='display : block' name='self_update_form' id='self_update_form'>";
         print "<div class='error'>" . __("Do not close this dialog until updating is finished. Backup your tt-rss directory before continuing.") . "</div>";
         print "<ul class='selfUpdateList' id='self_update_log'>";
         print "<li>" . __("Ready to update.") . "</li>";
         print "</ul>";
         print "<div class='dlgButtons'>";
         print "<button id=\"self_update_start_btn\" dojoType=\"dijit.form.Button\" onclick=\"return dijit.byId('updateSelfDlg').start()\" >" . __("Start update") . "</button>";
         print "<button id=\"self_update_stop_btn\" onclick=\"return dijit.byId('updateSelfDlg').close()\" dojoType=\"dijit.form.Button\">" . __("Close this window") . "</button>";
         print "</div>";
         print "</form>";
     }
     function performUpdate()
     {
         $step = (int) $_REQUEST["step"];
         $params = json_decode($_REQUEST["params"], true);
         $force = (bool) $_REQUEST["force"];
         if (($_SESSION["access_level"] >= 10 || SINGLE_USER_MODE) && CHECK_FOR_NEW_VERSION) {
             print json_encode($this->update_self_step($this->link, $step, $params, $force));
         }
     }
 }
开发者ID:bohoo,项目名称:tiny_tiny_rss-openshift-quickstart-1,代码行数:44,代码来源:init.php

示例6: module_popup_dialog


//.........这里部分代码省略.........
        print "<div class=\"tagCloudContainer\">";
        print "<a id='pub_feed_url' href='{$url_path}' target='_blank'>{$url_path}</a>";
        print "</div>";
        print "<div align='center'>";
        print "<button onclick=\"return pubRegenKey()\">" . __('Generate new URL') . "</button> ";
        print "<input class=\"button\"\n\t\t\t\ttype=\"submit\" onclick=\"return closeInfoBox()\" \n\t\t\t\tvalue=\"" . __('Close this window') . "\">";
        print "</div></div>";
        return;
    }
    if ($id == "pubOPMLUrl") {
        print "<div id=\"infoBoxTitle\">" . __('Public OPML URL') . "</div>";
        print "<div class=\"infoBoxContents\">";
        $url_path = opml_publish_url($link);
        print __("Your Public OPML URL is:");
        print "<div class=\"tagCloudContainer\">";
        print "<a id='pub_opml_url' href='{$url_path}' target='_blank'>{$url_path}</a>";
        print "</div>";
        print "<div align='center'>";
        print "<button onclick=\"return opmlRegenKey()\">" . __('Generate new URL') . "</button> ";
        print "<input class=\"button\"\n\t\t\t\ttype=\"submit\" onclick=\"return closeInfoBox()\" \n\t\t\t\tvalue=\"" . __('Close this window') . "\">";
        print "</div></div>";
        return;
    }
    if ($id == "explainError") {
        print "<div id=\"infoBoxTitle\">" . __('Notice') . "</div>";
        print "<div class=\"infoBoxContents\">";
        print "<div class=\"errorExplained\">";
        if ($param == 1) {
            print __("Update daemon is enabled in configuration, but daemon process is not running, which prevents all feeds from updating. Please start the daemon process or contact instance owner.");
            $stamp = (int) read_stampfile("update_daemon.stamp");
            print "<p>" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp);
        }
        if ($param == 2) {
            $msg = check_for_update($link);
            if (!$msg) {
                print __("You are running the latest version of Tiny Tiny RSS. The fact that you are seeing this dialog is probably a bug.");
            } else {
                print $msg;
            }
        }
        if ($param == 3) {
            print __("Update daemon is taking too long to perform a feed update. This could indicate a problem like crash or a hang. Please check the daemon process or contact instance owner.");
            $stamp = (int) read_stampfile("update_daemon.stamp");
            print "<p>" . __("Last update:") . " " . date("Y.m.d, G:i", $stamp);
        }
        print "</div>";
        print "<div align='center'>";
        print "<input class=\"button\"\n\t\t\t\ttype=\"submit\" onclick=\"return closeInfoBox()\" \n\t\t\t\tvalue=\"" . __('Close this window') . "\">";
        print "</div></div>";
        return;
    }
    if ($id == "quickAddFeed") {
        print "<div id=\"infoBoxTitle\">" . __('Subscribe to Feed') . "</div>";
        print "<div class=\"infoBoxContents\">";
        print "<form id='feed_add_form' onsubmit='return false'>";
        print "<input type=\"hidden\" name=\"op\" value=\"rpc\">";
        print "<input type=\"hidden\" name=\"subop\" value=\"addfeed\">";
        //print "<input type=\"hidden\" name=\"from\" value=\"tt-rss\">";
        print "<div class=\"dlgSec\">" . __("Feed") . "</div>";
        print "<div class=\"dlgSecCont\">";
        print __("URL:") . " ";
        print "<input size=\"40\"\n\t\t\t\t\tonkeypress=\"return filterCR(event, subscribeToFeed)\"\n\t\t\t\t\tname=\"feed\" id=\"feed_url\"></td></tr>";
        print "<br/>";
        if (get_pref($link, 'ENABLE_FEED_CATS')) {
            print __('Place in category:') . " ";
            print_feed_cat_select($link, "cat");
开发者ID:buggithubs,项目名称:Tiny-Tiny-RSS,代码行数:67,代码来源:popup-dialog.php

示例7: get_songs_path

    // of $_FILES.
    $upload_dir = get_songs_path();
    $upload_file = $upload_dir . basename($_FILES['file']['name']);
    $upload_success;
    if (move_uploaded_file($_FILES['file']['tmp_name'], $upload_file)) {
        $upload_success = 1;
    } else {
        $upload_success = 0;
    }
}
$songlist_struct = scan_songs();
$songlist_struct_original = $songlist_struct;
$prefs_struct = get_opentape_prefs();
// 604800 = week in seconds
if ((!isset($prefs_struct['check_updates']) || $prefs_struct['check_updates'] == 1) && (!isset($prefs_struct['last_update_check']) || time() - $prefs_struct['last_update_check'] > 604800)) {
    $prefs_struct = check_for_update();
    if ($prefs_struct === false) {
        header("Location: " . $REL_PATH . "code/warning.php");
    }
}
if (isset($prefs_struct['announce']) && $prefs_struct['announce'] == 1 && !isset($prefs_struct['last_announce_songs'])) {
    announce_songs($songlist_struct);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title>Opentape / Edit Mixtape</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link rel="stylesheet" type="text/css" href="<?php 
echo $REL_PATH;
开发者ID:scottatron,项目名称:opentape,代码行数:31,代码来源:edit.php

示例8: module_popup_dialog


//.........这里部分代码省略.........
        print "</td></tr><tr><td>";
        print __('Subject:');
        print "</td><td>";
        print "<input dojoType=\"dijit.form.ValidationTextBox\" required=\"true\"\n\t\t\t\t\tstyle=\"width : 30em;\"\n\t\t\t\t\tname=\"subject\" value=\"{$subject}\" id=\"subject\">";
        print "</td></tr>";
        print "<tr><td colspan='2'><textarea dojoType=\"dijit.form.SimpleTextarea\" style='font-size : 12px; width : 100%' rows=\"20\"\n\t\t\t\tname='content'>{$content}</textarea>";
        print "</td></tr></table>";
        print "<div class='dlgButtons'>";
        print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('emailArticleDlg').execute()\">" . __('Send e-mail') . "</button> ";
        print "<button dojoType=\"dijit.form.Button\" onclick=\"dijit.byId('emailArticleDlg').hide()\">" . __('Cancel') . "</button>";
        print "</div>";
        //return;
    }
    if ($id == "generatedFeed") {
        print "<title>" . __('View as RSS') . "</title>";
        print "<content><![CDATA[";
        $params = explode(":", $param, 3);
        $feed_id = db_escape_string($params[0]);
        $is_cat = (bool) $params[1];
        $key = get_feed_access_key($link, $feed_id, $is_cat);
        $url_path = htmlspecialchars($params[2]) . "&key=" . $key;
        print __("You can view this feed as RSS using the following URL:");
        print "<div class=\"tagCloudContainer\">";
        print "<a id='gen_feed_url' href='{$url_path}' target='_blank'>{$url_path}</a>";
        print "</div>";
        print "<div align='center'>";
        print "<button dojoType=\"dijit.form.Button\" onclick=\"return genUrlChangeKey('{$feed_id}', '{$is_cat}')\">" . __('Generate new URL') . "</button> ";
        print "<button dojoType=\"dijit.form.Button\" onclick=\"return closeInfoBox()\">" . __('Close this window') . "</button>";
        print "</div>";
        print "]]></content>";
        //return;
    }
    if ($id == "newVersion") {
        $version_data = check_for_update($link);
        $version = $version_data['version'];
        $id = $version_data['version_id'];
        print "<div class='tagCloudContainer'>";
        print T_sprintf("New version of Tiny Tiny RSS is available (%s).", "<b>{$version}</b>");
        print "</div>";
        $details = "http://tt-rss.org/redmine/versions/show/{$id}";
        $download = "http://tt-rss.org/#Download";
        print "<div style='text-align : center'>";
        print "<button dojoType=\"dijit.form.Button\"\n\t\t\t\tonclick=\"return window.open('{$details}')\">" . __("Details") . "</button>";
        print "<button dojoType=\"dijit.form.Button\"\n\t\t\t\tonclick=\"return window.open('{$download}')\">" . __("Download") . "</button>";
        print "<button dojoType=\"dijit.form.Button\"\n\t\t\t\tonclick=\"return dijit.byId('newVersionDlg').hide()\">" . __('Close this window') . "</button>";
        print "</div>";
    }
    if ($id == "customizeCSS") {
        $value = get_pref($link, "USER_STYLESHEET");
        $value = str_replace("<br/>", "\n", $value);
        print T_sprintf("You can override colors, fonts and layout of your currently selected theme with custom CSS declarations here. <a target=\"_blank\" class=\"visibleLink\" href=\"%s\">This file</a> can be used as a baseline.", "tt-rss.css");
        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"subop\" value=\"setpref\">";
        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"key\" value=\"USER_STYLESHEET\">";
        print "<table width='100%'><tr><td>";
        print "<textarea dojoType=\"dijit.form.SimpleTextarea\"\n\t\t\t\tstyle='font-size : 12px; width : 100%; height: 200px;'\n\t\t\t\tplaceHolder='body#ttrssMain { font-size : 14px; };'\n\t\t\t\tname='value'>{$value}</textarea>";
        print "</td></tr></table>";
        print "<div class='dlgButtons'>";
        print "<button dojoType=\"dijit.form.Button\"\n\t\t\t\tonclick=\"dijit.byId('cssEditDlg').execute()\">" . __('Save') . "</button> ";
        print "<button dojoType=\"dijit.form.Button\"\n\t\t\t\tonclick=\"dijit.byId('cssEditDlg').hide()\">" . __('Cancel') . "</button>";
        print "</div>";
    }
    if ($id == "editArticleNote") {
        $result = db_query($link, "SELECT note FROM ttrss_user_entries WHERE\n\t\t\t\tref_id = '{$param}' AND owner_uid = " . $_SESSION['uid']);
        $note = db_fetch_result($result, 0, "note");
        print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"id\" value=\"{$param}\">";
开发者ID:nougad,项目名称:Tiny-Tiny-RSS,代码行数:67,代码来源:popup-dialog.php

示例9: make_runtime_info

function make_runtime_info()
{
    $data = array();
    $result = db_query("SELECT MAX(id) AS mid, COUNT(*) AS nf FROM\n\t\t\tttrss_feeds WHERE owner_uid = " . $_SESSION["uid"]);
    $max_feed_id = db_fetch_result($result, 0, "mid");
    $num_feeds = db_fetch_result($result, 0, "nf");
    $data["max_feed_id"] = (int) $max_feed_id;
    $data["num_feeds"] = (int) $num_feeds;
    $data['last_article_id'] = getLastArticleId();
    $data['cdm_expanded'] = get_pref('CDM_EXPANDED');
    $data['dep_ts'] = calculate_dep_timestamp();
    $data['reload_on_ts_change'] = !defined('_NO_RELOAD_ON_TS_CHANGE');
    if (CHECK_FOR_UPDATES && $_SESSION["last_version_check"] + 86400 + rand(-1000, 1000) < time()) {
        $update_result = @check_for_update();
        $data["update_result"] = $update_result;
        $_SESSION["last_version_check"] = time();
    }
    if (file_exists(LOCK_DIRECTORY . "/update_daemon.lock")) {
        $data['daemon_is_running'] = (int) file_is_locked("update_daemon.lock");
        if (time() - $_SESSION["daemon_stamp_check"] > 30) {
            $stamp = (int) @file_get_contents(LOCK_DIRECTORY . "/update_daemon.stamp");
            if ($stamp) {
                $stamp_delta = time() - $stamp;
                if ($stamp_delta > 1800) {
                    $stamp_check = 0;
                } else {
                    $stamp_check = 1;
                    $_SESSION["daemon_stamp_check"] = time();
                }
                $data['daemon_stamp_ok'] = $stamp_check;
                $stamp_fmt = date("Y.m.d, G:i", $stamp);
                $data['daemon_stamp'] = $stamp_fmt;
            }
        }
    }
    return $data;
}
开发者ID:Verisor,项目名称:tt-rss,代码行数:37,代码来源:functions2.php

示例10: hook_prefs_tab

 function hook_prefs_tab($args)
 {
     if ($args != "prefPrefs") {
         return;
     }
     if (($_SESSION["access_level"] >= 10 || SINGLE_USER_MODE) && CHECK_FOR_NEW_VERSION) {
         print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"" . __('Update Tiny Tiny RSS') . "\">";
         if ($_SESSION["pref_last_version_check"] + 86400 + rand(-1000, 1000) < time()) {
             $_SESSION["version_data"] = @check_for_update();
             $_SESSION["pref_last_version_check"] = time();
         }
         if (is_array($_SESSION["version_data"])) {
             $version = $_SESSION["version_data"]["version"];
             $version_id = $_SESSION["version_data"]["version_id"];
             print_notice(T_sprintf("New version of Tiny Tiny RSS is available (%s).", "<b>{$version}</b>"));
             $details = "http://tt-rss.org/redmine/versions/{$version_id}";
             print "<p><button onclick=\"window.open('{$details}')\" dojoType=\"dijit.form.Button\">" . __("See the release notes") . "</button>";
             print " <button dojoType=\"dijit.form.Button\" onclick=\"return updateSelf()\">" . __('Update Tiny Tiny RSS') . "</button></p>";
         } else {
             print_notice(__("Your Tiny Tiny RSS installation is up to date."));
         }
         print "</div>";
         #pane
     }
 }
开发者ID:cs-team,项目名称:tiny_tiny_rss-openshift-quickstart,代码行数:25,代码来源:init.php

示例11: index


//.........这里部分代码省略.........
             $timezones = explode("\n", file_get_contents("lib/timezones.txt"));
             print_select($pref_name, $value, $timezones, 'dojoType="dijit.form.FilteringSelect"');
         } else {
             if ($pref_name == "USER_STYLESHEET") {
                 print "<button dojoType=\"dijit.form.Button\"\n\t\t\t\t\tonclick=\"customizeCSS()\">" . __('Customize') . "</button>";
             } else {
                 if ($pref_name == "DEFAULT_ARTICLE_LIMIT") {
                     $limits = array(15, 30, 45, 60);
                     print_select($pref_name, $value, $limits, 'dojoType="dijit.form.Select"');
                 } else {
                     if ($pref_name == "DEFAULT_UPDATE_INTERVAL") {
                         global $update_intervals_nodefault;
                         print_select_hash($pref_name, $value, $update_intervals_nodefault, 'dojoType="dijit.form.Select"');
                     } else {
                         if ($type_name == "bool") {
                             if ($value == "true") {
                                 $value = __("Yes");
                             } else {
                                 $value = __("No");
                             }
                             if ($pref_name == "PURGE_UNREAD_ARTICLES" && FORCE_ARTICLE_PURGE != 0) {
                                 $disabled = "disabled=\"1\"";
                                 $value = __("Yes");
                             } else {
                                 $disabled = "";
                             }
                             print_radio($pref_name, $value, __("Yes"), array(__("Yes"), __("No")), $disabled);
                         } else {
                             if (array_search($pref_name, array('FRESH_ARTICLE_MAX_AGE', 'DEFAULT_ARTICLE_LIMIT', 'PURGE_OLD_DAYS', 'LONG_DATE_FORMAT', 'SHORT_DATE_FORMAT')) !== false) {
                                 $regexp = $type_name == 'integer' ? 'regexp="^\\d*$"' : '';
                                 if ($pref_name == "PURGE_OLD_DAYS" && FORCE_ARTICLE_PURGE != 0) {
                                     $disabled = "disabled=\"1\"";
                                     $value = FORCE_ARTICLE_PURGE;
                                 } else {
                                     $disabled = "";
                                 }
                                 print "<input dojoType=\"dijit.form.ValidationTextBox\"\n\t\t\t\t\trequired=\"1\" {$regexp} {$disabled}\n\t\t\t\t\tname=\"{$pref_name}\" value=\"{$value}\">";
                             } else {
                                 if ($pref_name == "SSL_CERT_SERIAL") {
                                     print "<input dojoType=\"dijit.form.ValidationTextBox\"\n\t\t\t\t\tid=\"SSL_CERT_SERIAL\" readonly=\"1\"\n\t\t\t\t\tname=\"{$pref_name}\" value=\"{$value}\">";
                                     $cert_serial = htmlspecialchars(get_ssl_certificate_id());
                                     $has_serial = $cert_serial ? "false" : "true";
                                     print " <button dojoType=\"dijit.form.Button\" disabled=\"{$has_serial}\"\n\t\t\t\t\tonclick=\"insertSSLserial('{$cert_serial}')\">" . __('Register') . "</button>";
                                     print " <button dojoType=\"dijit.form.Button\"\n\t\t\t\t\tonclick=\"insertSSLserial('')\">" . __('Clear') . "</button>";
                                 } else {
                                     if ($pref_name == 'DIGEST_PREFERRED_TIME') {
                                         print "<input dojoType=\"dijit.form.ValidationTextBox\"\n\t\t\t\t\tid=\"{$pref_name}\" regexp=\"[012]?\\d:\\d\\d\" placeHolder=\"12:00\"\n\t\t\t\t\tname=\"{$pref_name}\" value=\"{$value}\"><div class=\"insensitive\">" . T_sprintf("Current server time: %s (UTC)", date("H:i")) . "</div>";
                                     } else {
                                         $regexp = $type_name == 'integer' ? 'regexp="^\\d*$"' : '';
                                         print "<input dojoType=\"dijit.form.ValidationTextBox\"\n\t\t\t\t\t{$regexp}\n\t\t\t\t\tname=\"{$pref_name}\" value=\"{$value}\">";
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         print "</td>";
         print "</tr>";
         $lnum++;
     }
     print "</table>";
     print '</div>';
     # inside pane
     print '<div dojoType="dijit.layout.ContentPane" region="bottom">';
     print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pref-prefs\">";
     print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"saveconfig\">";
     print "<button dojoType=\"dijit.form.Button\" type=\"submit\">" . __('Save configuration') . "</button> ";
     print "<button dojoType=\"dijit.form.Button\" onclick=\"return editProfiles()\">" . __('Manage profiles') . "</button> ";
     print "<button dojoType=\"dijit.form.Button\" onclick=\"return validatePrefsReset()\">" . __('Reset to defaults') . "</button>";
     print "&nbsp;";
     $checked = $_SESSION["prefs_show_advanced"] ? "checked='1'" : "";
     print "<input onclick='toggleAdvancedPrefs()'\n\t\t\t\tid='prefs_show_advanced'\n\t\t\t\tdojoType=\"dijit.form.CheckBox\"\n\t\t\t\t{$checked}\n\t\t\t\ttype=\"checkbox\"></input>\n\t\t\t\t<label for='prefs_show_advanced'>" . __("Show additional preferences") . "</label>";
     print '</div>';
     # inner pane
     print '</div>';
     # border container
     print "</form>";
     print "</div>";
     #pane
     if (($_SESSION["access_level"] >= 10 || SINGLE_USER_MODE) && CHECK_FOR_NEW_VERSION) {
         print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"" . __('Update Tiny Tiny RSS') . "\">";
         if ($_SESSION["pref_last_version_check"] + 86400 + rand(-1000, 1000) < time()) {
             $_SESSION["version_data"] = @check_for_update($this->link);
             $_SESSION["pref_last_version_check"] = time();
         }
         if (is_array($_SESSION["version_data"])) {
             $version = $_SESSION["version_data"]["version"];
             print_notice(T_sprintf("New version of Tiny Tiny RSS is available (%s).", "<b>{$version}</b>"));
             print "<p><button dojoType=\"dijit.form.Button\" onclick=\"return updateSelf()\">" . __('Update Tiny Tiny RSS') . "</button></p>";
         } else {
             print_notice(__("Your Tiny Tiny RSS installation is up to date."));
         }
         print "</div>";
         #pane
     }
     print "</div>";
     #container
 }
开发者ID:nvdnkpr,项目名称:Tiny-Tiny-RSS,代码行数:101,代码来源:prefs.php


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