Sera a tutti quanti,
avrei bisogno di un aiuto.
Nel mio forum [PHPBB3] vorrei inserire nelle tabelle degli argomenti in home page, un link per ogni tabella in alto, nel quale cliccando in esso si pùo nascondere o mostrare il contenuto della tabella.
Grazie a guide ho scritto (o almeno, ci ho provato) un codice javascript
Ed è:
Codice:
function mostra_nascondi(id_riga,i){
var IE=(window.navigator.userAgent.indexOf('MSIE')>-1)?1:0;
document.getElementById(id_riga).style.display=(document.getElementById(id_riga).style.display=='none')?((IE)?'block':'table-row'):'none';
if(document.all['riga'+i].style.display== "none") {
// chiuso
document.all['piu'+i].style.display = "block";
document.all['meno'+i].style.display = "none";
} else {
// aperto
document.all['piu'+i].style.display = "none";
document.all['meno'+i].style.display = "block";
}
}
// questa la richiamo sull'onload del tag body
function resettaRighe(){
for(i=0;i<15;i++){
document.all['riga'+i].style.display = "none";
document.all['meno'+i].style.display = "none";
}
}
Mentre nel file forumlist_body con le modifiche apportate, il codice è
Codice:
<!-- BEGIN forumrow -->
<!-- IF (forumrow.S_IS_CAT and not forumrow.S_FIRST_ROW) or forumrow.S_NO_CAT -->
</ul>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->
<!-- IF forumrow.S_IS_CAT or forumrow.S_FIRST_ROW or forumrow.S_NO_CAT -->
<div class="forabg">
<div class="inner"><span class="corners-top"><span></span></span>
<table><tbody><tr><td><a href="#" onclick="mostra_nascondi('riga1');return false"><img src="admin/gif/a.gif" width="11" height="9" border="0"></a><br /></td></tr></tbody></table><table><tbody><tr id="riga1">
<ul class="topiclist">
<li class="header">
<dl class="icon">
<dt><!-- IF forumrow.S_IS_CAT --><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a><!-- ELSE -->{L_FORUM}<!-- ENDIF --></dt>
<dd class="topics">{L_TOPICS}</dd>
<dd class="posts">{L_POSTS}</dd>
<dd class="lastpost"><span>{L_LAST_POST}</span></dd>
</dl>
</li> </ul>
<ul class="topiclist forums">
<!-- ENDIF -->
<!-- IF not forumrow.S_IS_CAT -->
<li class="row">
<dl class="icon" style="width:93%;background-image: url({forumrow.FORUM_FOLDER_IMG_SRC}); background-repeat: no-repeat;">
<dt title="{forumrow.FORUM_FOLDER_IMG_ALT}">
<!-- IF S_ENABLE_FEEDS and forumrow.S_FEED_ENABLED --><!-- <a class="feed-icon-forum" title="{L_FEED} - {forumrow.FORUM_NAME}" href="{U_FEED}?f={forumrow.FORUM_ID}"><img src="{T_THEME_PATH}/images/feed.gif" alt="{L_FEED} - {forumrow.FORUM_NAME}" /></a> --><!-- ENDIF -->
<!-- IF forumrow.FORUM_IMAGE --><span class="forum-image">{forumrow.FORUM_IMAGE}</span><!-- ENDIF -->
<a href="{forumrow.U_VIEWFORUM}" class="forumtitle">{forumrow.FORUM_NAME}</a><br />
{forumrow.FORUM_DESC}
<!-- IF forumrow.MODERATORS -->
<br /><strong>{forumrow.L_MODERATOR_STR}:</strong> {forumrow.MODERATORS}
<!-- ENDIF -->
<!-- IF forumrow.SUBFORUMS and forumrow.S_LIST_SUBFORUMS --><br /><strong>{forumrow.L_SUBFORUM_STR}</strong> {forumrow.SUBFORUMS}<!-- ENDIF -->
</dt>
<!-- IF forumrow.CLICKS -->
<dd class="redirect"><span>{L_REDIRECTS}: {forumrow.CLICKS}</span></dd>
<!-- ELSEIF not forumrow.S_IS_LINK -->
<dd class="topics" style="width:10%;">{forumrow.TOPICS} <dfn>{L_TOPICS}</dfn></dd>
<dd class="posts" style="width:10%;">{forumrow.POSTS} <dfn>{L_POSTS}</dfn></dd>
<dd class="lastpost" style="width:22%;"><span>
<!-- IF forumrow.LAST_POST_TIME --><dfn>{L_LAST_POST}</dfn> <a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}"><b>{forumrow.LAST_POST_SUBJECT_SHORT} </b></a>
<br>{L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL}
<!-- IF not S_IS_BOT --><a href="{forumrow.U_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF --><br />{forumrow.LAST_POST_TIME}<!-- ELSE -->{L_NO_POSTS}<br /> <!-- ENDIF --></span>
</dd>
<!-- ENDIF -->
</dl>
</li>
<!-- ENDIF -->
<!-- IF forumrow.S_LAST_ROW -->
</ul>
</tr></tbody></table>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- ENDIF -->
<!-- BEGINELSE -->
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<strong>{L_NO_FORUMS}</strong>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- END forumrow -->
Purtroppo non funziona, e non saprei cosa devo cambiare....