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
Next Page
Author Previous Topic Topic Next Topic
Page: of 13

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 13 July 2001 :  03:29:26  Show Profile  Visit Rob Poretti's Homepage
Hi fellow Snitz users,

It's 3:40 AM so I hope this all works, that I've documented everything, and haven't forgotten stuff...

I'll be out-of-commission for about a month, so it's now or never. To be on the safe side, please test this in a development or "off-line" forum before you implement it. The text below is included in the zip, which I'll post the links for, in the next message.

OVERVIEW:

The Content Display mod allows one to take forum posts and flexibly format that content to display on any asp page. It's intention is to create homepage's with dynamic content from within the forum -- to give it that "portal" look & feel.

It is loosely based on the Content Management mod with some ideas taken from the Slash Mod. (Thank you for the initial inspiration to the authors of both those mods!) The functionality, flexibility and ease of use of the Content Display mod, I feel is much better...

This is version 2 which has a number of new features, lots of display issues resolved, some bug fixes, and more programmability for those that are ASP programmers. The editor is now using a DB backend, although I do not yet have an automated way of creating the DB... This is my next little project... for now, I have instructions on creating the table...

SQL SERVER DB TABLE:
I will describe how to create the very simple table for SQL Server 6.5 or 7 -- sorry haven't worked with 2000 yet, so you're on your own there.

Create a table in Enterprise Manager, Access 2000 or some other SQL Server editor and call it: "FORUM_DC_TEMPLATES"

The Fields and their attributes (SQL Server), are as follows:

NAME:........DATATYPE:.....LENGTH:.......ALLOW NULLS:...DEFAULT VALUE:
ID..............int.............4...............no
Name............nvarchar........20..............yes...........(NewTemplate)
Description.....nvarchar........100.............yes...........(Description)
Parameters......nvarchar........100.............yes
Working.........bit.............1...............yes................(1)

Note: ID should be set to an Auto-Incrementing, IDENTITY Column. (In Access this is called AutoNumber.)

MS ACCESS DB TABLE:
Access users, please double check the section below! Do not take this for granted as I haven't worked with Access for some time. By the way, you don't HAVE to have a DB backend... the editor and the content.asp file will work "standalone."

The Fields and their attributes (MS ACCESS), are as follows:

NAME:..........DATATYPE:......LENGTH:........ALLOW NULLS:.....DEFAULT VALUE:
ID...............Autonumber
Name.............Text..............20................No
Description......Text..............100...............Yes.............(NewTemplate)
Parameters.......Text..............100...............Yes.............(Description)
Working..........Yes/No..............................Yes.................(Yes)

VERSION 1 USERS:
The easiest thing to do is replace all your old Display Content files, as if you're starting from scratch. (Please note: If you have a REAL early version, the newer versions have 12 parameters and your old function calls may not work. You'll have to update those.) Also, the editor will either work without a DB backend (like it used to), or if you've properly created the DB, it will use it instead. The DB is much prefereable as you will see when you begin to use it.


HOW TO USE IN PRINCIPLE:
The "content.asp" file should be used as an "include" in any page that you want to display content in. It is usually put at the top of a page -- in the header perhaps and the syntax for this is the following:

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

The next step is to call a sub from that include file which returns the content wherever you need it displayed. To do this you will type something like this:

<% DisplayContent 1, 6, 2, 7, 0, 9, 380, 0, 7, 0, 3, 0 %>

DisplayContent is the name of the sub 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>

THE NEW CONTENT.ASP FILE:
There are a lot of changes-- basically re-written to be more modular and easier to modify for asp programmers. A lot more functionality. I will discuss on Snitz Forums how to easily create more display modes and other cool features.

THE NEW EDITOR:
Even after you've create the DB, when enter the editor for the first time it will not find a recordset. So, the page loads in the "non-DB" MODE. There will be a button called "Create Working Template". This creates an initial Working Template using some default parameters -- displaying content from ForumID = 1 -- which I think is created during the Snitz installation by default. The Display Column may show an error, or report that there are no topics to display, depending if you have anything in that forum or not.

