Author |
Topic |
|
withanhdammit
Junior Member
USA
236 Posts |
Posted - 02 March 2005 : 22:33:42
|
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 |
|
withanhdammit
Junior Member
USA
236 Posts |
Posted - 03 March 2005 : 09:35:38
|
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 |
|
|
Podge
Support Moderator
Ireland
3775 Posts |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 03 March 2005 : 10:27:45
|
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.” |
|
|
withanhdammit
Junior Member
USA
236 Posts |
Posted - 03 March 2005 : 16:06:16
|
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 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 04 March 2005 : 07:02:28
|
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.” |
|
|
withanhdammit
Junior Member
USA
236 Posts |
Posted - 04 March 2005 : 08:19:43
|
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 |
|
|
Podge
Support Moderator
Ireland
3775 Posts |
|
withanhdammit
Junior Member
USA
236 Posts |
Posted - 04 March 2005 : 09:20:37
|
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 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 04 March 2005 : 09:37:51
|
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.” |
|
|
withanhdammit
Junior Member
USA
236 Posts |
Posted - 04 March 2005 : 09:46:02
|
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 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 04 March 2005 : 10:07:54
|
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.” |
|
|
withanhdammit
Junior Member
USA
236 Posts |
Posted - 04 March 2005 : 10:37:25
|
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 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 04 March 2005 : 10:57:06
|
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.” |
|
|
withanhdammit
Junior Member
USA
236 Posts |
Posted - 04 March 2005 : 11:05:18
|
At least I have something to look forward to!
h |
|
|
|
Topic |
|