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)
 Display Content Mod - Version 2
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 13

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 17 August 2001 :  12:49:48  Show Profile  Visit Rob Poretti's Homepage
Ok... no responses...

If anyone DOES have the problem that I mentioned in my earlier message OR has implemented GauravBhabu's fix for the ID=1 "bug", you should probably take a look at the fix they I will describe.

1) Look for this code:

'//////////////////////////////// FORM VARIABLES //////////////
if Request.Form("intID") = "" then
intID = 1
else
intID = cint(Request.Form.Item("intID"))
end if

and delete it!

2) Look for this code:

if not (oRSTemplates.EOF and oRSTemplates.BOF) then
DatabaseConnected = True
end if

Replace it with this:

if not (oRSTemplates.EOF and oRSTemplates.BOF) then
DatabaseConnected = True
if Request.Form("intID") = "" or Request.Form("intID") = "Blank" then
oRSTemplates.Filter = "WORKING = 1"
intID = oRSTemplates("ID")
oRSTemplates.Filter = adFilterNone
else
intID = cint(Request.Form.Item("intID"))
end if
end if

3) Now for the "UPDATE" problem. Look for the following code in the Select Case Request.QueryString("MODE") section, where case "UPDATE":

strContentType = Request.Form.Item ("strContentType")
strContentID = Request.Form.Item ("strContentID")
strTopicStatus = Request.Form.Item ("strTopicStatus")
strDisplayMode = Request.Form.Item ("strDisplayMode")
strDisplayOrder = Request.Form.Item ("strDisplayOrder")
strTopicCount = Request.Form.Item ("strTopicCount")
strMessageLength = Request.Form.Item ("strMessageLength")
strSubjectLength = Request.Form.Item ("strSubjectLength")
strOrnament = Request.Form.Item ("strOrnament")
strSpecial = Request.Form.Item ("strSpecial")
strSafeMode = Request.Form.Item ("strSafeMode")
strForumStatus = Request.Form.Item ("strForumStatus")

Replace the above with this:

if Request.Form.Item ("strContentType")= "" or _
Request.Form.Item ("strContentID")= "" or _
Request.Form.Item ("strTopicStatus")= "" or _
Request.Form.Item ("strDisplayMode")= "" or _
Request.Form.Item ("strDisplayOrder")= "" or _
Request.Form.Item ("strTopicCount")= "" or _
Request.Form.Item ("strTopicCount")= "" or _
Request.Form.Item ("strMessageLength")= "" or _
Request.Form.Item ("strSubjectLength")= "" or _
Request.Form.Item ("strOrnament")= "" or _
Request.Form.Item ("strSpecial")= "" or _
Request.Form.Item ("strSafeMode")= "" or _
Request.Form.Item ("strForumStatus")= "" then

arrParameterList = split(oRSSelectedTemplate("PARAMETERS"),",")

strContentType = arrParameterList(0)
strContentID = arrParameterList(1)
strTopicStatus = arrParameterList(2)
strDisplayMode = arrParameterList(3)
strDisplayOrder = arrParameterList(4)
strTopicCount = arrParameterList(5)
strMessageLength = arrParameterList(6)
strSubjectLength = arrParameterList(7)
strOrnament = arrParameterList(8)
strSpecial = arrParameterList(9)
strSafeMode = arrParameterList(10)
strForumStatus = arrParameterList(11)
else
strContentType = Request.Form.Item ("strContentType")
strContentID = Request.Form.Item ("strContentID")
strTopicStatus = Request.Form.Item ("strTopicStatus")
strDisplayMode = Request.Form.Item ("strDisplayMode")
strDisplayOrder = Request.Form.Item ("strDisplayOrder")
strTopicCount = Request.Form.Item ("strTopicCount")
strMessageLength = Request.Form.Item ("strMessageLength")
strSubjectLength = Request.Form.Item ("strSubjectLength")
strOrnament = Request.Form.Item ("strOrnament")
strSpecial = Request.Form.Item ("strSpecial")
strSafeMode = Request.Form.Item ("strSafeMode")
strForumStatus = Request.Form.Item ("strForumStatus")
end if


It's not pretty, but it works...

Cheers!



Rob Poretti
Sascom Marketing Group ~ Toronto
vox.905.825.5373 fax.905.825.5960

Edited by - Rob Poretti on 17 August 2001 14:35:13
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 17 August 2001 :  13:34:35  Show Profile
quote:

Ok... no responses...

3) Now for the "UPDATE" problem. ...


