Events Made Easy › Forums › Bug fixed or feature request implemented › Permalink suggestion!
Tagged: eme_event_url, eme_location_url, permalink
- This topic has 9 replies, 3 voices, and was last updated 13 years, 8 months ago by Franky.
-
AuthorPosts
-
Sun 27 Feb 2011 at 03:42 #42578AnonymousInactive
I really love the new permalink feature.
To make it just perfect, I have a suggestion:
Adding ‘user_trailingslashit’ to ’eme_event_url’ and ’eme_location_url’, as it will only add a triling slash if the blog is configured to use it
Best/
Andy
E.g.:
function eme_event_url($event) {
global $wp_rewrite;
if ($event != ”) {
$the_link = $event;
} else {
if (isset($wp_rewrite) && $wp_rewrite->using_permalinks()) {
$name=eme_permalink_convert(__(“events”,’eme’)).$event.”/”.eme_permalink_convert($event);
$the_link = trailingslashit(site_url()).$name;
} else {
$events_page_link = eme_get_events_page(true, false);
if (stristr ( $events_page_link, “?” ))
$joiner = “&”;
else
$joiner = “?”;
$the_link = $events_page_link.$joiner.”event_id=”.$event;
}
}
return user_trailingslashit($the_link);
}
function eme_location_url($location) {
global $wp_rewrite;
if (isset($wp_rewrite) && $wp_rewrite->using_permalinks()) {
$name=eme_permalink_convert(__(“locations”,’eme’)).$location.”/”.eme_permalink_convert($location);
$the_link = trailingslashit(site_url()).$name;
} else {
$events_page_link = eme_get_events_page(true, false);
if (stristr ( $events_page_link, “?” ))
$joiner = “&”;
else
$joiner = “?”;
$the_link = $events_page_link.$joiner.”location_id=”.$location;
}
return user_trailingslashit($the_link);
}
Sun 27 Feb 2011 at 17:09 #46994FrankyKeymasterI’ll take it into consideration, but the place where you use “user_trailingslashit” is wrong, because it also might add a “/” if no seo is used. The correct thing would be:
$the_link = trailingslashit(site_url()).user_trailingslashit($name);
Tue 1 Mar 2011 at 07:30 #46995AnonymousInactiveThat’s right …my bad 🙂
Tue 1 Mar 2011 at 13:09 #46996AnonymousInactiveI agree with andymax’s suggestion. Not only would it speed page loading by eliminating wasted data packet transmissions back and forth between visitor web browsers and servers, it also would eliminate thousands of server log entries per website per day due to user and bot redirects. Even websites that have no human visitors typically have thousands of bot page accesses per day and redirects bloat server logs by doubling the number of log entries.
Tue 1 Mar 2011 at 14:10 #46997FrankyKeymasteradmintiger: we are talking about “user_trailingslashit”, where the trailing slash only gets added if the user has defined this in his permalink setup.
Tue 1 Mar 2011 at 15:15 #46998AnonymousInactiveSorry, I had misunderstood!
Tue 1 Mar 2011 at 15:17 #46999FrankyKeymasterno prob, but I still like your feedback on this one 🙂
Tue 1 Mar 2011 at 20:51 #47000AnonymousInactiveIf I now understand correctly, EME would terminate URL’s with slashes if a user specifies that WordPress permalinks have a form something like this:
/%post_id%/%postname%/
But not if they specify something like this:
/%post_id%/%postname%
It seems reasonable to follow the slash convention specified for WordPress links. However, as stated before, trailing slashes should be specified.
Tue 1 Mar 2011 at 21:20 #47001FrankyKeymasteryup, that’s the reasoning behind user_trailingslashit.
Wed 9 Mar 2011 at 21:51 #47002FrankyKeymasterdone in trunk
-
AuthorPosts
- The forum ‘Bug fixed or feature request implemented’ is closed to new topics and replies.