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/O Code)
 Printer Friendly & David's Portal Mod
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

StephenD
Senior Member

Australia
1044 Posts

Posted - 09 December 2003 :  22:46:36  Show Profile  Send StephenD a Yahoo! Message
Yeah, can't stop playing around with this Portal Mod....

Been trying to get a 'Printer Friendly' page to work for the articles.

I can create a link in portal.asp OK:

Response.Write	"          <br /><a href=""JavaScript:openWindow5('pop_printer_friendly2.asp" &"?ContentID="& rsContent.Fields("CONT_ID").Value &"&CategoryID=" & TheCat & "')"">" & getCurrentIcon(strIconPrint,"","align=""absmiddle""") & "</a> <a href=""JavaScript:openWindow5('pop_printer_friendly2.asp" &"?ContentID="& rsContent.Fields("CONT_ID").Value &"&CategoryID=" & TheCat & "')"">Printer Friendly</a>" & vbNewLine


It's pop_printer_friendly.asp that I have problems with. Here is a link to a text file of where I'm up to at the moment.
pop_printer_friendly2.txt

Can anyone assist to get this working please. I've been trying for a couple of days now.

Edited by - StephenD on 09 December 2003 22:47:17

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 10 December 2003 :  04:29:05  Show Profile
In the SQL statement, you are using the variable "ContentID", it should be "CONT_ID".
Nice idea, i'll add this to the next release

The UK MkIVs Forum
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 10 December 2003 :  04:36:33  Show Profile  Send StephenD a Yahoo! Message
While you are at it can you add the Next/ Previous Article.