if Request.Form.Item ("strContentType")= "" or _
Request.Form.Item ("strContentID")= "" or _
Request.Form.Item ("strTopicStatus")= "" or _
Request.Form.Item ("strDisplayMode")= "" or _
Request.Form.Item ("strDisplayOrder")= "" or _
Request.Form.Item ("strTopicCount")= "" or _
Request.Form.Item ("strTopicCount")= "" or _
Request.Form.Item ("strMessageLength")= "" or _
Request.Form.Item ("strSubjectLength")= "" or _
Request.Form.Item ("strOrnament")= "" or _
Request.Form.Item ("strSpecial")= "" or _
Request.Form.Item ("strSafeMode")= "" or _
Request.Form.Item ("strForumStatus")= "" then

arrParameterList = split(oRSSelectedTemplate("PARAMETERS"),",")
for arrLoop = lbound(arrParameterList) to ubound(arrParameterList)

if isArray(arrParameterList) then
strContentType = arrParameterList(0)
strContentID = arrParameterList(1)
strTopicStatus = arrParameterList(2)
strDisplayMode = arrParameterList(3)
strDisplayOrder = arrParameterList(4)
strTopicCount = arrParameterList(5)
strMessageLength = arrParameterList(6)
strSubjectLength = arrParameterList(7)
strOrnament = arrParameterList(8)
strSpecial = arrParameterList(9)
strSafeMode = arrParameterList(10)
strForumStatus = arrParameterList(11)
end if
next

else
strContentType = Request.Form.Item ("strContentType")
strContentID = Request.Form.Item ("strContentID")
strTopicStatus = Request.Form.Item ("strTopicStatus")
strDisplayMode = Request.Form.Item ("strDisplayMode")
strDisplayOrder = Request.Form.Item ("strDisplayOrder")
strTopicCount = Request.Form.Item ("strTopicCount")
strMessageLength = Request.Form.Item ("strMessageLength")
strSubjectLength = Request.Form.Item ("strSubjectLength")
strOrnament = Request.Form.Item ("strOrnament")
strSpecial = Request.Form.Item ("strSpecial")
strSafeMode = Request.Form.Item ("strSafeMode")
strForumStatus = Request.Form.Item ("strForumStatus")
end if
[/code]

It's not pretty, but it works...

Cheers!



Rob Poretti
Sascom Marketing Group ~ Toronto
vox.905.825.5373 fax.905.825.5960





The statements in red? Why we need them. Instead you may, though not neccessary, make sure we got an array and for that statements in blue. Otherwise both statements in red and blue are not required. I have not checked the whole solution for the problem. But once I do I will let you know.

Share A Square at forumSquare


GauravBhabu

There is only one miracle...That is LIFE!

Edited by - GauravBhabu on 17 August 2001 13:36:26
Go to Top of Page

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 17 August 2001 :  14:34:30  Show Profile  Visit Rob Poretti's Homepage
Right...

See? Thats why I wanted to wait until morning... so I would be more awake!

Not much gets by you GauravBhabu, thanks again...

In fact as you point out, both the blue and red highlighted code sections are not required... I will modify my original posts to correct the error.

Thanks again!



Rob Poretti
Sascom Marketing Group ~ Toronto
vox.905.825.5373 fax.905.825.5960

Edited by - Rob Poretti on 17 August 2001 14:36:03
Go to Top of Page

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 17 August 2001 :  14:42:41  Show Profile  Visit Rob Poretti's Homepage
Actually,

There is one more place where the bit of non-necessary code can be removed. In the section:

Select Case Request.QueryString("MODE")
case "SELECT", "NEW", "CREATE", "DELETE", "STORE"
strSQL = "SELECT ID, Name, Description, Parameters, Working FROM FORUM_DC_TEMPLATES "
strSQL = strSQL & "WHERE WORKING = 1"

Set oRSSelectedTemplate = Server.CreateObject("ADODB.Recordset")
oRSSelectedTemplate.cachesize = 1
oRSSelectedTemplate.Open strSQL, my_Conn

strTemplateName = oRSSelectedTemplate("Name")
strTemplateDescription = oRSSelectedTemplate("Description")

if oRSSelectedTemplate("PARAMETERS") <> "" then
arrParameterList = split(oRSSelectedTemplate("PARAMETERS"),",")
for arrLoop = lbound(arrParameterList) to ubound(arrParameterList)
strContentType = arrParameterList(0)
strContentID = arrParameterList(1)
strTopicStatus = arrParameterList(2)
strDisplayMode = arrParameterList(3)
strDisplayOrder = arrParameterList(4)
strTopicCount = arrParameterList(5)
strMessageLength = arrParameterList(6)
strSubjectLength = arrParameterList(7)
strOrnament = arrParameterList(8)
strSpecial = arrParameterList(9)
strSafeMode = arrParameterList(10)
strForumStatus = arrParameterList(11)
next
end if

