- 1 Ağu 2007
- 5,470
- 41
ftp>>includes>>functions_newpost.php mizde alttaki kodlari buluyoruz
bunun hepsini alttakilerle değiştirin
bu işlem bittikten sora alltaki kodlari bulun
altina alttaki kodlari ekliyin
Onemli : Eklenti Kurmadan Once Kesinlikle Template ve php kopyalarini aliniz!!!...
Alıntdır
Kod:
[FONT=Courier New]$DB_site->query([/FONT][/COLOR][FONT=Courier New][COLOR=white]"
INSERT INTO " . TABLE_PREFIX . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"post
(threadid, parentid, title, username, userid, dateline, pagetext, allowsmilie,
showsignature, ipaddress, iconid, visible, attach)
VALUES
($threadinfo[threadid], $parentid, '" . addslashes($post['title']) . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"',
'" . addslashes($post['postusername']) . "', $bbuserinfo[userid], " . TIMENOW . [/COLOR][/FONT][FONT=Courier New][COLOR=white]",
'" . addslashes($post['message']) . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"', $post[enablesmilies], $post[signature],
'" . addslashes($post['ipaddress']) . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"', $post[iconid], $post[visible], $totalattachments)
"[/COLOR][/FONT][COLOR=white][FONT=Courier New]);
$post['postid'] = $DB_site->insert_id[/FONT][FONT=Courier New](); [/FONT]
bunun hepsini alttakilerle değiştirin
Kod:
[/COLOR][FONT=Courier New][COLOR=white]// ########### Xenon's prevent doublepost hack #########
$dp_settings [/COLOR][/FONT][FONT=Courier New][COLOR=white]= array(
'dobump' => true, [/COLOR][/FONT][FONT=Courier New][COLOR=white]// change this to false if you don't want doubleposts changing post's dateline
'timespan' => 3600, [/COLOR][/FONT][FONT=Courier New][COLOR=white]// how many seconds after the last post the new post is defined as doublepost
'spacer' => "\n\n", [/COLOR][/FONT][FONT=Courier New][COLOR=white]// What should be between the old post and the new one (default: two empty lines)
'addeditedby' => false, [/COLOR][/FONT][FONT=Courier New][COLOR=white]// Should a edited by author be added when a post is merged
[/COLOR][/FONT][FONT=Courier New][COLOR=white]);
$isdoublepost = false[/COLOR][/FONT][FONT=Courier New][COLOR=white];
if ($type != 'thread' AND $threadinfo['lastpost'] > TIMENOW - $dp_settings['timespan'] AND $threadinfo['lastposter'] == $post['postusername'[/COLOR][/FONT][FONT=Courier New][COLOR=white]])
{
[/COLOR][/FONT][FONT=Courier New][COLOR=white]// we are here, so we may have a doublepost -> do more exact checkings
$doublepost = $DB_site->query_first([/COLOR][/FONT][FONT=Courier New][COLOR=white]"
SELECT postid, pagetext, post.title, post.userid, post.attach
FROM " . TABLE_PREFIX . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"post AS post
LEFT JOIN " . TABLE_PREFIX . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND type = 'post')
WHERE threadid = $threadinfo[threadid]
AND dateline > " . (TIMENOW - $dp_settings['timespan']) . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"
AND visible = 1 AND deletionlog.primaryid IS NULL
ORDER BY dateline DESC
LIMIT 1
"[/COLOR][/FONT][FONT=Courier New][COLOR=white]);
if ($doublepost['userid'] == $bbuserinfo['userid'[/COLOR][/FONT][FONT=Courier New][COLOR=white]])
{
[/COLOR][/FONT][FONT=Courier New][COLOR=white]// we truely have a doublepost, now check if the merged post fits the rules!
$oldmsg = $post['message'[/COLOR][/FONT][FONT=Courier New][COLOR=white]];
$olderrors = $errors[/COLOR][/FONT][FONT=Courier New][COLOR=white];
$post['message'] = $doublepost['pagetext'] . $dp_settings['spacer'] . $post['message'[/COLOR][/FONT][FONT=Courier New][COLOR=white]];
verify_post_errors($type, $post, $errors[/COLOR][/FONT][FONT=Courier New][COLOR=white]);
if (sizeof($errors) == 0 AND !($vboptions['attachlimit'] AND $totalattachments + $doublepost['attach'] > $vboptions['attachlimit'[/COLOR][/FONT][FONT=Courier New][COLOR=white]]))
{
[/COLOR][/FONT][FONT=Courier New][COLOR=white]// merged post is ok, so do merging
$isdoublepost = true[/COLOR][/FONT][FONT=Courier New][COLOR=white];
$post['postid'] = $doublepost['postid'[/COLOR][/FONT][FONT=Courier New][COLOR=white]];
}
else
{
[/COLOR][/FONT][FONT=Courier New][COLOR=white]// merging will produce errors so keep it as a single post..
$isdoublepost = false[/COLOR][/FONT][FONT=Courier New][COLOR=white];
$post['message'] = $oldmsg[/COLOR][/FONT][FONT=Courier New][COLOR=white];
}
unset($oldmsg[/COLOR][/FONT][FONT=Courier New][COLOR=white]);
$errors = $olderrors[/COLOR][/FONT][FONT=Courier New][COLOR=white];
unset($olderrors[/COLOR][/FONT][FONT=Courier New][COLOR=white]);
}
}
if ($isdoublepost[/COLOR][/FONT][FONT=Courier New][COLOR=white])
{
[/COLOR][/FONT][FONT=Courier New][COLOR=white]// Yes we have a doublepost, so do unindexing
require_once('./includes/functions_databuild.php'[/COLOR][/FONT][FONT=Courier New][COLOR=white]);
delete_post_index($doublepost['postid'], $doublepost['title'], $doublepost['pagetext'[/COLOR][/FONT][FONT=Courier New][COLOR=white]]);
unset($doublepost[/COLOR][/FONT][FONT=Courier New][COLOR=white]);
[/COLOR][/FONT][FONT=Courier New][COLOR=white]// Update DB
$DB_site->query([/COLOR][/FONT][FONT=Courier New][COLOR=white]"
UPDATE " . TABLE_PREFIX . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"post
SET pagetext = '" . addslashes($post['message']) . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"',
" . iif($dp_settings['dobump'], 'dateline = ' . TIMENOW . ',', '') . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"
attach = attach + $totalattachments
WHERE postid = $post[postid]
"[/COLOR][/FONT][FONT=Courier New][COLOR=white]);
[/COLOR][/FONT][FONT=Courier New][COLOR=white]//Delete Eventually parsed cached post
$DB_site->query("DELETE FROM " . TABLE_PREFIX . "post_parsed WHERE postid = " . $post['postid'[/COLOR][/FONT][FONT=Courier New][COLOR=white]]);
if ($totalattachments > 0 OR $dp_settings['dobump'[/COLOR][/FONT][FONT=Courier New][COLOR=white]])
{
$DB_site->query([/COLOR][/FONT][FONT=Courier New][COLOR=white]"
UPDATE " . TABLE_PREFIX . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"thread
SET " . iif($dp_settings['dobump'], 'lastpost = ' . TIMENOW . ',', '') . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"
attach = attach + $totalattachments
WHERE threadid = $threadinfo[threadid]
"[/COLOR][/FONT][FONT=Courier New][COLOR=white]);
}
[/COLOR][/FONT][FONT=Courier New][COLOR=white]//Update forum if postdate has changed.
if ($dp_settings['dobump'[/COLOR][/FONT][FONT=Courier New][COLOR=white]])
{
$DB_site->query([/COLOR][/FONT][FONT=Courier New][COLOR=white]"
UPDATE " . TABLE_PREFIX . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"forum
SET lastpost = " . TIMENOW . [/COLOR][/FONT][FONT=Courier New][COLOR=white]",
lastposter = '" . addslashes($post['postusername']) . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"',
lastthread = '" . addslashes($threadinfo['title']) . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"',
lastthreadid = $threadinfo[threadid],
lasticonid = " . iif($threadinfo['pollid'], -1, $threadinfo['iconid']) . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"
WHERE forumid = $foruminfo[forumid]
"[/COLOR][/FONT][FONT=Courier New][COLOR=white]);
}
[/COLOR][/FONT][FONT=Courier New][COLOR=white]// Add edited by if wanted
if ($dp_settings['addeditedby'[/COLOR][/FONT][FONT=Courier New][COLOR=white]])
{
$DB_site->query([/COLOR][/FONT][FONT=Courier New][COLOR=white]"
REPLACE INTO " . TABLE_PREFIX . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"editlog (postid, userid, username, dateline, reason)
VALUES ($post[postid], $bbuserinfo[userid], '" . addslashes($bbuserinfo['username']) . "', " . TIMENOW . [/COLOR][/FONT][FONT=Courier New][COLOR=white]", 'Automerged Doublepost')
"[/COLOR][/FONT][FONT=Courier New][COLOR=white]);
}
}
else
{
$DB_site->query([/COLOR][/FONT][FONT=Courier New][COLOR=white]"
INSERT INTO " . TABLE_PREFIX . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"post
(threadid, parentid, title, username, userid, dateline, pagetext, allowsmilie,
showsignature, ipaddress, iconid, visible, attach)
VALUES
($threadinfo[threadid], $parentid, '" . addslashes($post['title']) . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"',
'" . addslashes($post['postusername']) . "', $bbuserinfo[userid], " . TIMENOW . [/COLOR][/FONT][FONT=Courier New][COLOR=white]",
'" . addslashes($post['message']) . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"', $post[enablesmilies], $post[signature],
'" . addslashes($post['ipaddress']) . [/COLOR][/FONT][FONT=Courier New][COLOR=white]"', $post[iconid], $post[visible], $totalattachments)
"[/COLOR][/FONT][FONT=Courier New][COLOR=white]);
$post['postid'] = $DB_site->insert_id[/COLOR][/FONT][COLOR=white][FONT=Courier New]();
}
// ########### Xenon's prevent doublepost hack ######### [/FONT]
bu işlem bittikten sora alltaki kodlari bulun
Kod:
[/COLOR][FONT=Courier New][COLOR=white]// ### UPDATE SEARCH INDEX ###
require_once('./includes/functions_databuild.php'[/COLOR][/FONT][COLOR=white][FONT=Courier New]);
build_post_index($post['postid'], $foruminfo, iif($type == 'thread', 1, 0[/FONT][FONT=Courier New])); [/FONT]
altina alttaki kodlari ekliyin
Kod:
[/COLOR][FONT=Courier New][COLOR=white]// Attachments and indexing done, if post was a doublepost, nothing more is needed
if ($isdoublepost[/COLOR][/FONT][COLOR=white][FONT=Courier New])
{
return;
} [/FONT]
Onemli : Eklenti Kurmadan Once Kesinlikle Template ve php kopyalarini aliniz!!!...
Alıntdır