Pagina 1 van 1

Double post merge

Geplaatst: 31 okt 2004, 08:08
door The Crow
Ik wil de double post merge mod toevoegen, maar de automatische databasefile doet het niet.
Zelf heb ik niet genoeg kennis om dit handmatig te doen.
Wie kan me helpen?

Geplaatst: 31 okt 2004, 10:30
door ElbertF
Bedoel je dit?

Code: Selecteer alles

##############################################################
## MOD Title: Double Post Control MOD
## MOD Author: Kinetix < webmaster@ikrontik.tk > (N/A) http://www.ikrontik.tk
## MOD Description: This MOD effectively stops users from posting the same message
##                  twice in a row.
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 1 Minute
## Files To Edit: 2: includes/functions_post.php 
##                   language/lang_english/lang_main.php 
## Included Files: 0
##############################################################
## For Security 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: None.
##
##############################################################
## MOD History:  None.
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
############################################################## 

# IMPORTANT: Some FIND commands only contain partial lines.  Unless the script calls for an
# "IN-LINE ADD," always add new segments of code on separate lines.  Also, before an In-Line
# Find, you'll often see a FIND.  These FINDS are there to help you locate the lines where
# In-Line FIND will work.
# 
#-----[ OPEN ]------------------------------------------ 
#
includes/functions_post.php
# 
#-----[ FIND ]------------------------------------------ 
#
		//
		// Flood control
		//
		$where_sql = ($userdata['user_id'] == ANONYMOUS) ? "poster_ip = '$user_ip'" : 'poster_id = ' . $userdata['user_id'];
		$sql = "SELECT MAX(post_time) AS last_post_time
			FROM " . POSTS_TABLE . "
			WHERE $where_sql";
		if ($result = $db->sql_query($sql))
		{
			if ($row = $db->sql_fetchrow($result))
			{
				if (intval($row['last_post_time']) > 0 && ($current_time - intval($row['last_post_time'])) < intval($board_config['flood_interval']))
				{
					message_die(GENERAL_MESSAGE, $lang['Flood_Error']);
				}
			}
		}
# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

		//
		// Double Post Control
		//
		$lastposttime = intval($row['last_post_time']);
		if($mode != 'editpost')
		{
			$sql = "SELECT pt.post_text
				FROM " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt
				WHERE $where_sql AND p.post_time = $lastposttime AND pt.post_id = p.post_id
				LIMIT 1";
			if ($result = $db->sql_query($sql))
			{
				if ($row = $db->sql_fetchrow($result))
				{
					if ($row['post_text'] == $post_message)
					{
						message_die(GENERAL_MESSAGE, $lang['Double_Post_Error']);
					}
				}
				$db->sql_freeresult($result);
			}
		}
# 
#-----[ OPEN ]------------------------------------------ 
#
language/lang_english/lang_main.php
# 
#-----[ FIND ]------------------------------------------ 
#
$lang['Flood_Error'] = 'You cannot make another post so soon after your last; please try again in a short while.';
# 
#-----[ AFTER, ADD ]------------------------------------------ 
#
$lang['Double_Post_Error'] = 'You cannot make another post with the exact same text as your last.';
# 
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
# 
# EoM 

Geplaatst: 31 okt 2004, 10:43
door The Crow
Nope, ik bedoel dit

Code: Selecteer alles

############################################################## 
## MOD Title: Double post merge
## MOD Author: Mercuree < mercuree@moldova.cc > ( Igor )
## MOD Description: 	This mod merges post text on posting
##			to the last message in topic
##			instead of adding a new one, only if
##			the poster of the last message
##			and the poster of current text is the
##			same person (double post becomes one post)
## MOD Version: 1.0.1
## 
## Installation Level: Easy
## Installation Time: 1 Minute
## 
## Files To Edit: 	posting.php
##			includes\function_post.php
##			admin\admin_board.php
##			language\lang_english\lang_admin.php
##			templates\subSilver\admin\board_config_body.tpl
## 
## Included Files: double_post_merge_mod_install.php
############################################################## 

Geplaatst: 31 okt 2004, 10:48
door ElbertF
Wat lukt je niet? Probeer anders de mod die ik postte?

Geplaatst: 31 okt 2004, 10:58
door The Crow
Die heb ik al geinstalled. Die gaat erom dat als je 2 keer achter elkaar op oke klikt dat je maar 1 keer het bericht ziet.
Ik wil degene installen dat als iemand een nieuwe reactie plaatst na een laatste reactie van hemzelf in een topic, dat dat gewoon onder zijn eigen post komt te staan en geen nieuwe post voor word geopend.
Het enige probleem is dat de automatische database update niet werkt, en ik ook niet weet hoe ik die handmatig kan toevoegen.
Ik geloof trouwens ook dat spammersheaven deze mod ook gebruikt.

