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)
 News Forum MOD
 New Topic  Topic Locked
 Printer Friendly
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 4

Pouyan
New Member

91 Posts

Posted - 01 August 2002 :  03:33:03  Show Profile
spg,

I just added your code and it works like a charm ! THANK YOU !


One small request... you have modified this mod to make it possible to control where you want to end the brief display and add a [Read More] link by setting an end point (^ in this case). Is there anyway to add the ability to set a begin point for it also ?! This can be used to take and display a very specific portion from anywhere in an article. I appreciate your help, thanks.

~pouyan
Go to Top of Page

Dan Martin
Average Member

USA
528 Posts

Posted - 01 August 2002 :  13:12:46  Show Profile  Visit Dan Martin's Homepage  Send Dan Martin an AOL message  Send Dan Martin an ICQ Message  Send Dan Martin a Yahoo! Message
You could do:
iStartPos = inStr(strNewsItem, "^")
iEndPos = inStrRev(strNewsItem, "^")
if iStartPos = iEndPos Then iStartPos = 1

(the if statement treats only one ^ as the end)

Then use Mid to grab everthing between the first and last ^. I'm not going to type in the Mid function, because I always get it wrong until I tinker with it. And I don't have time right now.

-Dan

Go to Top of Page

spg
Starting Member

26 Posts

Posted - 01 August 2002 :  21:47:07  Show Profile
quote:

I would suggest you look over the MOD because it fixes some bugs (including forgetting to close the DB connection - whoops) that were in the code I sent you.

It also adds an admin panel that lets you change the forum and number of topics which is kind of a nice perk. But, since you understand the code that's probably not enough reason to use it.


Yeah I had looked at it, and it added some cool stuff to what you sent me. But I have already modified the original code so much, it would be almost pointless to replace it at this point. One thing I added (besides the "read more" link) is that I display a small picture representing what category each post is in. Oh, and to do that I display posts from 4 or 5 different forums(hardcoded).

Pouyan - What Dan said should work, but I can write out the whole code and test it in the morning. Once I make sure I get the code right, I'll post it up here.



Go to Top of Page

Pouyan
New Member

91 Posts