Once you remove the non-required bit, you should have this:

Select Case Request.QueryString("MODE")
case "SELECT", "NEW", "CREATE", "DELETE", "STORE"
strSQL = "SELECT ID, Name, Description, Parameters, Working FROM FORUM_DC_TEMPLATES "
strSQL = strSQL & "WHERE WORKING = 1"

Set oRSSelectedTemplate = Server.CreateObject("ADODB.Recordset")
oRSSelectedTemplate.cachesize = 1
oRSSelectedTemplate.Open strSQL, my_Conn

strTemplateName = oRSSelectedTemplate("Name")
strTemplateDescription = oRSSelectedTemplate("Description")

if oRSSelectedTemplate("PARAMETERS") <> "" then
arrParameterList = split(oRSSelectedTemplate("PARAMETERS"),",")

strContentType = arrParameterList(0)
strContentID = arrParameterList(1)
strTopicStatus = arrParameterList(2)
strDisplayMode = arrParameterList(3)
strDisplayOrder = arrParameterList(4)
strTopicCount = arrParameterList(5)
strMessageLength = arrParameterList(6)
strSubjectLength = arrParameterList(7)
strOrnament = arrParameterList(8)
strSpecial = arrParameterList(9)
strSafeMode = arrParameterList(10)
strForumStatus = arrParameterList(11)
end if


Cheers,


Rob Poretti
Sascom Marketing Group ~ Toronto
vox.905.825.5373 fax.905.825.5960
Go to Top of Page

simonduz
Junior Member

161 Posts

Posted - 17 August 2001 :  15:07:48  Show Profile  Visit simonduz's Homepage  Send simonduz an ICQ Message  Send simonduz a Yahoo! Message
I applied the fix and checked the DB, but cannot get this to work.
I am supplying a link to the text.
contentdisplay_editor
content

Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/forum/contentdisplay_editor.asp, line 189


What have I missed?




http://easyromantic.webbhost.net -[test site]-
http://www.mygahanna.com -[new project]-
yada, yada.
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 17 August 2001 :  18:35:17  Show Profile
if you tell what is line 189 then it will be easier to look at the text file and find out the error.

Share A Square at forumSquare


GauravBhabu

There is only one miracle...That is LIFE!
Go to Top of Page

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 18 August 2001 :  10:35:04  Show Profile  Visit Rob Poretti's Homepage
Hi Simuduz,

DOes this error occur when you just enter the editor for the first time, or after you've entered the editor, and edited some content with the Admin Mode edit button -- and then returned?

Could you look at line 189 in your asp file and copy paste it here so we can look at it?



Rob Poretti
Sascom Marketing Group ~ Toronto
vox.905.825.5373 fax.905.825.5960
Go to Top of Page

simonduz
Junior Member

161 Posts

Posted - 18 August 2001 :  11:11:42  Show Profile  Visit simonduz's Homepage  Send simonduz an ICQ Message  Send simonduz a Yahoo! Message
The page displays until I create a default template.
After the template is created is when it generates the error.
I can delete the default from the DB and it will display the page again.
Line:

185 if not (oRSTemplates.EOF and oRSTemplates.BOF) then
186 DatabaseConnected = True
187 if Request.Form("intID") = "" or Request.Form("intID") = "Blank" then
188 oRSTemplates.Filter = "WORKING = 1"
189 intID = oRSTemplates("ID")
190 oRSTemplates.Filter = adFilterNone
191 else
192 intID = cint(Request.Form.Item("intID"))
193 end if


I think part of my problem is that while trying to learn the 'code' I'm having
a little trouble following all of these changes and why they are needed.
So please be bear with me.
Simonduz

http://easyromantic.webbhost.net -[test site]-
http://www.mygahanna.com -[new project]-
yada, yada.
Go to Top of Page

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 18 August 2001 :  14:05:23  Show Profile  Visit Rob Poretti's Homepage
Hmmm.... line 189 as you show it, should not cause that error....

Unless... are you sure that your DB is by default setting the "Working" field to 1? This is very important. As soon as the first record is created it's working field should be set to 1. If not, you need to change the DB so that it does. Please confirm this...


Cheers,

