Exemplo n.º 1
0
 function testGenerate()
 {
     $templates = array('currencies_list' => array(), 'currencies_inline' => array(), 'fiat_currencies_list' => array(), 'fiat_currencies_inline' => array(), 'crypto_currencies_list' => array(), 'crypto_currencies_inline' => array(), 'commodity_currencies_list' => array(), 'commodity_currencies_inline' => array(), 'exchange_wallets_list' => array(), 'mining_pools_list' => array(), 'securities_list' => array(), 'exchange_list' => array());
     foreach (get_all_currencies() as $cur) {
         $templates['currencies_list'][] = "  * " . get_currency_name($cur);
         $templates['currencies_inline'][] = get_currency_abbr($cur);
     }
     foreach (get_all_fiat_currencies() as $cur) {
         $templates['fiat_currencies_list'][] = "  * " . get_currency_name($cur);
         $templates['fiat_currencies_inline'][] = get_currency_abbr($cur);
     }
     foreach (get_all_cryptocurrencies() as $cur) {
         $templates['crypto_currencies_list'][] = "  * " . get_currency_name($cur);
         $templates['crypto_currencies_inline'][] = get_currency_abbr($cur);
     }
     foreach (get_all_commodity_currencies() as $cur) {
         $templates['commodity_currencies_list'][] = "  * " . get_currency_name($cur);
         $templates['commodity_currencies_inline'][] = get_currency_abbr($cur);
     }
     $grouped = account_data_grouped();
     foreach ($grouped['Exchanges'] as $key => $data) {
         if (!$data['disabled']) {
             $templates['exchange_wallets_list'][] = "  * " . get_exchange_name($key);
         }
     }
     foreach ($grouped['Mining pools'] as $key => $data) {
         if (!$data['disabled']) {
             $templates['mining_pools_list'][] = "  * " . get_exchange_name($key);
         }
     }
     foreach ($grouped['Securities'] as $key => $data) {
         if (!$data['disabled']) {
             $templates['securities_list'][] = "  * " . get_exchange_name($key);
         }
     }
     foreach (get_exchange_pairs() as $key => $pairs) {
         $templates['exchange_list'][] = "  * " . get_exchange_name($key);
     }
     $templates['currencies_list'] = implode("\n", array_unique($templates['currencies_list']));
     $templates['fiat_currencies_list'] = implode("\n", array_unique($templates['fiat_currencies_list']));
     $templates['crypto_currencies_list'] = implode("\n", array_unique($templates['crypto_currencies_list']));
     $templates['commodity_currencies_list'] = implode("\n", array_unique($templates['commodity_currencies_list']));
     $templates['exchange_wallets_list'] = implode("\n", array_unique($templates['exchange_wallets_list']));
     $templates['mining_pools_list'] = implode("\n", array_unique($templates['mining_pools_list']));
     $templates['securities_list'] = implode("\n", array_unique($templates['securities_list']));
     $templates['exchange_list'] = implode("\n", array_unique($templates['exchange_list']));
     $templates['currencies_inline'] = implode(", ", array_unique($templates['currencies_inline']));
     $templates['fiat_currencies_inline'] = implode(", ", array_unique($templates['fiat_currencies_inline']));
     $templates['crypto_currencies_inline'] = implode(", ", array_unique($templates['crypto_currencies_inline']));
     $templates['commodity_currencies_inline'] = implode(", ", array_unique($templates['commodity_currencies_inline']));
     // load the template
     $input = file_get_contents(__DIR__ . "/../README.template.md");
     foreach ($templates as $key => $value) {
         $input = str_replace('{$' . $key . '}', $value, $input);
     }
     // write it out
     file_put_contents(__DIR__ . "/../README.md", $input);
 }
Exemplo n.º 2
0
 function getJSON($arguments)
 {
     // important for url_for() links
     define('FORCE_NO_RELATIVE', true);
     $result = array();
     $result['currencies'] = array();
     foreach (get_all_currencies() as $cur) {
         $result['currencies'][] = array('code' => $cur, 'abbr' => get_currency_abbr($cur), 'name' => get_currency_name($cur), 'fiat' => is_fiat_currency($cur));
     }
     require __DIR__ . "/../../inc/api.php";
     $result['rates'] = api_get_all_rates();
     return $result;
 }
