 |
 |
 |
 |
 |
| Author |
Message |
flesh

Joined: 04 Mar 2006 Posts: 89 Location: Poland |
|
Selecting only one category |
|
Can someone help me how to make in add and edit story to be posible each story to be in only one category ...not with chech box, but with radio botton ... help 
|
|
| Mon Apr 24, 2006 8:29 pm |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2801 Location: Germany |
|
|
|
Open inc/plugins.inc.php and change this:
 |  | function multicats_AddEdit(){
global $id, $mod;
$echo = cute_lang($mod);
if ($category = category_get_tree(' ', '<label for="cat{id}"><input type="checkbox" [php]multicats({id})[/php] name="cat[{id}]" id="cat{id}")"> {name}</label><br />')){
return '<fieldset><legend>'.$echo['category'].'</legend>'.$category.'</fieldset>';
}
}
add_action('new-save-entry', 'multicats_Save', 1);
add_action('edit-save-entry', 'multicats_Save', 1);
function multicats_Save(){
global $cat, $category;
if ($cat){
foreach ($cat as $k => $v){
$category_tmp[] = $k;
}
$category = join(',', $category_tmp);
}
} |
to this:
 |  | function multicats_AddEdit(){
global $id, $mod;
$echo = cute_lang($mod);
if ($category = category_get_tree(' ', '<label for="cat{id}"><input type="radio" [php]multicats({id})[/php] name="cat" value="{id}" id="cat{id}")"> {name}</label><br />')){
return '<fieldset><legend>'.$echo['category'].'</legend>'.$category.'</fieldset>';
}
}
add_action('new-save-entry', 'multicats_Save', 1);
add_action('edit-save-entry', 'multicats_Save', 1);
function multicats_Save(){
global $cat, $category;
if ($cat){
$category = $cat;
}
} |
|
|
| Mon Apr 24, 2006 10:54 pm |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|
 |
 |
 |
|