• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_site_config函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: crypto_curl_init

/**
 * Extends {@link #curl_init()} to also set {@code CURLOPT_TIMEOUT}
 * and {@code CURLOPT_CONNECTTIMEOUT} appropriately.
 */
function crypto_curl_init()
{
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_TIMEOUT, get_site_config('get_contents_timeout'));
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, get_site_config('get_contents_timeout'));
    return $ch;
}
开发者ID:phpsource,项目名称:openclerk,代码行数:11,代码来源:_batch.php


示例2: getPackageJsonVersion

 function getPackageJsonVersion()
 {
     $version = get_site_config('openclerk_version');
     if (!preg_match("#^[0-9]+\\.[0-9]+\\.[0-9]+\$#", $version)) {
         $version = $version . ".0";
     }
     return $version;
 }
开发者ID:phpsource,项目名称:openclerk,代码行数:8,代码来源:GenerateVersionTest.php


示例3: isJobsDisabled

 function isJobsDisabled(Logger $logger)
 {
     if (!get_site_config('jobs_enabled')) {
         $logger->info("Running jobs is disabled");
         return true;
     }
     return false;
 }
开发者ID:phpsource,项目名称:openclerk,代码行数:8,代码来源:OpenclerkJobRunner.php


示例4: findJob

 /**
  * Find a job that belongs to the system user.
  */
 function findJob(Connection $db, Logger $logger)
 {
     if ($this->isJobsDisabled($logger)) {
         return false;
     }
     $q = $db->prepare("SELECT * FROM jobs WHERE user_id = ? AND " . $this->defaultFindJobQuery() . " LIMIT 1");
     $q->execute(array(get_site_config('system_user_id')));
     return $q->fetch();
 }
开发者ID:phpsource,项目名称:openclerk,代码行数:12,代码来源:batch_run_system.php


示例5: crypto_address

/**
 * Return a HTML link for inspecting a given cryptocurrency address.
 */
function crypto_address($currency, $address)
{
    foreach (\DiscoveredComponents\Currencies::getAddressCurrencies() as $cur) {
        if ($cur === $currency) {
            $instance = \DiscoveredComponents\Currencies::getInstance($cur);
            return "<span class=\"address " . $currency . "_address\"><code>" . htmlspecialchars($address) . "</code>\n        <a class=\"inspect\" href=\"" . htmlspecialchars($instance->getBalanceURL($address)) . "\" title=\"Inspect with " . htmlspecialchars($instance->getExplorerName()) . "\">?</a>\n      </span>";
        }
    }
    foreach (get_blockchain_currencies() as $explorer => $currencies) {
        foreach ($currencies as $cur) {
            if ($cur == $currency) {
                return "<span class=\"address " . $currency . "_address\"><code>" . htmlspecialchars($address) . "</code>\n          <a class=\"inspect\" href=\"" . htmlspecialchars(sprintf(get_site_config($currency . "_address_url"), $address)) . "\" title=\"Inspect with " . htmlspecialchars($explorer) . "\">?</a>\n        </span>";
            }
        }
    }
    return htmlspecialchars($address);
}
开发者ID:phpsource,项目名称:openclerk,代码行数:20,代码来源:templates.php


示例6: check_heavy_request

/**
 * We're about to perform a computationally intense task that is visible
 * or accessible to the public - this method will check the current user
 * IP and make sure this IP isn't requesting too many things at once.
 *
 * If login does not work, make sure that you have set database_timezone
 * correctly.
 */
function check_heavy_request()
{
    if (get_site_config("heavy_requests_seconds") >= 0) {
        $q = db()->prepare("SELECT * FROM heavy_requests WHERE user_ip=?");
        $q->execute(array(user_ip()));
        if ($heavy = $q->fetch()) {
            // too many requests?
            // assumes the database and server times are in sync
            if (strtotime($heavy['last_request']) > strtotime("-" . get_site_config("heavy_requests_seconds") . " seconds")) {
                throw new BlockedException(t("You are making too many requests at once: please wait at least :seconds.", array(':seconds' => plural("second", get_site_config("heavy_requests_seconds")))));
            } else {
                // update database
                $q = db()->prepare("UPDATE heavy_requests SET last_request=NOW() WHERE user_ip=?");
                $q->execute(array(user_ip()));
            }
        } else {
            // insert into database
            $q = db()->prepare("INSERT INTO heavy_requests SET last_request=NOW(), user_ip=?");
            $q->execute(array(user_ip()));
        }
    }
}
开发者ID:phpsource,项目名称:openclerk,代码行数:30,代码来源:heavy.php


