MOD-Beschreibung:
Fügt Links zum auf- und zuklappen der Forenkategorien hinzu. Der Zustand wird dabei per Cookie gespeichert.
phpBB-Version: phpBB 3.0.4
phpBB-Styles: prosilver
Benötigt:
jquery
jquery-Cookie-Plugin
Einbau:
- Ordner 'js' im Forumverzeichnis anlegen
- Die beiden heruntergeladenen Datein speichern
ÖFFNE: includes/functions.php
SUCHE:
Code: Alles auswählen
'SITE_DESCRIPTION' => $config['site_desc'],
Code: Alles auswählen
'COOKIE_NAME' => $config['cookie_name'],
ÖFFNE: styles/prosilver/template/overall_header.html
SUCHE:
Code: Alles auswählen
<script type="text/javascript" src="{T_TEMPLATE_PATH}/forum_fn.js"></script>
Code: Alles auswählen
<script type="text/javascript" src="{ROOT_PATH}js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="{ROOT_PATH}js/jquery.cookie.js"></script>
Code: Alles auswählen
<link href="{T_THEME_PATH}/print.css" rel="stylesheet" type="text/css" media="print" title="printonly" />
Code: Alles auswählen
<script type="text/javascript">
// <![CDATA[
$(document).ready(function() {
var id = [];
var cookie = {
get: false,
name:'{COOKIE_NAME}_cb_{SCRIPT_NAME}{FORUM_ID}',
value: []
};
cookie.get = $.cookie(cookie.name);
if (cookie.get) {cookie.value = cookie.get.split(',');}
$("[id^='colbox-switch-']").each(function() {
id.push($(this).attr("id").replace('colbox-switch-',''));
});
for (var i = 0; i < id.length; i++) {
if ($.inArray(id[i],cookie.value) !== -1) {
$('#colbox-switch-' + id[i]).addClass('cb_collapsed').text('[+]');
$('#colbox-content-' + id[i]).hide();
} else {
$('#colbox-switch-' + id[i]).addClass('cb_expanded').text('[-]');
}
$('#colbox-switch-' + id[i]).click(function() {
var thisid = $(this).attr("id").replace('colbox-switch-','');
if ($(this).attr('class') == 'cb_collapsed') {
$(this).removeClass('cb_collapsed').addClass('cb_expanded').text('[-]');
$("#colbox-content-" + thisid).slideDown(200);
} else {
$(this).removeClass('cb_expanded').addClass('cb_collapsed').text('[+]');
$("#colbox-content-" + thisid).slideUp(200);
}
});
}
$(window).unload(function() {
var c = [];
$('[id^="colbox-switch-"]').each(function() {
if ($(this).hasClass('cb_collapsed')) { c.push($(this).attr("id").replace('colbox-switch-','')); }
});
if (c.length) {$.cookie(cookie.name,c,{expires: 365});}
else {$.cookie(cookie.name,null);}
});
});
// ]]>
</script>
SUCHE:
Code: Alles auswählen
<dt><!-- IF forumrow.S_IS_CAT --><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a><!-- ELSE -->{L_FORUM}<!-- ENDIF -->
Code: Alles auswählen
<span id="colbox-switch-{forumrow.FORUM_ID}"></span>
Code: Alles auswählen
<ul class="topiclist forums">
Code: Alles auswählen
<ul id="colbox-content-{forumrow.FORUM_ID}" class="topiclist forums">
Code: Alles auswählen
.cb_collapsed, .cb_expanded {
font-family: Courier;
font-size: 1.2em;
line-height: 1.2em;
position:absolute;
top:2px;
right:5px;
bottom: 4px;
}
ÖFFNE: styles/subsilver2/template/overall_header.html
SUCHE:
Code: Alles auswählen
<link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" />
Code: Alles auswählen
<script type="text/javascript" src="{ROOT_PATH}js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="{ROOT_PATH}js/jquery.cookie.js"></script>
<script type="text/javascript">
// <![CDATA[
$(document).ready(function() {
var id = [];
var cookie = {
get: false,
name:'{COOKIE_NAME}_cb_{SCRIPT_NAME}{FORUM_ID}',
value: []
};
cookie.get = $.cookie(cookie.name);
if (cookie.get) {cookie.value = cookie.get.split(',');}
// fix 'last post' width
$('th:eq(3)').css('width', $('th:eq(3)').width());
$("[id^='colbox-switch-']").each(function() {
id.push( $(this).attr("id").replace('colbox-switch-','') );
});
for (var i = 0; i < id.length; i++) {
if ($.inArray(id[i],cookie.value) !== -1) {
$('#colbox-switch-' + id[i]).addClass('cb_collapsed').text('[+]');
$(".colbox-content-" + id[i]).each(function() {
$(this).hide();
});
} else {
$('#colbox-switch-' + id[i]).addClass('cb_expanded').text('[-]');
}
$('#colbox-switch-' + id[i]).click(function() {
var thisid = $(this).attr("id").replace('colbox-switch-','');
if ($(this).attr('class') == 'cb_collapsed') {
$(this).removeClass('cb_collapsed').addClass('cb_expanded').text('[-]');
$(".colbox-content-" + thisid).each(function() {
$(this).slideDown(0);
});
} else {
$(this).removeClass('cb_expanded').addClass('cb_collapsed').text('[+]');
$(".colbox-content-" + thisid).each(function() {
$(this).slideUp(0);
});
}
});
}
$(window).unload(function() {
var c = [];
$('[id^="colbox-switch-"]').each(function() {
if ($(this).hasClass('cb_collapsed')) { c.push($(this).attr("id").replace('colbox-switch-','')); }
});
if (c.length) {$.cookie(cookie.name,c,{expires: 365});}
else {$.cookie(cookie.name,null);}
});
});
// ]]>
</script>
SUCHE:
Code: Alles auswählen
<!-- IF forumrow.S_IS_CAT -->
Code: Alles auswählen
<!-- DEFINE $COLBOX_BUTTON = 'colbox-switch-{forumrow.FORUM_ID}' -->
<!-- DEFINE $COLBOX_CONTENT = 'colbox-content-{forumrow.FORUM_ID}' -->
Code: Alles auswählen
<td class="cat" colspan="2"><h4>
Code: Alles auswählen
<span id="{$COLBOX_BUTTON}"></span>
Code: Alles auswählen
<!-- IF forumrow.S_NO_CAT -->
Code: Alles auswählen
<!-- DEFINE $COLBOX_BUTTON = 'colbox-switch-{forumrow.FORUM_ID}' -->
<!-- DEFINE $COLBOX_CONTENT = 'colbox-content-{forumrow.FORUM_ID}' -->
Code: Alles auswählen
<td class="cat" colspan="2"><h4>
Code: Alles auswählen
<span id="{$COLBOX_BUTTON}"></span>
Code: Alles auswählen
<tr">
Code: Alles auswählen
<tr class="{$COLBOX_CONTENT}">
Demo: http://www.phpbb.de/community/viewtopic ... 9#p1085829
