1 (22.09.2008 15:10 отредактировано niikto)

Тема: Move Post 1.1.1 исправленый

но тут история такая: тот Move Post, что можно скачать на панресе 1.1.1 - корявый, поэтому я выдрал Move Post из сборки DEXUS
он не пользует картинки и главное - у него нету корявости версии 1.1.1 - которая проявляется в коверканьи имени тему, если переносить пост в новую тему (создавать тему из поста)

при включёных нотисах он выдает их много:


a) если просто какой то один пост перенести в другой форум с созданием из него новой темы, то в переадресации вылазиют такие нотисы:

Notice: Undefined index: topic_to_move in s:\home\aa.z\maf\movepost.php on line 121
[Денвер: показать возможную причину ошибки]
Notice: Undefined variable: all_id in s:\home\aa.z\maf\movepost.php on line 161

Notice: Undefined variable: del_old_topic in s:\home\aa.z\maf\movepost.php on line 171

Notice: Undefined variable: all_id in s:\home\aa.z\maf\movepost.php on line 171

Notice: Undefined variable: new_forum in s:\home\aa.z\maf\movepost.php on line 190

вот строка 121:

        $new_topic_id = $_POST['topic_to_move'];

тоесть там это не языковой файл виноват, а виимо она должна брать имя темы откуда то из базы, но не берёт sad

и остальные нотисы как убрать?



b) если просто перенести этот пост в другую тему в этом же разделе (форуме):

Notice: Undefined variable: all_id in s:\home\aa.z\maf\movepost.php on line 161
[Денвер: показать возможную причину ошибки]
Notice: Undefined variable: del_old_topic in s:\home\aa.z\maf\movepost.php on line 171

Notice: Undefined variable: all_id in s:\home\aa.z\maf\movepost.php on line 171

Notice: Undefined variable: new_forum in s:\home\aa.z\maf\movepost.php on line 190

тоесть её ненадо имя темы, вот и не вылазит первая ошибка из прошлых


c) если пост из одной темы переносить в другой форум, но не новую тему делать, а подклеивать к уже существующей:

Notice: Undefined variable: all_id in s:\home\aa.z\maf\movepost.php on line 161
[Денвер: показать возможную причину ошибки]
Notice: Undefined variable: new_forum in s:\home\aa.z\maf\movepost.php on line 176

еще вылазили несколько ошибок, но я исправил немного movepost.php и теперь если скрыть нотисы - хотябы можно пользоваться..

Вобщем уважаемые гуру -без Вас не обойтись!

Добавлено спустя     2 минуты   2 секунды:
вот как надо ставить:

##
##
##        Mod title:  MovePost Mod
##
##      Mod version:  1.1.1
##   Works on PunBB:  1.2.11 (should work with all 1.2.*)
##     Release date:  2006-03-05
##           Author:  Frщdщric Pouget (editeur at georezo dot net)
##
##      Description:  This mod will allow to move post between topics
##                    posted in PunBB 1.2.11
##
##   Affected files:  viewtopic.php
##                    include/functions.php
##                    lang/English/topic.php
##
##       Affects DB:  No
##
##            Notes:  No new functions in this release, except the Dutch
##                    language file (thanks to HJH & elbekko).
##                    All the identified bugs have been corrected. The mod is
##                    now fully compatible with Internet Explorer.
##                   
##                    This mod allow to move to an other topic in any forum, the
##                    selected post, or all the posts belong to the original
##                    topic. It allow too to create a new topic where the
##                    post(s) will be moved.
##                   
##                    To move a Post just follow the link "Move" and follow the
##                    instructions.
##
##       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.
##
##


#
#---------[ 1. UPLOAD ]-------------------------------------------------------
#

upload/movepost.php to movepost.php
upload/lang/English/topic.php to lang/English/topic.php

#
#---------[ 2. OPEN ]---------------------------------------------------------
#

viewtopic.php


#
#---------[ 3. FIND (line: 289) ]----------------------------------------------
#

$post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'.$lang_topic['Link separator'].'</li><li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>'.$lang_topic['Link separator'].'</li><li class="postedit"><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.$lang_topic['Link separator'].'</li><li class="postquote"><a href="post.php?tid='.$id.'&amp;qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>';


#
#---------[ 4. REPLACE WITH ]---------------------------------------------------
#

$post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'.$lang_topic['Link separator'].'</li><li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>'.$lang_topic['Link separator'].'</li><li class="postquote"><a href="movepost.php?id='.$cur_post['id'].'">'.$lang_topic['Move'].'</a>'.$lang_topic['Link separator'].'</li><li class="postedit"><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.$lang_topic['Link separator'].'</li><li class="postquote"><a href="post.php?tid='.$id.'&amp;qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>'; //Move Post 1.1.1 Mod row


#
#---------[ 5. OPEN ]---------------------------------------------------------
#

include/functions.php


#
#---------[ 6. FIND (line: 345) ]---------------------------------------------
#

//
// Delete a topic and all of it's posts
//
function delete_topic($topic_id)


#
#---------[ 7. BEFORE, ADD ]--------------------------------------------------
#

