Select auhor instead of category

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Select auhor instead of category

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Select auhor instead of category

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Select auhor instead of category

Post 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
Post Reply