New extension: referees stats (for 0.93)

you will find here.
User avatar
julienV
Joomleague Core Developer
Joomleague Core Developer
Posts: 2016
Joined: Tue Jun 19, 2007 9:27 am
Location: France
Contact:

New extension: referees stats (for 0.93)

Postby julienV » Tue Jul 22, 2008 2:30 pm

Hi all,

in response to Othon request here, I developed an extension to display referees on frontend, with some statistics.

Basically, it adds two pages to projects:
* one page listing referees: demo
* one profile page for each referee: demo

It is available for download here.
You can hire me, I'm a Joomla professional freelance developer.
Please contact me at jlv@jlv-solutions.com
NO PM, please use email !

Renegade
.
Posts: 317
Joined: Sat Apr 19, 2008 11:19 am
Contact:

Re: New extension: referees stats (for 0.93)

Postby Renegade » Tue Jul 22, 2008 3:23 pm

i have a problem with this one ...
i install this and use it as it is written in the readme.

now i add 2 events end a referee to a game-result. i add a url-link to the mainmenu with the link from the readme (index.php?option=com_joomleague&func=showprojectreferees&p=).
now in frontend i use these link, and it shows me a results & table site, and i can change the seasons on top of this, but neither referee-site as the demonstration site. only the name of the referee is displayed behind the game, i added the result and the events.
so what am I doing wrong?

[gelöscht durch Administrator]
Joomla! 1.0.15 Stable
Joomleague 0.93

User avatar
julienV
Joomleague Core Developer
Joomleague Core Developer
Posts: 2016
Joined: Tue Jun 19, 2007 9:27 am
Location: France
Contact:

Re: New extension: referees stats (for 0.93)

Postby julienV » Tue Jul 22, 2008 4:53 pm

have you selected the extension in your project properties ?
You can hire me, I'm a Joomla professional freelance developer.
Please contact me at jlv@jlv-solutions.com
NO PM, please use email !

Renegade
.
Posts: 317
Joined: Sat Apr 19, 2008 11:19 am
Contact:

Re: New extension: referees stats (for 0.93)

Postby Renegade » Tue Jul 22, 2008 5:05 pm

yes, referees-extention is selected in deseign template, and i wrote the id's for the events in "refereeextension" template settings
Joomla! 1.0.15 Stable
Joomleague 0.93

othonas
.
Posts: 46
Joined: Wed Apr 02, 2008 12:12 pm

Re: New extension: referees stats (for 0.93)

Postby othonas » Tue Jul 22, 2008 6:20 pm

i updated with the new version and its working fine.
the problem that the friend Renegade describes is visible only if there is no project id assigned in the (index.php?option=com_joomleague&func=showprojectreferees&p=). field.
in my page is index.php?option=com_joomleague&func=showprojectreferees&[b]p=12[b]
Last edited by othonas on Tue Jul 22, 2008 6:21 pm, edited 1 time in total.

Renegade
.
Posts: 317
Joined: Sat Apr 19, 2008 11:19 am
Contact:

Re: New extension: referees stats (for 0.93)

Postby Renegade » Tue Jul 22, 2008 7:23 pm

othonas wrote:i updated with the new version and its working fine.
the problem that the friend Renegade describes is visible only if there is no project id assigned in the (index.php?option=com_joomleague&func=showprojectreferees&p=). field.
in my page is index.php?option=com_joomleague&func=showprojectreferees&[b]p=12[b]


i made it with an project-id  ... now i made it again with ID, and now it works ......
and i don't know why it doesn't work at first time .... .... i will be old and blind  :bash:

good job ant thx for help

but it is possible to integrate this link in the navigation-module?
Last edited by Renegade on Tue Jul 22, 2008 7:25 pm, edited 1 time in total.
Joomla! 1.0.15 Stable
Joomleague 0.93

User avatar
johncage
.
Posts: 953
Joined: Fri May 11, 2007 11:49 pm
Location: Somewhere under the rainbow
Contact:

Re: New extension: referees stats (for 0.93)

Postby johncage » Tue Jul 22, 2008 8:10 pm

