Просмотр файла book_db.php

Размер файла: 2.22Kb
  1. <?php
  2.  
  3. define('IN_PHPBB', true);
  4. $phpbb_root_path = './';
  5. include($phpbb_root_path . 'extension.inc');
  6. include($phpbb_root_path . 'common.'.$phpEx);
  7. include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
  8. define('BOOK_TABLE','book');
  9.  
  10. ###################################################################################################
  11. ##
  12. ## put the SQL commands below here, the SQL commands listed below are only exampels, substitude them with the one you need ##
  13. ##
  14. ###################################################################################################
  15. $sql=array(
  16.  
  17. "CREATE TABLE ".BOOK_TABLE." (
  18. shout_id MEDIUMINT(8) UNSIGNED NOT NULL auto_increment,
  19. shout_username VARCHAR(25) NOT NULL,
  20. shout_user_id MEDIUMINT(8) NOT NULL,
  21. shout_group_id MEDIUMINT(8) NOT NULL,
  22. shout_session_time INT(11) NOT NULL,
  23. shout_ip CHAR(8) NOT NULL,
  24. shout_text TEXT NOT NULL,
  25. shout_active MEDIUMINT(8) NOT NULL,
  26. enable_bbcode TINYINT (1) NOT NULL,
  27. enable_html TINYINT (1) NOT NULL,
  28. enable_smilies TINYINT (1) NOT NULL,
  29. enable_sig TINYINT (1) NOT NULL,
  30. shout_bbcode_uid VARCHAR(10) NOT NULL,
  31. INDEX (shout_id)
  32. )",
  33. "INSERT INTO ".CONFIG_TABLE." (config_name, config_value) VALUES ('prune_shouts', '0')",
  34. );
  35.  
  36. $mods = array (
  37. 'fully integrated shoutbox','fully integrated shoutbox','fully integrated shoutbox'
  38. );
  39.  
  40.  
  41. ############################################### Do not change anything below this line #######################################
  42.  
  43. //
  44. // Start session management
  45. //
  46. $userdata = session_pagestart($user_ip, PAGE_INDEX);
  47. init_userprefs($userdata);
  48. //
  49. // End session management
  50. //
  51.  
  52. if ($userdata['user_level']!=ADMIN)
  53. message_die(GENERAL_ERROR, $lang['Not_Authorised']);
  54.  
  55.  
  56. $n=0;
  57. $message="<b>This list is a result of the SQL queries needed for this Mod</b><br/>";
  58. while($sql[$n])
  59. {
  60. $message .= ($mods[$n-1] != $mods[$n]) ? '<p><b><font size=3>'.$mods[$n].'</font></b><br/>' : '';
  61. if(!$result = $db->sql_query($sql[$n]))
  62. $message .= '<b><font color=#FF0000>[Already added]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />';
  63. else $message .='<b><font color=#0000fF>[Added/Updated]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />';
  64. $n++;
  65. }
  66. message_die(GENERAL_MESSAGE, $message);
  67. ?>