diff --git a/etc/config.php b/etc/config.php index 1e17711..6f8ad82 100644 --- a/etc/config.php +++ b/etc/config.php @@ -24,8 +24,7 @@ $settings = array( // the description of the overbpoard that is displayed when the users hovers on the link for the overboard "hover_title_main" => 'This is the main sub. Use to post important stuff and to create other subs.', // the description of the sub main that is displayed when the users hovers on the link. - "enable_reddit_bot" => TRUE, // use a bot to detect links to clearnet reddit, and post corresponding ones to an i2p frontend - "enable_wikipedia_bot" => TRUE, // the same, but for wikipedia links + "enable_link_bot" => TRUE, // use a bot to detect links to clearnet, and post corresponding ones to an i2p frontend "enable_sub_creation" => TRUE, // enable users to create subs by posting in main "enable_logging" => TRUE, // set to FALSE to disable all logs of endboard. This will provide stricter privacy, however, it will also // disable the features: max_post_*, bot_block, portal, max_requests_* and fail2ban. @@ -90,8 +89,6 @@ $settings = array( "min_space" => 200, // the minimum free space on the file system in Mb, if not available, no new posts will be taken "pagination" => 10, // number of messages per page to show for main, other subs and overboard. Threads and individual feeds show all messages. "max_name_sub" => 20, // the maximum number of characters allowed for the name of a sub, exceeding input will be cut - "line_break" => 300, // number of characters after which the line is broken when posts are displayed. - // 300 is to display certain ascii-art. 80...120 is fine for texts. "lifetime_token" => 5, // the lifetime of an access token for an admin or mod in minutes. After that a new login is needed. "original_content_thread" => FALSE, // do not allow the same text to be posted twice in the same thread "original_content_sub" => TRUE, // do not allow the same text to be posted twice in the same sub, including all threads on the sub (overrides previous if TRUE) diff --git a/opt/display.php b/opt/display.php index 6914bdc..9bc9e94 100644 --- a/opt/display.php +++ b/opt/display.php @@ -92,8 +92,10 @@ function bbcode_to_html($text, $settings, $sub) // and if so, give back an array with corresponding links in i2p function link_bot($text, $settings) { - if ( ($settings['enable_reddit_bot'] == FALSE) ) { - return $text; + $links = array(); + + if ( ($settings['enable_link_bot'] == FALSE) ) { + return $links; } $text = preg_replace('/\s*\R\s*/', ' ', $text); @@ -110,7 +112,9 @@ function link_bot($text, $settings) '/(http\:\/\/reddit\.com\/)(.*)/', '/(http\:\/\/redd\.it\/)(.*)/', '/(https\:\/\/en\.wikipedia\.org\/)(.*)/', - '/(http\:\/\/en\.wikipedia\.org\/)(.*)/' + '/(http\:\/\/en\.wikipedia\.org\/)(.*)/', + '/(https\:\/\/en\.m\.wikipedia\.org\/)(.*)/', + '/(http\:\/\/en\.m\.wikipedia\.org\/)(.*)/' ); $replace = array ( @@ -123,11 +127,11 @@ function link_bot($text, $settings) '[url http://libreddit.qwik.i2p/$2]', '[url http://libreddit.qwik.i2p/$2]', '[url http://wikiless.i2p/$2]', + '[url http://wikiless.i2p/$2]', + '[url http://wikiless.i2p/$2]', '[url http://wikiless.i2p/$2]' ); - $links = array(); - foreach($words as $word){ $new_link = preg_replace($search, $replace, $word); if ( $new_link != $word ) { diff --git a/opt/show.php b/opt/show.php index c55af53..859aa34 100644 --- a/opt/show.php +++ b/opt/show.php @@ -408,8 +408,6 @@ function show_settings($settings){ . $settings['pagination'] . ""; echo "