Custom User Rank
Geplaatst: 08 mei 2005, 21:05
Hoi allemaal,
Ik had de cusom user rank geinstalleerd maar dat liep niet lekker, ik kreeg allerlei vage foutmeldingen.
Om de mod aan de gang te krijgen moest ik onderstaande db_update.php draaien.
Kan iemand mij vertellen hoe ik dat weer terug kan draaien?
Alvast bedankt voor de moeite,
Lotte
Ik had de cusom user rank geinstalleerd maar dat liep niet lekker, ik kreeg allerlei vage foutmeldingen.
Om de mod aan de gang te krijgen moest ik onderstaande db_update.php draaien.
Kan iemand mij vertellen hoe ik dat weer terug kan draaien?
Code: Selecteer alles
<?
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path .'extension.inc');
include($phpbb_root_path .'common.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
if( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) )
{
$mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
}
else
{
$mode = '';
}
if( $userdata['user_level'] != ADMIN )
{
message_die(GENERAL_ERROR, 'what are you looking for?');
}
if( $board_config['default_lang'] == 'german' )
{
$l_install = '<font color="green">hinzufügen</font>';
$l_uninstall = '<font color="red">entfernen</font>';
$l_explain = ' wird geändert.';
$l_information = 'Nicht vergessen db_update.php vom Server zu <b>löschen</b> sobald die Installation beendet ist.';
$not_added = '<font color="red"><b>Tabelle konnte nicht angepasst werden.</b></font><br />Zur <a href="db_update.'.$phpEx.'">Hauptseite</a> zurückkehren.';
$added = '<font color="green"><b>Tabelle erfolgreich angepasst.</b></font><br />Zur <a href="db_update.'.$phpEx.'">Hauptseite</a> zurückkehren.';
}
else
{
$l_install = '<font color="green">add</font>';
$l_uninstall = '<font color="red">remove</font>';
$l_explain = ' will be altered.';
$l_information = 'Do not forget to <b>delete</b> db_update.php after finishing the installation.';
$not_added = '<font color="red"><b>Table couldn´t be altered.</b></font><br />Return to <a href="db_update.'.$phpEx.'">main site</a>.';
$added = '<font color="green"><b>Table altered successfully.</b></font><br />Return to <a href="db_update.'.$phpEx.'">main site</a>.';
}
$page_title = 'Installation (Hack: Custom User Rank)';
include($phpbb_root_path .'includes/page_header.'.$phpEx);
if( !empty($mode) )
{
switch( $mode )
{
case 'custom_install':
$sql = "ALTER TABLE ". USERS_TABLE ." ADD user_custom_rank VARCHAR(50) AFTER user_rank, ADD user_allow_rank TINYINT(1) default '1' AFTER user_custom_rank";
break;
case 'custom_uninstall':
$sql = "ALTER TABLE ". USERS_TABLE ." DROP user_custom_rank, DROP user_allow_rank";
break;
case 'allow_custom_install':
$sql = "INSERT INTO ". CONFIG_TABLE ." (config_name, config_value) VALUES ('allow_custom_rank', '100')";
break;
case 'allow_custom_uninstall':
$sql = "DELETE FROM ". CONFIG_TABLE ." WHERE config_name = 'allow_custom_rank'";
break;
default:
message_die(GENERAL_ERROR, 'what are you looking for?');
break;
}
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, $not_added, '', __LINE__, __FILE__, $sql);
}
else
{
message_die(GENERAL_MESSAGE, $added, '', __LINE__, __FILE__, $sql);
}
exit;
}
?>
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
<td align="left" class="nav"><a href="<?php echo append_sid("index.$phpEx") ?>" class="nav"><?php echo sprintf($lang['Forum_Index'], $board_config['sitename']) ?></a></td>
</tr>
</table>
<table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0">
<tr>
<th class="thHead" height="25"><b><?php echo $lang['Information'] ?></b></th>
</tr>
<tr>
<td class="row1" height ="25"><span class="genmed"><?php echo $l_information ?></b></th>
</tr>
<tr>
<td class="row1">
<table width="60%" align="center" cellspacing="1" cellpadding="1" border="1">
<tr>
<td width="80%"><span class="gen"> <b>user_custom_rank | user_allow_rank</b></span><br /> <span class="gensmall"><?php echo "<b>". USERS_TABLE ."</b>". $l_explain ?></span></td>
<td align="center"><span class="genmed"> <a href="<?php echo append_sid("db_update.$phpEx?mode=custom_install") ?>" class="genmed"><?php echo $l_install ?></a> |
<a href="<?php echo append_sid("db_update.$phpEx?mode=custom_uninstall") ?>" class="genmed"><?php echo $l_uninstall ?></a></span></td>
</tr>
<tr>
<td width="80%"><span class="gen"> <b>allow_custom_rank</b></span><br /> <span class="gensmall"><?php echo "<b>". CONFIG_TABLE ."</b>". $l_explain ?></span></td>
<td align="center"><span class="genmed"> <a href="<?php echo append_sid("db_update.$phpEx?mode=allow_custom_install") ?>" class="genmed"><?php echo $l_install ?></a> |
<a href="<?php echo append_sid("db_update.$phpEx?mode=allow_custom_uninstall") ?>" class="genmed"><?php echo $l_uninstall ?></a></span></td>
</tr>
</table></td>
</tr>
</table>
<?
include($phpbb_root_path .'includes/page_tail.'.$phpEx);
?>
Lotte