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
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 16

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 11 May 2001 :  17:18:22  Show Profile  Visit Rob Poretti's Homepage
Hi fellow Snitz users,

OVERVIEW:

The Display Content mod is loosely base on the Content Management mod with some ideas taken from the Slash Mod. However the functionality, flexibility and ease of use is much better. (See function parameters below, to get an idea of the functionality possible.)

It is simple to implement.

The content.asp file should be used as an "include" in any page that you want to display content in. The syntax for this is the following:

<!--#INCLUDE FILE="content.asp" -->

The next step is to call a function that returns the content wherever you need that content. To do this you will type something like this:

<% DisplayContent 1, 6, 2, 4, 0, 7, 275, 35, 5 %>

DisplayContent is the name of the function and the various numbers are a list of parameters that define how the content is collected, filtered, sorted, formatted, etc.

Since there are a lot of parameters, I have created a page called "DisplayContent_Editor.asp" to simplify setting up the parameters. I recommend that you put a link in the admin_home.asp page to access this page. If you like, you can copy/paste this into your admin_home.asp page:

<LI><a href="contentdisplay_editor.asp">Content Display Editor</a></LI>

* Make sure that you also have the inc_functions.asp, config.asp AND the inc_top.asp as includes in each page that you want to use the Display Content mod.

DATABASE ISSUES:

The SQL expressions used in this mod are formed for SQL Server 6.5/7/2000. I have not tested them with MS ACCESS and pretty sure they won't work with MYSQL.

OTHER PRE-REQUISITES:

This mod uses the msgIcon, Avatar mods and Topic Order mods. It will not work without the msgIcon Mod although an ASP programmer could easily make the changes so it will. If you don't have the Avatar mod, then one of the display modes won't work properly but the rest should be fine.

The Topic Order Mod needs to be installed as well. (It lets you order "By Topics Order field.")

I know of no other dependency. This mod should work in sr2 and up.

INSTALLATION:

Copy "content.asp" and "contentdisplay_editor.asp" to your main forum directory. Copy all of the images into your image directory. Make the change to the admin_home page as noted above.

Thats it!

OPERATION:

Go to the Display Content Editor. The "contentdisplay_editor.asp" page is fairly self-explanatory. The form field boxes allows one to set the various parameters. Please carefully read what all the parameters do. Once you set something, press "Update Display" and look at the results in the Display Column. You can change the Display column width to match what you will be looking for in your final output.

Once you get something formatted the way you want, simply copy the function parameters and paste it wherever you need that content to appear in the page that you're working on. (This is a little more evident if you're looking at the page!)

NOTES:

1) Make sure that you have correct category, forum, topic, author or msgIcon ID's. Look in your db to get those ID's

2) Don't use DisplayModes 5 and 6 -- 5 is something custom that I use -- IT WILL NOT WORK WITH YOUR FORUM. 6 is for and XML/XSL mode that I will be working on next.


DETAILED FUNCTION INFORMATION:


DisplayTopics(ContentType, ContentID, TopicStatus, DisplayMode, DisplayOrder,
TopicCount, MessageLength, SubjectLength, Ornament)


ContentType: How the content is initially derived...
0 = display topics from a specific category ID
1 = display topics from a specific forum ID
2 = display a specific topic ID (single topic is returned)
3 = display topics from a specific msgIcon ID (msgIcon mod must be installed)
4 = display topics from a specific author ID

ContentID: The category, forum, topic, msgIcon or author ID that the source is derived from...
Note: Make sure that the ID exists in your forum!

TopicStatus: Returns open, closed or all topics...
0 = returns closed topics
1 = returns open topics
2 = returns open or closed topics

DisplayMode: How the material is formatted and returned to the calling function...
0 = Link Only: Displays topics with links into the actual forum topic
1 = Basic: Displays topics with message next to topic link
2 = Split: Displays topics on top with links to the message below
3 = Detailed: Displays topics with message & details next to topic link
4 = Article: Displays topics with subject link, details & author's photo/avatar next to message
5 = Custom: Return raw data - So it can be formated using HTML! (n/a - do not use)
6 = Future: Use XSL file to format output (n/a - future use)

DisplayOrder: Order for the Displaying Returned Topics...
0 = By Last Posted Date
1 = By Topics Order field (Topic Order mod must be installed)
2 = By most View Counts
3 = By most Replies
4 = By msgIcons value (msgIcon mod must be installed)
5 = By author
6 = By original post Date

TopicCount: Maximum number of topics to display...
nnnn = Integer - any value from 1 to 9999

