Author |
Topic |
Pouyan
New Member
91 Posts |
Posted - 01 August 2002 : 03:33:03
|
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 |
|
|
Dan Martin
Average Member
USA
528 Posts |
Posted - 01 August 2002 : 13:12:46
|
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
|
|
|
spg
Starting Member
26 Posts |
Posted - 01 August 2002 : 21:47:07
|
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.
|
|
|
Pouyan
New Member
91 Posts |
Posted - 08 August 2002 : 12:47:49
|
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! |
|
|
Tmpj
Junior Member
Denmark
467 Posts |
|
Dan Martin
Average Member
USA
528 Posts |
Posted - 09 August 2002 : 15:54:08
|
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 |
|
|
Pouyan
New Member
91 Posts |
Posted - 09 August 2002 : 16:26:09
|
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, |
|
|
Dan Martin
Average Member
USA
528 Posts |
Posted - 11 August 2002 : 23:47:56
|
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. |
|
|
Pouyan
New Member
91 Posts |
Posted - 12 August 2002 : 00:11:17
|
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 |
|
|
richfed
Average Member
United States
999 Posts |
Posted - 17 August 2002 : 13:18:24
|
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] |
|
|
stylishvn
Junior Member
Vietnam
185 Posts |
Posted - 17 August 2002 : 23:11:08
|
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 ::.. |
|
|
richfed
Average Member
United States
999 Posts |
Posted - 24 August 2002 : 13:43:06
|
Help on this? |
|
|
Schwanke
New Member
77 Posts |
Posted - 25 August 2002 : 00:52:40
|
Please? :)
Is this mod going to be upated to 3.4? It uses inc_functions so its not at all compatable without a rewrite..
|
<>< |
|
|
Dan Martin
Average Member
USA
528 Posts |
Posted - 26 August 2002 : 18:33:39
|
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 |
|
|
Dan Martin
Average Member
USA
528 Posts |
Posted - 26 August 2002 : 18:38:31
|
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. |
|
|
Topic |
|