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 MOD-Group
 MOD Add-On Forum (W/O Code)
 Adding Archive Icon To Forum.asp
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

richfed
Average Member

United States
999 Posts

Posted - 01 September 2003 :  06:44:33  Show Profile  Visit richfed's Homepage
I asked about this once before, but there were no takers. Trying again.

I wish to be able to access a particular forum's archives [if that forum has any archives, of course] from forum.asp. What would be the code needed for forum.asp to check for archives & then call the archive icon to display if there are any? [Much like what occurs on default.asp]

Rich
[size=1]A Complete Idiot's Guide to MOD Implementation || On the Trail of the Last of the Mohicans[/size=1]

richfed
Average Member

United States
999 Posts

Posted - 11 September 2003 :  05:53:53  Show Profile  Visit richfed's Homepage
Hmmm ... I'm figuring this must be the dumbest request for a modification ever made, or else it is so difficult as to render it implausible. Maybe it's so easy any fool can do it ...

I don't know ... I tried ...

I thought it would be convenient to have the archive icon appear on each page of a forum that has archives, rather than only on default.asp. This would make it more readily known that a forum even has archived posts. Plus, if you're looking for a topic in a particular forum, and don't find it, you are more apt to check out the archives, I would think. Sure, one can use search.asp, but this is another option and would flow better while browsing.

Anyone?

Rich
[size=1]A Complete Idiot's Guide to MOD Implementation || On the Trail of the Last of the Mohicans[/size=1]
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 16 September 2003 :  05:30:42  Show Profile  Visit richfed's Homepage
*BUMP* [in the road]
Go to Top of Page

OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 16 September 2003 :  05:41:04  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
richfed, seems I have overlooked this topic.
I have done this on my forum, a link to the archive of a certain forum on forum.asp (if available).
I can post the code tomorrow when I'm back at home.
Hope that helps.

My MODs:
Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook
Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch

Useful stuff:
Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 17 September 2003 :  05:10:39  Show Profile  Visit richfed's Homepage
Excellent!!

Thanks, OneWayMule! Will look forward to your reply ...
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 17 September 2003 :  08:49:18  Show Profile  Visit MarcelG's Homepage
richfed, I think you mean the same as I did here:
http://www.crashsite.nl/topic.asp?TOPIC_ID=3183&SearchTerms=archive,forum.asp

quote:

I created a button on the forum.asp page, to switch to Archived Topics overview from Current Topics view et vice versa.
This came in handy on our Snitz 3.4.3 forum at work, so I thought I'd share it with you guys.

This one is done on an already modded 3.4.3...use at your own risk (not much risk I can think of, but anyway)

Changed forum.asp:

First get the count of the number of archived posts for the forum.
Around line 193 find the SQL query, and change it to this one:
(the red bold text added)
quote:

strSql = "SELECT C.CAT_STATUS, C.CAT_SUBSCRIPTION, " & _
"C.CAT_MODERATION, C.CAT_NAME, C.CAT_ID, " & _
"F_POLLS, F.F_STATUS, F.F_SUBSCRIPTION, " & _
"F.F_MODERATION, F_DEFAULTDAYS, F.F_SUBJECT, F.F_A_COUNT" & _



Some lines below, around line 216 change the list as shown below:
(the red bold text added)
quote:

Forum_Subject = rsCFStatus("F_SUBJECT")
Forum_ACount = rsCFStatus("F_A_COUNT")
Forum_Subscription = rsCFStatus("F_SUBSCRIPTION")


Around line 430 find the following:

	if (AdminAllowed = 1) then 
		call ForumAdminOptions 
	else
		Response.Write  "                 " & vbNewLine
	end if

After that add:

	if Forum_ACount > 0 and strArchiveState = "1" then
		if request("ARCHIVE") <> "true" then
				Response.Write	"<a href=""forum.asp?ARCHIVE=true&FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconFolderArchived,"View Archived posts","hspace=""0""") & "</a>"
				else
				Response.Write	"<a href=""forum.asp?FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconFolder,"View current posts","hspace=""0""") & "</a>"
				end if
	end if


That's it!

Now, if there are NO archived topics, the link is NOT shown.
If there áre archived posts, a button is shown 'View archived posts'.
If you select this button, you are brought to the forum.asp view with the archived posts.
The button is then changed into another button 'View current posts'.


portfolio - linkshrinker - oxle - twitter
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 18 September 2003 :  05:20:41  Show Profile  Visit richfed's Homepage
Sounds like exactly what I was looking for and looks pretty simple. Thank you for that. Will try it out this evening ...

OneWayMule, is that pretty much how you had it figured, as well?

Rich
[size=1]A Complete Idiot's Guide to MOD Implementation || On the Trail of the Last of the Mohicans[/size=1]
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 19 September 2003 :  16:16:27  Show Profile  Visit richfed's Homepage
Ok, I tried it out - first two bits were no problem, however, on my forum.asp I could not find the last part of code.

I could find this part: if (AdminAllowed = 1) then - in but one place, way down just below the: sub ForumAdminOptions()

So, I placed it down there, with the other icon codes, and it worked.

The only problem is it will only work for an administrator. I would like it to function as it does on default.asp - that is, all visitors can see the icon. Any ideas?

Rich
[size=1]A Complete Idiot's Guide to MOD Implementation || On the Trail of the Last of the Mohicans[/size=1]
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 19 September 2003 :  16:46:10  Show Profile  Visit MarcelG's Homepage
Rich, somewhere in forum.asp, the adminoptions are called.
In the default forum.asp this is from line 426 to 434.
if mlev > 0 or (lcase(strNoCookies) = "1") then 
	Response.Write  "                <td align=""center"" bgcolor=""" & strHeadCellColor & """ nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
	if (AdminAllowed = 1) then 
		call ForumAdminOptions 
	else
		Response.Write  "                 " & vbNewLine
	end if
	Response.Write  "                </font></td>" & vbNewLine
end if


After modification, this piece looks like this:

This call should be 'surrounded' by an IF .... END IF.
You should paste it either before or after this IF .... END IF.

So, look for the ForumAdminOptions part, and try to recognize the IF .... END IF part.
Put my proposed code outside that part.

After modification, the default forum.asp would contain this:
if mlev > 0 or (lcase(strNoCookies) = "1") then 
	Response.Write  "                <td align=""center"" bgcolor=""" & strHeadCellColor & """ nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
	if (AdminAllowed = 1) then 
		call ForumAdminOptions 
	else
		Response.Write  "                 " & vbNewLine
	end if
	if Forum_ACount > 0 and strArchiveState = "1" then
		if request("ARCHIVE") <> "true" then
				Response.Write	"<a href=""forum.asp?ARCHIVE=true&FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconFolderArchived,"View Archived posts","hspace=""0""") & "</a>"
				else
				Response.Write	"<a href=""forum.asp?FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconFolder,"View current posts","hspace=""0""") & "</a>"
				end if
	end if

	Response.Write  "                </font></td>" & vbNewLine
end if



You could also mail be with your forum.asp, I'd be happy to help you mod it.

portfolio - linkshrinker - oxle - twitter

Edited by - MarcelG on 19 September 2003 16:50:27
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 19 September 2003 :  17:06:21  Show Profile  Visit richfed's Homepage
Hmmm ... very strange. I don't know why my search of the .asp document didn't locate the code, but I did find it now. Thanks.

It now works better ... all members can now see the icon.

Can it be modded slightly further to allow all visitors to see it?

In any event, thank you very much! Much closer to what I wanted than I was before!!

Rich
[size=1]A Complete Idiot's Guide to MOD Implementation || On the Trail of the Last of the Mohicans[/size=1]
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 21 September 2003 :  08:05:56  Show Profile  Visit MarcelG's Homepage
If you want visitors to see it, you need to put the code outside the if mlev > 0 ... end if piece of code.

It will then look like this:

if mlev > 0 or (lcase(strNoCookies) = "1") then 
	Response.Write  "                <td align=""center"" bgcolor=""" & strHeadCellColor & """ nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
	if (AdminAllowed = 1) then 
		call ForumAdminOptions 
	else
		Response.Write  "                 " & vbNewLine
	end if
		Response.Write  "                </font></td>" & vbNewLine
end if
if Forum_ACount > 0 and strArchiveState = "1" then
	if request("ARCHIVE") <> "true" then
		Response.Write	"<a href=""forum.asp?ARCHIVE=true&FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconFolderArchived,"View Archived posts","hspace=""0""") & "</a>"
	else
		Response.Write	"<a href=""forum.asp?FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconFolder,"View current posts","hspace=""0""") & "</a>"
	end if
end if


portfolio - linkshrinker - oxle - twitter
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 21 September 2003 :  16:58:36  Show Profile  Visit richfed's Homepage
Excellent! Appreciated!
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 22 September 2003 :  05:46:10  Show Profile  Visit MarcelG's Homepage
glad to be of help
that's what open source is all about!

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 20 January 2004 :  06:22:16  Show Profile  Visit richfed's Homepage
quote:
Originally posted by marcelgoertz

If you want visitors to see it, you need to put the code outside the if mlev > 0 ... end if piece of code.

It will then look like this:

if mlev > 0 or (lcase(strNoCookies) = "1") then 
	Response.Write  "                <td align=""center"" bgcolor=""" & strHeadCellColor & """ nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
	if (AdminAllowed = 1) then 
		call ForumAdminOptions 
	else
		Response.Write  "                 " & vbNewLine
	end if
		Response.Write  "                </font></td>" & vbNewLine
end if
if Forum_ACount > 0 and strArchiveState = "1" then
	if request("ARCHIVE") <> "true" then
		Response.Write	"<a href=""forum.asp?ARCHIVE=true&FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconFolderArchived,"View Archived posts","hspace=""0""") & "</a>"
	else
		Response.Write	"<a href=""forum.asp?FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconFolder,"View current posts","hspace=""0""") & "</a>"
	end if
end if





Marcel - First let me say that the code to show the Archived Post folder on forum.asp works just fine for logged in members [see a few posts above]. That is how I have it on my site.

However, the code quoted - so that ALL visitors can see the icon, doesn't quite work. I keep coming back to this, and trying again - thinking I missed something - but it's the same result each time. The icon does show, but it's in a black cell at the top of the table, rather than where it should be ... so, I have to revert to the members only coding.

Any ideas on this?

Rich
[size=1]A Complete Idiot's Guide to MOD Implementation || On the Trail of the Last of the Mohicans[/size=1]
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 20 January 2004 :  10:02:45  Show Profile  Visit MarcelG's Homepage
Mmm...you're right...I missed the part of the td beginning..
What you could also try is to remove the 'if mlev < 0' part...it will display this TD then even when a visitor is online..

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 20 January 2004 :  10:18:17  Show Profile  Visit masterao's Homepage
The following should work for you, richfed:

	Response.Write  "                <td align=""center"" bgcolor=""" & strHeadCellColor & """ nowrap><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """>" & vbNewLine
if mlev > 0 or (lcase(strNoCookies) = "1") then 
	if (AdminAllowed = 1) then 
		call ForumAdminOptions 
	else
		Response.Write  "                 " & vbNewLine
	end if
end if
if Forum_ACount > 0 and strArchiveState = "1" then
	if request("ARCHIVE") <> "true" then
		Response.Write	"<a href=""forum.asp?ARCHIVE=true&FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconFolderArchived,"View Archived posts","hspace=""0""") & "</a>"
	else
		Response.Write	"<a href=""forum.asp?FORUM_ID=" & Forum_ID & """>" & getCurrentIcon(strIconFolder,"View current posts","hspace=""0""") & "</a>"
	end if
else
	Response.Write  "                 " & vbNewLine
end if
		Response.Write  "                </font></td>" & vbNewLine

Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 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.23 seconds. Powered By: Snitz Forums 2000 Version 3.4.07