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)
 Comments on reducing the size of the code
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

pweighill
Junior Member

United Kingdom
453 Posts

Posted - 19 August 2002 :  11:35:24  Show Profile
I've been looking through the asp code and have spotted a few places that could be changed to reduce the size of the code. This could also help make the maintanance of the code easier.

Perhaps some of these could be incorporated into v4.

pop_profile.asp

Remove all
" & strMemberTablePrefix & "MEMBERS.
from the file.

pop_config_help.asp

Instead of having lot of table cells:
" <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
" Table Name Prefix is used if you have multiple versions of the forum running in the same database. This way you can name the tables differently and still use one user to connect. (eg. FORUM_ and FORUM2_)</font>" & vbNewLine & _
" <a href=""#top"">" & getCurrentIcon(strIconGoUp,"Go To Top Of Page","align=""right""") & "</a></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _


could be converted into a function

OutputaCell("Table Name Prefix is used if you have multiple versions of the forum running in the same database. This way you can name the tables differently and still use one user to connect. (eg. FORUM_ and FORUM2_)")

Sub OutputaCell(pstrText)
Response.Write " <tr>" & vbNewLine & _
" <td bgcolor=""" & strForumCellColor & """><font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
" " & pstrText & "</font>" & vbNewLine & _
" <a href=""#top"">" & getCurrentIcon(strIconGoUp,"Go To Top Of Page","align=""right""") & "</a></font></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
End Sub

inc_create_forum_*.asp

All the SetConfigValue code and the "INSERT" code is the virtually the same in all 3 files.
This could be moved into one file.

Nathan
Help Moderator

USA
7664 Posts

Posted - 19 August 2002 :  12:23:43  Show Profile  Visit Nathan's Homepage
quote:

pop_config_help.asp

Instead of having lot of table cells:




There are alot of places this can be done. Another example is admin_config_colors.asp

Nathan Bales
CoreBoard | Active Users Download
Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 19 August 2002 :  12:48:02  Show Profile
I already have some code readied for v4, including this one...

I also did a performance comparison test to compare straight code vs use of subs/functions w/wo parameters to justify their use in some places and to understand where they should be avoided.

Stop the WAR!
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.15 seconds. Powered By: Snitz Forums 2000 Version 3.4.07