Page 1 of 1

Select auhor instead of category

Posted: Tue Jul 27, 2010 3:43 pm
by yellowled
The mimbo template uses this piece of code in the config.inc.php to select a category in a dropdown list:

Code: Select all

if ($serendipity['GET']['adminModule'] == 'templates') {

  $all_cats = serendipity_fetchCategories('all');

  $categories = serendipity_walkRecursive($categories, 'categoryid', 'parentid', VIEWMODE_THREADED);

  $catsel = array();

  foreach($all_cats AS $cat) {

    $catsel[$cat['categoryid']] = str_repeat(' ', $cat['depth']) . $cat['category_name'];

  }

}
I'm looking for a similar solution to select authors instead of categories, but as usual, my PHP knowledge leaves me hanging. Any help appreciated :)

YL

Re: Select auhor instead of category

Posted: Tue Jul 27, 2010 3:50 pm
by garvinhicking

Code: Select all

if ($serendipity['GET']['adminModule'] == 'templates') {
  $all_authors = serendipity_fetchUsers();
  $authorsel = array();

  foreach($all_authors AS $author) {
    $authorsel[$author['authorid']] = $author['realname'];
  }
}
HTH,
Garvin

Re: Select auhor instead of category

Posted: Tue Jul 27, 2010 3:53 pm
by yellowled
garvinhicking wrote:HTH
Now playing: Linkin Park - Cure For The Itch

(Haven't actually tried it, but you probably know what you're doing. :wink:)

EDIT: Yup, works like a charm. Thanks! :)

YL