Mutarea posturilor dintr-un topic intr-un alt topic existent

Aici sunt asteptate sugestiile de imbunatatire a forumului.

Moderator: Echipa Tehnica

Matrixu
pasionat
Mesaje: 2318
Membru din: Vin 15-Apr-2005 11:27
Localitate: Bucuresti
Contact:

Mutarea posturilor dintr-un topic intr-un alt topic existent

Mesajde Matrixu » Dum 11-Feb-2007 13:15

Zilele trecute am instalat la forumurile mele, un MOD care permite mutarea mesajelor dintr-un topic intr-un alt topic deja existent. Mi se pare un lucru extraordinar de util.
De ce nu il implementati si pe phpBB-ul asta?

Avatar utilizator
MARIAN
Admin CITROclub
Mesaje: 3044
Membru din: Mar 11-Noi-2003 18:34
Localitate: Buzau
Masina: Xantia 1.9TD VSX
2: C5 2.0 HDI 110CP
Contact:

Mesajde MARIAN » Dum 11-Feb-2007 22:32

Asa cum "Regulamentul Forumului" a venit abia dupa ce au aparut problemele, probabil ca atunci cand va fi necesara, functia "merge" se va implementa. La tine era altceva, sunt multe subiecte, multi bezmetici care posteaza aiurea...

Matrixu
pasionat
Mesaje: 2318
Membru din: Vin 15-Apr-2005 11:27
Localitate: Bucuresti
Contact:

Mesajde Matrixu » Lun 12-Feb-2007 00:37

Poate daca stateai tu sa muti toate topicurile de la C4, altfel vedeai lucrurile acum
E mai mult decat necesara optiunea, avand in vedere ca iti ia max 5 min sa o instalezi...

Cat despre bezmetici care posteaza aiurea....fiecare cum se descurca! Daca ar exista doar oameni de calitate, n-am mai avea discutia asta!

eugenro2001
RETRAS LA PENSIE
Mesaje: 2436
Membru din: Mie 05-Mar-2003 09:19
Localitate: Bucuresti

Mesajde eugenro2001 » Lun 12-Feb-2007 09:09

Nimeni nu contesta utilitatea acestei facilitati. Daca sti ca merge si pe aceasta versiune de Php, poate ar fi mai bine sa ne dai mai multe detalii, de unde se downloadeaza, cum se instaleaza, etc.

Avatar utilizator
MARIAN
Admin CITROclub
Mesaje: 3044
Membru din: Mar 11-Noi-2003 18:34
Localitate: Buzau
Masina: Xantia 1.9TD VSX
2: C5 2.0 HDI 110CP
Contact:

Mesajde MARIAN » Lun 12-Feb-2007 10:58

Poate daca stateai tu sa muti toate topicurile de la C4, altfel vedeai lucrurile acum

Vorbeai de o functie care unseste topicuri deci, atunci nu ti-ar fi fost necesara ca doar le-ai mutat.
Cat despre bezmetici care posteaza aiurea....fiecare cum se descurca! Daca ar exista doar oameni de calitate, n-am mai avea discutia asta!

Aici iti dau dreptate... bine ca nu postezi si aiurea
E mai mult decat necesara optiunea, avand in vedere ca iti ia max 5 min sa o instalezi...

Una peste alta ar pute fi utila functia dar, trebuie studiat daca merge pe varianta aceasta si daca nu ingreuneaza incarcarea forumului(eu unul tin la viteza de incarcare).

Matrixu
pasionat
Mesaje: 2318
Membru din: Vin 15-Apr-2005 11:27
Localitate: Bucuresti
Contact:

Mesajde Matrixu » Lun 12-Feb-2007 13:50

eugenro2001 scrie:Nimeni nu contesta utilitatea acestei facilitati. Daca sti ca merge si pe aceasta versiune de Php, poate ar fi mai bine sa ne dai mai multe detalii, de unde se downloadeaza, cum se instaleaza, etc.


O sa va dau diseara linkul si instructiunile, pe o adresa de mail...Teoretic trebuie sa mearga si nu necesita cunostiinte de php,html sau mai stiu eu ce.
@Marian, data viitoare cand se mai face vreo modificare de genul celei C4(daca se va mai face), sa o faci tu si sa imi zici daca ai fi nevoie sau nu de facilitatea asta.
Nu ingreuneaza cu nimic forumul, va mai aparea un field in ecranul de splitare, deci modifcare nu va fi vizibila decat moderatorilor.

Matrixu
pasionat
Mesaje: 2318
Membru din: Vin 15-Apr-2005 11:27
Localitate: Bucuresti
Contact:

Mesajde Matrixu » Mar 13-Feb-2007 19:03

##############################################################
## MOD Title: Split posts and merge in one step
## MOD Author: asinshesq < asinsh@speakeasy.net > (Alan Sinsheimer) N/A
## MOD Description: Allow admin to split posts from a topic (using the regular split feature) and merge them
## into an existing topic in a single step
##
## MOD Version: 1.0.3
##
## Installation Level: Easy
## Installation Time: 5 Minutes ( 1 minute with easymod)
##
## Files To Edit: modcp.php
## language/lang_english/lang_main.php
## templates/subSilver/modcp_split.tpl
##
## Included Files: n/a
##
##############################################################
## For xxxxxx Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes: n/a
##############################################################
## MOD History:
##
## 2005-5-06 - Version 1.0.3
## added an intval to protect against injection risk
##
## 2005-4-09 - Version 1.0.2
## a few more changes in textual instructions to ensure that the instructions don't wrap on monitors
## with resolutions lower than 1280 accross
##
## 2005-4-09 - Version 1.0.1
## a few changes in textual instructions suggested by mistakeprone (no change in functionality)
##
## 2005-4-08 - Version 1.0.0
## initial version
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]-------------------------------------------------
#
modcp.php

#
#-----[ FIND ]-------------------------------------------------
#
$sql = "SELECT post_id, poster_id, topic_id, post_time

#
#-----[ BEFORE, ADD ]-------------------------------------------------
#
// start mod split posts and merge in one step
// check to see if subject (new title of split topic) is empty...if so, and if there is a destination topic, do the regular split (copied from the regular modcp code) and then change the split posts to the destination topic
if (empty($HTTP_POST_VARS['subject']))
{
if (!empty($HTTP_POST_VARS['destination_topic']))
{
$destination_topic = $HTTP_POST_VARS['destination_topic'];

// the next block of code is borrowed from the simply merge mod...it extracts the topic id from topic_id, topic url or post url
// is this a direct value ?
$num_topic = intval($destination_topic);
if ($destination_topic == "$num_topic")
{
$destination_topic_id = $num_topic;
}
// is this a url with topic id or post id ?
else
{
$name = explode('?', $destination_topic);
$parms = ( isset($name[1]) ) ? $name[1] : $name[0];
parse_str($parms, $parm);
$found = false;
$destination_topic_id = 0;
while ((list($key, $val) = each($parm)) && !$found)
{
$vals = explode('#', $val);
$val = $vals[0];
if (empty($val))
{
$val = 0;
}
else $val = intval($val);
switch($key)
{
case POST_POST_URL:
$sql = "SELECT topic_id FROM " . POSTS_TABLE . " WHERE post_id=$val";
if ( !($result = $db->sql_query($sql)) ) message_die(GENERAL_ERROR, 'Could not get post information', '', __LINE__, __FILE__, $sql);
if ($row = $db->sql_fetchrow($result))
{
$val = $row['topic_id'];
$found = true;
}
break;

case POST_TOPIC_URL:
$found = true;
break;
}
if ($found)
{
$destination_topic_id = $val;
}
}
}

// done with getting topic_id
// now, get forum id for destination topic
$sql = "SELECT forum_id
FROM " . TOPICS_TABLE . "
WHERE topic_id = $destination_topic_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not get forum information for destination topic', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$destination_forum_id = $row['forum_id'];
$db->sql_freeresult($result);

// if there is no forum_id (probably because there is no such topic_id), give error message
if ($destination_forum_id == '') message_die(GENERAL_MESSAGE, 'Could not get forum information (no such topic_id?)');

// now get the posts that are being spit....
$sql = "SELECT post_id, poster_id, post_time
FROM " . POSTS_TABLE . "
WHERE post_id IN ($post_id_sql)
ORDER BY post_time ASC";
if (!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not get post information', '', __LINE__, __FILE__, $sql);
}

if ($row = $db->sql_fetchrow($result))
{
$post_time = $row['post_time'];
$user_id_sql = intval($row['poster_id']);
$post_id_sql = intval($row['post_id']);
}

do
{
$user_id_sql .= (($user_id_sql != '') ? ', ' : '') . intval($row['poster_id']);
$post_id_sql .= (($post_id_sql != '') ? ', ' : '') . intval($row['post_id']);
}
while ($row = $db->sql_fetchrow($result));

// Update topic watch table, switch users whose posts
// have moved, over to watching the destination topic
$sql = "UPDATE " . TOPICS_WATCH_TABLE . "
SET topic_id = $destination_topic_id
WHERE topic_id = $topic_id
AND user_id IN ($user_id_sql)";
if (!$db->sql_query($sql))
{
message_die(GENERAL_ERROR, 'Could not update topics watch table', '', __LINE__, __FILE__, $sql);
}

$sql_where = (!empty($HTTP_POST_VARS['split_type_beyond'])) ? " post_time >= $post_time AND topic_id = $topic_id" : "post_id IN ($post_id_sql)";

// now do a sql for switching the split posts over to the destination topic and forum
$sql = "UPDATE " . POSTS_TABLE . "
SET topic_id = $destination_topic_id, forum_id = $destination_forum_id
WHERE $sql_where";
if (!$db->sql_query($sql, END_TRANSACTION))
{
message_die(GENERAL_ERROR, 'Could not update posts table', '', __LINE__, __FILE__, $sql);
}

sync('topic', $destination_topic_id);
sync('topic', $topic_id);
sync('forum', $destination_forum_id);
sync('forum', $forum_id);

$template->assign_vars(array(
'META' => '<meta http-equiv="refresh" content="3;url=' . "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$destination_topic_id&amp;sid=" . $userdata['session_id'] . '">')
);

$message = $lang['Topic_split'] . '<br /><br />' . sprintf($lang['Click_return_topic'], '<a href="' . "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$destination_topic_id&amp;sid=" . $userdata['session_id'] . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
}
}
// end mod split posts and merge in one step

#
#-----[ FIND ]-------------------------------------------------
#
'L_POST' => $lang['Post'],

#
#-----[ AFTER, ADD ]-------------------------------------------------
#
'L_IF_TITLE_BLANK' => $lang['If_title_blank'],
'L_DESTINATION_TOPIC' => $lang['Destination_topic'],
'L_DESTINATION_TOPIC_FORMAT' => $lang['Destination_topic_format'],

#
#-----[ OPEN ]-------------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]-------------------------------------------------
#
$lang['Topic_split'] = 'The selected topic has been split successfully';

#
#-----[ AFTER, ADD ]-------------------------------------------------
#
// start mod split posts and merge in one step
$lang['If_title_blank'] = '<br />(specify new topic title; leave blank to merge split-off posts into existing topic specified below)';
$lang['Destination_topic'] = 'Destination topic';
$lang['Destination_topic_format'] = '<br />(if merging into existing topic, insert topic id or url of that topic, or insert url of a post in that topic)';
// end mod split posts and merge in one step

#
#-----[ OPEN ]-------------------------------------------------
#
templates/subSilver/modcp_split.tpl

#
#-----[ FIND ]-------------------------------------------------
#
<td class="row2" colspan="2"><input class="post" type="text" size="35" style="width: 350px" maxlength="60" name="subject" /></td>

#
#-----[ REPLACE WITH ]-------------------------------------------------
#
<td class="row2" colspan="2"><input class="post" type="text" size="35" style="width: 350px" maxlength="60" name="subject" /><span class="gensmall">{L_IF_TITLE_BLANK}</span></td>

#
#-----[ FIND ]-------------------------------------------------
#
<tr>
<td class="row1" nowrap="nowrap"><span class="gen">{L_SPLIT_FORUM}</span></td>
<td class="row2" colspan="2">{S_FORUM_SELECT}</td>
</tr>

#
#-----[ AFTER, ADD ]-------------------------------------------------
#
<tr>
<td class="row1" nowrap="nowrap"><span class="gen">{L_DESTINATION_TOPIC}</span></td>
<td class="row2" colspan="2"><input class="post" type="text" size="35" style="width: 350px" maxlength="60" name="destination_topic" /><span class="gensmall">{L_DESTINATION_TOPIC_FORMAT}</span></td>
</tr>

#
#-----[ SAVE/CLOSE ALL FILES ]--------------------------------
#
# EoM

Matrixu
pasionat
Mesaje: 2318
Membru din: Vin 15-Apr-2005 11:27
Localitate: Bucuresti
Contact:

Mesajde Matrixu » Mar 13-Feb-2007 19:32

Cu rectificarea:

Se foloseste fisierul langmain.PHP din directorul cu limba romana.

eugenro2001
RETRAS LA PENSIE
Mesaje: 2436
Membru din: Mie 05-Mar-2003 09:19
Localitate: Bucuresti

Mesajde eugenro2001 » Mar 13-Feb-2007 21:44

Multumesc.

Matrixu
pasionat
Mesaje: 2318
Membru din: Vin 15-Apr-2005 11:27
Localitate: Bucuresti
Contact:

Mesajde Matrixu » Mar 13-Feb-2007 22:51

Spor la treaba...


Înapoi la “Sugestii/Discutii despre forum”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 11 vizitatori

  •  Cauta in forum
  • Advanced search


  •  Mesaje
  • 07.05.2021 - Ca urmare a unor update-uri efectuate pe serverul de gazduire in 5 februarie 2021, Forumul clubcitroen.ro a suferit niste probleme de compatibilitate cu noul sistem de operare. Din acest motiv, astazi a fost migrat pe un VPS nou. Forumul functioneaza acum in parametri normali. Nu a fost sesizata nici o pierdere de date.





  •  Statistici
  • Totals
    Total mesaje 187757
    Total subiecte 18618
    Total Announcements: 8
    Total Stickies: 86
    Total Attachments: 0

    Topics per day: 2
    Posts per day: 24
    Users per day: 2
    Topics per user: 2
    Posts per user: 16
    Posts per topic: 10

    Total membri 11707
    Cel mai nou membru catalinos