Author |
Topic |
@tomic
Senior Member
USA
1790 Posts |
Posted - 07 January 2003 : 18:33:13
|
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" |
SportsBettingAcumen.com |
|
funinbc
Junior Member
245 Posts |
Posted - 07 January 2003 : 18:43:08
|
I just wanted to be the first to post :-)
Anyone have idea'a why I cant get the forums color and fonts to show up in the mod? As a test I have tried striping everything but a basic table and the mod and have tried to use it inside and outside the forum. No matter What I do or where I place it, it will not show |
|
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 07 January 2003 : 18:48:18
|
I said it in the last post in the previous topic but try searching and replacing strDefaultFontColor with strForumFontColor. I'm sory I didn't catch such an obvious one earlier but I have both set at the same color so for me there's no difference.
@tomic |
SportsBettingAcumen.com |
|
|
MarkJH
Senior Member
United Kingdom
1722 Posts |
Posted - 07 January 2003 : 19:17:26
|
Have to say @tomic that this really is an awesome MOD. I've been tweaking with it for the last couple of hours and got it looking juuuust right.
A couple of questions though; a) how would I remove the entire HeaderText part at the top of the display so that it just starts with the topics and b) how would I stop the pages opening in a new window? I want all links to open up in the same window. Thanks.
If it's any help, this is my DisplayContent:
<% DisplayContent 0, 0, 2, 3, 0, 5, 200, 0, 5, 1, 3, 1, "Blah blah blah", 310, "topic.asp" %> |
Bandlink.net - http://www.bandlink.net/ Bandlink Music Forums - http://www.bandlink.net/forum/ |
Edited by - MarkJH on 07 January 2003 19:18:02 |
|
|
@tomic
Senior Member
USA
1790 Posts |
Posted - 07 January 2003 : 19:45:07
|
If you locate the following at the very bottom of content.asp and simply remove it all you should get the result you desire. If you do remove it then you obviously won't need to include the header text in your sub call.
Sub WriteHeader(HeaderText) ' Writes text and selected color to Header. Yours to easily customize //////////////////////////
Response.Write " <tr>" & vbCrlf & _
" <td valign=""top"" align=""center"" colspan=""99"" width=""100%"">" & vbCrlf & _
" <table border=""0"" cellspacing=""0"" width=""100%"" cellpadding=""4"" background=""" & strImageURL & strHeadCellBGImage & """ bgcolor=""" & strHeadCellColor & """>" & vbCrlf & _
" <tr>" & vbCrlf & _
" <td valign=""top"" align=""center"">" & vbCrlf & _
" <font face=""" & strDefaultFontFace & """ size=""" & strHeaderFontSize & """ color=""" & strHeadFontColor & """>" & vbCrlf & _
" <b>" & HeaderText & "</b>" & vbCrlf & _
" </font>" & vbCrlf & _
" </td>" & vbCrlf & _
" </tr>" & vbCrlf & _
" </table>" & vbCrlf & _
" </td>" & vbCrlf & _
" </tr>" & vbCrlf
End Sub
@tomic
|
SportsBettingAcumen.com |
|
|
funinbc
Junior Member
245 Posts |
Posted - 07 January 2003 : 20:52:45
|
Thank you for the quick reply. I have changed every strDefaultFontColor to strForumFontColor in content.asp and in inc_header_nohtml.asp
but nothing changed :-(
Can you think of anything else I can try? |
|
|
jkmcgrath
Junior Member
USA
145 Posts |
Posted - 07 January 2003 : 21:47:19
|
Funinbc, Dont you want the strHeadCellColor ect?
@tomic, When I place this outside the forum the images cannot be found. The message icons can. Strange. |
Delta Force Seals |
|
|
funinbc
Junior Member
245 Posts |
Posted - 07 January 2003 : 22:51:55
|
well it looks like this :
case 3 ' ///// Detailed: Displays topics with message & details next to topic link counter = counter + 1 Response.Write "<tr>" & vbNewLine & _ " <td valign=""top"">" & vbNewLine & _ " <table border=""0"" cellspacing=""0"" cellpadding=""3"" width=""100%"">" & vbCrlf & _ " <tr>" & vbCrlf & _ " <td valign=""top"" bgcolor=""" & strForumCellColor & """ width=""100%"">" & vbCrlf Call WriteOrnament(Ornament, counter) Call WriteSubject2(SubjectLength, T_Topic_ID, MessageLength, strLink) if Special then Call WriteSpecial(Special) end if Response.Write " <br>" & vbNewLine Call WritePostingDetails(T_Topic_ID) Call WriteMessage(SafeMode, MessageLength) Response.Write " <br>" & vbNewLine Call WriteTextBar(T_Topic_ID, strLink) Response.Write " <hr color=""" & strHeadCellColor & """ size=""1"">" & vbNewLine Response.Write " </td>" & vbNewLine & _ " </tr>" & vbCrlf & _ " </table>" & vbCrlf & _ " <br>" & vbCrlf & _ " </td>" & vbCrlf & _ " </tr>" & vbCrlf
any ideas? |
|
|
MarkJH
Senior Member
United Kingdom
1722 Posts |
Posted - 08 January 2003 : 13:25:37
|
Had to remove Call WriteHeader(HeaderText) from line 205 but yes, that did the trick. Thanks.
Erm, so how would I force the links to open up in the same page as opposed to a new one? |
Bandlink.net - http://www.bandlink.net/ Bandlink Music Forums - http://www.bandlink.net/forum/ |
|
|
funinbc
Junior Member
245 Posts |
Posted - 08 January 2003 : 20:46:30
|
sorry I don't want to be a pest . If no one has any idea why the forum colors are not showing up I wont ask again.
things I've tried:
striped all html from the page as in this test http://www.funinbc.com/test.asp
I have placed this file inside and outside the forum
I have searched and replaced strDefaultFontColor with strForumFontColor
scratched my head and sat bug-eyed looking at the screen
|
|
|
masterao
Senior Member
Sweden
1678 Posts |
Posted - 08 January 2003 : 21:13:32
|
Download admin_run_config.txt, rename it to .asp and copy it into the root of your website. Run the file and it will hopefully work for you.
The includes in that file use virtual and if you don't have your forums in a folder named forum, you must change them to the folder name that you use. You can remove the file after you have used it. |
Jan =========== FR Portal Forums | Active Users 4.0.20 Mod |
|
|
funinbc
Junior Member
245 Posts |
Posted - 08 January 2003 : 22:03:34
|
Thank you for the quick reply. I did that but still no change. This is really odd
here is a link to the live front page:
http://www.funinbc.com/
|
|
|
masterao
Senior Member
Sweden
1678 Posts |
Posted - 08 January 2003 : 22:39:30
|
funinbc, Which text is that has the wrong color? Is it the links in the recent post-table? If so, try removing the color-definitions for links in your body-tag.
I looked at the testpage you did, and it seems to use the forum-colors now. |
Jan =========== FR Portal Forums | Active Users 4.0.20 Mod |
|
|
funinbc
Junior Member
245 Posts |
Posted - 08 January 2003 : 22:51:30
|
The font color is working.......... I'm getting closer !! Now if I could get the alternating forum colors to show in the posts |
|
|
masterao
Senior Member
Sweden
1678 Posts |
Posted - 08 January 2003 : 22:58:31
|
You should also decide which color to use for the other links on the front-page now. Darkblue doesn't work that well against the grey background. You could either use the forum colors for all links, or you could use a style-sheet/style-tags to fix them.
As for the alternating colors, I don't have any clue at the moment. |
Jan =========== FR Portal Forums | Active Users 4.0.20 Mod |
|
|
funinbc
Junior Member
245 Posts |
Posted - 08 January 2003 : 23:12:01
|
Thanks for looking masterao! You must have had a look when I was messing around on the front-page. That is how I fixed the other fonts is by style sheets. Here is the problem
If I do not use them as you saw the forum fonts take over the whole page and it looks really bad.
If I use them then the forum font colors will not show. This would be ok but I do not understand why others do not have this problem.
The bottom line is I am trying to get rid of the white background in the forum post on the front page. Trying to get the forum colors to show instead.
|
Edited by - funinbc on 08 January 2003 23:13:17 |
|
|
Topic |
|