othonas wrote:i updated with the new version and its working fine.
the problem that the friend Renegade describes is visible only if there is no project id assigned in the (index.php?option=com_joomleague&func=showprojectreferees&p=). field.
in my page is index.php?option=com_joomleague&func=showprojectreferees&[b]p=12[b]


yes, and the reason is: yet nothing is shown in joomleague if no project id is provided...

EDIT:
PS.: except frontpage of course...
Last edited by johncage on Tue Jul 22, 2008 8:33 pm, edited 1 time in total.
Look, you've got it all wrong! You don't NEED to follow ME, You don't NEED to follow ANYBODY! You've got to think for your selves! You're ALL individuals!
So keep a clear head and always carry a lightbulb.

Renegade
.
Posts: 317
Joined: Sat Apr 19, 2008 11:19 am
Contact:

Re: New extension: referees stats (for 0.93)

Postby Renegade » Tue Jul 22, 2008 10:38 pm

i made a simple nav-mod integration (it only works for the project, which is in the settings under "Default Project ID" was registered, but it works  ;) )

how to use:

to integrate only the referees stats to the navigation module,
upload mod_joomleague_navigation_menu.xml to ../modules/


to integrate it and make an additional line in the nav-mod,
upload all files to ../modules/
now you have 17 instead of 16 lines available.

you find the new link just like all the other links (table, results....) in the nav-mod-settings at the end of the dropdown-menu (referees stats)


make backup before upload!

[gelöscht durch Administrator]
Last edited by Renegade on Tue Jul 22, 2008 10:54 pm, edited 1 time in total.
Joomla! 1.0.15 Stable
Joomleague 0.93

othonas
.
Posts: 46
Joined: Wed Apr 02, 2008 12:12 pm

Re: New extension: referees stats (for 0.93)

Postby othonas » Tue Jul 22, 2008 11:53 pm

Nice.  :thx:

Is it possible to integrate all seasons, all projects, in one ? I mean carrier stats for a referee.
For example ROBERTO ROSETTI will also play in Champions League. Why not have full stats for his carrier ?
Anyone?

Thanks
I tried something but without knowledge of php i need some hlp.
In models/projectreferee.php i changed the following line

class ModelProjectReferee {
  var $_ref = null;
  var $_project;
  var $_db;
  var $_ref_id;
  var $_params;
to

class ModelProjectReferee {

  var $_ref = null;
  var $_season;
  var $_db;
  var $_ref_id;
  var $_params;
and all [project;] word to [season;.] within the template



It works fine for every ref profile. You can see this in Peter Froijdfeldt profile where i put him to play a greek superleague game.

http://diaitisia.gr/component/option,co ... temid,202/

what code should i replace in the match retrieving info in order to show Date, Time, Project, Teams, score? or even ' GROUP BY project_id ';?

I ask for this because the same refs will play some play offs at the end of the regular season and i should create a new project. Any help welcome

Last edited by othonas on Tue Jul 22, 2008 11:56 pm, edited 1 time in total.

User avatar
johncage
.
Posts: 953
Joined: Fri May 11, 2007 11:49 pm
Location: Somewhere under the rainbow
Contact:

Re: New extension: referees stats (for 0.93)

Postby johncage » Wed Jul 23, 2008 12:38 am

othonas wrote:Nice.  :thx:

Is it possible to integrate all seasons, all projects, in one ? I mean carrier stats for a referee.
For example ROBERTO ROSETTI will also play in Champions League. Why not have full stats for his carrier ?
Anyone?

Thanks
I tried something but without knowledge of php i need some hlp.
In models/projectreferee.php i changed the following line

class ModelProjectReferee {
  var $_ref = null;
  var $_project;
  var $_db;
  var $_ref_id;
  var $_params;
to

class ModelProjectReferee {

