Posted on: 03/11/04 09:24am
By: ZooN
When adding a story the default value is "Show on Front page" i want to reverse that so that the default value is "Show only in Topic"
How do i do that ?!?
Reverse frontpage_options
Posted on: 03/11/04 09:54am
By: Turias
In admin/story.php,
change
} elseif ($mode == "edit") {
to
} elseif ($mode == "edit") {
$A['frontpage'] = 0;
Reverse frontpage_options
Posted on: 03/11/04 10:10am
By: asmaloney
...or in MySQL you can change the default for the field 'frontpage' in the gl_stories table to 0.
Reverse frontpage_options
Posted on: 03/11/04 10:25am
By: Turias
[QUOTE BY= asmaloney]
...or in MySQL you can change the default for the field 'frontpage' in the gl_stories table to 0.[/QUOTE]
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.
Reverse frontpage_options
Posted on: 03/11/04 10:34am
By: asmaloney
Ah. I apologise. [Slinks back to his corner.]
Thanks for the info - I'm done for the day now that I've learned my one thing.
Reverse frontpage_options
Posted on: 03/11/04 10:47am
By: Turias
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?
Reverse frontpage_options
Posted on: 03/11/04 12:20pm
By: geKow
[QUOTE BY= Turias] ...Does anyone want to make a feature request? [/QUOTE]
geKow takes his backpack and walks to the feature requester
geKow
Reverse frontpage_options
Posted on: 03/23/04 02:45am
By: ZooN
Thanks for the answer Turias :-)
Reverse frontpage_options
Posted on: 05/17/05 11:08am
By: ckpicker
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?
Reverse frontpage_options
Posted on: 05/17/05 11:20am
By: ckpicker
I figured out how to do it. You need to change this code in admin/story.php:
$story_templates->set_var('frontpage_options', COM_optionList($_TABLES['frontpagecodes'],'code,name',$A['frontpage']));
to this:
$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.
Reverse frontpage_options
Posted on: 05/20/05 09:08am
By: ckpicker
Does anybody have any idea how I might limit the front page option to only certain topics?
Reverse frontpage_options
Posted on: 12/15/05 12:45pm
By: 1000ideen
>> limit the front page option to only certain topics<<
Or how about limiting "featured story" and "show on front page" to the root admin?