ruud2000 Posted March 6, 2008 Share Posted March 6, 2008 Hi, I have a question, I try to show a different picture my left table depending on the url, I mean something like this: <?php if (url=="index.php?option=com_content&view=frontpage&Itemid=1") { echo ('<img src=\"templates/RBL/images/webmaster.gif\" alt=\"Administrator\" border="0" />'); } ?> <?php if (path=="index.php?option=com_content&view=frontpage&Itemid=2") { echo ('<img src=\"templates/RBL/images/global.gif\" alt=\"Administrator\" border="0" />'); } But this does'nt work, what can I do? Greetings Ruud ?> Quote Link to comment Share on other sites More sharing options...
revraz Posted March 6, 2008 Share Posted March 6, 2008 You need to define url and path. Right now they are constants, did you define them? Quote Link to comment Share on other sites More sharing options...
Caesar Posted March 6, 2008 Share Posted March 6, 2008 I'm assuming you either are using constants or aren't sure how to define the url..... <?php function get_image($id) { switch($id) { case '1': $image = 'webmaster.gif'; break; case '2': $image = 'global.gif'; break; } return $image; } $id = $_GET['id']; // This would be the value in http://yourdomain.com/index.php?id=123 $img = 'templates/RBL/images/'.get_image($id); echo '<img src="'.$img.'" order="0" />'; ?> Possibly something like that.... Quote Link to comment Share on other sites More sharing options...
ruud2000 Posted March 6, 2008 Author Share Posted March 6, 2008 I will try it, now I go to sleep Thanks very much. Quote Link to comment Share on other sites More sharing options...
ruud2000 Posted March 7, 2008 Author Share Posted March 7, 2008 I found a simple solution: <?php $url = $_GET['Itemid']; if ($url == '1') { echo ('<img src="templates/RBL/images/webmaster.gif" border="0" />'); } else { echo "geen plaatje"; } ?> Thanks for the help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.