JEvents 1.5 (No longer actively supported)

Modifying latest module  Topic is solved

JEvents 2.0 was launched over 2 years ago and the latest stable version is version 2.2 which will run on Joomla 1.5 and Joomla 2.5. JEvents 1.5 is therefore no longer actively supported - you should upgrade to JEvents 2.2+ as soon as possible.
Forum rules
Please include as much detail in any test or bug reports for JEvents 1.5 as possible.

First of all, check if you are running the latest available version of Joomla! and JEvents. Posts for issues, where both systems are not updated, will be ignored.

We need the following at least:

* PHP version (e.g. 5.2.5). Note: Support for PHP4 is discontinued.
* Joomla! version
* JEvents version
* Web Server software (Apache or IIS with version number if possible)
* Server Operating system (e.g. Linux, Windows, Solaris, Darwin ...)
* Database version
* memory_limit from your phpinfo
* Web browser and version

Please enable error reporting and include any error messages in your posting. You do this via the Joomla Configuration - set "error reporting" to "maximum" on the Server tab.

Finally, please describe the steps required to recreate the problem and also please enable error reporting and give us any error messages generated.

Postby JohanH » Wed Feb 02, 2011 9:28 pm

Hi,

I need some advice about how to modify the latest_events module.

I have successfully copied the default/latest.php and the alternative/latest.php. I have made some modifications which works fine.

Now I wanted to change the 'createdByUserName' option in the custom format string to display the full name of the user, not the username. Doing the change was easy and worked fine. Then I thought that I would like to add the option to the custom format string ('createdByName') without removing the other.

Here is what I did:
1. Added 'createdByName' to the $keywords array in the default/latest.php
Code: Select all
$keywords = array(
   'content',   'eventDetailLink',   'createdByAlias',      'color',
   'createdByUserName',   'createdByName',      'createdByUserEmail',   'createdByUserEmailLink',
   'eventDate',   'endDate',      'startDate',   'title',   'category',
   'contact',   'addressInfo',   'location',            'extraInfo',
   'countdown'
);


2. Added the option in the switch statement in displayLatestEvents function in both default and alternative latest.php.
Code: Select all
case 'createdByName':
   $catobj   = JEVHelper::getUser($dayEvent->created_by());
   $content .= isset($catobj->name)?$catobj->name:"";
   break;


Using this new option I only get an empty string.
Now since this did work when changing the existing keyword, I am struggling to see what I have missed to make this work.

Regards, Johan

PHP-version: 5.3.5
Joomla! version: Joomla! 1.5.15 Stable
JEvents version: 1.5.5b 1871
Webbserver: Apache
Server OS: Linux srv73 2.6.26-2-vserver-amd64
Database version: 5.0.51a-24+lenny5-log
Memory limit: 32M
Webbrowser: Google Crome 8.0.552.237
JohanH
 
Posts: 6
Joined: Tue Jan 25, 2011 11:04 pm

Postby Geraint » Thu Feb 03, 2011 10:50 am

Looks ok to me

Try putting xxx instead of the "" to make sure its running.
JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!
User avatar
Geraint
 
Posts: 42799
Joined: Fri Feb 15, 2008 6:14 pm

Postby JohanH » Thu Feb 03, 2011 8:15 pm

Hi,

Adding "xxx" as the empty option did not help... after some more investigation it seems like the custom string parsing does not recognize the new keyword and thus is never matched in the switch statement.

I'll try to set up my develop environment and debug it, but that will take some time. I'll get back to you with my findings.

Regards, Johan
JohanH
 
Posts: 6
Joined: Tue Jan 25, 2011 11:04 pm

Postby Geraint » Fri Feb 04, 2011 10:32 am

I suspect the override is not being loaded at all
JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!
User avatar
Geraint
 
Posts: 42799
Joined: Fri Feb 15, 2008 6:14 pm

Postby JohanH » Fri Feb 04, 2011 12:01 pm

If you mean the template overload (i.e. alternative/latest.php) it is, I've been modifying it to figure out what is happening and those modifications has worked.

If the same is true for the processFormatString() method I do not know.

Regards, Johan
JohanH
 
Posts: 6
Joined: Tue Jan 25, 2011 11:04 pm

Postby JohanH » Mon Feb 07, 2011 10:04 pm

Problem solved!

I'm kind of embarrassed to admit that the default/latest.php was for some reason not updated remotely. I figured this out setting up my debug environment on my other computer, downloading my changed files only to notice that one of them was not changed at all.... turns out you where right, the override was not loaded ;)

Sorry if I caused any trouble.

Regards, Johan
JohanH
 
Posts: 6
Joined: Tue Jan 25, 2011 11:04 pm

Postby reditech » Sun Mar 25, 2012 4:25 am

Great help as this was exactly what I was after too. I updated the script so it would work with the latest version changing JEVHelper to JFactory as is shown below.

Code: Select all
case 'createdByName':
   $catobj   = JFactory::getUser($dayEvent->created_by());
   $content .= isset($catobj->name)?$catobj->name:"";
   break;
reditech
 
Posts: 22
Joined: Sat Mar 24, 2012 6:27 am

Postby reditech » Sun Mar 25, 2012 7:11 am

Hi

Am wondering if anyone has done the same for event detail layout and included the name rather than username.
reditech
 
Posts: 22
Joined: Sat Mar 24, 2012 6:27 am

Postby Geraint » Mon Mar 26, 2012 8:59 am

See the function getUserMailtoLink in compoments/com_jevents/libraries/jeventshtml.hpp line c. 567

Remember to keep a note of customisations of this file since and upgrade will overwrite it.
JEvents Club members can get priority forum support at the Support Forum. As well as access to a variety of custom JEvents addons and benefits. Join the JEvents club today!
User avatar
Geraint
 
Posts: 42799
Joined: Fri Feb 15, 2008 6:14 pm

Postby reditech » Mon Mar 26, 2012 12:17 pm

Not sure I follow. I am wanting to put the user's Full name as it is in the user list, not the username they login with or their email address.

Thanks
reditech
 
Posts: 22
Joined: Sat Mar 24, 2012 6:27 am

Next

Return to JEvents 1.5 (No longer actively supported)

  • Who is online
  • View new posts
  • View unanswered posts
  • In total there are 0 users online :: 0 registered and 0 hidden (based on users active over the past 5 minutes)
  • Most users ever online was 94 on Tue Sep 01, 2009 12:33 am
  • Users browsing this forum: No registered users