Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Discussions (General)
 Can't find forum name
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

withanhdammit
Junior Member

USA
236 Posts

Posted - 02 March 2005 :  22:33:42  Show Profile  Visit withanhdammit's Homepage  Send withanhdammit an ICQ Message
I'm working on updating the Admin Moderators v11 (? v1.1) mod by Da_Stimulator to work with Snitz v3.4.05 (probably all 3.4.xx versions - but I'm not 100% sure).

I can't find the string name for the forum name. If I use strForumTitle I get the name of the entire Forum that's set in Admin Options/Main Forum Config. The mod includes pop_admin_moderators.asp that makes easy to add/remove moderators from a forum. I want the pop-up to show the forum name you're working on just as a check.

If you want to see the forum I'm working on, email me and I'll send you an admin login you can use so you can see what the deal is.

If anyone needs more information, let me know and I'll do my best to furnish it. I'm not an asp developer, but these forums have motivated me, and I'm starting to learn how it all works.

Thanks!

h

Podge
Support Moderator

Ireland
3775 Posts

Posted - 03 March 2005 :  07:57:02  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
You would have to find the FORUM_ID then
use a query to select the forum title from the FORUM_FORUM table and include it in your popup.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

withanhdammit
Junior Member

USA
236 Posts

Posted - 03 March 2005 :  09:35:38  Show Profile  Visit withanhdammit's Homepage  Send withanhdammit an ICQ Message
Thanks Podge. I found the FORUM_ID, but the query is a little over my head. I do know the field in the db is F_SUBJECT. Any help with writing the query?

h
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 03 March 2005 :  09:48:34  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
select F_SUBJECT from FORUM_FORUM where FORUM_ID = 5

change 5 to whatever variable you're using.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 03 March 2005 :  10:27:45  Show Profile
No need to double post, H.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

withanhdammit
Junior Member

USA
236 Posts

Posted - 03 March 2005 :  16:06:16  Show Profile  Visit withanhdammit's Homepage  Send withanhdammit an ICQ Message
You're right, I apologize...I thought I was posting in two separate forums, not two different posts in the same forum. My hand has been slapped! We'll ignore the other post and use this one.

I've got my code working...it's returning the Forum Subject name as I want. Could someone look at my code and make any recommendations about making it efficient, clean, proper code, etc?
	strSql = "select F_SUBJECT from FORUM_FORUM where FORUM_ID = " & strForumID
	set rs = Server.CreateObject("ADODB.RecordSet")
	rs.Open strSql, my_conn
	strForumSubject = rs("F_SUBJECT")
	rs.close

Thanks!

h

Edited by - withanhdammit on 03 March 2005 16:55:31
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 04 March 2005 :  07:02:28  Show Profile
That looks fine although you might want to set the rs to nothing after you're done with it, unless you're reusing it elsewhere in the script. Also a good idea to add a chkString check to rs("F_SUBJECT") just in case.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

withanhdammit
Junior Member

USA
236 Posts

Posted - 04 March 2005 :  08:19:43  Show Profile  Visit withanhdammit's Homepage  Send withanhdammit an ICQ Message
OK, I added the set rs = nothing, but I'm not familiar with chkString...I did a couple of searches on the web for it, but couldn't find anything really telling me it's purpose. Could you explain what it is and what it does.

Thanks!

h


	strSql = "select F_SUBJECT from FORUM_FORUM where FORUM_ID = " & strForumID
	set rs = Server.CreateObject("ADODB.RecordSet")
	rs.Open strSql, my_conn
	strForumSubject = rs("F_SUBJECT")
	rs.close
	set rs = nothing



<edited to add code example>

Edited by - withanhdammit on 04 March 2005 08:21:47
Go to Top of Page

Podge
Support Moderator

Ireland
3775 Posts

Posted - 04 March 2005 :  08:34:01  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
Its a function specific to Snitz, you probably won't find anything on google.

replace this line - strForumSubject = rs("F_SUBJECT") with

strForumSubject = ChkString(rs("F_SUBJECT"),"display")

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

withanhdammit
Junior Member

USA
236 Posts

Posted - 04 March 2005 :  09:20:37  Show Profile  Visit withanhdammit's Homepage  Send withanhdammit an ICQ Message
Thanks Podge! I'll make the change. But could you try to explain to a feeble brain like mine what chkString is/does?

Thanks for the help!

h
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 04 March 2005 :  09:37:51  Show Profile
Removes any special/reserved characters that may enable someone to execute malicious code. It shouldn't really be a concern here as chkString is run on the forum title before it's inserted in the database but it always pays to play it safe. If you want to have a look at the function to see what it does, you'll find it in inc_func_common.asp.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

withanhdammit
Junior Member

USA
236 Posts

Posted - 04 March 2005 :  09:46:02  Show Profile  Visit withanhdammit's Homepage  Send withanhdammit an ICQ Message
Cool, thanks for the info Shaggy. I'll go look it up and see if I can muddle through what it's doing ;-)

I think with this change, I'm ready to release my mod. Of course, it's not a full mod, but I updated an existing mod to work with Snitz 3.4.05 (hey...today is 3/4/05 that's a weird coincidence) and make it follow the Snitz color/formatting schemes.

I never thought I'd be able to do that! The support for the Snitz forums is great. I've only been using Snitz for a couple of weeks, I've never done ASP programming before. Thanks to everyone that's helped me!

h
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 04 March 2005 :  10:07:54  Show Profile
quote:
Originally posted by withanhdammit
hey...today is 3/4/05 ...
No, it's 4/3/05

Told you you'd learn loads hanging 'round here; best ASP teacher around is Snitz


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

withanhdammit
Junior Member

USA
236 Posts

Posted - 04 March 2005 :  10:37:25  Show Profile  Visit withanhdammit's Homepage  Send withanhdammit an ICQ Message
I know...crazy Americans...can't get the date right

I think I'm starting to get the hang of it. I don't know if I could write my own mod from scratch, but just updating Da_Stimulator's mod really taught me a ton about ASP.

Thanks again!

h
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 04 March 2005 :  10:57:06  Show Profile
That's what I said 3 years ago when I started here; began by making tweaks and add-ons for existing mods and progressed from there. You'll soon be looking back on these days as a beginner wondering how there was ever a time when you didn't know all this stuff. Went through some of me old posts a few days ago when I was looking for something else and I had to laugh out loud at some of the things I was adking!


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

withanhdammit
Junior Member

USA
236 Posts

Posted - 04 March 2005 :  11:05:18  Show Profile  Visit withanhdammit's Homepage  Send withanhdammit an ICQ Message
At least I have something to look forward to!



h
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07