Extension for statistic does not work as expected

Extensions / Customization for JoomLeague 1.6.
hansnix
Donator
Donator
Posts: 57
Joined: Sat Oct 29, 2011 9:16 pm

Extension for statistic does not work as expected

Postby hansnix » Wed Jan 04, 2012 9:10 pm

Hi,

I created a new statistic bases on "pergame.php and pergame.xml" and named it "avgonbest.php and avgon.xml". I modified the files to match my needs and placed the two files next to the other once it:

administrator\components\com_joomleague\statistics

All works fine and I can create my new statistic named "avgonbest".
Then "timoline" recommends to add these new files as an extension.

So I created a directory:

components\com_joomleague\extensions\shooting\admin\statistics\

and moved the "avgonbest.php and avgonbest.xml" to that directory.

But when I create a new statistic using that type then I get a corrupt page. I see Joomleague menues but the style is corrupt. The same happens when I try to edit the just created stat. I am not able to edit it.
after_create_stat.png


If I move the two files back to the original folder then all works again.

I thought that I have a bug in my scripts but then I made the following test:

I moved the original "pergame.php and pergame.xml" from

administrator\components\com_joomleague\statistics

to

components\com_joomleague\extensions\shooting\admin\statistics\


And tried to create a new stat with type "pergame". But now the same corrupt page occures.

In addition I see two behaviours which doesn't seem to be correct:

1.)
If I leave "pergame.php and pergame.xml" in administrator\components\com_joomleague\statistics
and copy them to
components\com_joomleague\extensions\shooting\admin\statistics\
then I expected that the files in the extension directory would "overwrite" the files in other "original" directory. But when I try to create a new stat I see two "pergame" types in the selection box. I would expect only one (the one from the extension directory).

2.)
It is written in the wiki that all extension are included by default.
If I take a look to "project-settings" then I do see "shooting" listed in the "exclude extension" field. I found no way to delete "shoting" from the filed via the browser.

Hans
You do not have the required permissions to view the files attached to this post.

User avatar
timoline
Joomleague Core Developer, Donator
Joomleague Core Developer, Donator
Posts: 3331
Joined: Thu Mar 12, 2009 8:03 am
Contact:

Re: Extension for statistic does not work as expected

Postby timoline » Wed Jan 04, 2012 9:33 pm

can you share this extension, so we can have a look at it?

@and_one (or julienv), is statistics included in the extension framework?

I took a test and see this errors:
Warning: require_once(base.php) [function.require-once]: failed to open stream: No such file or directory in D:\jl\joomleague\com_joomleague\components\com_joomleague\extensions\test\admin\statistics\pergame2.php on line 15

Fatal error: require_once() [function.require]: Failed opening required 'base.php' (include_path='.;C:\php\pear') in D:\jl\joomleague\com_joomleague\components\com_joomleague\extensions\test\admin\statistics\pergame2.php on line 15

so path to base.php is incorrect
Joomla 1.5.x
Joomleague 1.5.....latest git version

hansnix
Donator
Donator
Posts: 57
Joined: Sat Oct 29, 2011 9:16 pm

Re: Extension for statistic does not work as expected

Postby hansnix » Wed Jan 04, 2012 10:18 pm

I attached the files.

Info: they are not 100% ready yet.
I still have include the number_to_count to the php file.
But they work with the fixed number for the 4 best results to count.

Hans
You do not have the required permissions to view the files attached to this post.

User avatar
timoline
Joomleague Core Developer, Donator
Joomleague Core Developer, Donator
Posts: 3331
Joined: Thu Mar 12, 2009 8:03 am
Contact:

Re: Extension for statistic does not work as expected

Postby timoline » Fri Jan 13, 2012 4:12 pm

you have tto change the path to base.php

like

require_once(JLG_PATH_ADMIN.DS.'statistics'.DS.'base.php');

http://bugtracker.joomleague.at/issues/1212
Joomla 1.5.x
Joomleague 1.5.....latest git version

User avatar
timoline
Joomleague Core Developer, Donator
Joomleague Core Developer, Donator
Posts: 3331
Joined: Thu Mar 12, 2009 8:03 am
Contact:

Re: Extension for statistic does not work as expected

Postby timoline » Tue Jan 17, 2012 8:19 am

It should work now as expected :thx:
Joomla 1.5.x
Joomleague 1.5.....latest git version

hansnix
Donator
Donator
Posts: 57
Joined: Sat Oct 29, 2011 9:16 pm

Re: Extension for statistic does not work as expected

Postby hansnix » Sun Jan 22, 2012 8:59 pm

Great, it works!

Thanks.

Hans

And_One
Joomleague Project Manager, Donator
Joomleague Project Manager, Donator
Posts: 3609
Joined: Fri Sep 11, 2009 4:00 pm
Joomleague version: 2.0.x
Location: Graz
Contact:

Re: Extension for statistic does not work as expected

Postby And_One » Mon Feb 06, 2012 11:03 pm

As this seems to be resolved, would you like to create a new topic with an explanation of your new statistic and what it does in detail ?

User avatar
timoline
Joomleague Core Developer, Donator
Joomleague Core Developer, Donator
Posts: 3331
Joined: Thu Mar 12, 2009 8:03 am
Contact:

Re: Extension for statistic does not work as expected

Postby timoline » Sun Apr 01, 2012 12:55 pm

hi hansnix,
would you like to share your new stat?
Joomla 1.5.x
Joomleague 1.5.....latest git version


Return to “Extensions / Customizations”

Who is online

Users browsing this forum: No registered users and 1 guest

cron