OutFront Forums
     Home    Register     Search      Help      Login    

Sponsors
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

 

Spooky Diet Macro "Revisited"

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> General Web Development >> Spooky Diet Macro "Revisited"
Page: [1]
 
 
WantToLearn

 

Posts: 109
Joined: 10/19/2002
Status: offline

 
Spooky Diet Macro "Revisited" - 7/26/2005 15:42:24   
As most of you know, the Spooky Diet is an ingenious technique used to reduce the excess MS FrontPage ASP webbot code from your Database results pages. This allows you much greater control to customize the database results and makes for a smaller, faster-loading web page. The details of the Spooky Diet can be found in the excellent tutorial written by the genius himself, Spooky.

At the end of the article, Spooky mentions an eaiser way to put your pages on the diet via a macro written by Stephen Travis, MVP for FrontPage. The macro automates the whole process allowing all the work to be done behind the scenes with the push of one button. Awesome!

However, the macro is not without some problems as can be seen from the followup posts. I decided to write a new Spooky Diet Macro that hopefully fixes the current problems and even improves the macro a bit. Here are the features:

  • Removes DRW code WITHOUT removing other webbots.
  • Removes the necessary ASP and DRW code in order to get the ID of the last added record to a database. (See the following article: http://www.outfront.net/spooky/adv_new_id.htm)
  • Provides an "Undo Last" button to reverse the most recent Spooky Diet operation. (Note: You should still make a backup before running the macro.)
  • Works with multiple DRW regions on the same page.
  • Removes DRW code for all types of regions (tables, dropdowns, search forms, etc.)
  • Works on DIW (Database Interface Wizard) generated pages. (Note: This feature has not been thoroughly tested. Remember to always make a backup.)
Anyway, I wrote this macro for my own personal use and just thought others who use the Spooky Diet might be interested.
Instructions for setup and usage can be found here: http://www.kallsmart.com/macro/

I've been using it with FP 2003 and FP 2000 running Windows 2000.

BeTheBall

 

Posts: 6502
Joined: 6/21/2002
From: West Point Utah USA
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 7/26/2005 16:26:43   
I am very impressed. I ran your macro on several pages that the old one had failed on and it worked each time. Nice work.

One note on this item:

quote:

Removes the necessary ASP and DRW code in order to get the ID of the last added record to a database. (See the following article: http://www.outfront.net/spooky/adv_new_id.htm)


One must first save the page and then refresh before running the macro. Otherwise, the macro will convert the send to database option to send to other and the form will do nothing.

_____________________________

Duane

Some people are like Slinkies . . . Not really good for anything . . . . . But they still bring a smile to your face when you push them down a flight of stairs.

(in reply to WantToLearn)
WantToLearn

 

Posts: 109
Joined: 10/19/2002
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 7/27/2005 11:30:59   
Glad to hear it worked. Let me know if you find any bugs or have any suggestions for improvement.


quote:

ORIGINAL: BeTheBall
One must first save the page and then refresh before running the macro. Otherwise, the macro will convert the send to database option to send to other and the form will do nothing.


Yes, thanks for clarifying that point.



(in reply to BeTheBall)
jaybee

 

Posts: 14442
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 7/27/2005 17:20:47   
quote:

As most of you know, the Spooky Diet is an ingenious technique,..........
written by the genius himself, Spooky.


Hang on, I've only just read this. We'll never hear the end of it, he already thinks he's omnipotent! Are you related? How much did he pay you? :)

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to WantToLearn)
Spooky

 

Posts: 26723
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 7/27/2005 17:33:44   
:)

(in reply to jaybee)
WantToLearn

 

Posts: 109
Joined: 10/19/2002
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 7/28/2005 11:58:18   
quote:

Are you related? How much did he pay you? :)


Darn it! We've been busted, Spooky. Does this mean I have to give you the money back?:)

< Message edited by WantToLearn -- 7/28/2005 12:08:34 >

(in reply to jaybee)
jaybee

 

Posts: 14442
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 7/28/2005 12:07:09   
quote:

Darn it! We've been busted, Spooky. Does this mean I have to give you the money back?


I KNEW IT!!!!! :)

_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to WantToLearn)
gmcl

 

Posts: 13
Joined: 8/13/2005
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 8/13/2005 11:24:13   
Hi all, Followed your instructions and loaded an ran the macro against a test DRW page using an Acces database.

However page returned an Internal Server Error.

Any ideas why the diet didn't work?

Cheers

(in reply to WantToLearn)
WantToLearn

 

Posts: 109
Joined: 10/19/2002
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 8/13/2005 13:03:40   
Can you post the code for the page before and after you ran the macro? Then I can test it on my machine and see if I get the same error.

(in reply to gmcl)
gmcl

 

Posts: 13
Joined: 8/13/2005
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 8/13/2005 14:06:17   
Hi