MessageLength: Maximum number of chars in each Topic message...
0 = full message
nnnn = number of characters to display (Integer - any value from 1 to 9999)

SubjectLength: Maximum number of chars in each Topic Subject...
0 = full subject
nnnn = number of characters to display (Integer - any value from 1 to 9999)

Ornament: Type of ornament to display
0 = no ornament - plain
1 = bullet
2 = msgIcon(requires MsgIcon mod)
3 = graphic
4 = numbered
5 = numbered graphic


--------------------------------------------------------------------------------

'INCLUDE' ORNAMENT VARIABLES: (Easilly changed programmatically, these are current examples)

strGraphicsPath = "images/" ' SET GRAPHIC IMAGE PATH HERE....

strBullet = "ballbullet3.gif" ' SET BULLET IMAGE NAME HERE....
intBulletWidth = 9 ' SET BULLET IMAGE WIDTH HERE ....
intBulletHeight = 9 ' SET BULLET IMAGE HEIGHT HERE ....

strGraphic = "bullet2.gif" ' SET GRAPHIC IMAGE NAME HERE....
intGraphicWidth = 15 ' SET GRAPHIC IMAGE WIDTH HERE ....
intGraphicHeight = 15 ' SET GRAPHIC IMAGE HEIGHT HERE ....

strNumberedGraphic = "_star.gif" ' SET NUMBERED GRAPHIC NAME HERE....
intNumberedGraphicWidth = 24 ' SET NUMBERED GRAPHIC IMAGE WIDTH HERE ....
intNumberedGraphicHeight = 24 ' SET NUMBERED GRAPHIC IMAGE HEIGHT HERE ....

intMsgIconWidth = 15 ' SET MSGICON IMAGE WIDTH HERE ....
intMsgIconHeight = 15 ' SET MSGICON IMAGE HEIGHT HERE ....

intPhotoAvatarWidth = 60 ' SET PHOTO/AVATAR IMAGE WIDTH HERE ....
intPhotoAvatarHeight = 80 ' SET PHOTO/AVATAR IMAGE HEIGHT HERE ....

strCounterDelimiter = ")" ' Alternatively use . ] | - or other characters...



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

Edited by - Rob Poretti on 11 May 2001 17:19:50

Edited by - Rob Poretti on 11 May 2001 17:30:22

Edited by - Rob Poretti on 17 May 2001 15:13:14

Edited by - Rob Poretti on 17 May 2001 21:17:49

Edited by - Rob Poretti on 21 May 2001 14:09:42

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 11 May 2001 :  17:19:33  Show Profile  Visit Rob Poretti's Homepage
Here are the various links...

DEMO: http://64.225.137.179/Cube-Tec_Forums/contentdisplay_editor.asp

FILES: http://64.225.137.179/Cube-Tec_Forums/downloads/ContentDisplayMod.zip

I'm afraid I will not be availalbe during the weekend to answer questions. I'll get to everyone on Monday...

Thanks for everyone's kind comments concerning the site. This site is not on-line yet and won't be for a number of weeks so there are a few "bugs" to deal with...

Cheers!

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

Edited by - Rob Poretti on 12 May 2001 00:33:51
***Changed the demo link

Edited by - Rob Poretti on 16 May 2001 20:53:11
Go to Top of Page

rick7165
Senior Member

USA
1094 Posts

Posted - 11 May 2001 :  17:44:48  Show Profile  Visit rick7165's Homepage
For those that read this... GO LOOK AT ROB'S FORUM!!

BTW.... Make sure you're sitting down and put your
set belt on because it will knock you out of your CHAIR!!


Hey Rob... Slide me your code... hehehe J/K



Test Site
www.eastpasco.com
HuwR's SR4 release. Colors and Graphic scheme done by Richard Kinser.

Edited by - rick7165 on 11 May 2001 17:47:46
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 11 May 2001 :  18:24:57  Show Profile  Visit HuwR's Homepage
It blew my chair apart, very nice site.

Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 11 May 2001 :  19:10:25  Show Profile
WOW!!

Rob, you better make room for that June Snitz award!!

Very, very, very nice site!! - oh and the mod looks great too.




Edited by - work mule on 11 May 2001 19:11:11
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 12 May 2001 :  00:54:24  Show Profile  Visit gor's Homepage
Very nice

Pierre
Join the Snitz WebRing
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 12 May 2001 :  11:03:56  Show Profile
quote:

6 is for and XML/XSL mode that I will be working on next.



