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 Bug Reports (Closed)
 ADJUST (3.x): multiple includes of inc_footer
 Forum Locked  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

gor
Retired Admin

Netherlands
5511 Posts

Posted - 10 March 2001 :  10:27:38  Show Profile  Visit gor's Homepage
I know I have seen this mentioned before, but I never really realised that it was this "bad".

If you look at default.asp the inc_footer.asp file gets included 7 times and is ofcourse displayed only once.

Were do these 7 times come from ?
inc_top.asp: 2
inc_functions.asp: 4
default.asp: 1

Though inc_footer.asp isn't the longest file there is, this means that it is included 6 times more than is really needed in almost every file, since most files use inc_top.asp and inc_functions.asp and include inc_footer.asp themselves. Even with 76 lines in inc_footer.asp that is much.

Fixing it is very easy too:

In inc_functions.asp add a sub:

Sub WriteFooter()
%>
<!--#INCLUDE FILE="inc_footer.asp"-->
<%
end sub
and then replace the include in all the other files and inc_functions.asp itself with:

WriteFooter


Remember that you'll have to move it inside the asp code, so i.e. this:

<!--#INCLUDE FILE="inc_footer.asp"-->
<%
end sub

should be replaced by:
<%
WriteFooter
end sub



Pierre

Reinsnitz
Snitz Forums Admin

USA
3545 Posts

Posted - 12 March 2001 :  14:56:20  Show Profile  Visit Reinsnitz's Homepage  Send Reinsnitz an AOL message  Send Reinsnitz an ICQ Message  Send Reinsnitz a Yahoo! Message
so literaly every single forum file has a minimum of 7 times... some even more.

Reinsnitz (Mike)
><)))'> Need a Mod?
"Therefore go and make disciples of all nations,..." Matthew 28:19a
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 12 March 2001 :  15:14:41  Show Profile  Visit gor's Homepage
Yes in the current version that is the case.

Pierre
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 12 March 2001 :  15:30:58  Show Profile
take a look at post_info.asp

and since Go_Result already includes inc_footer.asp then each instance after the Go_Result and before Response.End can be eliminated. ( I remember seeing this mentioned before, but just noticed it again when I was adding Huw's Posting Restriction MOD just now). Huw removed the extra inc_footer.asp INCLUDES in the files he included in that MOD. (I was wondering why my line #'s weren't matching up. )
Go to Top of Page

Reinsnitz
Snitz Forums Admin

USA
3545 Posts

Posted - 12 March 2001 :  15:42:58  Show Profile  Visit Reinsnitz's Homepage  Send Reinsnitz an AOL message  Send Reinsnitz an ICQ Message  Send Reinsnitz a Yahoo! Message
NOTE: For me.

Remember to rename inc_top.asp to inc_header.asp and inc_top_short.asp to inc_header_short.asp while doing this fix.

(just being more consistant with everything else... caus it's either this... or changing footer to bottom... and I don't think any of us want that

Reinsnitz (Mike)
><)))'> Need a Mod?
"Therefore go and make disciples of all nations,..." Matthew 28:19a
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 12 March 2001 :  17:13:50  Show Profile
It's grown! There were only 4 last May.

http://forum.snitz.com/old_forum/topic.asp?TOPIC_ID=480&FORUM_ID=2&CAT_ID=10&Topic_Title=New+Topic+Error+on+SQL+Server+7&Forum_Title=Database%3A+Access+97

======
Doug G
======
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 13 March 2001 :  00:52:22  Show Profile  Visit gor's Homepage
ehm...the thingy Doug mentioned in the other topic: if we wrap inc_top.asp in a sub...would make the variables declared in there have procedure scope and not page scope.
That would be a problem for my_Conn (being opened in inc_top.asp and inc_top_short.asp) and possibly mLev (which is being referred to througout the page).

A possible fix is to Dim both in config.asp and then just open them were they are now. That way they still have page scope.

Pierre
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 13 March 2001 :  10:13:15  Show Profile
I only saw

dim mLev, strLoginStatus

in inc_top

======
Doug G
======
Go to Top of Page

Reinsnitz
Snitz Forums Admin

USA
3545 Posts

Posted - 13 March 2001 :  13:23:53  Show Profile  Visit Reinsnitz's Homepage  Send Reinsnitz an AOL message  Send Reinsnitz an ICQ Message  Send Reinsnitz a Yahoo! Message
I thought that a sub actualy kinda just takes a segment of code and drops it in place where called.. variables included.