Here is the orginal code - uploaded and displays Access database okay. Database is in the root dir of fpdb.

<html>

<head>
<% ' FP_ASP -- ASP Automatically generated by a FrontPage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>ID</title>
</head>

<body>

<table width="100%" border="1">
	<thead>
		<tr>
			<th ALIGN="LEFT"><b>ID</b></th>
			<th ALIGN="LEFT"><b>date</b></th>
			<th ALIGN="LEFT"><b>opponents</b></th>
			<th ALIGN="LEFT"><b>result</b></th>
			<th ALIGN="LEFT"><b>reporter</b></th>
			<th ALIGN="LEFT"><b>team</b></th>
			<th ALIGN="LEFT"><b>report</b></th>
			<th ALIGN="LEFT"><b>teamRef</b></th>
		</tr>
	</thead>
	<tbody>
		<!--webbot bot="DatabaseRegionStart" s-columnnames="ID,date,opponents,result,reporter,team,report,teamRef" s-columntypes="3,202,202,202,202,203,203,202" s-dataconnection="tempdata" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="FALSE" s-recordsource="Table1" s-displaycolumns="ID,date,opponents,result,reporter,team,report,teamRef" s-criteria s-order s-sql="SELECT * FROM Table1" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields s-norecordsfound="No records returned." i-maxrecords="256" i-groupsize="5" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">This is the start of a Database Results region. The page must be fetched from a web server with a web browser to display correctly; the current web is stored on your local disk or network.</font></td></tr>" startspan --><!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Table1"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=8 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="tempdata"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ID=3&date=202&opponents=202&result=202&reporter=202&team=203&report=203&teamRef=202&"
fp_iDisplayCols=8
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="2648" --><tr>
			<td>
			<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,date,opponents,result,reporter,team,report,teamRef" s-column="ID" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>ID<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"ID")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="62813" --></td>
			<td>
			<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,date,opponents,result,reporter,team,report,teamRef" s-column="date" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>date<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"date")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="5315" --></td>
			<td>
			<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,date,opponents,result,reporter,team,report,teamRef" s-column="opponents" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>opponents<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"opponents")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="23710" --></td>
			<td>
			<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,date,opponents,result,reporter,team,report,teamRef" s-column="result" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>result<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"result")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="17234" --></td>
			<td>
			<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,date,opponents,result,reporter,team,report,teamRef" s-column="reporter" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>reporter<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"reporter")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="17932" --></td>
			<td>
			<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,date,opponents,result,reporter,team,report,teamRef" s-column="team" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>team<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"team")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="6848" --></td>
			<td>
			<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,date,opponents,result,reporter,team,report,teamRef" s-column="report" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>report<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"report")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="17243" --></td>
			<td>
			<!--webbot bot="DatabaseResultColumn" s-columnnames="ID,date,opponents,result,reporter,team,report,teamRef" s-column="teamRef" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="<font size="-1"><<</font>teamRef<font size="-1">>></font>" startspan --><%=FP_FieldVal(fp_rs,"teamRef")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="15086" --></td>
		</tr>
		<!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="5" clientside tag="TBODY" preview="<tr><td colspan=64 bgcolor="#FFFF00" width="100%"><font color="#000000">This is the end of a Database Results region.</font></td></tr><TR><TD VALIGN=MIDDLE COLSPAN=64><NOBR><INPUT TYPE=Button VALUE="  |<  "><INPUT TYPE=Button VALUE="   <  "><INPUT TYPE=Button VALUE="  >   "><INPUT TYPE=Button VALUE="  >|  ">  [1/5]</NOBR><BR></td></tr>" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --></tbody>
</table>

</body>

</html>




Here is the code after applying the Spooky Diet Macro :-

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>ID</title>
</head>

<body>

<table width="100%" border="1">
	<thead>
		<tr>
			<th ALIGN="LEFT"><b>ID</b></th>
			<th ALIGN="LEFT"><b>date</b></th>
			<th ALIGN="LEFT"><b>opponents</b></th>
			<th ALIGN="LEFT"><b>result</b></th>
			<th ALIGN="LEFT"><b>reporter</b></th>
			<th ALIGN="LEFT"><b>team</b></th>
			<th ALIGN="LEFT"><b>report</b></th>
			<th ALIGN="LEFT"><b>teamRef</b></th>
		</tr>
	</thead>
	<tbody>
		<!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM Table1"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=8 align=""LEFT"" width=""100%"">No records returned.</td></tr>"
