Welcome to Geeklog, Anonymous Sunday, December 22 2024 @ 01:29 pm EST

Geeklog Forums

author selection during story contribution?


bdefore

Anonymous
I'm curious if anyone else may have tried to do something similar. I have to publish articles for a campus newspaper and I would like to log in and contribute articles but have them post under the name of any of several authors, also users on the geeklog system. My attempt was to go into the storyeditor.thtml and put in a segment like this: <select name="author_selector"> {author_list} </select> ...and then in the story.php file add the following near line 282 of version 1.3.6: $story_templates->set_var('author_list', DB_query("SELECT fullname FROM gl_users"Wink); This does not create any syntax errors, but it gives me an empty dropdown menu rather than a list of all users. Any ideas why this doesn't work?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
You can't just stick a PHP array into a <select> tag and hope that it works ... Every author name needs to be in an <option> tag and you need to loop over the array as well. Have a look at how the list of authors is built in search.php (in function searchform(), around line 94), this should give you a better idea. But that's only part of it - you also need to check which author was selected when the story is saved. bye, Dirk
 Quote

All times are EST. The time is now 01:29 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content