Rob Poretti
Sascom Marketing Group ~ Toronto
vox.905.825.5373 fax.905.825.5960
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 18 August 2001 :  14:48:56  Show Profile
I worked whole day yesterday and revamped the contentdisplay_editor.asp file. I will be putting up a link to this file. Reorganized the code and removed unneccessary code from the file. Rob, you may look at it and hope you will agree with the changes. And then can be put up at the main post or a new topic. Whatever way you prefer?

Share A Square at forumSquare


GauravBhabu

There is only one miracle...That is LIFE!
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 18 August 2001 :  16:51:20  Show Profile
Hi Rob and everyone,

I have modified the contentdisplay_editor.asp. To me it seems to be more manageable now and should not give the errors. I have the same files working at my site without any error. If you get any error Just post it and I will be glad to assist. I have prepared a zip file which includes all the files. Please download them from my site.

Download Link:Display Content Editor

Select ModSquare from the menu and you can download. You need to look at

contentdisplay_editor.asp

I removed the repeating statements and put them in functions which are defined at the bottom of contentdisplay_editor.asp.

Also modified for the user to assign a name and description for the first template instead of assigning the hardcoded name "TEMP" and description "Temporary Working Template".

I have also split this file and created separate files for variable and parameter info. This information now show in a popup window by clicking on the help images near the description field in contentdisplay_editor.asp

Some modification to the functions added to the inc_functions were neccessary for me as I do not have those fields in the tables.

The functions as I have modified are included in the content_functions.asp, which are to be copied to inc_functions.asp. If you already installed this Mod, Please check your inc_functions, you might already have those functions in the file.

Those who have already installed this Mod may just replace the contentdisplay_editor.asp and also add the following files to their main forum folder
inc_DC_variables.asp
inc_DC_parameters.asp

These are included in the zip.


Rakesh


Share A Square at forumSquare


GauravBhabu

There is only one miracle...That is LIFE!
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 18 August 2001 :  17:01:10  Show Profile
quote:

The page displays until I create a default template.
After the template is created is when it generates the error.
I can delete the default from the DB and it will display the page again.
Line:

185 if not (oRSTemplates.EOF and oRSTemplates.BOF) then
186 DatabaseConnected = True
187 if Request.Form("intID") = "" or Request.Form("intID") = "Blank" then
188 oRSTemplates.Filter = "WORKING = 1"
189 intID = oRSTemplates("ID")
190 oRSTemplates.Filter = adFilterNone
191 else
192 intID = cint(Request.Form.Item("intID"))
193 end if


I think part of my problem is that while trying to learn the 'code' I'm having
a little trouble following all of these changes and why they are needed.

yada, yada.




When you apply filter at line 188. If no record is returned then the line 189 will give the error, you are mentioning.

You may use the contentdisplay_editor.asp and related files from the zip file which I have mentioned in my earlier post. You will need the following files from the zip. Just add them to your main forum folder. You should be able to use them as is except for image links, which may be different in your forum.

contentdisplay_editor.asp
inc_DC_variables.asp
inc_DC_parameters.asp

You will be all set.


Share A Square at forumSquare


GauravBhabu

There is only one miracle...That is LIFE!
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 18 August 2001 :  17:06:11  Show Profile
quote:

Hmmm.... line 189 as you show it, should not cause that error....

Unless... are you sure that your DB is by default setting the "Working" field to 1? This is very important. As soon as the first record is created it's working field should be set to 1. If not, you need to change the DB so that it does. Please confirm this...


Cheers,

Rob Poretti




You are right Rob. If after filter no record is returned it will give an error. Though the default for working is 1, but if for any reason all templates are set to false then this error can not be avoided. To avoid that, I have a solution for this and other errors and you may look at the modifified contentdisplay_editor.asp included in the zip file for which I have posted a download link in my earlier post.

Share A Square at forumSquare


GauravBhabu

There is only one miracle...That is LIFE!

Edited by - GauravBhabu on 18 August 2001 17:07:40
Go to Top of Page

Morpheus73
Average Member

Denmark
597 Posts

Posted - 18 August 2001 :  18:01:06  Show Profile
will this work with a article.asp-like file? ... what about the linksection? will it work with that? ... What I would really like to se was an integration of this with Tschive´s portalmod www.heilpaedagogik.121host.net/portal - would be so cool if you could use this mod to control the portalsystem....

mph73

Morpheus73 - morpheus73@hotmail.com
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 18 August 2001 :  18:17:16  Show Profile
This mod can be used any way you want it. Need to reference the infromation from database. At this moment the scope is limited to categories,forums,topics and posts

Share A Square at forumSquare


GauravBhabu

There is only one miracle...That is LIFE!
Go to Top of Page
Page: of 13 Previous Topic Topic Next Topic  
Previous Page | 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.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07