2

我收到以下错误:

 Parse error: syntax error,
 unexpected $end in /var/www/html/joomla/components/com_jtagmembersdirectory/views/memberdetails/tmpl/default.php 
on line 147

可能的解决方案是什么,我搜索了很多帖子,我确实使用了<?php ?> 没有开括号和右括号问题,也没有引用问题。

还有什么可能导致这个问题的吗?

我的代码如下所示,

  <?php

defined('_JEXEC') or die('Restricted access');

    $user =& JFactory::getUser();
    $this->user_id = $user->id;
?>

<div class="Jtag_Members_Directory_details">
    <h2 class="page-title"><?php echo JText:: _('JTAG_MEMBER_DETAIL');?></h2>
    <div id="jtag-member-list">

          <img width="225" src="components/com_jtagmembersdirectory/assets/profile_pictures/small/<?php echo $this->profile->profile_picture ? $this->profile->profile_picture : 'profile2.jpg' ?>" alt="" />
          <div class="info details">


            <?php if ($this->profile->user_id == $this->user_id && $this->profile->allow_edit):?>
                <a href="<?php echo JRoute::_('index.php?option=com_jtagmembersdirectory&task=editmemberdetails&mid='.$user->id) ?>" title ="Click to edit your Profile"><h2><?php echo $this->profile->name ?></h2></a>
            <?php else:?>
                <h2><?php echo $this->profile->name ?></h2>    
            <?php endif; ?>



            <h4><?php echo JText:: _('JTAG_MEMBER_DETAIL_ABOUT_ME');?></h4>
            <div><?php echo nl2br($this->profile->member_profile) ?></div>
            <ul class="member-details">

            <?php if($this->user_id !=0):?>
                <?php if($this->profile->hasGallery==1 && $this->profile->display_gallery == 1):?>      
                    <li><a href="<?php echo JRoute::_('index.php?option=com_jtagmembersdirectory&task=showgallery&mid='.$this->profile->user_id) ?>" title ="Click to checkout the gallery"><strong><?php echo JText:: _('JTAG_MEMBER_DETAIL_GALLERY');?></strong></a></li>                    
                <?php endif;?>
            <?php endif;?>  

            <?php if($this->user_id==0):?>
              <?php if($this->profile->display_nr_country==1 && $this->profile->country):?>
                <li><strong><?php echo JText:: _('JTAG_MEMBER_DETAIL_COUNTRY');?></strong> <?php echo $this->countries[$this->profile->country]; ?></li>
              <?php endif;?>
            <?php else:?>
              <?php if( $this->profile->country):?>
                <li><strong><?php echo JText:: _('JTAG_MEMBER_DETAIL_COUNTRY');?></strong> <?php echo $this->countries[$this->profile->country]; ?></li>
              <?php endif;?>
            <?php endif;?>  


            <?php if($this->user_id==0):?>
              <?php if($this->profile->display_nr_city==1 && $this->profile->city):?>
                <li><strong><?php echo JText:: _('JTAG_MEMBER_DETAIL_CITY');?></strong> <?php echo $this->profile->city; ?></li>
              <?php endif;?>
            <?php else:?>
              <?php if( $this->profile->city && $this->profile->display_city):?>
                <li><strong><?php echo JText:: _('JTAG_MEMBER_DETAIL_CITY');?></strong> <?php echo $this->profile->city; ?></li>
              <?php endif;?>
            <?php endif;?>  


            <?php if($this->user_id==0):?>
              <?php if($this->profile->display_nr_state==1 && $this->profile->state):?>
                          <li><strong><?php echo JText:: _('JTAG_MEMBER_DETAIL_STATE');?></strong> <?php echo $this->profile->state; ?></li>
              <?php endif;?>
            <?php else:?>
              <?php if( $this->profile->state ):?>
                          <li><strong><?php echo JText:: _('JTAG_MEMBER_DETAIL_STATE');?></strong> <?php echo $this->profile->state; ?></li>
              <?php endif;?>
            <?php endif;?>  




            <?php if($this->user_id==0):?>
              <?php if($this->profile->display_nr_phone_no==1 && $this->profile->phone_no):?>
                          <li><strong><?php echo JText:: _('JTAG_MEMBER_DETAIL_PHONE_NO');?></strong> <?php echo $this->profile->phone_no ?></li>
              <?php endif;?>
            <?php else:?>
              <?php if( $this->profile->phone_no  && $this->profile->display_phone_no):?>
                          <li><strong><?php echo JText:: _('JTAG_MEMBER_DETAIL_PHONE_NO');?></strong> <?php echo $this->profile->phone_no ?></li>
              <?php endif;?>
            <?php endif;?>  

            <?php if($this->user_id==0):?>
              <?php if($this->profile->display_nr_email==1 && $this->profile->Email):?>
               <li><strong><?php echo JText:: _('JTAG_MEMBER_DETAIL_EMAIL');?></strong> <?php echo $this->profile->Email; ?></li>
              <?php endif;?>
            <?php else:?>
              <?php if( $this->profile->Email):?>
               <li><strong><?php echo JText:: _('JTAG_MEMBER_DETAIL_EMAIL');?></strong> <?php echo $this->profile->Email; ?></li>
              <?php endif;?>
            <?php endif;?>  



          <?php if($this->user_id==0):?>
            <?php if($this->profile->display_nr_facebook==1 && $this->profile->facebook_page):?>
             <li><strong><?php echo JText:: _('JTAG_MEMBER_DETAIL_FACEBOOK_PAGE');?></strong> <a href="http://<?php echo $this->profile->facebook_page ?>" target="_blank"><?php echo $this->profile->facebook_page ?></a></li>

            <?php endif;?>
          <?php else:?>
            <?php if( $this->profile->facebook_page && $this->profile->display_facebook_page):?>
             <li><strong><?php echo JText:: _('JTAG_MEMBER_DETAIL_FACEBOOK_PAGE');?></strong> <a href="http://<?php echo $this->profile->facebook_page ?>" target="_blank"><?php echo $this->profile->facebook_page ?></a></li>

            <?php endif;?>
          <?php endif;?>  



          <?php if($this->user_id==0):?>
            <?php if($this->profile->display_nr_twitter==1 && $this->profile->twitter_page):?>
             <li><strong><?php echo JText:: _('JTAG_MEMBER_DETAIL_TWITTER_PAGE');?></strong> <a href="http://<?php echo $this->profile->twitter_page ?>" target="_blank"><?php echo $this->profile->twitter_page ?></a></li>

            <?php endif;?>
          <?php else:?>
            <?php if( $this->profile->twitter_page && $this->profile->display_twitter_page):?>
             <li><strong><?php echo JText:: _('JTAG_MEMBER_DETAIL_TWITTER_PAGE');?></strong> <a href="http://<?php echo $this->profile->twitter_page ?>" target="_blank"><?php echo $this->profile->twitter_page ?></a></li>

            <?php endif;?>
          <?php endif;?>  

          <?php if($this->user_id):?>   
              <?php foreach ($this->profile->custom_fields as $field):  ?>
                <?php if ($field->field_label && $field->field_value): ?>
                <li><strong><?php echo $field->field_label; ?>:</strong> <?php echo $field->field_value ?></li>
                <?php endif; ?>
              <?php endforeach; ?>
          <?php else: ?>
              <?php foreach ($this->profile->custom_fields as $field):  ?>
                <?php if ($field->field_label && $field->field_value && $field->display_nr_cf): ?>
                <li><strong><?php echo $field->field_label; ?>:</strong> <?php echo $field->field_value ?></li>
                <?php endif; ?>
              <?php endforeach; ?>

          <? endif;?>
            </ul>
            <a href="#" class="back-list" onclick="self.history.back(1)"><?php echo JText:: _('BACK_TO_THE_LIST');?></a>
          </div>

    </div>
</div>
4

1 回答 1

1

除非您启用了短标签,否则这一行 (#131) -

<? endif;?>

不会解析,结束你的if

但是您也只发布了 137 行代码,并且您的代码说它在第 147 行,所以可能还有另一个问题。

于 2012-12-25T08:17:36.993 回答