By Anirudh Kumar on Wednesday, 29 January 2014
Posted in Technical Issues
Replies 14
Likes 0
Views 0.9K
Votes 0
I have disabled shef404 for easyblog component and I did purged all my old urls and cleared cache but Bloggers directory is not working.

i was trying to achieve here is make links as simple as possible at the moment this is how it is for a blogger http://www.mysite.org.nz/Members(menu)/blogger/listings/username do you think we can make it as http://www.mysite.com/listings/username(or)firstname?

Cheers.
Oh, you also need to edit /components/com_easyblog/router.php and locate the codes below at line 297


if( $config->get( 'main_sef_unicode' ) )
{
// perform manual split on the string.
if( isset($segments[2]) && $segments[2] == EasyBlogSEFTranslation::_( 'statistic' ) )
{
$permalinkSegment = $rawSegments[1];
}
else
{
$permalinkSegment = $rawSegments[ ( $count - 1 ) ];
}

$permalinkArr = explode( ':', $permalinkSegment);
$bloggerId = $permalinkArr[0];
}
else
{
if( isset($segments[2]) && $segments[2] == EasyBlogSEFTranslation::_( 'statistic' ) )
{
$permalink = $segments[1];
}
else
{
$permalink = $segments[$count - 1];
}

if( $id = EasyBlogHelper::getUserId( $permalink ) )
{
$user = JFactory::getUser( $id );
}

if( !$user )
{
// For usernames with spaces, we might need to replace with dashes since SEF will rewrite it.
$id = EasyBlogHelper::getUserId( JString::str_ireplace( '-' , ' ' , $permalink ) );
$user = JFactory::getUser( $id );
}

if( !$id )
{
// For usernames with spaces, we might need to replace with dashes since SEF will rewrite it.
$id = EasyBlogHelper::getUserId( JString::str_ireplace( '-' , '_' , $permalink ) );
$user = JFactory::getUser( $id );
}

$bloggerId = $user->id;
}


Replace it with,


// perform manual split on the string.
if( isset($segments[2]) && $segments[2] == EasyBlogSEFTranslation::_( 'statistic' ) )
{
$permalinkSegment = $rawSegments[1];
}
else
{
$permalinkSegment = $rawSegments[ ( $count - 1 ) ];
}

$permalinkArr = explode( ':', $permalinkSegment);
$bloggerId = $permalinkArr[0];
·
Thursday, 30 January 2014 23:45
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Anirudh,

Hm, this is really odd because SH404 seems to be generating the URL of https://travcom.org.nz/Members-Directory/blogger.html but I don't see anywhere in SH404's database about such URLs. Can I try purging all the URLs? I am really not too sure why because I am not really familiar with what SH404 is doing behind the scenes.

I have also added some customizations on the SH404 extension file in /components/com_easyblog/sef_ext/com_easyblog.php so that the URLs appear as /listings/username
·
Wednesday, 29 January 2014 23:41
·
0 Likes
·
0 Votes
·
0 Comments
·
P/S: My changes too doesn't seem to be taken into account as I think SH404 is somehow caching all the URLs even after purging.
·
Wednesday, 29 January 2014 23:41
·
0 Likes
·
0 Votes
·
0 Comments
·
As i said I disabled Sh404 for easyblog!

and yes you are authorized to purge the links.
·
Thursday, 30 January 2014 04:54
·
0 Likes
·
0 Votes
·
0 Comments
·
Ok everything sorted... Now all I want to do is...

example https://travcom.org.nz/members/blogger/listings/12344username
to
https://travcom.org.nz/members/listings/firstname-lastname

P.S. easyblog has nothing to do with SH404SEF... I am now using Joomla router
·
Thursday, 30 January 2014 05:07
·
0 Likes
·
0 Votes
·
0 Comments
·
Update -

I disabled the unicode alias so I still need achieve 2 things

1)https://travcom.org.nz/members/blogger/listings/username - get rid of Members(or blogger) so that it looks like https://travcom.org.nz/members/listings/xxxxxx

2)https://travcom.org.nz/members/listings/username - I dont want username in my alias as all the blogger usernames are email addresses.

Thanks.
·
Thursday, 30 January 2014 05:22
·
0 Likes
·
0 Votes
·
0 Comments
·
can anyone look into it... I have clear 404 errors for the website.

Cheers.
·
Thursday, 30 January 2014 15:04
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Anirudh,

I am sorry for the delays but please take a look at the blog post, http://stackideas.com/blog/limited-support-this-lunar-new-year .

If you have disabled SH404 for EasyBlog, it's not possible to have such URLs. Those urls are only achieve-able if you have a cached url system like SH404.
·
Thursday, 30 January 2014 15:24
·
0 Likes
·
0 Votes
·
0 Comments
·
Ok thanks I can live with it but how to change Usernames to Firstname+Lastname in the url as all the blogger usernames are email id.
·
Thursday, 30 January 2014 15:29
·
0 Likes
·
0 Votes
·
0 Comments
·
Try this, edit the file /components/com_easyblog/helpers/router.php and at line 651 locate the codes below:


return $bloggerPermalink;


Replace it with,


$bloggerPermalink = $profile->id . '-' . $user->name;
return $bloggerPermalink;
·
Thursday, 30 January 2014 15:47
·
0 Likes
·
0 Votes
·
0 Comments
·
One step forward.

1) Its working fine but now the blogger name has become guest

2) want replace %20 with a dash

I am really sorry to push on a holiday but it took 4 months just to set easyblog.
·
Thursday, 30 January 2014 16:26
·
0 Likes
·
0 Votes
·
0 Comments
·
Try this code,


$bloggerPermalink = $profile->id . '-' . str_ireplace( ' ' , '-' , $user->name );
return $bloggerPermalink;
·
Thursday, 30 January 2014 23:43
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for your help. Everything went great
·
Friday, 31 January 2014 19:49
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome.
·
Saturday, 01 February 2014 00:57
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post