Author |
Topic |
richfed
Average Member
United States
999 Posts |
Posted - 01 September 2003 : 06:44:33
|
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
|
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] |
|
|
richfed
Average Member
United States
999 Posts |
Posted - 16 September 2003 : 05:30:42
|
*BUMP* [in the road] |
|
|
OneWayMule
Dev. Team Member & Support Moderator
Austria
4969 Posts |
|
richfed
Average Member
United States
999 Posts |
Posted - 17 September 2003 : 05:10:39
|
Excellent!!
Thanks, OneWayMule! Will look forward to your reply ... |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 17 September 2003 : 08:49:18
|
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 |
|
|
richfed
Average Member
United States
999 Posts |
|
richfed
Average Member
United States
999 Posts |
Posted - 19 September 2003 : 16:16:27
|
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] |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 19 September 2003 : 16:46:10
|
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 |
|
|
richfed
Average Member
United States
999 Posts |
Posted - 19 September 2003 : 17:06:21
|
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] |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 21 September 2003 : 08:05:56
|
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 |
|
|
richfed
Average Member
United States
999 Posts |
Posted - 21 September 2003 : 16:58:36
|
Excellent! Appreciated! |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
|
richfed
Average Member
United States
999 Posts |
Posted - 20 January 2004 : 06:22:16
|
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] |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 20 January 2004 : 10:02:45
|
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 |
|
|
masterao
Senior Member
Sweden
1678 Posts |
Posted - 20 January 2004 : 10:18:17
|
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 |
|
|
Topic |
|