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/880556Podczas instalacji w tej wtyczce nie działa mi ta zmienna:
$forum_config = "
<?PHP
//System Configurations
'forum_title' => 'DLE Forum 2.7',
'forum_url' => '',
'meta_descr' => '',
'meta_keywords' => '',
'meta_topic' => '1',
'sep_subforum' => ',&nbsp;',
'fullforum' => '1',
'sep_moderators' => ',&nbsp;',
'last_abc' => '20',
'mod_rewrite' => '1',
'wysiwyg' => '0',
'offline' => '0',
'timestamp' => 'j F Y H:i',
'sessions_log' => '1',
'session_time' => '15',
'stats' => '1',
'online' => '1',
'forum_bar' => '1',
'topic_inpage' => '25',
'topic_hot' => '30',
'post_inpage' => '20',
'post_hide' => '10',
'topic_abc' => '0',
'post_maxlen' => '10000',
'auto_wrap' => '80',
'post_update' => '1',
'last_plink' => '1',
'hide_forum' => '0',
'topic_sort' => '1',
'topic_email' => '1',
'forum_pr_imp' => 'Important:',
'forum_pr_vote' => 'Sondage:',
'forum_pr_modr' => 'Moderateur:',
'forum_pr_sub' => 'Sous-forum:',
'mod_report' => '0',
'flood_time' => '15',
'warn' => '1',
'warn_max' => '5',
'warn_day' => '3',
'warn_show' => '1',
'warn_show_all' => '0',
'warn_sh_pg' => '0',
'subscription' => '1',
'mod_icq' => '1',
'mod_rank' => '1',
'reputation' => '1',
'ses_forum' => '1',
'ses_topic' => '1',
'bot_agent' => '1',
'discuss' => '1',
'discuss_title' => '1',
'discuss_title_tpl' => 'Article: {post_title}',
'tools_disc_post' => '1',
'discuss_post_tpl' => 'Les discussions sur ce sujet: {post_title}',
'set_topic_post' => '1',
'set_post_num_up' => '0',
'set_post_num_day' => '1',
'topic_new_day' => '5',
'set_sub_last_up' => '1',
'upload_type' => 'zip,rar,exe,doc,pdf',
'img_upload' => '1',
'img_size' => '1024',
'thumb_size' => '150',
'jpeg_quality' => '85',
'tag_img_width' => '0',
'warn_group' => '1',
'search_captcha' => '5',
'topic_captcha' => '5',
'post_captcha' => '5',
'tools_upload' => '1',
'tools_poll' => '1:2',
'warn_show_group' => '1:2:3',
'rep_edit_group' => '1',
'forum_faq' => '1',
'version_id' => '2.7.1',
);
?>
";
$con_file = fopen('engine/data/forum_config.php', 'w+');
fwrite($con_file, $forum_config);
fclose($con_file);
natomiast podczas usówania wtyczki nie działa mi ta zmienna:
(
'open' => ROOT_DIR.'/.htaccess',
'key' => 'DLE-Forum',
'find' => 'DirectoryIndex index.php index.php?do=forum',
'replace' => 'DirectoryIndex index.php',
),
(
'open' => ROOT_DIR.'/.htaccess',
'key' => 'DLE-Forum',
'find' => 'RewriteEngine On
# DLE Forum
RewriteRule ^forum(/?)+$ index.php?do=forum [L]
RewriteRule ^forum/category_([0-9]+)(/?)+$ index.php?do=forum&category=$1 [L]
RewriteRule ^forum/forum_([0-9]+)(/?)+$ index.php?do=forum&showforum=$1 [L]
RewriteRule ^forum/forum_([0-9]+)/([0-9]+)(/?)+$ index.php?do=forum&showforum=$1&cstart=$2 [L]
RewriteRule ^forum/topic_([0-9]+)(/?)+$ index.php?do=forum&showtopic=$1 [L]
RewriteRule ^forum/topic_([0-9]+)/last(/?)+$ index.php?do=forum&showtopic=$1&lastpost=1 [L]
RewriteRule ^forum/topic_([0-9]+)/lastpost(/?)+$ index.php?do=forum&showtopic=$1&lastpost=$2#post-$3 [L]
RewriteRule ^forum/topic_([0-9]+)/([0-9]+)(/?)+$ index.php?do=forum&showtopic=$1&cstart=$2 [L]
RewriteRule ^forum/topic_([0-9]+)/reply(/?)+$ index.php?do=forum&act=_topic&code=reply&tid=$1 [L]
RewriteRule ^forum/forum_([0-9]+)/add(/?)+$ index.php?do=forum&act=add_topic&forum_id=$1 [L]
RewriteRule ^forum/search(/?)+$ index.php?do=forum&act=search [L]
RewriteRule ^forum/search/([0-9]+)-([^/]+)/([0-9]+)(/?)+$ index.php?do=forum&act=search&count_all=$1&search_text=$2&cstart=$3 [L]
RewriteRule ^forum/subscription(/?)+$ index.php?do=forum&act=subscription [L]
RewriteRule ^forum/getnew(/?)+$ index.php?do=forum&act=getnew [L]
RewriteRule ^forum/getnew/([0-9]+)(/?)+$ index.php?do=forum&act=getnew&cstart=$1 [L]
RewriteRule ^forum/warn/([^/]*)(/?)+$ index.php?do=forum&act=warn&user=$1 [L]
RewriteRule ^forum/warn/([^/]*)/([0-9]+)(/?)+$ index.php?do=forum&act=warn&user=$1&cstart=$2 [L]
RewriteRule ^forum/reputation/([^/]*)(/?)+$ index.php?do=forum&act=reputation&user=$1 [L]
RewriteRule ^forum/reputation/([^/]*)/([0-9]+)(/?)+$ index.php?do=forum&act=reputation&user=$1&cstart=$2 [L]
RewriteRule ^forum/textversion.html$ index.php?do=forum&act=textversion [L]
RewriteRule ^forum/whoonline(/?)+$ index.php?do=forum&act=whoonline [L]
RewriteRule ^forum/faq(/?)+$ index.php?do=forum&act=faq [L]',
'replace' => 'RewriteEngine On',
),
);
foreach ($edit_files as $file)
{
{
$new_file = str_replace($file['find'], $file['before'].(($file['replace']!="")?
$file['replace']:$file['find'])."\n".$file['add'], $file_edit);
$fd = @fopen($file['open'], "w+"); chmod($file['open'], 0644);
}
};
a dokładnie nie kasuje mi linijek kodu związanych z forum po
RewriteEngine OnDodam ż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