vBulletin Modifications

If statements in the archive?

Welcome to vBHackers.com! - vBHackers Updates:

Go Back   vBulletin Modifications > General vBulletin Section > General vBulletin Support

Reply
 
LinkBack Thread Tools
Old 05-24-2006, 08:17 PM   #1
Joe
vB Newbie
Join Date: May 2006
Joe is on a distinguished road

Default If statements in the archive?

I have half a dozen or so archive pages that rank #1 for REALLY high paying keywords, rather then accept a few dollars per click on adsense, I want to target these pages with affiliate links. Any ideas on how I can do this?

Something on the lines of:

if thread = 10004>affiliate link a</if
if thread = 10007>affiliate link b</if
if thread = 10011>affiliate link c</if

else>adsense ads</else>

No laughing at my code please.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 05-24-2006, 08:55 PM   #2
Rex
Advanced Coder
Rex's Avatar
Join Date: Sep 2004
Location: Louisiana
Rex is on a distinguished road

Default

Interesting idea, never thought about doing it in the archive.... hmmm




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-25-2006, 05:35 AM   #3
Niels
Support Staff
Niels's Avatar
Join Date: Jun 2004
Real Name: Niels
Location: NL
Niels is on a distinguished road

Default

Quote:
Originally Posted by Joe
I have half a dozen or so archive pages that rank #1 for REALLY high paying keywords, rather then accept a few dollars per click on adsense, I want to target these pages with affiliate links. Any ideas on how I can do this?

Something on the lines of:

if thread = 10004>affiliate link a</if
if thread = 10007>affiliate link b</if
if thread = 10011>affiliate link c</if

else>adsense ads</else>

No laughing at my code please.
Well I never did any modding in the archive pages. But I suppose they are using the template system:
You must first be a registered member to view any code.
etc. etc.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-25-2006, 05:03 PM   #4
vBulletin Guru
Arnoud's Avatar
Join Date: Nov 2004
Real Name: Arnoud Kuipers
Location: Europe, Flanders
Arnoud is on a distinguished road

Default

The archive uses raw PHP code, so you'll need to use code like this:

You must first be a registered member to view any code.
Seeing as you'll be using a lot of the above conditions, I'd suggest using a the switch function, like this:
You must first be a registered member to view any code.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-26-2006, 03:19 PM   #5
Joe
vB Newbie
Join Date: May 2006
Joe is on a distinguished road

Default

Quote:
Originally Posted by Arnoud
The archive uses raw PHP code, so you'll need to use code like this:

You must first be a registered member to view any code.
Seeing as you'll be using a lot of the above conditions, I'd suggest using a the switch function, like this:
You must first be a registered member to view any code.
Nice, thanks mucho.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-26-2006, 03:20 PM   #6
vBulletin Guru
Arnoud's Avatar
Join Date: Nov 2004
Real Name: Arnoud Kuipers
Location: Europe, Flanders
Arnoud is on a distinguished road

Default

No problem mate ;).

Remember, you can add as many "case"-es as you want. You can also add a "case default:" one, which shows a default banner for all the threads which arent in your switch function.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-26-2006, 03:24 PM   #7
Joe
vB Newbie
Join Date: May 2006
Joe is on a distinguished road

Default

Ahhh! The "case default:" makes it all worthwhile!

Quote:
Originally Posted by Arnoud
No problem mate ;).

Remember, you can add as many "case"-es as you want. You can also add a "case default:" one, which shows a default banner for all the threads which arent in your switch function.




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-26-2006, 04:29 PM   #8
Niels
Support Staff
Niels's Avatar
Join Date: Jun 2004
Real Name: Niels
Location: NL
Niels is on a distinguished road

Default

Oh didn't knew the archive didn't work with templates




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-26-2006, 06:07 PM   #9
vBulletin Guru
Arnoud's Avatar
Join Date: Nov 2004
Real Name: Arnoud Kuipers
Location: Europe, Flanders
Arnoud is on a distinguished road

Default

Well, now you know




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Archive Welcome Headers Impreza04 vBulletin 3.5 / 3.6 Hack Releases 5 04-28-2007 12:47 PM
Archive Thread Darkblade vBulletin Modification Requests 2 10-20-2005 10:44 AM
Archive Update Ken Iovino Announcements 0 05-09-2004 05:42 AM


All times are GMT -3. The time now is 03:29 AM.


SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc. (Patent Pending)