Author |
Topic  |
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 06 October 2000 : 21:52:22
|
<s>I've been half successful with this, I know there is an if then/else statement that would take care of this, but I'm not experienced enuf. Here's what I got.
In order to have the name of the topic in the <title> tag, and the forum name in the <title> tag, this is what I did.
I chopped up the inc_top.asp file, everything before the <title> tag was put into a file I named inc_topic_top.asp and everything below the <title> tag was put into a file named inc_topic_top1.asp.
I then went into topic.asp and changed the line include file="inc_top.asp" to
<!--#INCLUDE FILE="inc_topic_top.asp" --> <title><% =ChkString(Request.QueryString("Topic_Title"),"display") %> - <% =ChkString(Request.QueryString("FORUM_Title"),"display") %> - <% =strForumTitle %></title> <!--#INCLUDE FILE="inc_topic_top1.asp" -->
And for forum.asp
<!--#INCLUDE FILE="inc_topic_top.asp" --> <title><% =ChkString(Request.QueryString("FORUM_Title"),"display") %> - <% =strForumTitle %></title> <!--#INCLUDE FILE="inc_topic_top1.asp" -->
This is in use at http://dbd.gameglow.com/forum/default.asp - go into a forum then a topic and you will see in the title bar, it puts the topic title and forum name in
Edited by - da_stimulator on 06 October 2000 21:53:55
Edited by - da_stimulator on 06 October 2000 21:54:58</s>
<font color=red>[edited by admin on 10/12/2000]</font id=red> |
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 08 October 2000 : 03:53:59
|
ok forget all that up there, I combined my knowledge of javascript and cgi to get a final product. i know I'm no einstein, but hey, this is my first time messin with asp.
Replace <title><% =strForumTitle %></title>
With the Following
<% tt1forumtitle = request("FORUM_Title") tt1forumtopic = request("Topic_Title") if tt1forumtitle = "" and tt1forumtopic = "" then %> <title><% =strForumTitle %></title> <% else if tt1forumtopic = "" then %> <title><% =ChkString(Request.QueryString("FORUM_Title"),"display") %> - <% =strForumTitle %></title> <% else %> <title><% =ChkString(Request.QueryString("Topic_Title"),"display") %> - <% =ChkString(Request.QueryString("FORUM_Title"),"display") %> - <% =strForumTitle %></title> <% end if end if %>
-- http://aokingdom.com -- head webmaster/creator
-- He who has never made a mistake, has never made a discovery -- |
 |
|
gor
Retired Admin
    
Netherlands
5511 Posts |
Posted - 08 October 2000 : 04:19:02
|
hmm, though the windows when minimized are too small to display much usefull information, I don't see why we couldn't display more usefull info than just the forum title.
Great idea, simple but yet a nice adition <img src=icon_smile_cool.gif border=0 align=middle>
<b>Pierre Gorissen</b>
<font color=blue><font size=1>A man who is 'of sound mind' is one who keeps the inner madman under lock and key. </font id=blue></font id=size1><font size=1><font color=black>Paul Valery</font id=size1></font id=black> |
 |
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 08 October 2000 : 12:37:03
|
heh, cool :) I just figured the same monotonous (spelled wrong I know) title is kinda... boring. The title is usually where I look first to remember what page I'm lookin at, cuz I usually have like 10-15 browser windows open at a time.
-- http://aokingdom.com -- head webmaster/creator
-- He who has never made a mistake, has never made a discovery -- |
 |
|
Doug G
Support Moderator
    
USA
6493 Posts |
Posted - 08 October 2000 : 16:03:21
|
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote> heh, cool :) I just figured the same monotonous (spelled wrong I know) title is kinda... boring. The title is usually where I look first to remember what page I'm lookin at, cuz I usually have like 10-15 browser windows open at a time. <hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Nope, spelled right.
====== Doug G ====== |
 |
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 12 October 2000 : 17:36:50
|
I'm a better speller than I thought
-- http://aokingdom.com -- head webmaster/creator
-- He who has never made a mistake, has never made a discovery -- |
 |
|
Reinsnitz
Snitz Forums Admin
    
USA
3545 Posts |
Posted - 12 October 2000 : 22:09:48
|
Ok... I feel kinda silly asking this, but when you put a "request(value)" what exactly is it doing?
Request.Querystring? Request.????
I apreciate the help in understanding this.
Also, I re-wrote your function a little as follows:
<pre id=code><font face=courier size=2 id=code> <% tt1forumtitle = request("FORUM_Title") tt1forumtopic = request("Topic_Title")
if tt1forumtitle = "" and tt1forumtopic = "" then
Response.Write "<title>" & strForumTitle & "</title>" & vbcrlf
elseif tt1forumtopic = "" then
Response.Write "<title>" & ChkString(Request.QueryString("FORUM_Title"),"display") & " - " & strForumTitle & "</title>" & vbcrlf
else
Response.Write "<title>" & ChkString(Request.QueryString("Topic_Title"),"display") & " - " & ChkString(Request.QueryString("FORUM_Title"),"display") & " - " & strForumTitle & "</title>" & vbcrlf
end if %> </font id=code></pre id=code>
with the understanding I gain from this "Request()" thing... I can probably do a little better.
<center>Reinsnitz (Mike) <font color=red>><)))'></font id=red>
<font color=green>It's not a bug, it's a feature.</font id=green></center> |
 |
