FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Problem Changing Header Dynamically
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Problem Changing Header Dynamically [message #37955] Sun, 08 July 2007 22:44 Go to next message
Markus Allen is currently offline  Markus Allen   United States
Messages: 58
Registered: September 2005
Karma: 0
Member
Quick question:
Is there an easy way to display different headers depending on what forum my user visits?

Right now, I'm using frames, PHP, and if/elsw coding to show different headers (and it's sloppy).

Any ideas, Ilia?
Re: Problem Changing Header Dynamically [message #37977 is a reply to message #37955] Wed, 11 July 2007 12:51 Go to previous messageGo to next message
Markus Allen is currently offline  Markus Allen   United States
Messages: 58
Registered: September 2005
Karma: 0
Member
Is this too hard, Ilia? If so, no problem.
Re: Problem Changing Header Dynamically [message #38008 is a reply to message #37977] Thu, 12 July 2007 23:55 Go to previous messageGo to next message
Ilia is currently offline  Ilia   
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
You can put a conditional statement inside header.tmpl and have it show different content based on the forum_id

FUDforum Core Developer
Re: Problem Changing Header Dynamically [message #38074 is a reply to message #38008] Mon, 16 July 2007 11:18 Go to previous messageGo to next message
Markus Allen is currently offline  Markus Allen   United States
Messages: 58
Registered: September 2005
Karma: 0
Member
Thank you Ilia.

One final question:

I'd like my affiliates to recommend specific posts at FUDforum...

... Unfortunately, my affiliate program (amember) is tied into FUDforum (so I can't use FUDforum tracking).

Can I pass form parameters to a link in my forum header instead?

For example, I tried this:
{ROOT}?t=index&amp;{DEF: _rsid}&amp;affiliate=<?php echo $affiliate ?>

But I come up empty.

Can you help me, Ilia?
Re: Problem Changing Header Dynamically [message #38076 is a reply to message #38074] Tue, 17 July 2007 01:04 Go to previous messageGo to next message
Ilia is currently offline  Ilia   
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
you need to use {VAR: affiliate}

FUDforum Core Developer
Re: Problem Changing Header Dynamically [message #38092 is a reply to message #38076] Wed, 18 July 2007 11:37 Go to previous messageGo to next message
Markus Allen is currently offline  Markus Allen   United States
Messages: 58
Registered: September 2005
Karma: 0
Member
Ilia wrote on Mon, 16 July 2007 21:04

you need to use {VAR: affiliate}

Ilia, I tried that, but when I add to the URL something like:
http://www.myforum.com/forum/index.php?t=thread&frm_id=795&S=5bb504 327700146e331556323a6dadd7&article=223432

... And go to click on the "Home" link which has the code:
{ROOT}?t=index&amp;{DEF: _rsid}&amp;article={VAR: article}

The article= is blank.

Any ideas?
Re: Problem Changing Header Dynamically [message #38102 is a reply to message #38092] Wed, 18 July 2007 22:56 Go to previous messageGo to next message
Ilia is currently offline  Ilia   
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
I thought the variable was affiliate? You need to make sure that the variable exists in the scope of the code.

FUDforum Core Developer
Re: Problem Changing Header Dynamically [message #38105 is a reply to message #38102] Thu, 19 July 2007 00:03 Go to previous messageGo to next message
Markus Allen is currently offline  Markus Allen   United States
Messages: 58
Registered: September 2005
Karma: 0
Member
Ilia wrote on Wed, 18 July 2007 18:56

I thought the variable was affiliate? You need to make sure that the variable exists in the scope of the code.

I did try {VAR: affiliate} and it too is showing up with empty data.

I want to use {VAR: article} because this is a non-obvious affiliate link -- I'd like to have every single FUDforum post double as affiliate content.

By the way, I'm using FUDforum 2.7.2.

As I've offered in the past, I can send a donation for your help... this would really help me out.

[Updated on: Thu, 19 July 2007 00:08]

Report message to a moderator

Re: Problem Changing Header Dynamically [message #38173 is a reply to message #38105] Sun, 22 July 2007 20:03 Go to previous messageGo to next message
Ilia is currently offline  Ilia   
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
If you don't see any data this means that the variable is not present in the given scope. Where is $affiliate declared?

FUDforum Core Developer
Re: Problem Changing Header Dynamically [message #38176 is a reply to message #38173] Sun, 22 July 2007 20:56 Go to previous messageGo to next message
Markus Allen is currently offline  Markus Allen   United States
Messages: 58
Registered: September 2005
Karma: 0
Member
Ilia wrote on Sun, 22 July 2007 16:03

If you don't see any data this means that the variable is not present in the given scope. Where is $affiliate declared?

That might be the problem... where do I declare it?
Re: Problem Changing Header Dynamically [message #38186 is a reply to message #38176] Mon, 23 July 2007 23:05 Go to previous messageGo to next message
Ilia is currently offline  Ilia   
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
You want to declare it in the global scope, so declaring inside thread.php.t for example outside of any functions would work.

FUDforum Core Developer
Re: Problem Changing Header Dynamically [message #38244 is a reply to message #38186] Sat, 28 July 2007 12:28 Go to previous messageGo to next message
Markus Allen is currently offline  Markus Allen   United States
Messages: 58
Registered: September 2005
Karma: 0
Member
Ilia wrote on Mon, 23 July 2007 19:05

You want to declare it in the global scope, so declaring inside thread.php.t for example outside of any functions would work.

Ilia, I know just enough about programming to impress my marketing friends...

... Can you give me an example of how to add this -- I'd like to add the variable "article".

Thank you so much in advance (and again, if you'd like me to send money, you got it).
Re: Problem Changing Header Dynamically [message #38255 is a reply to message #38244] Sun, 29 July 2007 15:09 Go to previous messageGo to next message
Ilia is currently offline  Ilia   
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
<?php $foo = 1; ?>

FUDforum Core Developer
Re: Problem Changing Header Dynamically [message #38273 is a reply to message #38255] Mon, 30 July 2007 13:03 Go to previous messageGo to next message
Markus Allen is currently offline  Markus Allen   United States
Messages: 58
Registered: September 2005
Karma: 0
Member
Ilia wrote on Sun, 29 July 2007 11:09

<?php $foo = 1; ?>

I'm so, so sorry for not getting this Ilia -- it's still not passing the variable.

I added:
<?php $foo = 1; ?>

On the first line of:
thread.php.t

Within the subdirectory:
/FUDdata/src

Within the "Template Editor", I selected "default" and "english" (and clicked the [Edit] submit button).

I selected the "footer.tmpl" link... specifically the "footer link" and changed:
{ROOT}?t=index&amp;{DEF: _rsid}

To:
{ROOT}?t=index&amp;{DEF: _rsid}&amp;affiliate={VAR: affiliate}

Finally, I tested the main forum page with something like:
http://www.domain.org/forum/index.php?article=test

But when I click on the "home" link at the bottom of the webpage to test it out, I get an emply "affiliate" value like:

http://www.domain.org/forum/index.php?t=index&S=13eb371b824d11606192d97 53bc9cb51&affiliate=

Any ideas for a fix, Ilia?

Again, I can send money via PayPal if this is too complicated.


Re: Problem Changing Header Dynamically [message #38444 is a reply to message #38273] Tue, 07 August 2007 12:10 Go to previous message
Markus Allen is currently offline  Markus Allen   United States
Messages: 58
Registered: September 2005
Karma: 0
Member
Bump.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Group Request
Next Topic: A Few Template Changes
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Dec 22 06:02:55 GMT 2024

Total time taken to generate the page: 0.07300 seconds