<?php $editing = !empty($item); if (!$editing) { require_once 'textdb.php'; $db = new ToplistsDB(); $item = $db->Defaults(); } $trade_sources = array('all' => 'All Trades', 'outlist_main' => 'Main Outlist', 'outlist_primary' => 'Primary Bonus Outlist', 'outlist_secondary' => 'Secondary Bonus Outlist', 'outlist_forces' => 'Forces'); $sorters = array('i_raw_60' => '60 Minutes - In Raw', 'i_uniq_60' => '60 Minutes - In Unique', 'i_uniq_pct_60' => '60 Minutes - In Unique %', 'i_proxy_60' => '60 Minutes - In Proxy', 'i_ctry_g_60' => '60 Minutes - In Good Country', 'i_ctry_n_60' => '60 Minutes - In Normal Country', 'i_ctry_b_60' => '60 Minutes - In Bad Country', 'i_ctry_g_pct_60' => '60 Minutes - In Good Country %', 'i_ctry_n_pct_60' => '60 Minutes - In Normal Country %', 'i_ctry_b_pct_60' => '60 Minutes - In Bad Country %', 'o_raw_60' => '60 Minutes - Out Raw', 'o_proxy_60' => '60 Minutes - Out Proxy', 'o_ctry_g_60' => '60 Minutes - Out Good Country', 'o_ctry_n_60' => '60 Minutes - Out Normal Country', 'o_ctry_b_60' => '60 Minutes - Out Bad Country', 'o_ctry_g_pct_60' => '60 Minutes - Out Good Country %', 'o_ctry_n_pct_60' => '60 Minutes - Out Normal Country %', 'o_ctry_b_pct_60' => '60 Minutes - Out Bad Country %', 'c_raw_60' => '60 Minutes - Clicks Raw', 'c_proxy_60' => '60 Minutes - Clicks Proxy', 'c_trades_60' => '60 Minutes - Clicks To Trades', 'c_ctry_g_60' => '60 Minutes - Clicks Good Country', 'c_ctry_n_60' => '60 Minutes - Clicks Normal Country', 'c_ctry_b_60' => '60 Minutes - Clicks Bad Country', 'c_ctry_g_pct_60' => '60 Minutes - Clicks Good Country %', 'c_ctry_n_pct_60' => '60 Minutes - Clicks Normal Country %', 'c_ctry_b_pct_60' => '60 Minutes - Clicks Bad Country %', 'prod_60' => '60 Minutes - Productivity', 't_prod_60' => '60 Minutes - Trade Productivity', 'return_60' => '60 Minutes - Return', 'skim_60' => '60 Minutes - Skim', 'i_raw_24' => '24 Hours - In Raw', 'i_uniq_24' => '24 Hours - In Unique', 'i_uniq_pct_24' => '24 Hours - In Unique %', 'i_proxy_24' => '24 Hours - In Proxy', 'i_ctry_g_24' => '24 Hours - In Good Country', 'i_ctry_n_24' => '24 Hours - In Normal Country', 'i_ctry_b_24' => '24 Hours - In Bad Country', 'i_ctry_g_pct_24' => '24 Hours - In Good Country %', 'i_ctry_n_pct_24' => '24 Hours - In Normal Country %', 'i_ctry_b_pct_24' => '24 Hours - In Bad Country %', 'o_raw_24' => '24 Hours - Out Raw', 'o_proxy_24' => '24 Hours - Out Proxy', 'o_ctry_g_24' => '24 Hours - Out Good Country', 'o_ctry_n_24' => '24 Hours - Out Normal Country', 'o_ctry_b_24' => '24 Hours - Out Bad Country', 'o_ctry_g_pct_24' => '24 Hours - Out Good Country %', 'o_ctry_n_pct_24' => '24 Hours - Out Normal Country %', 'o_ctry_b_pct_24' => '24 Hours - Out Bad Country %', 'c_raw_24' => '24 Hours - Clicks Raw', 'c_proxy_24' => '24 Hours - Clicks Proxy', 'c_trades_24' => '24 Hours - Clicks To Trades', 'c_ctry_g_24' => '24 Hours - Clicks Good Country', 'c_ctry_n_24' => '24 Hours - Clicks Normal Country', 'c_ctry_b_24' => '24 Hours - Clicks Bad Country', 'c_ctry_g_pct_24' => '24 Hours - Clicks Good Country %', 'c_ctry_n_pct_24' => '24 Hours - Clicks Normal Country %', 'c_ctry_b_pct_24' => '24 Hours - Clicks Bad Country %', 'prod_24' => '24 Hours - Productivity', 't_prod_24' => '24 Hours - Trade Productivity', 'return_24' => '24 Hours - Return', 'skim_24' => '24 Hours - Skim', 'domain' => 'Domain', 'site_name' => 'Site Name'); ?> <div id="dialog-content"> <div id="dialog-header"> <img src="images/dialog-close-22x22.png" id="dialog-close"/> <?php echo $editing ? 'Edit' : 'Add'; ?> a Toplist </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="Select the source for the toplist template" class="short">Source:</label> <span> <select name="source"> <?php
function build_all_toplists() { require_once 'textdb.php'; $db = new ToplistsDB(); $toplists = $db->RetrieveAll(); foreach ($toplists as $toplist) { build_toplist($toplist); } touch(FILE_TIME_TOPLISTS); }
<?php include 'global-header.php'; include 'global-menu.php'; require_once 'textdb.php'; $_REQUEST['sort_by'] = isset($_REQUEST['sort_by']) ? $_REQUEST['sort_by'] : null; $db = new ToplistsDB(); $toplists = $db->RetrieveAll($_REQUEST['sort_by']); ?> <script type="text/javascript" src="js/toplists.js"></script> <div class="centered-header"> Toplists: <span id="num-items"><?php echo count($toplists); ?> </span> Configured </div> <table align="center" width="90%" cellspacing="0" class="item-table"> <thead> <tr> <td class="ta-center" style="width: 25px;"> <input type="checkbox" class="check-all"/> </td> <td class="ta-center<?php if ($db->sorter == 'toplist_id') { echo ' sort-by'; } ?> " style="width: 55px;">
function _xToplistsBuild() { require_once 'textdb.php'; $db = new ToplistsDB(); foreach (explode(',', $_REQUEST['toplist_id']) as $toplist_id) { $toplist = $db->Retrieve($toplist_id); build_toplist($toplist); } JSON::Success(array(JSON_KEY_MESSAGE => 'Selected toplists have been built<br />If one or more of your toplists does not get generated, check the logs/error.log file for possible error messages')); }