//Movepost Mod 1.1.1 Block Start
//
// Update num_replies, poster, , posted, last_post, last_post_id, last_poster for a topic
//
function update_topic($topic_id)
{
    global $db;
   
    // Count number of replies in the topic
    $result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id) or error('Unable to fetch post count for topic', __FILE__, __LINE__, $db->error());
    $num_replies = $db->result($result, 0) - 1;
   
    // find the first poster and posted (could be different from the original topic)
    $result = $db->query('SELECT poster, posted FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id.' ORDER BY posted LIMIT 1') or error('Unable to fetch poster for topic', __FILE__, __LINE__, $db->error());
    list($poster, $posted ) = $db->fetch_row($result);
   
    // last_post, last_post_id, last_poster (could be different from the original topic)
    $result = $db->query('SELECT posted, id, poster FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id.' ORDER BY posted DESC LIMIT 1') or error('Unable to fetch last_post/last_post_id/last_poster for topic', __FILE__, __LINE__, $db->error());
    list($last_post, $last_post_id, $last_poster) = $db->fetch_row($result);
   
    //Finally update the Topic
    $db->query('UPDATE '.$db->prefix.'topics SET num_replies='.$num_replies.', poster=\''.$db->escape($poster).'\', posted='.$posted.', last_post='.$last_post.', last_post_id='.$last_post_id.', last_poster=\''.$db->escape($last_poster).'\' WHERE id='.$topic_id) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error());
}
//Movepost Mod 1.1.1 Block End


#
#---------[ 8. OPEN ]--------------------------------------------------------
#

lang/English/topic.php

     russian

#
#---------[ 9. FIND (line: 25) ]---------------------------------------------
#



);


#
#---------[ 10. REPLACE WITH ]--------------------------------------------------
#

,

//Mod Move Post
'Move'                =>    'Move'
);


RUS

,

//Mod Move Post
'Move'                =>    'Переместить'
);



#
#---------[ 11. SAVE, UPLOAD ]------------------------------------------------
#

вот сам файл выдернутый из сборки dexus и поправленый мной немного:

<?php
/***********************************************************************

  Frщdщric Pouget (editeur at georezo dot net)

  This file is part of the mod: Move Post 1.1.1 for PunBB.

************************************************************************/

/***********************************************************************

  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)

  PunBB is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published
  by the Free Software Foundation; either version 2 of the License,
  or (at your option) any later version.

  PunBB is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

************************************************************************/

define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';

if ($pun_user['g_id'] > PUN_MOD)
    message($lang_common['No permission']);

