Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post Vars To Switch Header Location Wanted If Possible 
 
MG,

Are there any anchors / vars available to switch the script / markup that could be used in E.g. overall_header.tpl to modify the header.

I.E. :

<!-- IF LOCATION_SEARCH_PHP -->

Blah blah Blah Search-Header Page will change.

<!-- ELSE -->

<!-- IF LOCATION_ALBUM_PHP -->

More blah - Album Header changes?

<!-- ENDIF -->

Would be useful  
 
 
 
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Vars To Switch Header Location Wanted If Possible 
 
You can use this code in your overall_header to get the page name and do whatever you want with that:

Code: [Download] [Hide] [Select]
<?php echo(basename($_SERVER['SCRIPT_NAME'])); ?>


You can create a condition like this:
Code: [Download] [Hide] [Select]
<?php
if (basename($_SERVER['SCRIPT_NAME'], '.' . PHP_EXT) == 'album')
{
?>
We are in album baby!
<?php
}
?>

 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Vars To Switch Header Location Wanted If Possible 
 
Thanks Luca,

I'll have a stumble through it tomorrow.

But so that we are not confused about the small thing I want to do, I'm trying to use IP only as a forum without all of the CMS attributes and overhead.

Just simple stuff that would appeal to lot of people who only want a simple "Forum" though all of the other options would still be there.

And all I really want to do is to have the simplest way to change these banners, and possibly any other "location" script without having to add or modify anything. So maybe it's something that could be added as default vars to IP.

Here are two examples of why I would like to change the banners to something that reflects where one is.

h**p://***.lopalong.com/forum/crosswords_index.php
h**p://***.lopalong.com/forum/smilies_index.php

Update:

Thanks again, because it works a treat.  

Only I found it didn't need
Code: [Download] [Hide] [Select]
<?php echo(basename($_SERVER['SCRIPT_NAME'])); ?>
and I assume that has already been echoed previously.

The other thing is, it's more functional with "else" arguments, because with "else" one can not only swap the banners, but the logo's too.

I also don't know if there's any value in writing an example doc for this, because of the variations to different headers, and different arguments for every <?php anchor and .css markup.

And I've spent hours hunting the web for anything on how to add "?mode=page1" etc. Found a lot of stuff - Tried a lot of stuff - Nothing worked! - But then again, no-one else uses PHP_EXT constants either!


So is it possible to add ?mode= too?
 
 
Edited by Guest, Thu 02 Apr, 2009 09:08: Add Update
Edited by Guest, Wed 13 May, 2009 20:06: Changed the url's
 
Back to topPage bottom
Reply with quote Download Post 
Post Re: [SOLVED] Vars To Switch Header Location Wanted If Possible 
 
Of course it is possible.

You just need to play with globals php vars and some "cool" PHP functions:

http://it.php.net/manual/en/reserved.variables.server.php
http://it.php.net/manual/en/reserved.variables.environment.php
http://it.php.net/manual/en/function.getenv.php
http://it.php.net/manual/en/function.pathinfo.php
http://it.php.net/manual/en/function.parse-url.php


For example this var:
Code: [Download] [Hide] [Select]
$_SERVER['QUERY_STRING']


contains only the QUERY (the part after the question mark in URL).


I hope this helps.


 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: [SOLVED] Vars To Switch Header Location Wanted If Possible 
 
Grazzie once more!  

Stupid me thought one query would be enough and then add the other bits to the exiting query. Apparently not so.

I've also added this to the back-burner for now while I concentrate on something else, but sure as hell I WILL be using mode=options, because this my friend is far better than the "Random" javascript or .php changers.

 
 
 
 
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron