Joomla autopublish

por | 3 abril, 2008

Autopublicación

Cambiar $row->state = 0; a

$row->state =1; en todo el código

My apologies, I missed out part of the hack to get news auto-published.

If you can, please take Dave’s advice and use mycontent or ja_submit.
Once you hack core code you have to repeat your work every time there is a new release.

However, if you must, here it is:

For Joomla! 1.0.11:
content.php
comment out line 1822 $row->state = 0;
comment out line 1996 $row->state = 0;

database
change JOS_CONTENT.STATE default value to 1

Or if you prefer, instead of commenting out the above lines of code, just change 0 to 1 and leave the database unchanged.

For the item to display on the frontpage:
content.php
change line 1829 $row->frontpage = 0; to $row->frontpage = 1;

// Publishing state hardening CArlos Padron .. Hack
// Publishing state hardening for Authors
if ( !$access->canPublish ) {
if ( $isNew ) {
// For new items – author is not allowed to publish – prevent them from doing so
// $row->state = 0;
} else {
// For existing items keep existing state – author is not allowed to change status
$query = «SELECT state»
. «\n FROM #__content»
. «\n WHERE id = » . (int) $row->id
;
$database->setQuery( $query);
$state = $database->loadResult();

if ( $state ) {
$row->state = 1;
} else {
//    $row->state = 0;
}
}
}