I'm playing with it right now:
Sub Article_nav()    

	if prevArticle = "" then
		'strSQL = "SELECT T_SUBJECT, TOPIC_ID "
	       'strSql = strSql & "FROM " & strActivePrefix & "TOPICS "
		'strSql = strSql & "WHERE T_LAST_POST > '" & Topic_LastPost
		'strSql = strSql & "' AND FORUM_ID=" & Forum_ID
		'strSql = strSql & " AND T_STATUS < 2"  ' Ignore unapproved/held posts
		'strSql = strSql & " ORDER BY T_LAST_POST;"
				
		strSql = "SELECT " 
		strSql = strSql & strTablePrefix & "CMS_CONTENT.CONT_ID, "
		strSql = strSql & strTablePrefix & "CMS_CONTENT.CONT_TITLE "
		strSql = strSql & "FROM " & strTablePrefix & "CMS_CONTENT "
		strSql = strSql & "WHERE " & strTablePrefix & "CMS_CONTENT.CONT_LAST_EDIT > '" & ContentLastEdit   
		strSql = strSql & "'AND " & strTablePrefix & "CMS_CONTENT.CAT_ID = " & CategoryID
		strSql = strSql & "ORDER BY " & strTablePrefix & "CMS_CONTENT.CONT_LAST_EDIT "

		set rsPrevArticle = my_conn.Execute(TopSQL(strSql,1))

		if rsPrevArticle.EOF then
			prevArticle = getCurrentIcon(strIconBlank,"","align=""top"" hspace=""6""")
		else
		  '##### Next/Prev Topic Title Hover MOD #####
			prevTopic = "<a href=""portal.asp?" & "CONT_ID=" & rsPrevArticle("CONT_ID") & """>" & getCurrentIcon(strIconGoLeft,"" & "Previous Article: " & chkString(rsPrevArticle("CONT_TITLE"),"imagetag") & "","align=""top"" hspace=""6""") & "</a>"
		  '###########################################
		end if

		rsPrevArticle.close
		set rsPrevArticle = nothing
	else
		prevArticle = prevArticle
	end if

	if NextArticle = "" then
		strSql = "SELECT " 
		strSql = strSql & strTablePrefix & "CMS_CONTENT.CONT_ID, "
		strSql = strSql & strTablePrefix & "CMS_CONTENT.CONT_TITLE "
		strSql = strSql & "FROM " & strTablePrefix & "CMS_CONTENT "
		strSql = strSql & "WHERE " & strTablePrefix & "CMS_CONTENT.CONT_LAST_EDIT < '" & ContentLastEdit   
		strSql = strSql & "'AND " & strTablePrefix & "CMS_CONTENT.CAT_ID = " & CategoryID
		strSql = strSql & "ORDER BY " & strTablePrefix & "CMS_CONTENT.CONT_LAST_EDIT DESC;"
		
		set rsNextArticle = my_conn.Execute(TopSQL(strSql,1))

		if rsNextArticle.EOF then
			nextTopic = getCurrentIcon(strIconBlank,"","align=""top"" hspace=""6""")
		else
		  '##### Next/Prev Topic Title Hover MOD #####
			nextTopic = "<a href=""portal.asp?" & "CONT_ID=" & rsNextArticle("CONT_ID") & """>" & getCurrentIcon(strIconGoRight,"" & "Next Article: " & chkString(rsNextArtcile("CONT_TITLE"),"imagetag") & "","align=""top"" hspace=""6""") & "</a>"
		  '###########################################
		end if

		rsNextArticle.close
		set rsNextArticle = nothing
	else
		nextArticle = nextArticle
	end if

	Response.Write ("                " & prevArticle & "<b><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """ color=""" & strHeadFontColor & """>  Article </font></b>" & nextArticle)

end sub


Still hammering away
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 10 December 2003 :  04:39:48  Show Profile  Send StephenD a Yahoo! Message
Forgot to say thanks BTW. Love this Portal Mod...
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 10 December 2003 :  04:50:00  Show Profile
Yep, will do, post any other suggestions in here
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=49791

The UK MkIVs Forum
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 10 December 2003 :  06:14:00  Show Profile  Send StephenD a Yahoo! Message
OK, David before v1.2 comes out can you please help me out with my first post. I changed the variable to CONT_ID. I've updated the txt file and here is the relevant code section. Still comes up ' Article Not Found'.

CONT_ID = Request.QueryString("CONT_ID")
if CONT_ID = 0 then
	Go_Result "Article not found."
Response.End
end if	
dim strSql, rsCont

'## CMS_SQL
	strSql = "SELECT " 
	strSql = strSql & strTablePrefix & "CMS_CONTENT.CONT_ID, "
	strSql = strSql & strTablePrefix & "CMS_CONTENT.CAT_ID, "
	strSql = strSql & strTablePrefix & "CMS_CONTENT.CONT_TITLE, " 
	strSql = strSql & strTablePrefix & "CMS_CONTENT.CONT_BODY, "
	strSql = strSql & strTablePrefix & "CMS_CONTENT.CONT_DATE, " 
	strSql = strSql & strTablePrefix & "CMS_CONTENT.CONT_AUTHOR, " 
	strSql = strSql & strTablePrefix & "CMS_CONTENT.CONT_LAST_EDIT "
 	strSql = strSql & "FROM " & strTablePrefix & "CMS_CONTENT "
	strSql = strSql & "WHERE " & strTablePrefix & "CMS_CONTENT.CONT_ID = " & CONT_ID
        'strSql = strSql & "WHERE " & strTablePrefix & "CMS_CONTENT.CAT_ID = " & CAT_ID & " "


set rsCont = my_Conn.Execute (strSql)
if rsCont.EOF then
	rsCont.close
	set rsCont= nothing
	Go_Result "Either the Article was not found<br />or you are not authorized to view it."
	Response.End
end if


Any ideas?
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 10 December 2003 :  06:22:29  Show Profile
That looks fine to me, I think the error lies in the link to open it
Response.Write	"          <br /><a href=""JavaScript:openWindow5('pop_printer_friendly2.asp" &"?ContentID="& rsContent.Fields("CONT_ID").Value &"&CategoryID=" & TheCat & "')"">" & getCurrentIcon(strIconPrint,"","align=""absmiddle""") & "</a> <a href=""JavaScript:openWindow5('pop_printer_friendly2.asp" &"?ContentID="& rsContent.Fields("CONT_ID").Value &"&CategoryID=" & TheCat & "')"">Printer Friendly</a>" & vbNewLine

change to
Response.Write	"          <br /><a href=""JavaScript:openWindow5('pop_printer_friendly2.asp?ContentID="& rsContent.Fields("CONT_ID").Value &"&CategoryID=" & TheCat & "')"">" & getCurrentIcon(strIconPrint,"","align=""absmiddle""") & " Printer Friendly</a>" & vbNewLine

The UK MkIVs Forum
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 10 December 2003 :  06:52:22  Show Profile  Send StephenD a Yahoo! Message
Nah, still the same error David.
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 10 December 2003 :  07:00:37  Show Profile
try changing

if CONT_ID = 0 then
Go_Result "Article not found."
Response.End
end if

to

if Len(CONT_ID) < 1 then
Go_Result "Article not found."
Response.End
end if

The UK MkIVs Forum
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 10 December 2003 :  07:14:52  Show Profile  Send StephenD a Yahoo! Message
Still the same sorry.
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 10 December 2003 :  07:45:20  Show Profile
it looks like the querystring is not been passed for some reason. Right-click on the page, select properties and check the Address(URL)

The UK MkIVs Forum
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 10 December 2003 :  08:10:32  Show Profile  Send StephenD a Yahoo! Message
The URL seems fine
eg. http://www.cashbackphilippines.com/pop_printer_friendly2.asp?ContentID=5&CategoryID=5

If I substitute portal.asp for pop_printer_friendly2.asp the page comes up.
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 10 December 2003 :  08:47:19  Show Profile
remove
if CONT_ID = 0 then
Go_Result "Article not found."
Response.End
end if

is it really needed anyway?

The UK MkIVs Forum
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 10 December 2003 :  09:03:12  Show Profile  Send StephenD a Yahoo! Message
I now get :
Microsoft OLE DB Provider for SQL Server error '80040e14'

Line 1: Incorrect syntax near '='.

/pop_printer_friendly2.asp, line 64

'## CMS_SQL
	strSql = "SELECT " 
	strSql = strSql & strTablePrefix & "CMS_CONTENT.CONT_ID, "
	strSql = strSql & strTablePrefix & "CMS_CONTENT.CAT_ID, "
	strSql = strSql & strTablePrefix & "CMS_CONTENT.CONT_TITLE, " 
	strSql = strSql & strTablePrefix & "CMS_CONTENT.CONT_BODY, "
	strSql = strSql & strTablePrefix & "CMS_CONTENT.CONT_DATE, " 
	strSql = strSql & strTablePrefix & "CMS_CONTENT.CONT_AUTHOR, " 
	strSql = strSql & strTablePrefix & "CMS_CONTENT.CONT_LAST_EDIT "
 	strSql = strSql & "FROM " & strTablePrefix & "CMS_CONTENT "
	strSql = strSql & "WHERE " & strTablePrefix & "CMS_CONTENT.CONT_ID = " & CONT_ID
        'strSql = strSql & "WHERE " & strTablePrefix & "CMS_CONTENT.CAT_ID = " & CAT_ID & " "


set rsCont = my_Conn.Execute (strSql)


Thanks for your attention tonight David.
Go to Top of Page

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 10 December 2003 :  10:22:41  Show Profile
It's definitely not reading the querystring for some reason. Copy this before the sql

response.write("ContentID = " & CONT_ID)
response.end

It's the afternoon by th way

The UK MkIVs Forum
Go to Top of Page

StephenD
Senior Member

Australia
1044 Posts

Posted - 10 December 2003 :  10:25:28  Show Profile  Send StephenD a Yahoo! Message
This is what is output:
ContentID =
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.48 seconds. Powered By: Snitz Forums 2000 Version 3.4.07