Welcome to Geeklog, Anonymous Friday, November 22 2024 @ 08:49 pm EST
Geeklog Forums
Reverse frontpage_options
Status: offline
Turias
Forum User
Full Member
Registered: 10/20/03
Posts: 807
Quote by asmaloney:
...or in MySQL you can change the default for the field 'frontpage' in the gl_stories table to 0.
...or in MySQL you can change the default for the field 'frontpage' in the gl_stories table to 0.
That doesn't work. The COM_optionList function takes a parameter to tell it which value is selected, which is what I was setting above. Before I set it, it was undefined, making COM_optionList not actually set the "selected" attribute on any of the options. While it might be nice for the code to check the database and determine the default value for optionlists such as this one, it doesn't, so changing the database as you suggested won't actually change how the story editor page is built.
18
20
Quote
Status: offline
Turias
Forum User
Full Member
Registered: 10/20/03
Posts: 807
Heh, it is an interesting idea, and one that makes some sense.
I think, though, that users should never have to modify the structure of any of the core Geeklog tables. This would be an excellent use for some more config.php variables, though. Does anyone want to make a feature request?
I think, though, that users should never have to modify the structure of any of the core Geeklog tables. This would be an excellent use for some more config.php variables, though. Does anyone want to make a feature request?
17
16
Quote
Could you not just put an 'Order by' clause for the SQL that populates that drop-down? That would make 'Show in Topic' the first item, and therefore selected when a user creates a new story.
I think this would work, but I don't know how to implement it in PHP. Any help?
I think this would work, but I don't know how to implement it in PHP. Any help?
13
16
Quote
Status: offline
ckpicker
Forum User
Newbie
Registered: 07/01/03
Posts: 11
I figured out how to do it. You need to change this code in admin/story.php:
to this:
The '0' parameter on the end of the function call defines the ORDER BY criteria for the SQL statement.
Text Formatted Code
$story_templates->set_var('frontpage_options', COM_optionList($_TABLES['frontpagecodes'],'code,name',$A['frontpage']));to this:
Text Formatted Code
$story_templates->set_var('frontpage_options', COM_optionList($_TABLES['frontpagecodes'],'code,name',$A['frontpage'],0));The '0' parameter on the end of the function call defines the ORDER BY criteria for the SQL statement.
12
17
Quote
All times are EST. The time is now 08:49 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