示例7: findJobs

 /**
  * Get a list of all jobs that need to be queued, as an array of associative
  * arrays with (job_type, arg_id, [user_id]).
  *
  * This could use e.g. {@link JobTypeFinder}
  */
 function findJobs(Connection $db, Logger $logger)
 {
     $logger->info("Creating temporary table");
     $q = $db->prepare("CREATE TABLE temp (\n        created_at_day INT NOT NULL,\n        INDEX(created_at_day)\n      )");
     $q->execute();
     $logger->info("Inserting into temporary table");
     $q = $db->prepare("INSERT INTO temp (SELECT created_at_day FROM ticker WHERE exchange = 'average' GROUP BY created_at_day)");
     $q->execute();
     $logger->info("Querying");
     $q = $db->prepare("SELECT created_at_day, min(created_at) as date, count(*) as c\n        FROM ticker\n        WHERE exchange <> 'average' AND exchange <> 'themoneyconverter' and is_daily_data=1 and created_at_day not in (SELECT created_at_day FROM temp)\n        GROUP BY created_at_day");
     $q->execute();
     $missing = $q->fetchAll();
     $logger->info("Dropping temporary table");
     $q = $db->prepare("DROP TABLE temp");
     $q->execute();
     $logger->info("Found " . number_format(count($missing)) . " days of missing average data");
     $result = array();
     foreach ($missing as $row) {
         $logger->info("Average data for " . $row['date'] . " can be reconstructed from " . number_format($row['c']) . " ticker instances");
         $result[] = array('job_type' => 'missing_average', 'arg_id' => $row['created_at_day'], 'user_id' => get_site_config('system_user_id'));
     }
     return $result;
 }
开发者ID:phpsource,项目名称:openclerk,代码行数:29,代码来源:missing_average_find.php


示例8: getTitle

    }
    function getTitle()
    {
        return $this->title;
    }
    function load()
    {
        require __DIR__ . "/../locale/" . $this->key . ".php";
        return $result;
    }
}
$locales = array('de' => 'German', 'fr' => 'French', 'jp' => 'Japanese', 'ru' => 'Russian', 'zh' => 'Chinese');
foreach ($locales as $locale => $title) {
    I18n::addAvailableLocale(new GenericLocale($locale, $title));
}
I18n::addDefaultKeys(array(':site_name' => get_site_config('site_name')));
// set locale as necessary
if (isset($_COOKIE["locale"]) && in_array($_COOKIE["locale"], array_keys(I18n::getAvailableLocales()))) {
    I18n::setLocale($_COOKIE["locale"]);
}
\Openclerk\Events::on('i18n_missing_string', function ($data) {
    $locale = $data['locale'];
    $key = $data['key'];
    log_uncaught_exception(new LocaleException("Locale '{$locale}': Missing key '{$key}'"));
});
/**
 * Helper function to mark strings that need to be translated on the client-side.
 */
function ct($s)
{
    // do not do any translation here - we have to do it on the client side!
开发者ID:phpsource,项目名称:openclerk,代码行数:31,代码来源:i18n.php


示例9: t

?>
</h1>

<?php 
if (user_logged_in() && ($user = get_user(user_id()))) {
    if ($user['is_premium']) {
        ?>
	<div class="success success_float">
		<?php 
        echo t("Thank you for supporting :site_name with :premium!", array(':premium' => link_to(url_for('user#user_premium'), ht("your premium account"))));
        ?>
		<br>
		<?php 
        echo t("Your premium account expires in :time.", array(":time" => recent_format_html($user['premium_expires'], " ago", "")));
        ?>
	</div>
<?php 
    }
}
?>

<p>
	<?php 
$result = array();
foreach (get_site_config('premium_currencies') as $currency) {
    $result[] = get_currency_name($currency);
}
echo t("You can support :site_name by purchasing a\n\tpremium account with :currencies currencies. You will also get access to exclusive, premium-only functionality such as\n\tvastly increased limits on the number of addresses and accounts you may track at once,\n\tand advanced reporting and notification functionality. Your jobs and reports will also have higher priority over free users.", array(":currencies" => implode_english($result)));
?>
</p>
开发者ID:phpsource,项目名称:openclerk,代码行数:30,代码来源:premium.php


示例10: has_expected_user_graph_hash

function has_expected_user_graph_hash($hash, $user)
{
    $q = db()->prepare("SELECT * FROM user_valid_keys WHERE user_id=?");
    $q->execute(array($user['id']));
    while ($key = $q->fetch()) {
        if ($hash === md5(get_site_config('user_graph_hash_salt') . ":" . $user['id'] . ":" . $key['user_key'])) {
            return true;
        }
    }
    return false;
}
开发者ID:phpsource,项目名称:openclerk,代码行数:11,代码来源:new.php


示例11: define

 * This always executes (no job framework) so it should be used sparingly or as necessary.
 *
 * Arguments (in command line, use "-" for no argument):
 *   $key/1 required the automated key
 */
define('USE_MASTER_DB', true);
// always use the master database for selects!
require __DIR__ . "/../inc/global.php";
require __DIR__ . "/_batch.php";
require_batch_key();
batch_header("Batch cleanup balances", "batch_cleanup_balances");
crypto_log("Current time: " . date('r'));
// find all ticker data that needs to be inserted into the graph_data table
// TODO currently all database dates and PHP logic is based on server side timezone, not GMT/UTC
// database values need to all be modified to GMT before we can add '+00:00' for example
$cutoff_date = date('Y-m-d', strtotime(get_site_config('archive_balances_data'))) . ' 23:59:59';
// +00:00';
$summary_date_prefix = " 00:00:00";
// +00:00
crypto_log("Cleaning up balances data earlier than " . htmlspecialchars($cutoff_date) . " into summaries...");
$q = db_master()->prepare("SELECT * FROM balances WHERE created_at <= :date ORDER BY created_at ASC");
$q->execute(array("date" => $cutoff_date));
// we're going to store this all in memory, because at least that way we don't have to
// execute logic twice
$stored = array();
$count = 0;
while ($balance = $q->fetch()) {
    $count++;
    if ($count % 100 == 0) {
        crypto_log("Processed " . number_format($count) . "...");
    }
开发者ID:phpsource,项目名称:openclerk,代码行数:31,代码来源:batch_cleanup_balances.php


示例12: htmlspecialchars

<div class="instructions_safe">
<h2>Is it safe to provide <?php 
echo htmlspecialchars(get_site_config('site_name'));
?>
 a <?php 
echo $account_data['exchange_name'];
?>
 API key?</h2>

<ul>
	<li>At the time of writing, a <?php 
echo $account_data['exchange_name'];
?>
 API key can only be used to retrieve account balances and worker status;
		it should not be possible to perform transactions or change user details using the API key.</li>

	<li>Your <?php 
echo $account_data['exchange_name'];
?>
 API keys will <i>never</i> be displayed on the <?php 
echo htmlspecialchars(get_site_config('site_name'));
?>
		site, even if you have logged in.</li>

	<li>At the time of writing, it is not possible to change or reset your <?php 
echo $account_data['exchange_name'];
?>
 API key.</li>
</ul>
</div>
开发者ID:phpsource,项目名称:openclerk,代码行数:30,代码来源:inline_accounts_litecoinpool.php


示例13: foreach

foreach ($coins as $coin) {
    ?>
  <tr class="<?php 
    echo in_array($coin['id'], $my_coins) ? "voted-coin" : "";
    ?>
">
    <td class=""><?php 
    echo htmlspecialchars($coin['code']);
    ?>
</td>
    <td class=""><?php 
    echo htmlspecialchars($coin['title']);
    ?>
</td>
    <td class="number"><?php 
    echo number_format($coin['total_votes'] * get_site_config('vote_coins_multiplier'));
    ?>
</td>
    <td class="number"><?php 
    echo number_format($coin['total_users']);
    ?>
</td>
    <?php 
    if (user_logged_in()) {
        ?>
    <td class="buttons">
      <input type="checkbox" name="coins[]" value="<?php 
        echo htmlspecialchars($coin['id']);
        ?>
"<?php 
        echo in_array($coin['id'], $my_coins) ? " checked " : "";
开发者ID:phpsource,项目名称:openclerk,代码行数:31,代码来源:vote_coins.php


示例14: get_html_premium_prices

/**
 * @return a HTML string that can be used in an e-mail, listing all prices
 */
function get_html_premium_prices()
{
    $prices = array();
    foreach (get_site_config('premium_currencies') as $currency) {
        $prices[] = "  " . get_currency_abbr($currency) . ": " . number_format_autoprecision(get_premium_price($currency, 'monthly')) . " " . get_currency_abbr($currency) . "/month, or " . number_format_autoprecision(get_premium_price($currency, 'yearly')) . " " . get_currency_abbr($currency) . "/year" . (get_site_config('premium_' . $currency . '_discount') ? " (" . (int) (get_site_config('premium_' . $currency . '_discount') * 100) . "% off)" : "");
    }
    return implode("<br>\n", $prices);
}
开发者ID:phpsource,项目名称:openclerk,代码行数:11,代码来源:premium.php


示例15: require_get

<?php

$email = require_get("email", false);
$hash = require_get("hash", false);
// check hash
if ($hash !== md5(get_site_config('unsubscribe_salt') . $email)) {
    throw new Exception(t("Invalid hash - please recheck the link in your e-mail."));
}
// if any accounts have a password enabled, they simply cannot unsubscribe until they have at least one
// openid identity
$q = db()->prepare("SELECT * FROM users WHERE email=?");
$q->execute(array($email));
$users = $q->fetchAll();
$has_identity = false;
foreach ($users as $user) {
    $q = db()->prepare("SELECT * FROM user_passwords WHERE user_id=?");
    $q->execute(array($user['id']));
    $password_hash = $q->fetch();
    if ($password_hash) {
        $q = db()->prepare("SELECT * FROM user_openid_identities WHERE user_id=? LIMIT 1");
        $q->execute(array($user['id']));
        $has_identity = $q->fetch();
        $q = db()->prepare("SELECT * FROM user_oauth2_identities WHERE user_id=? LIMIT 1");
        $q->execute(array($user['id']));
        $has_oauth2 = $q->fetch();
        if (!$has_identity || !$has_oauth2) {
            require __DIR__ . "/../layout/templates.php";
            page_header(t("Unsubscribe unsuccessful"), "page_unsubscribe");
            ?>
      <h1><?php 
            echo ht("Unsubscribe unsuccessful");
开发者ID:phpsource,项目名称:openclerk,代码行数:31,代码来源:unsubscribe.php


示例16: htmlspecialchars

  <div class="link">
    <a href="https://groups.google.com/group/<?php 
echo htmlspecialchars(get_site_config('google_groups_announce'));
?>
" target="_blank"><img width="132" alt="Google Groups"
    src="https://groups.google.com/groups/img/3nb/groups_bar.gif" height="26"></a>
    <a href="https://groups.google.com/group/<?php 
echo htmlspecialchars(get_site_config('google_groups_announce'));
?>
" target="_blank" class="visit"><?php 
echo ht("Visit this group");
?>
</a>
  </div>
  <form action="https://groups.google.com/group/<?php 
echo htmlspecialchars(get_site_config('google_groups_announce'));
?>
/boxsubscribe" target="_blank">
  <label class="email"><?php 
echo ht("E-mail:");
?>
  <input name="email" type="text" size="32" value="<?php 
echo htmlspecialchars($user['email']);
?>
" /></label>
  <input value="<?php 
echo ht("Subscribe");
?>
" name="sub" type="submit" />
  </form>
</div>
开发者ID:phpsource,项目名称:openclerk,代码行数:31,代码来源:user.php


示例17: graph_technical_types

     // make sure that we don't add technicals that are premium only
     $graph_technical_types = graph_technical_types();
     if (!isset($graph_technical_types[$technical])) {
         $errors[] = "Could not add technical type '" . htmlspecialchars($technical) . "' - no such technical type.";
     } else {
         if ($graph_technical_types[$technical]['premium'] && !$user['is_premium']) {
             $errors[] = "Could not add technical type '" . htmlspecialchars($graph_technical_types[$technical]['title']) . "' - requires a <a href=\"" . htmlspecialchars(url_for('premium')) . "\">premium account</a>.";
         } else {
             // it's OK
             // delete any existing technicals (even if we're inserting, since this logic is used for edit too)
             // (we limit a graph to only have a single technical at the moment)
             $q = db()->prepare("DELETE FROM graph_technicals WHERE graph_id=?");
             $q->execute(array($graph_id));
             // insert a new technical
             $q = db()->prepare("INSERT INTO graph_technicals SET graph_id=:graph_id, technical_type=:type, technical_period=:period");
             $q->execute(array('graph_id' => $graph_id, 'type' => $technical, 'period' => min(get_site_config('technical_period_max'), max(1, (int) require_post("period", 0)))));
             $technical_added = htmlspecialchars($graph_technical_types[$technical]['title']);
         }
     }
 } else {
     // otherwise, delete old technicals
     $q = db()->prepare("DELETE FROM graph_technicals WHERE graph_id=?");
     $q->execute(array($graph_id));
 }
 // redirect
 $args = array(':heading' => $graph_types[$graph_type]['heading'], ':technical' => $technical_added);
 if ($is_edit) {
     if ($technical_added) {
         $messages[] = t("Edited :heading graph, with :technical.", $args);
     } else {
         $messages[] = t("Edited :heading graph.", $args);
开发者ID:phpsource,项目名称:openclerk,代码行数:31,代码来源:profile_add_graph.php


示例18: graph_types

/**
 * Get all of the defined graph types. Used for display and validation.
 */
function graph_types()
{
    $total_fiat_currencies = array();
    foreach (get_total_conversion_summary_types() as $c) {
        $total_fiat_currencies[] = $c['title'];
    }
    $total_fiat_currencies = implode_english($total_fiat_currencies);
    $data = array('category_general' => array('title' => t('General'), 'category' => true), 'subcategory_general' => array('title' => t('General graphs'), 'subcategory' => true), 'btc_equivalent' => array('title' => t('Equivalent BTC balances (pie)'), 'heading' => t('Equivalent BTC'), 'description' => t('A pie chart representing the overall proportional value of all currencies if they were all converted into BTC.') . '<p>' . t('Exchanges used:') . ' ' . get_default_exchange_text(array_diff(get_all_currencies(), array('btc'))) . '.', 'default_width' => get_site_config('default_user_graph_height'), 'uses_summaries' => true), 'btc_equivalent_graph' => array('title' => t('Equivalent BTC balances (graph)'), 'heading' => t('Equivalent BTC'), 'description' => t('A line graph displaying the historical value of all currencies if they were all converted into BTC.') . '<p>' . t('Exchanges used:') . ' ' . get_default_exchange_text(array_diff(get_all_currencies(), array('btc'))) . '.', 'days' => true, 'uses_summaries' => true), 'btc_equivalent_stacked' => array('title' => t('Equivalent BTC balances (stacked)'), 'heading' => t('Equivalent BTC'), 'description' => t('A stacked area graph displaying the historical value of all currencies if they were all converted into BTC.') . '<p>' . t('Exchanges used:') . ' ' . get_default_exchange_text(array_diff(get_all_currencies(), array('btc'))) . '.', 'days' => true, 'uses_summaries' => true), 'btc_equivalent_proportional' => array('title' => t('Equivalent BTC balances (proportional)'), 'heading' => t('Equivalent BTC'), 'description' => t('A stacked area graph displaying the proportional historical value of all currencies if they were all converted into BTC.') . '<p>' . t('Exchanges used:') . ' ' . get_default_exchange_text(array_diff(get_all_currencies(), array('btc'))) . '.', 'days' => true, 'uses_summaries' => true), 'ticker_matrix' => array('title' => t('All currencies exchange rates (matrix)'), 'heading' => t('All exchanges'), 'description' => t('A matrix displaying the current bid/ask of all of the currencies and exchanges :interested_in.', array(':interested_in' => link_to(url_for('wizard_currencies'), t('you are interested in'))))), 'balances_table' => array('title' => t('Total balances (table)'), 'heading' => t('Total balances'), 'description' => t('A table displaying the current sum of all your currencies (before any conversions).'), 'default_width' => get_site_config('default_user_graph_height'), 'uses_summaries' => true), 'total_converted_table' => array('title' => t('Total converted fiat balances (table)'), 'heading' => t('Converted fiat'), 'description' => t('A table displaying the equivalent value of all cryptocurrencies and fiat currencies if they were immediately converted into fiat currencies. Cryptocurrencies are converted via BTC.') . '<p>' . t('Supports :currencies.', array(':currencies' => $total_fiat_currencies)) . '<p>' . t('Exchanges used:') . ' ' . get_default_exchange_text(array_diff(get_all_currencies(), array('btc'))) . '.', 'default_width' => get_site_config('default_user_graph_height'), 'uses_summaries' => true), 'crypto_converted_table' => array('title' => t('Total converted crypto balances (table)'), 'heading' => t('Converted crypto'), 'description' => t('A table displaying the equivalent value of all cryptocurrencies - but not fiat currencies - if they were immediately converted into other cryptocurrencies.') . '<p>' . t('Exchanges used:') . ' ' . get_default_exchange_text(array_diff(get_all_cryptocurrencies(), array('btc'))) . '.', 'default_width' => get_site_config('default_user_graph_height'), 'uses_summaries' => true), 'balances_offset_table' => array('title' => t('Total balances with offsets (table)'), 'heading' => t('Total balances'), 'description' => t('A table displaying the current sum of all currencies (before any conversions), along with the current total offset values of each currency.'), 'uses_summaries' => true));
    $summaries = array();
    $conversions = array();
    if (user_logged_in()) {
        $summaries = get_all_summary_currencies();
        $conversions = get_all_conversion_currencies();
    }
    $data['category_summaries'] = array('title' => t('Your summaries'), 'category' => true);
    $data['subcategory_summaries_total'] = array('title' => t('Historical currency value'), 'subcategory' => true);
    // we can generate a list of summary daily graphs from all the currencies that we support
    foreach (get_summary_types() as $key => $summary) {
        $cur = $summary['currency'];
        $data["total_" . $cur . "_daily"] = array('title' => t("Total :currency historical (graph)", array(':currency' => get_currency_name($cur))), 'heading' => t("Total :currency", array(':currency' => get_currency_abbr($cur))), 'description' => t("A line graph displaying the historical sum of your :currency (before any conversions).", array(':currency' => get_currency_name($cur))), 'hide' => !isset($summaries[$cur]), 'days' => true, 'delta' => true, 'technical' => true, 'uses_summaries' => true);
    }
    $data['subcategory_summaries_crypto2'] = array('title' => t('Historical converted value'), 'subcategory' => true);
    foreach (get_crypto_conversion_summary_types() as $key => $summary) {
        $cur = $summary['currency'];
        $data["crypto2" . $key . "_daily"] = array('title' => t("Converted :title historical (graph)", array(':title' => $summary['title'])), 'heading' => t("Converted :title", array(':title' => $summary['short_title'])), 'description' => t("A line graph displaying the historical equivalent value of all cryptocurrencies - and not other fiat currencies - if they were immediately converted to :title.", array(':title' => $summary['title'])), 'hide' => !isset($conversions['summary_' . $key]), 'days' => true, 'delta' => true, 'technical' => true, 'uses_summaries' => true);
    }
    /*
     * Issue #112 reported that 'all2CUR' was not correctly converting fiat currencies other than CUR.
     * Rather than renaming 'all2CUR' as 'all cryptocurrencies and CUR', which doesn't seem to be particularly useful
     * - and it will mean we'll have to track two new summaries for every currency -
     * as of 0.19 this will now correctly be calculated as 'all cryptocurrencies and fiat currencies'. This means that there
     * will be a jump in the value of data when deployed.
     */
    foreach (get_total_conversion_summary_types() as $key => $summary) {
        $cur = $summary['currency'];
        $data["all2" . $key . "_daily"] = array('title' => t("Converted :title historical (graph)", array(':title' => $summary['title'])), 'heading' => t("Converted :title", array(':title' => $summary['short_title'])), 'description' => t("A line graph displaying the historical equivalent value of all cryptocurrencies and fiat currencies if they were immediately converted to :title (where possible).", array(':title' => $summary['title'])), 'hide' => !isset($conversions['summary_' . $key]), 'days' => true, 'delta' => true, 'technical' => true, 'uses_summaries' => true);
    }
    $data['subcategory_summaries_composition'] = array('title' => t('Total balance composition'), 'subcategory' => true);
    // we can generate a list of composition graphs from all of the currencies that we support
    foreach (get_all_currencies() as $currency) {
        $data["composition_" . $currency . "_pie"] = array('title' => t("Total :currency balance composition (pie)", array(':currency' => get_currency_name($currency))), 'heading' => t("Total :currency", array(':currency' => get_currency_abbr($currency))), 'description' => t("A pie chart representing all of the sources of your total :currency balance (before any conversions).", array(':currency' => get_currency_name($currency))), 'hide' => !isset($summaries[$currency]), 'default_width' => get_site_config('default_user_graph_height'), 'uses_summaries' => true);
    }
    $data['subcategory_summaries_graph'] = array('title' => t('All balances (graph)'), 'subcategory' => true);
    foreach (get_all_currencies() as $currency) {
        $data["composition_" . $currency . "_daily"] = array('title' => t("All :currency balances (graph)", array(':currency' => get_currency_name($currency))), 'heading' => t("All :currency balances", array(':currency' => get_currency_abbr($currency))), 'description' => t("A line graph representing all of the sources of your total :currency balance (before any conversions).", array(':currency' => get_currency_name($currency))), 'days' => true, 'hide' => !isset($summaries[$currency]), 'uses_summaries' => true);
    }
    $data['subcategory_summaries_table'] = array('title' => t('All balances (table)'), 'subcategory' => true);
    foreach (get_all_currencies() as $currency) {
        $data["composition_" . $currency . "_table"] = array('title' => t("Your :currency balances (table)", array(':currency' => get_currency_name($currency))), 'heading' => t("Your :currency balances", array(':currency' => get_currency_abbr($currency))), 'description' => t("A table displaying all of your :currency balances and the total balance (before any conversions).", array(':currency' => get_currency_name($currency))), 'hide' => !isset($summaries[$currency]), 'uses_summaries' => true);
    }
    $data['subcategory_summaries_stacked'] = array('title' => t('All balances (stacked)'), 'subcategory' => true);
    foreach (get_all_currencies() as $currency) {
        $data["composition_" . $currency . "_stacked"] = array('title' => t("All :currency balances (stacked)", array(':currency' => get_currency_name($currency))), 'heading' => t("All :currency balances", array(':currency' => get_currency_abbr($currency))), 'description' => t("A stacked area graph displaying the historical value of your total :currency balance (before any conversions).", array(':currency' => get_currency_name($currency))), 'days' => true, 'hide' => !isset($summaries[$currency]), 'uses_summaries' => true);
    }
    $data['subcategory_summaries_proportional'] = array('title' => t('All balances (proportional)'), 'subcategory' => true);
    foreach (get_all_currencies() as $currency) {
        $data["composition_" . $currency . "_proportional"] = array('title' => t("All :currency balances (proportional)", array(':currency' => get_currency_name($currency))), 'heading' => t("All :currency balances", array(':currency' => get_currency_abbr($currency))), 'description' => t("A stacked area graph displaying the proportional historical value of your total :currency balance (before any conversions).", array(':currency' => get_currency_name($currency))), 'days' => true, 'hide' => !isset($summaries[$currency]), 'uses_summaries' => true);
    }
    $data['category_hashrate'] = array('title' => t('Your mining'), 'category' => true);
    $data['category_hashrate_hashrate'] = array('title' => t('Historical hashrates'), 'subcategory' => true);
    // and for each cryptocurrency that can be hashed
    foreach (get_all_hashrate_currencies() as $cur) {
        $data["hashrate_" . $cur . "_daily"] = array('title' => t(":currency historical MHash/s (graph)", array(':currency' => get_currency_name($cur))), 'heading' => t(":currency MHash/s", array(':currency' => get_currency_abbr($cur))), 'description' => t("A line graph displaying the historical hashrate sum of all workers mining :currency across all mining pools (in MHash/s).", array(':currency' => get_currency_name($cur))), 'hide' => !isset($summaries[$cur]), 'days' => true, 'delta' => true, 'technical' => true, 'uses_summaries' => true);
    }
    // merge in graph_types_public() here
    foreach (graph_types_public($summaries) as $key => $public_data) {
        // but add 'hide' parameter to hide irrelevant currencies
        if (isset($public_data['pairs'])) {
            $pairs = $public_data['pairs'];
            $public_data['hide'] = !(isset($summaries[$pairs[0]]) && isset($summaries[$pairs[1]]));
        }
        $data[$key] = $public_data;
    }
    $data['subcategory_layout'] = array('title' => t('Layout tools'), 'subcategory' => true);
    $data['linebreak'] = array('title' => t('Line break'), 'description' => t('Forces a line break at a particular location. Select \'Enable layout editing\' to move it.'), 'heading' => t('Line break'));
    $data['heading'] = array('title' => t('Heading'), 'description' => t("Displays a line of text as a heading at a particular location. Also functions as a line break. Select 'Enable layout editing' to move it.'"), 'string0' => t("Example heading"), 'heading' => t('Heading'));
    // add sample images
    $images = array('btc_equivalent' => 'btc_equivalent.png', 'composition_btc_pie' => 'composition_btc_pie.png', 'composition_ltc_pie' => 'composition_ltc_pie.png', 'composition_nmc_pie' => 'composition_nmc_pie.png', 'btce_btcnmc_daily' => 'btce_btcnmc_daily.png', 'btce_btcftc_daily' => 'btce_btcftc_daily.png', 'btce_btcltc_daily' => 'btce_btcltc_daily.png', 'bitstamp_usdbtc_daily' => 'bitstamp_usdbtc_daily.png', 'bitnz_nzdbtc_daily' => 'bitnz_nzdbtc_daily.png', 'btcchina_cnybtc_daily' => 'btcchina_cnybtc_daily.png', 'cexio_btcghs_daily' => 'cexio_btcghs_daily.png', 'vircurex_btcltc_daily' => 'vircurex_btcltc_daily.png', 'vircurex_btcdog_daily' => 'vircurex_btcdog_daily.png', 'themoneyconverter_usdeur_daily' => 'themoneyconverter_usdeur_daily.png', 'themoneyconverter_usdaud_daily' => 'themoneyconverter_usdaud_daily.png', 'themoneyconverter_usdcad_daily' => 'themoneyconverter_usdcad_daily.png', 'themoneyconverter_usdnzd_daily' => 'themoneyconverter_usdnzd_daily.png', 'crypto2btc_daily' => 'crypto2btc_daily.png', 'crypto2ltc_daily' => 'crypto2ltc_daily.png', 'crypto2nmc_daily' => 'crypto2nmc_daily.png', 'crypto2dog_daily' => 'crypto2dog_daily.png', 'all2nzd_bitnz_daily' => 'all2nzd_bitnz_daily.png', 'all2cad_virtex_daily' => 'all2cad_virtex_daily.png', 'all2usd_bitstamp_daily' => 'all2usd_bitstamp_daily.png', 'all2usd_btce_daily' => 'all2usd_btce_daily.png', 'btc_equivalent_graph' => 'btc_equivalent_graph.png', 'btc_equivalent_proportional' => 'btc_equivalent_proportional.png', 'btc_equivalent_stacked' => 'btc_equivalent_stacked.png', 'total_btc_daily' => 'total_btc_daily.png', 'total_ltc_daily' => 'total_ltc_daily.png', 'total_nmc_daily' => 'total_nmc_daily.png', 'total_ghs_daily' => 'total_ghs_daily.png', 'hashrate_ltc_daily' => 'hashrate_ltc_daily.png', 'balances_table' => 'balances_table.png', 'balances_offset_table' => 'balances_offset_table.png', 'crypto_converted_table' => 'crypto_converted_table.png', 'total_converted_table' => 'total_converted_table.png', 'composition_btc_daily' => 'composition_btc_daily.png', 'composition_ltc_daily' => 'composition_ltc_daily.png', 'composition_nmc_daily' => 'composition_ltc_daily.png', 'composition_ftc_daily' => 'composition_ltc_daily.png', 'composition_ppc_daily' => 'composition_ltc_daily.png', 'composition_nvc_daily' => 'composition_ltc_daily.png', 'composition_dog_daily' => 'composition_dog_daily.png', 'composition_btc_table' => 'composition_btc_table.png', 'composition_ltc_table' => 'composition_ltc_table.png', 'composition_nmc_table' => 'composition_nmc_table.png', 'composition_ftc_table' => 'composition_ltc_table.png', 'composition_ppc_table' => 'composition_ltc_table.png', 'composition_nvc_table' => 'composition_ltc_table.png', 'composition_dog_table' => 'composition_dog_table.png', 'composition_btc_proportional' => 'composition_btc_proportional.png', 'composition_ltc_proportional' => 'composition_ltc_proportional.png', 'composition_nmc_proportional' => 'composition_nmc_proportional.png', 'composition_ftc_proportional' => 'composition_ltc_proportional.png', 'composition_ppc_proportional' => 'composition_ltc_proportional.png', 'composition_nvc_proportional' => 'composition_ltc_proportional.png', 'composition_btc_stacked' => 'composition_btc_stacked.png', 'composition_ltc_stacked' => 'composition_ltc_stacked.png', 'composition_nmc_stacked' => 'composition_ltc_stacked.png', 'composition_ftc_stacked' => 'composition_ltc_stacked.png', 'composition_ppc_stacked' => 'composition_ltc_stacked.png', 'composition_nvc_stacked' => 'composition_ltc_stacked.png', 'composition_ghs_stacked' => 'composition_ghs_stacked.png', 'average_usdbtc_daily' => 'average_usdbtc_daily.png', 'average_usdbtc_markets' => 'average_usdbtc_markets.png', 'average_cadbtc_daily' => 'average_cadbtc_daily.png', 'average_cadbtc_markets' => 'average_cadbtc_markets.png', 'average_audbtc_daily' => 'average_audbtc_daily.png', 'average_audbtc_markets' => 'average_audbtc_markets.png', 'average_nzdbtc_daily' => 'average_nzdbtc_daily.png', 'average_nzdbtc_markets' => 'average_nzdbtc_markets.png', 'average_btcdog_daily' => 'average_btcdog_daily.png', 'average_btcdog_markets' => 'average_btcdog_markets.png', 'average_btcltc_daily' => 'average_btcltc_daily.png', 'average_btcltc_markets' => 'average_btcltc_markets.png', 'ticker_matrix' => 'ticker_matrix.png', 'calculator' => 'calculator.png');
    $data = add_example_images($data, $images);
    return $data;
}
开发者ID:phpsource,项目名称:openclerk,代码行数:84,代码来源:types.php


示例19: require_admin

<?php

/**
 * This admin-only scripts allows us to "login" as another user for debugging
 * purposes. First the user must be logged in as an administrator, and the
 * 'allow_fake_login' config parameter set to true.
 * The target user also must not be an administrator.
 */
require_admin();
// TODO need to migrate to new openclerk/users framework
throw new Exception("Not implemented (#266).");
if (!get_site_config('allow_fake_login')) {
    throw new Exception("Fake login must be enabled through 'allow_fake_login' first.");
}
// login as a new user
$query = db()->prepare("SELECT * FROM users WHERE id=? LIMIT 1");
$query->execute(array(require_get("id")));
if (!($user = $query->fetch())) {
    throw new Exception("No user account found: " . require_get("id"));
}
if ($user['is_admin']) {
    throw new Exception("Cannot login as an administrator");
}
// create a log message
class FakeLogin extends Exception
{
}
log_uncaught_exception(new FakeLogin("Login emulated for user " . $user['id']));
// create new login key
$user_key = sprintf("%04x%04x%04x%04x", rand(0, 0xffff), rand(0, 0xffff), rand(0, 0xffff), rand(0, 0xffff));
$query = db()->prepare("INSERT INTO valid_user_keys SET user_id=?, user_key=?, created_at=NOW()");
开发者ID:phpsource,项目名称:openclerk,

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_site_default_lang函数代码示例发布时间:2022-05-15
下一篇:
PHP get_site_by_path函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap