login  Naam:   Wachtwoord: 
Registreer je!
 Forum

HULP gevraagd bij Phpbb2

Offline capilisa - 22/07/2005 18:19 (laatste wijziging 22/07/2005 18:42)
Avatar van capilisaNieuw lid ik ben bezig met het maken van een premodded phpbb2 en dit lukt redelijk maar na installatie zegt de phpbb2 verwijderd map /install en map /contrib

Het is gelukt dit in de instal fase te verwijderen dus hij vraagt dit niet maar het probleem is dat ik na de install nog 1 file moet laten runnen en dit lukt ook maar je moet er bepaalde gegevens invullen en op een knop drukken en dan geeft hij weer dat die maps enzo niet meer bestaan is dit te verhelpen via een code


Hierbij de php code die ik gebruik

  1. <?PHP
  2.  
  3. /***************************************************************************
  4.  * installer.php
  5.  * ---------------
  6.  * Version : 1.0.1
  7.  * Email : austin_inc@hotmail.com
  8.  * Site : http://phpbb-amod.com
  9.  *
  10.  ***************************************************************************/
  11.  
  12. /***************************************************************************
  13.  * delete the right files
  14.  * ----------------------
  15.  * Version : 1.0.0
  16.  * Email : admin@prutsemie.com
  17.  * Site : http://www.prutsemie.com
  18.  *
  19.  ***************************************************************************/
  20. // delete the install files
  21. $file[] = "install/install.php";
  22. $file[] = "install/upgrade.php";
  23. $file[] = "install/updates.php";
  24. $file[] = "install/update_to_latest.php";
  25. $file[] = "install/index.htm";
  26. $file[] = "install/schemas/index.htm";
  27. $file[] = "install/schemas/ms_access_primer.zip";
  28. $file[] = "install/schemas/mysql_basic.sql";
  29. $file[] = "install/schemas/mysql_schema.sql";
  30. // delete the contrib files
  31. $file[] = "contrib/dbinformer.php";
  32. $file[] = "contrib/template_db_cache.php";
  33. $file[] = "contrib/template_file_cache.php";
  34. $file[] = "contrib/fixfiles.sh";
  35. $file[] = "contrib/README.html";
  36. // delete the blend files
  37. $file[] = "/BlendAdmin/admin_downloads_config.php";
  38. $file[] = "/images/new_download.gif";
  39. $file[] = "/language/lang_english/lang_blend_downloads.php";
  40. $file[] = "/templates/subSilver/downloads_body.tpl";
  41. $file[] = "downloads.php";
  42. for($i=0; $i<count($file); $i++){
  43.  
  44. unlink($file[$i]);
  45. }
  46. // delete the install + contribmap
  47. $repertoire = "install/schemas";
  48. $repertoire1 = "install";
  49. $repertoire2 = "contrib";
  50. if (is_dir($repertoire)) rmdir ($repertoire);
  51. if (is_dir($repertoire1)) rmdir ($repertoire1);
  52. if (is_dir($repertoire2)) rmdir ($repertoire2);
  53. /***************************************************************************/
  54.  
  55. define('IN_PHPBB', true);
  56. $phpbb_root_path = './';
  57. include($phpbb_root_path . 'extension.inc');
  58. include($phpbb_root_path . 'common.'.$phpEx);
  59.  
  60. $userdata = session_pagestart($user_ip, PAGE_INDEX);
  61. init_userprefs($userdata);
  62.  
  63. $page_title = 'phpBB Security Install';
  64. echo "<br><br><br>";
  65.  
  66. $mode = ($_POST['mode']) ? $_POST['mode'] : $HTTP_POST_VARS['mode'];
  67.  
  68. if (!$mode)
  69. {
  70. echo 'Below, we will set up your DB values, so your site will be unique & dynamic!<br><br>';
  71. echo '
  72. <form name="build_install" action="security_install.php" method="post">
  73. <p>Choose an admin config name. This can be anything. Try to keep it 1 or 2 words
  74. max IE. <b>admins_allowed</b>. I would not suggest using that, but you get the
  75. idea.</p>
  76. <br><br>
  77. <input type="text" value="" name="admin" size="30" class="post">
  78. <br><br><br>
  79. <p>Choose a mod config name. This can be anything. Try to keep it 1 or 2 words
  80. max IE. <b>mods_allowed</b>. I would not suggest using that, but you get the
  81. idea.</p>
  82. <br><br>
  83. <input type="text" value="" name="mods" size="30" class="post">
  84. <br><br><br>
  85. <p>Choose a disable config name. This can be anything. Try to keep it 1 or 2 words
  86. max IE. <b>block_unwanted</b>. I would not suggest using that, but you get the
  87. idea.</p>
  88. <br><br>
  89. <input type="text" value="" name="name" size="30" class="post">
  90. <br>
  91. <input type="hidden" value="submit" name="mode">
  92. <input type="submit" class="mainoption" value=" Submit " onchange="document.build_install.submit()">
  93. </form>';
  94. }
  95.  
  96. if ($mode == 'submit')
  97. {
  98. $admin = ($_POST['admin']) ? $_POST['admin'] : $HTTP_POST_VARS['admin'];
  99. $mod = ($_POST['mods']) ? $_POST['mods'] : $HTTP_POST_VARS['mods'];
  100. $name = ($_POST['name']) ? $_POST['name'] : $HTTP_POST_VARS['name'];
  101.  
  102. if (empty($admin) || empty($mod) || empty($name))
  103. message_die(GENERAL_ERROR, 'All three fields are REQUIRED. Please click <b>Back</b> &amp; try again.', 'Error');
  104.  
  105. $sql = array();
  106. $sql[] = "DROP TABLE IF EXISTS ". $table_prefix ."phpBBSecurity";
  107. $sql[] = "CREATE TABLE `". $table_prefix ."phpBBSecurity` (
  108. `ban_id` mediumint(8) NOT NULL auto_increment,
  109. `ban_ip` varchar(15) NOT NULL default '',
  110. `ban_reason` varchar(50) NOT NULL default '0',
  111. `ban_date` int(10) NOT NULL default '0',
  112. `ban_attempts` int(10) NOT NULL default '0',
  113. `ban_link` text NOT NULL,
  114. PRIMARY KEY (`ban_id`)
  115. ) TYPE=MyISAM PACK_KEYS=0 AUTO_INCREMENT=1;";
  116.  
  117. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_login_limit', '3');";
  118. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_notify_admin', '1');";
  119. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_notify_admin_id', '". $userdata['user_id'] ."');";
  120. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_auto_ban', '1');";
  121. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_allowed_sessions', '50');";
  122. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('". $admin ."', '2');";
  123. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('". $mod ."', '0');";
  124. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('". $name ."', '1');";
  125. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_DDoS_Ban', '1');";
  126. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_Encoded_Ban', '1');";
  127. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_Union_Ban', '1');";
  128. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_Clike_Ban', '1');";
  129. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_SQL_Ban', '1');";
  130. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_File_Ban', '1');";
  131. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_Perl_Ban', '1');";
  132. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_total_attempts', '0');";
  133. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_Cback_Ban', '1');";
  134. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_Allow_Change', '0');";
  135. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_notify_admin_pm', '1');";
  136. $sql[] = "INSERT INTO ". CONFIG_TABLE ." VALUES ('phpBBSecurity_notify_admin_em', '1');";
  137.  
  138. $sql[] = "ALTER TABLE ". USERS_TABLE ." ADD phpBBSecurity_answer TEXT NOT NULL;";
  139. $sql[] = "ALTER TABLE ". USERS_TABLE ." ADD phpBBSecurity_question TEXT NOT NULL;";
  140. $sql[] = "ALTER TABLE ". USERS_TABLE ." ADD phpBBSecurity_login_tries smallint(5) NOT NULL default '0';";
  141. $sql[] = "ALTER TABLE ". USERS_TABLE ." ADD phpBBSecurity_pm_sent smallint(1) NOT NULL default '0';";
  142.  
  143. for ($b = 0; $b < count($sql); $b++)
  144. {
  145. if (!$result = $db->sql_query($sql[$b]))
  146. {
  147. $error = $db->sql_error();
  148. echo $sql[$b] .'<br><br><b>Error: </b>'. $error['message'] .'<br>';
  149. }
  150. else
  151. {
  152. echo $sql[$b]. '<br><br><b>Successfully Completed. </b>';
  153. }
  154. }
  155.  
  156. echo '<br><br><p><b>
  157. Install complete. Please open phpbb_security.php that was provided with the download. Find
  158. the below & change it as posted below. Basically you are changing the return lines in each
  159. of the functions to reflect your new fields you just created. If you skip this step, your
  160. board WILL NOT function properly.
  161. <br><br>
  162. <b>FIND</b>
  163. function phpBBSecurity_AdminConfigName()
  164. {
  165. return \'phpBBSecurity_max_admins\';
  166. }
  167. <br><br>
  168. <b>REPLACE WITH</b>
  169. function phpBBSecurity_AdminConfigName()
  170. {
  171. return \''. $admin .'\';
  172. }
  173. <br><br>
  174. <b>FIND</b>
  175. function phpBBSecurity_ModConfigName()
  176. {
  177. return \'phpBBSecurity_max_mods\';
  178. }
  179. <br><br>
  180. <b>REPLACE WITH</b>
  181. function phpBBSecurity_ModConfigName()
  182. {
  183. return \''. $mod .'\';
  184. }
  185. <br><br>
  186. <b>FIND</b>
  187. function phpBBSecurity_UseSpecial()
  188. {
  189. return \'phpBBSecurity_use_max\';
  190. }
  191. <br><br>
  192. <b>REPLACE WITH</b>
  193. function phpBBSecurity_UseSpecial()
  194. {
  195. return \''. $name .'\';
  196. }
  197. <br><br>
  198. <b>CLOSE & SAVE</b>
  199. <br><br>
  200. <p>I have set your board to allow 2 admins &amp; no mods. You need to goto
  201. the ACP -> General Admin -> Configuration & scroll down to <b>phpBB Security :: Special Fields.</b>
  202. And set the numbers correctly so your admins & mods can view the site. <br><br><b>NOW DELETE THIS FILE.</b></p>';
  203. }
  204. print "<br />If the upgrade completed without error you may click <a href=\"./../index.$phpEx\">Here</a> to proceed to the index<br />";
  205.  
  206. ?>

