so, ich will dass eine nachricht an den user dessen gästebuch es ist ausgegeben wird, wenn eine oder mehr nachrichten in sein gästebuch geschrieben werden.
dies hätte ich so gemacht
page_header.php
finde:
Code: Alles auswählen
if ( ($userdata['session_logged_in']) && (empty($gen_simple_header)) )
{
Code: Alles auswählen
if ( $userdata['user_new_piic'] )
{
$l_piic_message_new = ( $userdata['user_new_piic'] == 1 ) ? $lang['New_piic'] : $lang['New_piics'];
$l_piic_text = sprintf($l_piic_message_new, $userdata['user_new_piic']);
}
else
{
$l_piic_text = $lang['Platzhalter'];
}
Code: Alles auswählen
'PRIVMSG_IMG' => $icon_pm,
Code: Alles auswählen
'PIIC_MESSAGE_INFO' => $l_piic_text, // piic
irgendwo einfügen
Code: Alles auswählen
{PIIC_MESSAGE_INFO}irgendwo einfügen
Code: Alles auswählen
$lang['New_piics'] = '%d neue GB-Einträge';
$lang['New_piic'] = 'Ein neuer GB-Eintrag';
$lang['Platzhalter'] = ' ';
finde:
Code: Alles auswählen
include($phpbb_root_path . 'includes/functions_guestbook.'.$phpEx);
Code: Alles auswählen
$sql = "UPDATE " . USERS_TABLE . "
SET user_new_piic = 0
WHERE user_id = " . $profiledata['user_id'];
if ( !$status = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update gb message new/read status for user', '', __LINE__, __FILE__, $sql);
}
finde:
Code: Alles auswählen
$pid = $userdata['user_id'];
if($mode != 'edit')
{
//In version 0.0.4, one new field!
$sql = "INSERT INTO ".PROFILE_GUESTBOOK_TABLE." (user_id,poster_id,bbcode,title,message,gb_time,user_guest_name) VALUES
(".$this->uid.",$pid,'$bbcode','$ti','$me','".time()."','$username');";
}
else
{
$id = intval($HTTP_GET_VARS['gb_id']);
if(empty($id)){
message_die(GENERAL_ERROR,$lang['gb_no_id'],"",__LINE__,__FILE__);
}
$sql = "UPDATE ".PROFILE_GUESTBOOK_TABLE." SET
bbcode = '$bbcode', title = '$ti', message = '$me' WHERE gb_id = $id";
}
$r = $db->sql_query($sql);
if(!$r)
{
message_die(GENERAL_ERROR,"Could not insert or update user guestbook!","",__LINE__,__FILE__,$sql);
}
Code: Alles auswählen
$sql = "UPDATE " . USERS_TABLE . "
SET user_new_piic = user_new_piic + 1
WHERE user_id = " . $this->uid . "
AND user_id <> " . $userdata['user_id'];
if ( !$status = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Could not update gb message new/read status for user', '', __LINE__, __FILE__, $sql);
}
Code: Alles auswählen
<?php
/***************************************************************************
* db_update.php
* -------------------
*
* copyright : ©2003 Freakin' Booty ;-P & Antony Bailey
* project : http://sourceforge.net/projects/dbgenerator
* Website : http://freakingbooty.no-ip.com/ & http://www.rapiddr3am.net
*
***************************************************************************/
/***************************************************************************
*
* 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=db_update.$phpEx", true));
exit;
}
if( $userdata['user_level'] != ADMIN )
{
message_die(GENERAL_MESSAGE, 'You are not authorised to access this page');
}
$page_title = 'Updating the database';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
echo '<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">';
echo '<tr><th>Updating the database</th></tr><tr><td><span class="genmed"><ul type="circle">';
$sql = array();
$sql[] = "ALTER TABLE " . $table_prefix . "users ADD COLUMN user_new_piic SMALLINT(5) UNSIGNED DEFAULT '0' NOT NULL";
for( $i = 0; $i < count($sql); $i++ )
{
if( !$result = $db->sql_query ($sql[$i]) )
{
$error = $db->sql_error();
echo '<li>' . $sql[$i] . '<br /> +++ <font color="#FF0000"><b>Error:</b></font> ' . $error['message'] . '</li><br />';
}
else
{
echo '<li>' . $sql[$i] . '<br /> +++ <font color="#00AA00"><b>Successfull</b></font></li><br />';
}
}
echo '</ul></span></td></tr><tr><td class="catBottom" height="28"> </td></tr>';
echo '<tr><th>End</th></tr><tr><td><span class="genmed">Installation is now finished. Please be sure to delete this file now.</span></td></tr>';
echo '<tr><td class="catBottom" height="28" align="center"><span class="genmed"><a href="' . append_sid("index.$phpEx") . '">Have a nice day</a></span></td></table>';
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
So, es kommt keine Fehlermeldung, aber die Nachricht dass ein oder mehrere GB-Einträge gemacht wurden, kommt auch nicht.
WARUM?