Exemplo n.º 3
0
 public function getData($days)
 {
     $key_column = array('type' => 'string', 'title' => ct("Currency"));
     $columns = array();
     $columns[] = array('type' => 'string', 'title' => ct("Currency"), 'heading' => true);
     $columns[] = array('type' => 'string', 'title' => ct("Total"));
     // a table of each currency
     // get all balances
     $balances = get_all_summary_instances($this->getUser());
     $summaries = get_all_summary_currencies($this->getUser());
     $currencies = get_all_currencies();
     $last_updated = find_latest_created_at($balances, "total");
     // create data
     $data = array();
     foreach ($currencies as $c) {
         if (isset($summaries[$c])) {
             $balance = isset($balances['total' . $c]) ? $balances['total' . $c]['balance'] : 0;
             $data[] = array("<span title=\"" . htmlspecialchars(get_currency_name($c)) . "\">" . get_currency_abbr($c) . "</span>", currency_format($c, demo_scale($balance), 4));
         }
     }
     return array('key' => $key_column, 'columns' => $columns, 'data' => $data, 'last_updated' => $last_updated, 'add_more_currencies' => true, 'no_header' => true);
 }
Exemplo n.º 4
0
/**
 * Возвращает отформатированный диапазон стоимости c валютой.
 *
 * @param real 	$cost_from 		начальная стоимость
 * @param real 	$cost_to 		конечная стоимость
 * @param string 	$add 			префикс
 * @param string 	$empty_val 		текст для пустого значения
 * @param boolean $bold 			выделение цифр жирным шрифтом
 * @param integer $currency 		номер валюты
 * @return string отформатированная стоимость
 */
function view_range_cost2($cost_from, $cost_to, $add = '', $empty_val = 'нет', $bold = true, $currency = 0)
{
    // Название валюты по номеру
    $cur_name = get_currency_name($currency);
    if ((!isset($cost_from) || is_null($cost_from) || $cost_from == 0 || $cost_from == '') && (!isset($cost_to) || is_null($cost_to) || $cost_to == 0 || $cost_to == '')) {
        $ret = $empty_val;
    } else {
        $txt_cost = '';
        //if (($currency == 1) || ($currency == 2) || ($currency == 3)) {
        if (!(!isset($cost_from) || is_null($cost_from) || $cost_from == 0 || $cost_from == '') && !(!isset($cost_to) || is_null($cost_to) || $cost_to == 0 || $cost_to == '') && $cost_to == $cost_from) {
            $txt_cost .= ($bold ? '<strong>' : '') . number_format(floatval($cost_from), 0, '.', ' ') . ($bold ? '</strong>' : '');
        } else {
            if (!(!isset($cost_from) || is_null($cost_from) || $cost_from == 0 || $cost_from == '')) {
                $txt_cost .= '<span class="b-layout__bold">Стоимость:</span> от ' . ($bold ? '<strong>' : '') . number_format(floatval($cost_from), 0, '.', ' ') . ($bold ? '</strong>' : '');
            }
            if (!(!isset($cost_to) || is_null($cost_to) || $cost_to == 0 || $cost_to == '')) {
                $txt_cost .= ($txt_cost ? ' ' : '') . 'до ' . ($bold ? '<strong>' : '') . number_format(floatval($cost_to), 0, '.', ' ') . ($bold ? '</strong>' : '');
            }
        }
        $txt_cost .= $txt_cost ? ' ' . $cur_name : '';
        /*} else {
                        if ((!(!isset($cost_from) || is_null($cost_from) || ($cost_from == 0) || ($cost_from == ''))) && (!(!isset($cost_to) || is_null($cost_to) || ($cost_to == 0) || ($cost_to == ''))) && ($cost_to == $cost_from))
                        {
                            $txt_cost .= (($bold) ? '<strong>' : '') . $cur_name . number_format(floatval($cost_from),0,'.',' ') . (($bold) ? '</strong>' : '');
                        } else {
                            if (!(!isset($cost_from) || is_null($cost_from) || ($cost_from == 0) || ($cost_from == '')))
                            {
                                $txt_cost .= 'от ' . (($bold) ? '<strong>' : '') . $cur_name . number_format(floatval($cost_from),0,'.',' ') . (($bold) ? '</strong>' : '');
                            }
                            if (!(!isset($cost_to) || is_null($cost_to) || ($cost_to == 0) || ($cost_to == '')))
                            {
        
                                $txt_cost .= ($txt_cost?' ':'') . 'до ' . (($bold) ? '<strong>' : '') . $cur_name . number_format(floatval($cost_to),0,'.',' ') . (($bold) ? '</strong>' : '');
                            }
                        }
                    }*/
        $ret = ($add ? $add . ' ' : '') . $txt_cost;
    }
    return $ret;
}
Exemplo n.º 5
0
<div class="tip">
Cryptocurrencies that do <em>not</em> have a suitable explorer API yet at the time of writing:
<ul>
	<li><span class="currency_name_smc">Smartcoin</span></li>
