Jump to content

[SOLVED] can you do


Scott87

Recommended Posts

the *insert thing*?

 

 

Just kidding ;)

 

 

I'm having a bit of a struggle coming up with a solution - it's probably a simple thing and i'm just totally useless and should know better but basically this is it:

 

 

I've got a site which is ran through a CMS, the CMS generates pages from the index.php template. I want to change a few things on some pages. E.g. I have a right 'Facts box' on the index.php (which obviously displays on every page due to the template). However on the contact page I want an image to display here in place of the facts box.

 

Any ideas?

 

Thanks in advance..... ;)

 

 

Link to comment
Share on other sites

At the moment i'm doing it by saying :

 


<?php if($page == 'contact-us'){ include('_inc/rightsection2.inc.php'); } ?>

<?php if($page == 'login'){ include('_inc/rightsection2.inc.php'); } ?>

<?php if($page == 'faqs'){ include('_inc/rightsection2.inc.php'); } ?>


<?php include('_inc/rightsection.inc.php') ?>

 

In rightsection2.inc.php I have an include along with some other xhtml stuff. The include is to rightbox.inc.php which has:

 


<?php
$rightbox = array(
  'faqs' => '_img/faqanswers.jpg',
  'contact-us' => '_img/contactsuccessful.jpg',
  'login' => '_img/loginexperience.jpg',
);

$page = isset($_GET['page']) ? $_GET['page'] : 'home'; // default to home page
echo "<img src=\"{$rightbox[$page]}\" />";
?>

 

The images are working fine, however i still have the normal include of:

 


<?php include('_inc/rightsection.inc.php') ?>

 

Being displayed, I need to show it on all pages except the contact-us - faqs and login area. If i can hide this include only on those three pages everything should work fine.

 

 

 

 

Link to comment
Share on other sites

Thanks for that.

 

if($page == 'contact-us','login','faqs'){

//show righthand images

include('_inc/rightsection2.inc.php'); 

}

else

{

//use the facts box

include('_inc/rightsection.inc.php') }

 

Didn't work but Gevans code did, thanks again.

 

Scott

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.