Mod vraagje

Installatie lukt niet? Plotseling een foutmelding. Of weet je niet hoe iets werkt. Problemen met phpBB2 kun je in dit archief opzoeken.
Forumregels

Sinds 1 januari 2009 wordt phpBB2 niet meer ondersteund.
Onderstaande informatie is verouderd en dient uitsluitend als archief.
phpBB2.0.x
Gesloten
Faster
Berichten: 68
Lid geworden op: 11 feb 2005, 21:48

Mod vraagje

Bericht door Faster » 28 feb 2005, 18:47

Omdat ik niets ken van mods instaleren en mijn engels bar slecht is heb ik een vraagje, want ik wil wel eens mods proberen te instaleren :D

Wat bedoelen ze met


#
#-----[ REPLACE WITH ]---------------------------------------
#
// The place of the deleted PM on register mod of AbelaJohnB
#


Moet ik onderstaande regels veranderen in bovenstaande regel ? of bedoelen ze iets anders.

#
#-----[ FIND ]------------------------------------------
#

// START - SEND PM ON REGISTER MOD - AbelaJohnB
//
// According to 'netclectic' we need to set the datastamp to '9999999999' in order to
// insure the pop-up notification about a new message existing. I concur with 'netclectic'
// and have thus made the change to his suggestion. Thanks netclectic!
//
$sql = "UPDATE " . USERS_TABLE . "
SET user_new_privmsg = '1', user_last_privmsg = '9999999999'
WHERE user_id = $user_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
}

$register_pm_subject = $lang['register_pm_subject'];
$register_pm = $lang['register_pm'];
$privmsgs_date = date("U");
$sql = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) VALUES ('0', '" . str_replace("\'", "''", addslashes(sprintf($register_pm_subject,$board_config['sitename']))) . "', '2', " . $user_id . ", " . $privmsgs_date . ", '0', '1', '1', '0')";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not insert private message sent info', '', __LINE__, __FILE__, $sql);
}

$privmsg_sent_id = $db->sql_nextid();
$privmsgs_text = $lang['register_pm_subject'];
//
$sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_text) VALUES ($privmsg_sent_id, '" . str_replace("\'", "''", addslashes(sprintf($register_pm,$board_config['sitename'],$board_config['sitename']))) . "')";
if ( !$db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not insert private message sent text', '', __LINE__, __FILE__, $sql);
}
// END - SEND PM ON REGISTER MOD - AbelaJohnB


De mod code

Code: Selecteer alles

##########################################################################################
## MOD Title: Send PM On User Registration uninstall 
## MOD Author: Duvelske ( Richard Wagtmans ) http://www.vitrax.vze.com
## MOD Version: 1.0.0
## Installation Level: Easy 
## Installation Time: ~3 Minutes 
## Files To Edit: includes/usercp_register.php, language/lang_english/lang_main.php
## Included Files: n/a 
##########################################################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/downloads/ 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/downloads/ 
##########################################################################################
##############################################################
## Author Notes:
## This uninstall is only neccesary if you use the send pm on user registration mod by AbelaJohnB
## Otherwise this install neccesary. so if it's not neccesary please close it and forget it :P
##############################################################
#
#-----[ OPEN ]------------------------------------------ 
#
includes/usercp_register.php

#
#-----[ FIND ]------------------------------------------ 
#

        // START - SEND PM ON REGISTER MOD - AbelaJohnB
	//
	// According to 'netclectic' we need to set the datastamp to '9999999999' in order to
	// insure the pop-up notification about a new message existing. I concur with 'netclectic'
	// and have thus made the change to his suggestion. Thanks netclectic!
        //
	$sql = "UPDATE " . USERS_TABLE . " 
		SET user_new_privmsg = '1', user_last_privmsg = '9999999999'
				WHERE user_id = $user_id";
		if ( !($result = $db->sql_query($sql)) )
        {
		    message_die(GENERAL_ERROR, 'Could not update users table', '', __LINE__, __FILE__, $sql);
        }

        $register_pm_subject = $lang['register_pm_subject'];
        $register_pm = $lang['register_pm'];
        $privmsgs_date = date("U");
        $sql = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) VALUES ('0', '" . str_replace("\'", "''", addslashes(sprintf($register_pm_subject,$board_config['sitename']))) . "', '2', " . $user_id . ", " . $privmsgs_date . ", '0', '1', '1', '0')";
        if ( !$db->sql_query($sql) )
		{
			message_die(GENERAL_ERROR, 'Could not insert private message sent info', '', __LINE__, __FILE__, $sql);
		}

		$privmsg_sent_id = $db->sql_nextid();
		$privmsgs_text = $lang['register_pm_subject'];
        //
        $sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_text) VALUES ($privmsg_sent_id, '" . str_replace("\'", "''", addslashes(sprintf($register_pm,$board_config['sitename'],$board_config['sitename']))) . "')";
        if ( !$db->sql_query($sql) )
		{
			message_die(GENERAL_ERROR, 'Could not insert private message sent text', '', __LINE__, __FILE__, $sql);
		}
        // END - SEND PM ON REGISTER MOD - AbelaJohnB

# 
#-----[ REPLACE WITH ]---------------------------------------
# 
// The place of the deleted PM on register mod of AbelaJohnB
#
#-----[ OPEN ]------------------------------------------ 
#
language/lang_english/lang_main.php

[color=red]#
#-----[ FIND ]------------------------------------------ 
#

// START - SEND PM ON REGISTER MOD - AbelaJohnB 
$lang['register_pm_subject'] = 'Welcome to %s'; 
$lang['register_pm'] = 'Hello!<br /><br />Welcome to %s. <br /><br />We hope you enjoy your time at this site! <br /><br />Feel free to join in and share with others or start your own discussion! <br /><br />~Enjoy!<br />%s Staff '; 
// END - SEND PM ON REGISTER MOD - AbelaJohnB[/color]


[color=blue]#
#-----[ REPLACE WITH ]------------------------------------------ 
#
// The place of the deleted PM on register mod of AbelaJohnB
#[/color]#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ 
#
# EoM
[/b]

Gebruikersavatar
Paul
Beheerder
Beheerder
Berichten: 20316
Lid geworden op: 23 okt 2003, 11:38
Locatie: Utrecht
Contacteer:

Bericht door Paul » 28 feb 2005, 18:53

Staat in de kb een tut over.

http://www.phpbb.nl/kb.php?mode=article&k=24

En weer was ik eerder :lol:
Laatst gewijzigd door Paul op 28 feb 2005, 18:56, 1 keer totaal gewijzigd.

LoYaL
Berichten: 754
Lid geworden op: 15 okt 2004, 19:20
Contacteer:

Bericht door LoYaL » 28 feb 2005, 18:55

Replace With=Veranderen naar
Add after=Voeg daarna toe ( volgende regel)
Aff before=Voeg een regel ervoor toe...
add after in line=voeg achteraan in die regel
add before in line= voeg ervoor in die regel

SQL--> Moet je uitvoeren in je database, en als je een sql.php of een install krijgt moet je hem uitvoeren en daarna meteen deleten..

Kijk anders voor meer info in de Kennisbank :thumb:

Faster
Berichten: 68
Lid geworden op: 11 feb 2005, 21:48

Bericht door Faster » 28 feb 2005, 22:09

Thnx maar ik heb gekozen voor een simpele oplossing.
De bestanden van de gedownloade mod te verwijderen :roll:
Ik ga over op chinese les, lijkt mij makkelijker :lol:

Gesloten