Example #1
0
 $smarty->assign('show_control', is_admin() || is_mod());
 $smarty->assign('categories', $categories);
 $board['annotation'] = $board['annotation'] ? html_entity_decode($board['annotation'], ENT_QUOTES, Config::MB_ENCODING) : $board['annotation'];
 $smarty->assign('board', $board);
 $smarty->assign('boards', $boards);
 $smarty->assign('is_admin', is_admin());
 $smarty->assign('password', $password);
 $smarty->assign('upload_types', $upload_types);
 $smarty->assign('pages', $pages = range(1, $page_max));
 $smarty->assign('pages_count', count($pages));
 $smarty->assign('page', $page);
 $smarty->assign('goto', $_SESSION['goto']);
 $smarty->assign('macrochan_tags', $macrochan_tags);
 $smarty->assign('ib_name', Config::IB_NAME);
 $smarty->assign('enable_macro', is_macrochan_enabled($board));
 $smarty->assign('enable_youtube', is_youtube_enabled($board));
 $smarty->assign('enable_search', Config::ENABLE_SEARCH);
 $smarty->assign('enable_captcha', is_captcha_enabled($board));
 $smarty->assign('captcha', Config::CAPTCHA);
 $smarty->assign('enable_translation', is_translation_enabled($board));
 $smarty->assign('enable_geoip', is_geoip_enabled($board));
 $smarty->assign('enable_shi', is_shi_enabled($board));
 $smarty->assign('enable_postid', is_postid_enabled($board));
 $smarty->assign('ATTACHMENT_TYPE_FILE', Config::ATTACHMENT_TYPE_FILE);
 $smarty->assign('ATTACHMENT_TYPE_LINK', Config::ATTACHMENT_TYPE_LINK);
 $smarty->assign('ATTACHMENT_TYPE_VIDEO', Config::ATTACHMENT_TYPE_VIDEO);
 $smarty->assign('ATTACHMENT_TYPE_IMAGE', Config::ATTACHMENT_TYPE_IMAGE);
 $smarty->assign('name', $_SESSION['name']);
 isset($_SESSION['oekaki']) && $smarty->assign('oekaki', $_SESSION['oekaki']);
 $smarty->assign('is_board_view', true);
 $smarty->assign('MAX_FILE_SIZE', Config::MAX_FILE_SIZE);
Example #2
0
             }
             $attachment_type = Config::ATTACHMENT_TYPE_IMAGE;
         } else {
             $attachment_type = Config::ATTACHMENT_TYPE_FILE;
         }
     } elseif (is_macrochan_enabled($board) && isset($_REQUEST['macrochan_tag']) && $_REQUEST['macrochan_tag'] != '') {
         $_ = macrochan_tags_check($_REQUEST['macrochan_tag']);
         if ($_ === FALSE) {
             // Cleanup
             DataExchange::releaseResources();
             display_error_page($smarty, kotoba_last_error());
             exit(1);
         }
         $macrochan_tag['name'] = $_;
         $attachment_type = Config::ATTACHMENT_TYPE_LINK;
     } elseif (is_youtube_enabled($board) && isset($_REQUEST['youtube_video_code']) && $_REQUEST['youtube_video_code'] != '') {
         $youtube_video_code = videos_check_code($_REQUEST['youtube_video_code']);
         if ($youtube_video_code === FALSE) {
             // Cleanup
             DataExchange::releaseResources();
             display_error_page($smarty, kotoba_last_error());
             exit(1);
         }
         $attachment_type = Config::ATTACHMENT_TYPE_VIDEO;
     } else {
         throw new UnknownUploadTypeException();
     }
 }
 // Text.
 $text = $_REQUEST['text'];
 if ($attachment_type === NULL && !preg_match('/\\S/', $text)) {