Thursday, July 29, 2010

How to allow authors to auto-publish in Joomla 1.5.x

How to allow authors to auto-publish in Joomla 1.5.x ? This can be achieved using third party components or modules such as ja submit or content submit. But i've got some little trick here to make our registered users or authors can publish the contents to our website without administrator approval.

The hack for Joomla 1.5.X is to change the following two files, note that the hack has to be applied to any future upgrade of the core.

components\com_content\controller.php
components\com_content\models\article.php

For the first comment out some lines around 229 as follows to stop the wrong message coming up on save:

// if ($access->canPublish)
// {
// Publishers, admins, etc just get the stock msg
$msg = JText::_('Item successfully saved.');
// }
// else
// {
// $msg = $isNew ? JText::_('THANK_SUB') : JText::_('Item successfully saved.');
// }

For the second file change a zero to one on line 332 or thereabouts. This opens the gate to authors.
// For new items - author is not allowed to publish - prevent them from doing so
$article->state = 1;

:), that;s it fellas!

1 comments:

paskuale said...

thanks a lot, I tried desperately to this article. I also stretch the same topic in my blog if you want (www.paskuale.it) also removes the link from this message before approving it, write it just for your knowledge

Post a Comment