4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 Show/Hide Category Like On This Forum
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
thor
WebHelper
WebHelper


Joined: 10 Mar 2003
Posts: 71

PostPosted: Thu Jan 15, 2004 8:49 pm (13 years, 9 months ago) Reply with QuoteBack to Top

Hey

Daniel would you be able to take a quick look at this code and tell me where i`v gone wrong. I`m trying to do the show/hide like you`ve done on your forums but for some reason when i try to show or hide the category it only hides the first forum in the category?


Heres the code for the template files "index_body.tpl"

Code:

<table width="100%" cellspacing="0" cellpadding="2" border="0" align="center">
  <tr>
   <td align="left" valign="bottom"><span class="gensmall">
   <!-- BEGIN switch_user_logged_in -->
   {LAST_VISIT_DATE}<br />
   <!-- END switch_user_logged_in -->
   {CURRENT_TIME}<br /></span><span class="nav"><a href="{U_INDEX}" class="nav">{L_INDEX}</a></span></td>
   <td align="right" valign="bottom" class="gensmall">
      <!-- BEGIN switch_user_logged_in -->
      <a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br /><a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_SELF}</a><br />
      <!-- END switch_user_logged_in -->
      <a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a></td>
  </tr>
</table>

<table width="100%" cellpadding="2" cellspacing="1" border="0" class="forumline">
  <tr>
   <th colspan="2" class="thCornerL" height="25" nowrap="nowrap"> {L_FORUM} </th>
   <th width="50" class="thTop" nowrap="nowrap"> {L_TOPICS} </th>
   <th width="50" class="thTop" nowrap="nowrap"> {L_POSTS} </th>
   <th class="thCornerR" nowrap="nowrap"> {L_LASTPOST} </th>
  </tr>
  <!-- BEGIN catrow -->
  <tr>
   <td class="catLeft" colspan="2" height="28"><span class="cattitle"><a href="#" class="cattitle" onclick="displayElement('{catrow.U_VIEWCAT}'); return false;">{catrow.CAT_DESC}</a></span></td>
   <td class="rowpic" colspan="3" align="right">&nbsp;</td>
  </tr>
  <!-- BEGIN forumrow -->
  <tbody id="{catrow.U_VIEWCAT}">
  <tr>
   <td class="row1" align="center" valign="middle" height="50"><img src="{catrow.forumrow.FORUM_FOLDER_IMG}" width="46" height="25" alt="{catrow.forumrow.L_FORUM_FOLDER_ALT}" title="{catrow.forumrow.L_FORUM_FOLDER_ALT}" /></td>
   <td class="row1" width="100%" height="50"><span class="forumlink"> <a href="{catrow.forumrow.U_VIEWFORUM}" class="forumlink">{catrow.forumrow.FORUM_NAME}</a><br />
     </span> <span class="genmed">{catrow.forumrow.FORUM_DESC}<br />
     </span><span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span></td>
   <td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.TOPICS}</span></td>
   <td class="row2" align="center" valign="middle" height="50"><span class="gensmall">{catrow.forumrow.POSTS}</span></td>
   <td class="row2" align="center" valign="middle" height="50" nowrap="nowrap"> <span class="gensmall">{catrow.forumrow.LAST_POST}</span></td>
  </tr>
  <!-- END forumrow -->
  </tbody>
  <!-- END catrow -->
  <script language="Javascript">checkDisplayStatus('{catrow.U_VIEWCAT}', 'show');</script>
</table>

<table width="100%" cellspacing="0" border="0" align="center" cellpadding="2">
  <tr>
   <td align="left"><span class="gensmall"><a href="{U_MARK_READ}" class="gensmall">{L_MARK_FORUMS_READ}</a></span></td>
   <td align="right"><span class="gensmall">{S_TIMEZONE}</span></td>
  </tr>
</table>

<table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
  <tr>
   <td class="catHead" colspan="2" height="28"><span class="cattitle"><a href="{U_VIEWONLINE}" class="cattitle">{L_WHO_IS_ONLINE}</a></span></td>
  </tr>
  <tr>
   <td class="row1" align="center" valign="middle" rowspan="2"><img src="templates/subSilver/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
   <td class="row1" align="left" width="100%"><span class="gensmall">{TOTAL_POSTS}<br />{TOTAL_USERS}<br />{NEWEST_USER}</span>
   </td>
  </tr>
  <tr>
   <td class="row1" align="left"><span class="gensmall">{TOTAL_USERS_ONLINE}   [ {L_WHOSONLINE_ADMIN} ]   [ {L_WHOSONLINE_MOD} ]<br />{RECORD_USERS}<br />{LOGGED_IN_USER_LIST}</span></td>
  </tr>
</table>

<table width="100%" cellpadding="1" cellspacing="1" border="0">
<tr>
   <td align="left" valign="top"><span class="gensmall">{L_ONLINE_EXPLAIN}</span></td>
</tr>
</table>

<!-- BEGIN switch_user_logged_out -->
<form method="post" action="{S_LOGIN_ACTION}">
  <table width="100%" cellpadding="3" cellspacing="1" border="0" class="forumline">
   <tr>
     <td class="catHead" height="28"><a name="login"></a><span class="cattitle">{L_LOGIN_LOGOUT}</span></td>
   </tr>
   <tr>
     <td class="row1" align="center" valign="middle" height="28"><span class="gensmall">{L_USERNAME}:
      <input class="post" type="text" name="username" size="10" />
         {L_PASSWORD}:
      <input class="post" type="password" name="password" size="10" maxlength="32" />
           {L_AUTO_LOGIN}
      <input class="text" type="checkbox" name="autologin" />
         
      <input type="submit" class="mainoption" name="login" value="{L_LOGIN}" />
      </span> </td>
   </tr>
  </table>
</form>
<!-- END switch_user_logged_out -->

<br clear="all" />

<table cellspacing="3" border="0" align="center" cellpadding="0">
  <tr>
   <td width="20" align="center"><img src="templates/subSilver/images/folder_new.gif" alt="{L_NEW_POSTS}"/></td>
   <td><span class="gensmall">{L_NEW_POSTS}</span></td>
   <td>  </td>
   <td width="20" align="center"><img src="templates/subSilver/images/folder.gif" alt="{L_NO_NEW_POSTS}" /></td>
   <td><span class="gensmall">{L_NO_NEW_POSTS}</span></td>
   <td>  </td>
   <td width="20" align="center"><img src="templates/subSilver/images/folder_lock.gif" alt="{L_FORUM_LOCKED}" /></td>
   <td><span class="gensmall">{L_FORUM_LOCKED}</span></td>
  </tr>
</table>
OfflineView User's ProfileFind all posts by thorSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Fri Jan 16, 2004 6:21 am (13 years, 9 months ago) Reply with QuoteBack to Top

I don't remember releasing this script... Wink

Problem is probably that the <tbody> tag starts in the forumrow instead of the catrow. Also I wouldn't recommend using URLs to keep track of the cookies...

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
thor
WebHelper
WebHelper


Joined: 10 Mar 2003
Posts: 71

PostPosted: Fri Jan 16, 2004 10:08 am (13 years, 9 months ago) Reply with QuoteBack to Top

lol Smile thanx that works now Smile

what do you suggest i put instead of
Code:
<tbody id="{catrow.U_VIEWCAT}">


?
OfflineView User's ProfileFind all posts by thorSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Fri Jan 16, 2004 5:07 pm (13 years, 9 months ago) Reply with QuoteBack to Top

You'd have to send the category ID to the template with a name like "CAT_ID".

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
thor
WebHelper
WebHelper


Joined: 10 Mar 2003
Posts: 71

PostPosted: Fri Jan 16, 2004 5:29 pm (13 years, 9 months ago) Reply with QuoteBack to Top

how would i go about doing that? sorry about this lol
OfflineView User's ProfileFind all posts by thorSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Fri Jan 16, 2004 5:31 pm (13 years, 9 months ago) Reply with QuoteBack to Top

You go into the index.php file, look for the line which assigns the "U_VIEWCAT" variable and add another similar line, which just has the ID in it and not the whole URL.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
thor
WebHelper
WebHelper


Joined: 10 Mar 2003
Posts: 71

PostPosted: Fri Jan 16, 2004 5:40 pm (13 years, 9 months ago) Reply with QuoteBack to Top

and how would i do that? lol i`m real sorry about this maybe one day i`l be clever and i`l be able to figure this out for myself instead of bugging you.
OfflineView User's ProfileFind all posts by thorSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Fri Jan 16, 2004 5:44 pm (13 years, 9 months ago) Reply with QuoteBack to Top

