xoops forums

JCash

Just popping in
Posted on: 2011/12/4 13:03
JCash
JCash (Show more)
Just popping in
Posts: 66
Since: 2011/2/22
#1

Profile module - unclosed tag

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/>  &nbs ... nbsp;   //
//  ------------------------------------------------------------------------ //
//  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();

trabis

Core Developer
Posted on: 2011/12/4 14:14
trabis
trabis (Show more)
Core Developer
Posts: 2268
Since: 2006/9/1 1
#2

Re: Profile module - unclosed tag

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.

redheadedrod

Home away from home
Posted on: 2011/12/4 14:43
redheadedrod
redheadedrod (Show more)
Home away from home
Posts: 1296
Since: 2008/2/26
#3

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.

Mamba

Moderator
Posted on: 2011/12/4 18:37
Mamba
Mamba (Show more)
Moderator
Posts: 10966
Since: 2004/4/23
#4

Re: Profile module - unclosed tag

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

redheadedrod

Home away from home
Posted on: 2011/12/4 21:16
redheadedrod
redheadedrod (Show more)
Home away from home
Posts: 1296
Since: 2008/2/26
#5

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.