Events Made Easy › Forums › Bug fixed or feature request implemented › Suggested "eme_events.php" Mod to Prevent Page Number Centering Change
- This topic has 5 replies, 2 voices, and was last updated 13 years, 10 months ago by Anonymous.
Viewing 6 posts - 1 through 6 (of 6 total)
-
AuthorPosts
-
Wed 5 Jan 2011 at 19:58 #42371AnonymousInactive
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!
Wed 5 Jan 2011 at 20:21 #45957FrankyKeymasterI 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>";
}Wed 5 Jan 2011 at 20:24 #45958FrankyKeymasterBetter (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>";
}
}Wed 5 Jan 2011 at 20:50 #45959AnonymousInactiveI agree. That is better.
Wed 5 Jan 2011 at 21:05 #45960FrankyKeymasterdone in trunk
Wed 5 Jan 2011 at 21:13 #45961AnonymousInactiveConfirmed working.
-
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
- The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.