After looking at the file, it seems like it's there in a default installation. So just use {catrow.CAT_ID} in your template.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
thor
WebHelper
WebHelper


Joined: 10 Mar 2003
Posts: 71

PostPosted: Fri Jan 16, 2004 7:14 pm (13 years, 9 months ago) Reply with QuoteBack to Top

It doesn`t seem to work i get some javascript errors which are all the coming from the

Code:
<script language="Javascript">checkDisplayStatus('{catrow.CAT_ID}', 'show');</script>

part. i`m not sure if this has anything to do with it but when i view the source of the source of the forum it shows
Code:
  <script language="Javascript">checkDisplayStatus('1', 'show');</script>

and on your forums it shows
Code:
<script language="Javascript">checkDisplayStatus('cat_7', 'show');</script>


So maybe it has something to do with my forums not having the cat? bit before the number lol i really have no clue could you help me out please?
OfflineView User's ProfileFind all posts by thorSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Fri Jan 16, 2004 7:42 pm (13 years, 9 months ago) Reply with QuoteBack to Top

You can try adding the "cat_" bit although I'm not sure what that would change (maybe the script has a problem with numbers on their own - I've never tried that). What is the JS error about?

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
thor
WebHelper
WebHelper


Joined: 10 Mar 2003
Posts: 71

