Skip to content
Permalink
Browse files

added more-logs autoloader

  • Loading branch information...
following5 committed Aug 6, 2013
1 parent 1a2d821 commit 41f7248ae2e7ed9bd01aab3f061b6f2f1a85f26b
@@ -694,6 +694,7 @@ 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');

-- Table replication_overwritetypes
SET NAMES 'utf8';
@@ -2573,6 +2574,8 @@ INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2148', '... by
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2149', '... by region', '2010-09-07 20:19:07');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2150', 'This geocache is probably placed within the following protection areas:', '2011-05-20 23:48:29');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2151', 'Also listed as', '2011-05-20 23:48:29');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2152', 'Loading more log entries ...', '2011-05-20 23:48:29');
INSERT INTO `sys_trans` (`id`, `text`, `last_modified`) VALUES ('2153', 'Auto-load log entries', '2011-05-20 23:48:29');

-- Table sys_trans_ref
SET NAMES 'utf8';
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2149', 'DE', '... nach Region', '2010-09-07 20:19:07');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2150', 'DE', 'Dieser Geocache liegt vermutlich in den folgenden Schutzgebieten:', '2011-05-23 22:18:40');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2151', 'DE', 'Auch gelistet als', '2011-05-23 22:18:40');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2152', 'DE', 'Lade weitere Logeinträge ...', '2011-05-23 22:18:40');
INSERT INTO `sys_trans_text` (`trans_id`, `lang`, `text`, `last_modified`) VALUES ('2153', 'DE', 'Logeinträge automatisch nachladen', '2011-05-23 22:18:40');
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');
@@ -73,6 +73,7 @@
define('USR_OPT_PICSTAT', 11);
define('USR_OPT_TRANSLANG', 12);
define('USR_OPT_OCONLY81', 13);
define('USR_OPT_LOG_AUTOLOAD', 14);
// user.data_license values
define('OLD_DATA_LICSENSE',0); // before deadline
Binary file not shown.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1,68 @@
/***************************************************************************
* For license information see doc/license.txt
*
* Unicode Reminder メモ
*
* Javascript toolbox
***************************************************************************/


// detect client size and scoll position on all browsers
//
// based on http://www.ajaxschmiede.de/javascript/fenstergrose-und-scrollposition-in-javascript-auslesen/

function getClientWidth()
{
if (typeof(window.innerWidth) == 'number')
return window.innerWidth; // Non-IE
else
return Math.max(document.documentElement.clientWidth, document.body.clientWidth); // IE
}

function getClientHeight()
{
if (typeof(window.innerHeight) == 'number')
return window.innerHeight; // Non-IE
else
return Math.max(document.documentElement.clientHeight, document.body.clientHeight); // IE
}

function getScrollX()
{
if (typeof(window.pageXOffset) == 'number')
return window.pageXOffset; // Non-IE
else
return Math.max(document.body.scrollLeft, document.documentElement.scrollLeft); // IE
}

function getScrollY()
{
if (typeof(window.pageYOffset) == 'number')
return window.pageYOffset; // Non-IE
else
return Math.max(document.body.scrollTop, document.documentElement.scrollTop); // IE
}


// detect document height in all browsers
//
// from http://james.padolsey.com/javascript/get-document-height-cross-browser/

function getDocHeight()
{
var D = document;
return Math.max(
D.body.scrollHeight, D.documentElement.scrollHeight,
D.body.offsetHeight, D.documentElement.offsetHeight,
D.body.clientHeight, D.documentElement.clientHeight
);
}


// detect if the user scolled to the document bottom

function scrolledToBottom(tolerance)
{
// alert(getScrollY() + " " + getClientHeight() + " " + getDocHeight());
return getScrollY() + getClientHeight() + tolerance >= getDocHeight();
}
@@ -68,6 +68,8 @@
{t}Not registered?{/t} <a href="register.php">{t}Register{/t}</a><br />
{t}Forgotten your password?{/t} <a href="newpw.php">{t}Create a new password{/t}</a><br />
{t}Forgotten your E-Mail-Address?{/t} <a href="remindemail.php">{t}Remind me{/t}</a><br />
</p>
<p>
{t}Here you can find more troubleshooting:{/t} <a href="http://wiki.opencaching.de/index.php/Login_auf_Opencaching.de" target="_blank">{t}Problems with login{/t}</a>.
</p>
<div class="buffer" style="width: 500px;">&nbsp;</div>
@@ -6,6 +6,8 @@
{* OCSTYLE *}
{if $log != "N"}

{if $tagloadlogs}<ocloadlogs>{/if}

{if $header==true}
<div class="content2-container bg-blue02" id="logentries">
<p class="content-title-noshade-size2">
@@ -30,7 +32,7 @@
{include file="res_logentry_logitem.tpl" logs=$logs cache=$cache}
{/foreach}

{if $footer==true}
{if $footer==true && !$tagloadlogs}

{if $footbacklink==true}