I was reading over the instructions again and this caught my attention! Can you elaborate a little bit on this one?

We've been working with XML/XSL. Last December we brought online our content management system, which we built inhouse, to manage our websites. We use a combination of SQL Server to manage the data but then save all of our articles into an XML document. The XML document is nice because it stores all of the information related to the article in one location and saves us from having to run through all the complex queries which would kill us in a production environment (checking production schedules, existing images and publishing rights, etc.). With the XML document we can then publish static html files for everything we can and then also migrate the XML/XSL files over to the production server for other things like for allowing the user to get email, print, and text versions of the articles. This also takes the load off of our production db server. XML/XSL is very, very nice!

So anyways, what I've been looking into is integrating our articles in the Snitz forums and pulling in discussions/comments that pertain to the articles on the site and doing this without having the admin manually create a topic for each article. My idea is that each article has a unique article id. I would add an article id field to the topic/reply tables. I can use a query to check for topics/replies with that id for any articles. If there are none, then I just return a message saying there are no discussions. If someone wants to make a comment, then if there are no records, I would call my xml parser, pass it the id of the article, which it can relate to the proper xml file, and then get the article summary and post it in the topic table and then allow the user to create a record in the reply field with the proper topic id.

Go to Top of Page

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 12 May 2001 :  17:29:05  Show Profile  Visit Rob Poretti's Homepage
quote:

quote:

6 is for and XML/XSL mode that I will be working on next.



I was reading over the instructions again and this caught my attention! Can you elaborate a little bit on this one?




Sure...

I'm going to create a XSL document to format the data and create the HTML (server side) to feed to the client browser. Haven't got into details yet because I have to finish this website first. Perhaps I'll get into it in 3 or 4 weeks...


Cheers!

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

Deleted
deleted

4116 Posts

Posted - 12 May 2001 :  20:55:35  Show Profile
Great site. Congrats.

Bulent Ozden
History Foundation of Turkey
bozden@tarihvakfi.org.tr
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 13 May 2001 :  01:08:00  Show Profile  Visit gor's Homepage
quote:

I'm going to create a XSL document to format the data and create the HTML (server side) to feed to the client browser. Haven't got into details yet because I have to finish this website first. Perhaps I'll get into it in 3 or 4 weeks...



I know you don't have details yet, but what are you going to use to do the serverside conversion ?
Might I suggest using Xalan (see http://xml.apache.org/) instead of the Msxml parser ?
For two reasons: it also runs on linux and once you get that to run properly (took me some time) it is just a small step to using the Fop conversion tool (also on the apache site) to also do XML -> PDF conversion. And absolutely cool would be ofcourse to get it running in combination with Cocoon and have the conversion done on demand / dynamically on the server .


Pierre
Join the Snitz WebRing
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 13 May 2001 :  01:57:35  Show Profile
Hey gor, I haven't checked out the URL yet, but how well does it work on an NT server compared to the MSXML parser? Performance, ease of use, etc?

Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 13 May 2001 :  02:23:09  Show Profile  Visit gor's Homepage
Well...it works...eventually.
It depends a bit on how comfortable you are with installing a JAVA based application.
I hadn't done that before (hey, I'm a Windows-guy), so that took me a bit longer that instaling the MSXML component.
Both can run side by side btw.

Can't say much about the performance cause I only used it in a test-environment, but if you're planning to use the MSXML component in combination with ASP to do a live XML -> HTML conversion for you site, I think you run into problems when the site gets bigger.
The Cocoon application for build just for doing realtime conversion of XML, uses caching, doesn't need ASP to control it etc. So I think that then probably would be faster.
Ofcourse, if you want to do XML -> PDF and don't want to pay for it, FOP is your choice.

It took me a while to find the correct syntax of the commands using Xalan or FOP to actually get something going.
With MSXML in combination with ASP, where I just tread it like a component in a ASP page, that was/is much closer to home for me.
I'm not sure if you can call the Xalan parser from within ASP. If you use Cocoon to serve the page dynamically, you don't use ASP to decide what to do, but leave it all up to Cocoon.
One thing you have to remember though is that the XML and XSL pages you create are (almost) the same. For those is doesn't matter. I say almost because there might be a few small differences between what the different parsers support.

