我需要帮助才能让这个 if else 语句正常工作。我在网站上显示了 HTML,但我也需要 php 工作。我不知道在另一个回声中做一个回声的方法(这是不受欢迎的)。任何建议都会有所帮助!
code
<?php
if ( is_user_logged_in() ) {echo "
<div id='fixedbar'>
<div id='boxfloat'>
<div id='header'>
<img src='http://s3.amazonaws.com/punchtab-static/nd/images/favicon.ico' id='favicon' border='0' onerror='imageNotFound(this, '//s3.amazonaws.com/punchtab- static/nd/images/bar/shield.png')' onload='imageFound(this)' style='visibility: visible;'>
</div>
<p>
Rewards
<div id='points'>
<div id='user'>
echo 'cosmo_avatar( get_the_author_meta('ID') , 30 )'; ?>
</div>
echo cp_displayPoints($user->ID)'; pts
</div>
<div id='more'>
<a href='/leaderboard'>
<img border='0' src='http://expertcamo.com/wp-content/uploads/2012/12/icon-leaderboard.png' id='leaderboard' alt='Leaderboard' title='Expert Camo Points Leaderboard'</a>
<a href='/catalog'>
<img border='0' src='http://expertcamo.com/wp-content/uploads/2012/12/icon-trophy.png' id='catalog' alt='Catalog' title='Rewards Catalog'</a>
</div>
</p>
<div id='copyright'><a href='/'>
Expert Camo © echo 'date('Y')';</a>
</div>
</div>
</div>
";} else { echo "
<div id='fixedbar'>
<div id='boxfloat'>
</div>
</div>
";}
?>