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)
 Content Display 3.4.03.08 Beta
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 24

@tomic
Senior Member

USA
1790 Posts

Posted - 13 September 2002 :  21:48:07  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message

Content Display 3.4.03.01


For Snitz 3.4.02 and 3.4.03


Initial Release September 13, 2002
Updated December 26, 2002 (3.4.03.08)

Beta Release! Do not mess with this unless you are quite
aware of what you are doing

There is no security working with this right now
so once again I warn you not to use this in production.
I will have no sympathy for people running here to
post that their entire site has been hacked, ruined or
the polar ice caps melted because of this beta.



Download:
http://www.skepticfriends.org/download/contentdisplay34.zip

Alternate Download(Snitz Bitz):
http://www.snitzbitz.com/mods/details.asp?Version=All&mid=63


Demo available at:
http://www.skepticfriends.org/

User name: demo
Password: demo

Please report here any bugs or readme errors or ideas you would like to
share to improve this MOD.

Special thanks to Rob Poretti for the original MOD.


File changed in 3.4.03.08 - December 26, 2002
Added function CDchkForumAccess to inc_contentdisplay.asp

Files Added or changed in 3.4.03.01 - December 25, 2002
Added bookreviews.asp
Assorted security and formatting fixes in content.asp

Changes in 3.4.03.06

Added a parameter to content.asp for links so that all links are dynamic meaning any display mode can point to article.asp, news.asp or topic.asp

Renamed news2.asp to newsleftmenu.asp

Renamed article2.asp articleleftmenu.asp


Added or changed in 3.4.02.06

Added a parameter to content.asp for links so that all links are dynamic
meaning any display mode can point to article.asp, news.asp or topic.asp

Switched news.asp2 and news.asp so that news.asp is the "clean" version

Switched aerticle2.asp to article.asp so that article.asp is the "clean" version

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

Added or changed in 3.4.02.05

Added news.asp - comes with side menu but you have to add your own include files.
I left some there so you can see where they go.

Added news2.asp - Clean version of news.asp

Added 2 new display modes to content.asp


Added or changed in 3.4.02.04

content.asp
Numerous HTML fixes in every display mode. Other changes made to simplify the table structure.

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

Added or changed in 3.4.02.03

added article2.asp
- This is a "clean" version of article.asp which means it has no left side
menu and no mysteriously missing include files to irritate you all to no
end. I left article.asp with this as a starting point for those of you that
desire a left side menu. Both article pages started as default.asp so you
can use the same idea to make you default.asp have a left side menu or use
it as a template for other pages you would like to have a left menu on.

Added contentdisplay_tester.asp
-which is default.asp with evertything stripped off except for the Content
Display MOD. You can use this page to try out new display modes and help
me debug HTML errors ; )

################################################################################
Beta Release! Do not mess with this unless you are quite aware of what you are doing.
################################################################################

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 3.4.02 which has a number of new features, lots of display issues
resolved, some bug fixes, and more programmability for those that are ASP programmers.
You can now enter header text and table width where you call the Content Display sub.

Access users, please double check this! 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."

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 0, 3, 2, 12, 0, 5, 200, 0, 5, 1, 1, 0, "Top News Stories", 300, "news.asp" %>

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

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.

New Display Modes are:


Article and News

There is a header template that is super easy to customize.

* Make sure that you also have these includes in each page that you want to
use the Display Content mod.

The top of your page should look something like this:

<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="content.asp" -->
<!--#INCLUDE FILE="inc_contentdisplay.asp" -->

The very bottom of your page should have:

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


To use this outside the forum the includes should look like this:

<!--#INCLUDE VIRTUAL="forum/config.asp"-->
<!--#INCLUDE VIRTUAL="forum/inc_func_secure.asp" -->
<!--#INCLUDE VIRTUAL="forum/inc_sha256.asp"-->
<!--#INCLUDE VIRTUAL="forum/inc_header.asp" -->
<!--#INCLUDE VIRTUAL="forum/content.asp" -->
<!--#INCLUDE VIRTUAL="forum/inc_contentdisplay.asp" -->

The very bottom of a page outside the forum should have:

<!--#INCLUDE VIRTUAL="forum/inc_footer.asp" -->


These are, for now the necessary includes.

DEPENDANCIES:


You should have the MSGICON MOD and the AVATAR MOD
installed BEFORE you install this mod.