So, for a quick start, some easy conversion, I would go for MSXML.
For a large scale, cross platform option (don't think MSXML installs on Chili!Asp/Linux), I would use Xalan
If I wanted to use FOP to do -> PDF conversion I would use Xalan / FOP (FOP needs an external parser).

Pierre
Join the Snitz WebRing
Go to Top of Page

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 13 May 2001 :  12:13:06  Show Profile  Visit Rob Poretti's Homepage
Thanks Gor,

I'll look into it when I'm ready to jump in that revision...

I'm really interested in the pdf conversion. This could be VERY useful for the web site I'm working on -- which is essentially a tech support site. Creating on-the-fly pdf's of technical/service bulletins is a very interesting idea.

..........................

Anybody have problems installing the mod and having it work for them?



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

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 15 May 2001 :  13:44:52  Show Profile  Visit Rob Poretti's Homepage
Oops.. found a bug...

The MsgIcon Ornament is not working properly. I'll have something posted later this afternoon which fixes this plus adds some other functionality. Sorry about that.

Found some other minor problems -- and I'm adding some other functionality. New version will be up tomorrow...

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

Edited by - Rob Poretti on 15 May 2001 23:36:04
Go to Top of Page

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 16 May 2001 :  16:18:44  Show Profile  Visit Rob Poretti's Homepage
OK.... I've fixed the bug and updated the demo site:

DEMO: http://64.225.137.179/Cube-Tec_Forums/content_test.asp

I'm not going to post the new files until I play around with it over the next day or so... doesn't sound like anyone is in a rush for this anyway! I'll try to get the files up tomorrow...

I've added an Admin mode. If you are logged on as an administrator, the content that is displayed also shows an "edit" button so that you can go directly to that post and edit it's content. This is very handy when you're trying to get a layout to work. web (thanks Stef, for this idea.)

The Display Content Editor can turn display mode "on" or "off" so that you can see the layout as anyone visiting the site would see it. You can test this by switching modes and then hitting "update".

I've also added more graphic ornament modes. I had a request to do this so that you could easily change a bullet or graphic element to deal with different backgrounds and color schemes of a web site. Once the include variables are set for a particular web project, there should be much less changes to the actual include file -- then, all you have to do is pass parameters!

I added a "special" mode which is sort of like the ChkIsNew function in the inc_functions.asp. It checks for hot or new topics and puts up the appropriate image.

It also will look for something I call "special". This amounts to anything you might need! For example, you can set it so that it will display the MsgIcon of MsgIcon = 14 -- this might happen to represent a special announcemnt icon or technical bulletin icon. You have to edit the include file for this, but it's fairly easy to do. For this example:

if rs("T_MSGICON")=14 then ' ///// CHECK FOR SPECIAL STATUS - PUT WHATEVER YOU LIKE HERE ////
CheckIsSpecial = CheckIsSpecial & "<img width='" & intSpecialWidth & "' height='" & intSpecialHeight & "' src='" & strMsgIcon & "'>"
end if


With this example, that MsgIcon will be displayed only on topics that have MsgIcon set to 14 even if ornament is set to numbered or some other ornament. You can test for anything that the recordset can return, and then have it display some graphic element.

That's all for now...


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

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 16 May 2001 :  17:38:33  Show Profile  Visit Rob Poretti's Homepage
I've uploaded the new files:

FILES: http://64.225.137.179/Cube-Tec_Forums/downloads/ContentDisplayMod.zip

DEMO: http://64.225.137.179/Cube-Tec_Forums/contentdisplay_editor.asp

The links are the same as in the first message, so either one will do.


Here is an overview of the new version:

//////////////////////////////////////////////////////////////////////////////////////////////
DETAILED FUNCTION INFORMATION:


DisplayContent(ContentType, ContentID, TopicStatus, DisplayMode, DisplayOrder, TopicCount, MessageLength, SubjectLength, Ornament, Special)

ContentType: (Where the source is derived from)
0 = display topics from a specific category ID
1 = display topics from a specific forum ID
2 = display from a specific topic ID (single topic is returned)
3 = display topics from a specific msgIcon ID (msgIcon mod must be installed)
4 = display topics from a specific author ID

ContentID: (the ID of the category, forum, topic, msgIcon or author that the source is derived from)

TopicStatus: Returns open, closed or all topics
0 = returns closed topics
1 = returns open topics
2 = returns open or closed topics

DisplayMode: (how the material is formatted and returned to the calling function)
0 = Link Only: Displays topics with links into the actual forum topic
1 = Basic: Displays topics with message next to topic link
2 = Split: Displays topics on top with links to the message below
3 = Detailed: Displays topics with message & details next to topic link
4 = Article: Displays topics with subject link, details & author's photo/avatar next to message
5 = Custom: Return raw data - So it can be formated using HTML! (n/a - do not use)
6 = Future: Use XSL file to format output (n/a - future use)

DisplayOrder: Order for the Displaying Returned Topics
0 = By Last Posted Date
1 = By Topics Order field (Topic Order mod must be installed)
2 = By most View Counts
3 = By most Replies
4 = By msgIcons value (msgIcon mod must be installed)
5 = By author
6 = By original post Date
7 = By ForumID (useful when ContentType = 0)

TopicCount: Maximum number of topics to display (integer - any value from 1 to 9999)

MessageLength: Maximum number of chars in each Topic message.
n = number of characters to display (integer - any value from 1 to 9999)

Ornament: Type of ornament to display
0 = no ornament - plain
1 = Bullet 1
2 = Bullet 2
3 = Graphic 1
4 = Graphic 2
5 = msgIcon
6 = numbered
7 = numbered graphic
8 = special (hot, new or special topics)

Special: Check for new, hot and special topics
0 = no checks
1 = check if new/hot/special

//////////////////////////////////////////////////////////////////////////////////////////////



//////// ORNAMENT VARIABLES //////////////////////////////////////////////////
strGraphicsPath = "images/" ' SET GRAPHIC IMAGE PATH HERE....

strBullet1 = "ballbullet3.gif" ' SET BULLET 1 IMAGE NAME HERE....
intBullet1Width = 12 ' SET BULLET 1 IMAGE WIDTH HERE ....
intBullet1Height = 12 ' SET BULLET 1 IMAGE HEIGHT HERE ....

strBullet2 = "bullet2.gif" ' SET BULLET 2 IMAGE NAME HERE....
intBullet2Width = 9 ' SET BULLET 2 IMAGE WIDTH HERE ....
intBullet2Height = 9 ' SET BULLET 2 IMAGE HEIGHT HERE ....

strGraphic1 = "updat4.gif" ' SET GRAPHIC 1 IMAGE NAME HERE....
intGraphic1Width = 47 ' SET GRAPHIC 1 IMAGE WIDTH HERE ....
intGraphic1Height = 10 ' SET GRAPHIC 1 IMAGE HEIGHT HERE ....

strGraphic2 = "machineadd.gif" ' SET GRAPHIC 2 IMAGE NAME HERE....
intGraphic2Width = 13 ' SET GRAPHIC 2 IMAGE WIDTH HERE ....
intGraphic2Height = 15 ' SET GRAPHIC 2 IMAGE HEIGHT HERE ....

strNumberedGraphic = "_star.gif" ' SET NUMBERED GRAPHIC NAME HERE....
intNumberedGraphicWidth = 24 ' SET NUMBERED GRAPHIC IMAGE WIDTH HERE ....
intNumberedGraphicHeight = 24 ' SET NUMBERED GRAPHIC IMAGE HEIGHT HERE ....

intMsgIconWidth = 15 ' SET MSGICON IMAGE WIDTH HERE ....
intMsgIconHeight = 15 ' SET MSGICON IMAGE HEIGHT HERE ....

intPhotoAvatarWidth = 60 ' SET PHOTO/AVATAR IMAGE WIDTH HERE ....
intPhotoAvatarHeight = 80 ' SET PHOTO/AVATAR IMAGE HEIGHT HERE ....

strCounterDelimiter = ")" ' Alternatively use . ] | - or other characters...


//////// SPECIAL VARIABLES //////////////////////////////////////////////////
strNew = "new10.gif" ' SET NEW IMAGE NAME HERE....
intNewHeight = 12 ' SET NEW IMAGE HEIGHT HERE....
intNewWidth = 28 ' SET NEW IMAGE WIDTH HERE....

strHot = "hot_animate.gif" ' SET HOT IMAGE NAME HERE....
intHotHeight = 16 ' SET HOT IMAGE HEIGHT HERE....
intHotWidth = 44 ' SET HOT IMAGE WIDTH HERE....

strSpecial = "arrow.gif" ' SET SPECIAL IMAGE NAME HERE....
intSpecialHeight = 15 ' SET SPECIAL IMAGE HEIGHT HERE....
intSpecialWidth = 15 ' SET SPECIAL IMAGE WIDTH HERE....

strSpecialDisplayTest = " rs('T_MSGICON')=14 " ' SET SPECIAL CRITERIA HERE....



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

*** Changed the demo link...

Edited by - Rob Poretti on 16 May 2001 20:53:54
Go to Top of Page
Page: of 16 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.28 seconds. Powered By: Snitz Forums 2000 Version 3.4.07