Posted - 08 August 2002 :  12:47:49  Show Profile
For some reason the script always selects the latest topic from my main forum (ID #1). In other words, the News Forum admin page isn't controlling the News Forum. Any idea of what might be causing this problem ?

It worked fine when I first installed it...i've tried re-installing the mod several times. I even took spg's code out thinking that might be causing the problem, weird!
Go to Top of Page

Tmpj
Junior Member

Denmark
467 Posts

Posted - 08 August 2002 :  15:27:12  Show Profile
It is an OK MOD


------------------------------
Magic is an Orange
http://www.magicorange.tk
Go to Top of Page

Dan Martin
Average Member

USA
528 Posts

Posted - 09 August 2002 :  15:54:08  Show Profile  Visit Dan Martin's Homepage  Send Dan Martin an AOL message  Send Dan Martin an ICQ Message  Send Dan Martin a Yahoo! Message
Pouyan,
Look at your Application variables in "Forum Variables Information" within Admin Home. See if your "STRNEWSFORUM_ID" is set to the correct number. If it is not, try running setup.asp, which should reload the configuration variables from the database. If it is, then your page may not be getting the correct strCookieURL.

The easy way to correct is to hard-code your strCookieURL in the page that includes the inc_news.asp prior to the config.asp include.

Let me know the situation, and I will try to help you further.

Edited by - Dan Martin on 09 August 2002 15:55:39
Go to Top of Page

Pouyan
New Member

91 Posts

Posted - 09 August 2002 :  16:26:09  Show Profile
STRNEWSFORUM_ID variables are set to the correct number.
quote:
The easy way to correct is to hard-code your strCookieURL in the page that includes the inc_news.asp prior to the config.asp include.


How ?!

Thank you,
Go to Top of Page

Dan Martin
Average Member

USA
528 Posts

Posted - 11 August 2002 :  23:47:56  Show Profile  Visit Dan Martin's Homepage  Send Dan Martin an AOL message  Send Dan Martin an ICQ Message  Send Dan Martin a Yahoo! Message
Well, some people don't agree with this hack, but it's the only thing that works for me.

In config.asp, appx line 102, change this:
strCookieURL = Left(Request.ServerVariables("Path_Info"), InstrRev(Request.ServerVariables("Path_Info"), "/"))

To this:
'strCookieURL = Left(Request.ServerVariables("Path_Info"), InstrRev(Request.ServerVariables("Path_Info"), "/"))
strCookieURL = "/forum/"

(notice I commented out the old code for posterity)

If your forum folder is different than /forum/ you should change the above code to what your folder is. The issue is if you use config.asp in a page that lies outside the forum folder, that bit of code doesn't work correctly.
Go to Top of Page

Pouyan
New Member

91 Posts

Posted - 12 August 2002 :  00:11:17  Show Profile
THANK YOU Dan, that solved the problem

quote:
Pouyan - What Dan said should work, but I can write out the whole code and test it in the morning. Once I make sure I get the code right, I'll post it up here.


spg...any luck with that yet ?!

Edited by - Pouyan on 12 August 2002 00:11:42
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 17 August 2002 :  13:18:24  Show Profile  Visit richfed's Homepage
quote:
Originally posted by Dan Martin

News Forum MOD 1.0

Download: http://www.councilofgrey.com/downloads/News_Forum_MOD.zip

MOD Purpose: This MOD allows you to target one forum as your News forum and present the latest news anywhere you want. It displays topics only, with a link to the entire thread. Ideal for use on your homepage. This MOD supports moderated topics. If you'd like to allow everyone to post news, make your News Forum moderated. The news posted by normal members will not show up until it is accepted by a moderator.

This MOD also removes signatures from the post before displaying it.

Example: This MOD is used on the homepage of http://www.councilofgrey.com
Made by: Dan Martin
Made on: I've had the base code in use for about a year, but I turned it into a complete MOD on July 14, 2002.
Files to change: 2 (config.asp, admin_home.asp)
Number of changes: 3 (could be more depending on your implementation)
Files needed:
admin_news_forum.asp, inc_news.asp, dbs_News_Forum.asp

Complete instructions are included in the News_Forum_readme.txt in the zip.



Edited by - Dan Martin on 14 July 2002 14:41:04



Having a bit of a problem with this one ... installation all went well. I am trying to get the News Forum to appear on an html page outside of the forum directory (in my case, called "Messageboard").

When I attempt to link directly to inc_news.asp, I get the following error:

quote:
ADODB.Recordset error '800a0bb9'

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

/messageboard/inc_news.asp, line 17



When I use the format listed elsewhere in this thread:

quote:
<div align="center">
<table border="2" cellspacing="1">
<tr>
<td>
<!--#INCLUDE FILE="http://www.mohicanpress.com/messageboard/inc_config.asp" -->
<!--#INCLUDE FILE="http://www.mohicanpress.com/messageboard/inc_functions.asp" -->
<!--#INCLUDE FILE="http://www.mohicanpress.com/messageboard/inc_top.asp" -->
<!--#INCLUDE FILE="http://www.mohicanpress.com/messageboard/inc_news.asp" -->
<!--#INCLUDE FILE="http://www.mohicanpress.com/messageboard/inc_footer.asp" -->
</td>
</tr>
</table>
</div>



... well, then I get a completely blank table.

Any suggestions as to what I may be doing wrong?

Rich
[size=1]A Complete Idiot's Guide to MOD Implementation || On the Trail of the Last of the Mohicans[/size=1]
Go to Top of Page

stylishvn
Junior Member

Vietnam
185 Posts

Posted - 17 August 2002 :  23:11:08  Show Profile  Visit stylishvn's Homepage  Send stylishvn an ICQ Message  Send stylishvn a Yahoo! Message
I got the same error. Thiz MoD seem works well when I viewed homepage.asp but when
I try inc_news.asp it had error like Rich said.

also I have a little question, I want add some include file in homepage.asp but it also has include config.asp
so I alway got the error Name redefined it means that I used config.asp included twice. Anyone here
could tell me what the goodway could I do with that problem ??

ths 4 reading

..:: Welcome #Snitz in Dalnet ::..
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 24 August 2002 :  13:43:06  Show Profile  Visit richfed's Homepage
Help on this?
Go to Top of Page

Schwanke
New Member

77 Posts

Posted - 25 August 2002 :  00:52:40  Show Profile  Visit Schwanke's Homepage
Please? :)

Is this mod going to be upated to 3.4? It uses inc_functions so its not at all compatable without a rewrite..


<><
Go to Top of Page

Dan Martin
Average Member

USA
528 Posts

Posted - 26 August 2002 :  18:33:39  Show Profile  Visit Dan Martin's Homepage  Send Dan Martin an AOL message  Send Dan Martin an ICQ Message  Send Dan Martin a Yahoo! Message
richfed, try:
<!--#INCLUDE virtual="/messageboard/inc_config.asp" -->

and so on.

The first error you mention is "better" though than an empty table. If you get it again - don't change your includes - your issue is elsewhere.


Edited by - Dan Martin on 26 August 2002 18:36:13
Go to Top of Page

Dan Martin
Average Member

USA
528 Posts

Posted - 26 August 2002 :  18:38:31  Show Profile  Visit Dan Martin's Homepage  Send Dan Martin an AOL message  Send Dan Martin an ICQ Message  Send Dan Martin a Yahoo! Message
quote:
Originally posted by stylishvn


also I have a little question, I want add some include file in homepage.asp but it also has include config.asp
so I alway got the error Name redefined it means that I used config.asp included twice. Anyone here
could tell me what the goodway could I do with that problem ??


Simply put - don't include it in both places. No include file should have config.asp included anyway. An include with an include is a bit sloppy. config.asp can be inluded anywhere, as long as it comes before the pages that need it.
Go to Top of Page
Page: of 4 Previous Topic Topic Next Topic  
Previous Page | 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.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07