if (isset($_GET['id']))
{
    $sort_order_ ='';
    $sort_list_='last_post';

    $post_id = intval($_GET['id']);
    
    //Find the information from the original post
    $result = $db->query('
SELECT p.message, t.id, t.subject, t.forum_id, f.forum_name, c.cat_name, f.moderators
FROM '.$db->prefix.'posts as p
INNER JOIN '.$db->prefix.'topics as t
ON p.topic_id=t.id
INNER JOIN '.$db->prefix.'forums as f
ON t.forum_id=f.id
INNER JOIN '.$db->prefix.'categories AS c
ON c.id=f.cat_id
WHERE p.id='.$post_id) or error('Unable to find information for the post', __FILE__, __LINE__, $db->error());
    if (!$db->num_rows($result))
        message($lang_common['Bad request']);
        
    list($message, $old_topic_id, $subject, $old_fid, $forum_name, $cat_name, $moderators) = $db->fetch_row($result);

    // Sort out who the moderators are and if we are currently a moderator (or an admin)
    $mods_array = ($moderators != '') ? unserialize($moderators) : array();
    $is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;

    // Do we have permission to move this post?
    if (!$is_admmod)
        message($lang_common['No permission']);

        
    //Same forum or new one ?
    if (isset($_GET['new_fid']))
    {
        $fid =$new_fid = intval($_GET['new_fid']);
        
        if ($new_fid != $old_fid)
            $new_forum = TRUE;
        else
            $fid = $old_fid;

        // Fetch some info about new forum
        $result = $db->query('SELECT f.moderators FROM '.$db->prefix.'forums AS f WHERE f.id='.$fid) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
        if (!$db->num_rows($result))
            message($lang_common['Bad request']);

        list($moderators2) = $db->fetch_row($result);

        // Sort out who the moderators are and if we are currently a moderator (or an admin)
        $mods_array = ($moderators2 != '') ? unserialize($moderators2) : array();
        $is_admmod2 = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;

        // Do we have permission to move this post?
        if (!$is_admmod2)
            message($lang_common['No permission']);
    }
    else
        $fid = $old_fid;
    
    
    //Should be not necessary but in case ...
    if ($fid < 1)
        message($lang_common['Bad request']);
    
    
    //Count the post in the first topic
    //if result=1 (only one post in this topic) --> different process 
    $result = $db->query('SELECT count(id) FROM '.$db->prefix.'posts WHERE topic_id='.$old_topic_id) or error('Unable to count posts in topic', __FILE__, __LINE__, $db->error());
    $num_post = $db->result($result);
    if ($num_post < 1)
        message($lang_common['Bad request']);
    if ($num_post == 1)
        $del_old_topic=TRUE;
    
    
    // Load the movepost.php language file
    require PUN_ROOT.'lang/'.$pun_user['language'].'/movepost.php';
    require PUN_ROOT.'lang/'.$pun_user['language'].'/post.php';
    
    if (isset($_POST['form_sent']))
    {
        $form_sent = intval($_POST['form_sent']);
        
        $new_topic_id = $_POST['topic_to_move'];
        if ($new_topic_id == '' && $form_sent != 2)
            message($lang_movepost['Bad topic']);
        
        
        // If it's a creation of a new topic
        if ($form_sent == 2)
        {
            $new_subject = pun_trim($_POST['create_topic']);
            
            if ($new_subject == '')
                $errors[] = $lang_post['No subject'];
            else if (pun_strlen($new_subject) > 70)
                $errors[] = $lang_post['Too long subject'];
            else if ($pun_config['p_subject_all_caps'] == '0' && mb_strtoupper($subject) == $subject && $pun_user['g_id'] > PUN_MOD)
                $subject = ucwords(mb_strtolower($subject));

            if (!empty($errors)) {message($errors[0]);}
            
            // Create the topic
            $db->query('INSERT INTO '.$db->prefix.'topics (subject, forum_id) VALUES(\''.$db->escape($new_subject).'\', '.$fid.')') or error('Unable to create topic', __FILE__, __LINE__, $db->error());
            $new_topic_id = $db->insert_id();
        }
        
        
        // If all the posts move
        if (isset($_POST['move_all_post']))
        {
            // Create the list of the post
            $result = $db->query('SELECT id FROM '.$db->prefix.'posts WHERE topic_id='.$old_topic_id) or error('Unable to update user last visit data', __FILE__, __LINE__, $db->error());
            if ($db->num_rows($result))
            {
                $all_id = '';
                while ($row = $db->fetch_row($result))
                    $all_id .= (($all_id != '') ? ',' : '').$row[0];
            }
        }
        
        
        //Move post in the new topic
        if ($all_id)
            $db->query('UPDATE '.$db->prefix.'posts SET topic_id='.$new_topic_id.' WHERE id IN('.$all_id.')') or error('Unable to update user last visit data', __FILE__, __LINE__, $db->error());
        else
            $db->query('UPDATE '.$db->prefix.'posts SET topic_id='.$new_topic_id.' WHERE id='.$post_id) or error('Unable to update user last visit data', __FILE__, __LINE__, $db->error());
        
        
        //Update topics and forum if required
        update_topic($new_topic_id);
        
        
        if($del_old_topic || $all_id)
        {
            delete_topic($old_topic_id);
            update_forum($old_fid); // Update the forum FROM which the topic was moved
            
            if($new_forum)
                update_forum($new_fid);    // Update the forum FROM which the topic was moved
            
            require PUN_ROOT.'include/search_idx.php';
            // Bit silly should be probably improved: in order to remove the subject from the old topic, we need:
            // 1. remove all the words (message and subject) from the search tables 
            // 2. add the words from the message only in the search tables !!! 
            strip_search_index($post_id); 
            update_search_index('post', $post_id, $message); 
        }
        else
        {
            update_topic($old_topic_id);
            
            if($new_forum)
            {
                update_forum($old_fid);    // Update the forum FROM which the topic was moved
                update_forum($new_fid);    // Update the forum TO which the topic was moved
            }
        }
        
        redirect('viewtopic.php?pid='.$post_id.'#p'.$post_id, $lang_movepost['Mark move redirect']);
    }
    else
    {
        //Count the topics to diplayed
        $result = $db->query('SELECT count(id) FROM '.$db->prefix.'topics WHERE forum_id ='.$fid.' AND moved_to IS NULL') or error('Unable to count topics in forum', __FILE__, __LINE__, $db->error());
        $num_topics = $db->result($result);
        
        //Not add the original topic
        if ($fid == $old_fid)
            $num_topics = $num_topics-1;
        
        
        //Sort query (based on $_GET['new_fid'], $_GET['sort'] and $_GET['desc'])
        $var_query_img = $var_query = '';
        if (isset($_GET['new_fid']))
            $var_query_img .= $var_query .='&new_fid='.$fid;

        if (isset($_GET['sort']))
        {    
            $s_g=$_GET['sort'];
//            if ($s_g!='subject' && $s_g!='poster' && $s_g!='last_post' && $s_g!='num_replies') $s_g='subject';
            if (!in_array($s_g,array('subject','poster','last_post','num_replies'))) $s_g='last_post';
            $sort_list.= $s_g;
            $sort_list_=$sort_list;
            $var_query .='&sort='.$sort_list;
            
            if (isset($_GET['desc']))
            {
                $sort_list .=' DESC';
                $var_query .='&desc=1';
                $sort_order_ ='desc';
            }
        }
        else
            $sort_list= 'last_post DESC';

        $sort_list.=', subject';
        
        
        // Determine the topic offset (based on $_GET['p'])
        $num_pages = ceil($num_topics / $pun_user['disp_topics']);
        $p = (!isset($_GET['p']) || $_GET['p'] <= 1 || $_GET['p'] > $num_pages) ? 1 : $_GET['p'];
        $start_from = $pun_user['disp_topics'] * ($p - 1);
        
        
        // Generate paging links
        $paging_links = $lang_common['Pages'].': '.paginate($num_pages, $p, 'movepost.php?id='.$post_id.$var_query);
        
        
        //The topic query
        $result_topic = $db->query('SELECT id, subject, poster, last_post, num_replies FROM '.$db->prefix.'topics WHERE moved_to IS NULL AND forum_id='.$fid.' AND id <> '.$old_topic_id.' ORDER BY '.$sort_list.' LIMIT '.$start_from.','.$pun_user['disp_topics']) or error('Unable to find topics in forum', __FILE__, __LINE__, $db->error());
        
        $page_title = 'MovePost | '.pun_htmlspecialchars($pun_config['o_board_title']);        
        require PUN_ROOT.'header.php';
        
        ?>
<div class="blockform">
<h2><span><?php echo $lang_movepost['Mod move post'] ?></span></h2>
<div class="box">
<form id="qjump" method="get" action="movepost.php?id=<?php echo $post_id ?>">
<p><strong><?php echo "<a href=\"viewtopic.php?pid=".$post_id."#p".$post_id."\" />" ?><?php echo $lang_common['Go back'] ?></a></strong></p><br />
<fieldset>
<legend><?php echo $lang_movepost['Introduction'] ?></legend>
<div class="infldset">
<p><?php echo $lang_movepost['Intro'] ?></p><br />
<p><?php echo $lang_movepost['Original topic'] ?> <strong><?php echo pun_htmlspecialchars($subject) ?></strong></p>
<p><?php echo $lang_movepost['Original forum'] ?> <strong>(<?php echo pun_htmlspecialchars($cat_name).') '.pun_htmlspecialchars($forum_name) ?></strong></p>
<p><?php echo $lang_movepost['Select forum'] ?>:</p>
<div>
<select name="id" onchange="window.location=('movepost.php?id=<?php echo $post_id ?>&new_fid='+this.options[this.selectedIndex].value)">
<?php 
    $result = $db->query('SELECT c.id AS cid, c.cat_name, f.id AS fid, f.forum_name, f.moderators FROM '.$db->prefix.'categories AS c INNER JOIN '.$db->prefix.'forums AS f ON c.id=f.cat_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id='.$pun_user['g_id'].') WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND f.redirect_url IS NULL ORDER BY c.disp_position, c.id, f.disp_position', true) or error('Unable to fetch category/forum list', __FILE__, __LINE__, $db->error());
        $cur_category = 0;
        while ($cur_forum = $db->fetch_assoc($result))
        {
                $mods_array = ($cur_forum['moderators'] != '') ? unserialize($cur_forum['moderators']) : array();
            $is_admmod = ($pun_user['g_id'] == PUN_ADMIN || ($pun_user['g_id'] == PUN_MOD && array_key_exists($pun_user['username'], $mods_array))) ? true : false;
            if (!$is_admmod) continue;



            if ($cur_forum['cid'] != $cur_category)    // A new category since last iteration?
            {
                if ($cur_category)
                    echo '</optgroup>'."\n";
                
                echo '<optgroup label="'.pun_htmlspecialchars($cur_forum['cat_name']).'">'."\n";
                $cur_category = $cur_forum['cid'];
            }
            
            echo "<option value=".$cur_forum['fid'];
                if ($cur_forum['fid'] == $fid) echo " selected='selected'";
            echo " >".pun_htmlspecialchars($cur_forum['forum_name'])."</option>\n";
        }
if ($cur_category) echo '</optgroup>'
    ?>
</select>
</div>
</div>
</fieldset>
<input type="hidden" name="form_sent" value="1" />
</form>
<form id="movepost_create" method="post" action="movepost.php?id=<?php echo $post_id ?>&new_fid=<?php echo $fid ?>">
<fieldset>
<legend><?php echo $lang_movepost['Create topic'] ?></legend>
<div class="infldset">
<p><?php echo $lang_movepost['Explain create topic'] ?></p><br />
<input name="create_topic" size="70" maxlength="70" tabindex="1" type="text" />
<input name="save" value="<?php echo $lang_common['Submit'] ?>" type="submit" />
<br /><br />
<p><?php echo $lang_movepost['Move all posts'] ?> (<strong><?php echo $num_post ?></strong>)</p>
<div class="rbox">
<label><input name="move_all_post" value="1" type="checkbox" /><?php echo $lang_movepost['Explain move all posts'] ?> <br /></label>
</div>
</div>
</fieldset>
<input type="hidden" name="form_sent" value="2" />
</form>
<form id="movepost_move" method="post" action="movepost.php?id=<?php echo $post_id ?>">
<fieldset>
<legend><?php echo $lang_movepost['Move post'] ?></legend>
<div class="infldset">
<p><?php echo $lang_movepost['Explain move post'] ?></p><br />
<p><?php echo $lang_movepost['Move all posts'] ?> (<strong><?php echo $num_post ?></strong>)</p>
<div class="rbox">
<label><input name="move_all_post" value="1" type="checkbox" /><?php echo $lang_movepost['Explain move all posts'] ?> <br /></label>
</div>
<p style="TEXT-ALIGN:center;"><input name="save" value="<?php echo $lang_common['Submit'] ?>" type="submit" /></p>
<p class="pagelink conl"><?php echo $paging_links ?></p><p>&nbsp;</p>
<table class="aligntop" cellspacing="0">
<tr>
<th class="tc2" scope="col">
&nbsp;
</th>
<th scope="col"><strong>
<?php 
echo "<a href=\"movepost.php?id=".$post_id.$var_query_img.'&sort=subject';
if ($sort_list_=='subject') { if ($sort_order_!='desc') echo '&desc=1';}
echo "\">".$lang_common['Topic']."</a>";
if ($sort_list_=='subject') { if ($sort_order_=='desc') echo ' ▲'; else echo ' ▼'; }?>
</th>
</strong><th scope="col"><strong>
<?php 
echo "<a href=\"movepost.php?id=".$post_id.$var_query_img.'&sort=poster';
if ($sort_list_=='poster') { if ($sort_order_!='desc') echo '&desc=1';}
echo "\">".$lang_movepost['Poster']."</a>";
if ($sort_list_=='poster') { if ($sort_order_=='desc') echo ' ▲'; else echo ' ▼'; }?>
</th>
</strong><th scope="col"><strong>
<?php 
echo "<a href=\"movepost.php?id=".$post_id.$var_query_img.'&sort=last_post';
if ($sort_list_=='last_post') { if ($sort_order_!='desc') echo '&desc=1';}
echo "\">".$lang_movepost['Last']."</a>";
if ($sort_list_=='last_post') { if ($sort_order_=='desc') echo ' ▲'; else echo ' ▼'; }?>
</th>
</strong><th class="tc2" scope="col"><strong>
<?php 
echo "<a href=\"movepost.php?id=".$post_id.$var_query_img.'&sort=num_replies';
if ($sort_list_=='num_replies') { if ($sort_order_!='desc') echo '&desc=1';}
echo "\">".$lang_common['Replies']."</a>";
if ($sort_list_=='num_replies') { if ($sort_order_=='desc') echo ' ▲'; else echo ' ▼'; }?>
</strong></th>
</tr>
<?php
        // If there are topics in this forum.
        if ($db->num_rows($result_topic))
        {
            while ($cur_topic = $db->fetch_assoc($result_topic))
            {
                ?>
<tr>
<td class="tc2"><input name="topic_to_move" style="height:10pt" value="<?php echo $cur_topic['id'] ?>" type="radio" /></td>
<td><?php echo pun_htmlspecialchars($cur_topic['subject']) ?></td>
<td><?php echo pun_htmlspecialchars($cur_topic['poster']) ?></td>
<td><?php echo format_time($cur_topic['last_post']) ?></td>
<td class="tc2"><?php echo $cur_topic['num_replies'] ?></td>
</tr>
<?php
            }
        } 
?>
</table>
<p class="pagelink conl"><?php echo $paging_links ?></p><p>&nbsp;</p>
<p style= "TEXT-ALIGN: center;"><input name="save" value="<?php echo $lang_common['Submit'] ?>" type="submit" /></p>
</div>
</fieldset>
<input type="hidden" name="form_sent" value="3" />
<br /><p><strong><?php echo "<a href=\"viewtopic.php?pid=".$post_id."#p".$post_id."\" />" ?><?php echo $lang_common['Go back'] ?></a></strong></p>
</form>
</div>
</div>
<?php

    require PUN_ROOT.'footer.php';
    }
}
else
    message($lang_common['Bad request']);

Сайт niikto

Поделиться

2

Re: Move Post 1.1.1 исправленый

Что - то я вообще ничего не понял, тут про что разговор идёт?

Кстати, в самом последнем коде есть ошибка в файлах локализации, так что страницы с топиками вообще не должны показываться.

Поделиться

3

Re: Move Post 1.1.1 исправленый

так что насчёт мода? ибо весчь нужная
а тут как видно недоработанно и заброшенно

Поделиться

4

Re: Move Post 1.1.1 исправленый

Немного странное начало у этой темы, как впрочем и сама тема. Ведь на панресе лежит MovePost Mod версии 1.2, работоспособный, проверено на себе. Вот линк - www.punres.org/viewtopic.php?id=3077

PunBB.Ru ☭

Сайт nobody

Поделиться

5

Re: Move Post 1.1.1 исправленый

nobody прочерь пожалуйста - ты когда из середины темы переносишь пост и делаешь с НИМ новую тему - русскими буквами (длинное название какое нибудь из нескольких слов) - он его не обрезает, не коверкает?

(кодировка у тебя какая?

и включи дебаг и errors чтобы нотисы показывало - выдаетошибки-нотисы как5 выше написано?
ато если ерорс отключить - этот тоже не выдаёт. но это ж нехорошо...
жду ответа

Сайт niikto

Поделиться

6

Re: Move Post 1.1.1 исправленый

Сделал все как ты написал, все ok и с названием и с самим сообщением, ничего нигде не каверкается, нотисы не появляются.
Кодировка cp1251

У меня своя сборка, из тяжелых модов модов у меня стоят ЛС, голосовалка, репутация и еще много всего, сейчас даже не вспомню. Полный список можешь посмотреть в разделе "Выставка достижений"

Удачи!

Добавлено спустя     1 минуту  :
Гы, я теперь "Профи", смешно tongue

PunBB.Ru ☭

Сайт nobody

Поделиться

7

Re: Move Post 1.1.1 исправленый

Umenja ruskaja utf-8 modifikacija PunBB 1.2.14.
www.forum.islammuslim.lv/index.php
U menja jest nuzhen MovePost. (Vobsheta "who was online" tože, no tot mne nje poluchilsa i sovetov v rusforumume njepoluchil...)
Na punres.org njetu bolshe movepost 1.1.1. - toljko novaja versija. (Movepost 1.2)

Probovatj Movepost 1.2? Podojdjot k etoj ruskoj modifikacii?

Сайт AhmedAA

Поделиться

8

Re: Move Post 1.1.1 исправленый

думаю - да.

Сайт niikto

Поделиться

9

Re: Move Post 1.1.1 исправленый

Ja proboval ustanovitj MovePost 1.2, no njechevo nje izmenjilos. polnostju nechevo. Dazhe kazhetso shto vsjo rabotajet...

V dve chastji u menja bilo problemi v popitke modifikacii:

1) V readme napisono:

upload/movepost.php to movepost.php
upload/lang/English/topic.php to lang/English/topic.php
upload/img/movepost/* to img/movepost/*

No v failah v mapke "English" toljko odin fail: "movepost.php" a nje "topic.php".
Vso ravno perecopiruval a kogda nado modificirovatj "topic.php" modificiroval tot, kotorij tam uzhe bil.

2)
V readme bilo skazono shtobi obmenjali to shto v origianlnjom "viewtopic"srazu pod "Original".

Ja eto sdelal:

// QUICK QUOTE MOD END
        }
    }

    else
// QUICK QUOTE MOD BEGIN
//
// ORIGINAL:
//        $post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'.$lang_topic['Link separator'].'</li><li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>'.$lang_topic['Link separator'].'</li><li class="postquote"><a href="movepost.php?id='.$cur_post['id'].'">'.$lang_topic['Move'].'</a>'.$lang_topic['Link separator'].'</li><li class="postedit"><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.$lang_topic['Link separator'].'</li><li class="postquote"><a href="post.php?tid='.$id.'&amp;qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>'; //Move Post 1.2 Mod row


        // MOD: QUICK REPLY - 1 LINE FOLLOWING CODE MODIFIED
        $post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'.$lang_topic['Link separator'].'</li><li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>'.$lang_topic['Link separator'].'</li><li class="postedit"><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.$lang_topic['Link separator'].'</li><li class="postquote"><a href="post.php?tid='.$id.'&amp;qid='.$cur_post['id'].'">'.$lang_topic['Post reply'].'</a>'.$lang_topic['Link separator'].'<li class="postquote"><a onclick="copyPID(\''.$cur_post['id'].'\');" onmouseover="copyQ(\''.pun_htmlspecialchars($cur_post['username']).'\');" href="javascript:pasteQ();">'.$lang_topic['Quote'].'</a> <a class="quotehint" href="#nogo">( ! )</a>';
// QUICK QUOTE MOD END


    // Switch the background color for every message.
    $bg_switch = ($bg_switch) ? $bg_switch = false : $bg_switch = true;
    $vtbg = ($bg_switch) ? ' roweven' : ' rowodd';

No dumoju, shto mozhebit potomu shto u menja ruskaja modifikacija punBB 1.2.14, it tam napisono srazu pod to shto nado bilo obmenjatj: "MOD".
Mozhebit shto v modifikacii nuzhno obmenjat drugoje mesto? Daljshe?


Vot polnija Movepost 1.2 readme:

##
##
##        Mod title:  MovePost Mod
##
##      Mod version:  1.2
##   Works on PunBB:  1.2.14 (should work with all 1.2.*)
##     Release date:  2007-03-05
##           Author:  Frédéric Pouget (fpouget at georezo dot net)
##
##      Description:  This mod will allow to move post between topics
##                    posted in PunBB 1.2.14
##
##   Affected files:  viewtopic.php
##                    include/functions.php
##                    lang/[language]/topic.php
##
##       Affects DB:  No
##
##         Language:  Dutch, English, French, Italian
##
##            Notes:  Is possible to move a post in a new topic giving only the
##                                      topic_id.
##                    All the index's bugs mentionned by Vovochka and fews
##                    others ones have been fixed.
##
##                                        For updating just replace the file: forum/movepost.php and
##                    lang/[language]/movepost.php
##                   
##                    This mod allow to move to an other topic in any forum, the
##                    selected post, or all the posts belong to the original
##                    topic. It allow too to create a new topic where the
##                    post(s) will be moved.
##                   
##                    To move a Post just follow the link "Move" and follow the
##                    instructions.
##
##       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.
##
##


#
#---------[ 1. UPLOAD ]-------------------------------------------------------
#

upload/movepost.php to movepost.php
upload/lang/English/topic.php to lang/English/topic.php
upload/img/movepost/* to img/movepost/*

#
#---------[ 2. OPEN ]---------------------------------------------------------
#

viewtopic.php


#
#---------[ 3. FIND (line: 289) ]----------------------------------------------
#

$post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'.$lang_topic['Link separator'].'</li><li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>'.$lang_topic['Link separator'].'</li><li class="postedit"><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.$lang_topic['Link separator'].'</li><li class="postquote"><a href="post.php?tid='.$id.'&amp;qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>';


#
#---------[ 4. REPLACE WITH ]---------------------------------------------------
#

$post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'.$lang_topic['Link separator'].'</li><li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>'.$lang_topic['Link separator'].'</li><li class="postquote"><a href="movepost.php?id='.$cur_post['id'].'">'.$lang_topic['Move'].'</a>'.$lang_topic['Link separator'].'</li><li class="postedit"><a href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.$lang_topic['Link separator'].'</li><li class="postquote"><a href="post.php?tid='.$id.'&amp;qid='.$cur_post['id'].'">'.$lang_topic['Quote'].'</a>'; //Move Post 1.2 Mod row


#
#---------[ 5. OPEN ]---------------------------------------------------------
#

include/functions.php


#
#---------[ 6. FIND (line: 345) ]---------------------------------------------
#

//
// Delete a topic and all of it's posts
//
function delete_topic($topic_id)


#
#---------[ 7. BEFORE, ADD ]--------------------------------------------------
#

//Movepost Mod 1.2 Block Start
//
// Update num_replies, poster, , posted, last_post, last_post_id, last_poster for a topic
//
function update_topic($topic_id)
{
    global $db;
   
    // Count number of replies in the topic
    $result = $db->query('SELECT COUNT(id) FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id) or error('Unable to fetch post count for topic', __FILE__, __LINE__, $db->error());
    $num_replies = $db->result($result, 0) - 1;
   
    // find the first poster and posted (could be different from the original topic)
    $result = $db->query('SELECT poster, posted FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id.' ORDER BY posted LIMIT 1') or error('Unable to fetch poster for topic', __FILE__, __LINE__, $db->error());
    list($poster, $posted ) = $db->fetch_row($result);
   
    // last_post, last_post_id, last_poster (could be different from the original topic)
    $result = $db->query('SELECT posted, id, poster FROM '.$db->prefix.'posts WHERE topic_id='.$topic_id.' ORDER BY posted DESC LIMIT 1') or error('Unable to fetch last_post/last_post_id/last_poster for topic', __FILE__, __LINE__, $db->error());
    list($last_post, $last_post_id, $last_poster) = $db->fetch_row($result);
   
    //Finally update the Topic
    $db->query('UPDATE '.$db->prefix.'topics SET num_replies='.$num_replies.', poster=\''.$db->escape($poster).'\', posted='.$posted.', last_post='.$last_post.', last_post_id='.$last_post_id.', last_poster=\''.$db->escape($last_poster).'\' WHERE id='.$topic_id) or error('Unable to update last_post/last_post_id/last_poster', __FILE__, __LINE__, $db->error());
}
//Movepost Mod 1.2 Block End


#
#---------[ 8. OPEN ]--------------------------------------------------------
#

lang/English/topic.php

#
#---------[ 9. FIND (line: 25) ]---------------------------------------------
#



);


#
#---------[ 10. REPLACE WITH ]--------------------------------------------------
#

,

//Mod Move Post
'Move'                =>    'Move'
);


#
#---------[ 11. SAVE, UPLOAD ]------------------------------------------------
#

Добавлено спустя     54 минуты   49 секунд:
Kazhetsa izpravil probljemu.

Tak kak u russkoj modifikacii jest "quickpost" modifikacia, tagda nadobilo izmenjit tam. Ja nashol strochku kotoraja razlichajetsa i dobavil jejo.

Tak shto dlja etoj modifikacii u "viewtopic.php" replace dolzhen bitj tokoj:


        // MOD: QUICK REPLY - 1 LINE FOLLOWING CODE MODIFIED
        $post_actions[] = '<li class="postreport"><a href="misc.php?report='.$cur_post['id'].'">'.$lang_topic['Report'].'</a>'.$lang_topic['Link separator'].'</li><li class="postdelete"><a href="delete.php?id='.$cur_post['id'].'">'.$lang_topic['Delete'].'</a>'.$lang_topic['Link separator'].'</li><li class="postedit"><a 
href="movepost.php?id='.$cur_post['id'].'">'.$lang_topic['Move'].'</a>'.$lang_topic['Link separator'].'</li><li class="postedit"><a 
href="edit.php?id='.$cur_post['id'].'">'.$lang_topic['Edit'].'</a>'.$lang_topic['Link separator'].'</li><li class="postquote"><a href="post.php?tid='.$id.'&amp;qid='.$cur_post['id'].'">'.$lang_topic['Post reply'].'</a>'.$lang_topic['Link separator'].'<li class="postquote"><a onclick="copyPID(\''.$cur_post['id'].'\');" onmouseover="copyQ(\''.pun_htmlspecialchars($cur_post['username']).'\');" href="javascript:pasteQ();">'.$lang_topic['Quote'].'</a> <a class="quotehint" href="#nogo">( ! )</a>';
// QUICK QUOTE MOD END

Сайт AhmedAA

Поделиться

10

Re: Move Post 1.1.1 исправленый

AhmedAA
ты скажи - когда в common.php нотисы включаешь - мод версии 1.2. выдает какие то сообщения вверху страницы при переносе темы или поста?

Сайт niikto

Поделиться

11

Re: Move Post 1.1.1 исправленый

niikto пишет:

AhmedAA
ты скажи - когда в common.php нотисы включаешь - мод версии 1.2. выдает какие то сообщения вверху страницы при переносе темы или поста?

Neponemaju shto ti dumajesh s etim.
U menja etot movepost rabotajet na versiji 1.2.14 ir nje kakih problem.

Gde mne shto smatretj? Pochemu smotretj v common.php? Notisi eto: // ?

Neponjemaju vopros. Jesli moj common.php:

<?php
/***********************************************************************

  Copyright (C) 2002-2005  Rickard Andersson (rickard@punbb.org)

  This file is part of PunBB.

  PunBB is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published
  by the Free Software Foundation; either version 2 of the License,
  or (at your option) any later version.

  PunBB is distributed in the hope that it will be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  MA  02111-1307  USA

************************************************************************/

// Enable DEBUG mode by removing // from the following line
define('PUN_DEBUG', 1);

// This displays all executed queries in the page footer.
// DO NOT enable this in a production environment!
//define('PUN_SHOW_QUERIES', 1);

if (!defined('PUN_ROOT'))
    exit('The constant PUN_ROOT must be defined and point to a valid PunBB installation root directory.');


// Load the functions script
require PUN_ROOT.'include/functions.php';

// Reverse the effect of register_globals
if (@ini_get('register_globals'))
    unregister_globals();


@include PUN_ROOT.'config.php';

// If PUN isn't defined, config.php is missing or corrupt
if (!defined('PUN'))
    exit('The file \'config.php\' doesn\'t exist or is corrupt. Please run <a href="install.php">install.php</a> to install PunBB first.');


// Record the start time (will be used to calculate the generation time for the page)
list($usec, $sec) = explode(' ', microtime());
$pun_start = ((float)$usec + (float)$sec);

// Make sure PHP reports all errors except E_NOTICE. PunBB supports E_ALL, but a lot of scripts it may interact with, do not.
error_reporting(E_ALL ^ E_NOTICE);

// Turn off magic_quotes_runtime
set_magic_quotes_runtime(0);

// Strip slashes from GET/POST/COOKIE (if magic_quotes_gpc is enabled)
if (get_magic_quotes_gpc())
{
    function stripslashes_array($array)
    {
        return is_array($array) ? array_map('stripslashes_array', $array) : stripslashes($array);
    }

    $_GET = stripslashes_array($_GET);
    $_POST = stripslashes_array($_POST);
    $_COOKIE = stripslashes_array($_COOKIE);
}

// Seed the random number generator
mt_srand((double)microtime()*1000000);

// If a cookie name is not specified in config.php, we use the default (punbb_cookie)
if (empty($cookie_name))
    $cookie_name = 'punbb_cookie';

// Define a few commonly used constants
define('PUN_UNVERIFIED', 32000);
define('PUN_ADMIN', 1);
define('PUN_MOD', 2);
define('PUN_GUEST', 3);
define('PUN_MEMBER', 4);


// Load DB abstraction layer and connect
require PUN_ROOT.'include/dblayer/common_db.php';

// Start a transaction
$db->start_transaction();

// Load cached config
@include PUN_ROOT.'cache/cache_config.php';
if (!defined('PUN_CONFIG_LOADED'))
{
    require PUN_ROOT.'include/cache.php';
    generate_config_cache();
    require PUN_ROOT.'cache/cache_config.php';
}


// Enable output buffering
if (!defined('PUN_DISABLE_BUFFERING'))
{
    // For some very odd reason, "Norton Internet Security" unsets this
    $_SERVER['HTTP_ACCEPT_ENCODING'] = isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : '';

    // Should we use gzip output compression?
    if ($pun_config['o_gzip'] && extension_loaded('zlib') && (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false || strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') !== false))
        ob_start('ob_gzhandler');
    else
        ob_start();
}


// Check/update/set cookie and fetch user info
$pun_user = array();
check_cookie($pun_user);

// Attempt to load the common language file
@include PUN_ROOT.'lang/'.$pun_user['language'].'/common.php';
if (!isset($lang_common))
    exit('There is no valid language pack \''.pun_htmlspecialchars($pun_user['language']).'\' installed. Please reinstall a language of that name.');

// Check if we are to display a maintenance message
if ($pun_config['o_maintenance'] && $pun_user['g_id'] > PUN_ADMIN && !defined('PUN_TURN_OFF_MAINT'))
    maintenance_message();


// Load cached bans
@include PUN_ROOT.'cache/cache_bans.php';
if (!defined('PUN_BANS_LOADED'))
{
    require_once PUN_ROOT.'include/cache.php';
    generate_bans_cache();
    require PUN_ROOT.'cache/cache_bans.php';
}

// Check if current user is banned
check_bans();


// Update online list
update_users_online();

Добавлено спустя     3 минуты   42 секунды:
Nemnoshko ponjel.
Eto dumal:

// Make sure PHP reports all errors except E_NOTICE. PunBB supports E_ALL, but a lot of scripts it may interact with, do not.
error_reporting(E_ALL ^ E_NOTICE);

?
A zachem mne shto to tam menjat - mne vso rabotajet.

Сайт AhmedAA

Поделиться

12

Re: Move Post 1.1.1 исправленый

PunBB 1.2.16
Private_Message_Mod-1.2.3
Easy_Poll-1.1.3

Все хорошо работает с модом movepost 1.1.1 который я качал больше года назад.
А вот с movepost 1.2 проблема с обновлением кол-ва сообщений в теме и после переноса сообщений страница была пустой.
Вот ветка о проблемах мода с участием автора читать

У каждого свой взгляд на мир.

Сайт coordinator

Поделиться