2

I am getting the below error:

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

What could be the possible solution, I searched a number of posts, I do use <?php ?> No opening and closing bracket issues and no quote issues.

Is there anything else which could cause this problem?

My code is like below,

  <?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>
3
  • 3
    What's the code look like? Are you sure all the braces match? As you have noted, this is almost always caused by mismatched braces. Are you using a code editor with brace matching features? Is the code clearly indented? Commented Dec 25, 2012 at 8:01
  • Use pastebin.com to show the default.php page. It is not possible to help you without code. Commented Dec 25, 2012 at 8:06
  • Hello I have added code, Please help me out Commented Dec 25, 2012 at 8:16

1 Answer 1

1

Unless you have short tags enabled, this line (#131) -

<? endif;?>

will not parse, ending your if

But you have also only posted 137 lines of code, and your code said it is on line #147, so there might be another issue.

Sign up to request clarification or add additional context in comments.

1 Comment

Hey Thanks so much!!! I used a php short tag at line 137 :) thanks so much it took me around 5 hrs to get this done ..:) and oh even if the code says 147 line number, still the error can be on any line for this particular error :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.