[SOLVED] Preview BE...
 
Notifications
Clear all

[SOLVED] Preview BEFORE submitting?

7 Posts
2 Users
0 Reactions
1,055 Views
 Elle
(@jenny)
Posts: 594
Honorable Member
Topic starter
 

I'm not sure if this is a mod request, so I decided to put it here...

Is it possible to make sure the author previews their story before pressing submit? I was thinking of a preview-only button at first, and only when they've previewed it can they submit. I checked out the code and it seems -- to me -- that eFic doesn't actually distinguish the difference hence my thought of a mod, but I'm not "well-versed" with eFiction, so to say, so I was wondering if a) it was possible and/or b) what I could do in the mean time. :3 Without having reminders everywhere because I already do. ;P

Thanks!


archive: dramione.org
site: accio.nu

Available for skin/mod commission! πŸ™‚

 
Posted : 25/02/2008 5:41 pm
(@tammy)
Posts: 2577
Member Moderator
 

Use isset($_POST['submit']) to see whether or not they've previewed the item.  Then  around line 400 you should find where the preview and submit buttons are output. Just modify that so that only the preview button is displayed if they haven't submitted.


 
Posted : 25/02/2008 6:18 pm
 Elle
(@jenny)
Posts: 594
Honorable Member
Topic starter
 

I used this instead:

isset($_POST['submit']) ? $_POST['submit'] : false

It'll do the same job, right?

Thanks!


archive: dramione.org
site: accio.nu

Available for skin/mod commission! πŸ™‚

 
Posted : 26/02/2008 2:39 pm
(@tammy)
Posts: 2577
Member Moderator
 

You used that where? I think you need to leave it as _PREVIEW if you did it in the place I'm thinking.


 
Posted : 26/02/2008 3:07 pm
 Elle
(@jenny)
Posts: 594
Honorable Member
Topic starter
 

Here's the chunk of it:

	$submit = isset($_POST['submit']) ? $_POST['submit'] : false;
if(!$submit) $submit = _PREVIEW;
$output .= "<div class="tblborder" style="width: 80%; padding: 1em; margin: 1em auto;">
<form METHOD="POST" name="form" enctype="multipart/form-data" action='stories.php?action=$action".($newchapter ? "&sid=$sid&inorder=$inorder" : "").($admin == 1 ? "&amp;admin=1&amp;uid=$uid" : "")."'>";
if(!$newchapter) $output .= storyform($stories, $submit);
$output .= chapterform($inorder, $notes, $endnotes, $storytext, $chaptertitle, $uid);

// PREVIEW ONLY THEN SUBMIT
if (!$submit) {
$output .= "<div style="text-align: center;"><input type="submit" class="button" value=""._PREVIEW."" name="submit"> <input type="submit" class="button" value=""._ADDSTORY."" name="submit"></div></form>
</div>";
}
else {
$output .= "<div style="text-align: center;"><input type="submit" class="button" value=""._PREVIEW."" name="submit"></div></form>
</div>";
}
return $output;
}

That starts around line 338.


archive: dramione.org
site: accio.nu

Available for skin/mod commission! πŸ™‚

 
Posted : 26/02/2008 3:14 pm
(@tammy)
Posts: 2577
Member Moderator
 

Yeah that isn't going to work because right after the first line you set submit to _PREVIEW.  Change


if(!$submit) {

to


if(isset($_POST['submit'])) {

 
Posted : 26/02/2008 4:56 pm
 Elle
(@jenny)
Posts: 594
Honorable Member
Topic starter
 

Oh! That works good.

I originally had that with the !. o_O

Thanks, Tammy. πŸ˜€


archive: dramione.org
site: accio.nu

Available for skin/mod commission! πŸ™‚

 
Posted : 26/02/2008 5:13 pm
Share: