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: General / Classic ASP versions(v3.4.XX)
 Adding code to head for certain pages
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

leatherlips
Senior Member

USA
1838 Posts

Posted - 19 September 2009 :  11:13:28  Show Profile  Visit leatherlips's Homepage
When I need to add something to the head tags of the forum I have to do it in the inc_header.asp page. When you do that, the content in the head ends up in every page of the forum.

Is it possible to make it only appear on the pages that it is needed on? Something like this:

If post.asp or topic.asp

<Content Here>

end if

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Classicmotorcycling
Development Team Leader

Australia
2085 Posts

Posted - 20 September 2009 :  05:39:28  Show Profile
Would not something like this work for you:

<%
if request.servervariables("URL") = "/forum/post.asp" or request.servervariables("URL") = "/forum/topic.asp" then
%>
Content in here
<%
end if
%>


I have it like that for a couple of things.

Cheers,

David Greening
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 20 September 2009 :  07:29:21  Show Profile  Visit leatherlips's Homepage
I had to remove the <% at the top and the %> at the bottom, but after that it worked great!

Thanks!

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 20 September 2009 :  07:36:29  Show Profile  Visit leatherlips's Homepage
I have another detail I'd like to be able to add if possible.

Say this is the code:

if request.servervariables("URL") = "/forum/post.asp" or request.servervariables("URL") = "/forum/topic.asp" then
%>
Content in here
<%
end if


I want the green line to only make the "Content in here" show if they are a member. How can I insert that in there?

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 20 September 2009 :  07:45:42  Show Profile  Visit leatherlips's Homepage
I think I got it. Would this be correct?

if request.servervariables("URL") = "/forum/post.asp" then
%>
Content in here
<%
Else if mlev > 0 and request.servervariables("URL") = "/forum/topic.asp" then
%>
Content in here
<%
end if
end if

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 20 September 2009 07:57:28
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 21 September 2009 :  10:48:32  Show Profile
You only need one "end if" and "Else if" should be one word. Also, there's a variable called strScriptName declared in inc_header.asp that you can use to determine which page you're on.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

leatherlips
Senior Member

USA
1838 Posts

Posted - 21 September 2009 :  12:00:54  Show Profile  Visit leatherlips's Homepage
Thanks Shaggy. So this would be the way to do it...

if request.servervariables("URL") = "/forum/post.asp" then
%>
Content in here
<%
Elseif mlev > 0 and request.servervariables("URL") = "/forum/topic.asp" then
%>
Content in here
<%
end if

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 22 September 2009 :  07:52:20  Show Profile
Yup, that'll do it.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
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.35 seconds. Powered By: Snitz Forums 2000 Version 3.4.07