NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

#1 07-27-2011 01:25:32

rainbow
Member

"Edited on" feature does not work in replies to comment on drawing.

I'm pretty much done in regards to fixing pretty much all of the bugs since I upgraded my modified oekaki to Wax Poteto 5.8.5, with one last bug to fix.

Okay, the "Edited on" text does not work upon selecting "Yes" as a option when an administrator edits replies to comments made in a oekaki submission. This is also the case when the user edits the replies in the comment as well. However, when editing the main picture comment, the "Edited on" text with the date stamp appears.

Here is a snippet of the what the Edit comment function looks like on lines 1,492 to 1,519 of the function.php file:

Code:

// Edit comment
if ($action == 'editcomment') {
    $comment2 = w_gpc('comment2');
    $idno     = w_gpc('idno', 'i');
    $editon   = w_gpc('editon', 'i');

    // Comment owner
    $result = db_query ("SELECT usrname FROM {$db_p}oekakicmt WHERE ID_3='$idno'");
    if ($result) {
        $usrname = db_result ($result, 0);

        if ($usrname != $OekakiU) {
            if ($flags['admin']) {
                if ($editon) {
                    $comment2 .= "\n\n({$langop_common_editedon} ".date($datef['admin_edit']).", [b]{$OekakiU}[/b])";

                    // Log if admin edit
                    w_log(WLOG_EDIT_COMM, 'comment: '.$idno, $usrname);
                }
            } else {
                report_err($langop_functions_err21);
            }
        } elseif ($editon) {
            $comment2 .= "\n\n({$langop_common_editedon} ".date($datef['admin_edit']).')';
        }
        $result2 = db_query ("UPDATE {$db_p}oekakicmt SET comment='{$comment2}' WHERE ID_3='{$idno}'");
        all_done();
    }
}

And here is the snippet for the edit comment for main picture function found on lines 1,523 to 1,554 in the function.php file:

Code:

// Edit Pic
if ($action == 'picedit') {
    $comment2 = w_gpc('comment2');
    $title2   = w_gpc('title2');
    $adult    = w_gpc('adult', 'i');
    $picno    = w_gpc('picno', 'i+');

    // Pic owner
    $result = db_query ("SELECT usrname, PIC_ID, title, comment, adult FROM {$db_p}oekakidta WHERE PIC_ID='{$picno}'");
    if ($result) {
        $their_row = db_fetch_array ($result);
    } else {
        report_err('Unable to read picture info from database.  Try again.');
    }

    // Add it
    if (($their_row['usrname'] != $OekakiU) && !$flags['admin']) {
        // No match, not admin
        report_err($langop_functions_err21);
    } else {
        if (!$flags['admin'] || $_POST['editon'] != 'no') {
            $comment2 .= "\n\n({$langop_common_editedon} ".date($datef['admin_edit']).')';

            // Log if admin edit
            w_log(WLOG_EDIT_PIC, 'picture: '.$picno, $their_row['usrname']);
        }

        $result2 = db_query ("UPDATE {$db_p}oekakidta SET title='$title2', comment='$comment2', adult='$adult', postlock='1' WHERE PIC_ID='{$picno}'");

        all_done();
    }
}

What do I need to change to made to make the "Edited on" with the date and time of the edited comment to appear in replies to the drawing and not just the main comment on picture itself?

Last edited by rainbow (07-27-2011 02:08:06)

Offline

#2 07-27-2011 02:45:19

Waccoon
Administrator

Re: "Edited on" feature does not work in replies to comment on drawing.

This is pretty silly problem, due to a limitation of the Wax Poteto language system.   I should have just left the old system alone.

You may notice that when you try to edit someone else's comment, the "Edited on" part is added to the end of the comment on the comment screen, so you can see it and change it (ie, translate it) if you wish.  The functions.php file will NOT add it automatically.  This was just a bad design choice on my part.

Also, the functions.php file requires either a "0" or a "1", but the comment screen is sending a "no" or "yes".  This causes the bug.  I'll have to fix this.

In "editcomm.php" and "editpic.php", delete the following code from the top of the page:

Code:

// Admin edit
$change_editon_to_no = 0;
if ($flags['admin'] && ($their_row['usrname'] != $OekakiU)) {
    // So we don't have to update language files
    $their_row['comment'] .= "\n\n[b](Edited by {$OekakiU})[/b]";
    $change_editon_to_no = 1;
}

Then, in those same two files, find this part:

Code:

<?php if ($change_editon_to_no) { ?>
                    <option value="yes"><?php echo $langop_word_yes;?></option>
                    <option value="no" selected="selected"><?php echo $langop_word_no;?></option>
<?php } else { ?>
                    <option value="yes" selected="selected"><?php echo $langop_word_yes;?></option>
                    <option value="no"><?php echo $langop_word_no;?></option>
<?php } ?>

...and replace it with this:

Code:

                    <option value="1" selected="selected"><?php echo $langop_word_yes;?></option>
                    <option value="0"><?php echo $langop_word_no;?></option>

Offline

#3 07-27-2011 03:45:46

rainbow
Member

Re: "Edited on" feature does not work in replies to comment on drawing.

Thank you so much for the help once again!

I knew that this was due the a design limitation in the Wax Poteto language system. All of the problems have been fixed until the next update! smile

Edit: It looks like that it was a bit premature to say "all clear" when it comes to correcting all of the errors on my oekaki board. I'm running into a bit of a problem attempting to correct a bug involving not displaying replies to the oekaki drawing comments when comments are locked. I sent you a attachment of my modified comment.php file to look over.

I'm tired. I worked so hard trying to fix all of the errors on my oekaki board after upgrading and now I need to go to bed real soon.

Update: The bug that prevented users from commenting has finally been finished. I'm ready to declare that my oekaki is officially in use again. You're welcome to ignore the e-mail that I sent to you before I went to bed.

Last edited by rainbow (07-27-2011 11:14:10)

Offline

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB