unexpected T_PROTECTED on line 3

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
masterblaster
Forum Newbie
Posts: 10
Joined: Mon Jul 25, 2011 11:33 am

unexpected T_PROTECTED on line 3

Post by masterblaster »

Line 3 isn't correct? :crazy:
why?why?

Code: Select all

<?php
// The general information at the top of each file
/**
* @version    4.0.7 Release for Joomla 2.5
* @package    Joomla
* @copyright  Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license    GNU General Public License, see LICENSE.php
*/
 
// No direct access allowed to this file
defined( '_JEXEC' ) or die( 'Restricted access' );
 
// Import Joomla! Plugin library file
jimport('joomla.plugin.plugin');
// import panes
jimport('joomla.html.pane');
// import WeblinksHelperRoute
require_once JPATH_ROOT.'/components/com_weblinks/helpers/route.php';

//The Content plugin AllWeblinks
class plgContentAllWeblinks  extends JPlugin
{
	// plugin parameters 
	// _plgContentAllWeblinksReplace will set the values;
	protected $days_new;
	protected $txt_new;
	protected $days_mod;
	protected $txt_mod;
	protected $lengthoftitle;
	protected $orderby;
	protected $Corderby;
	protected $linkcount;	
	protected $displayemptycat;		
		// These params can also be overridden in the commmandline
	protected $real_url;
	protected $show_title;
	protected $show_new;
	protected $show_mod;
	protected $show_hits;
	protected $new_window;
	protected $moduleclass_sfx;
	protected $num_cols;
	protected $layout;
	protected $show_header;
	protected $show_cdate;
	protected $show_mdate;
	protected $show_author;
	protected $display_cdescription;
	protected $display_ldescription;
	protected $DEBUG = 0;
	protected $exclude_id = 0;
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: unexpected T_PROTECTED on line 3

Post by requinix »

Code: Select all

/**
That is line 3.

Are you looking at the right file? Right line number?
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: unexpected T_PROTECTED on line 3

Post by Celauran »

Also, line 3 of what? You've got at least three other files being included here.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: unexpected T_PROTECTED on line 3

Post by Christopher »

Yes, look for a file where line 3 is a protected property declaration.
(#10850)
masterblaster
Forum Newbie
Posts: 10
Joined: Mon Jul 25, 2011 11:33 am

Re: unexpected T_PROTECTED on line 3

Post by masterblaster »

Sorry guys. The right file is:
<?php// The general information at the top of each file/*** @version 4.0.7 Release for Joomla 2.5* @package Joomla* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.* @license GNU General Public License, see LICENSE.php*/ // No direct access allowed to this filedefined( '_JEXEC' ) or die( 'Restricted access' ); // Import Joomla! Plugin library filejimport('joomla.plugin.plugin');// import panesjimport('joomla.html.pane');// import WeblinksHelperRouterequire_once JPATH_ROOT.'/components/com_weblinks/helpers/route.php';//The Content plugin AllWeblinksclass plgContentAllWeblinks extends JPlugin{ // plugin parameters
// _plgContentAllWeblinksReplace will set the values; protected $days_new; protected $txt_new; protected $days_mod; protected $txt_mod; protected $lengthoftitle; protected $orderby; protected $Corderby; protected $linkcount; protected $displayemptycat; // These params can also be overridden in the commmandline protected $real_url; protected $show_title; protected $show_new; protected $show_mod; protected $show_hits;

protected $new_window;
protected $moduleclass_sfx;
protected $num_cols;
protected $layout;
protected $show_header;
protected $show_cdate;
protected $show_mdate;
protected $show_author;
protected $display_cdescription;
protected $display_ldescription;
protected $DEBUG = 0;
protected $exclude_id = 0;

The blue line "protected $new_window;" is the line 3
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: unexpected T_PROTECTED on line 3

Post by requinix »

Ah.

You see how the first line is all smashed together? That's bad. You need to undo that. Use that first version you posted earlier.

The problem is the line comment. You effectively have

Code: Select all

<?php //

protected $new_window;
...
which is clearly not what it should be.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: unexpected T_PROTECTED on line 3

Post by Christopher »

This looks better!

Code: Select all

<?php
// The general information at the top of each file
/*** 
@version    4.0.7 Release for Joomla 2.5* 
@package    Joomla* 
@copyright  Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.* 
@license    GNU General Public License, see LICENSE.php
*/
 // No direct access allowed to this file
defined( '_JEXEC' ) or die( 'Restricted access' );
 // Import Joomla! Plugin library file
jimport('joomla.plugin.plugin');
// import panes
jimport('joomla.html.pane');
// import WeblinksHelperRoute
require_once JPATH_ROOT.'/components/com_weblinks/helpers/route.php';
//The Content plugin AllWeblinks
class plgContentAllWeblinks  extends JPlugin
{
	// plugin parameters 
	// _plgContentAllWeblinksReplace will set the values;
	protected $days_new;
	protected $txt_new;
	protected $days_mod;
	protected $txt_mod;
	protected $lengthoftitle;
	protected $orderby;
	protected $Corderby;
	protected $linkcount;
	protected $displayemptycat;
	// These params can also be overridden in the commmandline
	protected $real_url;
	protected $show_title;
	protected $show_new;
	protected $show_mod;
	protected $show_hits;
	
        protected $new_window;
        protected $moduleclass_sfx;	
        protected $num_cols;	
        protected $layout;	
        protected $show_header;	
        protected $show_cdate;	
        protected $show_mdate;
        protected $show_author;
        protected $display_cdescription;
        protected $display_ldescription;	
        protected $DEBUG = 0;	
        protected $exclude_id = 0;
(#10850)
masterblaster
Forum Newbie
Posts: 10
Joined: Mon Jul 25, 2011 11:33 am

Re: unexpected T_PROTECTED on line 3

Post by masterblaster »

Thx Christopher and requinix.
All right. [SOLVED]
Post Reply