Skip to content
Permalink
Browse files

moved newlogs setting from user options to cookie; closes #891

  • Loading branch information...
following5 committed Feb 1, 2016
1 parent 6eefd9a commit 45ff858f348144338030ebbc5351b743d328d94c
@@ -745,7 +745,6 @@ 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 ('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', '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';
@@ -2816,7 +2815,6 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2529', 'recomme
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';
@@ -77,7 +77,7 @@
define('USR_OPT_TRANSLANG', 12);
define('USR_OPT_OCONLY81', 13);
define('USR_OPT_LOG_AUTOLOAD', 14);
define('USR_OPT_LOGLIST_SELECTION', 15);
// ID 15 was temporarily used and is reserved, see commit dda7ef0. Continue with 16.
// user.data_license values
define('OLD_DATA_LICSENSE',0); // before deadline
@@ -16,20 +16,16 @@
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();
}
$cookie->set('newlogs',$logselection);
}
else if ($login->userid != 0)
else
{
$useroptions = new useroptions($login->userid);
$logselection = $useroptions->getOptValue(USR_OPT_LOGLIST_SELECTION);
$logselection = $cookie->get('newlogs');
if ($logselection === false)
$logselection = 2;
else
$logselection = max(1, min($cookie->get('newlogs'), 3));
}
else
$logselection = 2;
if (isset($ownerid))
{
@@ -41,9 +41,9 @@
<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>
<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>
</td>
<td class="default" style="text-align:right; vertical-align:top; padding-top:0.2em">

0 comments on commit 45ff858

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