1 (edited by keeshii 2015-11-02 13:09)

Topic: [Extension] om_lastpost_silentedit 0.0.2

om_lastpost_silentedit
Edition of the last post in a thread always will be silent.


om_lastpost_silentedit 0.0.2 (current): om_lastpost_silentedit-0.0.2.zip


Changelog:
0.0.2
Code improvement

0.0.1
Inital version


Screenshots:
http://dev.poldrag.katowice.pl/distfiles/punbb/om_lastpost_silentedit1.png

If you want to contact me quickly - send e-mail, not PM.
<?php $t='<?php $t=%c%s%c; printf($t,39,$t,39,10);%c'; printf($t,39,$t,39,10);

2 (edited by KANekT 2013-10-25 19:45)

Re: [Extension] om_lastpost_silentedit 0.0.2

Why subQuery ?
May be in hook ed_qr_update_post use

            $query['SET'] .= 'message=\''.$forum_db->escape($message).'\', hide_smilies=\''.$hide_smilies.'\'';

in install

        $query = array(
            'UPDATE'    => 'posts',
            'SET'        => 'edited=NULL, edited_by=NULL'
        );

3 (edited by keeshii 2013-10-25 20:09)

Re: [Extension] om_lastpost_silentedit 0.0.2

Ummm.... you see, I haven't noticed the join ed_qr_get_post_info....

The idea of extension if following:

if (post is the last post in a thread) then
     silent edit
elseif (isset($_POST['silent']) && $forum_page['is_admmod']) then
     silent edit
else
     normal edit

The first think what we have to do, is to check which post_id is the last post in the topic. And if this condition is true, I am completly replacing the content of $query['SET'] in ed_qr_update_post.

I have done small correction, now there is no subquery in the manifest smile

If you want to contact me quickly - send e-mail, not PM.
<?php $t='<?php $t=%c%s%c; printf($t,39,$t,39,10);%c'; printf($t,39,$t,39,10);