Print Page | Close Window

Using strSubject

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=27891
Printed Date: 29 March 2026 at 2:09pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Using strSubject
Posted By: MortiOli
Subject: Using strSubject
Date Posted: 01 October 2009 at 9:23am
Sorry if this is a really easy problem to solve, but I'm a PHP programmer, so don't know a lot about ASP...

On my WWF forum, I have an advert at the top (where the WWF Google Ads usually appear), which I can specify keywords for.  What I'd like to do is to use the topic title (strSubject) as the keywords, with each word separated by + signs, BUT if the user is on another page (ie, Active Users etc), then a default set of keywords is used.

I managed to get half of this done, but having problems with errors saying variable undefined on some pages, then variable already defined on others when I define it.

Could someone please help?

Thanks!





Replies:
Posted By: Scotty32
Date Posted: 01 October 2009 at 11:48am
I would define a new variable at the bottom of the common.asp file say
dim strMortiKeywords

(to make sure its 'unique')

Then set your 'default' keywords under it like so
dim strMortiKeywords
strMortiKeywords = "my+keywords+for+advert"


Then in the forum_posts.asp  file set the bottom of the ASP section, before the HTML starts this:

strMortiKeywords = strSubject


To get the + in, you can either use
strMortiKeywords = Server.URLEncode(strSubject)


or
strMortiKeywords = Replace(strSubject," ", "+")


The Replace method will only replace spaces with the + sign, if (as i suspect) you need it for a URL, then the URL Encode method would be better as it'll make sure the subject is "URL Friendly"

Then pass it to your advert, as you are already with strSubject

You can then set your custom variable on any other pages with say forum titles on forum pages or anything else if you wished.


-------------
S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins

For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .


Posted By: MortiOli
Date Posted: 01 October 2009 at 12:39pm
Thanks Scotty, perfect!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net