Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 Need help with line of code for topic maker.
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

bobby131313
Senior Member

USA
1163 Posts

Posted - 27 May 2005 :  13:05:02  Show Profile  Visit bobby131313's Homepage
I have the topic maker installed and it works great. But I would like them to not refresh (which I've taken care of) and have a link to click on at the top to go to the topic. Something like this..

To read the full topic click here.

With the "click here" being a link to the main forum topic.

As stated, I have taken out the meta refresh line with no problems but I'm have trouble getting the extra line to write. I am by no means an ASP expert, but I am a quick learner.

Here is the code from my admin_topic_maker.asp with the meta refresh taken out...

quote:
%>

<!--#INCLUDE FILE="config.asp"-->
<!--#INCLUDE FILE="inc_sha256.asp"-->
<!--#INCLUDE FILE="inc_header.asp" -->
<!--#INCLUDE FILE="inc_func_secure.asp" -->
<!--#INCLUDE FILE="inc_func_member.asp" -->
<!--#INCLUDE FILE="inc_subscription.asp" -->
<!--#INCLUDE FILE="inc_moderation.asp" -->
<%if (mLev = 4) then
AdminAllowed = 1
else
AdminAllowed = 0
end if
%>
<table align="center" width="60%" border=0>
<tr>
<td nowrap align="left">
<%
if AdminAllowed = 1 then
set countrs = my_conn.execute("SELECT CAT_ID FROM " & strTablePrefix & "TOPICS")
ListTopic = 0
do until countrs.eof
ListTopic = ListTopic + 1
countrs.movenext
Loop
set countrs = nothing
strTotalTopics = ListTopic
'strSql = strSql & "SELECT T_COUNT FROM FORUM_TOTALS" & Topics
'write_this = Request.QueryString("TOPIC_ID")
'for write_this = 1 to ListTopic
for write_this = 1 to ListTopic
strSql = "SELECT FORUM_ID, CAT_ID, T_AUTHOR, T_SUBJECT, T_MESSAGE "
strSql = strSql & " FROM FORUM_TOPICS "
strSql = strSql & " WHERE TOPIC_ID = " & write_this
'response.write strSql
set rsWrite = my_Conn.Execute (strSql)
strStatus = ""
strWrite = ""
if rsWrite.Bof and rsWrite.eof then
strStatus = "<b>No such topic found.</b>"
else
set rsGetForum = my_Conn.Execute ("SELECT F_SUBJECT FROM FORUM_FORUM WHERE FORUM_ID =" & rsWrite("FORUM_ID"))
forum_name = rsGetForum("F_SUBJECT")
themessage = rsWrite("T_MESSAGE")
strWrite = strWrite & "<html><head><title>" & strForumTitle & " (© 2002) - " & rsWrite("T_SUBJECT") & "</title>"
strWrite = strWrite & "<meta name=""Description"" CONTENT=""" & strForumTitle & " (© 2002) - " & rsWrite("T_SUBJECT") & """>"
strWrite = strWrite & "<meta name=""Keywords"" CONTENT=""" & rsWrite("T_SUBJECT") & " " & Replace(themessage, Chr(13) & Chr(10), "") & """>"

strWrite = strWrite & "<table width=""100%"" border=""1"" cellpadding=""2"" cellspacing=""1"" bordercolor=""#3366CC""><tr><td align=""center"" colspan=""2""><b>" & rsWrite("T_SUBJECT") & "</b></td></tr>"
strWrite = strWrite & "<tr><td align=""center"" valign=""top""><b>" & getMemberName(rsWrite("T_AUTHOR")) & "</b></td>"
strWrite = strWrite & "<td>" & themessage & "</td></tr>"

strSql2 = "SELECT R_AUTHOR, R_MESSAGE "
strSql2 = strSql2 & " FROM FORUM_REPLY "
strSql2 = strSql2 & " WHERE TOPIC_ID = " & write_this
'response.write strSql
set rsWriteReply = my_Conn.Execute (strSql2)

do until rsWriteReply.eof
strWrite = strWrite & "<tr><td align=""center"" valign=""top""><b>" & getMemberName(rsWriteReply("R_AUTHOR")) & "</b></td>"
strWrite = strWrite & "<td>" & rsWriteReply("R_MESSAGE") & "</td></tr>"
rsWriteReply.MoveNext
loop

strWrite = strWrite & "</table>"

Set ObjTopicFile = Server.CreateObject("Scripting.FileSystemObject")
TopicFile = Server.MapPath ("/topicmaker/" & write_this & ".asp")
Set WriteTopicFile = ObjTopicFile.CreateTextFile (TopicFile, True)
WriteTopicFile.WriteLine(strWrite)
WriteTopicFile.Close
Set WriteTopicFile = Nothing
Set ObjTopicFile = Nothing

strStatus = "<b>Success.</b>"

end if
Response.write "<b>Done processing topic number " & write_this & ".</b> - "& strStatus & "<br>"
next
else
Response.write "You are not authorized to do this action."
End if
%>
</td>
</tr>
</table>
<!--#INCLUDE FILE="inc_footer.asp" -->


If anyone could help me I would greatly appreciate it.

Switch the order of your title tags

Edited by - bobby131313 on 27 May 2005 13:28:10

Mur
Zapped Profile

24 Posts

Posted - 03 June 2005 :  07:09:13  Show Profile  Visit Mur's Homepage
This might help:

strWrite = strWrite & " <td><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b><a href=""" & strForumURL & "topic.asp?TOPIC_ID=" & write_this & """>Topic #" & write_this & " - " & rsWrite("T_SUBJECT") & "</b></font></a></td>" & vbNewLine

This will place your Subject as the link. If you want a click here type just remove " & rsWrite("T_SUBJECT") & " and add Click Here.
You can paste the code anywhere within your strWrite lines.

Notes about your version of topic maker.
Your version of Topic maker does not have the private forums mod.
The part to look at:
quote:

else
set rsGetForum = my_Conn.Execute ("SELECT F_SUBJECT FROM FORUM_FORUM WHERE FORUM_ID =" & rsWrite("FORUM_ID"))



Your private forums and topics will be indexed with topic maker. There is a mod here that corrects this and works very well.
The line will look like:
quote:

else
set rsGetForum = my_Conn.Execute ("SELECT F_SUBJECT, F_PRIVATEFORUMS FROM " & strTablePrefix & "FORUM WHERE FORUM_ID =" & rsWrite("FORUM_ID"))
if rsGetForum("F_PRIVATEFORUMS") = 0 then




Also if you are going to use topic maker as a static page without redirect it would be good to include your Coin sites background, header and footer. (I viewed this topic from your site http://www.coincommunity.com/topicmaker/2.asp)


Remember the topic maker is for spiders so it's also a good idea to have the output file create your topicmaker pages with meta tags like you would use in your main site.
Another good idea is to output the file as a standard .htm or .html file some spiders don't link well within .asp pages. And lastly a big spider eater. Have all your topic pages output a default catalog index page. This would be your /topicmaker/default.asp page listing all subjects with links to the topicmaker/#.asp page. This will tell the spider to loop back and pull more links you have in your default.asp page.

The topic maker is fun to modify if you think of the lines that start with
strWrite = strWrite
As
Response.Write = "....

Have fun and if you need help just ask.


(Side Note: I made a manual on how to boil water so complicated that 9 out of 10 Italian cooks stopped making pasta dishes) lol

Edited by - Mur on 03 June 2005 07:13:59
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 03 June 2005 :  10:05:19  Show Profile  Visit bobby131313's Homepage

Mur, you are the bomb! Thank you!

Your code got me started. I tweaked a little and have it the way I want it.

http://www.coincommunity.com/topicmaker/1108.asp

We have no private forums here so that's not an issue. We have a separate completely private forum elsewhere.

quote:
Also if you are going to use topic maker as a static page without redirect it would be good to include your Coin sites background, header and footer.


I have no idea how to do that.

I tried...

strWrite = strWrite & "<body background=""http://coincommunity.com/images/coinbackground.jpg"">

and...

strWrite = strWrite & "<body background=""http://coincommunity.com/images/coinbackground.jpg""> & vbNewLine


I figured it out!

strWrite = strWrite & " <body background=""http://coincommunity.com/images/coinbackground.jpg"">" & vbNewLine

Well, at least the background. I'm lost on the includes.

quote:
Remember the topic maker is for spiders so it's also a good idea to have the output file create your topicmaker pages with meta tags like you would use in your main site.


Metas are being generated.

quote:
Have all your topic pages output a default catalog index page. This would be your /topicmaker/default.asp page listing all subjects with links to the topicmaker/#.asp page. This will tell the spider to loop back and pull more links you have in your default.asp page.


No clue here either.

I can't tell you how much I appreciate your help. I love learning this stuff. If there's anything I can do for you let me know.

Switch the order of your title tags
Go to Top of Page

Mur
Zapped Profile

24 Posts

Posted - 03 June 2005 :  11:12:42  Show Profile  Visit Mur's Homepage
Great job on the page. I'm glad the code got you going. I don't remember the original author of the topic maker (Think it was David) but he got the ball rolling on it all.


Because you like tweaking code I'll give you my meta's and tell you way I use them. I checked your page and don't see any meta's and do advise you place them in your pages to help dumb spiders index your site.

strWrite = strWrite & "<meta http-equiv=""Refresh"" content=""5; URL="/topicmaker/topic.asp?TOPIC_ID=" & write_this & """>" & vbNewLine
strWrite = strWrite & "<meta name=""keywords"" content=""" & Replace(rsWrite("T_SUBJECT"), " ", ", ") & ", " & Replace(Replace(themessage, Chr(13) & Chr(10), ""), " ", ", ") & """>" & vbNewLine
strWrite = strWrite & "<meta name=""description"" content=""" & strForumTitle & " - " & rsWrite("T_SUBJECT") & """>" & vbNewLine
strWrite = strWrite & "<meta name=""copyright"" content=""Copyright © " & strCopyright & """>" & vbNewLine
strWrite = strWrite & "<meta name=""author"" content=""" & strForumTitle & """>" & vbNewLine
strWrite = strWrite & "<meta name=""revisit-after"" content=""1 day"">" & vbNewLine
strWrite = strWrite & "<meta name=""robot"" content=""all"">" & vbNewLine

Why Meta's?
The way topic maker works is when you run it from your admin panel it will create a file using the topic id. It will over write any topic files you have. The meta's are used to tell the spiders just what the page is about and to have it revist the page. Because you are a good admin you run Topic Maker at least once each week so the pages update with all the new replies the spiders will see the topics as new content and reindex them. You'll see traffic to these pages higher than any other page in a few months.

If you are a heavy Google Adsense user you should include at least 4 ads in these pages. (I think 4 ads is googles max limit per page) You might not get the visitor to enter your site but you might get something in return for your topics content in the form of cash from Google.

The Default.htm or .asp page that I am talking about is a pure subject index of your topics.
Here is the example of the output. Yours should look just like your topic pages with background. Example Default.htm Output page.

Here is the code that builds that page. You might have to check and change how it writes because you are using a static link to your folders.

I think in your case you would place this code at the end of your page.

I think it will fall under the last End if. You'll have to test it. But my guess it will work and create your default.htm or asp page .

Under your code
quote:
Response.write "You are not authorized to do this action."
End if


Add this code
Set ObjTopicFile = Server.CreateObject("Scripting.FileSystemObject")
TopicFile = Server.MapPath (/topicmaker/ & "default.htm")
Set WriteTopicFile = ObjTopicFile.CreateTextFile (TopicFile, True)
WriteTopicFile.WriteLine(strWrite)
WriteTopicFile.Close
Set WriteTopicFile = Nothing
Set ObjTopicFile = Nothing
Response.Write " <tr>" & vbNewLine & _
" <td>Index file has been created.</td>" & _
"</td>" & vbNewLine & _
" </tr>" & vbNewLine

Adjust the output Response.Write to fit your format. Or just remove it if everything is working you really don't need it to say the file was created.



If you get the default.htm or default.asp page working add the following to your topics pages.

strWrite = strWrite & " <a href=""default.htm"">Main Category List and Topic List</a>" & vbNewLine

The thinking behind this is to have a link at the bottom of your topics page that the spider will follow. Cross your fingers and you might see the bot go back to the default.htm page and repeat thru all your pages.

Last Note: If you add a google adsense to this page above each ad place the default.htm page link. Google will follow it's own adsense ads from time to time so you want to give it a internal link before an external link.

Good Luck.


Edited by - Mur on 03 June 2005 11:23:59
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 03 June 2005 :  15:32:42  Show Profile  Visit bobby131313's Homepage


Ok, metatags are done and working. Also noticed that there never was a </head> tag. Fixed that.

Now the index page I'm having trouble with.

First I think the /topicmaker/ should be "/topicmaker/". Correct?

I've tried it in different places, I now have it at the end as you said. It generates the default.htm file but with one of the topics for content.

http://www.coincommunity.com/topicmaker/default.htm

Any ideas?

Switch the order of your title tags
Go to Top of Page

Mur
Zapped Profile

24 Posts

Posted - 04 June 2005 :  04:14:15  Show Profile  Visit Mur's Homepage
Sure I have a couple of ideas.
First, next time I'll copy and paste enough code to make things work.

Sorry to waste your time.

Good news is the old post is still in the archives from the developers that made it all work back years ago.
http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=33931&whichpage=2

Look for the post by James about halfway down. At the bottom has the index.asp output code with the proper placement.

But if you look a bit further down to kwhipp's post you'll see a very clean version of what I use it would be very easy just to copy that one and change the strTopicPath to your topicmaker folder and you site URL.

So all this work reworking something that has been working since 2002. Dang I'm getting slow at finding old archived posts.

You should now have all your answers to the TopicMaker Mod. And I'll stop sending you flawed code and bad placement notes.

Talk to you later,
Mur
Go to Top of Page

bobby131313
Senior Member

USA
1163 Posts

Posted - 07 June 2005 :  10:21:31  Show Profile  Visit bobby131313's Homepage

Thanks Mur!

I can't believe you're apologizing to me. You've been a tremendous help!

I'll play with this tonight. I'll just paste the whole thing in there and then redo my personal tweaks that I've figured out with your help.

Thanks again!

Switch the order of your title tags
Go to Top of Page
  Previous Topic Topic Next Topic  
 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.33 seconds. Powered By: Snitz Forums 2000 Version 3.4.07