The code is
Code: Select all
echo $lists['state'];
NB: my knowledge of php isn't, well, good.
Moderator: General Support Moderators
Code: Select all
echo $lists['state'];
Code: Select all
// Radio Buttons: Should the article be published
$lists['state'] = JHTML::_('select.booleanlist', 'state', '', $article->state);
Code: Select all
// Radio Buttons: Should the article be published
// lekankou's add for UNpublished by default :
if($article->id) {
$query = 'SELECT state FROM #__content WHERE id = '. (int) $article->id;
$db->setQuery($query);
$article->state = $db->loadResult();
} else {
$article->state = 0;
}
// End of lekankou's add
$lists['state'] = JHTML::_('select.booleanlist', 'state', '', $article->state);
Code: Select all
// Radio Buttons: Should the article be published
$lists['state'] = JHTML::_('select.booleanlist', 'state', '', $article->state);
Code: Select all
// Radio Buttons: Should the article be published
// lekankou's add for UNpublished by default :
if($article->id) {
$query = 'SELECT state FROM #__content WHERE id = '. (int) $article->id;
$db->setQuery($query);
$article->state = $db->loadResult();
} else {
$article->state = 0;
}
// End of lekankou's add
$lists['state'] = JHTML::_('select.booleanlist', 'state', '', $article->state);
May you try this ?What you could do is to edit the file article.xml that is located in the directory \administrator\components\com_content\models\forms and change the default value of the default from "1" to "0".
Code:
...
...
<field name="state" type="list" label="JSTATUS"
description="JFIELD_PUBLISHED_DESC" class="inputbox"
filter="intval" size="1" default="1"
>
<option value="1">
JPUBLISHED</option>
<option value="0">
JUNPUBLISHED</option>
<option value="2">
JARCHIVED</option>
<option value="-2">
JTRASHED</option>
</field>
...
...
Be informed that you are changing a core Joomla! file. So, make a copy of the original file. Also, be aware that this file may get overwritten by future releases/versions of Joomla!