Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Funkcje PHP w wtyczce XML
alkesz1718
post 18.01.2021, 02:21:22
Post #1





Grupa: Zarejestrowani
Postów: 98
Pomógł: 0
Dołączył: 8.12.2014
Skąd: Czernina

Ostrzeżenie: (0%)
-----


Witam,
Nie wiem czy to dobry dział ale borykam się z pewnym problemem z wtyczką XML.
Otóż do pewnego modułu robię instalację za pomocą wtyczki XML ale mam problemy bo podczas wgrywania wtyczki nie tworzy mi pliku konfiguracyjnego natomiast po odinstalowaniu tej wtyczki z pliku .htaccess nie kasuje mi wszystkich zapisanych wartości.

Wtyczka wygląda tak:
http://wklejto.pl/880556


Podczas instalacji w tej wtyczce nie działa mi ta zmienna:
  1. $forum_config = "
  2. <?PHP
  3.  
  4. //System Configurations
  5.  
  6. \$forum_config = array (
  7.  
  8. 'forum_title' => 'DLE Forum 2.7',
  9.  
  10. 'forum_url' => '',
  11.  
  12. 'meta_descr' => '',
  13.  
  14. 'meta_keywords' => '',
  15.  
  16. 'meta_topic' => '1',
  17.  
  18. 'sep_subforum' => ',&amp;nbsp;',
  19.  
  20. 'fullforum' => '1',
  21.  
  22. 'sep_moderators' => ',&amp;nbsp;',
  23.  
  24. 'last_abc' => '20',
  25.  
  26. 'mod_rewrite' => '1',
  27.  
  28. 'wysiwyg' => '0',
  29.  
  30. 'offline' => '0',
  31.  
  32. 'timestamp' => 'j F Y H:i',
  33.  
  34. 'sessions_log' => '1',
  35.  
  36. 'session_time' => '15',
  37.  
  38. 'stats' => '1',
  39.  
  40. 'online' => '1',
  41.  
  42. 'forum_bar' => '1',
  43.  
  44. 'topic_inpage' => '25',
  45.  
  46. 'topic_hot' => '30',
  47.  
  48. 'post_inpage' => '20',
  49.  
  50. 'post_hide' => '10',
  51.  
  52. 'topic_abc' => '0',
  53.  
  54. 'post_maxlen' => '10000',
  55.  
  56. 'auto_wrap' => '80',
  57.  
  58. 'post_update' => '1',
  59.  
  60. 'last_plink' => '1',
  61.  
  62. 'hide_forum' => '0',
  63.  
  64. 'topic_sort' => '1',
  65.  
  66. 'topic_email' => '1',
  67.  
  68. 'forum_pr_imp' => 'Important:',
  69.  
  70. 'forum_pr_vote' => 'Sondage:',
  71.  
  72. 'forum_pr_modr' => 'Moderateur:',
  73.  
  74. 'forum_pr_sub' => 'Sous-forum:',
  75.  
  76. 'mod_report' => '0',
  77.  
  78. 'flood_time' => '15',
  79.  
  80. 'warn' => '1',
  81.  
  82. 'warn_max' => '5',
  83.  
  84. 'warn_day' => '3',
  85.  
  86. 'warn_show' => '1',
  87.  
  88. 'warn_show_all' => '0',
  89.  
  90. 'warn_sh_pg' => '0',
  91.  
  92. 'subscription' => '1',
  93.  
  94. 'mod_icq' => '1',
  95.  
  96. 'mod_rank' => '1',
  97.  
  98. 'reputation' => '1',
  99.  
  100. 'ses_forum' => '1',
  101.  
  102. 'ses_topic' => '1',
  103.  
  104. 'bot_agent' => '1',
  105.  
  106. 'discuss' => '1',
  107.  
  108. 'discuss_title' => '1',
  109.  
  110. 'discuss_title_tpl' => 'Article: {post_title}',
  111.  
  112. 'tools_disc_post' => '1',
  113.  
  114. 'discuss_post_tpl' => 'Les discussions sur ce sujet: {post_title}',
  115.  
  116. 'set_topic_post' => '1',
  117.  
  118. 'set_post_num_up' => '0',
  119.  
  120. 'set_post_num_day' => '1',
  121.  
  122. 'topic_new_day' => '5',
  123.  
  124. 'set_sub_last_up' => '1',
  125.  
  126. 'upload_type' => 'zip,rar,exe,doc,pdf',
  127.  
  128. 'img_upload' => '1',
  129.  
  130. 'img_size' => '1024',
  131.  
  132. 'thumb_size' => '150',
  133.  
  134. 'jpeg_quality' => '85',
  135.  
  136. 'tag_img_width' => '0',
  137.  
  138. 'warn_group' => '1',
  139.  
  140. 'search_captcha' => '5',
  141.  
  142. 'topic_captcha' => '5',
  143.  
  144. 'post_captcha' => '5',
  145.  
  146. 'tools_upload' => '1',
  147.  
  148. 'tools_poll' => '1:2',
  149.  
  150. 'warn_show_group' => '1:2:3',
  151.  
  152. 'rep_edit_group' => '1',
  153.  
  154. 'forum_faq' => '1',
  155.  
  156. 'version_id' => '2.7.1',
  157.  
  158. );
  159.  
  160. ?>
  161. ";
  162.  
  163. $con_file = fopen('engine/data/forum_config.php', 'w+');
  164. fwrite($con_file, $forum_config);
  165. fclose($con_file);