</ul>
</div>

<p>
	Currently <?php 
echo htmlspecialchars(get_site_config('site_name'));
?>
 supports the <?php 
$result = array();
foreach (get_all_cryptocurrencies() as $c) {
    $result[] = "<span class=\"currency_name_" . htmlspecialchars($c) . "\">" . htmlspecialchars(get_currency_name($c)) . "</span>" . (in_array($c, get_new_supported_currencies()) ? " <span class=\"new\">" . ht("new") . "</span>" : "");
}
echo implode_english($result);
?>
 cryptocurrencies.
</p>

<p>
	In the future, <?php 
echo htmlspecialchars(get_site_config('site_name'));
?>
 will host cryptocurrency
	explorer instances locally, removing these requirements and making it possible to add almost any
	cryptocurrency; please donate or purchase a <a href="<?php 
echo htmlspecialchars(url_for('premium'));
?>
Exemplo n.º 6
0
  </tr>
</thead>
<tbody>
<?php 
    $count = 0;
    foreach ($previous as $o) {
        ?>
  <tr class="<?php 
        echo ++$count % 2 == 0 ? "odd" : "even";
        ?>
">
    <td><span class="currency_name_<?php 
        echo htmlspecialchars($o['currency']);
        ?>
"><?php 
        echo htmlspecialchars(get_currency_name($o['currency']));
        ?>
</span></td>
    <td><?php 
        echo $o['months'] ? plural("month", $o['months']) : "";
        echo $o['years'] ? plural("year", $o['years']) : "";
        ?>
</td>
    <td><?php 
        echo crypto_address($o['currency'], $o['address']);
        ?>
</td>
    <td class="number"><?php 
        echo currency_format($o['currency'], $o['balance']);
        ?>
</td>
Exemplo n.º 7
0
/**
 * 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;
}
Exemplo n.º 8
0
                        crypto_log("Sent e-mail to " . htmlspecialchars($user['email']) . ".");
                    }
                }
            } else {
                // have we reminded recently?
                if (!$address['last_reminder'] || strtotime($address['last_reminder'] . " +" . get_site_config('outstanding_reminder_hours') . " hour") < time()) {
                    // send a reminder
                    if ($user['email']) {
                        send_user_email($user, "purchase_reminder", array("name" => $user['name'] ? $user['name'] : $user['email'], "amount" => number_format_autoprecision($address['balance']), "received" => number_format_autoprecision($balance['balance']), "currency" => get_currency_abbr($address['currency']), "currency_name" => get_currency_name($address['currency']), "address" => $address['address'], "explorer" => get_explorer_address($address['currency'], $address['address']), "url" => absolute_url(url_for("user#user_outstanding")), "reminder" => $reminder, "cancelled" => $cancelled));
                        crypto_log("Sent e-mail to " . htmlspecialchars($user['email']) . ".");
                    }
                    $q = db()->prepare("UPDATE outstanding_premiums SET last_reminder=NOW() WHERE id=?");
                    $q->execute(array($address['id']));
                    crypto_log("Sent reminder message on outstanding premium payment.");
                }
            }
        } else {
            if ($balance['balance'] > 0 && $balance['balance'] > $address['last_balance']) {
                // issue #231: have we made a new payment since we looked last?
                // send a reminder
                if ($user['email']) {
                    send_user_email($user, "purchase_further", array("name" => $user['name'] ? $user['name'] : $user['email'], "amount" => number_format_autoprecision($address['balance']), "received" => number_format_autoprecision($balance['balance']), "difference" => number_format_autoprecision($balance['balance'] - $address['last_balance']), "currency" => get_currency_abbr($address['currency']), "currency_name" => get_currency_name($address['currency']), "address" => $address['address'], "explorer" => get_explorer_address($address['currency'], $address['address']), "url" => absolute_url(url_for("user#user_outstanding")), "reminder" => $reminder, "cancelled" => $cancelled));
                    crypto_log("Sent e-mail to " . htmlspecialchars($user['email']) . ".");
                }
                $q = db()->prepare("UPDATE outstanding_premiums SET last_balance=? WHERE id=?");
                $q->execute(array($balance['balance'], $address['id']));
                crypto_log("Sent received payment message on outstanding premium payment.");
            }
        }
    }
}
Exemplo n.º 9
0
?>
&zoneid=<?php 
echo $currzoneid;
?>
&npcid=<?php 
echo $npcid;
?>
&action=22" title="View/Change"><?php 
echo $merchant_id != 0 ? $merchant_id : "no";
?>
</a><br/>
                      <strong>Alt Currency:</strong> <a href="index.php?editor=altcur&npcid=<?php 
echo $id;
?>
&action=<?php 
echo $alt_currency_id != 0 ? '10">' . get_currency_name($alt_currency_id) : '8">no';
?>
</a><br/>
                      <strong>Adventure:</strong> <a href="index.php?editor=npc&z=<?php 
echo $currzone;
?>
&zoneid=<?php 
echo $currzoneid;
?>
&npcid=<?php 
echo $npcid;
?>
&action=29" title="View/Change"><?php 
echo $adventure_template_id != 0 ? $adventure_template_id : "no";
?>
</a><br/>
Exemplo n.º 10
0
?>
</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>
Exemplo n.º 11
0
    $q->execute(array(require_post("code"), require_post("title")));
    $messages[] = "Added coin " . require_post("code") . ".";
}
if (require_post("id", false)) {
    $q = db()->prepare("SELECT * FROM vote_coins WHERE id=?");
    $q->execute(array(require_post("id")));
    $vote = $q->fetch();
    if (!$vote) {
        $errors[] = "Could not find any such vote_coins";
    } else {
        $sent = 0;
        $q = db()->prepare("SELECT * FROM vote_coins_votes JOIN users ON vote_coins_votes.user_id=users.id WHERE coin_id=?");
        $q->execute(array($vote['id']));
        while ($user = $q->fetch()) {
            if ($user['email']) {
                send_user_email($user, "voted_coin", array("name" => $user['name'] ? $user['name'] : $user['email'], "code" => strtolower($vote['code']), "abbr" => get_currency_abbr(strtolower($vote['code'])), "title" => get_currency_name(strtolower($vote['code'])), "original_title" => $vote['title'], "total_users" => plural("other user", $vote['total_users']), "url" => absolute_url(url_for("vote_coins")), "wizard" => absolute_url(url_for("wizard_currencies"))));
                $sent++;
            }
        }
        $messages[] = "Sent notifications to " . plural("user", $sent) . ".";
        // remove vote_coins and vote_coins_votes entries
        $q = db()->prepare("DELETE FROM vote_coins WHERE id=?");
        $q->execute(array($vote['id']));
        $q = db()->prepare("DELETE FROM vote_coins_votes WHERE coin_id=?");
        $q->execute(array($vote['id']));
        $messages[] = "Removed voted coin.";
    }
}
page_header("Admin Vote Coins", "page_admin_vote_coins");
?>
Exemplo n.º 12
0
    $x = 0;
    foreach ($altcur_characters as $character) {
        ?>
      <tr bgcolor="#<?php 
        echo $x % 2 == 0 ? "BBBBBB" : "AAAAAA";
        ?>
">
        <td align="center" width="35%"><?php 
        echo getPlayerName($character['char_id']);
        ?>
 (<?php 
        echo $character['char_id'];
        ?>
)</td>
        <td align="center" width="35%"><?php 
        echo get_currency_name($character['currency_id']);
        ?>
 (<?php 
        echo $character['currency_id'];
        ?>
)</td>
        <td align="center" width="20%"><?php 
        echo $character['amount'];
        ?>
</td>
        <td align="right" width="10%"><a href="index.php?editor=altcur&charid=<?php 
        echo $character['char_id'];
        ?>
&currencyid=<?php 
        echo $character['currency_id'];
        ?>
Exemplo n.º 13
0
/**
 * Return a grouped array of (job_type => (table, gruop, wizard, failure, ...))
 */
function account_data_grouped()
{
    $addresses_data = array();
    $mining_pools_data = array();
    $exchange_wallets_data = array();
    // we can generate this automatically
    foreach (get_address_currencies() as $cur) {
        $addresses_data["address_" . $cur] = array('title' => get_currency_abbr($cur) . ' addresses', 'label' => 'address', 'labels' => 'addresses', 'table' => 'addresses', 'group' => 'addresses', 'query' => " AND currency='{$cur}'", 'wizard' => 'addresses', 'currency' => $cur, 'job_type' => 'addresses_' . $cur);
    }
    foreach (Accounts::getKeys() as $exchange) {
        if (in_array($exchange, Accounts::getMiners())) {
            // a miner
            $mining_pools_data[$exchange] = array('table' => 'accounts_' . safe_table_name($exchange), 'group' => 'accounts', 'wizard' => 'pools', 'failure' => true, 'disabled' => in_array($exchange, Accounts::getDisabled()), 'job_type' => 'account_' . $exchange);
        } else {
            // otherwise, assume an exchange wallet
            $exchange_wallets_data[$exchange] = array('table' => 'accounts_' . safe_table_name($exchange), 'group' => 'accounts', 'wizard' => 'exchanges', 'failure' => true, 'disabled' => in_array($exchange, Accounts::getDisabled()), 'job_type' => 'account_' . $exchange);
        }
    }
    $data = array('Addresses' => $addresses_data, 'Mining pools' => $mining_pools_data, 'Exchanges' => $exchange_wallets_data, 'Securities' => array('796' => array('table' => 'accounts_796', 'group' => 'accounts', 'wizard' => 'securities', 'failure' => true), 'bitfunder' => array('table' => 'accounts_bitfunder', 'group' => 'accounts', 'wizard' => 'securities', 'failure' => true, 'disabled' => true), 'btcinve' => array('table' => 'accounts_btcinve', 'group' => 'accounts', 'wizard' => 'securities', 'failure' => true, 'disabled' => true), 'btct' => array('table' => 'accounts_btct', 'group' => 'accounts', 'wizard' => 'securities', 'failure' => true, 'disabled' => true), 'crypto-trade' => array('table' => 'accounts_cryptotrade', 'group' => 'accounts', 'wizard' => 'securities', 'failure' => true), 'cryptostocks' => array('table' => 'accounts_cryptostocks', 'group' => 'accounts', 'wizard' => 'securities', 'failure' => true), 'havelock' => array('table' => 'accounts_havelock', 'group' => 'accounts', 'wizard' => 'securities', 'failure' => true), 'litecoininvest' => array('table' => 'accounts_litecoininvest', 'group' => 'accounts', 'wizard' => 'securities', 'failure' => true), 'litecoinglobal' => array('table' => 'accounts_litecoinglobal', 'group' => 'accounts', 'wizard' => 'securities', 'failure' => true, 'disabled' => true)), 'Individual Securities' => array('individual_796' => array('label' => 'security', 'labels' => 'securities', 'table' => 'accounts_individual_796', 'group' => 'accounts', 'wizard' => 'individual', 'exchange' => '796', 'securities_table' => 'securities_796', 'failure' => true), 'individual_bitfunder' => array('label' => 'security', 'labels' => 'securities', 'table' => 'accounts_individual_bitfunder', 'group' => 'accounts', 'wizard' => 'individual', 'exchange' => 'bitfunder', 'securities_table' => 'securities_bitfunder', 'failure' => true, 'disabled' => true), 'individual_btcinve' => array('label' => 'security', 'labels' => 'securities', 'table' => 'accounts_individual_btcinve', 'group' => 'accounts', 'wizard' => 'individual', 'exchange' => 'btcinve', 'securities_table' => 'securities_btcinve', 'failure' => true, 'disabled' => true), 'individual_btct' => array('label' => 'security', 'labels' => 'securities', 'table' => 'accounts_individual_btct', 'group' => 'accounts', 'wizard' => 'individual', 'exchange' => 'btct', 'securities_table' => 'securities_btct', 'failure' => true, 'disabled' => true), 'individual_crypto-trade' => array('label' => 'security', 'labels' => 'securities', 'table' => 'accounts_individual_cryptotrade', 'group' => 'accounts', 'wizard' => 'individual', 'exchange' => 'crypto-trade', 'securities_table' => 'securities_cryptotrade', 'failure' => true), 'individual_cryptostocks' => array('label' => 'security', 'labels' => 'securities', 'table' => 'accounts_individual_cryptostocks', 'group' => 'accounts', 'wizard' => 'individual', 'exchange' => 'cryptostocks', 'securities_table' => 'securities_cryptostocks', 'failure' => true), 'individual_havelock' => array('label' => 'security', 'labels' => 'securities', 'table' => 'accounts_individual_havelock', 'group' => 'accounts', 'wizard' => 'individual', 'exchange' => 'havelock', 'securities_table' => 'securities_havelock', 'failure' => true), 'individual_litecoininvest' => array('label' => 'security', 'labels' => 'securities', 'table' => 'accounts_individual_litecoininvest', 'group' => 'accounts', 'wizard' => 'individual', 'exchange' => 'litecoininvest', 'securities_table' => 'securities_litecoininvest', 'failure' => true), 'individual_litecoinglobal' => array('label' => 'security', 'labels' => 'securities', 'table' => 'accounts_individual_litecoinglobal', 'group' => 'accounts', 'wizard' => 'individual', 'exchange' => 'litecoinglobal', 'securities_table' => 'securities_litecoinglobal', 'failure' => true, 'disabled' => true)), 'Securities Tickers' => array('securities_796' => array('label' => 'security ticker', 'labels' => 'securities', 'table' => 'securities_796', 'exchange' => '796', 'securities_table' => 'securities_796'), 'securities_bitfunder' => array('label' => 'security ticker', 'labels' => 'securities', 'table' => 'securities_bitfunder', 'exchange' => 'bitfunder', 'securities_table' => 'securities_bitfunder', 'disabled' => true), 'securities_btcinve' => array('label' => 'security ticker', 'labels' => 'securities', 'table' => 'securities_btcinve', 'exchange' => 'btcinve', 'securities_table' => 'securities_btcinve', 'disabled' => true), 'securities_btct' => array('label' => 'security ticker', 'labels' => 'securities', 'table' => 'securities_btct', 'exchange' => 'btct', 'securities_table' => 'securities_btct', 'disabled' => true), 'securities_crypto-trade' => array('label' => 'security ticker', 'labels' => 'securities', 'table' => 'securities_cryptotrade', 'exchange' => 'crypto-trade', 'securities_table' => 'securities_cryptotrade', 'disabled' => true), 'securities_cryptostocks' => array('label' => 'security ticker', 'labels' => 'securities', 'table' => 'securities_cryptostocks', 'exchange' => 'cryptostocks', 'securities_table' => 'securities_cryptostocks', 'disabled' => true), 'securities_havelock' => array('label' => 'security ticker', 'labels' => 'securities', 'table' => 'securities_havelock', 'exchange' => 'havelock', 'securities_table' => 'securities_havelock', 'failure' => true), 'securities_litecoininvest' => array('label' => 'security ticker', 'labels' => 'securities', 'table' => 'securities_litecoininvest', 'exchange' => 'litecoininvest', 'securities_table' => 'securities_litecoininvest'), 'securities_litecoinglobal' => array('label' => 'security ticker', 'labels' => 'securities', 'table' => 'securities_litecoinglobal', 'exchange' => 'litecoinglobal', 'securities_table' => 'securities_litecoinglobal', 'disabled' => true)), 'Finance' => array('finance_accounts' => array('title' => 'Finance account', 'label' => 'finance account', 'table' => 'finance_accounts', 'group' => 'finance_accounts', 'job' => false), 'finance_categories' => array('title' => 'Finance category', 'label' => 'finance category', 'titles' => 'finance categories', 'table' => 'finance_categories', 'group' => 'finance_categories', 'job' => false)), 'Other' => array('generic' => array('title' => 'Generic APIs', 'label' => 'API', 'table' => 'accounts_generic', 'group' => 'accounts', 'wizard' => 'other', 'failure' => true)), 'Hidden' => array('graph' => array('title' => 'Graphs', 'table' => 'graphs', 'query' => ' AND is_removed=0', 'job' => false), 'graph_pages' => array('title' => 'Graph page', 'table' => 'graph_pages', 'group' => 'graph_pages', 'query' => ' AND is_removed=0', 'job' => false), 'summaries' => array('title' => 'Currency summaries', 'table' => 'summaries', 'group' => 'summaries', 'job' => false), 'notifications' => array('title' => 'Notifications', 'table' => 'notifications', 'group' => 'notifications', 'wizard' => 'notifications')), 'Offsets' => array());
    // add all offset currencies
    foreach (get_all_currencies() as $cur) {
        $data['Offsets']['offset_' . $cur] = array('title' => get_currency_name($cur), 'label' => 'offset', 'table' => 'offsets', 'group' => 'offsets', 'wizard' => 'offsets', 'query' => ' AND currency=\'' . $cur . '\'', 'currency' => $cur, 'job' => false);
    }
    foreach ($data as $key0 => $row0) {
        foreach ($row0 as $key => $row) {
            if (!isset($data[$key0][$key]['label'])) {
                $data[$key0][$key]['label'] = "account";
            }
            if (!isset($data[$key0][$key]['labels'])) {
                $data[$key0][$key]['labels'] = $data[$key0][$key]['label'] . "s";
            }
            if (!isset($data[$key0][$key]['title'])) {
                $data[$key0][$key]['title'] = get_exchange_name($key) . (isset($row['suffix']) ? $row['suffix'] : "") . " " . $data[$key0][$key]['labels'];
            }
            if (!isset($data[$key0][$key]['title_key'])) {
                $data[$key0][$key]['title_key'] = $key;
            }
            if (!isset($data[$key0][$key]['failure'])) {
                $data[$key0][$key]['failure'] = false;
            }
            if (!isset($data[$key0][$key]['job'])) {
                $data[$key0][$key]['job'] = true;
            }
            if (!isset($data[$key0][$key]['disabled'])) {
                $data[$key0][$key]['disabled'] = false;
            }
            if (!isset($data[$key0][$key]['suffix'])) {
                $data[$key0][$key]['suffix'] = false;
            }
            if (!isset($data[$key0][$key]['system'])) {
                $data[$key0][$key]['system'] = false;
            }
            if (!isset($data[$key0][$key]['query'])) {
                $data[$key0][$key]['query'] = '';
            }
            if (!isset($data[$key0][$key]['job_type']) && isset($data[$key0][$key]['exchange'])) {
                $data[$key0][$key]['job_type'] = $data[$key0][$key]['exchange'];
            }
            if (!isset($data[$key0][$key]['job_type']) && $key0 == "Exchanges") {
                $data[$key0][$key]['job_type'] = $key;
            }
        }
    }
    return $data;
}
Exemplo n.º 14
0
<?php

global $currency1, $currency2;
?>

<p>
	<?php 
echo ht("\n\tThis page lists the most recent and historical average price index, as weighted by trade volume,\n\tfrom all of the :currency1/:currency2\n\texchanges supported by :site_name.\n\t", array(":currency1" => get_currency_name($currency1), ":currency2" => get_currency_name($currency2)));
?>
</p>
Exemplo n.º 15
0
  <a href="https://nvc.khore.org">nvc.khore.org</a> accounts not updating;

  updated example graph images.
</dd>

<dt>10 September</dt>
<dd>
  Added currency support for <a href="https://www.darkcoin.io/" class="currency_name_drk">Darkcoin</a>,
  <a href="http://www.vericoin.info/" class="currency_name_vrc">Vericoin</a>,
  <a href="http://nxt.org/" class="currency_name_nxt">Nxt</a>,
  <span class="currency_name_dkk" title="<?php 
echo htmlspecialchars(get_currency_name('dkk'));
?>
">DKK</span>
  and <span class="currency_name_inr" title="<?php 
echo htmlspecialchars(get_currency_name('inr'));
?>
">INR</span>;

  rewrote graphing framework;

  added simple currency pair graphs for all exchange pairs;

  graphs can now be <a href="<?php 
echo htmlspecialchars(url_for('help/graph_refresh'));
?>
">refreshed manually</a>;

  disabled <a href="http://pool.dogechain.info">Dogechain Pool</a>,
  <a href="https://hypernova.pw/">hypernova.pw</a>,
  <a href="http://dogepool.pw">dogepool.pw</a> and
Exemplo n.º 16
0
        echo recent_format_html($last_updated[$exchange]);
        ?>
</td>
    <td class="number"><?php 
        echo currency_format($currency, $balance, 4);
        ?>
</td>
  </tr>
<?php 
    }
    ?>
