added display limit and 'show all' button to oconly81 page; fixes

This commit is contained in:
following 2013-08-09 17:18:29 +02:00
parent af7450e261
commit bd5cf65536
5 changed files with 31 additions and 6 deletions
htdocs

@ -402,9 +402,17 @@
/* search engines
* will be excluded from cache visitor count
* current active bots on www.opencaching.de in 03/2013:
*
* (I added this and then noticed that is may be unnecessary, as the
* visit counter function is special javascript code which probably is not
* executed by search engines. -- following)
*/
$opt['logic']['search_engines'] = 'AcoonBot;AhrefsBot;Baiduspider;bingbot;Exabot;Ezooms;Googlebot;Googlebot-mobile;ia_archiver,Linguee Bot;Mail.RU_Bot;MJ12bot;msnbot;SISTRIX Crawler;Sophora Linkchecker;TweetmemeBot;WBSearchBot;Yahoo! Slurp;YandexBot';
/* default maximum of OConly-81 ranklist members
*/
$opt['logic']['oconly81']['default_maxusers'] = 60;
/* opencaching prefixes in database available to search for
*/
$opt['logic']['ocprefixes'] = 'oc';

@ -10,10 +10,13 @@
require 'lib2/web.inc.php';
require 'lib2/logic/oconly81.inc.php';
$showall = (@$_REQUEST['showall'] == 1);
$tpl->name = 'oconly81';
$tpl->menuitem = MNU_CACHES_OCONLY81;
$tpl->caching = true;
$tpl->cache_lifetime = 900;
$tpl->cache_id = $showall ? 1 : 0;
$login->verify();
@ -28,17 +31,22 @@
INNER JOIN `user_options` ON `user_options`.`user_id`=`user`.`user_id`
WHERE `user_options`.`option_id`=13 AND `user_options`.`option_value`='1'");
// users with 0 OConly founds are filtered out here
$rs = sql("
SELECT `user`.`username`, `user`.`user_id`, COUNT(*) AS `count`
FROM `user`
INNER JOIN &oconly81 ON &oconly81.`user_id`=`user`.`user_id`
GROUP BY `user`.`user_id`
ORDER BY `count` DESC, `username` ASC");
ORDER BY `count` DESC, `username` ASC " .
($showall ? "" : "LIMIT " . sql_escape($opt['logic']['oconly81']['default_maxusers']+1)) );
$tpl->assign_rs('users', $rs);
sql_free_result($rs);
sql_drop_temp_table('oconly81');
set_oconly81_tpldata(0);
$tpl->assign('default_maxusers', $opt['logic']['oconly81']['default_maxusers']);
$tpl->assign('showall', $showall);
$tpl->display();
?>

@ -275,6 +275,8 @@ ul#statmenu { padding: 0px; margin: 0px;}
}
.content-title-noshade-size5 {margin: 0px; padding: 0px; color: rgb(88,144,168); font-weight: bold; font-size: 200%;}
.content-title-size3-more { color:black; font-size:0.8em; font-weight:normal; }
td.content-title-flag {
margin-left:0 !important;
padding-left:0 !important;

@ -20,6 +20,9 @@
<p class="content-title-noshade-size2">
<img src="resource2/{$opt.template.style}/images/profile/32x22-profile.png" style="align: left; margin-right: 10px;" width="32" height="22" />
{t}Participants{/t}
{if !$showall && ($users|@count > $default_maxusers)}
&nbsp; <span class="content-title-size3-more">[<a href="oconly81.php?showall=1">{t}Show all{/t}</a>]</span>
{/if}
</p>
</div>
@ -28,8 +31,12 @@
</p>
<ul class="col4">
{foreach from=$users item=user}
<li><a href="viewprofile.php?userid={$user.user_id}#oconly81">{$user.username}</a> ({$user.count})</li>
{foreach from=$users key=n item=user}
{if $showall || ($n < $default_maxusers)}
<li>
<a href="viewprofile.php?userid={$user.user_id}#oconly81">{$user.username}</a> ({$user.count})
</li>
{/if}
{/foreach}
</ul>

@ -23,7 +23,7 @@
<p class="content-title-noshade-size3">
<img src="resource2/{$opt.template.style}/images/misc/32x32-news.png" style="align: left; margin-right: 10px;" width="24" height="24" alt="" />
<a href="http://blog.opencaching.de/" style="color:rgb(88,144,168); text-decoration: none;">{t}News{/t}</a>
&nbsp; <span style="color:black; font-size:0.8em; font-weight:normal">[<a href="http://blog.opencaching.de/">{t}more{/t}...</a>]</span>
&nbsp; <span class="content-title-size3-more">[<a href="http://blog.opencaching.de/">{t}more{/t}...</a>]</span>
</p>
</td>
{if "$newsfeed" != ""}
@ -80,7 +80,7 @@
<p class="content-title-noshade-size3">
<img src="resource2/{$opt.template.style}/images/misc/32x32-pictures.gif" style="align: left; margin-right: 10px;" width="24" height="24" />
<a href="newlogpics.php" style="color:rgb(88,144,168); text-decoration: none;">{t}New log pictures{/t}</a>
&nbsp; <span style="color:black; font-size:0.8em; font-weight:normal">[<a href="newlogpics.php">{t}more{/t}...</a>]</span>
&nbsp; <span class="content-title-size3-more">[<a href="newlogpics.php">{t}more{/t}...</a>]</span>
</p>
</div>
{include file="res_logpictures.tpl" logdate=true loguser=true}
@ -143,7 +143,7 @@
<p class="content-title-noshade-size3">
<img src="resource2/{$opt.template.style}/images/cacheicon/traditional.gif" style="align: left; margin-right: 10px;" width="24" height="24" alt="" />
<a href="newcaches.php" style="color:rgb(88,144,168); text-decoration: none;">{t 1=$usercountry|escape}Newest caches in %1{/t}</a>
&nbsp; <span style="color:black; font-size:0.8em; font-weight:normal">[<a href="newcaches.php?country={$usercountryCode}">{t}more{/t}...</a>]</span>
&nbsp; <span class="content-title-size3-more">[<a href="newcaches.php?country={$usercountryCode}">{t}more{/t}...</a>]</span>
</p>
</div>
<p style="line-height: 1.6em;">({t 1=$count_hiddens 2=$count_founds 3=$count_users}Total of %1 active Caches and %2 founds by %3 users{/t})</p>