Events Made Easy Forums Bug fixed or feature request implemented Suggested "eme_events.php" Mod to Prevent Page Number Centering Change

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #42371
    Anonymous
    Inactive

    I suggest replacing lines 830 through 840 in “eme_events.php” with the following code to keep the event list page number centered on the first page of event listings.

    if ($backward >= 0)
    $pagination_top.= "<a class='eme_nav_left' href='" . $this_page_url.$joiner."eme_offset=$backward'><< $prev_text</a>";
    else
    $pagination_top.= "<a class='eme_nav_left' style='visibility:hidden;' href='" . $this_page_url.$joiner."eme_offset=$backward'><< $prev_text</a>";
    $pagination_top.= "<span class='eme_nav_center'>".__('Page ','eme').$page_number."</span>";
    $pagination_top.= "<a class='eme_nav_right' href='" . $this_page_url.$joiner."eme_offset=$forward'>$next_text >></a>";
    }
    if ($events_count <= $limit && $offset>0) {
    $backward = $offset - $limit;
    if ($backward >= 0)
    $pagination_top.= "<a class='eme_nav_left' style='visibility:hidden;' href='" . $this_page_url.$joiner."eme_offset=$backward'><< $prev_text</a>";
    else
    $pagination_top.= "<a class='eme_nav_left' href='" . $this_page_url.$joiner."eme_offset=$backward'><< $prev_text</a>";
    $pagination_top.= "<span class='eme_nav_center'>".__('Page ','eme').$page_number."</span>";
    }

    P.S. Sorry about the lousy formatting. bbpress has a mind of its own!

    #45957
    Franky
    Keymaster

    I see what you mean, but wouldn’t this be better then:

    if ($paging==1 && $limit>0) {
    $prev_text=__('Previous page','eme');
    $next_text=__('Next page','eme');
    $page_number = floor($offset/$limit) + 1;
    $this_page_url=get_permalink($post->ID);
    if (stristr($this_page_url, "?"))
    $joiner = "&";
    else
    $joiner = "?";
    $left_nav_hidden_class="";
    $right_nav_hidden_class="";
    if ($events_count > $limit) {
    $forward = $offset + $limit;
    $backward = $offset - $limit;
    if ($backward < 0)
    $left_nav_hidden_class="style='visibility:hidden;'";
    }
    if ($events_count <= $limit && $offset>0) {
    $backward = $offset - $limit;
    if ($backward < 0)
    $left_nav_hidden_class="style='visibility:hidden;'";
    $right_nav_hidden_class="style='visibility:hidden;'";
    }
    $pagination_top.= "<a class='eme_nav_left' $left_nav_hidden_class href='" . $this_page_url.$joiner."eme_offset=$backward'><< $prev_text</a>";
    $pagination_top.= "<span class='eme_nav_center'>".__('Page ','eme').$page_number."</span>";
    $pagination_top.= "<a class='eme_nav_right' $right_nav_hidden_class href='" . $this_page_url.$joiner."eme_offset=$forward'>$next_text >></a>";
    }

    #45958
    Franky
    Keymaster

    Better (otherwise you have pagination when it’s not needed):

    if ($paging==1 && $limit>0) {
    $prev_text=__('Previous page','eme');
    $next_text=__('Next page','eme');
    $page_number = floor($offset/$limit) + 1;
    $this_page_url=get_permalink($post->ID);
    if (stristr($this_page_url, "?"))
    $joiner = "&";
    else
    $joiner = "?";
    $left_nav_hidden_class="";
    $right_nav_hidden_class="";
    if ($events_count > $limit) {
    $forward = $offset + $limit;
    $backward = $offset - $limit;
    if ($backward < 0)
    $left_nav_hidden_class="style='visibility:hidden;'";
    $pagination_top.= "<a class='eme_nav_left' $left_nav_hidden_class href='" . $this_page_url.$joiner."eme_offset=$backward'><< $prev_text</a>";
    $pagination_top.= "<span class='eme_nav_center'>".__('Page ','eme').$page_number."</span>";
    $pagination_top.= "<a class='eme_nav_right' $right_nav_hidden_class href='" . $this_page_url.$joiner."eme_offset=$forward'>$next_text >></a>";
    }
    if ($events_count <= $limit && $offset>0) {
    $backward = $offset - $limit;
    if ($backward < 0)
    $left_nav_hidden_class="style='visibility:hidden;'";
    $right_nav_hidden_class="style='visibility:hidden;'";
    $pagination_top.= "<a class='eme_nav_left' $left_nav_hidden_class href='" . $this_page_url.$joiner."eme_offset=$backward'><< $prev_text</a>";
    $pagination_top.= "<span class='eme_nav_center'>".__('Page ','eme').$page_number."</span>";
    $pagination_top.= "<a class='eme_nav_right' $right_nav_hidden_class href='" . $this_page_url.$joiner."eme_offset=$forward'>$next_text >></a>";
    }
    }

    #45959
    Anonymous
    Inactive

    I agree. That is better.

    #45960
    Franky
    Keymaster

    done in trunk

    #45961
    Anonymous
    Inactive

    Confirmed working.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.
Scroll to Top