|
Reinsnitz
Snitz Forums Admin
    
USA
3545 Posts |
Posted - 12 October 2000 : 22:10:44
|
<b>NOTE:</b> That last post is the style we are moving twords.
<center>Reinsnitz (Mike) <font color=red>><)))'></font id=red>
<font color=green>It's not a bug, it's a feature.</font id=green></center> |
 |
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 12 October 2000 : 22:13:22
|
request("variable")
is the same as writing request.Querystring, I'm just too lazy :P
Oh yeah, and the tt1forumtitle thing, I named the variables so oddly so that it didnt interfere (sp?) with any of the other variables used among the forum.
-- http://aokingdom.com -- head webmaster/creator
-- He who has never made a mistake, has never made a discovery --
Edited by - da_stimulator on 12 October 2000 22:15:36 |
 |
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 12 October 2000 : 22:18:08
|
oh yeah, and whats the 'vbcrlf' thing?
-- http://aokingdom.com -- head webmaster/creator
-- He who has never made a mistake, has never made a discovery -- |
 |
|
Doug G
Support Moderator
    
USA
6493 Posts |
Posted - 12 October 2000 : 23:03:45
|
vbcrlf is a carriage-return line-feed string.
Response.write "this is " & vbcrlf & "a test"
comes out in your source as
this is a test
====== Doug G ====== |
 |
|
Reinsnitz
Snitz Forums Admin
    
USA
3545 Posts |
Posted - 12 October 2000 : 23:05:17
|
vbCrLf is basicaly a carrage return
so it's writing out code... and it sees a vbCrLf, and it places a return (Char13?)
<center>Reinsnitz (Mike) <font color=red>><)))'></font id=red>
<font color=green>It's not a bug, it's a feature.</font id=green></center> |
 |
|
blkrogue
New Member

USA
79 Posts |
Posted - 13 October 2000 : 05:37:12
|
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote> Ok... I feel kinda silly asking this, but when you put a "request(value)" what exactly is it doing? <hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Mike, the request("variabel-name") function, is a combination of request.querystring and the request.form ......... this way either a redirect to the asp (with all the needed variables added to the querystring) will be correctly translated by the asp redirected to (thus it will get the values for the variables) ....... but it will also correctly get the variables when you use a form (with an action and post type calling the asp-page).
We've switched here at work to using request("variable-name") is all our backend asp application as this way the frontend can either decide to have it's variables be shown in the querystring in the users browser or use hidden form fields to get the data across but not have the browser show the variables and their values.
Blkrogue
In the darkness of my soul a sparkling light has appeared |
 |
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 13 October 2000 : 05:59:53
|
Yeah I was looking around at the asp toolbox when I noticed an article saying the same thing (after I said it was another form of request.querystring, which it is in a way)
so what he said :)
<font color=red>Da_Stimulator</font id=red> <font color=red>http://aokingdom.com</font id=red> <font color=blue>response.write("I know what you coded last summer!")</font id=blue> |
 |
|
Doug G
Support Moderator
    
USA
6493 Posts |
Posted - 13 October 2000 : 11:10:40
|
If it's a concern, there is a performance hit using request("name") rather than request.form("name"). From MS:
Remarks If the specified variable is not in one of the preceding five collections, the Request object returns EMPTY.
All variables can be accessed directly by calling Request(variable) without the collection name. In this case, the Web server searches the collections in the following order.
QueryString
Form
Cookies
ClientCertificate
ServerVariables
If a variable with the same name exists in more than one collection, the Request object returns the first instance that the object encounters.
It is strongly recommended that when referring to members of a collection the full name be used. For example, rather than Request.(AUTH_USER) use Request.ServerVariables(AUTH_USER). This will allow the server to locate the item more quickly.
====== Doug G ====== |
 |
|
davemaxwell
Access 2000 Support Moderator
    
USA
3020 Posts |
Posted - 13 October 2000 : 12:51:52
|
Doug is the MS Master!!
He always seems to know exactly what article is relevent for any situation relating to ASP development. It amazes me.....
Dave Maxwell -------------- When's the next meeting of Snitzaholics Anonymous<img src=icon_smile_question.gif border=0 align=middle> |
 |
|
Topic  |
|