Author |
Topic  |
|
Astralis
Senior Member
   
USA
1218 Posts |
Posted - 17 September 2005 : 18:42:50
|
I need some advice.
I have integrated the topic.asp page onto an external page outside the forum directory. So far, I've had very good success with this although I'm concerned about the extra 1000+ lines of code this adds.
Anyhow, one thing that I want to do is to allow someone to create a new topic on this external page. After they click it and they fill in the new topic, then it takes them back to the external page. I see the "Go" function in post_info.asp. I'm thinking this will work.
But, also, what happens if someone needs to register? Can I redirect them to the external page after they place the topic?
For additional information, I have an article table and I am relating the topic_id in this table, so whenever an article is pulled, the topic will also display. This creates an article *comment* system. So far, it's working well. If I can get this redirect to work, then it's gold. Once someone starts a topic, I also put the new topic_id into the article table. I'll have to do some error checking if that topic is deleted though.< |
Edited by - Astralis on 17 September 2005 18:43:23 |
|
Astralis
Senior Member
   
USA
1218 Posts |
Posted - 18 September 2005 : 18:53:02
|
I don't think anyone was able to understand this, but for sake of completion I accomplished my goal with the following code on post.asp:
'##### For article redirect #########
if Request.Querystring("ref")<>"" then
strRefer = Request.Querystring("ref")
else
'##### Continue article redirect 1 of 2 #####
strRefer = Request.ServerVariables("HTTP_REFERER")
if strRefer = "" then strRefer = Request.Form("Refer")
if strRefer = "" then strRefer = "default.asp"
'##### continue article redirect 2 of 2 #####
end if
'##### end article redirect #####
< |
Edited by - Astralis on 18 September 2005 18:53:47 |
 |
|
MarcelG
Retired Support Moderator
    
Netherlands
2625 Posts |
Posted - 19 September 2005 : 10:36:06
|
Mmmm...great to see you got it working, but I'm still a bit confused about what you were trying to accomplish... I reread your post 5 times, and still don't get it. I guess it's more my lack of understanding than it was your post... < |
portfolio - linkshrinker - oxle - twitter |
 |
|
Astralis
Senior Member
   
USA
1218 Posts |
Posted - 19 September 2005 : 17:44:42
|
Well, it's a little bit difficult to explain so I wasn't that clear.
What I'm trying to do is to plug-in topic.asp into my CMS. So, when someone reads an article, below it, they will be able to comment or read peoples' replies. Essentially, it's a topic from a forum with the quick reply feature turned on so people can comment on the article.
The first thing I had to do was have a way to relate the Topic_ID and the Article_ID. So, I added Topic_ID to the Articles table of my CMS.
Then, I copied the code from topic.asp and put it at the bottom of the article view page of my CMS. I used inc_header_short.asp minus the login information instead of inc_header.asp, but essentially the page is the same except for one major change: I had to rework the login system. To do this, I installed the Universal login mod. Despite my initial problems with it, I got it to work by reinstalling it and discovered that it worked perfectly without any modification.
But, there were other issues: 1) How can I let users start a new topic FROM the CMS without going to the forum? To accomplish this, I had to be able to update the article row in the article table with the topic_id of the forum. I had to add an update sql in post.asp (or maybe it was post_info.asp) to do this. Very simple and basic code.
2) I also had to work on the redirect so that when someone creates a topic or replies to a topic WITHIN the CMS, it will redirect them to the CMS instead of the forum. To accomplish this, I realized the link needed to be passed with all the variables so that the forum HTTP_REFERER can grab it and redirect to the article page instead of default.asp or topic.asp of the forum. The forum already uses HTTP_REFERER very efficiently so I didn't want to mess that up. That is the code above. It actually is very simple, as you can see. Also, by using the forum's HTTP_REFERER server variable, I didn't need to change any of the forum's code and I was able to do this on my CMS's article.asp page and this made it very simple.
3) The next issue is I need to do the same thing when someone edits a post from the CMS. It needs to redirect back to the article CMS instead of the forum.
4) The other issue is reversal the display of the topic and replies. Because my topic.asp code is separate from the forum code, I can do whatever I want to do with it without messing up the forum.
5) Another issue that I will need to consider: all these posts are visible in the forum. Because they will be started from the CMS, if you visit them from the forum, you will not know which topic it's related to because I do not have a way for it to relate to the article in the TOPICS table. This is a very minor concern. I don't intend for people to visit these posts from the forum side, just through the CMS.
6) Relative versus absolute urls had to be configured also. But, because the code on the article page is just a topic.asp hack, nothing will affect the forum code.
So, what I have is topic.asp appearing on other pages of my CMS and able to be fully created and edited from the CMS instead of the forum. It seems to be working as a very good article COMMENT system.
But, this adds 1000+ lines to the code of my CMS and I've noticed it slowing down. I'm using MSSQL Server too. Perhaps stored procedures are in my future or maybe removing all the work from the article CMS.
In the short-run, this will work, but in the long-run, Snitz has too much code and database calls for even a robust database like MSSQL Server to handle a lot of visitors. On its own, though, the forum is doing fine although it takes a lot of bandwidth compared to my CMS.
Is that clearer?< |
Edited by - Astralis on 19 September 2005 18:09:43 |
 |
|
StephenD
Senior Member
   
Australia
1044 Posts |
Posted - 19 September 2005 : 19:55:24
|
Astralis, sounds very interesting what you are doing, I myself have an idea to get rid of my email contact forms on one of site's frontends and use either a custom posting form or anonymous posting mod or guestbook mod to insert website enquiries into a set forum as topics from a 'Guest User'.< |
 |
|
enricoska
Starting Member
15 Posts |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
|
enricoska
Starting Member
15 Posts |
Posted - 17 December 2005 : 07:50:46
|
I have only posted the same answer to the same questions in different discussions. Sorry Could i have posted in all those discussions only "read this topic: www..." or you would have said that i spammed the forum also in this case?< |
SkantaDj |
 |
|
|
Topic  |
|