The next time the page reloads, you will be in the "DB-backend" MODE, where you can create, modify and delete templates as well as automatically create the sub parameters that you will paste into you asp pages. 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. If you've got something you like, you can either save this a s template, or simply compy/paste the parameters created into your asp page.

The buttons/fields do the following:

UPDATE DISPLAY: Does just what it did in the old editor; refresh the screen to display a change in any of the parameters. This does not modify data in the table.

STORE: Stores the current Parameters in the DB table, under the currently "loaded" Template.

NEW: Creates a new Template with the current form parameters, and lets you type a name and description for them.

DELETE: Deletes the currently select template after you click "OK" on the "Are you sure?" dialog.

TEMPLATE COMBO: Displays the Name and Description of the loaded template. Selecting another template from the combo, will refresh the screen using those parameters.

(Note: the DB does not store the Display properties or the Admin/Test modes for the editor.)

DISPLAY CONTENT PARAMETERS:
These are fully described below...

CREATED FUNCTIONS WITH CURRENT PARAMETERS:
This is there simply to make it easy for you to copy the parameters and paste them wherever you need. The new Version includes a commented asp identifies that gives the name/description of the template it was derived from.

DISPLAY COLUMN WIDTH/HEIGHT:
These set the width and heigh of the column that is "holding" the content returned by the "content.asp" file. Match this to your target TD attributes and then play with the various parameters to have the content optimally displayed.

DISPLAY MODE:
Shows an "EDIT" button with each post only for administrators, so that they can quickly go to a post and modify content (for whatever reason). This radio button turns this faciltiy on or off so that you can see what it will look like when doing your "layout".

TEST MODE:
Prints the SQL statement that the recordset is created from. Good for debugging or for building SQL statements to use in other pages!


* 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.

DEPENDANCIES:
This is important: You should have the MOD: Message Icons (RichardKinser), the AVATAR MOD (RichardKinser), and the CATEGORY & FORUM SORTING MOD (RichardKinser) and Forum Posting Restrictions and Hiding (HuwR), installed BEFORE you install this mod. Here are available links that I know of:

MOD: Message Icons
Avatar Add-on 2.0
MOD: Category and Forum Sorting (new version)
Forum Posting restrictions and hiding

There are also new functions for the inc_fucntions.asp page that are required. (See below.)

INSTALLATION (Read this carefully):

Copy to your main forum directory:

"content.asp"
"contentdisplay_editor.asp"
"inc_DC_Parameters.asp"
"inc_DC_Variables.asp"
"ADOVBS.INC" - If you already have one of these you may want to keep yours...

Copy all of the images into your "image" directory. Make the change to the admin_home page as noted above.

DO NOT overwrite your "inc_functions.asp" file, with the one I've provided! It is there only as a guide. I use an sr2 forum and some of the functions have changed.

You need to copy/paste the following functions from the included "inc_functions.asp file, into YOUR "inc_functions.asp" file:

"chkDisplayPrivateForum"
"stripALL"


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.



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

Edited by - Rob Poretti on 13 July 2001 03:34:54

Edited by - Rob Poretti on 13 July 2001 08:59:14

Edited by - Rob Poretti on 07 August 2001 21:22:43

Edited by - Rob Poretti on 08 August 2001 10:11:06

Edited by - Rob Poretti on 08 August 2001 11:01:34

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 13 July 2001 :  03:30:12  Show Profile  Visit Rob Poretti's Homepage
DETAILED PARAMETER 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...
0 = displays all content with ID's greater than 0 (zero)
nnnn = Integer - any positive value defining specific ID of the ContentType.

Note: Make sure that the ID exists for the content specified, for 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. Message displayed in Acronym Title.
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 HTML data (n/a - do not use! Use 1, 45, 2, 5, 0, 9, 430, 33, 7, 0 for test)
6 = Future: Use XSL file to format output (n/a - future use)
7 = Graphical: Same content as Article(4) but w/Snitz type table layout & icons.
8 = Graphical 2: Same content as Detailed(3) but w/Snitz type table layout & icons.
9 = Horizontal: Using DHTML -- Coming Soon!
11 = Basic Graphical: DisplayMode 1 with Graphical Bar
21 = Split Graphical: DisplayMode 2 with Graphical Bar

Note:For your own creations, copy/paste DisplayModes and use numbers as a multiple of the
originating 'seed'. Example: copy DisplayMode 7 and rename it to 71.)

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)
8 = By CatID (useful when ContentType = 0)

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 positive value)

Note: (Except when DisplayMode = 0 -- then Message is not shown in Acronym Title)

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

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 or 'special' topics
0 = no checks
1 = check if new/hot/special

SafeMode: Specifies string processing using specific functions.
0 = Return EXACTLY what is in the database with no processing whatsoever
1 = Use FormatStr function which is a little safer but keeps most of the formating.
2 = Use CheckStr function which is what is used in the post.asp file
3 = Default: Use my new StripAll function which removes all forum code and html tags.
4 = Use the stripForumCode function -- removes only Forum Code
5 = Future: Custom Function

ForumStatus: Returns content based on Private/Hidden Forums
0 = Displays any topic.
1 = Does not Display topics that are in Private or Hidden Forums.


' //////////////////////////////////////////////////////////////////////////////////////////////


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

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...

'INCLUDE' SPECIAL VARIABLES (Easily changed programmatically, these are current examples)

strNew = "new10.gif" ' SET NEW IMAGE NAME HERE....
strNewHeight = 12 ' SET NEW IMAGE HEIGHT HERE....
strNewWidth = 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....

strIDImage = "CubeTecSmall.gif" ' SET ID IMAGE NAME HERE....
intIDHeight = 20 ' SET ID IMAGE HEIGHT HERE....
intIDWidth = 50 ' SET ID IMAGE WIDTH HERE....


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

Edited by - Rob Poretti on 13 July 2001 03:36:45
Go to Top of Page

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 13 July 2001 :  03:40:20  Show Profile  Visit Rob Poretti's Homepage
DEMO: http://64.225.137.179/Cube-Tec_Forums/content_test.asp

If you delete templates, please delete templates marked "Delete Test", or create your own templates and delete those! I made those templates for people to look at some display possibilities, without having to figure out each parameter and how they work!

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


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

Edited by - Rob Poretti on 13 July 2001 05:02:58

Edited by - Rob Poretti on 13 July 2001 09:50:00
Go to Top of Page

joswell
Starting Member

USA
11 Posts

Posted - 13 July 2001 :  09:26:56  Show Profile  Visit joswell's Homepage
Rob,
Where can I find a copy of contendisplay_editor.asp, it seems to missing from the zip.
Thanks!

Go to Top of Page

Rob Poretti
Junior Member

Canada
435 Posts

Posted - 13 July 2001 :  09:53:01  Show Profile  Visit Rob Poretti's Homepage
Oops,

Very sleepy when I posted all this... I have updated the zip file. Please re-download it. Thanks for pointing it out Joswell.

Cheers!

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

joswell
Starting Member

USA
11 Posts

Posted - 13 July 2001 :  09:53:04  Show Profile  Visit joswell's Homepage
Rob,
Thank you for updating the zip file!
The only problem I have left is finding the Topic Order Mod. Would you be so kind as to point me in the proper direction.
Thanks!

Go to Top of Page

michaeltran
Starting Member

13 Posts

Posted - 13 July 2001 :  10:51:20  Show Profile
quote:

Oops,

Very sleepy when I posted all this... I have updated the zip file. Please re-download it. Thanks for pointing it out Joswell.

Cheers!

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


Has anyone successfully created FORUM_DC_TEMPLATES in Access 2000?
I don't know how to convert from SQL DataType to Access DataType:
Please translate for me the following:
ID int (Is it Autonumber?)
Name nvchar (Is it Text?)
Working bit (I don't know this one??)

bit = what???
int = what???
nvchar = What???



Edited by - michaeltran on 13 July 2001 10:52:44
Go to Top of Page

michaeltran
Starting Member

13 Posts

Posted - 13 July 2001 :  11:03:03  Show Profile
I keep getting this error message when I first run contentDisplay_editor.asp

ADODB.Recordset error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

contentdisplay_editor.asp, line 204


What is wrong???

Go to Top of Page

Astralis
Senior Member

USA
1218 Posts

Posted - 13 July 2001 :  11:51:08  Show Profile  Send Astralis a Yahoo! Message
Is the content editor working? Also, does anyone know how to use this for an Access database?

Thanks to the author for his hard work!

Go to Top of Page

simonduz
Junior Member

161 Posts

Posted - 13 July 2001 :  14:07:50  Show Profile  Visit simonduz's Homepage  Send simonduz an ICQ Message  Send simonduz a Yahoo! Message
It is working just fine with out the DB backend. I have created the Access table and it does create the 'default' template but then errors out like the records don't exist.
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
/contentdisplay_editor.asp, line 336

After it creates the template it would not let me use the contentdisplay_editor until I delete the record from the DB.
But Rob is correct it does work without the DB and templates. Maybe some one with Access experience can help us get the templates working.
Simonduz

http://easyromantic.webbhost.net -[test site]-
yada, yada.
Go to Top of Page

simonduz
Junior Member

161 Posts

Posted - 13 July 2001 :  14:51:25  Show Profile  Visit simonduz's Homepage  Send simonduz an ICQ Message  Send simonduz a Yahoo! Message
Ok, I just corrected my own problem.
Everything is working on my Access version.
I can try and explain it for ya. Maybe someone else with more experience can do better but here goes.
Create an Access table named FORUM_DC_TEMPLATES
Create the colums /w values:
ID autonumber
Name text field size=20
Description text field size=100
Parameters text field size=100
Working number field size=byte default value=1

To make a long story short. It's has to do with the Working column in the Table.
On creating the default template it enters a value of 255 and in the contentdisplay_editor.asp the value is set to 1.
I changed all instances of WORKING = 1 to WORKING = 255 and bingo, it works.
Like I said I just did what I needed to get it working. Maybe someone else can correct my methods but I hope this helps get you up and running without many changes.
Later.
Simonduz

http://easyromantic.webbhost.net -[test site]-
yada, yada.

Edited by - simonduz on 13 July 2001 14:52:51
Go to Top of Page

michaeltran
Starting Member

13 Posts

Posted - 13 July 2001 :  20:32:57  Show Profile
simonduz;
You're right on the Access. However, I am not good at Access, but I figured out that the DataTypefor Working is should be in Yes/No in Access 2000. This is what Access calls BIT. When Rob Poretti said set the default valaue is (1), I think he meant set it equal TRUE (CHECKED value)

Correct me if I am wrong.
I still get not get the contendisplay_editor.asp work.



Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 14 July 2001 :  03:51:42  Show Profile
Yes In access the working should be set to Yes/No and then you can choose True/False or on/off or Yes/No in the format.

I have another problem. I do not have F.UserList in FORUM_FORUM table neither I have Topic_ORDER.

gauravbhabu

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

joswell
Starting Member

USA
11 Posts

Posted - 14 July 2001 :  08:23:34  Show Profile  Visit joswell's Homepage
quote:

Yes In access the working should be set to Yes/No and then you can choose True/False or on/off or Yes/No in the format.

I have another problem. I do not have F.UserList in FORUM_FORUM table neither I have Topic_ORDER.

gauravbhabu

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


You need to have the topic order, message icon, avatar and Posting restrictions mods installed. The readme says just the first three, but after reviewing the code you need the posting restrictions mod as well. I have those mods installed but I do not have the topic order mod. I can not find it anywhere.


Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 14 July 2001 :  14:18:39  Show Profile
Simply Amazing. Great work Rob. I got it working on my test site. There are some changes required to be made for Access database. But those are minor. Here is a link. This is my development site and hope to have forumSquare live by next week. Please post your comments at just a beginning...

gauravbhabu

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

Astralis
Senior Member

USA
1218 Posts

Posted - 17 July 2001 :  11:25:04  Show Profile  Send Astralis a Yahoo! Message
Has anyone found the "Posting Restrictions Mod"?

Go to Top of Page
Page: of 13 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.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07