Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Selecting only one category

 
Reply to topic    Forum Index » Help View previous topic
View next topic
Selecting only one category
Author Message
flesh



Joined: 04 Mar 2006
Posts: 89
Location: Poland

Post Selecting only one category Reply with quote
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 Exclamation
Mon Apr 24, 2006 8:29 pm View user's profile Send private message
Guest








Please login to hide the ads.

FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2801
Location: Germany

Post Reply with quote
Open inc/plugins.inc.php and change this:

Code:
function multicats_AddEdit(){

global $id, $mod;



   $echo = cute_lang($mod);



   if ($category = category_get_tree('&nbsp;', '<label for="cat{id}"><input type="checkbox" [php]multicats({id})[/php] name="cat[{id}]" id="cat{id}")">&nbsp;{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:

Code:
function multicats_AddEdit(){

global $id, $mod;



   $echo = cute_lang($mod);



   if ($category = category_get_tree('&nbsp;', '<label for="cat{id}"><input type="radio" [php]multicats({id})[/php] name="cat" value="{id}" id="cat{id}")">&nbsp;{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 View user's profile Send private message
Display posts from previous:    
Reply to topic    Forum Index » Help All times are GMT + 1 Hour
Page 1 of 1

 
Jump to: 
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



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.