PostPosted: Fri Jan 16, 2004 7:44 pm (13 years, 9 months ago) Reply with QuoteBack to Top

it says

Code:

Line: All the lines that the bit of code i showed is on
Char: 1
Error: Object Expected
Code: 0
Url: http://localhost/board
OfflineView User's ProfileFind all posts by thorSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Fri Jan 16, 2004 7:46 pm (13 years, 9 months ago) Reply with QuoteBack to Top

So does the error disappear when you add "cat_" before the ID, in the <script> part and in the link?

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
thor
WebHelper
WebHelper


Joined: 10 Mar 2003
Posts: 71

PostPosted: Fri Jan 16, 2004 7:49 pm (13 years, 9 months ago) Reply with QuoteBack to Top

i`m not sure i didnt try that but i did something else and its fixed now Smile thanx for all the help Smile
OfflineView User's ProfileFind all posts by thorSend Personal Message
thor
WebHelper
WebHelper


Joined: 10 Mar 2003
Posts: 71

PostPosted: Sun Jan 18, 2004 3:53 pm (13 years, 9 months ago) Reply with QuoteBack to Top

I got another small question i`m trying to figure out how to chaneg the images but i just cant figure out what to put in the image src bit. So far i`v got..

Code:
<img src="" id="toggleimg_{catrow.CAT_ID}" width="12" height="12" alt="" border="0">


Thanx for all the help i will give credit to your website in the script Smile
OfflineView User's ProfileFind all posts by thorSend Personal Message
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Sun Jan 18, 2004 4:22 pm (13 years, 9 months ago) Reply with QuoteBack to Top

Your images should be called something_open.gif and something_closed.gif. In "src=", put something_open.gif.

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   


Go to page 1, 2  Next

You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.077978 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme