Author |
Topic |
muzishun
Senior Member
United States
1079 Posts |
Posted - 26 November 2004 : 02:59:11
|
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
|
Erm, maybe I'm missing it but what would be the practical application for this mod ? |
portfolio - linkshrinker - oxle - twitter |
|
|
muzishun
Senior Member
United States
1079 Posts |
Posted - 26 November 2004 : 03:33:00
|
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) |
|
|
dayve
Forum Moderator
USA
5820 Posts |
|
Davio
Development Team Member
Jamaica
12217 Posts |
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 26 November 2004 : 14:32:00
|
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 |
|
|
muzishun
Senior Member
United States
1079 Posts |
Posted - 26 November 2004 : 14:38:54
|
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) |
|
|
muzishun
Senior Member
United States
1079 Posts |
Posted - 26 November 2004 : 14:44:21
|
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) |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
|
muzishun
Senior Member
United States
1079 Posts |
Posted - 26 November 2004 : 15:04:58
|
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) |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 26 November 2004 : 15:09:27
|
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 |
|
|
serritzlev
Junior Member
Denmark
291 Posts |
Posted - 26 November 2004 : 16:53:13
|
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 |
|
|
Nertz
Junior Member
Canada
341 Posts |
Posted - 29 November 2004 : 21:01:02
|
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 |
|
|
muzishun
Senior Member
United States
1079 Posts |
Posted - 29 November 2004 : 23:27:14
|
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) |
|
|
MarcelG
Retired Support Moderator
Netherlands
2625 Posts |
Posted - 30 November 2004 : 02:25:54
|
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 |
|
|
muzishun
Senior Member
United States
1079 Posts |
Posted - 30 November 2004 : 04:50:33
|
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) |
|
|
Topic |
|