</tbody>
<tfoot>
  <tr>
    <th colspan="2"><?php 
    echo t("Total :currency", array(':currency' => get_currency_name($currency)));
    ?>
</th>
    <th class="number"><?php 
    echo currency_format($currency, $sum, 4);
    ?>
</th>
  </tr>
</tfoot>
</table>

    </li>
    <?php 
    $first_tab = false;
}
?>
Exemplo n.º 17
0
              <input type="text" name="char_id" value="" size="10"/>
            </td>
            <td width="60%">
              Currency:<br/>
              <select name="currency_id">
<?php 
foreach ($currencies as $currency) {
    ?>
                <option value="<?php 
    echo $currency['id'];
    ?>
"<?php 
    echo $altcur_char['currency_id'] == $currency['id'] ? " selected" : "";
    ?>
><?php 
    echo get_currency_name($currency['id']);
    ?>
 (<?php 
    echo $currency['id'];
    ?>
)</option>
<?php 
}
?>
              </select>
            </td>
            <td width="10%">
              Amount:<br/>
              <input type="text" name="amount" value="" size="10"/>
            </td>
          </tr>
Exemplo n.º 18
0
  </td>
</tr>
<tr>
  <td colspan="2" class="buttons">
    <input type="hidden" name="currency" value="<?php 
