Community builder article link author

This forum is for general questions about extensions for Joomla! version 1.5.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
keepcool
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Thu May 17, 2007 9:36 pm

Community builder article link author

Post by keepcool » Sun Oct 11, 2009 2:54 pm

Hi!

Im using community builder, and when a user write an article, up appears "Written 'by username'". The problem is that the username dont links to his CB profile, and i want it to be linked. Any idea on how do that?

Thanx!

Craigo
Joomla! Intern
Joomla! Intern
Posts: 74
Joined: Sat May 30, 2009 12:51 pm

Re: Community builder article link author

Post by Craigo » Mon Oct 12, 2009 4:50 pm

Yes.

1) download, install and enable the Zakauthor plugin from this link:
http://extensions.joomla.org/extensions ... files/5403

2) After you enable it, you'll notice a problem in Joomla 1.5.14:
the links appear on the frontend as code, and not as they should.
This is due to changes made in latest versions of Joomla.
This can be fixed, but I should note that you should consider if in your specific case
the fix does or doesn't cause a security compromise.

So here's the fix:

In few php files (that would be listed below), find the 'Written by' function, that originally looks more or less like this:

<tr>
<td valign="top">
<span class="small">
<?php JText::printf( 'Written by', ($this->escape($this->article->created_by_alias) ? $this->escape($this->article->created_by_alias) : $this->escape($this->article->author)) ); ?>
</span>
&nbsp;&nbsp;
</td>
</tr>

The problem is with the html escaping, so in order to resolve this, change it to:

<tr>
<td valign="top">
<span class="small">
<?php JText::printf( 'Written by', ($this->escape($this->article->created_by_alias) ? $this->article->created_by_alias : $this->escape($this->article->author)) ); ?>
</span>
&nbsp;&nbsp;
</td>
</tr>


This code is a bit different between the several files that require the same change, but in all of them there is only one 'Written by' block, and in all of them the $this->escape that should be omitted is the first one that comes after the first 'created_by_alias'.

Please note that if a certain template is being used, and within its folder in root directory: /templates/<template name> there are non of these folders:
html/com_content/article
html/com_content/frontpage
html/com_content/category
html/com_content/section

then the fix should be applied to the following Joomla core files:

components/com_content/views/article/tmpl/default.php
components/com_content/views/frontpage/tmpl/default_item.php
components/com_content/views/category/tmpl/blog_item.php
components/com_content/views/section/tmpl/blog_item.php

If, however, the template that is being used does have the following files under the following folders:
html/com_content/article/default.php
html/com_content/frontpage/default_item.php
html/com_content/category/blog_item.php
html/com_content/section/blog_item.php

then the fix should be applied only to the files under the specific template folders (although sometimes the template would have these files in its own folder, but the files won't contain the code for 'Written by'. In that case, the fix should be applied to the Joomla core files).

The fix would work in any case of using a broken link from articles to authors profile page,
even when using other updated plugins such as 'Author Link' plugin by azrul for Jomsocial (and not just with Zak author plugin).
However, if the chosen plugin is Zak Author (which is currently the only 1.5 solution for CB)
then that would work only when using Community Builder and trying to link to CB profile pages.

That's about it!

jazzking2001
Joomla! Explorer
Joomla! Explorer
Posts: 397
Joined: Sun Sep 02, 2007 12:50 am
Contact:

Re: Community builder article link author

Post by jazzking2001 » Sat Oct 17, 2009 8:29 pm

i did the edits to those 4 pages
the issue was fixed when actually viewing a page
but the user name was completely gone when i was viewing our front page
i just reset all the 4 files to how they were before
http://www.neocrisis.com/ - What will you find Next?

michelech
Joomla! Apprentice
Joomla! Apprentice
Posts: 15
Joined: Sat Aug 25, 2007 12:25 am

Re: Community builder article link author

Post by michelech » Fri Nov 06, 2009 1:05 pm

Did you check your frontpage settings (main menu - home - parameters) to make sure author was not hidden on front page - I didn't change anything in the frontpage items php - only the other three and the frontpage works fine with links, etc. (But I originally had front page parameters set to author hidden and changed it to show author).

Just an idea...

EmlynC
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed May 05, 2010 6:00 pm

Re: Community builder article link author

Post by EmlynC » Wed May 05, 2010 7:27 pm

The hacks worked great for me - many thanks for posting it up.


Locked

Return to “Extensions for Joomla! 1.5”