Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Categories
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Categories

 Post Reply Post Reply
Author
suedechaser View Drop Down
Groupie
Groupie


Joined: 25 February 2006
Location: USA
Status: Offline
Points: 129
Post Options Post Options   Thanks (0) Thanks(0)   Quote suedechaser Quote  Post ReplyReply Direct Link To This Post Topic: Categories
    Posted: 30 September 2006 at 2:53am
Hi All,

I was wondering if the following is possible.

If I specify a link to a specific category -eg. default.asp?C=6 - is there a way to only have that forum category / forums show in default.asp instead of all the forum categories. I hope this makes sense.

thanks in advance

regards

suede
Back to Top
Hades View Drop Down
Newbie
Newbie


Joined: 17 January 2005
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hades Quote  Post ReplyReply Direct Link To This Post Posted: 30 September 2006 at 7:46pm

Let's see if I got this right.. You want a mod that, if you click on "Web Wiz Guide's ASP Applications Support Forums", you don't see the "General Discussion", "Community Forums" and "Testing this forum" links below it.. ?

(This example is off course for Borg's Forum)
 
..I'm at work so I can't look into codes from here.. But what you have to search is the part where it is looking for the "C=" value. Then add that if there is a value and it is the one of this category, write the forum code. But if there is a value and it is NOT the one of this category, don't write anything.. And if there is no value, write the code for all categories.


Edited by Hades - 30 September 2006 at 7:49pm
Back to Top
Hades View Drop Down
Newbie
Newbie


Joined: 17 January 2005
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hades Quote  Post ReplyReply Direct Link To This Post Posted: 30 September 2006 at 11:14pm
So.. I had a look into the code to see how he defines this "C" value. I think what you are looking for (if it is what I understood) is quite simple. All you need to do is copy some lines around to include/exclude them from a condition.
 
I can't test what I'm writing, though.. I'm still at work :P
 
Find these lines :

'If the user only wants to see one category, only display the forums for that category
  If intCatShow = intCatID OR intCatShow = 0 Then
 
Cut, and past them just above the code for the table, getting this result :

  'Read in the details from the array of this category
  intCatID = CInt(sarryForums(0,intCurrentRecord))
  strCategory = sarryForums(1,intCurrentRecord)  
  
'If the user only wants to see one category, only display the forums for that category
  If intCatShow = intCatID OR intCatShow = 0 Then

%>
<table cellspacing="1" cellpadding="3" class="tableBorder" align="center">
 <tr class="tableLedger">
  <td width="4%">&nbsp;</td>
  <td width="56%"><% = strTxtForum %></td>
  <td width="6%" align="center"><% = strTxtTopics %></td>
  <td width="6%" align="center"><% = strTxtPosts %></td>
  <td width="28%" align="center"><% = strTxtLastPost %></td>
 </tr><%
  
  'Display the category name
  Response.Write vbCrLf & " <tr class=""tableSubLedger""><td colspan=""5""><a href=""default.asp?C=" & intCatID & strQsSID2 & """>" & strCategory & "</a></td></tr>"

And you'll need to move the "</table>" into the loop, just under the "Loop" command (before this line :

'Else we are not displaying forums in this category so we need to move to the next category in the array
Else
)
 
..like I said, I can't test the code here, you may have to fiddle a bit with it.


Edited by Hades - 30 September 2006 at 11:16pm
Back to Top
suedechaser View Drop Down
Groupie
Groupie


Joined: 25 February 2006
Location: USA
Status: Offline
Points: 129
Post Options Post Options   Thanks (0) Thanks(0)   Quote suedechaser Quote  Post ReplyReply Direct Link To This Post Posted: 01 October 2006 at 10:12pm
Hi Hades,

Yes, you've understood correctly - unfortunately though, I've not had a chance to work on this yet. I will have a go later today.

thank you for your assistance so far.

regards

suede
Back to Top
suedechaser View Drop Down
Groupie
Groupie


Joined: 25 February 2006
Location: USA
Status: Offline
Points: 129
Post Options Post Options   Thanks (0) Thanks(0)   Quote suedechaser Quote  Post ReplyReply Direct Link To This Post Posted: 02 October 2006 at 7:39am
Hi Hades,

You don't actually need to move the </table> tag.

Simply moving the 'If the user only wants to see one category.......lines worked nicely.

Default.asp shows all categories. Default.asp?C=X shows only the category X with all forums.

quite sweet! nice teamwork.

regards

suede
Back to Top
Hades View Drop Down
Newbie
Newbie


Joined: 17 January 2005
Status: Offline
Points: 23
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hades Quote  Post ReplyReply Direct Link To This Post Posted: 02 October 2006 at 4:40pm
Actually you do need to move the table tag.. The reason is that if you link to an empty gallery, you won't enter the "If...then" condition, and there'll be a </table> tag that wasn't opened which can lead to funny results.
 
But it's nice to see that it actually works :)
Back to Top
suedechaser View Drop Down
Groupie
Groupie


Joined: 25 February 2006
Location: USA
Status: Offline
Points: 129
Post Options Post Options   Thanks (0) Thanks(0)   Quote suedechaser Quote  Post ReplyReply Direct Link To This Post Posted: 18 October 2006 at 1:52am
Yes Hades - you are correct....and didn't I have a time trying to sort this out.

I eventually worked out what the error " Expected statement..." means.

Don't forget to also move the <% .....%> tags with the </table> !!

Thank you again.

regards

suede
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.