1
JCash
Profile module - unclosed tag
  • 2011/12/4 13:03

  • JCash

  • Just popping in

  • Posts: 66

  • Since: 2011/2/22


hi

www/modules/profile/admin/index.php, seems there is a ?> missing ?

<?php
// $Id: index.php 8066 2011-11-06 05:09:33Z beckmi $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
// Author: Raul Recio (AKA UNFOR)                                            //
// Project: The XOOPS Project                                                //
// ------------------------------------------------------------------------- //

include_once 'admin_header.php';
xoops_cp_header();

$indexAdmin = new ModuleAdmin();
//-----------------------
// $xpPartnerHandler =& xoops_getmodulehandler('partners', $xoopsModule->getVar('dirname'));

// $totalPartners = $xpPartnerHandler->getCount();
// $totalNonActivePartners = $xpPartnerHandler->getCount(new Criteria('status', 0, '='));
// $totalActivePartners = $totalPartners - $totalNonActivePartners;

// $indexAdmin->addInfoBox(_MD_XPARTNERS_DASHBOARD);

// $indexAdmin->addInfoBoxLine(_MD_XPARTNERS_DASHBOARD, "<infolabel>" ._MD_XPARTNERS_TOTALACTIVE. "</infolabel>", $totalActivePartners, 'Green');
// $indexAdmin->addInfoBoxLine(_MD_XPARTNERS_DASHBOARD,  "<infolabel>" ._MD_XPARTNERS_TOTALNONACTIVE. "</infolabel>", $totalNonActivePartners, 'Red');
// $indexAdmin->addInfoBoxLine(_MD_XPARTNERS_DASHBOARD,  "<infolabel>" ._MD_XPARTNERS_TOTALPARTNERS. "</infolabel><infotext>", $totalPartners."</infotext>");
//----------------------------

echo $indexAdmin->addNavigation('index.php');
echo 
$indexAdmin->renderIndex();

include 
'admin_footer.php';
//xoops_cp_footer();

2
trabis
Re: Profile module - unclosed tag
  • 2011/12/4 14:14

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Hi,

There is no need to include ?>

We are removing them in all 2.6.0 files. It avoids problems with extra spaces after the ?> tag.

Sometimes users edit core files and accidentally let a blank space after ?> tag, that cause problems with layout and also with http headers. An extra blank space is enough for cookies not being set anymore and is very hard to find where the problem is. Less ?> means less problems.

Some people would disagree on this, saying that it is bad code practice, typical of lazy developers. I can ear hervet screaming now :)

Zend Framework does not use ?>, we are trying to keep close with Zend coding standards.

3
redheadedrod
Re: Profile module - unclosed tag

Zend for those that are not aware are the creators of PHP and what trabis is talking about is the coding standard from Zend (Zend Framework or not) is that the closing ?> tag that is at the bottom of a PHP file is not required. The closing tag is only required when the code is inline and there is other, non-php, code following on the page.
Attending College working towards Bachelors in Software Engineering and Network Security.

4
Mamba
Re: Profile module - unclosed tag
  • 2011/12/4 18:37

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


Quote:
Zend for those that are not aware are the creators of PHP

Not exactly. They are the current "maintainer" of PHP, but the creator is Rasmus Lerdorf.

I met him in April this year:

Resized Image

Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

5
redheadedrod
Re: Profile module - unclosed tag

Current Caretakers would probably be the best description. But anything new coming out of the PHP front will be coming from the Zend group.

But yes you are right there Mamba, thanks for the correction.

Rodney
Attending College working towards Bachelors in Software Engineering and Network Security.

Login

Who's Online

156 user(s) are online (119 user(s) are browsing Support Forums)


Members: 0


Guests: 156


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits