Code: Select all
<?php
if ( $this->is_premium ) {
// premium only get skyscraper if they have a campaign:
if( $this->hasCampaign() && $this->getCampaign()->hasSkyscraper() )
{
echo $this->getCampaign()->displaySkyscraper();
echo "<br />";
}
if( $this->hasCampaign() && $this->getCampaign()->hasSquare() )
{
echo $this->getCampaign()->displaySquare();
}
} else if ( ! $_REQUEST[ 'pfv' ] ) {
?>
<div id="masterdiv" class="links">
<ul>
<li><a href="<?=URL_HOME_U?>/">Home</a></li>
<li><a href="#" onClick="SwitchMenu('sub3')">Directory</a></li>
<span class="submenu" id="sub3">
<ul>
<?php
require( CONFIGURATION_PATH . '/categories.inc.php' );
foreach( array(
'abc',
'xyz',
'abc',
'xyz',
'abc',
'xyz',
'abc',
'xyz',
'abc',
'xyz',
'abc',
'xyz',
'abc',
'xyz',
'abc',
'xyz',
'abc',
'xyz',
) as $code ) {
$description = $categories[ $code ];
?>
<li><a href="<?=URL_HOME_U?>/index?a=&b=<?=htmlentities( $code , ENT_QUOTES, 'UTF-8' )?>"><?= $description ?></a></li>
<?php
}
?>
</ul>
</span>
<li><a href="<?=URL_HOME_U?>/asdf/">aasdf</a></li>
<li><a href="<?=URL_HOME_U?>/asdfasdf">asdf</a></li>
<li><a href="<?=URL_HOME_U?>/sdf">sdf</a></li>
<li><a href="#" onClick="SwitchMenu('sub1')">sdf</a></li>
<span class="submenu" id="sub1">
<ul>
<li><a href="<?=URL_HOME_U?>/sdf/">SDF</a></li>
<li><a href="<?=URL_HOME_U?>/sdf/">sdf</a></li>
</ul>
</span>
<li><a href="<?=URL_HOME_U?>/forums/">Forums</a></li>
</ul>
</div>
<br />
<?= $button ?>
<br />
<br />
<?php
$this->display_translate_widget();
?>
<br />
<?php
if( $this->hasCampaign() && $this->getCampaign()->hasSkyscraper() )
{
echo $this->getCampaign()->displaySkyscraper();
}
?>
<?php
// No left nav
}
?>Read the above code over closely before opening the image below. Read it over slow and carefully, Then take a look at the image below, then I want to know did you mis-read the code?
...
Click > http://img13.imageshack.us/img13/734/95180883.jpg
Did you think opening bracket labelled one was actually matching closing bracket labelled two? Do you think this code formatting style makes the code unreadable? The supposed logic behind is it that you can look down the left hand side to see where PHP begins & ends, but I personally think it is unorthodox and unreadable.
Also, have any of you guys seen any code written like this before? How do you think it would impact your productivity, personally, to have to work on code like this. Do you think its a serious problem or just a minor annoyance?
PS. my example was edited down too, the original example that sparked the debate was so long that you couldn't see the whole problem at once, you had to scroll. That is not the case with this edited example.