  var $_ref = null;
  var $_season;
  var $_db;
  var $_ref_id;
  var $_params;
and all [project;] word to [season;.] within the template



It works fine for every ref profile. You can see this in Peter Froijdfeldt profile where i put him to play a greek superleague game.

http://diaitisia.gr/component/option,co ... temid,202/

what code should i replace in the match retrieving info in order to show Date, Time, Project, Teams, score? or even ' GROUP BY project_id ';?

I ask for this because the same refs will play some play offs at the end of the regular season and i should create a new project. Any help welcome



i actually don't know the code, but:

1) if you want to have season-wide stats, it should work to remove after a "WHERE" " project_id = ..." (or somehing like that)
2) if you want to have global stats, remove " project_id = ..." AND " season_id = ... " (if there is something like that... though i don't think so)

.... anyway, the first removal should do... though it is hard to tell without knowing code, of course. but if you know a bit about mysql (or try to learn about it) you'll know what i mean...
Look, you've got it all wrong! You don't NEED to follow ME, You don't NEED to follow ANYBODY! You've got to think for your selves! You're ALL individuals!
So keep a clear head and always carry a lightbulb.

othonas
.
Posts: 46
Joined: Wed Apr 02, 2008 12:12 pm

Re: New extension: referees stats (for 0.93)

Postby othonas » Wed Jul 23, 2008 12:54 am

Thanks for your reply. Actually i have site wide stats as mentioned in the above link and the picture attached.
the 3 first games are form EURO and the 4th match AEK - ΠΑΝΑΘΗΝΑΙΚΟΣ is from Greek Superleague.
I want to Group them by project id or the project name to be written next to date and time.
For example :
06/09/08 EURO 2008 21:45 NETHERLANDS - ITALY
06/15/08 EURO 2008 21:45 TURKEY - CZECH REPUBLIC
06/19/08 EURO 2008 21:45 PORTUGAL - GERMANY
08/31/08 SUPERLEAGUE GREECE 19:00 ΑΕΚ - ΠΑΝΑΘΗΝΑΙΚΟΣ

The code is this
function getGames()
  {
  if ( !$this->_games ) {     
    $query = ' SELECT m.* '
          . ' FROM #__joomleague_matches AS m '
          . ' WHERE m.referee_id='.$this->_ref_id
          . ' AND m.published = 1 '
          . ' ORDER BY m.match_date ASC'
          ;
    $this->_db->setQuery($query);
    $this->_games = $this->_db->loadObjectList();
  }
    return $this->_games;
  }
 
  function getEventGamesCount($event_id)
  {
    if ( !$this->_games ) return null;
    $ids = array();
    foreach($this->_games AS $g) {
      $ids[]=$g->match_id;
    }
   
    $query = ' SELECT COUNT(*) as `sum`, m.match_id FROM #__joomleague_matches as m '
            . ' INNER JOIN #__joomleague_match_events AS me ON me.match_id = m.match_id '
            . ' WHERE m.match_id IN ('.implode(",", $ids).') '
            . ' AND me.event_type_id = ' . $event_id
            . ' GROUP BY m.match_id ';
    $this->_db->setQuery($query);
    return $this->_db->loadObjectList('match_id');
  }


[gelöscht durch Administrator]
Last edited by othonas on Wed Jul 23, 2008 12:59 am, edited 1 time in total.

User avatar
johncage
.
Posts: 953
Joined: Fri May 11, 2007 11:49 pm
Location: Somewhere under the rainbow
Contact:

Re: New extension: referees stats (for 0.93)

Postby johncage » Wed Jul 23, 2008 1:22 am

othonas wrote:Thanks for your reply. Actually i have site wide stats as mentioned in the above link and the picture attached.
the 3 first games are form EURO and the 4th match AEK - ΠΑΝΑΘΗΝΑΙΚΟΣ is from Greek Superleague.
I want to Group them by project id or the project name to be written next to date and time.
For example :
06/09/08 EURO 2008 21:45 NETHERLANDS - ITALY
06/15/08 EURO 2008 21:45 TURKEY - CZECH REPUBLIC
06/19/08 EURO 2008 21:45 PORTUGAL - GERMANY
08/31/08 SUPERLEAGUE GREECE 19:00 ΑΕΚ - ΠΑΝΑΘΗΝΑΙΚΟΣ

The code is this
function getGames()
  {
  if ( !$this->_games ) {     
    $query = ' SELECT m.* '
           . ' FROM #__joomleague_matches AS m '
           . ' WHERE m.referee_id='.$this->_ref_id
           . ' AND m.published = 1 '
           . ' ORDER BY m.match_date ASC'
           ;
    $this->_db->setQuery($query);
    $this->_games = $this->_db->loadObjectList();
  }
    return $this->_games;
  }
 
  function getEventGamesCount($event_id)
  {
    if ( !$this->_games ) return null;
    $ids = array();
    foreach($this->_games AS $g) {
      $ids[]=$g->match_id;
    }
   
    $query = ' SELECT COUNT(*) as `sum`, m.match_id FROM #__joomleague_matches as m '
             . ' INNER JOIN #__joomleague_match_events AS me ON me.match_id = m.match_id '
             . ' WHERE m.match_id IN ('.implode(",", $ids).') '
             . ' AND me.event_type_id = ' . $event_id
             . ' GROUP BY m.match_id ';
    $this->_db->setQuery($query);
    return $this->_db->loadObjectList('match_id');
  }



ok, it is not in the class... try to remove the lines with // in following code (or comment the lines with // just like i did...:

function getGames()
  {
//     if ( !$this->_games ) {    
    $query = ' SELECT m.* '
           . ' FROM #__joomleague_matches AS m '
           . ' WHERE m.referee_id='.$this->_ref_id
           . ' AND m.published = 1 '
           . ' ORDER BY m.match_date ASC'
           ;
    $this->_db->setQuery($query);
    $this->_games = $this->_db->loadObjectList();
//     }
    return $this->_games;
  }

and if that doesn't do, there must be a function inside class called ModelProjectReferee ( what a name... :D ), would you post only the parameters, please, like

function ModelProjectReferee (...[parameters]...) {...

and find out where else the code ModelProjectReferee appears in the modified files, maybe then i can help you better...

but... I just reread the first post i answered to, if you create the playoffs inside the same project and set "count result?" to no, you should even be able to have playoff-matches inside the same project...

sorry, forgot to mention: i have to go to sleep right now... has been a long day... good night.
Last edited by johncage on Wed Jul 23, 2008 1:24 am, edited 1 time in total.
Look, you've got it all wrong! You don't NEED to follow ME, You don't NEED to follow ANYBODY! You've got to think for your selves! You're ALL individuals!
So keep a clear head and always carry a lightbulb.

othonas
.
Posts: 46
Joined: Wed Apr 02, 2008 12:12 pm

Re: New extension: referees stats (for 0.93)

Postby othonas » Wed Jul 23, 2008 1:26 am

I will try it now.
As for the playoffs they will be played in divisions for the first 5 teams and for the 5 (almost relegated) teams. So i have to create a division project.
I 'll post my results soon.
Thanks

It didn't work.
I go also to sleep now. I'll look at it tomorrow.
Thanks anyway
Last edited by othonas on Wed Jul 23, 2008 1:57 am, edited 1 time in total.

User avatar
julienV
Joomleague Core Developer
Joomleague Core Developer
Posts: 2016
Joined: Tue Jun 19, 2007 9:27 am
Location: France
Contact:

Re: New extension: referees stats (for 0.93)

Postby julienV » Wed Jul 23, 2008 3:15 pm

i updated the extension with season pages. just replace 'project' with 'season' in the url
You can hire me, I'm a Joomla professional freelance developer.
Please contact me at jlv@jlv-solutions.com
NO PM, please use email !

othonas
.
Posts: 46
Joined: Wed Apr 02, 2008 12:12 pm

Re: New extension: referees stats (for 0.93)

Postby othonas » Wed Jul 23, 2008 4:36 pm

Perfect. Exactly what i wanted.
Thank you Julien

Renegade
.
Posts: 317
Joined: Sat Apr 19, 2008 11:19 am
Contact:

Re: New extension: referees stats (for 0.93)

Postby Renegade » Thu Jul 24, 2008 12:44 am

julienV wrote:i updated the extension with season pages. just replace 'project' with 'season' in the url

and how must i do this, to make a working link for a season?? my seasons are called 2007/2008, or 2008/2009, but i don't have an id for a season....
so can you give me an example for a season-link?
Joomla! 1.0.15 Stable
Joomleague 0.93

othonas
.
Posts: 46
Joined: Wed Apr 02, 2008 12:12 pm

Re: New extension: referees stats (for 0.93)

Postby othonas » Thu Jul 24, 2008 1:05 am

hello again.
ok here is an example. the following link points EURO 2008 project
http://diaitisia.gr/component/option,co ... temid,201/
the next example point SUPERLEAGUE project
http://diaitisia.gr/component/option,co ... temid,202/

I have both projects in SEASON 2008-2009.
In this link http://diaitisia.gr/component/option,co ... eague/func,showseasonreferees/p,9/Itemid,204/ (no matter the p,9value, you can change it in my page in p,12, you can see both english and greek names. They are all referees for the SEASON 2008-2009.

If i change for example project EURO 2008 and place it in a new season let's say SEASON European championships, the greeks will dissapear from the list as they do not participate in any project of season European Championship. Even VASSARAS will dissapear. But in this case you have to create a new link component/option,com_joomleague/func,showseasonreferees/p,9/(there will be any project id of the season
Create these links and you will see
component/option,com_joomleague/func,showseasonreferees/p,(any project id of season 2007-2008)/ and
component/option,com_joomleague/func,showseasonreferees/p,(any project id of season 2008-2009/
You will receive different results.

I just registered to your page to see your links.
join the chat in your page if you are still in

Ok i saw your page
try to place Fandel in a game for season 2008-2009 in Champions League.
then point the url to option=com_joomleague&func=showseasonreferees&Itemid=29&p=8 and fandel will appear participating in two games
Last edited by othonas on Thu Jul 24, 2008 1:23 am, edited 1 time in total.

tangobet.com
.
Posts: 23
Joined: Mon Feb 25, 2008 2:38 pm

Re: New extension: referees stats (for 0.93)

Postby tangobet.com » Thu Jul 24, 2008 4:13 am

to make it perfect, i guess it would be cool to make a link like venues in the results page, to being able to click on a given ref in a game and display the stats for that ref. More cool even could be to put the stats (sum in your list) in a popup.

tangobet.com
.
Posts: 23
Joined: Mon Feb 25, 2008 2:38 pm

Re: New extension: referees stats (for 0.93)

Postby tangobet.com » Thu Jul 24, 2008 4:22 am

the list of refs can be sorted by lastnames?
check here: http://www.tangobet.com/index.php?optio ... &Itemid=26

all unsorted

User avatar
julienV
Joomleague Core Developer
Joomleague Core Developer
Posts: 2016
Joined: Tue Jun 19, 2007 9:27 am
Location: France
Contact:

Re: New extension: referees stats (for 0.93)

Postby julienV » Thu Jul 24, 2008 9:22 am

tangobet.com wrote:the list of refs can be sorted by lastnames?
check here: http://www.tangobet.com/index.php?optio ... &Itemid=26

all unsorted



ok, it's done and uploaded.
You can hire me, I'm a Joomla professional freelance developer.
Please contact me at jlv@jlv-solutions.com
NO PM, please use email !

Renegade
.
Posts: 317
Joined: Sat Apr 19, 2008 11:19 am
Contact:

Re: New extension: referees stats (for 0.93)

Postby Renegade » Thu Jul 24, 2008 1:28 pm

so.... i have a little template-problem with new version

on first site the position of the total events isn't correct

[gelöscht durch Administrator]
Joomla! 1.0.15 Stable
Joomleague 0.93

othonas
.
Posts: 46
Joined: Wed Apr 02, 2008 12:12 pm

Re: New extension: referees stats (for 0.93)

Postby othonas » Thu Jul 24, 2008 1:56 pm

i don't know why, but try to use the project 9 for the season 2008-2009 link
http://www.fubatipper.de/index.php?opti ... mid=29&p=9
It looks ok with this link.
Did you assigned all project with the template. And if yes, did you "played" with   
projectreferee.tpl
seasonreferee.tpl
refereeextension.tpl in all projects?
And something else. In seasonreferee.tpl uncheck the project heading. It is a season stat but shows Project Id in the header

[gelöscht durch Administrator]
Last edited by othonas on Thu Jul 24, 2008 2:01 pm, edited 1 time in total.

tangobet.com
.
Posts: 23
Joined: Mon Feb 25, 2008 2:38 pm

Re: New extension: referees stats (for 0.93)

Postby tangobet.com » Thu Jul 24, 2008 2:20 pm

JulienV is very hard to make links to ref pages? Like Venues? Best regards.

Renegade
.
Posts: 317
Joined: Sat Apr 19, 2008 11:19 am
Contact:

Re: New extension: referees stats (for 0.93)

Postby Renegade » Thu Jul 24, 2008 3:00 pm

othonas wrote:i don't know why, but try to use the project 9 for the season 2008-2009 link
http://www.fubatipper.de/index.php?opti ... mid=29&p=9
It looks ok with this link.
Did you assigned all project with the template. And if yes, did you "played" with     
projectreferee.tpl
seasonreferee.tpl
refereeextension.tpl in all projects?
And something else. In seasonreferee.tpl uncheck the project heading. It is a season stat but shows Project Id in the header

if i use this link (id 9) ..... -> Restricted Access

all projects assign with the template, and i have all 3 templates in all projects
Joomla! 1.0.15 Stable
Joomleague 0.93

tangobet.com
.
Posts: 23
Joined: Mon Feb 25, 2008 2:38 pm

Re: New extension: referees stats (for 0.93)

Postby tangobet.com » Thu Jul 24, 2008 3:16 pm

Sorting by a given event? yellow cards, red cards? like event stats??????'

othonas
.
Posts: 46
Joined: Wed Apr 02, 2008 12:12 pm

Re: New extension: referees stats (for 0.93)

Postby othonas » Thu Jul 24, 2008 3:45 pm

Renegade wrote:
othonas wrote:i don't know why, but try to use the project 9 for the season 2008-2009 link
http://www.fubatipper.de/index.php?opti ... mid=29&p=9
It looks ok with this link.
Did you assigned all project with the template. And if yes, did you "played" with   
projectreferee.tpl
seasonreferee.tpl
refereeextension.tpl in all projects?
And something else. In seasonreferee.tpl uncheck the project heading. It is a season stat but shows Project Id in the header

if i use this link (id 9) ..... -> Restricted Access

all projects assign with the template, and i have all 3 templates in all projects


There is a mistake in your link. there is a repeating http://www.fubatipper.de/index.php?option=http://www.fubatipper.de/index.php?option=com_joomleague&func=showseasonreferees&Itemid=29&p=9

remove the bold and will be fine

tangobet.com
.
Posts: 23
Joined: Mon Feb 25, 2008 2:38 pm

Re: New extension: referees stats (for 0.93)

Postby tangobet.com » Thu Jul 24, 2008 4:45 pm

in ref page: http://www.tangobet.com/copa-santander- ... 08-14.html could we put a link to match report instead of match score? (i mean a link to match_id instead the result page), could be a link in the name of the match or even at the left (where the round of the match is linked).

Renegade
.
Posts: 317
Joined: Sat Apr 19, 2008 11:19 am
Contact:

Re: New extension: referees stats (for 0.93)

Postby Renegade » Thu Jul 24, 2008 5:46 pm

othonas wrote:There is a mistake in your link. there is a repeating http://www.fubatipper.de/index.php?option=http://www.fubatipper.de/index.php?option=com_joomleague&func=showseasonreferees&Itemid=29&p=9

remove the bold and will be fine

oups  :confused: .... my fault
Joomla! 1.0.15 Stable
Joomleague 0.93

User avatar
julienV
Joomleague Core Developer
Joomleague Core Developer
Posts: 2016
Joined: Tue Jun 19, 2007 9:27 am
Location: France
Contact:

Re: New extension: referees stats (for 0.93)

Postby julienV » Thu Jul 24, 2008 5:48 pm

* added link to referee from results and calendars
* added link to game reports from referee page (on game result)

I'm not sure I'll have much more time to spend on this people... it was supposed to be a small work ;)
You can hire me, I'm a Joomla professional freelance developer.
Please contact me at jlv@jlv-solutions.com
NO PM, please use email !

tangobet.com
.
Posts: 23
Joined: Mon Feb 25, 2008 2:38 pm

Re: New extension: referees stats (for 0.93)

Postby tangobet.com » Thu Jul 24, 2008 6:33 pm

now we need to make a module with this julien v and completed work  :lol:


Return to “Tips, Tricks, SourceCodeChanges”

Who is online

Users browsing this forum: Baidu [Spider] and 2 guests

cron