4 antwoorden

Gesponsorde links
Offline Dolfje - 22/07/2005 18:26
Avatar van Dolfje Gouden medailleGouden medailleGouden medaille

PHP ver gevorderde
chmod-probleem?
Offline Rens - 22/07/2005 18:29
Avatar van Rens Gouden medaille

Crew algemeen
Je gooit eerst de mappen weg, en daarna wil je er nog een of meerdere bestanden uit gebruiken...
Zelfde als op je computer als je een spel eraf gooit en je het daarna wil gaan spelen:
het lukt niet.

FF iets aan je code veranderen dus, dat hij je mappen pas weggooid nadat je helemaal klaar bent.
Offline Ontani - 22/07/2005 18:31
Avatar van Ontani Gouden medailleGouden medailleGouden medailleGouden medaille

-1
mappen worden manueel verwijderd
Offline Rens - 22/07/2005 18:36 (laatste wijziging 22/07/2005 18:36)
Avatar van Rens Gouden medaille

Crew algemeen
Ik ken PHPBB ook, en ik weet ook dat je ze met de hand moet verwijderen.
Maar door het volgende stukje text dacht ik dat ze door het script verwijderen werden:

Citaat:
ik ben bezig met het maken van een premodded phpbb2 en dit lukt redelijk maar na installatie zegt de phpbb2 verwijderd map /install en map /contrib

Het is gelukt dit in de instal fase te verwijderen dus hij vraagt dit niet maar het probleem is dat ik na de install nog 1 file moet laten runnen en dit lukt ook maar [...]


Owjah, ennuh, zet die code nou eens tussen codetags:!:
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.207s