@@ -43,12 +45,14 @@
{* $footer==true *}
{/if}

{if tagloadlogs}</ocloadlogs>{/if}

{* $log != "N" *}
{/if}


<script type="text/javascript">
<!--
remove_piclinks();
init_enlargeit_for_logentries();
-->
</script>
@@ -8,6 +8,7 @@
<script type="text/javascript" src="resource2/{$opt.template.style}/js/tip_balloon.js"></script>
<script type="text/javascript" src="resource2/{$opt.template.style}/js/tip_centerwindow.js"></script>
<script type="text/javascript" src="resource2/{$opt.template.style}/js/rot13.js"></script>
<script type="text/javascript" src="resource2/{$opt.template.style}/js/tools.js"></script>

<script type="text/javascript">
{literal}
@@ -29,6 +30,8 @@
xmlReq.send(params);
}
window.setTimeout("visitCounter()", 1000);
function createXMLHttp()
{
if (typeof XMLHttpRequest != 'undefined')
@@ -51,7 +54,41 @@
return null;
}
window.setTimeout("visitCounter()", 1000);
function loadRestOfLogs()
{
var xmlhttp = createXMLHttp();
if (!xmlhttp)
return;
document.getElementById('showalllogs_img').src = 'resource2/ocstyle/images/misc/16x16-ajax-loader.gif';
document.getElementById('showalllogs_text').innerHTML = "{/literal}{t}Loading more log entries ...{/t}{literal}";
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
var logblockstart = xmlhttp.responseText.indexOf('<ocloadlogs>');
var logblockend = xmlhttp.responseText.indexOf('</ocloadlogs>');
if (logblockstart > 0 && logblockend > logblockstart)
{
document.getElementById('logblock').innerHTML = xmlhttp.responseText.substring(logblockstart+12, logblockend);
init_enlargeit_for_logentries();
}
}
}
xmlhttp.open("GET", "viewlogs.php?cacheid={/literal}{$cache.cacheid}{literal}&tagloadlogs=1", true);
xmlhttp.send();
}
function onScroll(oEvent)
{
if (scrolledToBottom(70))
{
window.onscroll = null;
loadRestOfLogs();
}
}
//-->
{/literal}
</script>
@@ -495,15 +532,25 @@
<!-- End GK -->
<!-- Logs -->
{include file="res_logentry.tpl" header=true footer=true footbacklink=false logs=$logs cache=$cache}
<div id="logblock">
{include file="res_logentry.tpl" header=true footer=true footbacklink=false logs=$logs cache=$cache}
{if $showalllogs}
<div class="content2-container bg-blue02">
<p id="showalllogs" class="content-title-noshade-size2">
<img id="showalllogs_img" src="resource2/{$opt.template.style}/images/action/16x16-showall.png" style="align: left; margin-right: 10px;" width="16" height="16" alt="{t}Show all logentries{/t}" />
<span id="showalllogs_text">[<a href="viewcache.php?cacheid={$cache.cacheid}&log=A#logentries">{t}Show all logentries{/t}</a>]</span>
</p>
</div>
<div style="clear:both"></div> {* MSIE needs this to keep some space below the show-all-logs block *}
{/if}
</div>
{if $showalllogs}
<div class="content2-container bg-blue02">
<p class="content-title-noshade-size2">
<img src="resource2/{$opt.template.style}/images/action/16x16-showall.png" style="align: left; margin-right: 10px;" width="16" height="16" alt="{t}Show all logentries{/t}" />
[<a href="viewcache.php?cacheid={$cache.cacheid}&log=A#logentries">{t}Show all logentries{/t}</a>]
</p>
</div>
{if $showalllogs && $autoload_logs}
<script type="text/javascript">
window.onscroll = onScroll;
</script>
{/if}
<!-- End Logs -->
{/if} {* not $show_logpics *}
@@ -310,15 +310,21 @@ function getChildWaypoints($cacheid)
else
$tpl->assign('logpics', get_logpics(LOGPICS_FOR_CACHE_STAT, 0, $cacheid));
/* process the cachmap options
/* process profile settings
*/
$userzoom = 11;
if ($login->userid > 0)
{
$useropt = new useroptions($login->userid);
$userzoom = $useropt->getOptValue(USR_OPT_GMZOOM);
$autoload_logs = $useropt->getOptValue(USR_OPT_LOG_AUTOLOAD);
}
else
{
$autoload_logs = false;
}
$tpl->assign('userzoom', $userzoom);
$tpl->assign('autoload_logs', $autoload_logs);
// get the correct mapkey
$sHost = strtolower($_SERVER['HTTP_HOST']);
@@ -74,6 +74,7 @@
$tpl->assign('cache', $rCache);
$tpl->assign('logs', cache::getLogsArray($cache_id, $start, $count, $deleted));
$tpl->assign('tagloadlogs', @$_REQUEST['tagloadlogs'] == 1);
$tpl->display();

0 comments on commit 41f7248

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