natomiast podczas usówania wtyczki nie działa mi ta zmienna:
  1. $edit_files = array
  2. (
  3. 'open' => ROOT_DIR.'/.htaccess',
  4. 'key' => 'DLE-Forum',
  5. 'find' => 'DirectoryIndex index.php index.php?do=forum',
  6. 'replace' => 'DirectoryIndex index.php',
  7. ),
  8.  
  9. (
  10. 'open' => ROOT_DIR.'/.htaccess',
  11. 'key' => 'DLE-Forum',
  12. 'find' => 'RewriteEngine On
  13.  
  14. # DLE Forum
  15. RewriteRule ^forum(/?)+$ index.php?do=forum [L]
  16. RewriteRule ^forum/category_([0-9]+)(/?)+$ index.php?do=forum&category=$1 [L]
  17. RewriteRule ^forum/forum_([0-9]+)(/?)+$ index.php?do=forum&showforum=$1 [L]
  18. RewriteRule ^forum/forum_([0-9]+)/([0-9]+)(/?)+$ index.php?do=forum&showforum=$1&cstart=$2 [L]
  19. RewriteRule ^forum/topic_([0-9]+)(/?)+$ index.php?do=forum&showtopic=$1 [L]
  20. RewriteRule ^forum/topic_([0-9]+)/last(/?)+$ index.php?do=forum&showtopic=$1&lastpost=1 [L]
  21. RewriteRule ^forum/topic_([0-9]+)/lastpost(/?)+$ index.php?do=forum&showtopic=$1&lastpost=$2#post-$3 [L]
  22. RewriteRule ^forum/topic_([0-9]+)/([0-9]+)(/?)+$ index.php?do=forum&showtopic=$1&cstart=$2 [L]
  23. RewriteRule ^forum/topic_([0-9]+)/reply(/?)+$ index.php?do=forum&act=_topic&code=reply&tid=$1 [L]
  24. RewriteRule ^forum/forum_([0-9]+)/add(/?)+$ index.php?do=forum&act=add_topic&forum_id=$1 [L]
  25. RewriteRule ^forum/search(/?)+$ index.php?do=forum&act=search [L]
  26. RewriteRule ^forum/search/([0-9]+)-([^/]+)/([0-9]+)(/?)+$ index.php?do=forum&act=search&count_all=$1&search_text=$2&cstart=$3 [L]
  27. RewriteRule ^forum/subscription(/?)+$ index.php?do=forum&act=subscription [L]
  28. RewriteRule ^forum/getnew(/?)+$ index.php?do=forum&act=getnew [L]
  29. RewriteRule ^forum/getnew/([0-9]+)(/?)+$ index.php?do=forum&act=getnew&cstart=$1 [L]
  30. RewriteRule ^forum/warn/([^/]*)(/?)+$ index.php?do=forum&act=warn&user=$1 [L]
  31. RewriteRule ^forum/warn/([^/]*)/([0-9]+)(/?)+$ index.php?do=forum&act=warn&user=$1&cstart=$2 [L]
  32. RewriteRule ^forum/reputation/([^/]*)(/?)+$ index.php?do=forum&act=reputation&user=$1 [L]
  33. RewriteRule ^forum/reputation/([^/]*)/([0-9]+)(/?)+$ index.php?do=forum&act=reputation&user=$1&cstart=$2 [L]
  34. RewriteRule ^forum/textversion.html$ index.php?do=forum&act=textversion [L]
  35. RewriteRule ^forum/whoonline(/?)+$ index.php?do=forum&act=whoonline [L]
  36. RewriteRule ^forum/faq(/?)+$ index.php?do=forum&act=faq [L]',
  37. 'replace' => 'RewriteEngine On',
  38. ),
  39. );
  40.  
  41. foreach ($edit_files as $file)
  42. {
  43. $file_edit = file_get_contents($file['open']);
  44.  
  45. if (!preg_match('/$file[key]/', $file_edit))
  46. {
  47. $new_file = str_replace($file['find'], $file['before'].(($file['replace']!="")?$file['replace']:$file['find'])."\n".$file['add'], $file_edit);
  48.  
  49. $fd = @fopen($file['open'], "w+");
  50. fwrite ( $fd, $new_file );
  51. fclose($fd);
  52. chmod($file['open'], 0644);
  53. }
  54. };


a dokładnie nie kasuje mi linijek kodu związanych z forum po RewriteEngine On

Dodam że gdy kod do tworzenia pliku konfiguracyjnego dam do sekcji <phpenable> to wtedy po ponownym włączeniu (bez usówania) tworzy mi ten plik konfiguracyjny ale jest to trochę nie wygodne ponieważ podczas instalacji wtyczka jest automatycznie uruchamiana i żeby wszystko działało to użytkownik musi wyłączyć i włączyć wtyczkę. Czy gdzieś w tym całym kodzie mam błąd? jeśli tak to gdzie dokładnie i jak go naprawić?

Ten post edytował alkesz1718 18.01.2021, 02:29:55
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 19.03.2024 - 11:50