Hi,
Is it possible to edit the 'Add Story' on the submit buttons to 'Update Story' when you're editing a chapter/story?
It's a little confusing for me and my members right now, because when we update something at the end it says 'Add Story' rather than 'Update' so it confuses us a little.
archive:
site:
Available for skin/mod commission! π
well it is possible to edit it via the en.php file but then that will mess up the add story button for when users wish to add the story as well im thinking as theres only 1 add story variable defined though so it may be hardcoded... (so i wouldnt do it the way ive just said)
there may be another way to do it that someone else here may be able to advise you of
~Spikey~
my site url: http://www.fanfictionworld.org
efic version:3.5.3
You'll need to edit stories.php
Find:
$output .= "<p><input type="hidden" name="sid" value="$sid"><input type="hidden" name="inorder" value="$inorder"><input type="submit" class="button" value="$submit" name="submit"> <input type="submit" class="button" value=""._EDITSTORY."" name="submit"></p></form></div>";
return $output;
}
// end editchapter function
Replace with:
$output .= "<p><input type="hidden" name="sid" value="$sid"><input type="hidden" name="inorder" value="$inorder"><input type="submit" class="button" value="$submit" name="submit"> <input type="submit" class="button" value=""._EDITSTORY."" name="submit"></p></form></div>";
return $output;
}
// end editchapter function
Find:
$chapters = dbnumrows($chapquery);
$output .= "<p><input type="submit" class="button" value="$submit" name="submit"> <input type="submit" class="button" value=""._ADDSTORY."" name="submit"></p></form></div>";
Replace with:
$chapters = dbnumrows($chapquery);
$output .= "<p><input type="submit" class="button" value="$submit" name="submit"> <input type="submit" class="button" value=""._EDITSTORY."" name="submit"></p></form></div>";
Thank you muchly!
archive:
site:
Available for skin/mod commission! π
You'll break it doing that. It checks for the _ADDSTORY value when the story is submitted.
Here's the fix.
You'll edit stories.php again. I've included the approximate lines for clarity:
AROUND LINE 438 FIND:
if(isset($_POST['submit']) && $_POST['submit'] == _ADDSTORY) {
if(!$chaptertitle || !$storytext ) $submit == _PREVIEW;
else {
REPLACE WITH:
if(isset($_POST['submit']) && $_POST['submit'] == _EDITSTORY) {
if(!$chaptertitle || !$storytext ) $submit == _PREVIEW;
else {
AROUND LINE 575 FIND:
if(isset($_POST['submit']) && $_POST['submit'] == _ADDSTORY) {
$oldcats = isset($_POST['oldcats']) ? array_filter(explode(",", $_POST['oldcats']), "isNumber") : array( );
if (!$rid || !$title || !$summary || !$catid) {
$output .= write_error(_MISSINGFIELDS);
$submit = _PREVIEW;
}
REPLACE WITH:
if(isset($_POST['submit']) && $_POST['submit'] == _EDITSTORY) {
$oldcats = isset($_POST['oldcats']) ? array_filter(explode(",", $_POST['oldcats']), "isNumber") : array( );
if (!$rid || !$title || !$summary || !$catid) {
$output .= write_error(_MISSINGFIELDS);
$submit = _PREVIEW;
}
That should work for you. I've already testing adding a new story/chapter and editing them as well.
Are those changes on the 'default' stories.php or the one that I changed before?
archive:
site:
Available for skin/mod commission! π
The one you changed before. You will need to make the changes in my first reply and also my second.
Got it - thanks. π
archive:
site:
Available for skin/mod commission! π
