コード例 #1
0
ファイル: network-stats.php プロジェクト: hackingman/TradeX
<?php

include 'global-header.php';
include 'global-menu.php';
require_once 'stats.php';
require_once 'textdb.php';
$_REQUEST['cache'] = isset($_REQUEST['cache']) ? $_REQUEST['cache'] : 5;
$values = unserialize(file_get_contents(FILE_NETWORK_SITES_VALUES));
$cache = unserialize(file_get_contents(FILE_NETWORK_SITES_CACHE));
$db = new NetworkDB();
?>

    <script type="text/javascript" src="js/network-stats.js"></script>

    <div class="centered-header">
      Network Stats: <span id="num-items"><?php 
echo $db->Count();
?>
</span> Total Sites, <span id="shown-items"></span> Shown
    </div>


    <!-- SEARCH OPTIONS START -->
    <div class="ta-center block-center search-fields">
      <form action="index.php" method="post">
        <b style="margin-left: 15px;">Owner:</b>
        <select name="owner">
          <option value="">-- ALL --</option>
          <?php 
if (!empty($values['owners'])) {
    echo form_options($values['owners'], $_REQUEST['owner']);
コード例 #2
0
ファイル: network-sites.php プロジェクト: hackingman/TradeX
<?php

include 'global-header.php';
include 'global-menu.php';
require_once 'textdb.php';
$db = new NetworkDB();
$sites = $db->RetrieveAll('domain');
?>

    <script type="text/javascript" src="js/network-sites.js"></script>

    <div class="centered-header">
      Network Sites: <span id="num-items"><?php 
echo count($sites);
?>
</span> Configured
    </div>

    <table id="network-sites" align="center" width="1000" cellspacing="0" class="item-table">
      <thead>
        <tr class="ta-center">
          <th style="width: 25px;">
            <input type="checkbox" class="check-all"/>
          </th>
          <th>
            Domain
          </th>
          <th style="width: 150px;">
            Owner
          </th>
          <th style="width: 150px;">
コード例 #3
0
ファイル: network.php プロジェクト: hackingman/TradeX
function _xSync()
{
    $settings = unserialize(base64_decode($_REQUEST['sync']));
    // Sync blacklist
    if (isset($settings[NETWORK_SYNC_BLACKLIST]) && is_array($settings[NETWORK_SYNC_BLACKLIST])) {
        foreach ($settings[NETWORK_SYNC_BLACKLIST] as $bl_file => $file_contents) {
            file_write(DIR_BLACKLIST . '/' . $bl_file, $file_contents);
        }
    }
    // Sync categories
    if (isset($settings[NETWORK_SYNC_CATEGORIES])) {
        file_write(FILE_CATEGORIES, $settings[NETWORK_SYNC_CATEGORIES]);
    }
    // Sync countries
    if (isset($settings[NETWORK_SYNC_COUNTRIES])) {
        file_write(FILE_COUNTRIES, $settings[NETWORK_SYNC_COUNTRIES]);
    }
    // Sync groups
    if (isset($settings[NETWORK_SYNC_GROUPS])) {
        file_write(FILE_GROUPS, $settings[NETWORK_SYNC_GROUPS]);
    }
    // Sync network sites
    if (isset($settings[NETWORK_SYNC_NETWORK_SITES]) && is_array($settings[NETWORK_SYNC_NETWORK_SITES])) {
        require_once 'textdb.php';
        $db = new NetworkDB();
        foreach ($settings[NETWORK_SYNC_NETWORK_SITES] as $site) {
            if ($db->Exists($site['domain'])) {
                $db->Update($site['domain'], $site);
            } else {
                $db->Add($site);
            }
        }
        network_site_update_stored_values();
    }
    // Sync search engines
    if (isset($settings[NETWORK_SYNC_SEARCH_ENGINES])) {
        file_write(FILE_SEARCH_ENGINES, $settings[NETWORK_SYNC_SEARCH_ENGINES]);
    }
    // Sync skim schemes
    if (isset($settings[NETWORK_SYNC_SKIM_SCHEMES]) && is_array($settings[NETWORK_SYNC_SKIM_SCHEMES])) {
        foreach ($settings[NETWORK_SYNC_SKIM_SCHEMES] as $scheme => $ss_file) {
            file_write(DIR_SKIM_SCHEMES . '/' . $scheme, $ss_file['merged']);
            file_write(DIR_SKIM_SCHEMES_BASE . '/' . $scheme, $ss_file['base']);
            file_write(DIR_SKIM_SCHEMES_DYNAMIC . '/' . $scheme, $ss_file['dynamic']);
        }
    }
    // Sync trades
    if (isset($settings[NETWORK_SYNC_TRADES]) && is_array($settings[NETWORK_SYNC_TRADES])) {
        require_once 'dirdb.php';
        $db = new TradeDB();
        foreach ($settings[NETWORK_SYNC_TRADES] as $trade) {
            if ($db->Exists($trade['domain'])) {
                // Update existing
                $db->Update($trade['domain'], $trade);
            } else {
                // Create new, no confirmation
                $trade['flag_confirm'] = 0;
                trade_add($trade);
            }
        }
    }
    // Sync trade rules
    if (isset($settings[NETWORK_SYNC_TRADE_RULES])) {
        file_write(FILE_TRADE_RULES, $settings[NETWORK_SYNC_TRADE_RULES]);
    }
    network_success(true);
}
コード例 #4
0
      <?php 
$editing = !empty($item);
if (!$editing) {
    require_once 'textdb.php';
    $db = new NetworkDB();
    $item = $db->Defaults();
}
?>

      <div id="dialog-content">

        <div id="dialog-header">
          <img src="images/dialog-close-22x22.png" id="dialog-close"/>
          <?php 
echo $editing ? 'Edit' : 'Add';
?>
 a Network Site
        </div>

        <form method="post" action="xhr.php" class="xhr-form">

          <div id="dialog-panel" dwidth="860px">
            <div style="padding-top: 2px;">

              <div class="field">
                <label title="The full URL to the TradeX control panel">Control Panel URL:</label>
                <span><input name="url" value="<?php 
echo $item['url'];
?>
" size="80" type="text"></span>
              </div>
コード例 #5
0
ファイル: utility.php プロジェクト: hackingman/TradeX
function network_site_update_stored_values()
{
    require_once 'textdb.php';
    $db = new NetworkDB();
    $values = array('categories' => array(), 'owners' => array());
    foreach ($db->RetrieveAll() as $site) {
        if (!string_is_empty($site['category'])) {
            $values['categories'][] = $site['category'];
        }
        if (!string_is_empty($site['owner'])) {
            $values['owners'][] = $site['owner'];
        }
    }
    $values['categories'] = array_unique($values['categories']);
    $values['owners'] = array_unique($values['owners']);
    file_write(FILE_NETWORK_SITES_VALUES, serialize($values));
}
コード例 #6
0
ファイル: xhr.php プロジェクト: hackingman/TradeX
function _xNetworkSitesBulkEdit()
{
    $v = Validator::Get();
    if ($_REQUEST['flag_update']['username']) {
        $v->Register($_REQUEST['username'], VT_NOT_EMPTY, 'The Username field is required');
    }
    if ($_REQUEST['flag_update']['password']) {
        $v->Register($_REQUEST['password'], VT_NOT_EMPTY, 'The Password field is required');
    }
    if (!$v->Validate()) {
        return JSON::Warning(array(JSON_KEY_MESSAGE => 'Network sites could not be updated; please fix the following items', JSON_KEY_WARNINGS => $v->GetErrors()));
    }
    if ($_REQUEST['flag_update']['category'] && string_is_empty($_REQUEST['category'])) {
        $_REQUEST['category'] = '-- NONE --';
    }
    if ($_REQUEST['flag_update']['owner'] && string_is_empty($_REQUEST['owner'])) {
        $_REQUEST['owner'] = '-- NONE --';
    }
    foreach ($_REQUEST['flag_update'] as $field => $update) {
        if (!$update) {
            unset($_REQUEST[$field]);
        }
    }
    require_once 'textdb.php';
    $db = new NetworkDB();
    foreach (explode(',', $_REQUEST['domain']) as $domain) {
        if (string_is_empty($domain)) {
            continue;
        }
        $db->Update($domain, $_REQUEST);
    }
    network_site_update_stored_values();
    JSON::Success(array(JSON_KEY_MESSAGE => 'The selected network sites have been updated', JSON_KEY_DIALOG => _xIncludeCapture('network-sites-bulk-edit.php', $_REQUEST)));
}