fp_sDataConn="tempdata"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ID=3&date=202&opponents=202&result=202&reporter=202&team=203&report=203&teamRef=202&"
fp_iDisplayCols=8
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<tr>
			<td>
			<%=FP_FieldVal(fp_rs,"ID")%></td>
			<td>
			<%=FP_FieldVal(fp_rs,"date")%></td>
			<td>
			<%=FP_FieldVal(fp_rs,"opponents")%></td>
			<td>
			<%=FP_FieldVal(fp_rs,"result")%></td>
			<td>
			<%=FP_FieldVal(fp_rs,"reporter")%></td>
			<td>
			<%=FP_FieldVal(fp_rs,"team")%></td>
			<td>
			<%=FP_FieldVal(fp_rs,"report")%></td>
			<td>
			<%=FP_FieldVal(fp_rs,"teamRef")%></td>
		</tr>
		<!--#include file="_fpclass/fpdbrgn2.inc"-->
</tbody>
</table>

</body>

</html>




Page returns message : Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Thanks for your help.

Graeme

< Message edited by Spooky -- 8/19/2005 5:28:18 >

(in reply to WantToLearn)
WantToLearn

 

Posts: 109
Joined: 10/19/2002
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 8/13/2005 14:30:34   
hhmm... It looks like the macro did what it was supposed to. However, I'm not sure about the following lines from your original page:

quote:


<% ' FP_ASP -- ASP Automatically generated by a FrontPage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>


I'm not familiar with what those lines do (help, spooky!):) but it looks like the macro removed them. Try adding them back into the finished page and see if that works.


(in reply to gmcl)
gmcl

 

Posts: 13
Joined: 8/13/2005
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 8/13/2005 14:46:17   
Hi

Did as you suggested, but made no difference. Created another test page (this time FP didn't create those lines by the way).

Same result unfortunately.


(in reply to WantToLearn)
WantToLearn

 

Posts: 109
Joined: 10/19/2002
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 8/13/2005 14:57:27   
bummer...:) Well, the only other suggestion I can think of is to try doing the spooky diet manually (without the macro). If that works, then there is something wrong with the macro. But if it still doesn't work, then it's probably not the macro and you'll need help from someone with more experience with DRW and ASP.


(in reply to gmcl)
gmcl

 

Posts: 13
Joined: 8/13/2005
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 8/13/2005 15:02:46   
Thanks - I'll try it manually over the weekend.

Cheers

(in reply to WantToLearn)
Spooky

 

Posts: 26723
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 8/13/2005 18:02:40   
When you get a server error - do as suggested in this thread to get a full error messgae

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to gmcl)
gmcl

 

Posts: 13
Joined: 8/13/2005
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 8/15/2005 18:16:34   
Hi guys

Well I followed the manual procedure as suggested and rightly ended up with the same code produced by the macro. No surprise to find that the page still returned the same Internal Server Error after uploading.

Also unchecked 'friendly error messages ' on Internet Options, however the error message remains the same.

Could it be a server extensions issue ? although DRW's work fine prior to applying the diet?


(in reply to WantToLearn)
gmcl

 

Posts: 13
Joined: 8/13/2005
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 8/19/2005 4:29:43   
I did some more testing and found that if I applied the Diet to the code on the live server file that the resultant asp page displayed properly.

On further investigation, it looks like if the Diet is applied to the page on the PC, that when the page is published to the server, all the include statements are deleted/not published.

Any suggestions why this is happening. Is it a setup problem on FP. As I said earlier asp pages without the Diet publish and work fine.

Thanks in advance.

Graeme

(in reply to WantToLearn)
Spooky

 

Posts: 26723
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 8/19/2005 5:21:30   
It may be your publishing method - if you choose to optimize publishing, then the includes are stripped - its a FP bug that hasnt been sorted.

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

Sp:)ky


(in reply to gmcl)
gmcl

 

Posts: 13
Joined: 8/13/2005
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 8/19/2005 7:42:02   
Thanks Spooky

- it now works when I remove the Optimise option.

We all get there in the end.

Cheers

(in reply to Spooky)
barrysigsworth

 

Posts: 39
Joined: 11/12/2005
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 2/10/2006 5:44:18   
Hi,
I note the comment from Duane much higher up the thread

"One must first save the page and then refresh before running the macro. Otherwise, the macro will convert the send to database option to send to other and the form will do nothing. "

Using FP2003 I have followed the instruction but a simple add to database page stops working after the diet, on checking in design mode it does show send to other which returns to send to database after using the Undo Last" macro. I have saved, refreshed, saved and refreshed again but each time I then diet the page it stops posting to the database, any suggestions please?


(in reply to gmcl)
WantToLearn

 

Posts: 109
Joined: 10/19/2002
Status: offline

 
RE: Spooky Diet Macro "Revisited" - 2/10/2006 16:22:58   
Please post the code for your page after you've run the macro so we can see what might be wrong.

(in reply to barrysigsworth)
Page:   [1]

All Forums >> Web Development >> General Web Development >> Spooky Diet Macro "Revisited"
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts