Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Display category name in forum topics?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Display category name in forum topics?

 Post Reply Post Reply Page  12>
Author
shovel View Drop Down
Groupie
Groupie
Avatar

Joined: 08 November 2001
Location: United States
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote shovel Quote  Post ReplyReply Direct Link To This Post Topic: Display category name in forum topics?
    Posted: 12 August 2003 at 3:16pm

Hi all,

I would like to display the category name in both the forum topics and the forum posts pages.  I've been fooling around with it for a while with no success.  Anybody have an easy solution?

Thanks, Jim

Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 12 August 2003 at 11:16pm
Query the database for the Category name associated with the Forum and save it to a variable.
Back to Top
shovel View Drop Down
Groupie
Groupie
Avatar

Joined: 08 November 2001
Location: United States
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote shovel Quote  Post ReplyReply Direct Link To This Post Posted: 13 August 2003 at 1:23pm

Thanks Jámal ...

Now, I'm sure that sounds real easy to you, but as I am an ASP dabbler who mostly copies and pastes code from one place to another I'm not sure what that entails.   

Now, I can follow along in the default.asp page and see the flow of code related to categories, but I'm not sure how much of that is actually needed for this task, nor how to query regarding the particular forum or which part makes for the saving to a variable. 

I've done a lot of guessing and experimenting with a few things and surprisingly for me it often works.  I'm just at an impasse since I can't find the needed code in the pages to do what I want.  One day I'll most likely pick up an ASP book and learn it from the ground up, but that day is not today. 

Should you decide to help me any further it will be appreciated, and if not, it will be understood. 

Thanks, Jim

Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 13 August 2003 at 3:33pm
You can save a query or make it simplier by passing the category ID on the URL so you only have to query tblCategory, that's how I did it on my portal if it's not found on the URL then it queries tblForum and tblCategory i think..... you can even browse one category at the time in my forum.... http://www.uznetworkz.com/forum/ it can be a pain to get this done as you have to modify about every file on the forums...

Edited by fernan82
FeRnAN
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 13 August 2003 at 4:24pm
I just created a MOD to do this for you.

MOD

The problem with passing the Category ID is that it would be possible to produce a category ID that did not exist in the database and thus would not return the correct name. By querying it from the Forum ID you are guaranteed to get the correct Category ID for the froum
Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 13 August 2003 at 5:10pm
I don't see how you're gonna produce a category ID that doesn't exist on the db when you're passing it from other pages where it's queried from the db... i've been doing it for a while like that and it never happened...
FeRnAN
Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post Posted: 13 August 2003 at 5:28pm
Any time you pass information via the querystring if opens it up for your users to change that information. This means that the information has to be checked to insure that it is at least of the variable type you need. This is an unnecessary step when the information is easily and more accurately queried from the database.

I wouldn't call you way wrong or incorrect, just not the simplest or more straightforward method of getting the data.
Back to Top
shovel View Drop Down
Groupie
Groupie
Avatar

Joined: 08 November 2001
Location: United States
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote shovel Quote  Post ReplyReply Direct Link To This Post Posted: 14 August 2003 at 12:39pm

Originally posted by ljamal ljamal wrote:

I just created a MOD to do this for you.

Jamal, thank you so much for this MOD.  I was able to easily copy and paste it into my already heavily modified pages, thanks to your clear notation!

By the way, I want to once again thank not only Bruce for such an outstanding job on this forum but also all those who have added so many useful and easily administered MODS!

Jim 

Back to Top
 Post Reply Post Reply Page  12>

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.