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/Code)
 MOD: View Source Code
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

muzishun
Senior Member

United States
1079 Posts

Posted - 26 November 2004 :  02:59:11  Show Profile  Visit muzishun's Homepage
The actual code to view the source came from here (good work, dayve). I simply made it into its own separate inc page that you can put anywhere on your site. I have put one into my admin_home.asp file. May not have tons of practical uses, but enough to warrant updating.

Ease of installation (1 easy - 10 hard): 1

Download the following file and rename it to .asp.

http://www.genuineimitation.org/forum/vsrc.txt

In the file, there are several places where you can change the code. I've tried to comment most of these to make the job easier. Currently the MOD still lists restricted files in the dropdown menu, but I'm working on fixing that. If anyone has any suggestions as to how I can do that, they are more than welcome.

Next, add the following line to any place on the forum you want to include the file.

<!--#include file="vsrc.asp"-->

It will also work as a standalone page. Alternatively, here's my code to add it to admin_home.asp

Find the following lines (around line 125)
		"                <td bgcolor=""" & strCategoryCellColor & """ colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """><b>Administrative Functions</b></font></td>" & vbNewLine & _
		"              </tr>" & vbNewLine & _
		"              <tr>" & vbNewLine & _
		"                <td bgcolor=""" & strForumCellColor & """ valign=""top""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
		"                <p><b>Forum Feature Configuration:</b>" & vbNewLine & _


Replace them with the following:


		"                <td bgcolor=""" & strCategoryCellColor & """ colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strCategoryFontColor & """><b>Administrative Functions</b></font></td>" & vbNewLine & _
		"              </tr>" & vbNewLine & _
		"              <tr>" & vbNewLine & _
		"                <td bgcolor=""" & strForumCellColor & """ valign=""top"" colspan=""2""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>"& vbNewLine & _
		"                  <center>" & vbNewline
		%><!--#include file="vsrc.asp"--><%
Response.Write	"                  </center>" & vbnewlinej & _
		"                </td>" & vbNewLine & _
		"              </tr>" & vbNewLine & _
		"              <tr>" & vbNewLine & _
		"                <td bgcolor=""" & strForumCellColor & """ valign=""top""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strForumFontColor & """>" & vbNewLine & _
		"                <p><b>Forum Feature Configuration:</b>" & vbNewLine & _


That ought to be everything you need! This will open the source in a new window. Feel free to give me feedback with security leaks (this has extreme potential for those) or other opinions. Enjoy!

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)

Edited by - muzishun on 26 November 2004 03:14:39

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 26 November 2004 :  03:25:38  Show Profile  Visit MarcelG's Homepage
Erm, maybe I'm missing it but what would be the practical application for this mod ?

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

muzishun
Senior Member

United States
1079 Posts

Posted - 26 November 2004 :  03:33:00  Show Profile  Visit muzishun's Homepage
Often times when someone is having problems with MOD implementation, another user will ask to see the source code for a particular file. It's also handy if you want to share the code for a file. Rather than spend the time (however little it takes ) to rename and upload it, you've got it here already. I personally have also found it useful when I'm working on different web projects while at the office or at school.

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 26 November 2004 :  11:24:06  Show Profile  Visit dayve's Homepage
Maybe showing an example will help:

http://www.burningsoulsforum.com/forum/display_source.asp?page=active_users.asp

Go to Top of Page

Davio
Development Team Member

Jamaica
12217 Posts

Posted - 26 November 2004 :  13:39:47  Show Profile
Also have it on my forum too. A link at the bottom of each page so you can see the asp source. http://www.dsilvera.com/forum/

Support Snitz Forums
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 26 November 2004 :  14:32:00  Show Profile  Visit MarcelG's Homepage
Ah, now I get it!
I've got it working at http://www.oxle.com/source.asp ! (only for registered members, use demo/demo to view)
Could you point me in the right direction with this question ; I do not want to have it open a new window for every file I want to select. I want it to refresh the current window. Where do I change that ?

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

muzishun
Senior Member

United States
1079 Posts

Posted - 26 November 2004 :  14:38:54  Show Profile  Visit muzishun's Homepage
In the source.asp file change the following line:


Response.write	"window.open('vsrc.asp?page='+document.zFileForm.zFileName.options[document.zFileForm.zFileName.selectedIndex].value,""src_window"")" & vbNewline & _


To this:


Response.write	"window.location = 'vsrc.asp?page='+document.zFileForm.zFileName.options[document.zFileForm.zFileName.selectedIndex].value" & vbNewline & _


That ought to do it.

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 26 November 2004 :  14:44:21  Show Profile  Visit muzishun's Homepage
marcelgoertz, I just noticed that you have a typo on your page. The button shows "View sourcode".

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 26 November 2004 :  14:52:46  Show Profile  Visit MarcelG's Homepage
hahaha....that must be a freudian slip considering my coding-skills.

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

muzishun
Senior Member

United States
1079 Posts

Posted - 26 November 2004 :  15:04:58  Show Profile  Visit muzishun's Homepage
lol. Yours are better than mine, I'm sure. I only started learning ASP about four months ago, and most of what I've learned came from Snitz!

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 26 November 2004 :  15:09:27  Show Profile  Visit MarcelG's Homepage
Snitz is the only ASP I can read...and I've been snitzing for about 1,5 years now.
I'm a genuine CP-coder (copy/paste)

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

serritzlev
Junior Member

Denmark
291 Posts

Posted - 26 November 2004 :  16:53:13  Show Profile  Visit serritzlev's Homepage
There is only one thing there dont works verry well, and that is that way marcelgoertz ( i do that on the same way) or the user try a file there not are share the footer in not show.

Sub noshare()
Response.write "<font size=""" & strDefaultFontSize & """>Sorry, but the source code for that file is not available for viewing.</font>" & vbNewline
SelectPageMenu()
End Sub


Edited by - serritzlev on 26 November 2004 17:36:11
Go to Top of Page

Nertz
Junior Member

Canada
341 Posts

Posted - 29 November 2004 :  21:01:02  Show Profile
Great mod... ended up using Marcel's version off oxle.com, with a few little changes specific to my site. Thanks Marcel for making it available through the "view source" mod itself.

quote:
Originally posted by serritzlev

There is only one thing there dont works verry well, and that is that way marcelgoertz ( i do that on the same way) or the user try a file there not are share the footer in not show.



As serritzlev pointed out if a protected file is selected, the mod as it is does not write the footer. I added the following red code to clean up tables & write the footer:

		For n=0 to Numberofpairs 
			if inStr(DoNotShare(n), strPageRequested)>0 then 
				noshare()
				Response.Write "          </td>" & vbNewLine & _
 					"        </tr>" & vbNewLine & _
 					"      </table>" & vbNewLine & _
 					"    </td>" & vbNewLine & _
 					"  </tr>" & vbNewLine & _
 					"</table>" & vbNewLine 
				WriteFooter
				Response.End
			end if 
		Next 


cheers,
Nat

Sadly, most Family Court Judges wrongfully reward opportunistic gold diggers
that use our children unjustly as "instruments" of power.


www.fathers-4-justice-canada.ca

Edited by - Nertz on 29 November 2004 21:02:28
Go to Top of Page

muzishun
Senior Member

United States
1079 Posts

Posted - 29 November 2004 :  23:27:14  Show Profile  Visit muzishun's Homepage
Thanks! This is my first MOD, so it's been a learning process the whole way. In fact, I am using Marcel's version for a public source page as well.

I noticed a bug (in my version, not sure if it's in Marcel's) that will list protected files in the drop down box, but only if there is no code currently being displayed. Has anyone else noticed this? It seems to not be pulling the protected files from the array properly, but everything works when the page is displaying code.

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 30 November 2004 :  02:25:54  Show Profile  Visit MarcelG's Homepage
Hehe ; funny that I seem to have 'hijacked' muzishun's mod
anyway ; my version has the same 'bug' ; it also lists protected files. Only my version does that all the time, even when a file is being displayed.

Nertz, Serritzlev ; I've added the footer - completely overlooked that one. Thanks.

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

muzishun
Senior Member

United States
1079 Posts

Posted - 30 November 2004 :  04:50:33  Show Profile  Visit muzishun's Homepage
No worries. I didn't really write the code for it anyways. Dayve did that. All I did was add the drop-down file interface to it so that it could be a little more dynamic.

Bill Parrott
Senior Web Programmer, University of Kansas
Co-Owner and Code Monkey, Eternal Second Designs (www.eternalsecond.com)
Personal Website (www.chimericdream.com)
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.25 seconds. Powered By: Snitz Forums 2000 Version 3.4.07