[MOD] Split posts and merge /Mesajları böl ve birleştir

[url=http://www.phpbbturkey.com/mods.html:34cnv4ga]phpBB 2.0.x MOD Veritabanımızda[/url:34cnv4ga] yayınlanan ve tarafınızca eklenen tüm yeni phpBB 2.0.x sürümleri için MODların duyuruları buradan yapılmaktadır. MODlar hakkında ihtiyacınız olan desteği lütfen [b:34cnv4ga]2.0.x MOD Destek[/b:34cnv4ga] forumuna başlık açarak sorunuz.
Kullanıcı avatarı
cupra
Kayıtlı Kullanıcı
Mesajlar: 2505
Kayıt: 01.04.2006, 02:33
Konum: smyrna
İletişim:

[MOD] Split posts and merge /Mesajları böl ve birleştir

Mesaj gönderen cupra »

bu yönetici modla kullanıcı mesajlarını istediğimiz diğer bir başlığın içindeki mesajlarla birleştirebiliyoruz, mesajları başlıktan ayırabiliyoruz.. yani mesajları bir başlıktan bir başlığa gezdirebiliyoruz..:)
bu mod normal ayırma fonksiyonuna ek olarak konulardaki başlık altına verilen cevapları birleştiriliyor, yerlerini değiştiriyor tek mesaj var ise iki başlığı birleştirmiyor


[ resmi görüntülemek için tıklayın ]

Kod: Tümünü seç

############################################################## 
## MOD Title:		Split posts and merge in one step
## MOD Author: asinshesq < N/A > (Alan) 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.3a
## 
## 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
##
## License:		http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
############################################################## 
## Author Notes:	n/a
############################################################## 
## MOD History:
##
##   2006-5-20	- Version 1.0.3a
##		  no changes...just repacked to be validated against phpbb2.0.20
##
##   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&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&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

Kod: Tümünü seç

// start mod split posts and merge in one step
$lang['If_title_blank'] = '<br />(Yeni konu başlığı belirleyin; yada burayı boş bırakarak aşağıdaki hedef başlığı kullanarak varolan bir başlığa mesajınızı taşıyabilirsiniz)';
$lang['Destination_topic'] = 'Hedef Başlık';
$lang['Destination_topic_format'] = '<br />(Birleştirme işlemi varolan bir başlığa yapılacaksa, Başlık ID No sunu; yada o başlığın url adresini, yada başlığın içindeki mesajın url adresini yazın)';
// end mod split posts and merge in one step
bu bölüm tarafımdan Türkçeleştirilmiştir.

mod'un orijinal bölümü

Kod: Tümünü seç

// 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
En son cupra tarafından 27.07.2006, 16:49 tarihinde düzenlendi, toplamda 4 kere düzenlendi.
Kullanıcı avatarı
CaN_BaKıR
Kayıtlı Kullanıcı
Mesajlar: 459
Kayıt: 17.03.2006, 01:16

Mesaj gönderen CaN_BaKıR »

Malesef çalışmıyor...

İlk eklediğinüz gün kurmuştum ama denemek nasip olmamıştı.. Geçen gün birisi ile aynı anda aynı konuda başlık açtık ve mesajları birleştireyim dedim.. Mesajın linkini yapıştırıp yaptım ama hiçbirşey olmazdı... Mesjaın başlığını yazdım yine tık yok... :roll:
[ resmi görüntülemek için tıklayın ]
phpBB Nasıl Kurulur
https://www.phpbbturkey.com/viewtopic.php?t=35
Mod Nasıl Kurulur
https://www.phpbbturkey.com/viewtopic.php?t=108

Lütfen Özel Mesaj Atıp Soru Sormayınız !!!
Kullanıcı avatarı
cupra
Kayıtlı Kullanıcı
Mesajlar: 2505
Kayıt: 01.04.2006, 02:33
Konum: smyrna
İletişim:

Mesaj gönderen cupra »

dosyalarla ilgili bir durumm mu sözkonusu acaba bende çaılışıyor..
o 3 dosyayı gönderin kontrol edeyim..
Kullanıcı avatarı
CaN_BaKıR
Kayıtlı Kullanıcı
Mesajlar: 459
Kayıt: 17.03.2006, 01:16

