Kullanici 2 msg ard arda atmasin

Slaughter

New member
Katılım
22 Ağu 2005
Mesajlar
287
Reaction score
0
Puanları
0
Konum
Your Dreams
eyer kimse ard arda 2 msg atmasin diosaniz bu eklentiyi kurmanizda yarar war.

ftp>>includes>>functions_newpost.php mizde alttaki kodlari buluyoruz

PHP:
 $DB_site->query("
            INSERT INTO " . TABLE_PREFIX . "post
                (threadid, parentid, title, username, userid, dateline, pagetext, allowsmilie,
                 showsignature, ipaddress, iconid, visible, attach)
            VALUES
                ($threadinfo[threadid], $parentid, '" . addslashes($post['title']) . "',
                 '" . addslashes($post['postusername']) . "', $bbuserinfo[userid], " . TIMENOW . ",
                 '" . addslashes($post['message']) . "', $post[enablesmilies], $post[signature],
                 '" . addslashes($post['ipaddress']) . "', $post[iconid], $post[visible], $totalattachments)
        ");
        $post['postid'] = $DB_site->insert_id();


bunun heeepsini alttakilerle deiştirin


PHP:
// ########### Xenon's prevent doublepost hack #########
        $dp_settings = array(
            'dobump' => true,    // change this to false if you don't want doubleposts changing post's dateline
            'timespan' => 3600,    // how many seconds after the last post the new post is defined as doublepost
            'spacer' => "\n\n",    // What should be between the old post and the new one (default: two empty lines)
            'addeditedby' => false,    // Should a edited by author be added when a post is merged
        );

        $isdoublepost = false;
        if ($type != 'thread' AND $threadinfo['lastpost'] > TIMENOW - $dp_settings['timespan'] AND $threadinfo['lastposter'] == $post['postusername'])
        {
            // we are here, so we may have a doublepost -> do more exact checkings
            $doublepost = $DB_site->query_first("
                SELECT postid, pagetext, post.title, post.userid, post.attach
                FROM " . TABLE_PREFIX . "post AS post
                LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND type = 'post')
                WHERE threadid = $threadinfo[threadid]
                    AND dateline > " . (TIMENOW - $dp_settings['timespan']) . "
                    AND visible = 1 AND deletionlog.primaryid IS NULL
                ORDER BY dateline DESC
                LIMIT 1
            ");

            if ($doublepost['userid'] == $bbuserinfo['userid'])
            {
                // we truely have a doublepost, now check if the merged post fits the rules!
                $oldmsg = $post['message'];
                $olderrors = $errors;

                $post['message'] = $doublepost['pagetext'] . $dp_settings['spacer'] . $post['message'];
                verify_post_errors($type, $post, $errors);
                if (sizeof($errors) == 0 AND !($vboptions['attachlimit'] AND $totalattachments +  $doublepost['attach'] > $vboptions['attachlimit']))
                {
                    // merged post is ok, so do merging
                    $isdoublepost = true;
                    $post['postid'] = $doublepost['postid'];
                }
                else
                {
                    // merging will produce errors so keep it as a single post..
                    $isdoublepost = false;
                    $post['message'] = $oldmsg;
                }
                unset($oldmsg);
                $errors = $olderrors;
                unset($olderrors);
            }
        }

        if ($isdoublepost)
        {
            // Yes we have a doublepost, so do unindexing
            require_once('./includes/functions_databuild.php');
            delete_post_index($doublepost['postid'], $doublepost['title'], $doublepost['pagetext']);
            unset($doublepost);

            // Update DB
            $DB_site->query("
                UPDATE " . TABLE_PREFIX . "post
                SET pagetext = '" . addslashes($post['message']) . "',
                " . iif($dp_settings['dobump'], 'dateline = ' . TIMENOW . ',', '') . "
                attach = attach + $totalattachments
                WHERE postid = $post[postid]
            ");

            //Delete Eventually parsed cached post
            $DB_site->query("DELETE FROM " . TABLE_PREFIX . "post_parsed WHERE postid = " . $post['postid']);

            if ($totalattachments > 0 OR $dp_settings['dobump'])
            {
                $DB_site->query("
                    UPDATE " . TABLE_PREFIX . "thread
                    SET " . iif($dp_settings['dobump'], 'lastpost = ' . TIMENOW . ',', '') . "
                    attach = attach + $totalattachments
                    WHERE threadid = $threadinfo[threadid]
                ");
            }

            //Update forum if postdate has changed.
            if ($dp_settings['dobump'])
            {
                $DB_site->query("
                    UPDATE " . TABLE_PREFIX . "forum
                    SET lastpost = " . TIMENOW . ",
                    lastposter = '" . addslashes($post['postusername']) . "',
                    lastthread = '" . addslashes($threadinfo['title']) . "',
                    lastthreadid = $threadinfo[threadid],
                    lasticonid = " . iif($threadinfo['pollid'], -1, $threadinfo['iconid']) . "
                    WHERE forumid = $foruminfo[forumid]
                ");
            }

            // Add edited by if wanted
            if ($dp_settings['addeditedby'])
            {
                $DB_site->query("
                    REPLACE INTO " . TABLE_PREFIX . "editlog (postid, userid, username, dateline, reason)
                    VALUES ($post[postid], $bbuserinfo[userid], '" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . ", 'Automerged Doublepost')
                ");
            }
        }
        else
        {
            $DB_site->query("
                INSERT INTO " . TABLE_PREFIX . "post
                    (threadid, parentid, title, username, userid, dateline, pagetext, allowsmilie,
                     showsignature, ipaddress, iconid, visible, attach)
                VALUES
                    ($threadinfo[threadid], $parentid, '" . addslashes($post['title']) . "',
                     '" . addslashes($post['postusername']) . "', $bbuserinfo[userid], " . TIMENOW . ",
                     '" . addslashes($post['message']) . "', $post[enablesmilies], $post[signature],
                     '" . addslashes($post['ipaddress']) . "', $post[iconid], $post[visible], $totalattachments)
            ");
            $post['postid'] = $DB_site->insert_id();
        }
        // ########### Xenon's prevent doublepost hack #########


bu işlem bittikten sora alltaki kodlari bulun

PHP:
// ### UPDATE SEARCH INDEX ###
        require_once('./includes/functions_databuild.php');
        build_post_index($post['postid'], $foruminfo, iif($type == 'thread', 1, 0));

altina alttaki kodlari ekliyin

PHP:
// Attachments and indexing done, if post was a doublepost, nothing more is needed
        if ($isdoublepost)
        {
            return;
        }

Onemli : Eklenti Kurmadan Once Kesinlikle Template ve php kopyalarini aliniz!!!...
 
kardeş bişey söyliycem bu 3.5.x e mi ekleniyo ?
 
Geri
Üst