Your ultimate PunBB resource!
You are not logged in.
## ## Mod title: Complete Management of the posts ## ## Mod version: 1.0 ## Works on PunBB: 1.2.5, 1.2.6 ## Release date: 7-13-05 ## Author: Julien VAUBOURG (CtrlAltSuppr.com - www.jsand.net) ## ## Description: Modulate management complete of the posts in mass or individual (function moderator/administrator) : ## - Move ## - Delete ## - Amalgamate (merge) ## ## Affects DB: No ## ## Affected files: viewtopic.php ## moderate.php ## lang/English/misc.php ## lang/English/topic.php ## style/imports/base.css ## ## Notes: Tested on CtrlAltSuppr.com - Translated from french ## ## DISCLAIMER: Please note that 'mods' are not officially supported by ## PunBB. Installation of this modification is done at your ## own risk. Backup your forum database and any and all ## applicable files before proceeding. ## [[url=http://www.punbb.fr/forums/viewtopic.php?id=457]French version[/url]]
Offline
Great mod Ju!
Is there any possibility to move the first post of a topic?
Offline
Yes, I see...
Is there any possibility to merge two topics?
Offline
I noticed one bug in that mod. When you amalgamate posts, the topic decreases and fits into smaller number of pages than before. Anyway the displayed number of pages remaines unchanged and the last pages are of course empty ![]()
Offline
Bulgaricus wrote:
I noticed one bug in that mod. When you amalgamate posts, the topic decreases and fits into smaller number of pages than before. Anyway the displayed number of pages remaines unchanged and the last pages are of course empty
ok !
It's good.
[color=red]I corrected the mod.[/red]
hdiff :
Replace :
// Déplacement de posts
case 'move' :
if(!isset($_POST['confirm'])) {
//confirm_referrer('viewtopic.php'); // Bug IE
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Moderate'];
require PUN_ROOT.'header.php';
?> <div class="blockform">
<h2><?php echo $lang_misc['Deplacer posts'] ?></h2>
<div class="box">
<form method="post" action="moderate.php?fid=<?php echo $fid ?>&ptid=<?php echo $_GET['ptid'] ?>&actionposts=move">
<input type="hidden" name="posts" value="<?php echo urlencode($posts) ?>" />
<div class="inform">
<fieldset>
<legend><?php echo $lang_misc['Choisir topic'] ?></legend>
<div class="infldset">
<p><?php echo $lang_misc['Topic destination'] ?><br />
<input type="text" style="width:50%" name="postsmoveto" /><br />
<br />
<input type="checkbox" name="anterieurs" value="1" /> <?php echo $lang_misc['Avertissement date'] ?></p>
</div>
</fieldset>
</div>
<p><input type="submit" name="confirm" value="<?php echo $lang_misc['Deplacer posts ok'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
</form>
</div>
</div> <?
require PUN_ROOT.'footer.php';
break;
} else {
confirm_referrer('moderate.php');
// Extraction de l'id du topic de destination
preg_match('/id=([0-9]+)/',$_POST['postsmoveto'], $postsmoveto);
if(empty($postsmoveto[1]))
message($lang_misc['Erreur topic destination']);
$posts = unserialize(urldecode(stripslashes($_POST['posts'])));
$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$postsmoveto[1].' ORDER BY posted LIMIT 1');
$topic_post_id = $db->result($result);
for($i=0; $i < count($posts); $i++) {
// On réécrit les messages qui sont plus anciens que le topic ou tous si anterieurs a été coché pour avoir un id récent
if($posts[$i] < $topic_post_id || isset($_POST['anterieurs'])) {
$post = $db->fetch_assoc($db->query('SELECT * FROM '.$db->prefix.'posts WHERE id='.$posts[$i]));
$db->query('INSERT INTO '.$db->prefix.'posts(poster,poster_id,poster_ip,poster_email,message,hide_smilies,posted,edited,edited_by,topic_id) VALUES("'.$post['poster'].'", "'.$post['poster_id'].'", "'.$post['poster_ip'].'", '.(!isset($post['poster_email']) ? 'NULL' : '"'.$post['poster_email'].'"').', "'.$post['message'].'", "'.$post['hide_smilies'].'", "'.time().'", '.(!isset($post['edited']) ? 'NULL' : '"'.$post['edited'].'"').', '.(!isset($post['edited_by']) ? 'NULL' : '"'.$post['edited_by'].'"').', "'.$postsmoveto[1].'")');
// On supprime les doublons qui comportent l'ancienne date
$db->query('DELETE FROM '.$db->prefix.'posts WHERE id='.$posts[$i]);
// On supprime la clé du topic qui n'est plus à écrire
unset($posts[$i]);
}
}
// Si il reste des topic qui sont à insérer avec leur date initiale
if(!empty($posts))
$db->query('UPDATE '.$db->prefix.'posts SET topic_id='.$postsmoveto[1].' WHERE id='.implode(' OR id=',$posts));
redirect('viewtopic.php?id='.$postsmoveto[1], $lang_misc['Posts deplaces']);
break;
}
// Supprimer des posts
case 'delete' :
if(!isset($_POST['confirm'])) {
//confirm_referrer('viewtopic.php'); // Bug IE
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Moderate'];
require PUN_ROOT.'header.php';
?> <div class="blockform">
<h2><?php echo $lang_misc['Supprimer posts'] ?></h2>
<div class="box">
<form method="post" action="moderate.php?fid=<?php echo $fid ?>&ptid=<?php echo $_GET['ptid'] ?>&actionposts=delete">
<input type="hidden" name="posts" value="<?php echo urlencode($posts) ?>" />
<div class="inform">
<fieldset>
<legend><?php echo $lang_misc['Confirmer'] ?></legend>
<div class="infldset">
<p><?php echo $lang_misc['Confirmer suppression'] ?><br />
</div>
</fieldset>
</div>
<p><input type="submit" name="confirm" value="<?php echo $lang_misc['Supprimer posts ok'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
</form>
</div>
</div> <?
require PUN_ROOT.'footer.php';
break;
} else {
confirm_referrer('moderate.php');
$posts = unserialize(urldecode(stripslashes($_POST['posts'])));
// On vérifie que le post initial du topic ne fait pas partie de la sélection
$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$_GET['ptid'].' ORDER BY posted LIMIT 1');
$topic_post_id = $db->result($result);
if(isset($posts[$topic_post_id]))
unset($posts[$topic_post_id]);
// On supprime les topics concernés
if(!empty($posts))
$db->query('DELETE FROM '.$db->prefix.'posts WHERE id='.implode(' OR id=',$posts));
redirect('viewtopic.php?id='.$_GET['ptid'], $lang_misc['Posts supprimes']);
break;
}
// Fusionner des posts
case 'fusion' :
if(!isset($_POST['confirm'])) {
//confirm_referrer('viewtopic.php'); // Bug IE
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Moderate'];
require PUN_ROOT.'header.php';
?> <div class="blockform">
<h2><?php echo $lang_misc['Fusionner posts'] ?></h2>
<div class="box">
<form method="post" action="moderate.php?fid=<?php echo $fid ?>&ptid=<?php echo $_GET['ptid'] ?>&actionposts=fusion">
<input type="hidden" name="posts" value="<?php echo urlencode($posts) ?>" />
<div class="inform">
<fieldset>
<legend><?php echo $lang_misc['Confirmer'] ?></legend>
<div class="infldset">
<p><?php echo $lang_misc['Separer fusion'] ?><br />
<textarea name="fusion_sep"></textarea><br />
<br />
<?php echo $lang_misc['Avertissement fusion'] ?>
</div>
</fieldset>
</div>
<p><input type="submit" name="confirm" value="<?php echo $lang_misc['Fusionner posts ok'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
</form>
</div>
</div> <?
require PUN_ROOT.'footer.php';
break;
} else {
confirm_referrer('moderate.php');
$posts = unserialize(urldecode(stripslashes($_POST['posts'])));
sort($posts);
reset($posts);
// On récupére et on concatène les différents messages
$message_add = '';
for($i=0; $i < count($posts); $i++)
$message_add .= $db->result($db->query('SELECT message FROM '.$db->prefix.'posts WHERE id='.$posts[$i])).$_POST['fusion_sep'];
// On écrit la concaténation à la place du message du plus ancien post
$db->query('UPDATE '.$db->prefix.'posts SET message="'.$message_add.'" WHERE id='.$posts[0]);
// On supprime tous les messages sauf le plus ancien
unset($posts[0]);
if(!empty($posts))
$db->query('DELETE FROM '.$db->prefix.'posts WHERE id='.implode(' OR id=',$posts));
redirect('viewtopic.php?id='.$_GET['ptid'], $lang_misc['Posts fusionnes']);
break;
}By :
// Déplacement de posts
case 'move' :
if(!isset($_POST['confirm'])) {
//confirm_referrer('viewtopic.php'); // Bug IE
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Moderate'];
require PUN_ROOT.'header.php';
?> <div class="blockform">
<h2><?php echo $lang_misc['Deplacer posts'] ?></h2>
<div class="box">
<form method="post" action="moderate.php?fid=<?php echo $fid ?>&ptid=<?php echo $_GET['ptid'] ?>&actionposts=move">
<input type="hidden" name="posts" value="<?php echo urlencode($posts) ?>" />
<div class="inform">
<fieldset>
<legend><?php echo $lang_misc['Choisir topic'] ?></legend>
<div class="infldset">
<p><?php echo $lang_misc['Topic destination'] ?><br />
<input type="text" style="width:50%" name="postsmoveto" /><br />
<br />
<input type="checkbox" name="anterieurs" value="1" /> <?php echo $lang_misc['Avertissement date'] ?></p>
</div>
</fieldset>
</div>
<p><input type="submit" name="confirm" value="<?php echo $lang_misc['Deplacer posts ok'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
</form>
</div>
</div> <?
require PUN_ROOT.'footer.php';
break;
} else {
confirm_referrer('moderate.php');
require PUN_ROOT.'include/search_idx.php';
// Extraction de l'id du topic de destination
preg_match('/id=([0-9]+)/',$_POST['postsmoveto'], $postsmoveto);
if(empty($postsmoveto[1]))
message($lang_misc['Erreur topic destination']);
$posts = unserialize(urldecode(stripslashes($_POST['posts'])));
$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$postsmoveto[1].' ORDER BY posted LIMIT 1');
$topic_post_id = $db->result($result);
for($i=0; $i < count($posts); $i++) {
// On réécrit les messages qui sont plus anciens que le topic ou tous si anterieurs a été coché pour avoir un id récent
if($posts[$i] < $topic_post_id || isset($_POST['anterieurs'])) {
$post = $db->fetch_assoc($db->query('SELECT * FROM '.$db->prefix.'posts WHERE id='.$posts[$i]));
$db->query('INSERT INTO '.$db->prefix.'posts(poster,poster_id,poster_ip,poster_email,message,hide_smilies,posted,edited,edited_by,topic_id) VALUES("'.$post['poster'].'", "'.$post['poster_id'].'", "'.$post['poster_ip'].'", '.(!isset($post['poster_email']) ? 'NULL' : '"'.$post['poster_email'].'"').', "'.$post['message'].'", "'.$post['hide_smilies'].'", "'.time().'", '.(!isset($post['edited']) ? 'NULL' : '"'.$post['edited'].'"').', '.(!isset($post['edited_by']) ? 'NULL' : '"'.$post['edited_by'].'"').', "'.$postsmoveto[1].'")');
// On supprime les doublons qui comportent l'ancienne date
delete_post($posts[$i], $_GET['ptid']);
// On supprime la clé du topic qui n'est plus à écrire
unset($posts[$i]);
}
}
// Si il reste des topic qui sont à insérer avec leur date initiale
if(!empty($posts))
$db->query('UPDATE '.$db->prefix.'posts SET topic_id='.$postsmoveto[1].' WHERE id='.implode(' OR id=',$posts));
redirect('viewtopic.php?id='.$postsmoveto[1], $lang_misc['Posts deplaces']);
break;
}
// Supprimer des posts
case 'delete' :
if(!isset($_POST['confirm'])) {
//confirm_referrer('viewtopic.php'); // Bug IE
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Moderate'];
require PUN_ROOT.'header.php';
?> <div class="blockform">
<h2><?php echo $lang_misc['Supprimer posts'] ?></h2>
<div class="box">
<form method="post" action="moderate.php?fid=<?php echo $fid ?>&ptid=<?php echo $_GET['ptid'] ?>&actionposts=delete">
<input type="hidden" name="posts" value="<?php echo urlencode($posts) ?>" />
<div class="inform">
<fieldset>
<legend><?php echo $lang_misc['Confirmer'] ?></legend>
<div class="infldset">
<p><?php echo $lang_misc['Confirmer suppression'] ?><br />
</div>
</fieldset>
</div>
<p><input type="submit" name="confirm" value="<?php echo $lang_misc['Supprimer posts ok'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
</form>
</div>
</div> <?
require PUN_ROOT.'footer.php';
break;
} else {
confirm_referrer('moderate.php');
require PUN_ROOT.'include/search_idx.php';
$posts = unserialize(urldecode(stripslashes($_POST['posts'])));
// On vérifie que le post initial du topic ne fait pas partie de la sélection
$result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$_GET['ptid'].' ORDER BY posted LIMIT 1');
$topic_post_id = $db->result($result);
if(isset($posts[$topic_post_id]))
unset($posts[$topic_post_id]);
// On supprime les topics concernés
foreach($posts AS $post)
delete_post($post, $_GET['ptid']);
redirect('viewtopic.php?id='.$_GET['ptid'], $lang_misc['Posts supprimes']);
break;
}
// Fusionner des posts
case 'fusion' :
if(!isset($_POST['confirm'])) {
//confirm_referrer('viewtopic.php'); // Bug IE
$page_title = pun_htmlspecialchars($pun_config['o_board_title']).' / '.$lang_misc['Moderate'];
require PUN_ROOT.'header.php';
?> <div class="blockform">
<h2><?php echo $lang_misc['Fusionner posts'] ?></h2>
<div class="box">
<form method="post" action="moderate.php?fid=<?php echo $fid ?>&ptid=<?php echo $_GET['ptid'] ?>&actionposts=fusion">
<input type="hidden" name="posts" value="<?php echo urlencode($posts) ?>" />
<div class="inform">
<fieldset>
<legend><?php echo $lang_misc['Confirmer'] ?></legend>
<div class="infldset">
<p><?php echo $lang_misc['Separer fusion'] ?><br />
<textarea name="fusion_sep"></textarea><br />
<br />
<?php echo $lang_misc['Avertissement fusion'] ?>
</div>
</fieldset>
</div>
<p><input type="submit" name="confirm" value="<?php echo $lang_misc['Fusionner posts ok'] ?>" /><a href="javascript:history.go(-1)"><?php echo $lang_common['Go back'] ?></a></p>
</form>
</div>
</div> <?
require PUN_ROOT.'footer.php';
break;
} else {
confirm_referrer('moderate.php');
require PUN_ROOT.'include/search_idx.php';
$posts = unserialize(urldecode(stripslashes($_POST['posts'])));
sort($posts);
reset($posts);
// On récupére et on concatène les différents messages
$message_add = '';
for($i=0; $i < count($posts); $i++)
$message_add .= $db->result($db->query('SELECT message FROM '.$db->prefix.'posts WHERE id='.$posts[$i])).$_POST['fusion_sep'];
// On écrit la concaténation à la place du message du plus ancien post
$db->query('UPDATE '.$db->prefix.'posts SET message="'.$message_add.'" WHERE id='.$posts[0]);
// On supprime tous les messages sauf le plus ancien
unset($posts[0]);
foreach($posts AS $post)
delete_post($post, $_GET['ptid']);
redirect('viewtopic.php?id='.$_GET['ptid'], $lang_misc['Posts fusionnes']);
break;
}Offline
Thanks for the mod, but I get this error when trying to move/delete/amalgamate posts:
Parse error: parse error, unexpected T_STRING, expecting ')' in /home/.dapper/a63548/a63548.net/forum/lang/English/misc.php on line 70
Offline
The problem is in the lang file.. he forgot to had "\" before the ' which causes the problem..
Thanks for the mod Ju ![]()
Offline
Why can't I edit my post?
oh well, there another problem, it seems the posts counter does not update..
i tried to use Maintenance but it doesn't help..
Offline
Exactly what i was looking for!
Unfortunately there seems to be a problem.. If i move a couple of posts to another thread the dates gets messed up, wich also messes up the order of the posts.
Is this the development of this mod still on?
(if so, beeing able to move the first post aswell into another topic would be nice..)
Offline
Arvid wrote:
(if so, beeing able to move the first post aswell into another topic would be nice..)
Yes this feature will be very useful for me too.
Offline
I upgraded my forum from 1.2.6 to 1.2.7 and the mod stopped working
During the upgrade I uploaded only the changed files among which there were no files affected by this mod.
Offline
What's not working about it?
Offline
It was not working the move topic feature, but it is O.K. now ![]()
Offline
Will this mod work with PunBB 1.2.14 ?
Offline
I edited the post a little... to make it more understandable ![]()
Added (merge) to the line where it says Amalgamate. Had to look it up myself ![]()
Offline
Is there any mod doing the same thing + topics merging ?
Offline
does anyone know if this mod is also compatible with the latest version of punBB forum software?
Offline
Just installing this mod.
Work perfectly on version 1.2.14.
Installing tutorial here http://www.punres.org/files/projects/pr … 9/mod.html
Notes:
1. You will not find this, if you already install PunPortal ![]()
Line 350, after :
<ul><li><a href="index.php"><?php echo $lang_common['Index'] ?>index.php & Index, already change to forum.php & Forum
2. I'll give you the English Translation from My French Friend "Ju" ![]()
LANG/ENGLISH/TOPIC.PHP At the end, replace : ); By : , 'Select label' => 'Action Select', 'Select label groupe' => 'Selection management', 'Select Action' => 'Action', 'Select Deplacer' => 'Move posts', 'Select Supprimer' => 'Delete posts', 'Select Fusionner' => 'Merge posts' );
Also, I try to translate another for more explanation. This is important parts for Moderator and Admin. Sorry, My English ![]()
LANG/ENGLISH/MISC.PHP At the end, replace : ); By : , // Mass post management 'Erreur action' => 'Error: The action not available', 'Erreur posts selection' => 'Error: You are not select any post', 'Deplacer posts' => 'Move posts', 'Choisir topic' => 'Choose the destination topic (topic URL at your browser)', 'Topic destination' => 'Destination topic URL', 'Avertissement date' => 'Check this, if you want to apply and change the moved post to the current date and displaying the post at the bottom of new destination topic. If the moved post older than destination forum, it will change to today current date. So, it will not confusing the first topic and the destinatioan topic still has older date for first topic (Please consider in some case, the order of publication date will be respected and important)<br /><br /><strong>Caution</strong>, the older posts than the topic destination will be automatically placed at the end of topic target.', 'Deplacer posts ok' => 'Move', 'Erreur topic destination' => 'Error: The destination topic URL not valid', 'Posts deplaces' => 'The posts has been moved', 'Supprimer posts' => 'Delete posts', 'Confirmer' => 'Confirm', 'Confirmer suppression' => 'Confirm to delete the selected posts ?', 'Supprimer posts ok' => 'Delete', 'Posts supprimes' => 'The posts has been deleted', 'Fusionner posts' => 'Merge posts', 'Separer fusion' => 'Use ENTER to separate between posts<br>or use custom characters by', 'Avertissement fusion' => '<strong>Note :</strong> The merged post, will have the older (first) post informations. Please check that merged posts must have same owner (poster)', 'Fusionner posts ok' => 'Merge', 'Posts fusionnes' => 'The posts has been merged' );
Enjoy the new feature of Moderation..
Offline
I tried to aply this mod to modified russian pusBB 1.2.14 but it went quite strange.
When I open topic, I can see only first Post and no later posts. Also this post has no checkbox, but inputbox with action, move etc I have...
(I have succesful MovePost 1.2 but it has no mass move for now...)
Offline
OK - When I tried to aply Easy profile fields then I got the same problem and solved.
I just had "antispam" mod inside, so by carefuly looking on diferences I aplied what I did not have.
So with these two codes variations in viewtopic.php it is working for me (others who have clean PunBB version seems that should not have these problems):
$result = $db->query('SELECT u.id AS uid, u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online, spam.id AS spam_id FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) LEFT JOIN '.$db->prefix.'spam_repository AS spam ON spam.post_id=p.id WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], false) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());<h2><span><span class="conr">#<?php echo ($start_from + $post_count) ?> </span> <?php if($is_admmod && !$is_topic_post) : ?><input type="checkbox" name="ps<?php echo $cur_post['id'] ?>" class="postselection" /><?php endif; ?> <a href="viewtopic.php?pid=<?php echo $cur_post['id'].'#p'.$cur_post['id'] ?>"><?php echo format_time($cur_post['posted']) ?></a></span></h2>
Offline