Need help building an "else if" statement.
Posted: Sun Jan 25, 2009 2:38 pm
Let me start with saying I'm a novice when it comes to writing PHP. I have a dilemma that I'm sure I can solve if I can figure out how to write an "exception" clause, but it seems to be beyond me to figure this out, and I'm embarrassed to say I'm sure it's simple.
Here's my issue - I am working on a site for a charity. They purchased a template that is really complex for their CMS. Now I'm very experienced building my own templates and doing basic code, but the author's have introduced a ton of what I call over kill when building this template. They have a java script that was written to control the content of the site's layout. As is typical from my experience, these designers create these templates without taking into consideration how these application work in "real time". Anytime dynamic content is introduced, it cuts off part of the content.
The original script is a javascript seen here (I'm not looking to rewrite the javascript, so please bear with me here)
Now, when a component with dynamic content (this is Joomla if anyone is familiar) comes into play, the content at the bottom is cutoff, so I tried the following code to create an exception.
Now that works perfect to get the dynamic content to lay correctly in this particular component; however it breaks the template, as all it is really doing is disabling the script entirely.
What I'm looking for is a PHP statement that states use this script "unless" com_profiler (or whatever component is listed (I have three that are broken due to this script) is being used. Right now my script just disables it through out the template and my right column is a disaster. What I really need "I think" (remember novice here) is a case statement where I can include all three components. com_profiler, com_chronoforms, com_wrapper.
I'm obviously over my head here and really need an expert.
Thank you in advance for any assistance you can offer.
Ruth
Here's my issue - I am working on a site for a charity. They purchased a template that is really complex for their CMS. Now I'm very experienced building my own templates and doing basic code, but the author's have introduced a ton of what I call over kill when building this template. They have a java script that was written to control the content of the site's layout. As is typical from my experience, these designers create these templates without taking into consideration how these application work in "real time". Anytime dynamic content is introduced, it cuts off part of the content.
The original script is a javascript seen here (I'm not looking to rewrite the javascript, so please bear with me here)
Code: Select all
<script type="text/javascript" src="<?php echo $mosConfig_live_site;?>/templates/<?php echo $mainframe->getTemplate(); ?>/js/roksameheight.js"></script>
Code: Select all
<?php if ($option != "com_comprofiler") : ?>
<script type="text/javascript" src="<?php echo $mosConfig_live_site;?>/templates/<?php echo $mainframe->getTemplate(); ?>/js/roksameheight.js"></script>
<?php endif; ?>What I'm looking for is a PHP statement that states use this script "unless" com_profiler (or whatever component is listed (I have three that are broken due to this script) is being used. Right now my script just disables it through out the template and my right column is a disaster. What I really need "I think" (remember novice here) is a case statement where I can include all three components. com_profiler, com_chronoforms, com_wrapper.
I'm obviously over my head here and really need an expert.
Thank you in advance for any assistance you can offer.
Ruth