Seite 2 von 3

Verfasst: 18.01.2006 21:47
von iceyboy
der hagily hat mir ne db_update.php datei geschrieben, vermutlich ist da aber ein fehler drin....

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(); 


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">&nbsp;</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.<br />If you have run into any errors, please visit the <a href="http://www.phpbbsupport.co.uk" target="_phpbbsupport">phpBBSupport.co.uk</a> and ask someone for help.</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); 

?>

Verfasst: 18.01.2006 22:06
von Markus67
Hi ...

welche meldung kommt denn wenn du die Datei aufrufst?

Markus

Verfasst: 18.01.2006 22:10
von iceyboy
dass das update erfolgreich ausgeführt wurde...

aber die meldung ist ein wenig anders als bei den anderen mods die ich bisher eingebaut hab...

ich versteh das alles nicht :(

Verfasst: 18.01.2006 22:15
von Markus67
Hi ...

vielleicht bin ich ja auch blind ... aber wo wird da was der DB hinzugefügt?

Markus

Verfasst: 18.01.2006 22:19
von iceyboy
keine ahnung ich sag ja, dass ich denke, dass da ein fehler drin ist...

weißt du wie man solche dateien schreibt? dann kannst mir ja vielleicht helfen auf meinem weg....

Code: Alles auswählen

Run the following command on your sql database (replace phpbb_ with your db prefix):
##
## ALTER TABLE `phpbb_users` ADD `user_reminded` TINYINT(4) DEFAULT '0' NOT NULL 
das muss ich an der db ändern

Verfasst: 18.01.2006 22:22
von Markus67
Hi ...

speichere die hier als installer.php und rufe sie im Browser auf ....

Code: Alles auswählen

<?php

define('IN_PHPBB', true);
$phpbb_root_path = './';
include_once($phpbb_root_path . 'extension.inc');
include_once($phpbb_root_path . 'common.'.$phpEx);
include_once($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
define('SITE_HISTORY_TABLE', $table_prefix.'site_history');

###################################################################################################
##
## put the SQL commands below here, the SQL commands listed below are only exampels, substitude them with the one you need ##
##
###################################################################################################
$sql=array(
'ALTER TABLE '.USERS_TABLE.' ADD user_reminded TINYINT(4) DEFAULT "0" not null '
);

$mods = array ( 
'DB-Installer',
);

############################################### Do not change anything below this line #######################################

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

if ($userdata['user_level']!=ADMIN)
      message_die(GENERAL_ERROR, "You are not Authorised to do this"); 
$n=0;
$message="<b>This list is a result of the SQL queries needed for the additional mods in the pre-moded pack</b><br/><br/>";
while($sql[$n])
{
	$message .= ($mods[$n-1] != $mods[$n]) ? '<p><b><font size=3>'.$mods[$n].'</font></b><br/>' : '';
	if(!$result = $db->sql_query($sql[$n])) 
	$message .= '<b><font color=#FF0000>[Already added]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />';
	else $message .='<b><font color=#0000fF>[Added/Updated]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />';
	$n++;
}
 message_die(GENERAL_MESSAGE, $message); 
?>
Markus

Verfasst: 18.01.2006 22:27
von iceyboy
:D :D :D super es geht!!!! jetzt bin i aber froh..... danke schön, mal wieder hast du mir geholfen.....


weißt du was über den mod user email list?? der download geht schon nicht....

Verfasst: 18.01.2006 23:10
von Markus67
iceyboy hat geschrieben::D :D :D super es geht!!!! jetzt bin i aber froh..... danke schön, mal wieder hast du mir geholfen.....


weißt du was über den mod user email list?? der download geht schon nicht....
Hi ...

was soll der MOD können bzw. machen?

Markus

Verfasst: 18.01.2006 23:15
von iceyboy
Dieser MOD gibt alle eMail-Adressen der User in der Datenbank in einer Liste im Adminpanel aus.
Diese Funktion kann dazu hilfreich sein, alle Mailadressen aus der Datenbank auszulesen, um anschließend z.B. einen Newsletter zu versenden.

so stehts in dem, der nicht funktioniert....

http://www.phpbb.de/moddb/mod.php?id=149

Verfasst: 18.01.2006 23:55
von Markus67
Hi ...

und was funktioniert bei dem MOD nicht ... gibts da einen extra Topic?

Markus