Mesaj gönderen CaN_BaKıR »

lang_main.php ile alakası olduğunu sanmıyorum sonuçta o sadece dil dosyası...

Diğer ikisi önemli olan modun çalışmasını sağlayan olduğuna göre onları gönderiyorum...

modcp.php
http://www.hemenpaylas.com/download/736 ... p.php.html

modcp_split.tpl
http://www.hemenpaylas.com/download/736 ... t.tpl.html

Şimdiden teşekkürler...
[ resmi görüntülemek için tıklayın ]
phpBB Nasıl Kurulur
https://www.phpbbturkey.com/viewtopic.php?t=35
Mod Nasıl Kurulur
https://www.phpbbturkey.com/viewtopic.php?t=108

Lütfen Özel Mesaj Atıp Soru Sormayınız !!!
Kullanıcı avatarı
cupra
Kayıtlı Kullanıcı
Mesajlar: 2505
Kayıt: 01.04.2006, 02:33
Konum: smyrna
İletişim:

Mesaj gönderen cupra »

mod cp de bir sorun buldum kodu yanlış yazmışlardı ben kendime göre uygulamıştım demekki burda değiştirmemişim.. değiştirdim; dosya yedeğini alarak bunu bir denermisin..
http://www.hemenpaylas.com/download/736 ... p.php.html
'L_IF_TITLE_BLANK' => $lang['If_title_blank'],
'L_DESTINATION_TOPIC' => $lang['Destination_topic'],
'L_DESTINATION_TOPIC_FORMAT' => $lang['Destination_topic_format'],
üsteki diğer benzer kodlarla aynı hizada olması gerekiyordu sendekiler tam hizalanmamıştı.. işallah olur..
not:wordpad le aç notepad le bozuk olabilir...
En son cupra tarafından 17.05.2006, 03:12 tarihinde düzenlendi, toplamda 1 kere düzenlendi.
Kullanıcı avatarı
CaN_BaKıR
Kayıtlı Kullanıcı
Mesajlar: 459
Kayıt: 17.03.2006, 01:16

Mesaj gönderen CaN_BaKıR »

Yok hocam yine olmadı :(

Ama şöyle bir durum var bu modu kurduktan sonra şu oldu... Resimde kırmızı ile gösterdiğim yerde seç kutucuğu kayboldu :(

[ resmi görüntülemek için tıklayın ]
[ resmi görüntülemek için tıklayın ]
phpBB Nasıl Kurulur
https://www.phpbbturkey.com/viewtopic.php?t=35
Mod Nasıl Kurulur
https://www.phpbbturkey.com/viewtopic.php?t=108

Lütfen Özel Mesaj Atıp Soru Sormayınız !!!
Kullanıcı avatarı
cupra
Kayıtlı Kullanıcı
Mesajlar: 2505
Kayıt: 01.04.2006, 02:33
Konum: smyrna
İletişim:

Mesaj gönderen cupra »

mod cp de bir değişiklik yapmadıysan yani başka kod eklenmediyse benimkilerle bir dene istersen dicem..
yedek elıp benimkileri at karıştırma dikkat et..
http://www.hemenpaylas.com/download/737 ... a.zip.html
not kullanıcılar direkt olarak bunları kullanabilirsiniz eğer başka bir mod kurmadıysanız.. yada yaptıklarınızı kontrol edebilirsiniz..
En son cupra tarafından 17.05.2006, 03:37 tarihinde düzenlendi, toplamda 2 kere düzenlendi.
Kullanıcı avatarı
cupra
Kayıtlı Kullanıcı
Mesajlar: 2505
Kayıt: 01.04.2006, 02:33
Konum: smyrna
İletişim:

Mesaj gönderen cupra »

yanlış annlamadıysam ilk mesajdaki kutu yok oldu bendede ilk mesajların kutucuğu yok.. bu hep böyleydi hatırladığım kadarıyla..
En son cupra tarafından 17.05.2006, 03:49 tarihinde düzenlendi, toplamda 1 kere düzenlendi.
Kullanıcı avatarı
CaN_BaKıR
Kayıtlı Kullanıcı
Mesajlar: 459
Kayıt: 17.03.2006, 01:16

Mesaj gönderen CaN_BaKıR »

Birde seninki ile deniyeyim bakalım nasıl olacak.. modcp ye başka mod kurduğumu katırlamıyorum.. İnşallah kurmamışımdır :D
[ resmi görüntülemek için tıklayın ]
phpBB Nasıl Kurulur
https://www.phpbbturkey.com/viewtopic.php?t=35
Mod Nasıl Kurulur
https://www.phpbbturkey.com/viewtopic.php?t=108

Lütfen Özel Mesaj Atıp Soru Sormayınız !!!
Kullanıcı avatarı
CaN_BaKıR
Kayıtlı Kullanıcı
Mesajlar: 459
Kayıt: 17.03.2006, 01:16

Mesaj gönderen CaN_BaKıR »

Hocam sorunu buldum tamam benim eski dosyalar ile de bölüyor veya birleştiriyor tamam....

Sorun şu başlık altına verilen cevapları birleştiriyor tek mesaj var ise iki başlığı birleştirmiyor... Sadece mesajları birleştirebiliyor bu mod.. Yani ilk mesaj hariç diğer mesajlarda başarılı bir şekilde çalışıyor... ;)
[ resmi görüntülemek için tıklayın ]
phpBB Nasıl Kurulur
https://www.phpbbturkey.com/viewtopic.php?t=35
Mod Nasıl Kurulur
https://www.phpbbturkey.com/viewtopic.php?t=108

Lütfen Özel Mesaj Atıp Soru Sormayınız !!!
Kullanıcı avatarı
cupra
Kayıtlı Kullanıcı
Mesajlar: 2505
Kayıt: 01.04.2006, 02:33
Konum: smyrna
İletişim:

Mesaj gönderen cupra »

evet aynen öyle :) kodlarda bir hata yok sanırım zaten olmasaydı uygulamayı yanlış yapıyorsun diyecektim..
:)
senin siteye üye oldum ama onayın lazım :D
Kullanıcı avatarı
CaN_BaKıR
Kayıtlı Kullanıcı
Mesajlar: 459
Kayıt: 17.03.2006, 01:16

Mesaj gönderen CaN_BaKıR »

Onaylanmıştır :D
[ resmi görüntülemek için tıklayın ]
phpBB Nasıl Kurulur
https://www.phpbbturkey.com/viewtopic.php?t=35
Mod Nasıl Kurulur
https://www.phpbbturkey.com/viewtopic.php?t=108

Lütfen Özel Mesaj Atıp Soru Sormayınız !!!
adin
Kayıtlı Kullanıcı
Mesajlar: 26
Kayıt: 23.06.2006, 18:13
İletişim:

Mesaj gönderen adin »

ben aynısını yaptım ama değişen bişey olmadı
Kullanıcı avatarı
cupra
Kayıtlı Kullanıcı
Mesajlar: 2505
Kayıt: 01.04.2006, 02:33
Konum: smyrna
İletişim:

Mesaj gönderen cupra »

adin yazdı:ben aynısını yaptım ama değişen bişey olmadı
başlığı taşı simgesine tıklarsan değişimi çözersin..
bu mod ekstra bir buton eklemiyor varolan yerlere ekleme yapıyor resimde olduğu gibi.
Kullanıcı avatarı
RaMSeN
Kayıtlı Kullanıcı
Mesajlar: 58
Kayıt: 28.04.2006, 15:39

Mesaj gönderen RaMSeN »

Hocam modu kurdum.. Herhangi bir sorun yok.. Yapmak istediğim şu..

Adamın biri yeni konu açmış.. O açtığı konudaki yazdığı mesajı bir alttaki konuya mesaj olarak göndermek ve onun açtığı konuyu silmek istiyorum ama açılan konudaki mesajı diğer konuya taşıyamıyorum :?
Kilitli

“2.0.x MOD Duyuruları” sayfasına dön

Kimler çevrimiçi

Bu forumu görüntüleyen kullanıcılar: Hiç bir kayıtlı kullanıcı yok ve 2 misafir