echo htmlspecialchars($currency);
?>
">
    <button type="submit" class="purchase_button"><span class="currency_name_<?php 
echo htmlspecialchars($currency);
?>
">Purchase</span></button>
  </td>
</tr>
</table>
</form>

</div>
<div class="column">

<p>
<?php 
echo ht("Once you have submitted your order, a :currency address will be generated for your payment.\n    Your premium purchase will complete once the :currency network confirms your transaction.", array(':currency' => get_currency_name($currency)));
?>
</p>

</div>
</div>

<?php 
page_footer();
Exemplo n.º 19
0
      <tr bgcolor="#<?php 
        echo $x % 2 == 0 ? "BBBBBB" : "AAAAAA";
        ?>
">
        <td align="center" width="45%"><a href="index.php?editor=npc&npcid=<?php 
        echo $npc['id'];
        ?>
"><?php 
        echo getNPCName($npc['id']);
        ?>
 (<?php 
        echo $npc['id'];
        ?>
)</a></td>
        <td align="center" width="45%"><?php 
        echo get_currency_name($npc['alt_currency_id']);
        ?>
 (<?php 
        echo $npc['alt_currency_id'];
        ?>
)</td>
        <td align="right" width="10%"><a href="index.php?editor=altcur&npcid=<?php 
        echo $npc['id'];
        ?>
&action=10"><img src="images/edit2.gif" width="13" height="13" border="0" title="Edit Entry"></a>&nbsp;<a onClick="return confirm('Really delete this entry?');" href="index.php?editor=altcur&npcid=<?php 
        echo $npc['id'];
        ?>
&action=12"><img src="images/remove3.gif" border="0" title="Delete Entry"></a></td>
      </tr>
<?php 
        $x++;
Exemplo n.º 20
0
    </ul>

    <ul class="tab_groups">
    <?php 
$first_tab = true;
foreach ($all_main_currencies as $c) {
    ?>
    <li id="tab_average_<?php 
    echo $c;
    ?>
_tab"<?php 
    echo $first_tab ? "" : " style=\"display:none;\"";
    ?>
 class="tab">
      <h3><?php 
    echo get_currency_name($c);
    ?>
 market averages</h3>
      <ul>
      <?php 
    foreach ($pairs as $pair) {
        if ($pair['currency1'] != $c) {
            continue;
        }
        $selected = $currency1 == $pair['currency1'] && $currency2 == $pair['currency2'];
        echo "<li" . ($selected ? " class=\"selected\"" : "") . ">";
        echo "<a href=\"" . htmlspecialchars(url_for('average#average_' . $pair['currency1'], array('currency1' => $pair['currency1'], 'currency2' => $pair['currency2']))) . "\">";
        echo get_currency_abbr($pair['currency1']) . "/" . get_currency_abbr($pair['currency2']);
        echo "</a>";
        echo " (" . number_format($pair['market_count']) . ")";
        echo "</li>\n";
Exemplo n.º 21
0
<?php 
if (in_premium_promotion_leadup_period()) {
    require_template("premium_promotion");
}
?>

<table class="fancy">
<?php 
foreach (get_site_config('premium_currencies') as $currency) {
    ?>
<tr>
  <th class="currency"><span class="currency_name_<?php 
    echo $currency;
    ?>
"><?php 
    echo htmlspecialchars(get_currency_name($currency));
    ?>
</span></th>
  <td class="prices">
    <?php 
    if (get_site_config('premium_' . $currency . '_discount')) {
        ?>
    <div class="discounted"><?php 
        echo t(":cost1 per month, or :cost2 per year", array(':cost1' => currency_format($currency, get_site_config('premium_' . $currency . '_monthly')), ':cost2' => currency_format($currency, get_site_config('premium_' . $currency . '_yearly'))));
        ?>
</div>
    <?php 
    }
    ?>
    <?php 
    echo t(":cost1 per month, or :cost2 per year", array(':cost1' => currency_format($currency, get_premium_price($currency, 'monthly')), ':cost2' => currency_format($currency, get_premium_price($currency, 'yearly'))));
}
// order by the order defined in crypto.php, and only ones that we can actually address
$currencies = array_intersect(get_address_currencies(), $currencies);
require_template("wizard_accounts_addresses");
?>

<div class="wizard">

<div class="tabs" id="tabs_wizard">
  <ul class="tab_list">
    <?php 
/* each <li> must not have any whitespace between them otherwise whitespace will appear when rendered */
?>
    <?php 
foreach ($currencies as $c) {
    echo "<li id=\"tab_wizard_" . $c . "\"><span class=\"currency_name_" . $c . "\">" . htmlspecialchars(get_currency_name($c)) . "</span></li>";
}
?>
  </ul>

  <ul class="tab_groups">
  <?php 
$first_tab = true;
foreach ($currencies as $c) {
    ?>
  <li id="tab_wizard_<?php 
    echo $c;
    ?>
_tab"<?php 
    echo $first_tab ? "" : " style=\"display:none;\"";
    ?>