Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Professional Joomla! ISBN: 978-0-470-13394-1
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional Joomla! ISBN: 978-0-470-13394-1
This is the forum to discuss the Wrox book Professional Joomla! by Dan Rahmel; ISBN: 9780470133941
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Joomla! ISBN: 978-0-470-13394-1 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 18th, 2009, 04:16 PM
Registered User
 
Join Date: Apr 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chap 9 HelloWorld Plug problems.

Hi,

In Chapter 9 there is a HelloWorld Plugin that does not appear to work. I already found one problem in plgHelloWorld.php line 25 JEventDispatcher has been renamed JDispatcher. I get no errors with my typed in code or the code provided by the book. I also checked the the show intro text and it is on both globally and in each article. When I run Firebug in firefox I get no errors but I also see no sign that the code is running. This makes me suspect that there is something wrong with how the event is triggered but I can't figure out what. Here is the code:
PHP Code:
<?php
/**
* @version
* @package plgHelloWorld
*/

// No Direct Access
defined('_JEXEC') or die('Restricted Access');

class 
plgContentHelloWorld extends JPlugin {
    
// PHP4 compatible constructor
    
function plgContentHelloWorld( &$subject ) {
        
parent::__construct$subject );
    }
    
// Name function same as event so it will be called.
    
function onAfterDisplayTitle(& $article, & $params$limitstart=0) {
        
$myOutput "<h3>Hello World!</h3>";
         return 
$myOutput;
    }
}

// Instantiate the plug-in with an instance of the event dispatcher
$myPlugin =& new plgContentHelloWorldJDispatcher::getInstance());

?>
  #2 (permalink)  
Old June 2nd, 2009, 03:37 PM
Registered User
 
Join Date: May 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy I am having the same problem

I put some echos in the constuctor, onAfterDisplayTitle and at the bottom of the module, the module is loading but neither the constructor or the onAfterDisplayTitle is being called.
  #3 (permalink)  
Old June 26th, 2009, 08:33 PM
Registered User
 
Join Date: May 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Smile I think I found it

The onAfterDisplayTitle trigger output is only displayed when the summary text is configured to be hidden.I changed the trigger to onBeforeDisplayContent and it is working.
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plug-in for Outlook using C# AccessAasif@aol.com C# 2005 1 October 29th, 2008 05:27 PM
problem in helloworld progarmme in chapt 18 clnbabu BOOK Beginning Linux Programming, 3rd Edition 0 August 25th, 2007 04:54 AM
Problems with Chap. 17 pg.557 & 558 alk BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 2 August 19th, 2007 10:58 AM
Chap 10 FileSystemObject Problems orbbital BOOK: Beginning ASP 3.0 2 April 20th, 2005 11:19 AM
How to use the bootstrapper plug-in ? Help please! irnbru VS.NET 2002/2003 1 April 10th, 2005 04:36 PM



All times are GMT -4. The time now is 07:39 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.