Reinsnitz (Mike)
><)))'> Need a Mod?
"Therefore go and make disciples of all nations,..." Matthew 28:19a
Go to Top of Page

davemaxwell
Access 2000 Support Moderator

USA
3020 Posts

Posted - 13 March 2001 :  13:34:51  Show Profile  Visit davemaxwell's Homepage  Send davemaxwell an AOL message  Send davemaxwell an ICQ Message  Send davemaxwell a Yahoo! Message
quote:

I thought that a sub actualy kinda just takes a segment of code and drops it in place where called.. variables included.



But if a variable is declared in a sub, it's only good in that sub. It's not global....

Dave Maxwell
--------------
Proud to be a "World Class" Knucklehead
Go to Top of Page

Reinsnitz
Snitz Forums Admin

USA
3545 Posts

Posted - 13 March 2001 :  15:00:50  Show Profile  Visit Reinsnitz's Homepage  Send Reinsnitz an AOL message  Send Reinsnitz an ICQ Message  Send Reinsnitz a Yahoo! Message
I realy must be bad off... a world class knucklehead just told me!

Reinsnitz (Mike)
><)))'> Need a Mod?
"Therefore go and make disciples of all nations,..." Matthew 28:19a
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 13 March 2001 :  15:11:19  Show Profile
Hey, it's "World Class", not just plain vanilla World Class

======
Doug G
======
Go to Top of Page

Reinsnitz
Snitz Forums Admin

USA
3545 Posts

Posted - 13 March 2001 :  15:16:08  Show Profile  Visit Reinsnitz's Homepage  Send Reinsnitz an AOL message  Send Reinsnitz an ICQ Message  Send Reinsnitz a Yahoo! Message
ah man... there I go again!

Reinsnitz (Mike)
><)))'> Need a Mod?
"Therefore go and make disciples of all nations,..." Matthew 28:19a
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 13 March 2001 :  17:40:43  Show Profile


======
Doug G
======
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 15 March 2001 :  09:27:55  Show Profile
quote:

quote:

I thought that a sub actualy kinda just takes a segment of code and drops it in place where called.. variables included.



But if a variable is declared in a sub, it's only good in that sub. It's not global....



Dave's right. A variable that is dim'ed in a sub or function are local to that sub/function. A variable dim'ed outside of the sub or function can be modified by a sub or function.

One option is to put inc_top's vars at the top of the file and then wrap everything else in a sub. When that file is included, the dim statements will be outside of the sub and thus be global to the page. Then when you need to display or use the inc_top code, just call the sub/function. Does this make sense?

Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 15 March 2001 :  09:38:26  Show Profile
...now back to the original topic about multiple includes of inc_footer.

Here's the current status of 3.2a06 code:

Searching for inc_footer.asp - Found 90 occurrence(s) in 36 file(s)

Included the instances of duplicate references

admin_login.asp(83)
admin_login.asp(119)

inc_functions.asp(1686)
inc_functions.asp(1700)
inc_functions.asp(1726)
inc_functions.asp(1740)

inc_top.asp(154)
inc_top.asp(172)

pop_profile.asp(55)
pop_profile.asp(1196)

post.asp(317)
post.asp(1105)

post_info.asp(58)
post_info.asp(66)
post_info.asp(78)
post_info.asp(133)
post_info.asp(152)
post_info.asp(158)
post_info.asp(187)
post_info.asp(195)
post_info.asp(207)
post_info.asp(359)
post_info.asp(405)
post_info.asp(419)
post_info.asp(426)
post_info.asp(493)
post_info.asp(521)
post_info.asp(535)
post_info.asp(605)
post_info.asp(626)
post_info.asp(640)
post_info.asp(648)
post_info.asp(661)
post_info.asp(710)
post_info.asp(745)
post_info.asp(753)
post_info.asp(765)
post_info.asp(819)
post_info.asp(855)
post_info.asp(863)
post_info.asp(875)
post_info.asp(937)
post_info.asp(973)
post_info.asp(981)
post_info.asp(993)
post_info.asp(1034)
post_info.asp(1070)
post_info.asp(1078)
post_info.asp(1090)
post_info.asp(1110)
post_info.asp(1142)
post_info.asp(1150)
post_info.asp(1163)
post_info.asp(1183)
post_info.asp(1209)
post_info.asp(1415)
post_info.asp(1426)

register.asp(65)
register.asp(340)
register.asp(352)
register.asp(378)

As was stated earlier, post_info.asp is the worst offender.

This was previously mentioned in this topic:
http://forum.snitz.com/forum/link.asp?TOPIC_ID=4354

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