WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: LeagueManager] Widget Problems (5 posts)

  1. basilfx
    Member
    Posted 4 years ago #

    Hi,

    I tried to implement LeagueManager 3.4-rc2 (also development) in WordPress 2.8.4, but I have some problems with the widget in the sidebar.

    I made a competition with several matches, but when I click the blue arrow, it does not show the next one. I also noticed it does not work with NEXTGen Gallery (latest version), but when I disable this plugin, I still don't get any results.

    After some debugging I found this line where the problems occour (ajax.php Line 50):
    $lmWidget->setMatchIndex( $index, $element );

    The var $lmWidget is not defined and it then crashes. It returns nothing to the AJAX response. I also noticed this line (ajax.php Line 62):
    $match_box = $lmWidget->showPrevMatchBox($widget_number, $league_id, $season, $match_limit, false);

    It specifies 5 arguments to the function showPrevMatchBox, but the declaration only defined 3 in widget.php Line 135.

    Is there some fix for this problem? I tried googeling for this problem, but the only thing I found whas that WordPress 2.8 uses another widget system. The plugin information specifies it is compatible with 2.8.

    Thanks in advance!

    http://wordpress.org/extend/plugins/leaguemanager/

  2. chinocharles
    Member
    Posted 4 years ago #

    Same problem here. Free bump in hopes of a fix.

  3. aledan
    Member
    Posted 4 years ago #

    Same here. Anyone have a fix? Thanks!

  4. cyclopes
    Member
    Posted 4 years ago #

    Quick fix:

    in lib/ajax.php

    line 38:
    add

    require_once('widget.php');
    if (!isset($lmWidget))
    $lmWidget = new LeagueManagerWidget();

    line 44-50:
    modify

    $current = $_POST['current'];
    $element = $_POST['element'];
    $operation = $_POST['operation'];
    $league_id = $_POST['league_id'];
    $match_limit = ( $_POST['match_limit'] == 'false' ) ? false : $_POST['match_limit'];
    $widget_number = $_POST['widget_number'];
    $season = $_POST['season'];

    to

    $current = $_POST['current'];
    $element = $_POST['element'];
    $operation = $_POST['operation'];
    $instance['league'] = $_POST['league_id'];
    $instance['match_limit'] = ( $_POST['match_limit'] == 'false' ) ? false : $_POST['match_limit'];
    $widget_number = $_POST['widget_number'];
    $instance['season'] = $_POST['season'];

    line 62:
    modify

    $match_box = $lmWidget->showNextMatchBox($widget_number, $league_id, $season, $match_limit, false);

    to

    $match_box = $lmWidget->showNextMatchBox($widget_number, $instance, false);

    line 66
    modify:

    $match_box = $lmWidget->showPrevMatchBox($widget_number, $league_id, $season, $match_limit, false);

    to

    $match_box = $lmWidget->showPrevMatchBox($widget_number, $instance, false);

    in lib/widget.php

    line 141:
    add

    if (!isset($instance['date_format']) || empty($instance['date_format']))
    $instance['date_format'] = 'l jS F';

    (update the date_format string with that of your choice).

    Should get it working until we get a fix.

  5. aledan
    Member
    Posted 4 years ago #

    Thanks a lot!

Topic Closed

This topic has been closed to new replies.

About this Topic