Message Icons and Avatars may be commented out if you know what you are doing and display
modes that do not use these features can be used.

INSTALLATION

(Read this carefully):
Copy to your main forum directory:

content.asp
article.asp
article2.asp
inc_contentdisplay.asp
contentdisplay_tester.asp


Copy all of the images into your "image" directory.

Add the following to inc_iconfiles.asp:

'Added for Content Display
Const strIconEmailCD = "email.gif|18|18"
Const strIconBlank3CD = "blank.gif|3|1"
Const strIconBlank10CD = "blank.gif|10|1"
Const strIconBlank20CD = "blank.gif|20|1"
Const strIconEditCD = "edit.gif|28|16"
Const strIconViewDocCD = "viewdoc.gif|15|15"
Const strIconGraphic1CD = "updat4.gif|47|10"
Const strIconGraphic2CD = "machineadd.gif|13|15"
Const strIconBullet1CD = "ballbullet3.gif|12|12"
Const strIconBullet2CD = "bullet2.gif|9|9"
Const strIconNewCD = "new10.gif|28|12"
Const strIconHotCD = "hot_animate.gif|44|16"
Const strIconSpecialCD = "arrow.gif|15|15"


Replace the getCurrentIcon function with this:

function getCurrentIcon(fIconName,fAltText,fOtherTags)
	if fIconName = "" then exit function
	if fOtherTags <> "" then fOtherTags = " " & fOtherTags
	if Instr(fIconName,"http://") > 0 then strTempImageUrl = "" else strTempImageUrl = strImageUrl
	tmpicons = split(fIconName,"|")
	if tmpicons(1) <> "" then fWidth = " width=""" & tmpicons(1) & """"
	if tmpicons(2) <> "" then fHeight = " height=""" & tmpicons(2) & """"
	if lcase(left(fIconName,7)) = "http://" then 
	getCurrentIcon = "<img src=""" & strTempImageUrl & tmpicons(0) & """" & fWidth & fHeight & " border=""0"" alt=""" & fAltText & """ title=""" & fAltText & """" & fOtherTags & " />"
	else
	getCurrentIcon = "<img src=""" & strForumURL & strTempImageUrl & tmpicons(0) & """" & fWidth & fHeight & " border=""0"" alt=""" & fAltText & """ title=""" & fAltText & """" & fOtherTags & " />"
	end if
end function

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.

The following include files will be necessary(maybe more I have forgotton)

<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_contentdisplay.asp" -->

GETIMAGE.ASP and GETPHOTO.ASP


Place getimage.asp and getphoto.asp in the root of your website. They do not go in the forum.
The root is one level above the forum. So where you place those 2 files you will see your
forum folder. These files protect your avatar and photo images from being easily linked to(
leeched) to save your bandwidth.


TO USE ARTICLE.ASP, NEWS.ASP and CATEGORY.ASP


You will need to designate a forum category for news and/or articles(note the CATEGORY_ID)
You will then need to create forums for articles and news(Note the FORUM_ID)

Then in your content sub you will want to point at the category or even better the forum for articles or news.
Don't forget that if you want it to go to articles the last parameter would be "articles.asp"

If you are using the left menu version there are places to hard code(for now) the FORUM_ID in the lenk to forums and news.


DETAILED FUNCTION INFORMATION:

DISPLAY CONTENT FUNCTION PARAMETERS:


sub DisplayContent(ContentType, ContentID, TopicStatus, DisplayMode, DisplayOrder, TopicCount, MessageLength, SubjectLength, Ornament, Special, SafeMode, ForumStatus, HeaderText, TableWidth, strLink)

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)
0 = displays all content with ID's greater than 0 (zero)

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 = Topics Deluxe: 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)
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
12 = Basic News Display
13 = Article Display
21 = Split Graphical: DisplayMode 2 with Graphical Bar

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 (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 and 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 Hidden or Private Forums.

HeaderText: Set Header Text here. Whatever you want the header to say for all modes
Example = "Top News Stories"

TableWidth: Set the width you want the box to be
Example = 500
Example = "95%" (percentage width)

strLink: Set the link you want to point to
"topic.asp"
"news.asp"
"article.asp"
Make your own page and just enter it here ex: "sports.asp"

Edited by - @tomic on 27 December 2002 01:32:59

@tomic
Senior Member

USA
1790 Posts

Posted - 13 September 2002 :  21:54:21  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
Doh! I forgot the inc_iconfiles.asp references

Add this to inc_iconfiles.asp

'Added for Content Display
Const strIconEmailCD = "email.gif|18|18"
Const strIconBlank3CD = "blank.gif|3|1"
Const strIconBlank10CD = "blank.gif|10|1"
Const strIconBlank20CD = "blank.gif|20|1"
Const strIconEditCD = "edit.gif|28|16"
Const strIconViewDocCD = "viewdoc.gif|15|15"
Const strIconGraphic1CD = "updat4.gif|47|10"
Const strIconGraphic2CD = "machineadd.gif|13|15"
Const strIconBullet1CD = "ballbullet3.gif|12|12"
Const strIconBullet2CD = "bullet2.gif|9|9"
Const strIconNewCD = "new10.gif|28|12"
Const strIconHotCD = "hot_animate.gif|44|16"
Const strIconSpecialCD = "arrow.gif|15|15"


I also forgot to add <% strForumURL %> to the links so that this can be used outside the forum. Look for this to appear soon to a zip near you.

@tomic

SportsBettingAcumen.com

Edited by - @tomic on 13 September 2002 22:06:52
Go to Top of Page

@tomic
Senior Member

USA
1790 Posts

Posted - 13 September 2002 :  21:59:00  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
I want to stress that this is not for production! This needs testing on many different forums with many different configurations before it can be declared "good to go".

@tomic

SportsBettingAcumen.com
Go to Top of Page

GauravBhabu
Advanced Member

4288 Posts

Posted - 13 September 2002 :  23:09:59  Show Profile
on your test Forum shows this error

Microsoft OLE DB Provider for SQL Server error '80040e14'
Line 1: Incorrect syntax near '='.

/forum2/inc_contentdisplay.asp, line 72

CSS and HTML4.01 Compilant Snitz Forum . ForumSquare . Rakesh Jain

It is difficult to IMPROVE on Perfection, There is no harm in Keep Trying.

Prayer Of Forgiveness
"I forgive all living beings. May all living beings forgive me!
I cherish the friendliness towards all and harbour enmity towards none." -- Aavashyaka Sutra(Translated)
Go to Top of Page

@tomic
Senior Member

USA
1790 Posts

Posted - 14 September 2002 :  01:00:18  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
Thanks. I had to log out to catch that one. It was an easy fix as it turns out.
I just had to change the way I checked the forum by removing the previous method
and adding this:

if ChkDisplayForum(ForumPrivateForums,ForumFPasswordNew,ForumID,MemberID) then

Then I removed the old function from inc_contentdisplay.asp

Replace your content.asp and inc_contentdisplay.asp with the new ones in the zip.

So far it works logged in or out AND so far I can't see hidden forums. I'm sure
something will go awry so I shall stand by

@tomic

SportsBettingAcumen.com

Edited by - @tomic on 14 September 2002 01:01:28
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 14 September 2002 :  03:04:13  Show Profile  Visit masterao's Homepage
It looks good, @tomic.

Im going to test this with access on my test server. If I encounter any problems, I'll post it here.

I noticed that you referenced to inc_functions.asp in your first post here, just so you know.


Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page

Rusty_yellowjeep
Starting Member

23 Posts

Posted - 14 September 2002 :  11:25:52  Show Profile  Visit Rusty_yellowjeep's Homepage  Send Rusty_yellowjeep a Yahoo! Message
I have the MSGICON MOD installed but the AVATAR Plus MOD has not been released yet.

Go to Top of Page

@tomic
Senior Member

USA
1790 Posts

Posted - 14 September 2002 :  12:35:55  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
Dunno what the avatar plus MOD is. The avatar MOD works with this.

@tomic

SportsBettingAcumen.com
Go to Top of Page

@tomic
Senior Member

USA
1790 Posts

Posted - 14 September 2002 :  13:31:29  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
Watch out for article.asp because I accidently left my left hand navigation and references to my includes. The code that makes articles work is fine and if you want left hand navigation then you are in luck. You need a couple table closings in inc_footer, though.

I just thought of this but I am rushing out of town but will fix that tomorrow.

@tomic

SportsBettingAcumen.com
Go to Top of Page

Jeepaholic
Average Member

USA
697 Posts

Posted - 14 September 2002 :  13:35:41  Show Profile  Visit Jeepaholic's Homepage
Can it be used withOUT MSGICON and AVATAR, as long as those features are not selected? Awesome job on this, btw.

Al Bsharah
Aholics.com

Jeepaholics Anonymous
Broncoholics Anonymous
Network Insight
Go to Top of Page

@tomic
Senior Member

USA
1790 Posts

Posted - 14 September 2002 :  13:41:31  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
That is correct. Before Message Icons were released I had commented out Message Icon refrences in the queries. Ditto for avatars. Apart from that you could remove Call WriteAvatar or whatever that sub's name is. Message Icons are tougher, though, because they are somehow involved in most of the graphic displays. If you don't intend on using those I would remove them. One thing I was thinking would be cool is Message Icons for just this MOD. That's more tlike how PhPNuke is. I wasn't intending on adding Message Icons either intil i remember this. Perhaps if the code that displays the Message Icon bar requires a mLev > 2 so moderators can use it as well and remove the icons from forum.asp

@tomic

SportsBettingAcumen.com
Go to Top of Page

auditude
Starting Member

USA
37 Posts

Posted - 15 September 2002 :  20:19:41  Show Profile
Can anyone help me with the following syntax error I'm getting with MySQL??:

ADODB.Recordset.1 error '80004005'

SQLState: 42000
Native Error Code: 1064
[TCX][MyODBC]You have an error in your SQL syntax near 'FROM ((FORUM_FORUM INNER JOIN FORUM_TOPICS ON FORUM_FORUM.FORUM_ID = FORUM_TOPIC' at line 1

/forum/content.asp, line 256

The SQL string is:

SELECT FORUM_FORUM.F_SUBJECT, FORUM_FORUM.F_DESCRIPTION, FORUM_TOPICS.T_STATUS, FORUM_TOPICS.CAT_ID, FORUM_TOPICS.FORUM_ID, FORUM_TOPICS.TOPIC_ID, FORUM_TOPICS.T_SUBJECT, FORUM_TOPICS.T_MESSAGE, FORUM_TOPICS.T_VIEW_COUNT, FORUM_TOPICS.T_LAST_POST, FORUM_TOPICS.T_DATE, FORUM_TOPICS.T_REPLIES, FORUM_TOPICS.T_AUTHOR, FORUM_MEMBERS.MEMBER_ID, FORUM_MEMBERS.M_NAME, FORUM_MEMBERS.M_EMAIL, FORUM_MEMBERS.M_HOMEPAGE, FORUM_MEMBERS.M_PHOTO_URL, FROM ((FORUM_FORUM INNER JOIN FORUM_TOPICS ON FORUM_FORUM.FORUM_ID = FORUM_TOPICS.FORUM_ID) INNER JOIN FORUM_MEMBERS ON FORUM_TOPICS.T_AUTHOR = FORUM_MEMBERS.MEMBER_ID) WHERE FORUM_TOPICS.FORUM_ID > 0 ORDER BY FORUM_TOPICS.T_LAST_POST DESC
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 15 September 2002 :  20:37:20  Show Profile  Visit masterao's Homepage
Im not that knowledgeable with mysql, but try removing the , from: FORUM_MEMBERS.M_PHOTO_URL, FROM ((FORUM_FORUM INNER JOIN FORUM_TOPICS ON FORUM_FORUM.FORUM_ID = FORUM_TOPIC

Im not dead sure if that is the cause of the error.


Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod

Edited by - masterao on 15 September 2002 20:38:08
Go to Top of Page

auditude
Starting Member

USA
37 Posts

Posted - 15 September 2002 :  20:43:17  Show Profile
Good catch! Thanks... I commented out the Avatar line which didn't have the comma, and didn't catch that one...
Go to Top of Page

masterao
Senior Member

Sweden
1678 Posts

Posted - 15 September 2002 :  20:45:50  Show Profile  Visit masterao's Homepage
No problems, Im just glad to be of assistance.


Jan
===========
FR Portal Forums | Active Users 4.0.20 Mod
Go to Top of Page

@tomic
Senior Member

USA
1790 Posts

Posted - 15 September 2002 :  20:50:41  Show Profile  Visit @tomic's Homepage  Send @tomic an ICQ Message
Whew. I am glad it was that easy. I was worried it was that mySQL didn't support INER JOIN.

@tomic

SportsBettingAcumen.com
Go to Top of Page
Page: of 24 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