Geplaatst: 31 okt 2004, 11:35
door The Crow
Dit is trouwens de foumelding die ik krijg.

Code: Selecteer alles

 Could not update database

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AFTER flood_interval' at line 1

INSERT INTO phpbb_config (config_name, config_value) VALUES ('join_interval', '18') AFTER flood_interval
Line : 55
File : /home/spamhotel.nl/www/double_post_merge_mod_install.php

Geplaatst: 31 okt 2004, 12:55
door The Crow
Iemand een idee wat ik hieraan kan doen??

Geplaatst: 31 okt 2004, 13:00
door ElbertF
Die "automatische database update", is dat een bestand? Kun je die ook even posten?

Geplaatst: 31 okt 2004, 13:57
door The Crow
Hier is hij

Code: Selecteer alles

<?php
/***************************************************************************
 *                      double_post_merge_mod_install.php
 *                            -------------------
 *   copyright            : ©2004 Mercuree
 *   built for            : Double post merge
 *
 *
 ***************************************************************************/

/***************************************************************************
 *
 *   This program 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.
 *
 ***************************************************************************/

define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);

//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//


if( !$userdata['session_logged_in'] )
{
	$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
	header($header_location . append_sid('login.'.$phpEx.'?redirect=double_post_merge_mod_install.'.$phpEx));
	exit;
}

if( $userdata['user_level'] != ADMIN )
{
	message_die(GENERAL_MESSAGE, 'You are not authorised to access this page');
}


$sql = array();
$sql[] = "INSERT INTO " . $table_prefix . "config (config_name, config_value) VALUES ('join_interval', '18') AFTER flood_interval";

for( $i = 0; $i < count($sql); $i++ )
{
	if( !$result = $db->sql_query ($sql[$i]) )
	{
		message_die(GENERAL_ERROR, 'Could not update database', '', __LINE__, __FILE__, $sql[$i]);
	}

	$sql_message .= '* ' . $sql[$i] . '<br />';
}

$message = 'Database updated successfully<br />The following queries were executed:<br /><br /><span class="genmed">' . $sql_message . '</span><br /><br />Please be sure to delete this file now<br /><br />' . sprintf ($lang['Click_return_index'], '<a href="' . append_sid ('index.'.$phpEx) . '">', '</a>');
message_die (GENERAL_MESSAGE, $message);

?>

Geplaatst: 31 okt 2004, 14:10
door ElbertF
Je kan in phpMyAdmin op deze query runnen (let op de juiste prefix):
INSERT INTO phpbb_config (config_name, config_value) VALUES ('join_interval', '18') AFTER flood_interval
Maar waarschijnlijk krijg je dezelfde foutmelding, hopelijk met iets meer details.

Geplaatst: 31 okt 2004, 14:12
door The Crow
Hoe zou ik dat moeten invoegen?? heb er niets geen ervaring mee met handmatig invullen

Geplaatst: 31 okt 2004, 14:15
door ElbertF
Weet je hoe je op phpMyAdmin moet komen? Je ziet dan linksonderin een linkje "Query Window".

Geplaatst: 31 okt 2004, 14:38
door Bee
Spambot schreef:Weet je hoe je op phpMyAdmin moet komen? Je ziet dan linksonderin een linkje "Query Window".
Sorry Spambot, die is verhuist. Het linkje zit nu onder het logo linksboven.

Geplaatst: 31 okt 2004, 14:45
door ElbertF
Bij mij niet :)

Geplaatst: 31 okt 2004, 14:57
door The Crow
Handmatig geeft hij ook die melding aan :?

Geplaatst: 31 okt 2004, 15:01
door ElbertF
Dat vermoede ik al, zegt die foutmelding iets meer dan die andere of niet?

Geplaatst: 31 okt 2004, 15:26
door The Crow
Helaas, de melding blijft hetzelfde.

Ik snap er echt niets meer van.

Geplaatst: 31 okt 2004, 16:25
door The Crow
De querycode stond verkeerd in die lijst.

Deze is het

Code: Selecteer alles

INSERT INTO bbcc_config (config_name, config_value) VALUES ('join_interval', '18');
[/code]

Geplaatst: 31 okt 2004, 16:47
door ElbertF
Werkt het nu wel?

Geplaatst: 31 okt 2004, 16:56
door The Crow
Yup werkt perfect :thumb: