Skip to content
Permalink
Browse files

added options for new logs list; updates #891

  • Loading branch information...
following5 committed Jan 23, 2016
1 parent c30eeda commit dda7ef01829a4979e0221e302cc2450c67b31809
@@ -744,7 +744,8 @@ INSERT INTO `profile_options` (`id`, `name`, `trans_id`, `internal_use`, `defaul
INSERT INTO `profile_options` (`id`, `name`, `trans_id`, `internal_use`, `default_value`, `check_regex`, `option_order`, `option_input`, `optionset`) VALUES ('10', 'Show %1preview pictures</a><br />(% of map area, 0=off):', '1928', '1', '7', '^[0-5]?[0-9]$', '150', 'text', '2');
INSERT INTO `profile_options` (`id`, `name`, `trans_id`, `internal_use`, `default_value`, `check_regex`, `option_order`, `option_input`, `optionset`) VALUES ('11', 'Show picture stats and gallery', '1944', '1', '1', '^[0-1]$', '60', 'checkbox', '1');
INSERT INTO `profile_options` (`id`, `name`, `trans_id`, `internal_use`, `default_value`, `check_regex`, `option_order`, `option_input`, `optionset`) VALUES ('13', 'Show OConly-81 stats', '2135', '1', '0', '^[0-1]$', '65', 'checkbox', '1');
INSERT INTO `profile_options` (`id`, `name`, `trans_id`, `internal_use`, `default_value`, `check_regex`, `option_order`, `option_input`, `optionset`) VALUES ('14', 'Auto-load log entries', '2153', '1', '1', '^[0-1]$', '15', 'checkbox', '1');
INSERT INTO `profile_options` (`id`, `name`, `trans_id`, `internal_use`, `default_value`, `check_regex`, `option_order`, `option_input`, `optionset`) VALUES ('14', 'Auto-load log entries', '2153', '1', '1', '^[0-1]$', '15', 'text', '1');
INSERT INTO `profile_options` (`id`, `name`, `trans_id`, `internal_use`, `default_value`, `check_regex`, `option_order`, `option_input`, `optionset`) VALUES ('15', 'New logs list selection', '2533', '1', '2', '^[1-3]$', '16', 'text', '1');

-- Table replication_overwritetypes
SET NAMES 'utf8';
@@ -2812,6 +2813,10 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2526', 'found',
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2527', 'not\&nbsp;found', '2013-11-03 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2528', 'attended', '2013-11-03 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2529', 'recommended', '2013-11-03 10:09:14');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2530', 'Current new entries', '2015-01-20 20:37:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2531', 'All new entries', '2015-01-20 20:37:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2532', '... by log date', '2015-01-20 20:37:00');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2533', 'New logs list selection', '2015-01-20 20:37:00');

-- Table sys_trans_ref
SET NAMES 'utf8';
@@ -7354,7 +7359,9 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2527', 'DE', 'nicht\&nbsp;gefunden', '2016-01-21 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2528', 'DE', 'teilgenommen', '2016-01-21 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2529', 'DE', 'empfohlen', '2016-01-21 10:09:14');

INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2530', 'DE', 'Aktuelle Neueinträge', '2015-01-20 20:37:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2531', 'DE', 'Alle Neueinträge', '2015-01-20 20:37:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2532', 'DE', '... nach Logdatum', '2015-01-20 20:37:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('1', 'EN', 'Reorder IDs', '2010-09-02 00:15:30');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2', 'EN', 'The database could not be reconnected.', '2010-08-28 11:48:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('3', 'EN', 'Testing – please do not login', '2010-08-28 11:48:07');
@@ -9189,7 +9196,9 @@ INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUE
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2527', 'EN', 'not\&nbsp;found', '2016-01-21 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2528', 'EN', 'attended', '2016-01-21 10:09:14');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2529', 'EN', 'recommended', '2016-01-21 10:09:14');

INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2530', 'EN', 'Current new entries', '2015-01-20 20:37:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2531', 'EN', 'All new entries', '2015-01-20 20:37:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2532', 'EN', '... by log date', '2015-01-20 20:37:00');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2', 'ES', 'La base de datos no se pudo conectar.', '2010-12-09 00:17:55');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('3', 'ES', 'En pruebas - por favor, no entre.', '2010-12-09 00:17:55');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('4', 'ES', 'Usuario', '2010-12-09 00:17:55');
@@ -77,6 +77,7 @@
define('USR_OPT_TRANSLANG', 12);
define('USR_OPT_OCONLY81', 13);
define('USR_OPT_LOG_AUTOLOAD', 14);
define('USR_OPT_LOGLIST_SELECTION', 15);
// user.data_license values
define('OLD_DATA_LICSENSE',0); // before deadline
@@ -13,6 +13,24 @@
$urlparams = '';
$optimize_for_latest_logs = false;
if (isset($_GET['logselection']))
{
$logselection = max(1, min($_GET['logselection']+0, 3));
if ($login->userid != 0)
{
$useroptions = new useroptions($login->userid);
$useroptions->setOptValue(USR_OPT_LOGLIST_SELECTION, $logselection);
$useroptions->save();
}
}
else if ($login->userid != 0)
{
$useroptions = new useroptions($login->userid);
$logselection = $useroptions->getOptValue(USR_OPT_LOGLIST_SELECTION);
}
else
$logselection = 2;
if (isset($ownerid))
{
// all logs for caches of one owner
@@ -58,7 +76,7 @@
$tpl->cache_id = $exclude_country;
$logcount = 250;
$paging = false; // paging would have poor performance for all logs
$orderByDate = '';
$orderByDate = $logselection == 3 ? "{fromtable}.`date` DESC, " : "";
}
else
{
@@ -80,7 +98,7 @@
$tpl->cache_id = $country;
$logcount = 250;
$paging = false; // paging would have poor performance for all logs
$orderByDate = '';
$orderByDate = $logselection == 3 ? "{fromtable}.`date` DESC, " : "";
$optimize_for_latest_logs = ($country == '' || $country == $opt['page']['main_country']);
}
@@ -90,9 +108,13 @@
$tpl->cache_id .= "|fm";
$logcount *= 2;
}
if ($logselection == 1)
{
$add_where .= "AND DATEDIFF(NOW(), {fromtable}.`date`) < 30 ";
}
$tpl->cache_id .= "|".$logselection;
$tpl->change_country_inpage = true;
$tpl->assign('creation_date', $orderByDate == '');
if (!$tpl->is_cached())
{
@@ -127,13 +149,11 @@
WHERE `cache_status`.`allow_user_view`=1
AND `caches`.`country` LIKE '&1'
AND `caches`.`country`<>'&2'
AND `username`<>'&3'
".$add_where."
ORDER BY " . $orderByDate . $fromtable.".`date_created` DESC
LIMIT &4, &5",
ORDER BY " . str_replace("{fromtable}", $fromtable, $orderByDate) . $fromtable.".`date_created` DESC
LIMIT &3, &4",
$include_country,
$exclude_country,
isset($_GET['showsyslogs']) ? '' : $opt['logic']['systemuser']['user'],
$startat,
$logcount);
if ($paging)
@@ -175,7 +195,7 @@
LEFT JOIN `cache_rating` ON `cache_rating`.`cache_id`=`caches`.`cache_id` AND `cache_rating`.`user_id`=`cache_logs`.`user_id` AND `cache_rating`.`rating_date`=`cache_logs`.`date`
LEFT JOIN `caches_attributes` ON `caches_attributes`.`cache_id`=`caches`.`cache_id` AND `caches_attributes`.`attrib_id`=6
WHERE IFNULL(`cache_logs_restored`.`restored_by`,0)=0
ORDER BY " . $orderByCountry . $orderByDate . "`cache_logs`.`date_created` DESC",
ORDER BY " . $orderByCountry . str_replace("{fromtable}", "`cache_logs`", $orderByDate) . "`cache_logs`.`date_created` DESC",
$opt['template']['locale']);
$newLogs = array();
@@ -243,6 +263,7 @@
$tpl->assign('newLogs', $newLogs);
$tpl->assign('addpiclines', max($pics-1,0));
$tpl->assign('newLogsPerCountry', $newLogsPerCountry);
$tpl->assign('logselection', $logselection);
$tpl->assign('countryCode', $country);
$tpl->assign(
@@ -52,7 +52,7 @@
<tr>
<td>{t}Delivery:{/t}</td>
<td>
<select id="interval" name="interval" onChange="intervalChanged();">
<select id="interval" name="interval" onchange="intervalChanged();">
<option value="0" {if $interval==0}selected="selected"{/if}>{t}Immediate{/t}</option>
<option value="1" {if $interval==1}selected="selected"{/if}>{t}Daily{/t}</option>
<option value="2" {if $interval==2}selected="selected"{/if}>{t}Weekly{/t}</option>
@@ -19,14 +19,43 @@
{/if}
</div>
{else}
<div class="nav4">
<ul>
<li class="group noicon {if $countryCode === ''}selected{/if}"><a href="newlogs.php">{t}All new logs{/t}</a></li>
<li class="group noicon {if !$rest && $countryCode}selected{/if}"><a href="newlogs.php?country={$opt.template.country}">{t 1=$countryName}New logs in %1{/t}</a>
<li class="group noicon {if $rest}selected{/if}"><a href="newlogsrest.php">{t 1=$mainCountryName}New logs without %1{/t}</a></li>
</ul>
</div>
<p style="clear:both;" >
<script type="text/javascript">
{literal}
<!--
function logSelectionChanged()
{
var new_logselection = document.getElementById('logselection').value;
var url = window.location.href;
url = url.replace(/[&?]logselection=[123]/, "");
if (url.indexOf('?') > 0)
url += "&";
else
url += "?";
url += "logselection=" + new_logselection;
window.location.href = url;
}
//-->
{/literal}
</script>
<table cellspacing="0" cellpadding="0" style="width:98.1%">
<tr>
<td class="nav4">
<ul>
<li class="group noicon {if $countryCode === ''}selected{/if}"><a href="newlogs.php?logselection={$logselection}">{t}All new logs{/t}</a></li>
<li class="group noicon {if !$rest && $countryCode}selected{/if}"><a href="newlogs.php?country={$opt.template.country}&logselection={$logselection}">{t 1=$countryName}New logs in %1{/t}</a>
<li class="group noicon {if $rest}selected{/if}"><a href="newlogsrest.php?logselection={$logselection}">{t 1=$mainCountryName}New logs without %1{/t}</a></li>
</ul>
</td>
<td class="default" style="text-align:right; vertical-align:top; padding-top:0.2em">
<select id="logselection" onchange="logSelectionChanged()" >
<option value="1" {if $logselection==1}selected="selected"{/if}>{t}Current new entries{/t}</option>
<option value="2" {if $logselection==2}selected="selected"{/if}>{t}All new entries{/t}</option>
<option value="3" {if $logselection==3}selected="selected"{/if}>{t}... by log date{/t}</option>
</select>
</td>
</tr>
</table>
<p>
{if $rest || !$countryCode}
<br />
{include file="res_countrylinks.tpl" newCaches=$newLogs}
@@ -88,7 +117,7 @@
{/if}
<tr>
<td style="width:1px">
{if $creation_date}{$newLog.date_created|date_format:$opt.format.date}{else}{$newLog.date|date_format:$opt.format.date}{/if}
{$newLog.date|date_format:$opt.format.date}
</td>
<td class="listicon">
{if $newLog.type==1}

0 comments on commit dda7ef0

Please sign in to comment.
You can’t perform that action at this time.