Changeset 269
- Timestamp:
- 09/28/09 13:23:52 (3 years ago)
- Files:
-
- admin/admin_board.php (modified) (3 diffs)
- admin/admin_categories.php (modified) (4 diffs)
- admin/admin_news.php (modified) (2 diffs)
- admin/admin_statistics.php (modified) (1 diff)
- admin/admin_styles.php (modified) (3 diffs)
- admin/admin_users.php (modified) (2 diffs)
- admin/admin_voting.php (modified) (3 diffs)
- ajax.php (modified) (5 diffs)
- announce.php (modified) (1 diff)
- bookmarks.php (modified) (3 diffs)
- browse.php (modified) (4 diffs)
- chat/index.php (modified) (1 diff)
- comment.php (modified) (4 diffs)
- db_updater.php (modified) (1 diff)
- details.php (modified) (15 diffs)
- include/acp/config/tags_settings.php (added)
- include/acp/config/upload_settings.php (modified) (1 diff)
- include/acp/config/xbt_settings.php (added)
- include/ajax.php (modified) (13 diffs)
- include/bbcode (added)
- include/bbcode/Xbb (added)
- include/bbcode/Xbb/Tags (added)
- include/bbcode/Xbb/Tags/A.php (added)
- include/bbcode/Xbb/Tags/Abbr.php (added)
- include/bbcode/Xbb/Tags/Acronym.php (added)
- include/bbcode/Xbb/Tags/Address.php (added)
- include/bbcode/Xbb/Tags/Align.php (added)
- include/bbcode/Xbb/Tags/Bbcode.php (added)
- include/bbcode/Xbb/Tags/Bdo.php (added)
- include/bbcode/Xbb/Tags/Br.php (added)
- include/bbcode/Xbb/Tags/Caption.php (added)
- include/bbcode/Xbb/Tags/Code.php (added)
- include/bbcode/Xbb/Tags/Color.php (added)
- include/bbcode/Xbb/Tags/Email.php (added)
- include/bbcode/Xbb/Tags/Font.php (added)
- include/bbcode/Xbb/Tags/Google.php (added)
- include/bbcode/Xbb/Tags/Hr.php (added)
- include/bbcode/Xbb/Tags/Img.php (added)
- include/bbcode/Xbb/Tags/Li.php (added)
- include/bbcode/Xbb/Tags/List.php (added)
- include/bbcode/Xbb/Tags/Mod.php (added)
- include/bbcode/Xbb/Tags/Nobb.php (added)
- include/bbcode/Xbb/Tags/Offtop.php (added)
- include/bbcode/Xbb/Tags/P.php (added)
- include/bbcode/Xbb/Tags/Quote.php (added)
- include/bbcode/Xbb/Tags/Simple.php (added)
- include/bbcode/Xbb/Tags/Size.php (added)
- include/bbcode/Xbb/Tags/Spoiler.php (added)
- include/bbcode/Xbb/Tags/Table.php (added)
- include/bbcode/Xbb/Tags/Td.php (added)
- include/bbcode/Xbb/Tags/Th.php (added)
- include/bbcode/Xbb/Tags/Tr.php (added)
- include/bbcode/area.php (added)
- include/bbcode/bbcode.lib.js (added)
- include/bbcode/bbcode.lib.php (added)
- include/bbcode/config (added)
- include/bbcode/config/editor.config.php (added)
- include/bbcode/config/parser.config.php (added)
- include/bbcode/config/tags.php (added)
- include/bbcode/config/xbbeditor.config.php (added)
- include/bbcode/i18n (added)
- include/bbcode/i18n/default (added)
- include/bbcode/i18n/default/lang.php (added)
- include/bbcode/i18n/ru_cp1251 (added)
- include/bbcode/i18n/ru_cp1251/lang.php (added)
- include/bbcode/i18n/ru_utf8 (added)
- include/bbcode/i18n/ru_utf8/lang.php (added)
- include/bbcode/images (added)
- include/bbcode/images/background.gif (added)
- include/bbcode/images/button_menu.gif (added)
- include/bbcode/images/buttons (added)
- include/bbcode/images/buttons/bold.gif (added)
- include/bbcode/images/buttons/center.gif (added)
- include/bbcode/images/buttons/code.gif (added)
- include/bbcode/images/buttons/color.gif (added)
- include/bbcode/images/buttons/font.gif (added)
- include/bbcode/images/buttons/help.gif (added)
- include/bbcode/images/buttons/hr.gif (added)
- include/bbcode/images/buttons/image.gif (added)
- include/bbcode/images/buttons/italic.gif (added)
- include/bbcode/images/buttons/justify.gif (added)
- include/bbcode/images/buttons/left.gif (added)
- include/bbcode/images/buttons/link.gif (added)
- include/bbcode/images/buttons/mail.gif (added)
- include/bbcode/images/buttons/preview.gif (added)
- include/bbcode/images/buttons/quote.gif (added)
- include/bbcode/images/buttons/right.gif (added)
- include/bbcode/images/buttons/s.gif (added)
- include/bbcode/images/buttons/size.gif (added)
- include/bbcode/images/buttons/smile.gif (added)
- include/bbcode/images/buttons/sub.gif (added)
- include/bbcode/images/buttons/sup.gif (added)
- include/bbcode/images/buttons/underline.gif (added)
- include/bbcode/images/left.gif (added)
- include/bbcode/images/loader.gif (added)
- include/bbcode/images/pixel.gif (added)
- include/bbcode/images/right.gif (added)
- include/bbcode/images/separator.gif (added)
- include/bbcode/images/xbb.jpg (added)
- include/bbcode/index.php (added)
- include/bbcode/lib (added)
- include/bbcode/lib/geshi (added)
- include/bbcode/lib/geshi.php (added)
- include/bbcode/lib/geshi/actionscript.php (added)
- include/bbcode/lib/geshi/ada.php (added)
- include/bbcode/lib/geshi/apache.php (added)
- include/bbcode/lib/geshi/applescript.php (added)
- include/bbcode/lib/geshi/asm.php (added)
- include/bbcode/lib/geshi/asp.php (added)
- include/bbcode/lib/geshi/autoit.php (added)
- include/bbcode/lib/geshi/bash.php (added)
- include/bbcode/lib/geshi/blitzbasic.php (added)
- include/bbcode/lib/geshi/bnf.php (added)
- include/bbcode/lib/geshi/c.php (added)
- include/bbcode/lib/geshi/c_mac.php (added)
- include/bbcode/lib/geshi/caddcl.php (added)
- include/bbcode/lib/geshi/cadlisp.php (added)
- include/bbcode/lib/geshi/cfdg.php (added)
- include/bbcode/lib/geshi/cfm.php (added)
- include/bbcode/lib/geshi/cpp-qt.php (added)
- include/bbcode/lib/geshi/cpp.php (added)
- include/bbcode/lib/geshi/csharp.php (added)
- include/bbcode/lib/geshi/css-gen.cfg (added)
- include/bbcode/lib/geshi/css.php (added)
- include/bbcode/lib/geshi/d.php (added)
- include/bbcode/lib/geshi/delphi.php (added)
- include/bbcode/lib/geshi/diff.php (added)
- include/bbcode/lib/geshi/div.php (added)
- include/bbcode/lib/geshi/dos.php (added)
- include/bbcode/lib/geshi/eiffel.php (added)
- include/bbcode/lib/geshi/fortran.php (added)
- include/bbcode/lib/geshi/freebasic.php (added)
- include/bbcode/lib/geshi/gml.php (added)
- include/bbcode/lib/geshi/groovy.php (added)
- include/bbcode/lib/geshi/html4strict.php (added)
- include/bbcode/lib/geshi/idl.php (added)
- include/bbcode/lib/geshi/ini.php (added)
- include/bbcode/lib/geshi/inno.php (added)
- include/bbcode/lib/geshi/io.php (added)
- include/bbcode/lib/geshi/java.php (added)
- include/bbcode/lib/geshi/java5.php (added)
- include/bbcode/lib/geshi/javascript.php (added)
- include/bbcode/lib/geshi/latex.php (added)
- include/bbcode/lib/geshi/lisp.php (added)
- include/bbcode/lib/geshi/lua.php (added)
- include/bbcode/lib/geshi/matlab.php (added)
- include/bbcode/lib/geshi/mirc.php (added)
- include/bbcode/lib/geshi/mpasm.php (added)
- include/bbcode/lib/geshi/mysql.php (added)
- include/bbcode/lib/geshi/nsis.php (added)
- include/bbcode/lib/geshi/objc.php (added)
- include/bbcode/lib/geshi/ocaml-brief.php (added)
- include/bbcode/lib/geshi/ocaml.php (added)
- include/bbcode/lib/geshi/oobas.php (added)
- include/bbcode/lib/geshi/oracle8.php (added)
- include/bbcode/lib/geshi/pascal.php (added)
- include/bbcode/lib/geshi/perl.php (added)
- include/bbcode/lib/geshi/php-brief.php (added)
- include/bbcode/lib/geshi/php.php (added)
- include/bbcode/lib/geshi/plsql.php (added)
- include/bbcode/lib/geshi/python.php (added)
- include/bbcode/lib/geshi/qbasic.php (added)
- include/bbcode/lib/geshi/reg.php (added)
- include/bbcode/lib/geshi/robots.php (added)
- include/bbcode/lib/geshi/ruby.php (added)
- include/bbcode/lib/geshi/sas.php (added)
- include/bbcode/lib/geshi/scheme.php (added)
- include/bbcode/lib/geshi/sdlbasic.php (added)
- include/bbcode/lib/geshi/smalltalk.php (added)
- include/bbcode/lib/geshi/smarty.php (added)
- include/bbcode/lib/geshi/sql.php (added)
- include/bbcode/lib/geshi/tcl.php (added)
- include/bbcode/lib/geshi/text.php (added)
- include/bbcode/lib/geshi/thinbasic.php (added)
- include/bbcode/lib/geshi/tsql.php (added)
- include/bbcode/lib/geshi/vb.php (added)
- include/bbcode/lib/geshi/vbnet.php (added)
- include/bbcode/lib/geshi/vhdl.php (added)
- include/bbcode/lib/geshi/visualfoxpro.php (added)
- include/bbcode/lib/geshi/winbatch.php (added)
- include/bbcode/lib/geshi/xml.php (added)
- include/bbcode/lib/geshi/z80.php (added)
- include/bbcode/style.css (added)
- include/bbcode/xbb.js.php (added)
- include/bbcode/xbb.php (added)
- include/benc.php (deleted)
- include/class.bencode.php (added)
- include/constants.php (modified) (1 diff)
- include/details/download.php (modified) (3 diffs)
- include/details/edit.php (modified) (5 diffs)
- include/functions.php (modified) (7 diffs)
- include/functions_announce.php (added)
- include/functions_check.php (modified) (2 diffs)
- include/functions_post.php (modified) (14 diffs)
- include/functions_search.php (modified) (3 diffs)
- include/functions_torrenttable.php (modified) (1 diff)
- include/modtask/mass_torrent_actions.php (modified) (3 diffs)
- include/modtask/new_comments.php (modified) (5 diffs)
- include/modtask/tags.php (added)
- include/sessions.php (modified) (6 diffs)
- include/ucp/bonus.php (modified) (1 diff)
- include/ucp/checkcomm.php (modified) (3 diffs)
- index.php (modified) (9 diffs)
- js/ajax_common.js (modified) (2 diffs)
- js/jquery-impromptu.js (added)
- js/jquery.autocomplete.js (added)
- js/jquery.js (added)
- languages/lang_english/lang_admin.php (modified) (2 diffs)
- languages/lang_english/lang_admin_xbt_settings.php (added)
- languages/lang_english/lang_bbcode.php (modified) (3 diffs)
- languages/lang_english/lang_convert_table.php (added)
- languages/lang_english/lang_forum.php (modified) (2 diffs)
- languages/lang_english/lang_js.php (added)
- languages/lang_english/lang_main.php (modified) (5 diffs)
- languages/lang_english/lang_merge.php (modified) (1 diff)
- languages/lang_english/lang_modcomment_log.php (modified) (1 diff)
- languages/lang_english/lang_pms.php (modified) (1 diff)
- languages/lang_russian/lang_admin.php (modified) (1 diff)
- languages/lang_russian/lang_admin_xbt_settings.php (added)
- languages/lang_russian/lang_bbcode.php (modified) (3 diffs)
- languages/lang_russian/lang_convert_table.php (added)
- languages/lang_russian/lang_forum.php (modified) (2 diffs)
- languages/lang_russian/lang_js.php (added)
- languages/lang_russian/lang_main.php (modified) (5 diffs)
- languages/lang_russian/lang_merge.php (modified) (1 diff)
- languages/lang_russian/lang_modcomment_log.php (modified) (1 diff)
- languages/lang_russian/lang_pms.php (modified) (1 diff)
- languages/lang_russian/search_stopwords.txt (added)
- languages/lang_russian/search_synonyms.txt (added)
- log.php (modified) (5 diffs)
- message.php (modified) (8 diffs)
- modtask.php (modified) (1 diff)
- my.php (modified) (3 diffs)
- news.php (modified) (2 diffs)
- offers.php (modified) (8 diffs)
- phpBB2/groupcp.php (modified) (10 diffs)
- phpBB2/includes/bbcode.php (modified) (3 diffs)
- phpBB2/includes/functions_post.php (modified) (10 diffs)
- phpBB2/includes/topic_review.php (modified) (4 diffs)
- phpBB2/index.php (modified) (1 diff)
- phpBB2/modcp.php (modified) (23 diffs)
- phpBB2/posting.php (modified) (10 diffs)
- phpBB2/search.php (modified) (8 diffs)
- phpBB2/viewforum.php (modified) (5 diffs)
- phpBB2/viewtopic.php (modified) (3 diffs)
- releases.php (modified) (1 diff)
- requests.php (modified) (10 diffs)
- rss.php (modified) (5 diffs)
- scrape.php (modified) (1 diff)
- signup.php (modified) (2 diffs)
- simpaty.php (modified) (1 diff)
- sql.sql (modified) (10 diffs)
- tags.php (modified) (3 diffs)
- templates/bithdtv/bbcode.html (modified) (4 diffs)
- templates/bithdtv/bithdtv.cfg (modified) (1 diff)
- templates/bithdtv/bithdtv.css (modified) (2 diffs)
- templates/bithdtv/browse.html (modified) (1 diff)
- templates/bithdtv/cats_select_body.html (added)
- templates/bithdtv/details.html (modified) (5 diffs)
- templates/bithdtv/details_comments.html (added)
- templates/bithdtv/forum/index_body.tpl (modified) (2 diffs)
- templates/bithdtv/forum/modcp_delete_posts.tpl (modified) (1 diff)
- templates/bithdtv/forum/modcp_split.tpl (modified) (1 diff)
- templates/bithdtv/forum/posting_body.tpl (modified) (1 diff)
- templates/bithdtv/forum/posting_preview.tpl (modified) (2 diffs)
- templates/bithdtv/forum/posting_topic_review.tpl (modified) (1 diff)
- templates/bithdtv/forum/search_results_posts.tpl (modified) (1 diff)
- templates/bithdtv/forum/topic_search_results.tpl (modified) (1 diff)
- templates/bithdtv/forum/viewtopic_body.tpl (modified) (1 diff)
- templates/bithdtv/modtask_tags_users.html (added)
- templates/bithdtv/overall_header.html (modified) (8 diffs)
- templates/bithdtv/tags_view_form.html (added)
- templates/bithdtv/textbbcode.html (modified) (1 diff)
- templates/bithdtv/upload.html (deleted)
- templates/bithdtv/upload_body.html (added)
- templates/bithdtv/upload_template_body.html (added)
- templates/bithdtv/userdetails.html (modified) (1 diff)
- templates/main/bbcode.html (modified) (4 diffs)
- templates/main/browse.html (modified) (1 diff)
- templates/main/cats_select_body.html (added)
- templates/main/details.html (modified) (8 diffs)
- templates/main/details_comments.html (added)
- templates/main/forum/index_body.tpl (modified) (2 diffs)
- templates/main/forum/modcp_delete_posts.tpl (modified) (1 diff)
- templates/main/forum/modcp_split.tpl (modified) (1 diff)
- templates/main/forum/posting_body.tpl (modified) (2 diffs)
- templates/main/forum/posting_preview.tpl (modified) (1 diff)
- templates/main/forum/posting_topic_review.tpl (modified) (1 diff)
- templates/main/forum/search_results_posts.tpl (modified) (1 diff)
- templates/main/forum/topic_search_results.tpl (modified) (1 diff)
- templates/main/forum/viewtopic_body.tpl (modified) (2 diffs)
- templates/main/main.cfg (modified) (1 diff)
- templates/main/main.css (modified) (4 diffs)
- templates/main/modtask_tags_users.html (added)
- templates/main/overall_header.html (modified) (11 diffs)
- templates/main/tags_view_form.html (added)
- templates/main/textbbcode.html (modified) (3 diffs)
- templates/main/upload.html (deleted)
- templates/main/upload_body.html (added)
- templates/main/upload_template_body.html (added)
- templates/main/userdetails.html (modified) (2 diffs)
- templates/reflection/bbcode.html (modified) (4 diffs)
- templates/reflection/browse.html (modified) (1 diff)
- templates/reflection/cats_select_body.html (added)
- templates/reflection/details.html (modified) (5 diffs)
- templates/reflection/details_comments.html (added)
- templates/reflection/forum/index_body.tpl (modified) (1 diff)
- templates/reflection/forum/modcp_delete_posts.tpl (modified) (1 diff)
- templates/reflection/forum/modcp_split.tpl (modified) (1 diff)
- templates/reflection/forum/posting_body.tpl (modified) (2 diffs)
- templates/reflection/forum/posting_preview.tpl (modified) (1 diff)
- templates/reflection/forum/posting_topic_review.tpl (modified) (1 diff)
- templates/reflection/forum/search_results_posts.tpl (modified) (1 diff)
- templates/reflection/forum/topic_search_results.tpl (modified) (1 diff)
- templates/reflection/forum/viewtopic_body.tpl (modified) (2 diffs)
- templates/reflection/modtask_tags_users.html (added)
- templates/reflection/overall_header.html (modified) (9 diffs)
- templates/reflection/reflection.cfg (modified) (1 diff)
- templates/reflection/reflection.css (modified) (2 diffs)
- templates/reflection/tags_view_form.html (added)
- templates/reflection/textbbcode.html (modified) (1 diff)
- templates/reflection/upload.html (deleted)
- templates/reflection/upload_body.html (added)
- templates/reflection/upload_template_body.html (added)
- templates/reflection/userdetails.html (modified) (2 diffs)
- upload.php (modified) (12 diffs)
- uploadapp.php (modified) (4 diffs)
- userdetails.php (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
admin/admin_board.php
r245 r269 87 87 $file = substr($file, 0, strpos($file, '.php')); 88 88 $valid_modes[] = $file; 89 @include($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_admin_' . $file . '.php'); 89 90 require($include_dir . $file . '.php'); 90 91 } … … 101 102 } 102 103 else { 104 @include($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_admin_' . $mode . '.php'); 103 105 require($include_dir . $mode . '.php'); 104 106 } … … 145 147 $new_config['email_function_name'] = (empty($new_config['email_function_name']) || !function_exists($new_config['email_function_name'])) ? 'mail' : $new_config['email_function_name']; 146 148 $config_value = $new_config['email_function_name']; 147 break;148 149 case 'torrent_dir':150 $new_config['torrent_dir'] = ( empty($new_config['torrent_dir']) || $new_config['torrent_dir'] == '/' ? '/torrents' : $new_config['torrent_dir'] );151 $config_value = $new_config['torrent_dir'];152 149 break; 153 150 admin/admin_categories.php
r266 r269 79 79 80 80 case 'edit_template': 81 @require($root_path . 'include/functions_post.php'); 81 require ($root_path . 'include/bbcode/bbcode.lib.php'); 82 82 83 $cats = $cache->obtain_cats(); 83 84 … … 241 242 $cat_parent_name = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_name']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_name'] . ' -> ' : '' ); 242 243 244 $template_edit_content = $preview_view; 245 246 $bb_code = new bbcode($preview_view); 247 $preview_view = $bb_code->get_html(); 248 243 249 $template->assign_vars(array( 244 'PREVIEW_VIEW' => format_comment($preview_view),245 'TEMPLATE_EDIT_CONTENT' => $ preview_view,250 'PREVIEW_VIEW' => $preview_view, 251 'TEMPLATE_EDIT_CONTENT' => $template_edit_content, 246 252 'CAT_ID' => $cat_id, 247 253 'S_TRACKER_CATEGORY_EDITING' => sprintf($lang['tracker_category_editing'], $cat_parent_name . $cats[$cat_id]['cat_name']), … … 671 677 $no_page_header = true; 672 678 673 @require($root_path . 'include/functions_post.php');679 require ($root_path . 'include/bbcode/bbcode.lib.php'); 674 680 675 681 $cat_id = request_var('cat_id', 0); … … 763 769 $name_content = str_replace($find, $replace, trim($name_content)); 764 770 771 $bb_code = new bbcode($preview_view); 772 $preview_view = $bb_code->get_html(); 773 765 774 $template->assign_vars(array( 766 'PREVIEW_VIEW' => format_comment($preview_view),775 'PREVIEW_VIEW' => $preview_view, 767 776 'TEMPLATE_EDIT_CONTENT' => $preview_view, 768 777 'TEMPLATE_NAME_CREATOR_VALUE' => $name_content admin/admin_news.php
r266 r269 14 14 require ($root_path . 'extension.inc'); 15 15 require ('./pagestart.' . $phpEx); 16 require ($root_path . 'include/ functions_post.php');16 require ($root_path . 'include/bbcode/bbcode.lib.php'); 17 17 18 18 $action = request_var('action', ''); … … 190 190 } 191 191 192 $body = format_comment($row['body']); 192 $bb_code = new bbcode($body); 193 $body = $bb_code->get_html(); 194 193 195 $body .= '<br /><i>' . sprintf($lang['news_view_by_classes'], $classes) . '</i>'; 194 196 $added = create_date($row['added']); admin/admin_statistics.php
r266 r269 213 213 'PAGE_DETAILS' => $page_detail, 214 214 'TIMESCALE' => ($_POST['timescale'] == 'daily' ? $lang['daily'] : ( $_POST['timescale'] == 'weekly' ? $lang['weekly'] : $lang['monthly'] ) ), 215 'DATE_FROM' => create_date( "Y M d",$from_time, 'Y M d'),215 'DATE_FROM' => create_date($from_time, 'Y M d'), 216 216 'DATE_TO' => create_date($to_time, 'Y M d') ) 217 217 ); admin/admin_styles.php
r247 r269 1 1 <?php 2 2 /*************************************************************************** 3 * admin_styles.php4 * -------------------5 * begin : Thursday, Jul 12, 20016 * copyright : (C) 2001 The phpBB Group7 * email : support@phpbb.com3 * admin_styles.php 4 * ------------------- 5 * begin : Thursday, Jul 12, 2001 6 * copyright : (C) 2001 The phpBB Group 7 * email : support@phpbb.com 8 8 * 9 9 * $Id: admin_styles.php,v 1.27.2.15 2005/10/04 21:45:02 grahamje Exp $ … … 23 23 if( !empty($setmodules) ) 24 24 { 25 $file = basename(__FILE__);26 $module['styles']['add_new'] = "$file?mode=addnew";27 $module['styles']['manage'] = $file;28 $module['styles']['export'] = "$file?mode=export";29 return;25 $file = basename(__FILE__); 26 $module['styles']['add_new'] = "$file?mode=addnew"; 27 $module['styles']['manage'] = $file; 28 $module['styles']['export'] = "$file?mode=export"; 29 return; 30 30 } 31 31 … … 49 49 if ($cancel) 50 50 { 51 redirect('admin/' . append_sid("admin_styles.$phpEx"));51 redirect('admin/' . append_sid("admin_styles.$phpEx")); 52 52 } 53 53 54 54 if( isset($_GET['mode']) || isset($_POST['mode']) ) 55 55 { 56 $mode = ( isset($_GET['mode']) ) ? $_GET['mode'] : $_POST['mode'];57 $mode = htmlspecialchars($mode);56 $mode = ( isset($_GET['mode']) ) ? $_GET['mode'] : $_POST['mode']; 57 $mode = htmlspecialchars($mode); 58 58 } 59 59 else 60 60 { 61 $mode = "";61 $mode = ""; 62 62 } 63 63 64 64 switch( $mode ) 65 65 { 66 case "addnew": 67 $install_to = ( isset($_GET['install_to']) ? urldecode($_GET['install_to']) : ( isset($_POST['install_to']) ? urldecode($_POST['install_to']) : '' ) ); 68 $style_name = ( isset($_GET['style']) ? urldecode($_GET['style']) : ( isset($_POST['style']) ? urldecode($_POST['style']) : '' ) ); 69 70 if( $install_to ) 71 { 72 73 @include($root_path. "templates/" . basename($install_to) . "/theme_info.cfg"); 74 75 $template_name = $$install_to; 76 77 if ( is_array($template_name) ) { 78 foreach ( $template_name AS $key => $val ) { 79 $db_data[$key] = $val; 80 } 81 82 $sql = "INSERT INTO " . THEMES_TABLE . " " . $db->sql_build_array('INSERT', $db_data); 83 84 $result = $db->sql_query($sql); 85 86 $message = $lang['theme_installed'] . "<br /><br />" . sprintf($lang['click_return_styleadmin'], "<a href=\"" . append_sid("admin_styles.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); 87 } 88 else { 89 $message = $lang['invalid_data'] . "<br /><br />" . sprintf($lang['click_return_styleadmin'], "<a href=\"" . append_sid("admin_styles.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); 90 } 91 92 trigger_error($message); 93 return; 94 } 95 else 96 { 97 98 $installable_themes = array(); 99 100 if( $dir = @opendir($root_path . "templates/") ) 101 { 102 while( $sub_dir = @readdir($dir) ) 103 { 104 if( !is_file($root_path . 'templates/' .$sub_dir) && !is_link($root_path . 'templates/' .$sub_dir) && $sub_dir != "." && $sub_dir != ".." && $sub_dir != "CVS" && $sub_dir != "admin" && $sub_dir != "upload_templates" ) 105 { 106 if( @file_exists($root_path. "templates/" . $sub_dir . "/theme_info.cfg") ) 107 { 108 @include($root_path. "templates/" . $sub_dir . "/theme_info.cfg"); 109 for($i = 0; $i < sizeof($$sub_dir); $i++) 110 { 111 $working_data = $$sub_dir; 112 113 $style_name = $working_data['style_name']; 114 115 $sql = "SELECT themes_id 116 FROM " . THEMES_TABLE . " 117 WHERE style_name = '" . $db->sql_escape($style_name) . "'"; 118 $result = $db->sql_query($sql); 119 120 if( !( $row = $db->sql_fetchrow($result)) ) 121 { 122 $installable_themes[$working_data['style_name']] = $working_data['template_name']; 123 } 124 } 125 } 126 } 127 } 128 129 $template->set_filenames(array( 130 "body" => "../admin/styles_addnew_body.tpl") 131 ); 132 133 $template->assign_vars(array( 134 "L_STYLES_TITLE" => $lang['styles_admin'], 135 "L_STYLES_ADD_TEXT" => $lang['styles_addnew_explain']) 136 ); 137 138 $i = 0; 66 case "addnew": 67 $install_to = ( isset($_GET['install_to']) ? urldecode($_GET['install_to']) : ( isset($_POST['install_to']) ? urldecode($_POST['install_to']) : '' ) ); 68 $style_name = ( isset($_GET['style']) ? urldecode($_GET['style']) : ( isset($_POST['style']) ? urldecode($_POST['style']) : '' ) ); 69 70 if( $install_to ) 71 { 72 73 @include($root_path. "templates/" . basename($install_to) . "/theme_info.cfg"); 74 75 $template_name = $$install_to; 76 77 if ( is_array($template_name) ) { 78 foreach ( $template_name AS $key => $val ) { 79 $db_data[$key] = $val; 80 } 81 82 $sql = "INSERT INTO " . THEMES_TABLE . " " . $db->sql_build_array('INSERT', $db_data); 83 84 $result = $db->sql_query($sql); 85 86 $message = $lang['theme_installed'] . "<br /><br />" . sprintf($lang['click_return_styleadmin'], "<a href=\"" . append_sid("admin_styles.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); 87 } 88 else { 89 $message = $lang['invalid_data'] . "<br /><br />" . sprintf($lang['click_return_styleadmin'], "<a href=\"" . append_sid("admin_styles.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); 90 } 91 92 trigger_error($message); 93 return; 94 } 95 else 96 { 97 98 $installable_themes = array(); 99 100 if( $dir = @opendir($root_path . "templates/") ) 101 { 102 while( $sub_dir = @readdir($dir) ) 103 { 104 if( !is_file($root_path . 'templates/' .$sub_dir) && !is_link($root_path . 'templates/' .$sub_dir) && $sub_dir != "." && $sub_dir != ".." && $sub_dir != "CVS" && $sub_dir != "admin" && $sub_dir != "upload_templates" ) 105 { 106 if( @file_exists($root_path. "templates/" . $sub_dir . "/theme_info.cfg") ) 107 { 108 @include($root_path. "templates/" . $sub_dir . "/theme_info.cfg"); 109 110 $working_data = $$sub_dir; 111 112 $style_name = $working_data['style_name']; 113 114 $sql = "SELECT themes_id 115 FROM " . THEMES_TABLE . " 116 WHERE style_name = '" . $db->sql_escape($style_name) . "'"; 117 $result = $db->sql_query($sql); 118 119 if( !$row = $db->sql_fetchrow($result) ) 120 { 121 $installable_themes[$style_name] = $working_data['template_name']; 122 } 123 } 124 } 125 } 126 127 $template->set_filenames(array( 128 "body" => "../admin/styles_addnew_body.tpl") 129 ); 130 131 $template->assign_vars(array( 132 "L_STYLES_TITLE" => $lang['styles_admin'], 133 "L_STYLES_ADD_TEXT" => $lang['styles_addnew_explain']) 134 ); 135 136 $i = 0; 139 137 foreach ( $installable_themes AS $style_name => $template_name ) { 140 138 ++$i; 141 $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];142 $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];143 144 $template->assign_block_vars("styles", array(145 "ROW_CLASS" => $row_class,146 "ROW_COLOR" => "#" . $row_color,147 "STYLE_NAME" => $style_name,148 "TEMPLATE_NAME" => $template_name,149 150 "U_STYLES_INSTALL" => append_sid("admin_styles.$phpEx?mode=addnew&style=" . urlencode($style_name) . "&install_to=" . urlencode($template_name)))151 );152 153 }154 $template->display("body");155 156 }157 closedir($dir);158 }159 break;160 161 case "export";162 if( isset($_POST['export_template']) )163 {164 $template_name = $_POST['export_template'];165 166 $sql = "SELECT *167 FROM " . THEMES_TABLE . "168 WHERE template_name = '" . $db->sql_escape($template_name) . "'";169 $result = $db->sql_query($sql);170 171 if( $theme_rowset = $db->sql_fetchrow($result) ) {172 173 $theme_data = '<?php'."\n\n";174 $theme_data .= "//\n// TB Dev SZ Edition auto-generated theme config file for $template_name\n// Do not change anything in this file!\n";175 $theme_data .= "// Creatation date: " . date('Y-m-d H:i:s') . "\n//\n\n";139 $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2']; 140 $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2']; 141 142 $template->assign_block_vars("styles", array( 143 "ROW_CLASS" => $row_class, 144 "ROW_COLOR" => "#" . $row_color, 145 "STYLE_NAME" => $style_name, 146 "TEMPLATE_NAME" => $template_name, 147 148 "U_STYLES_INSTALL" => append_sid("admin_styles.$phpEx?mode=addnew&style=" . urlencode($style_name) . "&install_to=" . urlencode($template_name))) 149 ); 150 151 } 152 $template->display("body"); 153 154 } 155 closedir($dir); 156 } 157 break; 158 159 case "export"; 160 if( isset($_POST['export_template']) ) 161 { 162 $template_name = $_POST['export_template']; 163 164 $sql = "SELECT * 165 FROM " . THEMES_TABLE . " 166 WHERE template_name = '" . $db->sql_escape($template_name) . "'"; 167 $result = $db->sql_query($sql); 168 169 if( $theme_rowset = $db->sql_fetchrow($result) ) { 170 171 $theme_data = '<?php'."\n\n"; 172 $theme_data .= "//\n// TB Dev SZ Edition auto-generated theme config file for $template_name\n// Do not change anything in this file!\n"; 173 $theme_data .= "// Creatation date: " . date('Y-m-d H:i:s') . "\n//\n\n"; 176 174 177 175 do 178 {176 { 179 177 foreach ( $theme_rowset AS $key => $val ) { 180 178 if(!intval($key) && $key != "0" && $key != "themes_id") { 181 179 $theme_data .= '$' . $template_name . "['$key'] = \"" . addslashes($val) . "\";\n"; 182 }183 }184 $theme_data .= "\n";185 }186 while ( $theme_rowset = $db->sql_fetchrow($result) ) ;187 188 $theme_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused!189 190 @umask(0111);191 192 $fp = @fopen($root_path . 'templates/' . basename($template_name) . '/theme_info.cfg', 'w');193 }194 else {195 trigger_error($lang['no_themes']);196 return;197 }198 199 if( !$fp )200 {201 //202 // Unable to open the file writeable do something here as an attempt203 // to get around that...204 //205 $s_hidden_fields = '<input type="hidden" name="theme_info" value="' . htmlspecialchars($theme_data) . '" />';206 $s_hidden_fields .= '<input type="hidden" name="send_file" value="1" /><input type="hidden" name="mode" value="export" />';207 208 $download_form = '<form action="' . append_sid("admin_styles.$phpEx") . '" method="post"><input class="mainoption" type="submit" name="submit" value="' . $lang['download'] . '" />' . $s_hidden_fields;209 210 $template->set_filenames(array(211 "body" => "../admin/message_body.tpl")212 );213 214 $template->assign_vars(array(215 "MESSAGE_TITLE" => $lang['export_themes'],216 "MESSAGE_TEXT" => $lang['download_theme_cfg'] . "<br /><br />" . $download_form)217 );218 219 $template->display('body');220 exit();221 }222 223 $result = @fputs($fp, $theme_data, strlen($theme_data));224 fclose($fp);225 226 $message = $lang['theme_info_saved'] . "<br /><br />" . sprintf($lang['click_return_styleadmin'], "<a href=\"" . append_sid("admin_styles.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");227 228 trigger_error($message);229 return;230 231 }232 else if( isset($_POST['send_file']) )233 {234 $theme_info = ( isset($_POST['theme_info']) ? trim(stripslashes($_POST['theme_info'])) : '' );235 236 header("Content-Type: text/x-delimtext; name=\"theme_info.cfg\"");237 header("Content-disposition: attachment; filename=theme_info.cfg");238 239 echo $theme_info;240 exit();241 }242 else243 {244 $template->set_filenames(array(245 "body" => "../admin/styles_exporter.tpl")246 );247 248 if( $dir = @opendir($root_path . 'templates/') )249 {250 $s_template_select = '<select name="export_template">';251 while( $file = @readdir($dir) )252 {253 if( !is_file($root_path . 'templates/' . $file) && !is_link($root_path . 'templates/' .$file) && $file != "." && $file != ".." && $file != "CVS" && $file != "admin" && $file != "upload_templates" )254 {255 $s_template_select .= '<option value="' . $file . '">' . $file . "</option>\n";256 }257 }258 $s_template_select .= '</select>';259 }260 else261 {262 trigger_error($lang['no_template_dir']);263 return;264 }265 266 $template->assign_vars(array(267 "S_EXPORTER_ACTION" => append_sid("admin_styles.$phpEx?mode=export"),268 "S_TEMPLATE_SELECT" => $s_template_select)269 );270 271 $template->display("body");272 273 }274 break;275 276 case "delete":277 $style_id = ( isset($_GET['style_id']) ) ? intval($_GET['style_id']) : intval($_POST['style_id']);278 279 if( !$confirm )280 {281 if($style_id == $config['default_style'])282 {283 trigger_error($lang['cannot_remove_style']);284 return;285 }286 287 $hidden_fields = '<input type="hidden" name="mode" value="'.$mode.'" /><input type="hidden" name="style_id" value="'.$style_id.'" />';288 289 //290 // Set template files291 //292 $template->set_filenames(array(293 "confirm" => "../admin/confirm_body.tpl")294 );295 296 $template->assign_vars(array(297 "MESSAGE_TITLE" => $lang['confirm'],298 "MESSAGE_TEXT" => $lang['confirm_delete_style'],299 300 "S_CONFIRM_ACTION" => append_sid("admin_styles.$phpEx"),301 "S_HIDDEN_FIELDS" => $hidden_fields)302 );303 304 $template->display("confirm");305 306 }307 else308 {309 //310 // The user has confirmed the delete. Remove the style, the style element311 // names and update any users who might be using this style312 //313 $sql = "DELETE FROM " . THEMES_TABLE . "314 WHERE themes_id = $style_id";315 $db->sql_query($sql);316 317 $sql = "UPDATE " . USERS_TABLE . "318 SET user_style = " . $config['default_style'] . "319 WHERE user_style = $style_id";320 $db->sql_query($sql);321 322 $message = $lang['style_removed'] . "<br /><br />" . sprintf($lang['click_return_styleadmin'], "<a href=\"" . append_sid("admin_styles.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>");323 324 trigger_error($message);325 return;326 }327 break;328 329 default:330 331 $sql = "SELECT themes_id, template_name, style_name332 FROM " . THEMES_TABLE . "333 ORDER BY template_name";334 $result = $db->sql_query($sql);335 336 $template->set_filenames(array(337 "body" => "../admin/styles_list_body.tpl")338 );180 } 181 } 182 $theme_data .= "\n"; 183 } 184 while ( $theme_rowset = $db->sql_fetchrow($result) ) ; 185 186 $theme_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused! 187 188 @umask(0111); 189 190 $fp = @fopen($root_path . 'templates/' . basename($template_name) . '/theme_info.cfg', 'w'); 191 } 192 else { 193 trigger_error($lang['no_themes']); 194 return; 195 } 196 197 if( !$fp ) 198 { 199 // 200 // Unable to open the file writeable do something here as an attempt 201 // to get around that... 202 // 203 $s_hidden_fields = '<input type="hidden" name="theme_info" value="' . htmlspecialchars($theme_data) . '" />'; 204 $s_hidden_fields .= '<input type="hidden" name="send_file" value="1" /><input type="hidden" name="mode" value="export" />'; 205 206 $download_form = '<form action="' . append_sid("admin_styles.$phpEx") . '" method="post"><input class="mainoption" type="submit" name="submit" value="' . $lang['download'] . '" />' . $s_hidden_fields; 207 208 $template->set_filenames(array( 209 "body" => "../admin/message_body.tpl") 210 ); 211 212 $template->assign_vars(array( 213 "MESSAGE_TITLE" => $lang['export_themes'], 214 "MESSAGE_TEXT" => $lang['download_theme_cfg'] . "<br /><br />" . $download_form) 215 ); 216 217 $template->display('body'); 218 exit(); 219 } 220 221 $result = @fputs($fp, $theme_data, strlen($theme_data)); 222 fclose($fp); 223 224 $message = $lang['theme_info_saved'] . "<br /><br />" . sprintf($lang['click_return_styleadmin'], "<a href=\"" . append_sid("admin_styles.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); 225 226 trigger_error($message); 227 return; 228 229 } 230 else if( isset($_POST['send_file']) ) 231 { 232 $theme_info = ( isset($_POST['theme_info']) ? trim(stripslashes($_POST['theme_info'])) : '' ); 233 234 header("Content-Type: text/x-delimtext; name=\"theme_info.cfg\""); 235 header("Content-disposition: attachment; filename=theme_info.cfg"); 236 237 echo $theme_info; 238 exit(); 239 } 240 else 241 { 242 $template->set_filenames(array( 243 "body" => "../admin/styles_exporter.tpl") 244 ); 245 246 if( $dir = @opendir($root_path . 'templates/') ) 247 { 248 $s_template_select = '<select name="export_template">'; 249 while( $file = @readdir($dir) ) 250 { 251 if( !is_file($root_path . 'templates/' . $file) && !is_link($root_path . 'templates/' .$file) && $file != "." && $file != ".." && $file != "CVS" && $file != "admin" && $file != "upload_templates" ) 252 { 253 $s_template_select .= '<option value="' . $file . '">' . $file . "</option>\n"; 254 } 255 } 256 $s_template_select .= '</select>'; 257 } 258 else 259 { 260 trigger_error($lang['no_template_dir']); 261 return; 262 } 263 264 $template->assign_vars(array( 265 "S_EXPORTER_ACTION" => append_sid("admin_styles.$phpEx?mode=export"), 266 "S_TEMPLATE_SELECT" => $s_template_select) 267 ); 268 269 $template->display("body"); 270 271 } 272 break; 273 274 case "delete": 275 $style_id = ( isset($_GET['style_id']) ) ? intval($_GET['style_id']) : intval($_POST['style_id']); 276 277 if( !$confirm ) 278 { 279 if($style_id == $config['default_style']) 280 { 281 trigger_error($lang['cannot_remove_style']); 282 return; 283 } 284 285 $hidden_fields = '<input type="hidden" name="mode" value="'.$mode.'" /><input type="hidden" name="style_id" value="'.$style_id.'" />'; 286 287 // 288 // Set template files 289 // 290 $template->set_filenames(array( 291 "confirm" => "../admin/confirm_body.tpl") 292 ); 293 294 $template->assign_vars(array( 295 "MESSAGE_TITLE" => $lang['confirm'], 296 "MESSAGE_TEXT" => $lang['confirm_delete_style'], 297 298 "S_CONFIRM_ACTION" => append_sid("admin_styles.$phpEx"), 299 "S_HIDDEN_FIELDS" => $hidden_fields) 300 ); 301 302 $template->display("confirm"); 303 304 } 305 else 306 { 307 // 308 // The user has confirmed the delete. Remove the style, the style element 309 // names and update any users who might be using this style 310 // 311 $sql = "DELETE FROM " . THEMES_TABLE . " 312 WHERE themes_id = $style_id"; 313 $db->sql_query($sql); 314 315 $sql = "UPDATE " . USERS_TABLE . " 316 SET user_style = " . $config['default_style'] . " 317 WHERE user_style = $style_id"; 318 $db->sql_query($sql); 319 320 $message = $lang['style_removed'] . "<br /><br />" . sprintf($lang['click_return_styleadmin'], "<a href=\"" . append_sid("admin_styles.$phpEx") . "\">", "</a>") . "<br /><br />" . sprintf($lang['click_return_admin_index'], "<a href=\"" . append_sid("index.$phpEx?pane=right") . "\">", "</a>"); 321 322 trigger_error($message); 323 return; 324 } 325 break; 326 327 default: 328 329 $sql = "SELECT themes_id, template_name, style_name 330 FROM " . THEMES_TABLE . " 331 ORDER BY template_name"; 332 $result = $db->sql_query($sql); 333 334 $template->set_filenames(array( 335 "body" => "../admin/styles_list_body.tpl") 336 ); 339 337 340 338 $i = 0; 341 while ( $row = $db->sql_fetchrow($result) )342 {343 ++$i;344 $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];345 $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];346 347 $template->assign_block_vars("styles", array(348 "ROW_CLASS" => $row_class,349 "ROW_COLOR" => $row_color,350 "STYLE_NAME" => $row['style_name'],351 "TEMPLATE_NAME" => $row['template_name'],352 353 "U_STYLES_EDIT" => append_sid("admin_styles.$phpEx?mode=edit&style_id=" . $row['themes_id']),354 "U_STYLES_DELETE" => append_sid("admin_styles.$phpEx?mode=delete&style_id=" . $row['themes_id']))355 );356 }357 358 $template->display("body");359 break;339 while ( $row = $db->sql_fetchrow($result) ) 340 { 341 ++$i; 342 $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2']; 343 $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2']; 344 345 $template->assign_block_vars("styles", array( 346 "ROW_CLASS" => $row_class, 347 "ROW_COLOR" => $row_color, 348 "STYLE_NAME" => $row['style_name'], 349 "TEMPLATE_NAME" => $row['template_name'], 350 351 "U_STYLES_EDIT" => append_sid("admin_styles.$phpEx?mode=edit&style_id=" . $row['themes_id']), 352 "U_STYLES_DELETE" => append_sid("admin_styles.$phpEx?mode=delete&style_id=" . $row['themes_id'])) 353 ); 354 } 355 356 $template->display("body"); 357 break; 360 358 } 361 359 362 360 if (empty($_POST['send_file'])) 363 361 { 364 include('./page_footer_admin.'.$phpEx);362 include('./page_footer_admin.'.$phpEx); 365 363 } 366 364 admin/admin_users.php
r266 r269 199 199 $sig_length_check = preg_replace('/(\[.*?)(=.*?)\]/is', '\\1]', $signature); 200 200 201 // Only create a new bbcode_uid when there was no uid yet. 202 if ( $signature_bbcode_uid == '' ) 203 { 204 $signature_bbcode_uid = ( $config['allow_bbcode'] ) ? make_bbcode_uid() : ''; 205 } 206 $signature = prepare_message($signature, $config['allow_html'], $config['allow_bbcode'], $config['allow_smilies'], $signature_bbcode_uid); 201 $signature = prepare_message($signature, $config['allow_html'], $config['allow_bbcode'], $config['allow_smilies']); 207 202 208 203 if ( strlen($sig_length_check) > $config['max_sig_chars'] ) … … 396 391 $user_avatar = $this_userdata['avatar']; 397 392 398 $signature = ($this_userdata['user_sig_bbcode_uid'] != '') ? preg_replace('#:' . $this_userdata['user_sig_bbcode_uid'] . '#si', '', $this_userdata['user_sig']) :$this_userdata['user_sig'];393 $signature = $this_userdata['user_sig']; 399 394 $signature = preg_replace($html_entities_match, $html_entities_replace, $signature); 400 395 admin/admin_voting.php
r222 r269 36 36 require('./pagestart.' . $phpEx); 37 37 include($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_admin_voting.' . $phpEx); 38 include($root_path . 'include/functions_post.' . $phpEx);39 38 40 39 if ( isset($_GET['action']) && $_GET['action'] == 'show_voted_users' ) { … … 410 409 $topic_row_color = (($i % 2) == 0) ? $theme['td_class1'] : $theme['td_class2']; 411 410 $vote_id = $row['vote_id']; 412 $vote_text = ( $row['topic_id'] ? $row['vote_text'] : '<b>' . format_comment($row['vote_text']). '</b>' );411 $vote_text = ( $row['topic_id'] ? $row['vote_text'] : '<b>' . $row['vote_text'] . '</b>' ); 413 412 $topic_id = $row['topic_id']; 414 413 $vote_start = $row['vote_start']; … … 470 469 471 470 $template->assign_block_vars("viewresult.votes.detail", array( 472 'OPTION' => censor_text( format_comment($option_text)),471 'OPTION' => censor_text($option_text), 473 472 'RESULT' => $option_result, 474 473 'USER' => $user ) ajax.php
r266 r269 199 199 case 'preview': 200 200 201 require_once ($root_path . 'include/ functions_post.php');201 require_once ($root_path . 'include/bbcode/bbcode.lib.php'); 202 202 203 203 $name = request_var('name', ''); … … 208 208 209 209 $name = ( !empty($name) ? censor_text($name) : $lang['preview'] ); 210 $message = format_comment(censor_text($message)); 210 211 $message = censor_text($message); 212 $bb_code = new bbcode($message); 213 $message = $bb_code->get_html(); 211 214 212 215 $template->set_filenames(array( … … 227 230 case 'edit_template_preview': 228 231 229 require_once ($root_path . 'include/ functions_post.php');232 require_once ($root_path . 'include/bbcode/bbcode.lib.php'); 230 233 231 234 $template_prev = request_var('template', ''); … … 235 238 ); 236 239 240 $bb_code = new bbcode($template_prev); 241 $template_prev = $bb_code->get_html(); 242 237 243 $template->assign_vars(array( 238 'PREVIEW_VIEW' => format_comment($template_prev))244 'PREVIEW_VIEW' => $template_prev) 239 245 ); 240 246 … … 243 249 return $_RESULT = array( 'tpl' => $tpl ); 244 250 251 break; 252 253 case 'update_tag': 254 $name = request_var('tag_name', ''); 255 $tag_type = request_var('tag_type', TYPE_TORRENT); 256 $id = request_var('id', 0); 257 $type = request_var('type', ''); 258 259 if ( !$name ) { 260 return; 261 } 262 263 if ( strpos($name, ',') !== false ) { 264 $name = explode(',', $name); 265 } 266 else { 267 $name = array($name); 268 } 269 270 if ( $config['tags_max_allow'] ) { 271 $sql = 'SELECT COUNT(*) AS count FROM ' . TAGS_USERS_TABLE . ' WHERE tag_users_uid = ' . $userdata['uid'] . ' AND tag_users_for_id = ' . $id . ' AND tag_users_type = ' . $tag_type; 272 $result = $db->sql_query($sql); 273 $count = ( $row = $db->sql_fetchrow($result) ) ? $row['count'] : 0; 274 275 if ( $count >= $config['tags_max_allow'] || ( ( sizeof($name) + $count ) >= $config['tags_max_allow'] ) ) { 276 return $_RESULT = array( 'message' => sprintf($lang['no_more_tags_allowed'], $config['tags_max_allow']) ); 277 } 278 } 279 280 $message = ''; 281 $tags = ''; 282 283 foreach ( $name AS $_null => $tag_name ) { 284 $tag_name = trim($tag_name); 285 $tag_name = preg_replace('/[\.,:\^]/', '', $tag_name); 286 $tag_length = utf_strlen($tag_name); 287 288 if ( $config['tags_max_length'] && $tag_length > $config['tags_max_length'] ) { 289 $message .= sprintf($lang['tag_is_too_short_or_long'], $tag_name, $config['tags_min_length'], $config['tags_max_length']); 290 continue; 291 } 292 293 if ( $config['tags_min_length'] && $tag_length < $config['tags_min_length'] ) { 294 $message .= sprintf($lang['tag_is_too_short_or_long'], $tag_name, $config['tags_min_length'], $config['tags_max_length']); 295 continue; 296 } 297 298 //get info for this tag and user from db -> mb user already voted for this tag? 299 300 $sql = 'SELECT * 301 FROM ' . TAGS_USERS_TABLE . ' 302 WHERE tag_users_uid = ' . $userdata['uid'] . ' 303 AND tag_users_for_id = ' . $id . ' 304 AND tag_users_type = ' . $tag_type . ' 305 AND tag_users_name = \'' . $db->sql_escape($tag_name) . '\''; 306 $result = $db->sql_query($sql); 307 308 if ( $row = $db->sql_fetchrow($result) ) { 309 $message = $lang['dupe_vote']; 310 } 311 else { 312 if ( $type == 'down' ) { 313 $sql = 'SELECT tag_count 314 FROM ' . TAGS_TABLE . ' 315 WHERE tag_name = \'' . $db->sql_escape($tag_name) . '\' 316 AND tag_type = ' . $tag_type . ' 317 AND tag_for_id = ' . $id; 318 $result = $db->sql_query($sql); 319 $tag_count = ( $row = $db->sql_fetchrow($result) ) ? $row['tag_count'] : false; 320 321 if ( $tag_count <= 1 && $tag_count !== false ) { 322 $sql = 'DELETE 323 FROM ' . TAGS_TABLE . ' 324 WHERE tag_name = \'' . $db->sql_escape($tag_name) . '\' 325 AND tag_type = ' . $tag_type . ' 326 AND tag_for_id = ' . $id; 327 $lets_insert = false; 328 } 329 else { 330 $sql = 'UPDATE ' . TAGS_TABLE . ' 331 SET tag_count = tag_count - 1 332 WHERE tag_name = \'' . $db->sql_escape($tag_name) . '\' 333 AND tag_type = ' . $tag_type . ' 334 AND tag_for_id = ' . $id; 335 $lets_insert = true; 336 } 337 338 $db->sql_query($sql); 339 } 340 else { 341 $sql = 'UPDATE ' . TAGS_TABLE . ' 342 SET tag_count = tag_count + 1 343 WHERE tag_name = \'' . $db->sql_escape($tag_name) . '\' 344 AND tag_type = ' . $tag_type . ' 345 AND tag_for_id = ' . $id; 346 $db->sql_query($sql); 347 $lets_insert = true; 348 } 349 350 //we using LOWER function in mysql, not in php - it's not a mistake! 351 // new tag, let's insert 352 if ( !$db->sql_affectedrows() && $lets_insert ) { 353 $sql = 'INSERT INTO ' . TAGS_TABLE . ' VALUES (LOWER(\'' . $db->sql_escape($tag_name) . '\'), ' . $tag_type . ', ' . $id . ', 1)'; 354 $db->sql_query($sql); 355 356 $tags .= ' <a href="' . append_sid($root_path . 'browse.php?search_in=3&search=' . $tag_name) . '">' . $tag_name . '</a>'; 357 } 358 359 $sql = 'INSERT INTO ' . TAGS_USERS_TABLE . ' VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . $tag_type . ', LOWER(\'' . $db->sql_escape($tag_name) . '\'))'; 360 $db->sql_query($sql); 361 362 //$message .= sprintf($lang['tag_added'], $tag_name) . "\n"; 363 } 364 } 365 366 return $_RESULT = array( 'message' => $message, 'tags' => $tags ); 367 break; 368 369 case 'autocomplete_tags': 370 $tag_name = request_var('q', ''); 371 372 $tag_length = utf_strlen($tag_name); 373 374 if ( $tag_length < $config['tags_min_length'] ) { 375 return false; 376 } 377 else { 378 $sql = 'SELECT SUM(tag_count) AS sum, tag_name 379 FROM ' . TAGS_TABLE . ' 380 WHERE tag_name LIKE \'' . $db->sql_escape($tag_name) . '%\' 381 GROUP BY tag_name 382 ORDER BY sum DESC'; 383 $result = $db->sql_query($sql); 384 385 while ( $row = $db->sql_fetchrow($result) ) { 386 echo $row['tag_name'] . "\n"; 387 } 388 } 245 389 break; 246 390 announce.php
r241 r269 3 3 $root_path = './'; 4 4 require ($root_path . 'include/config.php'); 5 require ($root_path . 'include/ benc.php');5 require ($root_path . 'include/functions_announce.php'); 6 6 require ($root_path . '/languages/lang_' . $config['default_lang'] . '/lang_announce.php'); 7 7 bookmarks.php
r266 r269 15 15 16 16 if ( $tor_id ) { 17 $sql = 'SELECT name FROM ' . TORRENTS_TABLE . ' WHERE fid = ' . $tor_id;17 $sql = 'SELECT name, category FROM ' . TORRENTS_TABLE . ' WHERE fid = ' . $tor_id; 18 18 $result = $db->sql_query($sql); 19 19 … … 21 21 trigger_error(sprintf($lang['invalid_id'],$tor_id)); 22 22 } 23 24 $cats = $cache->obtain_cats(); 25 $cat_id = $row['category']; 26 $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 23 27 24 28 … … 102 106 list($pagertop, $pagerbottom, $limit) = pager($torrentsperpage, $count, 'bookmarks.php?'); 103 107 104 $sql = 'SELECT b.id AS bookmarkid, u.name AS username, u.uid AS owner, u.privacy, t.fid, t.category, t.leechers, t.seeders, t.name, t.completed, t.free, t.size, t.ctime, t.comments, t.numfiles, t.filename, t.owner, t.hidden, t.numratings, t.ratingsum, t.save_as, t.numfiles, t.filename, t.size, t.completed, t.category, t. hidden, t.moderated, t.banned108 $sql = 'SELECT b.id AS bookmarkid, u.name AS username, u.uid AS owner, u.privacy, t.fid, t.category, t.leechers, t.seeders, t.name, t.completed, t.free, t.size, t.ctime, t.comments, t.numfiles, t.filename, t.owner, t.hidden, t.numratings, t.ratingsum, t.save_as, t.numfiles, t.filename, t.size, t.completed, t.category, t.moderated, t.banned 105 109 FROM ' . BOOKMARKS_TABLE . ' b, ' . TORRENTS_TABLE . ' t, ' . USERS_TABLE . ' u 106 110 WHERE b.userid = ' . $userdata['uid'] . ' AND b.torrentid = t.fid AND t.owner = u.uid ' . $orderby . ' ' . $limit; browse.php
r266 r269 278 278 } 279 279 280 281 282 280 if ( isset($cleansearchstr) || $search_id ) { 283 281 … … 302 300 if ( !$search_id ) { 303 301 switch ( $search_in ) { 302 case 3: 303 $where_search = 'tg.tag_name'; 304 $sql = 'SELECT t.fid AS id FROM ' . TORRENTS_TABLE . ' t LEFT JOIN ' . TAGS_TABLE . ' tg ON (t.fid = tg.tag_for_id)'; 305 $cats_sql[] = 'tg.tag_type = ' . TYPE_TORRENT; 306 $strict = true; 307 break; 308 304 309 case 2: 305 310 $where_search = 't.descr'; 311 $sql = 'SELECT t.fid AS id FROM ' . TORRENTS_TABLE . ' t'; 312 $strict = false; 306 313 break; 307 314 308 315 default: 309 316 $where_search = 't.name'; 317 $sql = 'SELECT t.fid AS id FROM ' . TORRENTS_TABLE . ' t'; 318 $strict = false; 310 319 break; 311 320 } 312 $search_ids = search_text_in_db($searchstr, 'SELECT t.fid AS id FROM ' . TORRENTS_TABLE . ' t', $where_search, $cats_sql); 321 322 $search_ids = search_text_in_db($searchstr, $sql, $where_search, $cats_sql, $strict); 313 323 314 324 if ( sizeof($search_ids) ) { … … 413 423 $incldead_select .= '</select>'; 414 424 425 $search_in_ary = array(1 => $lang['name'], 2 => $lang['description'], 3 => $lang['tags']); 426 $search_in_select = '<select name="search_in">'; 427 foreach ( $search_in_ary AS $_key => $_val ) { 428 $search_in_select .= '<option value="' . $_key . '"' . ( $search_in === $_key ? ' selected="selected"' : '' ) . '>' . $_val . '</option>'; 429 } 430 $search_in_select .= '</select>'; 431 415 432 if ( $page ) { 416 433 $back_url[] = 'page=' . $page; … … 434 451 'S_BROWSE_ACTION' => append_sid($root_path . 'browse.php'), 435 452 'U_SHOW_ALL' => append_sid($root_path . 'browse.php?all=1'), 436 'L_JS_SEARCH_EXPLAIN' => str_replace("'", "\'", $lang['search_explain']),437 453 'INCLDEAD_SELECT' => $incldead_select, 438 'SEARCH_IN_CHECKED_1' => ($search_in == 1 ? ' selected="selected"' : ''), 439 'SEARCH_IN_CHECKED_2' => ($search_in == 2 ? ' selected="selected"' : ''), 454 'SEARCH_IN_SELECT' => $search_in_select, 440 455 'SEARCH_STRING' => $searchstr, 441 456 'CAT_DROP_DOWN' => $catdropdown, chat/index.php
r218 r269 9 9 10 10 // Show all errors: 11 error_reporting(E_ALL);11 //error_reporting(E_ALL); 12 12 13 13 // Path to the chat directory: comment.php
r266 r269 2 2 $root_path = './'; 3 3 require ($root_path . 'include/config.php'); 4 require ($root_path . 'include/bbcode/bbcode.lib.php'); 4 5 require ($root_path . 'include/functions_post.php'); 5 6 … … 340 341 } 341 342 342 $sql = 'SELECT comment_for_id FROM ' . COMMENTS_TABLE . ' WHERE comment_id = ' . $id; 343 $sql = 'SELECT c.comment_for_id, ' . $field . ' 344 FROM ' . COMMENTS_TABLE . ' c, ' . $sql_table . ' 345 WHERE c.comment_for_id = ' . $where . ' 346 AND comment_id = ' . $id; 343 347 $result = $db->sql_query($sql); 344 348 if ( !($arr = $db->sql_fetchrow($result)) ) { … … 409 413 $username = ( $arr['uid'] == ANONYMOUS ? $lang['unknown'] : $arr['username'] ); 410 414 411 $quoted_text = '[quote= ' . $username . ']' . $arr['comment_text'] . '[/quote]';415 $quoted_text = '[quote="' . $username . '"]' . $arr['comment_text'] . '[/quote]'; 412 416 413 417 $tpl = textbbcode(trim($quoted_text)); … … 439 443 440 444 if ( $row = $db->sql_fetchrow($result) ) { 441 442 445 $sql = 'SELECT COUNT(*) AS count FROM ' . COMMENTS_TABLE . ' WHERE comment_type = ' . $row['comment_type'] . ' AND comment_for_id = ' . $row['comment_for_id'] . ' AND comment_id < ' . $id; 443 446 $result = $db->sql_query( $sql ); db_updater.php
r268 r269 393 393 $db->sql_query('ALTER TABLE ' . THEMES_TABLE . ' DROP `bbcode_bitfield`'); 394 394 395 $db->sql_query('UPDATE ' . POSTS_TEXT_TABLE . ' SET post_text = REPLACE( post_text, CONCAT( \':\', bbcode_uid ) , \'\' )'); 396 $db->sql_query('ALTER TABLE ' . POSTS_TEXT_TABLE . ' DROP bbcode_uid'); 397 $db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_sig = REPLACE( user_sig, CONCAT( \':\', user_sig_bbcode_uid ) , \'\' )'); 398 $db->sql_query('ALTER TABLE ' . USERS_TABLE . ' DROP user_sig_bbcode_uid'); 399 400 $db->sql_query('UPDATE ' . POSTS_TEXT_TABLE . ' SET post_text = REPLACE( post_text, \'[color=green][size=9]\' , \'[color=green][size=1]\' )'); 401 $db->sql_query('UPDATE ' . COMMENTS_TABLE . ' SET comment_text = REPLACE( comment_text, \'[color=green][size=9]\' , \'[color=green][size=1]\' )'); 402 403 $sql = 'SELECT post_text, post_id FROM ' . POSTS_TEXT_TABLE . ' WHERE post_text LIKE \'%[img:%\''; 404 $result = $db->sql_query($sql); 405 while ( $row = $db->sql_fetchrow($result) ) { 406 $post_text = preg_replace('/\[img:([0-9]+):([0-9]+)\]/si', '[img]', $row['post_text']); 407 $db->sql_query('UPDATE ' . POSTS_TEXT_TABLE . ' SET post_text = \'' . $db->sql_escape($post_text) . '\' WHERE post_id = ' . $row['post_id']); 408 } 409 410 set_config('tags_max_allow', 10); 411 set_config('tags_max_length', 50); 412 set_config('tags_min_length', 3); 413 414 $db->sql_query('CREATE TABLE IF NOT EXISTS tags ( 415 tag_name varchar(255) NOT NULL, 416 tag_type tinyint(1) NOT NULL, 417 tag_for_id int(10) NOT NULL, 418 tag_count int(10) NOT NULL DEFAULT \'0\', 419 KEY tag_type (tag_type), 420 KEY tag_for_id (tag_for_id) 421 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;'); 422 423 $db->sql_query('CREATE TABLE IF NOT EXISTS tags_users ( 424 tag_users_uid int(10) NOT NULL, 425 tag_users_for_id int(10) NOT NULL, 426 tag_users_type tinyint(1) NOT NULL, 427 tag_users_name varchar(255) NOT NULL, 428 KEY tag_users_type (tag_users_type), 429 KEY tag_users_for_id (tag_users_for_id), 430 KEY tag_users_uid (tag_users_uid) 431 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;'); 432 433 $db->sql_query('ALTER TABLE ' . FILES_TABLE . ' CHANGE `filename` `filename` TEXT NULL DEFAULT \'\''); 434 $db->sql_query('ALTER TABLE ' . FILES_TABLE . ' DROP id'); 435 395 436 396 437 $message .= 'Database updated sucefully. Now you must delete this file!'; details.php
r266 r269 1 1 <?php 2 2 $root_path = './'; 3 require ( $root_path . 'include/config.php'); 4 require ( $root_path . 'include/functions_post.php'); 5 require ( $root_path . 'include/benc.php'); 3 require ($root_path . 'include/config.php'); 6 4 7 5 $userdata = session_pagestart( $user_ip ); … … 13 11 function dltable( $left_name, $name, $arr, $aname ) 14 12 { 15 global $userdata, $template, $lang, $theme ;13 global $userdata, $template, $lang, $theme, $root_path; 16 14 17 15 $count = sizeof( $arr ); … … 58 56 } 59 57 else { 60 $u_userdetails = append_sid( 'userdetails.php?id=' . $arr[$i]['uid']);58 $u_userdetails = append_sid($root_path . 'userdetails.php?id=' . $arr[$i]['uid']); 61 59 $username_color = get_user_class_color( $arr[$i]['class'], $arr[$i]['name'] ); 62 60 $username = $arr[$i]['name']; … … 275 273 'USERID' => $row['userid'], 276 274 'USERNAME' => get_user_class_color( $row['class'], $row['name'] ) . get_user_icons( $row ), 277 'U_USERDETAILS' => append_sid( 'userdetails.php?id=' . $row['userid'] ),275 'U_USERDETAILS' => append_sid($root_path . 'userdetails.php?id=' . $row['userid'] ), 278 276 'U_SEND_PM' => append_sid( 'message.php?action=send&receiver=' . $row['userid'] ), 279 277 'TOR_UPLOADED' => $uploaded, … … 300 298 } 301 299 break; 300 301 case 'thanks': 302 $sql = 'SELECT t.userid, u.name 303 FROM ' . THANKS_TABLE . ' t, ' . USERS_TABLE . ' u 304 WHERE t.torrentid = ' . $id . ' AND t.userid = u.uid'; 305 $result = $db->sql_query( $sql ); 306 307 if ( $subrow = $db->sql_fetchrow( $result ) ) { 308 $thanksby = ''; 309 $thanks_userid = ''; 310 do { 311 $thanksby .= ( $thanks_userid ? ', ' : '' ); 312 $thanks_userid = $subrow['userid']; 313 // www.phpBB-SEO.com SEO TOOLKIT START 314 $seo->set_user_url($subrow['name'], $thanks_userid); 315 // www.phpBB-SEO.com SEO TOOLKIT END 316 $thanksby .= '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $thanks_userid) . '">' . $subrow['name'] . '</a>'; 317 } 318 while ( $subrow = $db->sql_fetchrow( $result ) ); 319 $db->sql_freeresult( $result ); 320 } 321 else { 322 $thanksby = ''; 323 } 324 325 return $_RESULT = array( 'tpl' => $thanksby ); 326 break; 302 327 } 303 328 } … … 315 340 316 341 if ( in_array($action, $files) ) { 317 require _once($root_path . 'include/details/' . $action . '.php');342 require($root_path . 'include/details/' . $action . '.php'); 318 343 } 319 344 else { … … 322 347 } 323 348 else { 349 require ($root_path . 'include/bbcode/bbcode.lib.php'); 350 require ($root_path . 'include/functions_post.php'); 351 324 352 $view = request_var('view', ''); 325 353 $highlight = request_var('highlight', ''); 326 354 $cats = $cache->obtain_cats(); 355 327 356 if ( !$id ) { 328 357 trigger_error( sprintf( $lang['invalid_id'], $id ) ); … … 350 379 351 380 $template->assign_vars( array( 352 'ID' => $id, 353 'L_ADD_TO_BOOKMARKS' => ( $userdata['session_logged_in'] ? $lang['add_to_bookmarks'] : '' ), 381 'ID' => $id 354 382 )); 355 383 384 if ( isset($cats[$cats[$row['category']]['cat_parent']]['cat_name']) ) { 385 $cat_parent = $cats[$cats[$row['category']]['cat_parent']]; 386 387 $cat_parent_name = '<a href="' . append_sid($root_path . 'browse.php?cat=' . $cat_parent['cat_id']) . '">' . $cat_parent['cat_name'] . '</a> -> '; 388 } 389 else { 390 $cat_parent_name = ''; 391 } 392 356 393 if ( $view <> 'comments' ) { 357 $template->assign_block_vars( 'torrent_details', array() );358 394 359 395 $message1 = ''; … … 400 436 $rating_options .= '<option value="' . $k . '">' . $k . ' - ' . $v . '</option>'; 401 437 } 402 $template->assign_block_vars( ' torrent_details.switch_rating_form', array(438 $template->assign_block_vars( 'switch_rating_form', array( 403 439 'RATING_OPTIONS' => $rating_options 404 440 )); … … 416 452 $owner = ( $row['owner'] ? ( $row['privacy'] == PRIVACY_LEVEL_HIGH && $userdata['class'] < UC_MODERATOR && $row['owner'] <> $userdata['uid'] ? '<i>' . $lang['anonymous'] . '</i>' : $row['owner'] ) : '<i>' . $lang['unknown'] . '</i>' ); 417 453 $last_activity = ( $row['mtime'] == $row['ctime'] ? $lang['none'] : sprintf( $lang['last_activity'], mkprettytime( time() - $row['mtime'] ) ) . ' (' . create_date($row['mtime']) . ')' ); 418 $description = censor_text( format_comment($row['descr']) ); 454 $description = censor_text($row['descr']); 455 456 $bb_code = new bbcode($description); 457 $description = $bb_code->get_html(); 458 459 419 460 if ( $highlight ) { 420 461 $description = highlight_text($highlight, $description); 421 462 } 422 $cat_parent_name = ( isset($cats[$cats[$row['category']]['cat_parent']]['cat_name']) ? $cats[$cats[$row['category']]['cat_parent']]['cat_name'] . ' -> ' : '' ); 463 464 $cat_name = '<a href="' . append_sid($root_path . 'browse.php?cat=' . $cats[$row['category']]['cat_id']) . '">' . $cats[$row['category']]['cat_name'] . '</a>'; 423 465 424 466 $template->assign_vars( array( 425 467 'MESSAGE1' => $message1, 426 468 'MESSAGE2' => $message2, 427 'U_DETAILS' => append_sid($root_path . 'details.php?id=' . $id ),469 'U_DETAILS' => append_sid($root_path . 'details.php?id=' . $id), 428 470 'U_DOWNLOAD' => append_sid($root_path . 'details.php?id=' . $id . '&action=download'), 429 'U_DOWNLOAD_AS_GZIP' => append_sid($root_path . 'details.php?id=' . $id . '&action=download&type=gzip' ),430 'U_ADD_TO_BOOKMARKS' => append_sid( 'bookmarks.php?torrent=' . $id ),471 'U_DOWNLOAD_AS_GZIP' => append_sid($root_path . 'details.php?id=' . $id . '&action=download&type=gzip'), 472 'U_ADD_TO_BOOKMARKS' => append_sid('bookmarks.php?torrent=' . $id ), 431 473 'U_VIEW_NFO' => append_sid($root_path . 'details.php?id=' . $id . '&action=viewnfo'), 432 'U_VIEW_SNATCHEDLIST' => append_sid($root_path . 'details.php?id=' . $id . '&view=snatchedlist' ),433 'U_VIEW_PEERLIST' => append_sid($root_path . 'details.php?id=' . $id . '&view=peerlist' ),434 'U_VIEW_FILELIST' => append_sid($root_path . 'details.php?id=' . $id . '&view=filelist' ),474 'U_VIEW_SNATCHEDLIST' => append_sid($root_path . 'details.php?id=' . $id . '&view=snatchedlist'), 475 'U_VIEW_PEERLIST' => append_sid($root_path . 'details.php?id=' . $id . '&view=peerlist'), 476 'U_VIEW_FILELIST' => append_sid($root_path . 'details.php?id=' . $id . '&view=filelist'), 435 477 'S_EDIT_ACTION' => append_sid($root_path . 'details.php?id=' . $id . '&action=edit'), 436 478 'SPACER' => ' ', … … 439 481 'IMG_FREE' => $images['freedownload'], 440 482 'TORRENT_FILENAME' => htmlspecialchars( $row['filename'] ), 441 'INFO_HASH' => preg_replace_callback( '/./s', 'hex_esc', hash_pad( $row['info_hash']) ),483 'INFO_HASH' => preg_replace_callback('/./s', create_function('$matches','return sprintf(\'%02x\', ord($matches[0]));'), str_pad($row['info_hash'], 20) ), 442 484 'DESCRIPTION' => $description, 443 485 'BANNED' => ( $row['banned'] ? $lang['yes'] : $lang['no'] ), 444 'TYPE' => $cat_parent_name . $cat s[$row['category']]['cat_name'],486 'TYPE' => $cat_parent_name . $cat_name, 445 487 'LAST_ACTIVITY' => $last_activity, 446 488 'SIZE' => mksize( $row['size'] ) . ' (' . number_format( $row['size'] ) . ' ' . $lang['bytes'] . ')', … … 450 492 'HITS' => $row['hits'], 451 493 'HIDDEN' => ( $row['hidden'] ? $lang['yes'] : $lang['no'] ), 452 'USER_UPLOADED' => ( is_numeric($owner) ? ( '<a href="' . append_sid( 'userdetails.php?id=' . $owner ) . '"><b>' . $row['username'] . '</b></a>' ) : $owner ),494 'USER_UPLOADED' => ( is_numeric($owner) ? ( '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $owner ) . '"><b>' . $row['username'] . '</b></a>' ) : $owner ), 453 495 'NUM_FILES' => sprintf( $lang['num_files'], $row['numfiles'] ), 454 496 'PEERS_COUNT' => sprintf( $lang['peers_count'], $row['seeders'], $row['leechers'], ( $row['seeders'] + $row['leechers'] ) ), 455 497 'REPORT' => sprintf( $lang['report_descr'], append_sid( 'reports.php?action=send_report&type=torrent&id=' . $id ) ), 456 'OWNER_ID' => ( is_numeric($owner) ? $owner : 0 ) 498 'OWNER_ID' => ( is_numeric($owner) ? $owner : 0 ), 499 500 'TAG_TYPE' => TYPE_TORRENT 457 501 )); 458 502 459 503 if ( $userdata['session_logged_in'] && $userdata['class'] >= UC_ADMINISTRATOR ) { 460 $template->assign_block_vars( ' torrent_details.switch_add_to_index', array(504 $template->assign_block_vars( 'switch_add_to_index', array( 461 505 'U_ADD_TO_INDEX' => append_sid( 'releases.php?action=autoadd&id=' . $id ) 462 506 )); 463 507 } 464 if ( trim( $row['nfo'] ) ) { 465 $template->assign_block_vars( 'torrent_details.switch_nfo_section', array() ); 466 } 467 if ( $userdata['class'] >= UC_MODERATOR ) { 468 $template->assign_block_vars( 'torrent_details.switch_banned_section', array() ); 508 if ( $row['nfo'] ) { 509 $template->assign_block_vars( 'switch_nfo_section', array() ); 469 510 } 470 511 if ( $userdata['session_logged_in'] && ( $userdata['hiddentorrents'] || $userdata['class'] >= UC_MODERATOR ) ) { 471 $template->assign_block_vars( ' torrent_details.switch_hidden_section', array() );512 $template->assign_block_vars( 'switch_hidden_section', array() ); 472 513 } 473 514 474 515 if ( $row['completed'] ) { 475 $template->assign_block_vars( ' torrent_details.switch_simple_snatched', array(516 $template->assign_block_vars( 'switch_simple_snatched', array( 476 517 'SIMPLE_SNATCHED_COUNT' => sprintf( $lang['snatched_times'], $row['completed'] ) 477 518 )); 478 519 } 479 520 if ( $userdata['uid'] == $row['owner'] || $userdata['class'] >= UC_MODERATOR ) { 480 $template->assign_block_vars( ' torrent_details.switch_owner_section', array() );521 $template->assign_block_vars( 'switch_owner_section', array() ); 481 522 } 482 523 … … 488 529 $peer_count = ( $sos_row = $db->sql_fetchrow( $result ) ) ? intval( $sos_row['peers_count'] ) : 0; 489 530 if ( $peer_count ) { 490 $template->assign_block_vars( 'torrent_details.switch_sos_section', array() ); 491 } 492 } 493 494 $sql = 'SELECT t.userid, u.name 495 FROM ' . THANKS_TABLE . ' t, ' . USERS_TABLE . ' u 496 WHERE t.torrentid = ' . $id . ' AND t.userid = u.uid'; 497 $result = $db->sql_query( $sql ); 498 499 if ( $subrow = $db->sql_fetchrow( $result ) ) { 500 $thanksby = ''; 501 $disabled = 'disabled="disabled"'; 502 $thanks_userid = ''; 503 $user_thanked = 0; 531 $template->assign_block_vars( 'switch_sos_section', array() ); 532 } 533 } 534 535 /* start tags */ 536 537 $sql = 'SELECT tag_name, tag_count 538 FROM ' . TAGS_TABLE . ' 539 WHERE tag_type = ' . TYPE_TORRENT . ' 540 AND tag_for_id = ' . $id; 541 $result = $db->sql_query($sql); 542 if ( $subrow = $db->sql_fetchrow($result) ) { 543 $template->assign_vars(array( 544 'TAGS' => '' 545 )); 546 547 $tags = array(); 504 548 do { 505 $thanksby .= ( $thanks_userid ? ', ' : '' ); 506 $thanks_userid = $subrow['userid']; 507 if ( $userdata['session_logged_in'] && ( $userdata['uid'] == $thanks_userid ) ) { 508 $user_thanked = 1; 509 } 510 $thanksby .= '<a href="' . append_sid( 'userdetails.php?id=' . $thanks_userid ) . '">' . $subrow['name'] . '</a>'; 511 } 512 while ( $subrow = $db->sql_fetchrow( $result ) ); 513 $db->sql_freeresult( $result ); 514 if ( !$user_thanked && $userdata['uid'] != $row['owner'] && $userdata['session_logged_in'] ) { 515 $disabled = ''; 516 } 517 $template->assign_block_vars( 'torrent_details.switch_thanks', array( 518 'THANKS_USERS' => $thanksby, 519 'DISABLED' => $disabled 549 $tags[$subrow['tag_name']] = $subrow['tag_count']; 550 } 551 while ( $subrow = $db->sql_fetchrow($result) ); 552 553 //simple tag cloud find here http://www.bytemycode.com/snippets/snippet/415/ 554 555 $max_qty = max(array_values($tags)); 556 $min_qty = min(array_values($tags)); 557 558 $spread = $max_qty - $min_qty; 559 $spread = ( $spread == 0 ? 1 : $spread ); 560 561 $step = ( $config['max_tag_size'] - $config['min_tag_size'] ) / $spread; 562 563 foreach ( $tags AS $tag_name => $tag_count ) { 564 $size = round($config['min_tag_size'] + (($tag_count - $min_qty) * $step)); 565 566 $template->assign_block_vars('tags_row', array( 567 'TAG_NAME' => $tag_name, 568 'TAG_SIZE' => $size, 569 570 'U_TAG' => append_sid($root_path . 'browse.php?search_in=3&search=' . $tag_name), 571 572 'U_TAG_USERS' => append_sid($root_path . 'modtask.php?action=tags&do=view_users&tag_name=' . $tag_name . '&tag_type=' . TYPE_TORRENT . '&tag_for_id=' . $id), 573 )); 574 } 575 } 576 else { 577 $template->assign_vars(array( 578 'TAGS' => $lang['no_tags'] 520 579 )); 521 580 } 522 elseif ( !$userdata['session_logged_in'] || $userdata['uid'] == $row['owner'] ) { 523 $template->assign_block_vars( 'torrent_details.switch_thanks', array( 524 'DISABLED' => 'disabled="disabled"' 525 )); 526 } 527 else { 528 $template->assign_block_vars( 'torrent_details.switch_thanks', array( 529 'DISABLED' => '' 530 )); 531 } 581 /* end tags */ 582 583 $include_header = false; 584 585 $body = 'details.html'; 586 532 587 stdhead( sprintf( $lang['torrent_details'], $torrent_name ), false ); 533 588 } 534 589 else { 535 590 stdhead( sprintf( $lang['comments_for'], $torrent_name ) ); 536 $template->assign_ block_vars( 'switch_comments_details_head',array(537 'COMMENTS_FOR' => sprintf( $lang['comments_for'], '<a href="' . append_sid( $root_path . 'details.php?id=' . $id) . '">' . $torrent_name . '</a>' )591 $template->assign_vars(array( 592 'COMMENTS_FOR' => sprintf( $lang['comments_for'], '<a href="' . append_sid($root_path . 'details.php?id=' . $id) . '">' . $torrent_name . '</a>' ) 538 593 )); 594 595 $include_header = true; 596 597 $body = 'details_comments.html'; 539 598 } 540 599 if ( $userdata['session_logged_in'] ) { … … 549 608 $db->sql_query($sql); 550 609 } 551 $check_action = 'comment.php?type=' . TYPE_TORRENT . '&action=checkoff&tid=' . $id;610 $check_action = append_sid($root_path . 'comment.php?type=' . TYPE_TORRENT . '&action=checkoff&tid=' . $id); 552 611 $check_title = $lang['checkcomm_off']; 553 612 } 554 613 else { 555 $check_action = 'comment.php?type=' . TYPE_TORRENT . '&action=check&tid=' . $id;614 $check_action = append_sid($root_path . 'comment.php?type=' . TYPE_TORRENT . '&action=check&tid=' . $id); 556 615 $check_title = $lang['checkcomm_on']; 557 616 } … … 575 634 set_cookie('d', serialize( $tracking_details )); 576 635 } 577 if ( !$row['comments'] && !isset( $_GET['page'] ) ) {578 $template->assign_block_vars( 'switch_no_comments_details', array(579 'U_ADD_COMMENT' => append_sid($root_path . 'comment.php?type=' . TYPE_TORRENT . '&action=add&tid=' . $id ),580 'U_CHECK' => ( isset( $check_action ) ? append_sid($root_path . $check_action ) : '' ),581 'CHECK_TITLE' => ( isset( $check_title ) ? $check_title : '' ),582 'L_ADD_NEW_COMMENT' => ( $userdata['session_logged_in'] ? $lang['add_new_comment'] : '' ),583 'DISABLE_COMMENTS' => $row['disable_comments']584 ));585 }586 636 else { 587 list( $pagertop, $pagerbottom, $limit ) = pager( $config['posts_per_page'], $row['comments'], 'details.php?id=' . $id . '&' . ( isset( $_GET['view'] ) ? 'view=comments&' : '' ) ); 588 637 $check_action = ''; 638 $check_title = ''; 639 } 640 641 if ( $row['comments'] ) { 642 list($pagertop, $pagerbottom, $limit) = pager($config['posts_per_page'], $row['comments'], 'details.php?id=' . $id . '&' . ( isset( $_GET['view'] ) ? 'view=comments&' : '' )); 589 643 commenttable(TYPE_TORRENT, $id, $limit); 590 591 $template->assign_block_vars( 'switch_comments_details', array( 592 'U_ADD_COMMENT' => append_sid($root_path . 'comment.php?type=' . TYPE_TORRENT . '&action=add&tid=' . $id ), 593 'U_CHECK' => ( isset( $check_action ) ? append_sid( $check_action ) : '' ), 594 'CHECK_TITLE' => ( isset( $check_title ) ? $check_title : '' ), 595 'L_ADD_NEW_COMMENT' => ( $userdata['session_logged_in'] ? $lang['add_new_comment'] : '' ), 596 'DISABLE_COMMENTS' => $row['disable_comments'], 597 'COMMENTBAR' => ( isset( $commentbar ) ? $commentbar : '' ), 598 'PAGERTOP' => $pagertop, 599 'PAGERBOTTOM' => $pagerbottom 600 )); 601 } 644 } 645 else { 646 $pagertop = ''; 647 $pagerbottom = ''; 648 } 649 650 $template->assign_vars(array( 651 'U_ADD_COMMENT' => append_sid($root_path . 'comment.php?type=' . TYPE_TORRENT . '&action=add&tid=' . $id ), 652 'U_CHECK' => $check_action, 653 'CHECK_TITLE' => $check_title, 654 'DISABLE_COMMENTS' => $row['disable_comments'], 655 656 'COMMENTS_COUNT' => $row['comments'], 657 658 'INCLUDE_HEADER' => $include_header, 659 660 'PAGERTOP' => $pagertop, 661 662 'PAGERBOTTOM' => $pagerbottom, 663 )); 602 664 } 603 665 $template->set_filenames( array( 604 'body' => 'details.html'666 'body' => $body 605 667 )); 606 668 stdfoot(); include/acp/config/upload_settings.php
r226 r269 12 12 13 13 'max_torrent_size' => array('lang' => 'max_torrent_size', 'validate' => 'int', 'type' => 'text:20:255', 'explain' => true), 14 'torrent_dir' => array('lang' => 'torrent_dir', 'validate' => ' script_path', 'type' => 'text:50:255', 'explain' => true),14 'torrent_dir' => array('lang' => 'torrent_dir', 'validate' => 'wpath', 'type' => 'text:50:255', 'explain' => true), 15 15 16 16 'demote_uploader_days' => array('lang' => 'demote_uploaders', 'validate' => 'int', 'type' => 'text:20:255', 'explain' => true), include/ajax.php
r221 r269 25 25 var $LOADER = null; 26 26 var $ID = null; 27 var $RESULT = null; 27 28 28 29 // Internal; uniq value. 29 30 var $_uniqHash; 31 // Magic number for display_error checking. 32 var $_magic = 14623; 33 // Previous display_errors value. 34 var $_prevDisplayErrors = null; 30 35 // Internal: response content-type depending on loader type. 31 36 var $_contentTypes = array( … … 41 46 // Which Unicode conversion function is available? 42 47 var $_unicodeConvMethod = null; 48 // Emergency memory buffer to be freed on memory_limit error. 49 var $_emergBuffer = null; 43 50 44 51 … … 49 56 * to script output buffer. As a result - script will always return 50 57 * correct JavaScript code, even in case of fatal errors. 58 * 59 * QUERY_STRING is in form of: PHPSESSID=<sid>&a=aaa&b=bbb&JsHttpRequest=<id>-<loader> 60 * where <id> is a request ID, <loader> is a loader name, <sid> - a session ID (if present), 61 * PHPSESSID - session parameter name (by default = "PHPSESSID"). 62 * 63 * If an object is created WITHOUT an active AJAX query, it is simply marked as 64 * non-active. Use statuc method isActive() to check. 51 65 */ 52 66 function JsHttpRequest($enc = 'utf-8') 53 67 { 54 // QUERY_STRING is in form of: PHPSESSID=<sid>&a=aaa&b=bbb&JsHttpRequest=<id>-<loader> 55 // where <id> is a request ID, <loader> is a loader name, <sid> - a session ID (if present), 56 // PHPSESSID - session parameter name (by default = "PHPSESSID"). 68 global $JsHttpRequest_Active; 69 70 // To be on a safe side - do not allow to drop reference counter on ob processing. 71 $GLOBALS['_RESULT'] =& $this->RESULT; 57 72 58 73 // Parse QUERY_STRING. … … 68 83 $_REQUEST[session_name()] 69 84 ); 85 // Detect Unicode conversion method. 86 $this->_unicodeConvMethod = function_exists('mb_convert_encoding')? 'mb' : (function_exists('iconv')? 'iconv' : null); 87 88 // Fill an emergency buffer. We erase it at the first line of OB processor 89 // to free some memory. This memory may be used on memory_limit error. 90 $this->_emergBuffer = str_repeat('a', 1024 * 200); 91 92 // Intercept fatal errors via display_errors (seems it is the only way). 93 $this->_uniqHash = md5('JsHttpRequest' . microtime() . getmypid()); 94 $this->_prevDisplayErrors = ini_get('display_errors'); 95 ini_set('display_errors', $this->_magic); // 96 ini_set('error_prepend_string', $this->_uniqHash . ini_get('error_prepend_string')); 97 ini_set('error_append_string', ini_get('error_append_string') . $this->_uniqHash); 98 if (function_exists('xdebug_disable')) xdebug_disable(); // else Fatal errors are not catched 99 100 // Start OB handling early. 101 ob_start(array(&$this, "_obHandler")); 102 $JsHttpRequest_Active = true; 103 104 // Set up the encoding. 105 $this->setEncoding($enc); 106 107 // Check if headers are already sent (see Content-Type library usage). 108 // If true - generate a debug message and exit. 109 $file = $line = null; 110 $headersSent = version_compare(PHP_VERSION, "4.3.0") < 0? headers_sent() : headers_sent($file, $line); 111 if ($headersSent) { 112 trigger_error( 113 "HTTP headers are already sent" . ($line !== null? " in $file on line $line" : " somewhere in the script") . ". " 114 . "Possibly you have an extra space (or a newline) before the first line of the script or any library. " 115 . "Please note that JsHttpRequest uses its own Content-Type header and fails if " 116 . "this header cannot be set. See header() function documentation for more details", 117 E_USER_ERROR 118 ); 119 exit(); 120 } 70 121 } else { 71 122 $this->ID = 0; 72 123 $this->LOADER = 'unknown'; 73 } 74 75 // Detect Unicode conversion method. 76 $this->_unicodeConvMethod = function_exists('mb_convert_encoding')? 'mb' : (function_exists('iconv')? 'iconv' : null); 77 78 // Start OB handling early. 79 $this->_uniqHash = md5(microtime() . getmypid()); 80 ini_set('error_prepend_string', ini_get('error_prepend_string') . $this->_uniqHash); 81 ini_set('error_append_string', ini_get('error_append_string') . $this->_uniqHash); 82 ob_start(array(&$this, "_obHandler")); 83 84 // Set up the encoding. 85 $this->setEncoding($enc); 86 87 // Check if headers are already sent (see Content-Type library usage). 88 // If true - generate a debug message and exit. 89 $file = $line = null; 90 if (headers_sent($file, $line)) { 91 trigger_error( 92 "HTTP headers are already sent" . ($line !== null? " in $file on line $line" : "") . ". " 93 . "Possibly you have an extra space (or a newline) before the first line of the script or any library. " 94 . "Please note that JsHttpRequest uses its own Content-Type header and fails if " 95 . "this header cannot be set. See header() function documentation for more details", 96 E_USER_ERROR 97 ); 98 exit(); 99 } 124 $JsHttpRequest_Active = false; 125 } 126 } 127 128 129 /** 130 * Static function. 131 * Returns true if JsHttpRequest output processor is currently active. 132 * 133 * @return boolean True if the library is active, false otherwise. 134 */ 135 function isActive() 136 { 137 return !empty($GLOBALS['JsHttpRequest_Active']); 100 138 } 101 139 … … 108 146 function getJsCode() 109 147 { 110 return file_get_contents(dirname(__FILE__) .'/JsHttpRequest.js');148 return file_get_contents(dirname(__FILE__) . '/JsHttpRequest.js'); 111 149 } 112 150 … … 205 243 206 244 207 208 245 /** 209 246 * Internal methods. … … 222 259 // is NOT default "application/x-www-form-urlencoded"!!! 223 260 // Library frontend sets "application/octet-stream" for that purpose, 224 // see JavaScript code. 261 // see JavaScript code. In PHP 5.2.2.HTTP_RAW_POST_DATA is not set sometimes; 262 // in such cases - read the POST data manually from the STDIN stream. 263 $rawPost = strcasecmp($_SERVER['REQUEST_METHOD'], 'POST') == 0? (isset($GLOBALS['HTTP_RAW_POST_DATA'])? $GLOBALS['HTTP_RAW_POST_DATA'] : @file_get_contents("php://input")) : null; 225 264 $source = array( 226 265 '_GET' => !empty($_SERVER['QUERY_STRING'])? $_SERVER['QUERY_STRING'] : null, 227 '_POST'=> !empty($GLOBALS['HTTP_RAW_POST_DATA'])? $GLOBALS['HTTP_RAW_POST_DATA'] : null266 '_POST'=> $rawPost, 228 267 ); 229 268 foreach ($source as $dst=>$src) { … … 252 291 function _obHandler($text) 253 292 { 254 // Check for error. 255 if (preg_match('{'.$this->_uniqHash.'(.*?)'.$this->_uniqHash.'}sx', $text)) { 256 $text = str_replace($this->_uniqHash, '', $text); 257 } 258 259 // Make a resulting hash. 260 if (!isset($this->RESULT)) { 261 $this->RESULT = isset($GLOBALS['_RESULT'])? $GLOBALS['_RESULT'] : null; 262 } 263 $encoding = $this->SCRIPT_ENCODING; 293 unset($this->_emergBuffer); // free a piece of memory for memory_limit error 294 unset($GLOBALS['JsHttpRequest_Active']); 295 296 // Check for error & fetch a resulting data. 297 $wasFatalError = false; 298 if (preg_match_all("/{$this->_uniqHash}(.*?){$this->_uniqHash}/sx", $text, $m)) { 299 // Display_errors: 300 // 1. disabled manually after the library initialization, or 301 // 2. was initially disabled and is not changed 302 $needRemoveErrorMessages = !ini_get('display_errors') || (!$this->_prevDisplayErrors && ini_get('display_errors') == $this->_magic); 303 foreach ($m[0] as $error) { 304 if (preg_match('/\bFatal error(<.*?>)?:/i', $error)) { 305 $wasFatalError = true; 306 } 307 if ($needRemoveErrorMessages) { 308 $text = str_replace($error, '', $text); // strip the whole error message 309 } else { 310 $text = str_replace($this->_uniqHash, '', $text); 311 } 312 } 313 } 314 if ($wasFatalError) { 315 // On fatal errors - force "null" result. This is needed, because $_RESULT 316 // may not be fully completed at the moment of the error. 317 $this->RESULT = null; 318 } else { 319 // Read the result from globals if not set directly. 320 if (!isset($this->RESULT)) { 321 global $_RESULT; 322 $this->RESULT = $_RESULT; 323 } 324 // Avoid manual NULLs in the result (very important!). 325 if ($this->RESULT === null) { 326 $this->RESULT = false; 327 } 328 } 329 330 // Note that 500 error is generated when a PHP error occurred. 331 $status = $this->RESULT === null? 500 : 200; 264 332 $result = array( 265 333 'id' => $this->ID, 266 'js' => $this->RESULT, 267 'text' => $text, 334 'js' => $this->RESULT, // null always means a fatal error... 335 'text' => $text, // ...independent on $text!!! 268 336 ); 337 $encoding = $this->SCRIPT_ENCODING; 338 $text = null; // to be on a safe side 339 340 // Try to use very fast json_encode: 3-4 times faster than a manual encoding. 269 341 if (function_exists('array_walk_recursive') && function_exists('json_encode') && $this->_unicodeConvMethod) { 270 $encoding = "UTF-8";271 342 $this->_nonAsciiChars = join("", array_map('chr', range(128, 255))); 272 343 $this->_toUtfFailed = false; 273 array_walk_recursive($result, array(&$this, '_toUtf8_callback'), $this->SCRIPT_ENCODING); 344 $resultUtf8 = $result; 345 array_walk_recursive($resultUtf8, array(&$this, '_toUtf8_callback'), $this->SCRIPT_ENCODING); 274 346 if (!$this->_toUtfFailed) { 275 347 // If some key contains non-ASCII character, convert everything manually. 276 $text = json_encode($result); 277 } else { 278 $text = $this->php2js($result); 279 } 280 } else { 348 $text = json_encode($resultUtf8); 349 $encoding = "UTF-8"; 350 } 351 } 352 353 // On failure, use manual encoding. 354 if ($text === null) { 281 355 $text = $this->php2js($result); 282 356 } 283 284 // Content-type header.285 // In XMLHttpRequest mode we must return text/plain - damned stupid Opera 8.0. :(286 $ctype = !empty($this->_contentTypes[$this->LOADER])? $this->_contentTypes[$this->LOADER] : $this->_contentTypes[''];287 header("Content-type: $ctype; charset=$encoding");288 357 289 358 if ($this->LOADER != "xml") { … … 298 367 $text = '<script type="text/javascript" language="JavaScript"><!--' . "\n$text" . '//--></script>'; 299 368 } 300 } 369 370 // Always return 200 code in non-XML mode (else SCRIPT does not work in FF). 371 // For XML mode, 500 code is okay. 372 $status = 200; 373 } 374 375 // Status header. To be safe, display it only in error mode. In case of success 376 // termination, do not modify the status (""HTTP/1.1 ..." header seems to be not 377 // too cross-platform). 378 if ($this->RESULT === null) { 379 if (php_sapi_name() == "cgi") { 380 header("Status: $status"); 381 } else { 382 header("HTTP/1.1 $status"); 383 } 384 } 385 386 // In XMLHttpRequest mode we must return text/plain - damned stupid Opera 8.0. :( 387 $ctype = !empty($this->_contentTypes[$this->LOADER])? $this->_contentTypes[$this->LOADER] : $this->_contentTypes['']; 388 header("Content-type: $ctype; charset=$encoding"); 301 389 302 390 return $text; … … 311 399 function _toUtf8_callback(&$v, $k, $fromEnc) 312 400 { 313 if ($this->_toUtfFailed || strpbrk($k, $this->_nonAsciiChars) !== false) { 401 if ($v === null || is_bool($v)) return; 402 if ($this->_toUtfFailed || !is_scalar($v) || strpbrk($k, $this->_nonAsciiChars) !== false) { 314 403 $this->_toUtfFailed = true; 315 404 } else { … … 383 472 384 473 385 386 /** 387 * If there is no ICONV, try to decode 1-byte characters manually 474 /** 475 * If there is no ICONV, try to decode 1-byte characters and UTF-8 manually 388 476 * (for most popular charsets only). 389 477 */ … … 394 482 function _decUcs2Decode($code, $toEnc) 395 483 { 484 // Little speedup by using array_flip($this->_encTables) and later hash access. 485 static $flippedTable = null; 396 486 if ($code < 128) return chr($code); 487 397 488 if (isset($this->_encTables[$toEnc])) { 398 // TODO: possible speedup by using array_flip($this->_encTables) and later hash access in the constructor. 399 $p = array_search($code, $this->_encTables[$toEnc]); 400 if ($p !== false) return chr(128 + $p); 401 } 489 if (!$flippedTable) $flippedTable = array_flip($this->_encTables[$toEnc]); 490 if (isset($flippedTable[$code])) return chr(128 + $flippedTable[$code]); 491 } else if ($toEnc == 'utf-8' || $toEnc == 'utf8') { 492 // UTF-8 conversion rules: http://www.cl.cam.ac.uk/~mgk25/unicode.html 493 if ($code < 0x800) { 494 return chr(0xC0 + ($code >> 6)) . 495 chr(0x80 + ($code & 0x3F)); 496 } else { // if ($code <= 0xFFFF) -- it is almost always so for UCS2-BE 497 return chr(0xE0 + ($code >> 12)) . 498 chr(0x80 + (0x3F & ($code >> 6))) . 499 chr(0x80 + ($code & 0x3F)); 500 } 501 } 502 402 503 return ""; 403 504 } … … 446 547 ); 447 548 } 448 ?>include/constants.php
r247 r269 207 207 define('SNATCHED_TABLE', 'snatched'); 208 208 define('SOS_TABLE', 'sos'); 209 define('TAGS_TABLE', 'tags'); 210 define('TAGS_USERS_TABLE', 'tags_users'); 209 211 define('THANKS_TABLE', 'thanks'); 210 212 define('THEMES_TABLE', 'themes'); include/details/download.php
r213 r269 1 1 <?php 2 loggedinorreturn(); 3 require($root_path . '/include/class.bencode.php'); 2 4 3 loggedinorreturn();4 5 $type = request_var('type', ''); 5 6 … … 25 26 $torrent_dir = $root_path . ( !empty($config['torrent_dir']) ? $config['torrent_dir'] : 'torrents'); 26 27 $fn = $torrent_dir . '/' . $id . '.torrent'; 27 if ( !is_file( $fn ) || !is_readable( $fn) ) {28 if ( !is_file($fn) || !is_readable($fn) ) { 28 29 trigger_error( $lang['error_reading_torrent_file'] ); 29 30 } 30 31 31 32 $sql = 'UPDATE ' . TORRENTS_TABLE . ' SET hits = hits + 1 WHERE fid = ' . $id; 32 $db->sql_query( $sql);33 $db->sql_query($sql); 33 34 34 $dict = bdec_file( $fn, filesize( $fn ) ); 35 $dict['value']['announce']['value'] = generate_base_url() . '/announce.php?passkey=' . $userdata['torrent_pass']; 36 $dict['value']['announce']['string'] = benc_str( $dict['value']['announce']['value'] ); 37 $dict['value']['announce']['strlen'] = strlen( $dict['value']['announce']['string'] ); 35 $torrent = new Torrent($fn); 38 36 39 $file = benc( $dict ); 37 $base_url = generate_base_url(); 38 if ( defined('USE_XBTT') ) { 39 $announce = $base_url . ':' . $config['xbt_listen_port'] . '/' . $userdata['torrent_pass'] . '/announce/'; 40 } 41 else { 42 $announce = $base_url . '/announce.php?passkey=' . $userdata['torrent_pass']; 43 } 44 45 $torrent->announce(array($announce)); 40 46 41 47 if ( $type == 'gzip' ) { 42 48 $length = strlen( $file ); 43 49 //next code founded at http://php.net/manual/ru/function.gzcompress.php#50692 44 $comp_data = pack("C1C1C1C1VC1C1", 0x1f, 0x8b, 8, 8, time(), 2, 0xFF) . $row['filename'] . "\0" . gzdeflate($ file, 9) . pack("VV", crc32($file), $length);50 $comp_data = pack("C1C1C1C1VC1C1", 0x1f, 0x8b, 8, 8, time(), 2, 0xFF) . $row['filename'] . "\0" . gzdeflate($torrent, 9) . pack("VV", crc32($torrent), $length); 45 51 header( 'Content-Type: application/x-gzip' ); 46 52 header( 'Content-disposition: attachment; filename="' . str_replace('.torrent', '.gz', $row['filename']) . '"' ); … … 50 56 } 51 57 else { 52 header( 'Content-Type: application/x-bittorrent' ); 53 header( 'Content-disposition: attachment; filename="' . $row['filename'] . '"' ); 54 header( 'Content-transfer-encoding: binary' ); 55 header( 'Content-length: ' . strlen( $file ) ); 56 echo( $file ); 58 $torrent->send($row['filename']); 57 59 } 58 60 ?> include/details/edit.php
r255 r269 1 1 <?php 2 3 loggedinorreturn(); 2 4 3 5 $sql = 'SELECT t.*, user_reputation, user_reputation_level, user_rank_id, uid … … 5 7 WHERE u.uid = t.owner 6 8 AND fid = ' . $id; 7 $result = $db->sql_query( $sql);8 if ( ! ( $row = $db->sql_fetchrow( $result )) ) {9 trigger_error( sprintf( $lang['inv lalid_id'], $id ) );9 $result = $db->sql_query($sql); 10 if ( !$row = $db->sql_fetchrow($result) ) { 11 trigger_error( sprintf( $lang['invalid_id'], $id ) ); 10 12 } 11 13 if ( $userdata['uid'] != $row['owner'] && $userdata['class'] < UC_MODERATOR ) { … … 13 15 } 14 16 17 $cats = $cache->obtain_cats(); 18 19 $cat_id = $row['category']; 20 $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 21 15 22 16 23 if ( isset($_POST['submit']) ) { 17 24 loggedinorreturn(); 18 require_once ( $root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php');19 require_once ( $root_path . 'include/functions_check.php');25 require_once ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 26 require_once ($root_path . 'include/functions_check.php'); 20 27 21 28 $name = request_var('name', ''); … … 95 102 96 103 if ( $tor_action == 'update' ) { 97 list( $tmpname, $infohash, $fname, $totallen, $filelist, $dname, $dict ) = check_torrent( $_FILES['file'] ); 104 list($infohash, $fname, $totallen, $filelist, $dname, $filename) = check_torrent( $_FILES['file'] ); 105 106 $updateset[] = 'filename = ' . "'" . $db->sql_escape( $fname ) . "'"; 107 $updateset[] = 'size = ' . "'" . $db->sql_escape( $totallen ) . "'"; 108 $updateset[] = 'numfiles = ' . "'" . $db->sql_escape( sizeof( $filelist ) ) . "'"; 109 $updateset[] = 'save_as = ' . "'" . $db->sql_escape( $dname ) . "'"; 110 $updateset[] = 'info_hash = ' . "'" . $db->sql_escape( $infohash ) . "'"; 111 112 $sql = 'DELETE FROM ' . FILES_TABLE . ' WHERE torrent = ' . $id; 113 $db->sql_query( $sql ); 114 foreach ( $filelist as $file ) { 115 $sql = 'INSERT INTO ' . FILES_TABLE . ' (torrent, filename, size) VALUES (' . $id . ', ' . "'" . $db->sql_escape( $file[0] ) . "'" . ', ' . $file[1] . ')'; 116 $db->sql_query( $sql ); 117 } 118 if ( $row['info_hash'] != $infohash ) { 119 $sql = 'DELETE FROM ' . PEERS_TABLE . ' WHERE fid = ' . $id; 120 $db->sql_query( $sql ); 121 $updateset[] = 'seeders = 0'; 122 $updateset[] = 'leechers = 0'; 123 } 98 124 99 125 $torrent_dir = $root_path . ( !empty($config['torrent_dir']) ? $config['torrent_dir'] : 'torrents'); 100 101 if ( @move_uploaded_file( $tmpname, $torrent_dir . DIRECTORY_SEPARATOR . $id . '.torrent' ) !== false ) { 102 if ( $fp = @fopen( $torrent_dir . DIRECTORY_SEPARATOR . $id . '.torrent', 'w' ) ) { 103 $updateset[] = 'filename = ' . "'" . $db->sql_escape( $fname ) . "'"; 104 $updateset[] = 'size = ' . "'" . $db->sql_escape( $totallen ) . "'"; 105 $updateset[] = 'numfiles = ' . "'" . $db->sql_escape( sizeof( $filelist ) ) . "'"; 106 $updateset[] = 'save_as = ' . "'" . $db->sql_escape( $dname ) . "'"; 107 $updateset[] = 'info_hash = ' . "'" . $db->sql_escape( $infohash ) . "'"; 108 109 fwrite( $fp, benc( $dict ), strlen( benc( $dict ) ) ); 110 fclose( $fp ); 111 $sql = 'DELETE FROM ' . FILES_TABLE . ' WHERE torrent = ' . $id; 112 $db->sql_query( $sql ); 113 foreach ( $filelist as $file ) { 114 $sql = 'INSERT INTO ' . FILES_TABLE . ' (torrent, filename, size) VALUES (' . $id . ', ' . "'" . $db->sql_escape( $file[0] ) . "'" . ', ' . $file[1] . ')'; 115 $db->sql_query( $sql ); 116 } 117 if ( $row['info_hash'] != $infohash ) { 118 $sql = 'DELETE FROM ' . PEERS_TABLE . ' WHERE fid = ' . $id; 119 $db->sql_query( $sql ); 120 $updateset[] = 'seeders = 0'; 121 $updateset[] = 'leechers = 0'; 122 } 123 } 124 else { 125 trigger_error( $lang['file_cannot_be_uploaded'] ); 126 } 127 } 128 elseif ( !file_exists( $torrent_dir ) || !is_writable( $torrent_dir . DIRECTORY_SEPARATOR ) ) { 129 trigger_error( $lang['dir_not_exist_or_not_writable'] ); 130 } 131 else { 132 trigger_error( $lang['file_cannot_be_uploaded'] ); 133 } 126 @unlink($torrent_dir . DIRECTORY_SEPARATOR . $id . '.torrent'); 127 @rename($torrent_dir . DIRECTORY_SEPARATOR . $filename . '.torrent', $torrent_dir . DIRECTORY_SEPARATOR . $id . '.torrent'); 134 128 } 135 129 $sql = 'UPDATE ' . TORRENTS_TABLE . ' SET ' . implode( ',', $updateset ) . ' WHERE fid = ' . $id; … … 137 131 $cache->destroy( 'sql', INDEXRELEASES_TABLE ); 138 132 139 write_log( sprintf( $lang['log_torrent_edited'], 'details_' . $id, $name, $userdata['name'] ) ); 133 write_log( sprintf( $lang['log_torrent_edited'], $id, $name, $userdata['uid'], $userdata['name']) ); 134 140 135 141 136 redirect( append_sid($root_path . 'details.php?id=' . $id . '&edited=1') ); 142 137 } 143 138 else { 144 145 loggedinorreturn();146 139 require_once ( $root_path . 'include/functions_selects.php' ); 147 140 include/functions.php
r266 r269 1279 1279 function stdhead($title = '', $right_menu = true) { 1280 1280 global $userdata, $config, $template, $lang, $db, $images, $root_path, $theme, $cache; 1281 global $bb_code; 1281 1282 static $ranks; 1282 1283 … … 1425 1426 'CURUSER_ID' => $userdata['uid'], 1426 1427 'S_USER_LOGGED_IN' => $userdata['session_logged_in'], 1428 1429 'S_USER_IS_MOD' => ( $userdata['class'] >= UC_MODERATOR ) ? 1 : 0, 1430 1427 1431 'CURRENT_USER_POINTS_LEVEL' => $userdata['user_reputation_level'], 1428 1432 'CURRENT_USER_POINTS' => $userdata['user_reputation'], … … 1489 1493 1490 1494 if ( $show_news ) { 1491 require_once($root_path . 'include/functions_post.php'); 1495 1496 if ( !isset($bb_code) ) { 1497 require_once($root_path . 'include/bbcode/bbcode.lib.php'); 1498 $bb_code = new bbcode; 1499 } 1492 1500 1493 1501 $template->assign_block_vars('news_annoucment', array()); 1494 1502 1495 1503 foreach ( $news_ary AS $key => $ary ) { 1504 1505 $body = $ary['body']; 1506 $bb_code->parse($body); 1507 $body = $bb_code->get_html(); 1508 1496 1509 $template->assign_block_vars('news_annoucment.news_annoucment_row', array( 1497 1510 'NEWS_ID' => $ary['id'], 1498 1511 'NEWS_ADDED' => create_date($ary['added'], 'M d'), 1499 1512 'NEWS_TITLE' => $ary['title'], 1500 'NEWS_BODY' => format_comment($ary['body']),1513 'NEWS_BODY' => $body, 1501 1514 'U_ADD_COMMENT' => append_sid($root_path . 'comment.php', 'type=' . TYPE_NEWS . '&action=add&tid=' . $ary['id']), 1502 1515 'COMMENTS_COUNT' => $ary['news_comments'], … … 1507 1520 } 1508 1521 } 1522 1523 1524 $uped = mksize($userdata['uploaded']); 1525 $downed = mksize($userdata['downloaded']); 1526 $ratio = get_ratio ($userdata['uploaded'], $userdata['downloaded']); 1527 $color = get_ratio_color($ratio); 1528 $ratio = '<span style="color:' . $color . ';">' . $ratio . '</span>'; 1529 $avatar_prefix = ( ( strpos($userdata['avatar'], 'user_avatar_' . $userdata['uid']) === false && strpos($userdata['avatar'], '/') !== false ) || !$userdata['avatar'] ? '' : generate_base_url() . '/' . $config['avatar_path'] . '/' ); 1530 $avatar = ( !$userdata['avatar'] ? $images['default_avatar'] : $avatar_prefix . $userdata['avatar'] ); 1531 $title = get_user_class_name($userdata['class']); 1509 1532 1510 1533 $template->assign_vars(array( … … 1519 1542 'HELPDESC_NUM' => $config['count_helpdesk_not_solved'], 1520 1543 'REPORTS_NUM' => $config['count_reports_not_solved'], 1521 'CANDIDATES_NUM' => $config['count_candidates_waiting'] 1522 )); 1523 1524 $uped = mksize($userdata['uploaded']); 1525 $downed = mksize($userdata['downloaded']); 1526 $ratio = get_ratio ($userdata['uploaded'], $userdata['downloaded']); 1527 $color = get_ratio_color($ratio); 1528 $ratio = '<span style="color:' . $color . ';">' . $ratio . '</span>'; 1529 $avatar_prefix = ( ( strpos($userdata['avatar'], 'user_avatar_' . $userdata['uid']) === false && strpos($userdata['avatar'], '/') !== false ) || !$userdata['avatar'] ? '' : generate_base_url() . '/' . $config['avatar_path'] . '/' ); 1530 $avatar = ( !$userdata['avatar'] ? $images['default_avatar'] : $avatar_prefix . $userdata['avatar'] ); 1531 $title = get_user_class_name($userdata['class']); 1532 1533 $template->assign_block_vars('user_panel', array( 1544 'CANDIDATES_NUM' => $config['count_candidates_waiting'], 1534 1545 'PM_TITLE' =>( $userdata['user_unread_pms'] ? $lang['new_inbox_pms'] : $lang['no_new_inbox_pms'] ), 1535 1546 'INBOX_PM_PIC' => ( $userdata['user_unread_pms'] ? $images['inboxnew'] : $images['inbox'] ), 1536 1547 'SENTBOX_PIC' => $images['sentbox'], 1537 1548 'BUDDYLIST_PIC' => $images['buddylist'], 1538 'RATIO' => $ratio, 1539 'UPED' => $uped, 1540 'DOWNED' => $downed, 1541 'WARN_PANEL' => ($userdata['class'] < UC_MODERATOR? $lang['warns'] . ': ' . warn_panel($userdata['warn']) : ''), 1542 'CURUSER_NAME' => get_user_class_color($userdata['class'], $userdata['name']), 1543 'CURUSER_ICONS' => get_user_icons($userdata), 1549 1550 'CURRENT_USER_RATIO' => $ratio, 1551 'CURRENT_USER_UPED' => $uped, 1552 'CURRENT_USER_DOWNED' => $downed, 1553 'CURRENT_USER_WARN_PANEL' => ( $userdata['class'] < UC_MODERATOR ? $lang['warns'] . ': ' . warn_panel($userdata['warn']) : '' ), 1554 'CURRENT_USER_NAME' => get_user_class_color($userdata['class'], $userdata['name']), 1555 'CURRENT_USER_ICONS' => get_user_icons($userdata), 1544 1556 'S_CURRENT_TIME' => sprintf($lang['current_time'], '<span id="clock"> </span>'), 1545 1557 'CURRENT_USER_AVATAR' => $avatar, … … 1554 1566 } 1555 1567 1556 if ( $userdata['class'] >= UC_MODERATOR ) {1557 $template->assign_block_vars('switch_moderator_view', array());1558 }1559 1568 if ( $userdata['class'] >= UC_ADMINISTRATOR ) { 1560 1569 $template->assign_block_vars('switch_admin_view', array()); … … 1568 1577 )); 1569 1578 } 1570 $template->assign_block_vars('switch_curuser_view', array());1571 }1572 else {1573 $template->assign_block_vars('switch_non_curuser_view', array());1574 1579 } 1575 1580 include/functions_check.php
r265 r269 304 304 305 305 function check_torrent ( $torrent_file ) { 306 global $lang, $config; 307 308 $errors = $error_in_filenames = array(); 309 $private = 0; 306 global $lang, $config, $root_path; 307 308 require ($root_path . 'include/class.bencode.php'); 309 310 $errors = array(); 311 312 $torrent_dir = $root_path . ( !empty($config['torrent_dir']) ? $config['torrent_dir'] : 'torrents'); 310 313 311 314 if ( !check_filename($torrent_file['name']) || empty($torrent_file['name']) ) { … … 329 332 } 330 333 331 $dict = bdec_file($torrent_file['tmp_name'], $config['max_torrent_size']); 332 if ( !isset($dict) ) { 333 $errors[] = $lang['you_upload_not_torrent_file']; 334 } 335 336 list($ann, $info) = dict_check($dict, 'announce(string):info'); 337 list($dname, $plen, $pieces) = dict_check($info, 'name(string):piece length(integer):pieces(string)'); 338 339 if ( !preg_match("/^[a-zA-Z0-9_~!@$^()\[\]{}&'`%,.-\s]+$/", $dname) ) { 340 $errors[] = sprintf($lang['invalid_name_in_files'], $dname); 341 } 342 343 if ( $ann != generate_base_url() . '/announce.php' ) { 344 $errors[] = sprintf($lang['invalid_announce'], generate_base_url() . '/announce.php'); 345 } 346 347 if ( strlen($pieces) % 20 != 0 ) { 348 $errors[] = $lang['invalid_pieces']; 349 } 350 $filelist = array(); 351 $totallen = dict_get($info, 'length', 'integer'); 352 353 if ( isset($totallen) ) { 354 $filelist[] = array($dname, $totallen); 355 } 356 else { 357 $flist = dict_get($info, 'files', 'list'); 358 if (!isset($flist)) { 359 $errors[] = $lang['no_filesize']; 360 } 361 if (!sizeof($flist)) { 362 $errors[] = $lang['no_files']; 363 } 364 $totallen = 0; 365 for ( $i = 0; $i < sizeof($flist); ++$i ) { 366 list($ll, $ff) = dict_check($flist[$i], 'length(integer):path(list)'); 367 $totallen += $ll; 368 $ffa = array(); 369 for ( $j = 0; $j < sizeof($ff); ++$j ) { 370 if (!preg_match("/^[a-zA-Z0-9_~!@$^()&'\[\]{}`%,.-\s]+$/", $ff[$j]['value'])) { 371 $error_in_filenames[] = $ff[$j]['value']; 372 } 373 if ( $ff[$j]['type'] != 'string' ) { 374 $errors[] = $lang['invalid_filename']; 375 } 376 $ffa[] = $ff[$j]['value']; 377 } 378 if ( !sizeof($ffa) ) { 379 $errors[] = $lang['invalid_filename']; 380 } 381 $ff[$j] = implode('/', $ffa); 382 $filelist[] = array($ff[$j], $ll); 383 } 384 } 385 if ( sizeof($error_in_filenames) ) { 386 $errors[] = sprintf($lang['invalid_name_in_files'], '<br />' . implode('<br />', $error_in_filenames) ); 387 } 388 389 //private tracker start 390 $private = dict_get($info, 'private', 'integer'); 391 if ( !$private ) { 392 $info['value']['source']['type'] = 'string'; 393 $info['value']['source']['value'] = $config['server_name']; 394 $info['value']['source']['strlen'] = strlen($info['value']['source']['value']); 395 $info['value']['private']['type'] = 'integer'; 396 $info['value']['private']['value'] = 1; 397 $dict['value']['info'] = $info; 398 $dict = benc($dict); 399 $dict = bdec($dict); 400 list($ann, $info) = dict_check($dict, 'announce(string):info'); 401 } 402 //private tracker end 403 $infohash = pack('H*', sha1($info['string'])); 404 405 if ( sizeof($errors) ) { 406 trigger_error($lang['next_errors_occured'] . '<br />' . implode('<br />', $errors) ); 407 } 334 $torrent = new Torrent($torrent_file['tmp_name']); 335 336 if ( !$torrent->is_torrent($torrent_file['tmp_name']) ) { 337 $errors[] = $lang['you_upload_not_torrent_file']; 338 } 339 340 $site_url = generate_base_url(); 341 342 if ( defined('USE_XBTT') ) { 343 $base_announce = $site_url . ':' . $config['xbt_listen_port'] . '/announce/'; 344 } 408 345 else { 409 return array($torrent_file['tmp_name'], $infohash, $torrent_file['name'], $totallen, $filelist, $dname, $dict, $private ); 410 } 346 $base_announce = $site_url . '/announce.php'; 347 } 348 349 $torrent->announce(array($base_announce)); 350 351 $dname = $torrent->name(); 352 $plen = $torrent->piece_length(); 353 354 $flist = $torrent->content(); 355 356 if (!sizeof($flist)) { 357 $errors[] = $lang['no_files']; 358 } 359 360 $totallen = 0; 361 $filelist = array(); 362 363 foreach ( $flist AS $file => $size ) { 364 $filelist[] = array($file, $size); 365 $totallen += $size; 366 } 367 368 if ( !$torrent->is_private() ) { 369 $torrent->is_private(true); 370 } 371 372 if ( sizeof($errors) ) { 373 trigger_error($lang['next_errors_occured'] . '<br />' . implode('<br />', $errors) ); 374 } 375 376 $infohash = $torrent->hash_info(); 377 378 $filename = md5($infohash . time()); 379 380 if ( sizeof($errors) ) { 381 trigger_error($lang['next_errors_occured'] . '<br />' . implode('<br />', $errors) ); 382 } 383 384 if ( @move_uploaded_file($torrent_file['tmp_name'], $torrent_dir . DIRECTORY_SEPARATOR . $filename . '.torrent') === false ) { 385 trigger_error($lang['file_cannot_be_uploaded']); 386 } 387 388 $torrent->save($torrent_dir . DIRECTORY_SEPARATOR . $filename . '.torrent'); 389 390 return array($infohash, $torrent_file['name'], $totallen, $filelist, $dname, $filename); 411 391 } 412 392 include/functions_post.php
r266 r269 3 3 global $db, $userdata, $lang, $template, $config, $images, $cache, $root_path; 4 4 global $tor_comment_last_read, $req_comment_last_read, $off_comment_last_read; 5 global $bb_code; 5 6 static $ranks; 6 7 7 8 if ( !isset($ranks) ) { 8 9 $ranks = $cache->obtain_ranks(); 10 } 11 if ( !isset($bb_code) ) { 12 $bb_code = new bbcode(); 9 13 } 10 14 … … 33 37 } 34 38 35 $sql = 'SELECT c.comment_id, c.comment_text, c.comment_user, c.comment_added, c.comment_editedby, c.comment_editedat, c.comment_reputation, u.avatar, u.warneduntil, u.parked, u.name, u.title, u.class, u.donor, u.downloaded, u.uploaded, u.enabled, u2.name AS edited_by_username, u.birthday, u.gender, u.user_session_time, u.user_sig _bbcode_uid, u.user_sig, u.privacy, u.user_reputation_level, u.user_rank_id39 $sql = 'SELECT c.comment_id, c.comment_text, c.comment_user, c.comment_added, c.comment_editedby, c.comment_editedat, c.comment_reputation, u.avatar, u.warneduntil, u.parked, u.name, u.title, u.class, u.donor, u.downloaded, u.uploaded, u.enabled, u2.name AS edited_by_username, u.birthday, u.gender, u.user_session_time, u.user_sig, u.privacy, u.user_reputation_level, u.user_rank_id 36 40 FROM ' . COMMENTS_TABLE . ' c 37 41 LEFT JOIN ' . USERS_TABLE . ' u2 ON c.comment_editedby = u2.uid, … … 63 67 } 64 68 65 $username = $row['name'] . get_user_icons($row);69 $username = $row['name']; 66 70 67 71 if ( $row['comment_user'] != $userdata['uid'] && $userdata['session_logged_in'] ) { … … 99 103 if ( $row['user_sig'] && $config['allow_sig'] ) { 100 104 //now we delete imgs if config allow_sig == 2 101 $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace('#((\r)+?(\n)+?)*(\[url(:'.$row['user_sig_bbcode_uid'].')?(.*)\])?\[img.*?:'.$row['user_sig_bbcode_uid'].'\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img.*?:'.$row['user_sig_bbcode_uid'].'\](\[/url(:'.$row['user_sig_bbcode_uid'].')?\])?#i', '', $row['user_sig']) : $row['user_sig']; 102 //now we remove bbcode from sig, because bbcode uses only at forum 103 $user_sig = preg_replace('#:' . $row['user_sig_bbcode_uid'] . '#', '', $user_sig); 105 $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace('#((\r)+?(\n)+?)*(\[url?(.*)\])?\[img.*?\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img.*?\](\[/url\])?#i', '', $row['user_sig']) : $row['user_sig']; 104 106 // Replace naughty words 105 107 $user_sig = censor_text($user_sig); 106 108 //and now we format sig 107 $ user_sig = preg_replace('/\[img(.*?)\]/', '[img]',$user_sig);108 $user_sig = format_comment($user_sig);109 $bb_code->parse($user_sig); 110 $user_sig = $bb_code->get_html(); 109 111 //last preparation :) 110 112 $user_sig = ( $user_sig != '' ? '<br />_________________<br />' . $user_sig : '' ); … … 136 138 137 139 $text = censor_text($row['comment_text']); 138 $text = format_comment($text); 140 $bb_code->parse($text); 141 $text = $bb_code->get_html(); 139 142 140 143 $post_time = create_date($row['comment_added']); … … 142 145 if ( $row['comment_editedby'] ) { 143 146 if ( $row['edited_by_username'] ) { 144 $u_edited_by = append_sid( 'userdetails.php?id=' . $row['comment_editedby']);147 $u_edited_by = append_sid($root_path . 'userdetails.php?id=' . $row['comment_editedby']); 145 148 $edited_by_username = $row['edited_by_username']; 146 149 } … … 198 201 199 202 $comments[] = array( 200 'U_USERDETAILS' => append_sid( 'userdetails.php?id=' . $row['comment_user']),203 'U_USERDETAILS' => append_sid($root_path . 'userdetails.php?id=' . $row['comment_user']), 201 204 'U_COMMENT' => append_sid($root_path . 'comment.php?cid=' . $row['comment_id']), 202 205 'COMM_ID' => $row['comment_id'], 203 206 'USER_ID' => $row['comment_user'], 204 'USERNAME' => $username ,207 'USERNAME' => $username . get_user_icons($row), 205 208 'TITLE' => $title, 206 209 'AVATAR' => $avatar, … … 262 265 $userslist .= ( $userslist ? ', ' : '' ); 263 266 264 $userslist .= '<a href="' . append_sid( 'userdetails.php?id=') . $users['uid']. '"><span class="' . ( $users['simpaty'] ? 'usergoodResp' : 'userbadResp' ) . '">' . $users['name'] . '</span></a>';267 $userslist .= '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $users['uid']) . '"><span class="' . ( $users['simpaty'] ? 'usergoodResp' : 'userbadResp' ) . '">' . $users['name'] . '</span></a>'; 265 268 } 266 269 … … 317 320 function preview_commentable ( $type = TYPE_TORRENT, $id ) { 318 321 global $userdata, $lang, $template, $config, $images, $db, $cache, $root_path; 322 global $bb_code; 319 323 static $ranks; 320 324 321 325 if ( !isset($ranks) ) { 322 326 $ranks = $cache->obtain_ranks(); 327 } 328 if ( !isset($bb_code) ) { 329 $bb_code = new bbcode(); 323 330 } 324 331 … … 338 345 339 346 if ( $row['user'] <> ANONYMOUS ) { 340 $username = $row['name'] . get_user_icons($row);347 $username = $row['name']; 341 348 $avatar_prefix = ( ( strpos($row['avatar'], 'user_avatar_' . $row['user']) === false && strpos($row['avatar'], '/') !== false ) || !$row['avatar'] ? '' : generate_base_url() . '/' . $config['avatar_path'] . '/' ); 342 349 $avatar = ($userdata['avatars'] ? ( !$row['avatar'] ? $images['default_avatar'] : $avatar_prefix . $row['avatar'] ) : $images['default_avatar']); … … 344 351 if ( $user_sig ) { 345 352 //now we delete imgs if config allow_sig == 2 346 $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace('#((\r)+?(\n)+?)*(\[url(:'.$row['user_sig_bbcode_uid'].')?(.*)\])?\[img.*?:'.$row['user_sig_bbcode_uid'].'\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img.*?:'.$row['user_sig_bbcode_uid'].'\](\[/url(:'.$row['user_sig_bbcode_uid'].')?\])?#i', '', $user_sig) : $user_sig; 347 //now we remove bbcode from sig, because bbcode uses only at forum 348 $user_sig = preg_replace('#:' . $row['user_sig_bbcode_uid'] . '#', '', $user_sig); 353 $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace('#((\r)+?(\n)+?)*(\[url(.*)\])?\[img.*?\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img.*?](\[/url\])?#i', '', $user_sig) : $user_sig; 349 354 // Replace naughty words 350 355 $user_sig = censor_text($user_sig); 351 356 //and now we format sig 352 $user_sig = preg_replace('/\[img(.*?)\]/', '[img]',$user_sig);353 $user_sig = format_comment($user_sig);357 $bb_code->parse($user_sig); 358 $user_sig = $bb_code->get_html(); 354 359 //last preparation :) 355 360 $user_sig = ( $user_sig != '' ? '<br />_________________<br />' . $user_sig : '' ); … … 368 373 369 374 $text = censor_text($row['comment_text']); 370 $text = format_comment($text); 371 $edited_by_link = ( $row['edited_by_username'] ? '<a href="' . append_sid('userdetails.php?id=' . $row['comment_editedby']) . '"><b>' . $row['edited_by_username'] . '</b></a>' : '<i>' . $lang['unknown'] . '</i>'); 375 $bb_code->parse($text); 376 $text = $bb_code->get_html(); 377 378 379 $edited_by_link = ( $row['edited_by_username'] ? '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $row['comment_editedby']) . '"><b>' . $row['edited_by_username'] . '</b></a>' : '<i>' . $lang['unknown'] . '</i>'); 372 380 $edited_by = ( $row['comment_editedby'] ? sprintf($lang['edited_by'], $edited_by_link, create_date($row['comment_editedat'])):''); 373 381 $post_time = create_date($row['comment_added']); … … 385 393 386 394 $template->assign_block_vars('comments_table_row', array( 387 'U_USERDETAILS' => append_sid( 'userdetails.php?id=' . $row['user']),395 'U_USERDETAILS' => append_sid($root_path . 'userdetails.php?id=' . $row['user']), 388 396 'U_COMMENT' => append_sid($root_path . 'comment.php?cid=' . $row['comment_id']), 389 397 'COMM_ID' => $row['comment_id'], 390 398 'USER_ID' => $row['user'], 391 'USERNAME' => $username ,399 'USERNAME' => $username . get_user_icons($row), 392 400 'TITLE' => $title, 393 401 'AVATAR' => $avatar, … … 522 530 } 523 531 } 524 525 function _strlastpos ($haystack, $needle, $offset = 0) {526 if ( function_exists('strripos') ) {527 $endPos = strripos($haystack, $needle, $offset);528 return ($endPos >= 0) ? $endPos : false;529 }530 $addLen = strlen ($needle);531 $endPos = $offset - $addLen;532 while (true)533 {534 if (($newPos = strpos ($haystack, $needle, $endPos + $addLen)) === false) {535 break;536 }537 $endPos = $newPos;538 }539 return ($endPos >= 0) ? $endPos : false;540 }541 542 function format_quote_like_tags ( $text, $tag_name ) {543 global $lang, $bb_tpl;544 545 $old_text = '';546 $tag_size = strlen($tag_name) + 3;547 548 $tpl = $bb_tpl[$tag_name . '_open'] . '\\1' . $bb_tpl[$tag_name . '_close'];549 550 if ( isset($bb_tpl[$tag_name . '_header_open']) && isset($bb_tpl[$tag_name . '_close']) ) {551 $tpl_header = $bb_tpl[$tag_name . '_header_open'] . '\\2' . $bb_tpl[$tag_name . '_close'];552 }553 else {554 $tpl_header = '';555 }556 557 while ( $old_text != $text ) {558 $old_text = $text;559 //find first occurrence of [/quote]560 $close = strpos($text, '[/' . $tag_name . ']');561 562 if ($close === false) {563 return $text;564 }565 //find last [quote] before first [/quote]566 //note that there is no check for correct syntax567 if ( function_exists('strripos') ) {568 $open = strripos(substr($text, 0, $close), '[' . $tag_name);569 }570 else {571 $open = _strlastpos(substr($text, 0, $close), '[' . $tag_name);572 }573 if ( $open === false ) {574 return $text;575 }576 $tag = substr($text, $open, $close - $open + $tag_size);577 //[quote]Text[/quote]578 $tag = preg_replace("/\[" . $tag_name . "\]\s*((\s|.)+?)\s*\[\/" . $tag_name . "\]\s*/i", $tpl, $tag);579 580 //[quote=Author]Text[/quote]581 if ( $tpl_header ) {582 $tag = preg_replace("/\[" . $tag_name . "=(.+?)\]\s*((\s|.)+?)\s*\[\/" . $tag_name . "\]\s*/i", $tpl_header, $tag);583 }584 585 $text = substr($text, 0, $open) . $tag . substr($text, $close + $tag_size);586 }587 return $text;588 }589 590 function format_comment($text) {591 global $db, $template, $lang, $bb_tpl, $template_path;592 593 if (!defined('BB_TPL_READY'))594 {595 $tpl = @file_get_contents($template_path . '/bbcode.html');596 597 // replace \ with \\ and then ' with \'.598 $tpl = str_replace('\\', '\\\\', $tpl);599 $tpl = str_replace('\'', '\\\'', $tpl);600 601 // strip newlines.602 $tpl = str_replace("\n", '', $tpl);603 604 // Turn template blocks into PHP assignment statements for the values of $bb_tpls..605 $tpl = preg_replace('#<!-- BEGIN (.*?) -->(.*?)<!-- END (.*?) -->#', "\n" . '$bb_tpl[\'\\1\'] = \'\\2\';', $tpl);606 607 $bb_tpl = array();608 609 eval($tpl);610 611 $bb_tpl['olist_open'] = str_replace('{LIST_TYPE}', '\\1', $bb_tpl['olist_open']);612 613 $bb_tpl['color_open'] = str_replace('{COLOR}', '\\1', $bb_tpl['color_open']);614 615 $bb_tpl['size_open'] = str_replace('{SIZE}', '\\1', $bb_tpl['size_open']);616 617 $bb_tpl['quote_open'] = str_replace('{L_QUOTE}', $lang['quote'], $bb_tpl['quote_open']);618 619 $bb_tpl['quote_header_open'] = str_replace('{L_QUOTE}', $lang['quote'], $bb_tpl['quote_username_open']);620 $bb_tpl['quote_header_open'] = str_replace('{L_POSTED}', $lang['posted'], $bb_tpl['quote_header_open']);621 $bb_tpl['quote_header_open'] = str_replace('{USERNAME}', '\\1', $bb_tpl['quote_header_open']);622 // BEGIN Moderator Tags623 $bb_tpl['mod_header_open'] = str_replace('{USERNAME}', '\\1', $bb_tpl['mod_username_open']);624 // END Moderator Tags625 626 // We do URLs in several different ways..627 $bb_tpl['url1'] = str_replace('{URL}', '\\1', $bb_tpl['url']);628 $bb_tpl['url1'] = str_replace('{DESCRIPTION}', '\\1', $bb_tpl['url1']);629 630 $bb_tpl['url2'] = str_replace('{URL}', 'http://\\1', $bb_tpl['url']);631 $bb_tpl['url2'] = str_replace('{DESCRIPTION}', '\\1', $bb_tpl['url2']);632 633 $bb_tpl['url3'] = str_replace('{URL}', '\\1', $bb_tpl['url']);634 $bb_tpl['url3'] = str_replace('{DESCRIPTION}', '\\2', $bb_tpl['url3']);635 636 $bb_tpl['url4'] = str_replace('{URL}', 'http://\\1', $bb_tpl['url']);637 $bb_tpl['url4'] = str_replace('{DESCRIPTION}', '\\3', $bb_tpl['url4']);638 639 $bb_tpl['url5'] = str_replace('{URL}', '\\2', $bb_tpl['url']);640 $bb_tpl['url5'] = str_replace('{DESCRIPTION}', '\\2', $bb_tpl['url5']);641 642 $bb_tpl['url6'] = str_replace('{URL}', 'http://\\2', $bb_tpl['url']);643 $bb_tpl['url6'] = str_replace('{DESCRIPTION}', '\\2', $bb_tpl['url6']);644 645 $bb_tpl['email1'] = str_replace('{EMAIL}', '\\1', $bb_tpl['email']);646 $bb_tpl['email1'] = str_replace('{DESCRIPTION}', '\\1', $bb_tpl['email1']);647 $bb_tpl['email2'] = str_replace('{EMAIL}', '\\2@\\3', $bb_tpl['email']);648 $bb_tpl['email2'] = str_replace('{DESCRIPTION}', '\\2@\\3', $bb_tpl['email2']);649 650 $bb_tpl['font'] = str_replace('{FONT_FAMILY}', '\\1', $bb_tpl['font']);651 $bb_tpl['font'] = str_replace('{CONTENT}', '\\2', $bb_tpl['font']);652 653 define('BB_TPL_READY', true);654 }655 656 $text = format_quote_like_tags($text, 'quote');657 $text = format_quote_like_tags($text, 'mod');658 659 $pattern = $tags = array();660 661 //strip some bad words ;)662 $pattern[] = "#(script|about|applet|activex|chrome):#is";663 $tags[] = "\\1:";664 665 // [font=Arial]example[/font] becomes <span style="font: Arial">example</span>666 $pattern[] = "/\[font=([a-zA-Z ,]+)\]((\s|.)+?)\[\/font\]/i";667 $tags[] = $bb_tpl['font'];668 669 // matches a [url]xxxx://www.example.com[/url] code..670 $pattern[] = "#\[url\]([\w]+?://([\w\#$%&~/.\-;:=,?@\]+]+|\[(?!url=))*?)\[/url\]#is";671 $tags[] = $bb_tpl['url1'];672 673 // [url]www.example.com[/url] code.. (no xxxx:// prefix).674 $pattern[] = "#\[url\]((www|ftp)\.([\w\#$%&~/.\-;:=,?@\]+]+|\[(?!url=))*?)\[/url\]#is";675 $tags[] = $bb_tpl['url2'];676 677 // [url=xxxx://www.example.com]example[/url] code..678 $pattern[] = "#\[url=([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is";679 $tags[] = $bb_tpl['url3'];680 681 // [url=www.example.com]example[/url] code.. (no xxxx:// prefix).682 $pattern[] = "#\[url=((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is";683 $tags[] = $bb_tpl['url4'];684 685 $pattern[] = "#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]|+]*)#is";686 $tags[] = '\\1' . $bb_tpl['url5'];687 688 $pattern[] = "#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]|+]*)#is";689 $tags[] = '\\1' . $bb_tpl['url6'];690 691 $pattern[] = "#\[email\]([a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si";692 $tags[] = $bb_tpl['email1'];693 694 $pattern[] = "#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i";695 $tags[] = '\\1' . $bb_tpl['email2'];696 697 $text = preg_replace($pattern, $tags, $text);698 699 // [img]example_img[/img] becomes <img src="example_img" />700 preg_match_all( "#\[(img)\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/(img)\]#sie", $text, $matches );701 foreach ( $matches[0] as $i => $m ) {702 $tag_open = $matches[1][$i];703 $tag_close = $matches[7][$i];704 $url1 = $matches[2][$i];705 $url2 = $matches[4][$i];706 $img_tag = str_replace('{URL}', $url1 . $url2, $bb_tpl['img']);707 $text = str_replace('[' . $tag_open . ']' . $url1 . $url2 . '[/' . $tag_close . ']', $img_tag, $text);708 }709 710 $text = preg_replace("/\[color=(\#[0-9A-F]{6}|[a-z]+)\]/si", $bb_tpl['color_open'], $text);711 $text = str_replace("[/color]", $bb_tpl['color_close'], $text);712 713 $text = preg_replace("/\[size=([1-2]?[0-9])\]/si", $bb_tpl['size_open'], $text);714 $text = str_replace("[/size]", $bb_tpl['size_close'], $text);715 716 // [b] and [/b] for bolding text.717 $text = str_replace("[b]", $bb_tpl['b_open'], $text);718 $text = str_replace("[/b]", $bb_tpl['b_close'], $text);719 720 // [u] and [/u] for underlining text.721 $text = str_replace("[u]", $bb_tpl['u_open'], $text);722 $text = str_replace("[/u]", $bb_tpl['u_close'], $text);723 724 // [i] and [/i] for italicizing text.725 $text = str_replace("[i]", $bb_tpl['i_open'], $text);726 $text = str_replace("[/i]", $bb_tpl['i_close'], $text);727 728 $text = str_replace("[*]", $bb_tpl['listitem'], $text);729 730 preg_match_all( "/\[(pre)\](.*?)\[\/(pre)\]/si", $text, $matches );731 foreach ( $matches[0] as $i => $m ) {732 $tag_open = $matches[1][$i];733 $tag_close = $matches[3][$i];734 $pre_content = str_replace(" ", " ", $matches[2][$i]);735 $pre_tag = str_replace('{CONTENT}', $pre_content, $bb_tpl['pre']);736 $text = str_replace('[' . $tag_open . ']' . $matches[2][$i] . '[/' . $tag_close . ']', $pre_tag, $text);737 }738 739 $text = str_replace("\n", "\n<br />\n", $text);740 741 $text = smilies_pass($text);742 743 return $text;744 }745 746 function smilies_pass($text)747 {748 global $smilies, $cache, $config, $root_path;749 static $orig_smilies, $repl_smilies;750 751 if (!isset($smilies))752 {753 $smilies = $cache->obtain_smilies();754 755 foreach ( $smilies AS $smiley_id => $row )756 {757 $code = str_replace('"', '\"', $row['code']);758 $orig_smilies[] = "/(?<=.\W|\W.|^\W)" . preg_quote(str_replace("\\'", "'", str_replace('\\\\', '\\', $row['code'])), "/") . "(?=.\W|\W.|\W$)/";759 $repl_smilies[] = '<img src="'. $root_path . $config['smilies_path'] . '/' . $row['smile_url'] . '" alt="' . $code . '" border="0" />';760 }761 }762 763 if (sizeof($orig_smilies))764 {765 $text = preg_replace($orig_smilies, $repl_smilies, ' ' . $text . ' ');766 $text = substr($text, 1, -1);767 }768 769 return $text;770 }771 532 ?> include/functions_search.php
r264 r269 28 28 } 29 29 30 function search_text_in_db ( $searchstr, $base_sql, $where_search, $add_where = array() ) {30 function search_text_in_db ( $searchstr, $base_sql, $where_search, $add_where = array(), $strict = false ) { 31 31 global $db, $config; 32 32 … … 41 41 $lower_searchstr = utf_strtolower($searchstr); 42 42 43 $split_search = split_words($cleansearchstr); 43 if ( $strict ) { 44 $split_search = array($lower_searchstr); 45 } 46 else { 44 47 45 if ( $lower_searchstr <> $searchstr ) { 46 $search_full_string = true; 47 foreach ( $match_types AS $_null => $match_type ) { 48 if ( strpos($lower_searchstr, $match_type) !== false ) { 49 $search_full_string = false; 48 $split_search = split_words($cleansearchstr); 49 50 if ( $lower_searchstr <> $searchstr ) { 51 $search_full_string = true; 52 foreach ( $match_types AS $_null => $match_type ) { 53 if ( strpos($lower_searchstr, $match_type) !== false ) { 54 $search_full_string = false; 55 } 50 56 } 51 }52 if ( $search_full_string ) {53 $split_search[] = $lower_searchstr;57 if ( $search_full_string ) { 58 $split_search[] = $lower_searchstr; 59 } 54 60 } 55 61 } … … 89 95 90 96 $match_word = str_replace('*', '%', $split_search[$i]); 91 $search = $where_search . ' LIKE \'%' . $db->sql_escape($match_word) . '%\'' . $add_where; 97 if ( $strict ) { 98 $search = $where_search . ' = \'' . $db->sql_escape($match_word) . '\'' . $add_where; 99 } 100 else { 101 $search = $where_search . ' LIKE \'%' . $db->sql_escape($match_word) . '%\'' . $add_where; 102 } 92 103 93 104 $sql = $base_sql . ' WHERE ' . $search; include/functions_torrenttable.php
r266 r269 142 142 $id = $ary[$i]['fid']; 143 143 $dispname = $ary[$i]['name']; 144 $dispname = ( $highlight ? highlight_text($search, $dispname) : $dispname );145 144 $dispname = censor_text($dispname); 146 145 $hidden_color = ( $ary[$i]['hidden'] ? 'bgcolor="#' . $theme['hidden_torrent_color'] . '" ':''); 146 147 $dispname = ( $highlight ? highlight_text($search, $dispname) : $dispname ); 147 148 148 149 if ( $ary[$i]['numratings'] < $config['minvotes'] ) { include/modtask/mass_torrent_actions.php
r266 r269 112 112 deletetorrent( $delete_arr ); 113 113 114 $cache->destroy( 'sql', INDEXRELEASES_TABLE );114 $cache->destroy('sql', INDEXRELEASES_TABLE ); 115 115 } 116 116 … … 146 146 $db->sql_query($sql); 147 147 148 write_log( sprintf( $lang['log_torrent_edited'], 'details_' . $ary['fid'], $ary['name'], $userdata['name'] ));149 150 } 151 152 meta_refresh(3, append_sid( 'browse.php'));148 write_log(sprintf($lang['log_torrent_edited'], $ary['fid'], $ary['name'], $userdata['uid'], $userdata['name'])); 149 150 } 151 152 meta_refresh(3, append_sid($root_path . 'browse.php')); 153 153 trigger_error($lang['succefully_edited']); 154 154 } … … 197 197 $db->sql_query($sql); 198 198 199 write_log( sprintf( $lang['log_torrent_edited'], 'details_' . $ary['fid'], $ary['name'], $userdata['name']) );199 write_log( sprintf( $lang['log_torrent_edited'], $ary['fid'], $ary['name'], $userdata['uid'], $userdata['name']) ); 200 200 201 201 } include/modtask/new_comments.php
r266 r269 12 12 )); 13 13 14 $sql = 'SELECT c.*, u.name, u.class, u.avatar, u.enabled, u.warneduntil, u.parked, u.donor, u.title, u.user_sig _bbcode_uid, u.user_sig, u2.name AS edited_by_username, t.fid, r.id AS req_id, o.id AS off_id14 $sql = 'SELECT c.*, u.name, u.class, u.avatar, u.enabled, u.warneduntil, u.parked, u.donor, u.title, u.user_sig, u2.name AS edited_by_username, t.fid, r.id AS req_id, o.id AS off_id 15 15 FROM ' . COMMENTS_TABLE . ' c 16 16 LEFT JOIN ' . TORRENTS_TABLE . ' t ON c.comment_for_id = t.fid … … 25 25 $result = $db->sql_query($sql); 26 26 if ( $row = $db->sql_fetchrow($result) ) { 27 28 $bb_code = new bbcode; 27 29 28 30 $tracking_details = ( isset($_COOKIE[$config['cookie_name'] . '_d']) ) ? unserialize($_COOKIE[$config['cookie_name'] . '_d']) : array(); … … 40 42 if ( $user_sig ) { 41 43 //now we delete imgs if config allow_sig == 2 42 $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace('#((\r)+?(\n)+?)*(\[url(:'.$row['user_sig_bbcode_uid'].')?(.*)\])?\[img.*?:'.$row['user_sig_bbcode_uid'].'\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img.*?:'.$row['user_sig_bbcode_uid'].'\](\[/url(:'.$row['user_sig_bbcode_uid'].')?\])?#i', '', $user_sig) : $user_sig; 43 //now we remove bbcode from sig, because bbcode uses only at forum 44 $user_sig = preg_replace('#:' . $row['user_sig_bbcode_uid'] . '#', '', $user_sig); 44 $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace('#((\r)+?(\n)+?)*(\[url(.*)\])?\[img.*?\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img.*?\](\[/url\])?#i', '', $user_sig) : $user_sig; 45 45 // Replace naughty words 46 46 $user_sig = censor_text($user_sig); 47 //and now we format sig 48 $user_sig = preg_replace('/\[img(.*?)\]/', '[img]', $user_sig); 49 $user_sig = format_comment($user_sig); 47 $bb_code->parse($user_sig); 48 $user_sig = $bb_code->get_html(); 50 49 //last preparation :) 51 50 $user_sig = ( $user_sig != '' ? '<br />_________________<br />' . $user_sig : '' ); … … 85 84 } 86 85 86 $bb_code->parse($row['comment_text']); 87 $row['comment_text'] = $bb_code->get_html(); 88 87 89 $template->assign_block_vars('comments_row', array( 88 90 'USER_ID' => $user_id, … … 95 97 'SIGNATURE' => $user_sig, 96 98 'EDITED_BY' => $edited_by, 97 'TEXT' => format_comment($row['comment_text']),99 'TEXT' => $row['comment_text'], 98 100 'MINI_POST_IMG' => $mini_post_img, 99 101 'MINI_POST_ALT' => $mini_post_alt include/sessions.php
r266 r269 518 518 { 519 519 global $config, $theme, $images; 520 global $template, $lang, $ phpEx, $root_path, $db;520 global $template, $lang, $lang_js, $phpEx, $root_path, $db; 521 521 522 522 if ( $userdata['uid'] != ANONYMOUS ) … … 603 603 604 604 include($root_path . 'languages/lang_' . $default_lang . '/lang_main.php'); 605 include($root_path . 'languages/lang_' . $default_lang . '/lang_js.php'); 606 607 //$lang = array_merge($lang, $lang_js); 605 608 606 609 if ( defined('IN_PHPBB') ) … … 634 637 635 638 function setup_style($style) { 636 global $db, $config, $template, $root_path, $lang, $images, $template_path, $userdata ;639 global $db, $config, $template, $root_path, $lang, $images, $template_path, $userdata, $lang_js; 637 640 638 641 require_once ($root_path . 'include/class.template.php'); … … 640 643 $sql = 'SELECT * FROM ' . THEMES_TABLE . ' WHERE themes_id = ' . $style; 641 644 $result = $db->sql_query($sql, 31536000); 642 if ( ! ($row = $db->sql_fetchrow($result)) ) {645 if ( !$row = $db->sql_fetchrow($result) ) { 643 646 $db->sql_freeresult($result); 644 647 … … 686 689 } 687 690 $userdata['template_path'] = $template_path; 688 // $userdata['theme_bitfield'] = $row['bbcode_bitfield'];689 691 690 692 $template->assign_vars(array( 691 693 'TEMPLATE_PATH' => $template_path 692 694 )); 695 696 foreach ( $lang_js AS $key => $value ) { 697 $template->assign_block_vars('javascript_lang', array( 698 'KEY' => 'L_' . strtoupper($key), 699 'VALUE' => str_replace("'", "\'", $value) 700 )); 701 } 693 702 } 694 703 else { … … 1129 1138 } 1130 1139 1131 return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $ userdata['tzoffset'])), $translate) : @gmdate($format, $gmepoch + (3600 * $userdata['tzoffset']));1140 return ( !empty($translate) ) ? strtr(@gmdate($format, $gmepoch + (3600 * $tz)), $translate) : @gmdate($format, $gmepoch + (3600 * $tz)); 1132 1141 } 1133 1142 include/ucp/bonus.php
r245 r269 15 15 $title = request_var('title', ''); 16 16 $reputation_count = request_var('reputation_count', 0); 17 $reputation_count = ( $reputation_count < 0 ? 0 : $reputation_count ); 17 18 18 19 if ( isset($my_bonus_settings[$choice]) ) { include/ucp/checkcomm.php
r266 r269 11 11 else { 12 12 list($pagertop, $pagerbottom, $limit) = pager($config['posts_per_page'], $count, 'my.php?type=' . $type . '&'); 13 $sql = 'SELECT cn.checkcomm_for_id, cn.checkcomm_type, t.name AS torrent_name, r.request AS request_name, o.name AS offer_name, n.title AS news_name, c.comment_added, c.comment_id, u.name, u.uid, u.class13 $sql = 'SELECT cn.checkcomm_for_id, cn.checkcomm_type, t.name AS torrent_name, t.category AS torrent_category, r.request AS request_name, r.cat AS request_category, o.name AS offer_name, o.category AS offer_category, n.title AS news_name, NULL AS news_category, c.comment_added, c.comment_id, u.name, u.uid, u.class 14 14 FROM ' . COMMENTS_NOTIFY_TABLE . ' cn 15 15 LEFT JOIN ' . TORRENTS_TABLE . ' t ON cn.checkcomm_for_id = t.fid … … 33 33 34 34 $i = 0; 35 36 $cats = $cache->obtain_cats(); 35 37 36 38 while ( $row = $db->sql_fetchrow($result) ) { … … 62 64 } 63 65 66 $cat_id = $row[$table . '_category']; 64 67 if ( $row['uid'] <> ANONYMOUS ) { 65 68 $u_last_poster = append_sid('userdetails.php?id=' . $row['uid']); index.php
r266 r269 2 2 $root_path = './'; 3 3 require ($root_path . 'include/config.php'); 4 require ($root_path . 'include/ functions_post.php');4 require ($root_path . 'include/bbcode/bbcode.lib.php'); 5 5 6 6 $userdata = session_pagestart($user_ip); 7 7 init_userprefs($userdata); 8 9 $bb_code = new bbcode(); 8 10 9 11 $sql = 'SELECT uid, name FROM ' . USERS_TABLE . ' WHERE status = 1 AND uid <> ' . ANONYMOUS . ' ORDER BY uid DESC'; 10 12 $result = $db->sql_query_limit($sql, 1, 0, 20 * 60); 11 13 if ($row = $db->sql_fetchrow($result)) { 12 $latestuser = ( $userdata['session_logged_in'] ? '<a href="' . append_sid('userdetails.php?id=' . $row['uid']) . '"><b>' . $row['name'] . '</b></a>' : '<b>' . $row['name'] . '</b>' ); 14 15 $latestuser = ( $userdata['session_logged_in'] ? '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $row['uid']) . '"><b>' . $row['name'] . '</b></a>' : '<b>' . $row['name'] . '</b>' ); 13 16 } 14 17 $db->sql_freeresult($result); … … 24 27 if ( $birthday_arr = $db->sql_fetchrow($result) ) { 25 28 do { 29 26 30 $age = get_age($birthday_arr['birthday']); 27 $birthday_arr['name'] = get_user_class_color($birthday_arr['class'], $birthday_arr['name']);28 $birthday_users .= ( $birthday_users ? ', ' : '' ) . '<a href="' . append_sid('userdetails.php?id=' . $birthday_arr['uid']) . '">' . $birthday_arr['name'] . '</a> (' . $age . ')' . get_user_icons($birthday_arr);29 30 }31 while ($birthday_arr = $db->sql_fetchrow($result));31 $birthday_arr['name'] = get_user_class_color($birthday_arr['class'], $birthday_arr['name']); 32 $birthday_users .= ( $birthday_users ? ', ' : '' ) . '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $birthday_arr['uid']) . '">' . $birthday_arr['name'] . '</a> (' . $age . ')' . get_user_icons($birthday_arr); 33 34 } 35 while ($birthday_arr = $db->sql_fetchrow($result)); 32 36 } 33 37 $db->sql_freeresult($result); … … 147 151 $vote_graphic = ($vote_graphic < $vote_graphic_max - 1) ? $vote_graphic + 1 : 0; 148 152 149 150 $vote_info[$i]['vote_option_text'] = censor_text(format_comment($vote_info[$i]['vote_option_text'])); 153 $vote_option_text = $vote_info[$i]['vote_option_text']; 154 $bb_code->parse($vote_option_text); 155 $vote_option_text = $bb_code->get_html(); 156 157 158 $vote_info[$i]['vote_option_text'] = $vote_option_text; 151 159 152 160 $template->assign_block_vars("poll.voted.voted_row", array( … … 169 177 170 178 for($i = 0; $i < $vote_options; $i++) { 171 $vote_info[$i]['vote_option_text'] = censor_text($vote_info[$i]['vote_option_text']); 179 $vote_option_text = $vote_info[$i]['vote_option_text']; 180 $bb_code->parse($vote_option_text); 181 $vote_option_text = $bb_code->get_html(); 172 182 173 183 $template->assign_block_vars("poll.no_voted.novoted_row", array( 174 184 'POLL_OPTION_ID' => $vote_info[$i]['vote_option_id'], 175 'POLL_OPTION_CAPTION' => format_comment($vote_info[$i]['vote_option_text'])185 'POLL_OPTION_CAPTION' => $vote_option_text 176 186 )); 177 187 } … … 181 191 $expire_time = ( $vote_info[0]['vote_length'] ? create_date($vote_info[0]['vote_start'] + $vote_info[0]['vote_length']) : 0 ); 182 192 193 $bb_code->parse($vote_title); 194 $vote_title = $bb_code->get_html(); 195 183 196 $template->assign_vars(array( 184 'POLL_QUESTION' => format_comment($vote_title),197 'POLL_QUESTION' => $vote_title, 185 198 'S_THIS_POLL_WILL_EXPIRE_AT' => ( $expire_time ? ( $poll_expired ? sprintf($lang['this_poll_expired_at'], $expire_time ) : sprintf($lang['this_poll_will_expire_at'], $expire_time ) ) : '') ) 186 199 ); … … 234 247 $template->assign_block_vars('news', array()); 235 248 foreach ( $news_ary AS $key => $ary ) { 249 250 $bb_code->parse($ary['body']); 251 $ary['body'] = $bb_code->get_html(); 252 236 253 $template->assign_block_vars('news.news_row', array( 237 254 'ID' => $ary['id'], … … 240 257 'PIC' => $root_path . 'pic/' . ( $i ? 'plus.gif' : 'minus.gif' ), 241 258 'TITLE' => $ary['title'], 242 'BODY' => format_comment($ary['body']),259 'BODY' => $ary['body'], 243 260 'U_ADD_COMMENT' => append_sid($root_path . 'comment.php', 'type=' . TYPE_NEWS . '&action=add&tid=' . $ary['id']), 244 261 'COMMENTS_COUNT' => $ary['news_comments'], … … 274 291 do { 275 292 $name = $row['name'] ? $row['name'] : $row['torrent_name']; 293 294 $cat_id = $row['category']; 295 $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 296 297 298 $description = censor_text($row['description']); 299 $bb_code->parse($description); 300 $description = $bb_code->get_html(); 301 276 302 $template->assign_block_vars('releases.releases_row', array( 277 303 'NAME' => $name, … … 285 311 'CATEGORY_IMAGE' => $root_path . 'pic/categories/' . $row['category_image'], 286 312 'CATEGORY_NAME' => $row['category_name'], 287 'DESCRIPTION' => format_comment(censor_text($row['description'])),313 'DESCRIPTION' => $description, 288 314 'IMDB_LINK' => ( $row['imdb_link'] ? ' [<a href="redir.php?url=' . $row['imdb_link'] . '" target="_blank">IMDB</a>]' : '' ), 289 315 'FORUM_LINK' => ( $row['forum_link'] ? ' [<a href="' . append_sid($root_path . 'phpbb2.php?page=viewtopic&t=' . $row['forum_link']) . '" target="_blank">' . $lang['talk_at_forum'] . '</a>]' : '' ) js/ajax_common.js
r239 r269 23 23 if (req.responseJS) { 24 24 document.getElementById('thanks_button').disabled = true; 25 if (req.responseJS.thanks_users) {26 document.getElementById('thanks_users').innerHTML = ( show ? document.getElementById('thanks_users').innerHTML + ', ' : '' ) + req.responseJS.thanks_users;27 }28 25 alert(req.responseJS.text); 29 26 } … … 259 256 } 260 257 258 function show_prompt (tag_type, id) { 259 var txt = L_JS_ENTER_TAGS + '<input type="text" id="tag_name" name="tag_name" size="50" \/>'; 260 261 $.prompt(txt, { 262 loaded: function () { 263 $("#tag_name").autocomplete(TRACKER_URL + 'ajax.php?action=autocomplete_tags&sid=' + SID, { 264 delay:10, 265 matchSubset:1, 266 autoFill:true, 267 matchContains:1, 268 cacheLength:10, 269 selectFirst:true, 270 multiple: true 271 }); 272 }, 273 submit: function (v, m, f) { 274 var tag_name = f.tag_name; 275 if ( !tag_name ) { 276 return false; 277 } 278 update_tag(tag_name, tag_type, id, 'up'); 279 } 280 }); 281 282 return false; 283 } 284 285 function update_tag (tag_name, tag_type, id, type) { 286 var req = new JsHttpRequest(); 287 req.onreadystatechange = function() { 288 if ( req.readyState == 4 ) { 289 if ( req.responseJS ) { 290 if ( req.responseJS.tags ) { 291 $('#details_tags').append(' ' + req.responseJS.tags); 292 } 293 if ( req.responseJS.message ) { 294 alert(req.responseJS.message); 295 } 296 } 297 } 298 } 299 req.caching = true; 300 req.open('POST', TRACKER_URL + 'ajax.php?action=update_tag&sid=' + SID, true); 301 req.send({ tag_name: tag_name, tag_type: tag_type, id: id, type: type }); 302 } 303 304 function delete_tag (tag_name, tag_type, id) { 305 306 if ( !confirm(L_JS_ARE_YOU_SURE_DELETE_TAG + ' "' + tag_name + '"?') ) { 307 return; 308 } 309 $.ajax({ 310 url: TRACKER_URL + 'modtask.php?action=tags&do=delete_tag&sid=' + SID, 311 global: false, 312 type: "POST", 313 data: ({tag_name: tag_name, tag_type: tag_type, id: id}), 314 dataType: "html", 315 success: function(msg){ 316 $('#tag_' + tag_name).remove(); 317 alert(msg); 318 } 319 }).responseText; 320 } 321 languages/lang_english/lang_admin.php
r246 r269 979 979 'template_preview' => 'Template preview', 980 980 'template_edit' => 'Template editing', 981 'template_edit_help' => 'Р В Р ’ РІР‚”Р ТвЂВесь РІС‹ Р В Р’В Р РЋР’Вожете СЃРѕР·РТвЂВать шаблон Р В Р’В Р СћРІР‚Вля категорРСвЂВР В Р’В Р РЋРІР‚В. Р В РІР‚в„ўР РЋРІР‚в„– Р В Р’В Р РЋР’Вожете Р В Р’В Р РЋРІР‚Вспользовать любой bb-РєРѕРТвЂВ. Для Р В Р’В Р РЋРІР‚ВспользованРСвЂВР РЋР РЏ значенРСвЂВР в„– Р В Р’В Р РЋРІР‚ВР В Р’В· полей форРСВВР РЋРІР‚в„– Р В Р’В Р РЋРІР‚Вспользуйте названРСвЂВР В Р’Вµ поля Рцслово value, напрРСвЂВР В Р’В Р РЋР’Вер как Обложка.value. Для полей С‚РСвЂВР С—Р В° select РІС‹ Р В Р’В Р РЋР’Вожете Р В Р’В Р РЋРІР‚Вспользовать переРСВВенную value2, вэтоРѠслучае Р±СѓРТвЂВет Р В Р’В Р РЋРІР‚Вспользовано значенРСвЂВР В Р’Вµ Р В Р’В Р РЋРІР‚ВспользуеРСВВРѕРµ Р В Р’В Р РЋР’Веж теговoption, Р В Р’В° Р Р…Р Вµ value тега option. Для СЃРѕР·РТвЂВанРСвЂВР РЋР РЏ тега select Р РЋР С“ разныРСВВРцзначенРСвЂВР РЋР РЏР В РЎВВРцРІvalue option РцРСВВеж option Р В Р’В Р РЋРІР‚Вспользуйте конструкцРСвЂВРЎР‹ РІРСвЂВР В Р’В Р СћРІР‚ВР В Р’В° "Да [YES]; Нет [NO]", то есть РІРєРІР°РТвЂВратных скобках указывайте текст, который Р В Р’В Р СћРІР‚Волжен быть Р В Р’В Р РЋР’Веж тегоРРвЂВoption.',982 'name_help' => 'Р В Р ’ РЎСљР В Р’°Р В·Р Р†Р В°Р Р…Р СвЂВР В Р’Вµ поля так, как РѕРЅРѕ Р±СѓРТвЂВет показано вшаблоне',981 'template_edit_help' => 'Р—РТвЂР  ВµРЎРѓРЎРЉ РІС‹ Р В РЎВожете СЃРѕР·РТвЂР  В°РЎвЂљРЎРЉ шаблон Р В РўвЂР  В»РЎРЏ категорРСвЂР В РЎвЂ. Р В РІР‚в„ўР РЋРІР‚в„– Р В РЎВожете Р В РЎвЂР ЎРѓР С—ользовать любой bb-РєРѕРТвЂ. Для Р В РЎвЂР ЎРѓР С—ользованРСвЂР РЋР РЏ значенРСвЂР  в„– Р В РЎвЂР В Р’В· полей форРСВР РЋРІР‚в„– Р В РЎвЂР ЎРѓР С—ользуйте названРСвЂР В Р’Вµ поля Рцслово value, напрРСвЂР В РЎВер как Обложка.value. Для полей С‚РСвЂР  С—Р В° select РІС‹ Р В РЎВожете Р В РЎвЂР ЎРѓР С—ользовать переРСВенную value2, вэтоРѠслучае Р±СѓРТвЂР  ВµРЎвЂљ Р В РЎвЂР ЎРѓР С—ользовано значенРСвЂР В Р’Вµ Р В РЎвЂР ЎРѓР С—ользуеРСВРѕРµ Р В РЎВеж теговoption, Р В Р’В° Р Р…Р Вµ value тега option. Для СЃРѕР·РТвЂР  В°Р Р…Р СвЂР РЋР РЏ тега select Р РЋР С“ разныРСВРцзначенРСвЂР РЋР РЏР В РЎВРцРІvalue option РцРСВеж option Р В РЎвЂР ЎРѓР С—ользуйте конструкцРСвЂР ЎР‹ РІРСвЂР В РўвЂР В Р’В° "Да [YES]; Нет [NO]", то есть РІРєРІР°РТвЂР ЎР‚атных скобках указывайте текст, который Р В РўвЂР  С•лжен быть Р В РЎВеж теговoption.', 982 'name_help' => 'НазванРСвЂР В Р’Вµ поля так, как РѕРЅРѕ Р±СѓРТвЂР  ВµРЎвЂљ показано вшаблоне', 983 983 'default_value' => 'Default value', 984 'default_value_help' => 'Р В Р’ВВто значенРСвЂВР В Р’Вµ Р±СѓРТвЂВет Р С—Р С• СѓРСВВолчанРСвЂВРЎР‹ вполе шаблона. Для поля С‚РСвЂВР С—Р В° select укажРСвЂВте РІСЃРµ значенРСвЂВР РЋР РЏ, разРТвЂВеляя Р В Р’В Р РЋРІР‚ВС… ;',985 'note_help' => 'Р В Р’ВВтот текст Р±СѓРТвЂВет показ около РїРѕР»СРВР РЏ',984 'default_value_help' => 'Р В Р’Вто значенРСвЂР В Р’Вµ Р±СѓРТвЂР  ВµРЎвЂљ Р С—Р С• СѓРСВолчанРСвЂР ЎР‹ вполе шаблона. Для поля С‚РСвЂР  С—Р В° select укажРСвЂР ЎвЂљР Вµ РІСЃРµ значенРСвЂР РЋР РЏ, разРТвЂР  ВµР В»РЎРЏРЎРЏ Р В РЎвЂР ЎвЂ¦ ;', 985 'note_help' => 'Р В Р’Втот текст Р±СѓРТвЂР  ВµРЎвЂљ показ около поля', 986 986 'must_be_filled' => 'Required', 987 'must_be_filled_help' => 'Р В Р ’ РІР‚ўРЎРѓР В»Р С†Р Р†РЎвЂ№ поставРСвЂВте Р В Р’В·Р В РўвЂВесь галочку, то пользователь Р±СѓРТвЂВет обязан заполнРСвЂВть это поле',987 'must_be_filled_help' => 'ЕслРцРІС‹ поставРСвЂР ЎвЂљР Вµ Р В Р’В·Р В РўвЂР  ВµРЎРѓРЎРЉ галочку, то пользователь Р±СѓРТвЂР  ВµРЎвЂљ обязан заполнРСвЂР ЎвЂљРЎРЉ это поле', 988 988 'add_new_field' => 'Add new field', 989 989 'show_at' => 'Show at', … … 1107 1107 'simpaty_thanks_to_upload' => 'Points 1 thanks from user to uploaded torrent', 1108 1108 1109 1110 'tags_settings' => 'Настройки тегов', 1111 'tags_max_allow' => 'Максимальное количество тегов', 1112 'tags_max_allow_explain' => 'Максимальное количество тегов, которое может поставить один пользователь для одной раздачи', 1113 'tags_max_length' => 'Максимальная длинна тега', 1114 'tags_max_length_explain' => 'Максимальная длинна тега (в символах)', 1115 'tags_min_length' => 'Минимальная длинна тега', 1116 'tags_min_length_explain' => 'Минимальная длинна тега (в символах). Не ставьте значение менее 3 символов, они все равно не будут работать в поиске.', 1117 1109 1118 )); 1110 1119 ?> languages/lang_english/lang_bbcode.php
r184 r269 45 45 2 => '[size=<i>n</i>]<i>Text</i>[/size]', 46 46 3 => '[size=11]Text size is 11[/size]', 47 4 => '<i>n</i> must be integer from 1 (min) to 29 (max). Standard 11'47 4 => '<i>n</i> must be integer from 1 (min) to 7 (max)' 48 48 ), 49 49 array( … … 85 85 0 => 'Quote (2)', 86 86 1 => 'Inserts quotes', 87 2 => '[quote= <i>Author</i>]<i>Text for quoting</i>[/quote]',88 3 => '[quote= ' . $userdata['name'] . ']Quote example[/quote]',87 2 => '[quote="<i>Author</i>"]<i>Text for quoting</i>[/quote]', 88 3 => '[quote="' . $userdata['name'] . '"]Quote example[/quote]', 89 89 4 => '' 90 90 ), … … 97 97 ), 98 98 array( 99 0 => 'Preformatted text (tracker only)',99 0 => 'Preformatted text', 100 100 1 => 'Preformatted (monospace) text. All text formatting will be saved', 101 101 2 => '[pre]<i>Text</i>[/pre]', 102 102 3 => '[pre]This is preformatted text.[/pre]', 103 4 => ' On forum use tag [code][/code] to obtain preformatted text.'103 4 => '' 104 104 ) 105 105 ); languages/lang_english/lang_forum.php
r164 r269 48 48 'post' => 'Post', 49 49 'posts' => 'Posts', 50 'posted' => 'Posted',51 50 'username' => 'Username', 52 51 'password' => 'Password', … … 368 367 'color_black' => 'Black', 369 368 370 'font_size' => 'Font size',371 'font_tiny' => 'Tiny',372 'font_small' => 'Small',373 'font_normal' => 'Normal',374 'font_large' => 'Large',375 'font_huge' => 'Huge',376 377 369 'close_tags' => 'Close Tags', 378 370 'styles_tip' => 'Tip: Styles can be applied quickly to selected text.', languages/lang_english/lang_main.php
r248 r269 245 245 'new' => 'New', 246 246 'new_at_forum' => 'New at forum', 247 'popular_at_forum' => 'Popular at forum', 247 248 'active_torrents' => 'Active torrents', 248 249 'popular_torrents' => 'Popular torrents', … … 265 266 'list' => 'List', 266 267 'quote' => 'Quote', 268 'spoiler' => 'Spoiler', 267 269 'code' => 'Code', 268 270 'all_tags' => 'All tags', … … 282 284 'violet' => 'Violet', 283 285 'white' => 'White', 284 'text_size' => 'Font size', 285 'small' => 'Small', 286 'standart' => 'Standart', 287 'big' => 'Big', 288 'very_big' => 'Huge', 286 287 'font_size' => 'Font size', 288 'font_tiny' => 'Tiny', 289 'font_small' => 'Small', 290 'font_normal' => 'Normal', 291 'font_large' => 'Large', 292 'font_huge' => 'Huge', 293 289 294 'close_all_tags' => 'Close tags', 290 295 'smilies' => 'Smilies', … … 416 421 'succefully_uploaded' => 'Uploaded successfully!', 417 422 'succefully_uploaded_descr' => 'Now you can seed. <b>Attention</b> torrent will be invisible, until any seeders are avalaible!', 423 'you_must_download_your_torrent_from_here' => 'Your torrent has been changed and your must download it from here and seed downloaded torrent', 418 424 'succefully_edited' => 'Successfully edited!', 419 425 'rating_added' => 'Rating added!', … … 1205 1211 'reputation' => 'Reputation', 1206 1212 1213 'no_tags' => 'No tags', 1214 'add_tag' => 'Add tag', 1215 'enter_tags' => 'Enter one tag or either comma-separated', 1216 'are_you_sure_delete_tag' => 'Are you sure you want to delete tag', 1217 'no_more_tags_allowed' => 'You want to add too more tags, more then %d you canno\'t add', 1218 'tag_is_too_short_or_long' => 'Tag "%s" is shorter then %d symbols or longer then %d symbols. Please, edit tag', 1219 'tag_added' => 'Tag "%s" added', 1220 1207 1221 'translated_by' => 'Translation to english made by %s', 1208 1222 )); languages/lang_english/lang_merge.php
r9 r269 49 49 // 27 seconds. 50 50 51 'merge_separator' => "\r\n\r\n[color=green][size= 9]Posted after%s%s%s%s:[/size][/color]\r\n\r\n",51 'merge_separator' => "\r\n\r\n[color=green][size=1]Posted after%s%s%s%s:[/size][/color]\r\n\r\n", 52 52 53 53 // Subject of the added message languages/lang_english/lang_modcomment_log.php
r245 r269 19 19 'modcomment_account_enabled_disabled' => '%s - Account %s by user %s', 20 20 'modcomment_one_warning_deleted' => '%s - 1 warning remited by user %s', 21 'log_torrent_uploaded' => 'Torrent < a href="%s">%s</a> was uploaded by %s',22 'log_torrent_edited' => 'Torrent < a href="%s">%s</a> was edited by %s',21 'log_torrent_uploaded' => 'Torrent <!--S-->TORRENT_%d_%s<!--E--> was uploaded by <!--S-->USER_%d_%s<!--E-->', 22 'log_torrent_edited' => 'Torrent <!--S-->TORRENT_%d_%s<!--E--> was edited by <!--S-->USER_%d_%s<!--E-->', 23 23 'log_torrent_deleted_by_user' => 'Torrent %d (%s) was deleted by user %s (Reason: %s)', 24 24 'modcomment_uploadapp' => '%s - Request for promotion: %s (Yes = %d, No = %d (%01.2f %%))', //два символа %% это не описка languages/lang_english/lang_pms.php
r9 r269 14 14 'pm_helpdesc_answer_body' => "%s==[Tech. Support]==%s\n%s\n\n%s wrote \n%s", 15 15 'pm_offer_filled_subject' => 'Offer has been uploaded', 16 'pm_offer_filled_body' => 'You have voted for the offer [url=%s /offers.php?id=%d]%s[/url] and your offer have been uploaded by user [url=%s/userdetails.php?id=%d][b]%s[/b][/url]. You can download it, clicking here [url=%s/details.php?id=%d]%s[/url]. Please don\'t forget to say Thanks.',16 'pm_offer_filled_body' => 'You have voted for the offer [url=%s]%s[/url] and your offer have been uploaded by user [url=%s][b]%s[/b][/url]. You can download it, clicking here [url=%s]%s[/url]. Please don\'t forget to say Thanks.', 17 17 'pm_request_filled_subject' => 'Request has been uploaded', 18 'pm_request_filled_body' => 'You have voted for the request [url=%s /requests.php?id=%d]%s[/url] and it has been filled by user [url=%s/userdetails.php?id=%d][b]%s[/b][/url]. You can download it, clicking here [url=%s/details.php?id=%d]%s[/url]. Please, don\'t forget to say Thanks.',18 'pm_request_filled_body' => 'You have voted for the request [url=%s]%s[/url] and it has been filled by user [url=%s][b]%s[/b][/url]. You can download it, clicking here [url=%s]%s[/url]. Please, don\'t forget to say Thanks.', 19 19 'pm_class_changed_subject' => '%s in class', 20 20 'pm_class_changed_body' => 'You were %s before class %s user %s', languages/lang_russian/lang_admin.php
r246 r269 1089 1089 'simpaty_thanks_to_upload' => 'Очки за одно полученное спасибо для выложенного торрента', 1090 1090 1091 'tags_settings' => 'Настройки тегов', 1092 'tags_max_allow' => 'Максимальное количество тегов', 1093 'tags_max_allow_explain' => 'Максимальное количество тегов, которое может поставить один пользователь для одной раздачи', 1094 'tags_max_length' => 'Максимальная длинна тега', 1095 'tags_max_length_explain' => 'Максимальная длинна тега (в символах)', 1096 'tags_min_length' => 'Минимальная длинна тега', 1097 'tags_min_length_explain' => 'Минимальная длинна тега (в символах). Не ставьте значение менее 3 символов, они все равно не будут работать в поиске.', 1098 1091 1099 )); 1092 1100 ?> languages/lang_russian/lang_bbcode.php
r221 r269 44 44 1 => 'Меняет размер текста в теге', 45 45 2 => '[size=<i>n</i>]<i>Текст</i>[/size]', 46 3 => '[size=1 1]Это размер 11[/size]',47 4 => '<i>n</i> должно быть целым числом от 1 (самый маленький) до 29 (Самый большой). Стандартный размер это 11'46 3 => '[size=1]Это размер 1[/size]', 47 4 => '<i>n</i> должно быть целым числом от 1 (самый маленький) до 7 (Самый большой)' 48 48 ), 49 49 array( … … 85 85 0 => 'Цитата (2)', 86 86 1 => 'Вставляет цитату', 87 2 => '[quote= <i>Автор</i>]<i>Текст для цитаты</i>[/quote]',88 3 => '[quote= ' . $userdata['name'] . ']Пример для цитирования.[/quote]',87 2 => '[quote="<i>Автор</i>"]<i>Текст для цитаты</i>[/quote]', 88 3 => '[quote="' . $userdata['name'] . '"]Пример для цитирования.[/quote]', 89 89 4 => '' 90 90 ), … … 97 97 ), 98 98 array( 99 0 => 'Преформатированный (только для трекера)',99 0 => 'Преформатированный', 100 100 1 => 'Преформатированный (monospace) текст. Все форматирование внутри текста будет сохранено', 101 101 2 => '[pre]<i>Текст</i>[/pre]', 102 102 3 => '[pre]Это преформатированный текст.[/pre]', 103 4 => ' На форуме используйте тег [code][/code] для получения преформатированного текста.'103 4 => '' 104 104 ) 105 105 ); languages/lang_russian/lang_forum.php
r221 r269 53 53 'post' => 'Сообщение', // ??? 54 54 'posts' => 'Сообщения', // ??? 55 'posted' => 'Добавлено',56 55 'username' => 'Имя', 57 56 'password' => 'Пароль', … … 372 371 'color_black' => 'Чёрный', 373 372 374 'font_size' => 'Размер шрифта',375 'font_tiny' => 'Очень маленький',376 'font_small' => 'Маленький',377 'font_normal' => 'Обычный',378 'font_large' => 'Большой',379 'font_huge' => 'Огромный',380 381 373 'close_tags' => 'Закрыть теги', 382 374 'styles_tip' => 'Подсказка: Можно быстро применить стили к выделенному тексту', languages/lang_russian/lang_main.php
r248 r269 253 253 'new' => 'Новый', 254 254 'new_at_forum' => 'Новое на форуме', 255 'popular_at_forum' => 'Популярное на форуме', 255 256 'active_torrents' => 'Активные торренты', 256 257 'popular_torrents' => 'Популярные торренты', … … 273 274 'list' => 'Список', 274 275 'quote' => 'Цитата', 276 'spoiler' => 'Спойлер', 275 277 'code' => 'Код', 276 278 'all_tags' => 'Все теги', … … 290 292 'violet' => 'Фиолетовый', 291 293 'white' => 'Белый', 292 'text_size' => 'Размер текста', 293 'small' => 'Маленький', 294 'standart' => 'Стандартный', 295 'big' => 'Большой', 296 'very_big' => 'Огромный', 294 295 'font_size' => 'Размер шрифта', 296 'font_tiny' => 'Очень маленький', 297 'font_small' => 'Маленький', 298 'font_normal' => 'Обычный', 299 'font_large' => 'Большой', 300 'font_huge' => 'Огромный', 301 297 302 'close_all_tags' => 'Закрыть теги', 298 303 'smilies' => 'Смайлы', … … 425 430 'succefully_uploaded' => 'Успешно загружено!', 426 431 'succefully_uploaded_descr' => 'Теперь вы можете сидировать. <b>Внимание</b> торрента не будет видно пока вы это не сделаете!', 432 'you_must_download_your_torrent_from_here' => 'Ваш торрент был изменен и вам надо скачать торрент из своей раздачи и сидировать его', 427 433 'succefully_edited' => 'Успешно изменено!', 428 434 'rating_added' => 'Рейтинг добавлен!', … … 1215 1221 'reputation' => 'Репутация', 1216 1222 1223 'no_tags' => 'Нет тегов', 1224 'add_tag' => 'Добавить тег', 1225 'enter_tags' => 'Введите один тег или несколько тегов через запятую', 1226 'are_you_sure_delete_tag' => 'Вы уверены, что хотите удалить тег', 1227 'no_more_tags_allowed' => 'Вы добавляете слишком много тегов, более %d добавлять нельзя', 1228 'tag_is_too_short_or_long' => 'Тег "%s" короче %d символов или длинее %d символов. Пожалуйста, измените тег', 1229 'tag_added' => 'Тег "%s" добавлен', 1230 1217 1231 'translated_by' => 'На русский язык перевел %s', 1218 1232 )); languages/lang_russian/lang_merge.php
r221 r269 50 50 // 27 seconds. 51 51 52 'merge_separator' => "\r\n\r\n[color=green][size= 9]Добавлено спустя%s%s%s%s:[/size][/color]\r\n\r\n",52 'merge_separator' => "\r\n\r\n[color=green][size=1]Добавлено спустя%s%s%s%s:[/size][/color]\r\n\r\n", 53 53 54 54 // Subject of the added message languages/lang_russian/lang_modcomment_log.php
r245 r269 19 19 'modcomment_account_enabled_disabled' => '%s - Аккаунт %s пользователем %s', 20 20 'modcomment_one_warning_deleted' => '%s - 1 предупреждение удалено пользователем %s', 21 'log_torrent_uploaded' => 'Торрент < a href="%s">%s</a> загрузил %s',22 'log_torrent_edited' => 'Торрент < a href="%s">%s</a> редактировал %s',21 'log_torrent_uploaded' => 'Торрент <!--S-->TORRENT_%d_%s<!--E--> загрузил <!--S-->USER_%d_%s<!--E-->', 22 'log_torrent_edited' => 'Торрент <!--S-->TORRENT_%d_%s<!--E--> редактировал <!--S-->USER_%d_%s<!--E-->', 23 23 'log_torrent_deleted_by_user' => 'Торрент %d (%s) удалил пользователь %s (Причина: %s)', 24 24 'modcomment_uploadapp' => '%s - Запрос на повышение: %s (Да = %d, Нет = %d (%01.2f %%))', //два символа %% это не описка languages/lang_russian/lang_pms.php
r221 r269 14 14 'pm_helpdesc_answer_body' => "%s==[Тех. Поддержка]==%s\n%s\n\n%s писал(а) \n%s", 15 15 'pm_offer_filled_subject' => 'Предложение выложено', 16 'pm_offer_filled_body' => 'Вы голосовали за предложение [url=%s /offers.php?id=%d]%s[/url] и оно было выложено пользователем [url=%s/userdetails.php?id=%d][b]%s[/b][/url]. Вы можете скачать его, кликнув по ссылке [url=%s/details.php?id=%d]%s[/url]. Пожалуйста, не забудьте сказать спасибо.',16 'pm_offer_filled_body' => 'Вы голосовали за предложение [url=%s]%s[/url] и оно было выложено пользователем [url=%s][b]%s[/b][/url]. Вы можете скачать его, кликнув по ссылке [url=%s]%s[/url]. Пожалуйста, не забудьте сказать спасибо.', 17 17 'pm_request_filled_subject' => 'Запрос выложен', 18 'pm_request_filled_body' => 'Вы голосовали за запрос [url=%s /requests.php?id=%d]%s[/url] и он был выполнен пользователем [url=%s/userdetails.php?id=%d][b]%s[/b][/url]. Вы можете скачать его, кликнув по ссылке [url=%s/details.php?id=%d]%s[/url]. Пожалуйста, не забудьте сказать спасибо.',18 'pm_request_filled_body' => 'Вы голосовали за запрос [url=%s]%s[/url] и он был выполнен пользователем [url=%s][b]%s[/b][/url]. Вы можете скачать его, кликнув по ссылке [url=%s]%s[/url]. Пожалуйста, не забудьте сказать спасибо.', 19 19 'pm_class_changed_subject' => '%s в классе', 20 20 'pm_class_changed_body' => 'Вы были %s до класса %s пользователем %s', log.php
r266 r269 5 5 require ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 6 6 7 /* */ 8 function search_id_from_string ( $string ) { 9 10 $ary = array(); 11 12 while ( true ) { 13 $first_pos = strpos($string, '<!--S-->'); 14 15 if ( $first_pos !== false ) { 16 $last_pos = strpos($string, '<!--E-->'); 17 $_pos = strpos($string, '_'); 18 $_pos = strpos($string, '_', $_pos + 1); 19 $substr = substr($string, $first_pos + 8, $_pos - $first_pos - 8); 20 21 $_pos = strpos($substr, '_'); 22 23 $id = substr($substr, $_pos + 1); 24 $type = substr($substr, 0, $_pos); 25 26 $string = preg_replace('/<!--S-->' . $type . '_' . $id . '_(.*?)<!--E-->/si', '', $string); 27 28 $ary[$id] = $type; 29 } 30 else { 31 break; 32 } 33 } 34 35 if ( sizeof($ary) ) { 36 return $ary; 37 } 38 else { 39 return false; 40 } 41 } 42 /* */ 43 7 44 $userdata = session_pagestart($user_ip); 8 45 init_userprefs($userdata); 9 46 loggedinorreturn(); 10 47 11 $log_level_view = ( isset($_REQUEST['log_level_view']) ? intval($_REQUEST['log_level_view']) : -1);12 $ nick_ary = array();48 $log_level_view = request_var('log_level_view', -1); 49 $query = request_var('query', ''); 13 50 14 51 if ( $userdata['class'] == UC_MODERATOR ) { … … 50 87 51 88 $template->assign_vars(array( 52 'S_FORM_ACTION' => append_sid('log.php') ) 53 ); 54 55 if ( isset($_REQUEST['query']) && !empty($_REQUEST['query']) ) { 56 $query = request_var('query', ''); 89 'S_FORM_ACTION' => append_sid('log.php') 90 )); 91 92 if ( $query ) { 93 $template->assign_vars(array( 94 'SEARCH_RESULTS' => sprintf($lang['search_results'], $query), 95 'SEARCH_VALUE' => $query 96 )); 97 57 98 $query = searchfield($query); 58 $template->assign_vars(array(59 'SEARCH_RESULTS' => sprintf($lang['search_results'], htmlspecialchars($_REQUEST['query'])),60 'SEARCH_VALUE' => htmlspecialchars($_REQUEST['query']) )61 );62 99 } 63 100 // delete items older than 2 weeks … … 67 104 68 105 $template->assign_vars(array( 69 'LOG_LEVEL_SELECT' => $log_level_select )70 ) ;106 'LOG_LEVEL_SELECT' => $log_level_select 107 )); 71 108 72 109 … … 74 111 FROM ' . SITELOG_TABLE . ' 75 112 WHERE ' . ( $log_level_view <> -1 ? 'log_view_level = ' . $log_level_view : 'log_view_level <= ' . $level ) . 76 ( isset($query)? ' AND txt LIKE ' . "'%" . $db->sql_escape($query) . "%'" : '' );113 ( $query ? ' AND txt LIKE ' . "'%" . $db->sql_escape($query) . "%'" : '' ); 77 114 $result = $db->sql_query($sql); 78 115 $count = ( $row = $db->sql_fetchrow($result) ) ? $row['count'] : 0; 79 116 80 117 if ( $count ) { 81 list($pagertop, $pagerbottom, $limit) = pager(50, $count, 'log.php?' . ( !empty($query)? 'query=' . $query . '&' : '' ) . ( $log_level_view <> -1 ? 'log_level_view=' . $log_level_view . '&' : '' ) );118 list($pagertop, $pagerbottom, $limit) = pager(50, $count, 'log.php?' . ( $query ? 'query=' . $query . '&' : '' ) . ( $log_level_view <> -1 ? 'log_level_view=' . $log_level_view . '&' : '' ) ); 82 119 $template->assign_vars(array( 83 'PAGERBOTTOM' => $pagerbottom )84 ) ;120 'PAGERBOTTOM' => $pagerbottom 121 )); 85 122 86 123 $sql = 'SELECT added, txt … … 90 127 $result = $db->sql_query($sql); 91 128 92 $str = str_replace('%s', '(.*)', $lang['log_torrent_uploaded']); 93 $str = str_replace(array('<', '/'), array('\<', '\/'), $str); 129 $tor_ary = array(); 130 $user_ary = array(); 131 $log_ary = array(); 132 $cats = $cache->obtain_cats(); 94 133 95 134 while ( $row = $db->sql_fetchrow($result) ) { 96 preg_match('/' . $str . '/', $row['txt'], $matches); 97 if ( isset($matches[3]) ) { 98 $nick_ary[] = "'" . $db->sql_escape(trim($matches[3])) . "'"; 99 } 100 101 $ary[] = array($row['added'], $row['txt']); 102 } 103 if ( sizeof($nick_ary) ) { 104 $sql = 'SELECT name, privacy FROM ' . USERS_TABLE . ' WHERE name IN (' . implode(',', $nick_ary) . ')'; 135 if ( $search = search_id_from_string($row['txt']) ) { 136 foreach ( $search AS $id => $type ) { 137 switch ( $type ) { 138 case 'TORRENT': 139 $tor_ary[] = $id; 140 break; 141 case 'USER': 142 $user_ary[] = $id; 143 break; 144 } 145 } 146 } 147 148 $log_ary[] = $row; 149 } 150 if ( sizeof($user_ary) ) { 151 $user_ary = array_unique($user_ary); 152 $sql = 'SELECT name, privacy, uid FROM ' . USERS_TABLE . ' WHERE uid IN (' . implode(',', $user_ary) . ')'; 105 153 $result = $db->sql_query($sql); 106 $ nick_ary = array();154 $user_ary = array(); 107 155 while ( $row = $db->sql_fetchrow($result) ) { 108 $nick_ary[$row['name']] = $row['privacy']; 109 } 110 } 111 112 for ( $i = 0; $i < sizeof($ary); ++$i ) { 156 $user_ary[$row['uid']] = $row; 157 } 158 } 159 if ( sizeof($tor_ary) ) { 160 $tor_ary = array_unique($tor_ary); 161 $sql = 'SELECT name, fid, category FROM ' . TORRENTS_TABLE . ' WHERE fid IN (' . implode(',', $tor_ary) . ')'; 162 $result = $db->sql_query($sql); 163 $tor_ary = array(); 164 while ( $row = $db->sql_fetchrow($result) ) { 165 $tor_ary[$row['fid']] = $row; 166 } 167 } 168 169 foreach ( $log_ary AS $_null => $ary ) { 170 171 $date = create_date($ary['added']); 172 $text = $ary['txt']; 173 $continue = false; 174 113 175 $log_color = ''; 114 foreach ( $colors AS $t ext => $color ) {115 if ( strpos($ ary[$i][1], $text) ) {176 foreach ( $colors AS $txt => $color ) { 177 if ( strpos($text, $txt) ) { 116 178 $log_color = $color; 117 179 } 118 180 } 119 $date = create_date($ary[$i][0]); 120 $txt = $ary[$i][1]; 121 122 preg_match('/' . $str . '/', $ary[$i][1], $matches); 123 if ( isset($matches[3]) && $nick_ary[$matches[3]] == PRIVACY_LEVEL_HIGH && $userdata['class'] < UC_MODERATOR && $userdata['name'] <> $matches[3] ) { 124 if ( isset($query) ) { 125 continue; 181 182 if ( $search = search_id_from_string($text) ) { 183 foreach ( $search AS $id => $type ) { 184 switch ( $type ) { 185 case 'TORRENT': 186 if ( isset($tor_ary[$id]['category']) ) { 187 $cat_id = $tor_ary[$id]['category']; 188 $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 189 // www.phpBB-SEO.com SEO TOOLKIT BEGIN 190 if ( $cat_parent_id ) { 191 $seo->set_url($cats[$cat_parent_id]['cat_name'], $cat_parent_id, $seo->seo_static['browse']); 192 $seo->set_parent($cat_id, $seo->seo_static['browse'], $cat_parent_id, $seo->seo_static['browse']); 193 } 194 195 $seo->set_url($cats[$cat_id]['cat_name'], $cat_id, $seo->seo_static['browse']); 196 197 $seo->set_parent($id, $seo->seo_static['details'], $cat_id, $seo->seo_static['browse']); 198 199 $seo->set_url($tor_ary[$id]['name'], $id, $seo->seo_static['details']); 200 // www.phpBB-SEO.com SEO TOOLKIT END 201 202 $text = preg_replace('/<!--S-->TORRENT_' . $id . '_(.*?)<!--E-->/', '<a href="' . append_sid($root_path . 'details.php?id=' . $id) . '">' . $tor_ary[$id]['name'] . '</a>', $text); 203 } 204 else { 205 $text = preg_replace('/<!--S-->TORRENT_' . $id . '_(.*?)<!--E-->/', '\\1', $text); 206 } 207 break; 208 case 'USER': 209 if ( $user_ary[$id]['privacy'] == PRIVACY_LEVEL_HIGH && $userdata['class'] < UC_MODERATOR && $userdata['name'] <> $user_ary[$id]['name'] ) { 210 if ( $query ) { 211 $continue = true; 212 } 213 $text = preg_replace('/<!--S-->USER_' . $id . '_(.*?)<!--E-->/', $lang['anonymous'], $text); 214 } 215 else { 216 // www.phpBB-SEO.com SEO TOOLKIT START 217 $seo->set_user_url($user_ary[$id]['name'], $id); 218 // www.phpBB-SEO.com SEO TOOLKIT END 219 220 $text = preg_replace('/<!--S-->USER_' . $id . '_(.*?)<!--E-->/', '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $id) . '">' . $user_ary[$id]['name'] . '</a>', $text); 221 } 222 break; 223 } 126 224 } 127 $txt = preg_replace('/' . $str . '/e', "str_replace('\\3', '<i>' . \$lang['anonymous'] . '</i>', \"\\0\")", $txt); 128 } 129 if ( strpos($txt, 'userdetails_') !== false ) { 130 $txt = preg_replace('/userdetails_([0-9]+)/e', "append_sid(\$root_path . 'userdetails.php?id=\\1')", $txt); 131 } 132 if ( strpos($txt, 'details_') !== false ) { 133 preg_match('/<a href="details_([0-9]+)">(.*?)<\/a>/', $txt, $matches); 134 $tor_id = $matches[1]; 135 $torrent_name = $matches[2]; 136 $txt = preg_replace('/details_([0-9]+)/e', "append_sid(\$root_path . 'details.php?id=\\1')", $txt); 137 } 225 } 226 227 if ( $continue ) { 228 continue; 229 } 230 138 231 $template->assign_block_vars('log_row', array( 139 232 'COLOR' => $log_color, 140 233 'DATE' => $date, 141 'ACTION' => $txt) 142 ); 143 } 234 'ACTION' => $text 235 )); 236 } 237 144 238 } 145 239 else { message.php
r266 r269 2 2 $root_path = './'; 3 3 require ($root_path . 'include/config.php'); 4 require ($root_path . 'include/bbcode/bbcode.lib.php'); 5 require ($root_path . 'include/functions_check.php'); 4 6 require ($root_path . 'include/functions_post.php'); 5 require ($root_path . 'include/functions_check.php');6 7 require ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_pms.php'); 7 8 … … 79 80 } 80 81 82 $bb_code = new bbcode(); 83 81 84 if ( $message['sender'] == $userdata['uid'] ) { 82 85 $sender = '<a href="' . append_sid('userdetails.php?id=' . $message['receiver']) . '">' . $message['name'] . '</a>'; … … 114 117 } 115 118 } 116 $body = format_comment($message['msg']); 119 $body = censor_text($message['msg']); 120 $bb_code->parse($body); 121 $body = $bb_code->get_html(); 122 117 123 $added = create_date($message['added']); 118 124 if ( $userdata['class'] >= UC_MODERATOR && $message['sender'] == $userdata['uid'] ) { … … 151 157 foreach ( $msg_history_ary AS $msg_id => $ary ) { 152 158 $added = create_date($ary['added']); 159 160 $body = censor_text($ary['msg']); 161 $bb_code->parse($body); 162 $body = $bb_code->get_html(); 163 153 164 $template->assign_block_vars('messages_history.messages_history_row', array( 154 165 'SUBJECT' => $ary['subject'], 155 'MESSAGE' => format_comment($ary['msg']),166 'MESSAGE' => $body, 156 167 'ADDED' => $added, 157 168 'USERNAME' => ( $ary['uid'] == ANONYMOUS ? $lang['system'] : $ary['name'] ) … … 296 307 $origmsg = $reply_to; 297 308 309 $bb_code = new bbcode(); 310 298 311 if ( $reply_to ) { 299 312 $template->assign_block_vars('reply_to', array()); … … 303 316 foreach ( $reply_msg AS $msg_id => $ary ) { 304 317 $added = create_date($ary['added']); 318 $msg = censor_text($ary['msg']); 319 $bb_code->parse($msg); 320 $msg = $bb_code->get_html(); 321 305 322 $template->assign_block_vars('reply_to.reply_to_row', array( 306 323 'SUBJECT' => $ary['subject'], 307 'MESSAGE' => format_comment($ary['msg']),324 'MESSAGE' => $msg, 308 325 'ADDED' => $added, 309 326 'USERNAME' => ( $ary['uid'] == ANONYMOUS ? $lang['system'] : $ary['name'] ) … … 445 462 } 446 463 464 $bb_code = new bbcode(); 465 447 466 $body = sprintf($lang['pm_message_separator'], $orig2['name'], $message['msg']); 467 $body = censor_text($body); 468 $bb_code->parse($body); 469 $body = $bb_code->get_html(); 448 470 449 471 $template->assign_vars(array( … … 452 474 'PM_ID' => $pm_id, 453 475 'FROM_NAME' => $from_name, 454 'BODY' => format_comment($body),476 'BODY' => $body, 455 477 'SAVE_PM_CHECKED' => ( $userdata['savepms'] ? 'checked="checked"' : '' ), 456 478 'ORIG_NAME' => $orig_name modtask.php
r241 r269 3 3 require ($root_path . 'include/config.php'); 4 4 require ($root_path . 'include/functions_selects.php'); 5 require ($root_path . 'include/ functions_post.php');5 require ($root_path . 'include/bbcode/bbcode.lib.php'); 6 6 require ($root_path . 'include/functions_check.php'); 7 7 require ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); my.php
r267 r269 193 193 } 194 194 195 if ( $userdata['user_sig_bbcode_uid'] == '' ) { 196 $userdata['user_sig_bbcode_uid'] = make_bbcode_uid(); 197 $updateset['user_sig_bbcode_uid'] = $userdata['user_sig_bbcode_uid']; 198 } 199 $signature = prepare_message($signature, $config['allow_html'], $config['allow_bbcode'], $config['allow_smilies'], $userdata['user_sig_bbcode_uid']); 195 $signature = prepare_message($signature, $config['allow_html'], $config['allow_bbcode'], $config['allow_smilies']); 200 196 $updateset['user_sig'] = $signature; 201 197 } … … 285 281 } 286 282 287 $user_sig_bbcode_uid = $userdata['user_sig_bbcode_uid']; 283 288 284 $user_sig = $userdata['user_sig']; 289 285 $template->assign_vars(array( … … 303 299 'USER_MSN' => $userdata['msn'], 304 300 'USER_YAHOO' => $userdata['yahoo'], 305 'USER_SIGNATURE' => ( $config['allow_sig'] ? '<textarea rows="4" cols="40" id="signature" name="signature">' . ( $user_sig != '' ? preg_replace("/:(([a-z0-9]+:)?)$user_sig_bbcode_uid(=|\])/si", '\\3', $user_sig) : $user_sig ). '</textarea>' : '' ),301 'USER_SIGNATURE' => ( $config['allow_sig'] ? '<textarea rows="4" cols="40" id="signature" name="signature">' . $user_sig . '</textarea>' : '' ), 306 302 'GENDER_INPUT' => '<input type="radio" class="radio" id="gender" name="gender"' . ( !$userdata['gender'] ? ' checked="checked"' : '') . ' value="0" />' . $lang['gender_male'] . ' <input type="radio" class="radio" name="gender"' . ($userdata['gender'] ? ' checked="checked"' : '') . ' value="1" />' . $lang['gender_female'], 307 303 'USER_AVATAR_LINK_INPUT' => ( $config['allow_avatar_remote'] ? '<input type="text" id="avatar" name="avatar_link" size="45" value="' . htmlspecialchars($userdata['avatar']) . '" />' : '' ), news.php
r266 r269 2 2 $root_path = './'; 3 3 require ($root_path . 'include/config.php'); 4 require ($root_path . 'include/bbcode/bbcode.lib.php'); 4 5 require ($root_path . 'include/functions_post.php'); 5 6 … … 20 21 } 21 22 23 $bb_code = new bbcode($row['body']); 24 $row['body'] = $bb_code->get_html(); 25 22 26 $template->assign_vars(array( 23 27 'NEWS_TITLE' => $row['title'], 24 'NEWS_TEXT' => format_comment($row['body']),28 'NEWS_TEXT' => $row['body'], 25 29 'NEWS_ADDED' => create_date($row['added']), 26 30 'NEWS_AUTHOR' => $row['name'] offers.php
r266 r269 3 3 require ($root_path . 'include/config.php'); 4 4 require ($root_path . 'include/functions_check.php'); 5 require ($root_path . 'include/functions_post.php');6 5 require ($root_path . 'include/functions_selects.php'); 7 6 … … 165 164 $filled_torrent_id = $matches[1]; 166 165 167 $sql = 'SELECT name FROM ' . TORRENTS_TABLE . ' WHERE fid = ' . $filled_torrent_id;168 $result = $db->sql_query($sql); 169 if ( ! ($row = $db->sql_fetchrow($result)) ) {166 $sql = 'SELECT name, category FROM ' . TORRENTS_TABLE . ' WHERE fid = ' . $filled_torrent_id; 167 $result = $db->sql_query($sql); 168 if ( !$row = $db->sql_fetchrow($result) ) { 170 169 trigger_error($lang['invalid_url_for_uploaded_torrent']); 171 170 } 172 171 $torrent_name = censor_text($row['name']); 172 $cats = $cache->obtain_cats(); 173 174 $cat_id = $row['category']; 175 $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 176 if ( $config['mod_rewrite_enabled'] ) { 177 $u_offer = append_sid($root_path . 'offers.php?id=' . $id, false, true, ''); 178 $u_userdetails = append_sid($root_path . 'userdetails.php?id=' . $userdata['uid'], false, true, ''); 179 $u_details = append_sid($root_path . 'details.php?id=' . $filled_torrent_id, false, true, ''); 180 } 181 else { 182 $base_url = generate_base_url(); 183 $u_offer = $base_url . '/offers.php?id=' . $id; 184 $u_userdetails = $base_url . '/userdetails.php?id=' . $userdata['uid']; 185 $u_details = $base_url . '/details.php?id=' . $filled_torrent_id; 186 } 173 187 174 188 $sql = 'SELECT o.userid, u.language, u.name, u.email, u.notifs, u.language, u.class … … 185 199 'sender' => 0, 186 200 'receiver' => $arr['userid'], 187 'msg' => sprintf($lang['pm_offer_filled_body'], generate_base_url() , $id, $offer_name, generate_base_url(), $userdata['uid'], $userdata['name'], generate_base_url() , $filled_torrent_id, $torrent_name),201 'msg' => sprintf($lang['pm_offer_filled_body'], $u_offer, $offer_name, $u_userdetails, $userdata['name'], $u_details, $torrent_name), 188 202 'subject' => $lang['pm_offer_filled_subject'], 189 203 'name' => $arr['name'], … … 262 276 $result = $db->sql_query($sql); 263 277 264 if ( ! ($row = $db->sql_fetchrow($result)) ) {278 if ( !$row = $db->sql_fetchrow($result) ) { 265 279 trigger_error (sprintf($lang['invalid_id'], $id)); 266 280 } 281 282 /* */ 283 require ($root_path . 'include/bbcode/bbcode.lib.php'); 284 require ($root_path . 'include/functions_post.php'); 285 /* */ 267 286 268 287 if ( $row['userid'] <> ANONYMOUS ) { … … 278 297 $u_oferer = ''; 279 298 } 299 300 $description = censor_text($row['descr']); 301 $bb_code = new bbcode($description); 302 $description = $bb_code->get_html(); 280 303 281 304 $template->assign_vars(array( … … 291 314 'OFFER_DETAILS' => sprintf($lang['offer_details'], $row['name']), 292 315 'OFFER_NAME' => censor_text($row['name']), 293 'DESCRIPTION' => format_comment(censor_text($row['descr'])),316 'DESCRIPTION' => $description, 294 317 'ADDED' => create_date($row['added']), 295 318 'TYPE' => $row['cat_name'], … … 476 499 list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, 'offers.php?' . $search_arr . 'sort=' . $sort . '&' ); 477 500 478 $sql = 'SELECT u.name AS username, u.class, o.id, o.userid, o.name, o.added, o.votes, o.comments, o.filled, o.filledby, u2.name AS filledby_username, o.category, t.name AS torrent_name 501 $sql = 'SELECT u.name AS username, u.class, o.id, o.userid, o.name, o.added, o.votes, o.comments, o.filled, o.filledby, u2.name AS filledby_username, o.category, t.name AS torrent_name, t.category AS t_category 479 502 FROM ' . OFFERS_TABLE . ' o 480 503 LEFT JOIN ' . USERS_TABLE . ' u2 ON o.filledby = u2.uid … … 520 543 'U_CAT' => append_sid('offers.php?cat=' . $row['category']), 521 544 'U_OFFER' => ( $filled ? $filled : append_sid('offers.php?id=' . $row['id']) ), 522 'U_OFFERER' => append_sid( 'userdetails.php?id=' . $row['userid']),545 'U_OFFERER' => append_sid($root_path . 'userdetails.php?id=' . $row['userid']), 523 546 'U_VOTES' => append_sid('offers.php?action=voteview&offerid=' . $row['id']), 524 547 'CAT_NAME_DISPLAY' => $cat_name_display, phpBB2/groupcp.php
r266 r269 36 36 37 37 $from = ( !empty($row['user_from']) ) ? $row['user_from'] : ' '; 38 $joined = create_date($row['added'] , $date_format);38 $joined = create_date($row['added']); 39 39 $posts = ( $row['user_posts'] ) ? $row['user_posts'] : 0; 40 40 … … 58 58 } 59 59 60 $temp_url = append_sid( "userdetails.php?id=" . $row['uid']);60 $temp_url = append_sid($root_path . "userdetails.php?id=" . $row['uid']); 61 61 $profile_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_profile'] . '" alt="' . $lang['read_profile'] . '" title="' . $lang['read_profile'] . '" border="0" /></a>'; 62 62 $profile = '<a href="' . $temp_url . '">' . $lang['read_profile'] . '</a>'; 63 63 64 $temp_url = append_sid( "message.php?action=send&receiver=" . $row['uid']);64 $temp_url = append_sid($root_path . "message.php?action=send&receiver=" . $row['uid']); 65 65 $pm_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_pm'] . '" alt="' . $lang['send_private_message'] . '" title="' . $lang['send_private_message'] . '" border="0" /></a>'; 66 66 $pm = '<a href="' . $temp_url . '">' . $lang['send_private_message'] . '</a>'; … … 82 82 $aim = ( $row['aim'] ) ? '<a href="aim:goim?screenname=' . $row['aim'] . '&message=Hello+Are+you+there?">' . $lang['aim'] . '</a>' : ''; 83 83 84 $temp_url = append_sid( "userdetails.php?id=" . $row['uid']);84 $temp_url = append_sid($root_path . "userdetails.php?id=" . $row['uid']); 85 85 $msn_img = ( $row['msn'] ) ? '<a href="' . $temp_url . '"><img src="' . $images['icon_msnm'] . '" alt="' . $lang['msnm'] . '" title="' . $lang['msnm'] . '" border="0" /></a>' : ''; 86 86 $msn = ( $row['msn'] ) ? '<a href="' . $temp_url . '">' . $lang['msnm'] . '</a>' : ''; … … 95 95 if ($row['user_session_time'] >= (time() - $config['online_time'])) 96 96 { 97 $online_status_img = '<a href="' . append_sid( "index.php?viewonline=1") . '"><img src="' . $images['icon_online'] . '" alt="' . sprintf($lang['is_online'], $row['username']) . '" title="' . sprintf($lang['is_online'], $row['username']) . '" /></a>';98 $online_status = '<strong><a href="' . append_sid( "index.php?viewonline=1") . '" title="' . sprintf($lang['is_online'], $row['username']) . '"' . $online_color . '>' . $lang['online'] . '</a></strong>';97 $online_status_img = '<a href="' . append_sid($root_path . "index.php?viewonline=1") . '"><img src="' . $images['icon_online'] . '" alt="' . sprintf($lang['is_online'], $row['username']) . '" title="' . sprintf($lang['is_online'], $row['username']) . '" /></a>'; 98 $online_status = '<strong><a href="' . append_sid($root_path . "index.php?viewonline=1") . '" title="' . sprintf($lang['is_online'], $row['username']) . '"' . $online_color . '>' . $lang['online'] . '</a></strong>'; 99 99 } 100 100 else … … 611 611 // Get moderator details for this group 612 612 // 613 $sql = "SELECT u.name AS username, u.uid, u.user_posts, u. email, u.icq, u.aim, u.yahoo, u.msn, u.user_session_time, u.user_lastvisit613 $sql = "SELECT u.name AS username, u.uid, u.user_posts, u.added, u.email, u.icq, u.aim, u.yahoo, u.msn, u.user_session_time, u.user_lastvisit, u.avatar 614 614 FROM " . USERS_TABLE . " u 615 615 WHERE u.uid = " . $group_info['group_moderator']; … … 621 621 // Get user information for this group 622 622 // 623 $sql = "SELECT u.name AS username, u.uid, u.user_posts, u. email, u.icq, u.aim, u.yahoo, u.msn, ug.user_pending, u.user_session_time, u.user_lastvisit623 $sql = "SELECT u.name AS username, u.uid, u.user_posts, u.added, u.email, u.icq, u.aim, u.yahoo, u.msn, ug.user_pending, u.user_session_time, u.user_lastvisit, u.avatar 624 624 FROM " . USERS_TABLE . " u, " . USER_GROUP_TABLE . " ug 625 625 WHERE ug.group_id = $group_id … … 775 775 776 776 //'U_MOD_VIEWPROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id"), 777 'U_MOD_VIEWPROFILE' => append_sid( "userdetails.php?id=$user_id"),777 'U_MOD_VIEWPROFILE' => append_sid($root_path . "userdetails.php?id=$user_id"), 778 778 // FIXME: 779 779 //'U_SEARCH_USER' => append_sid("search.$phpEx?mode=searchuser"), … … 787 787 'S_GROUP_HIDDEN_CHECKED' => ( $group_info['group_type'] == GROUP_HIDDEN ) ? ' checked="checked"' : '', 788 788 'S_HIDDEN_FIELDS' => $s_hidden_fields, 789 'S_MODE_SELECT' => $select_sort_mode,790 'S_ORDER_SELECT' => $select_sort_order,791 789 //'S_GROUPCP_ACTION' => append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id")) 792 790 'S_GROUPCP_ACTION' => append_sid($root_path . "phpbb2.php?page=groupcp&" . POST_GROUPS_URL . "=$group_id")) … … 842 840 843 841 //'U_VIEWPROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id")) 844 'U_VIEWPROFILE' => append_sid( "userdetails.php?id=$user_id"))842 'U_VIEWPROFILE' => append_sid($root_path . "userdetails.php?id=$user_id")) 845 843 ); 846 844 … … 933 931 934 932 //'U_VIEWPROFILE' => append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id")) 935 'U_VIEWPROFILE' => append_sid( "userdetails.php?id=$user_id"))933 'U_VIEWPROFILE' => append_sid($root_path . "userdetails.php?id=$user_id")) 936 934 ); 937 935 } phpBB2/includes/bbcode.php
r8 r269 25 25 } 26 26 27 define("BBCODE_UID_LEN", 10);28 29 // global that holds loaded-and-prepared bbcode templates, so we only have to do30 // that stuff once.31 32 $bbcode_tpl = null;33 34 // mod img size add35 function makeimgsize ( $width, $height )36 {37 global $config;38 39 $size = '';40 41 // check for smallness42 if ( $width < $config['postimg_width'] && $height < $config['postimg_height'] )43 {44 return 'SMALL';45 }46 elseif ( $width > $height )47 {48 if ( $config['postimg_width'] < $width )49 {50 $size = 'width="' . $config['postimg_width'] . '"';51 }52 }else53 {54 if ( $config['postimg_height'] < $height )55 {56 $size = 'height="' . $config['postimg_height'] . '"';57 }58 }59 60 return $size;61 }62 63 function image_parse ( $post, $uid )64 {65 global $config, $lang, $bbcode_tpl;66 67 preg_match_all( "/\[img(.*?):$uid\](.*?)\[\/img:$uid\]/i", $post, $matches);68 foreach ( $matches[0] as $i => $img )69 {70 $stuff = $matches[1][$i];71 $stuff = explode( ':', $stuff );72 if ( sizeof( $stuff ) != 4 )73 { // old image or something74 $post = preg_replace( "#\[img:$uid\]([^?].*?)\[/img:$uid\]#i", $bbcode_tpl['img'], $post );75 }76 switch($stuff[0])77 {78 case '=right':79 $align = $lang['right'];80 break;81 case '=center':82 $align = 'center';83 break;84 case '=left':85 default:86 $align = $lang['left'];87 break;88 }89 $width = ( isset($stuff[1]) ? $stuff[1] : 0 );90 $height = ( isset($stuff[2]) ? $stuff[2] : 0 );91 $size = makeimgsize( $width, $height );92 93 if ( $size != 'SMALL' )94 {95 $replace = $bbcode_tpl['thmbimg'];96 $seek = array( '{IMAGE}', '{WIDTH}', '{HEIGHT}', '{SIZE}', '{NOTICE}', '{ALIGN}' );97 $with = ( !empty( $size ) ) ? array( $matches[2][$i] , $width, $height, $size, $lang['postimg_clickme'], $align ) : array( $matches[2][$i] , $width, $height, $size, '', $align );98 $replace = str_replace( $seek, $with, $replace );99 }100 else101 {102 $replace = str_replace( '\1', $matches[2][$i], $bbcode_tpl['img'] );103 }104 $post = str_replace( $img, $replace, $post );105 }106 107 return $post;108 }109 // mod img size end110 111 27 // MULTI BBCODE-begin 112 28 function Multi_BBCode() … … 123 39 $EMBB_widths[] = '55'; 124 40 $EMBB_values[] = $lang['offtop']; 41 42 $EMBB_widths[] = '60'; 43 $EMBB_values[] = $lang['spoiler']; 44 125 45 if ( ($is_auth['auth_mod']) || ( ($userdata['user_level'] != USER) ) ) 126 46 { … … 145 65 } 146 66 // MULTI BBCODE-end 147 148 149 /**150 * Loads bbcode templates from the bbcode.tpl file of the current template set.151 * Creates an array, keys are bbcode names like "b_open" or "url", values152 * are the associated template.153 * Probably pukes all over the place if there's something really screwed154 * with the bbcode.tpl file.155 *156 * Nathan Codding, Sept 26 2001.157 */158 function load_bbcode_template()159 {160 global $template, $template_path;161 162 $tpl = file_get_contents($template_path . '/bbcode.html');163 164 // replace \ with \\ and then ' with \'.165 $tpl = str_replace('\\', '\\\\', $tpl);166 $tpl = str_replace('\'', '\\\'', $tpl);167 168 // strip newlines.169 $tpl = str_replace("\n", '', $tpl);170 171 // Turn template blocks into PHP assignment statements for the values of $bbcode_tpls..172 $tpl = preg_replace('#<!-- BEGIN (.*?) -->(.*?)<!-- END (.*?) -->#', "\n" . '$bbcode_tpls[\'\\1\'] = \'\\2\';', $tpl);173 174 $bbcode_tpls = array();175 176 eval($tpl);177 178 return $bbcode_tpls;179 }180 181 182 /**183 * Prepares the loaded bbcode templates for insertion into preg_replace()184 * or str_replace() calls in the bbencode_second_pass functions. This185 * means replacing template placeholders with the appropriate preg backrefs186 * or with language vars. NOTE: If you change how the regexps work in187 * bbencode_second_pass(), you MUST change this function.188 *189 * Nathan Codding, Sept 26 2001190 *191 */192 function prepare_bbcode_template($bbcode_tpl)193 {194 global $lang;195 196 $bbcode_tpl['olist_open'] = str_replace('{LIST_TYPE}', '\\1', $bbcode_tpl['olist_open']);197 198 $bbcode_tpl['color_open'] = str_replace('{COLOR}', '\\1', $bbcode_tpl['color_open']);199 200 $bbcode_tpl['size_open'] = str_replace('{SIZE}', '\\1', $bbcode_tpl['size_open']);201 202 $bbcode_tpl['quote_open'] = str_replace('{L_QUOTE}', $lang['quote'], $bbcode_tpl['quote_open']);203 204 $bbcode_tpl['quote_username_open'] = str_replace('{L_QUOTE}', $lang['quote'], $bbcode_tpl['quote_username_open']);205 $bbcode_tpl['quote_username_open'] = str_replace('{L_POSTED}', $lang['wrote'], $bbcode_tpl['quote_username_open']);206 $bbcode_tpl['quote_username_open'] = str_replace('{USERNAME}', '\\1', $bbcode_tpl['quote_username_open']);207 // BEGIN Moderator Tags208 $bbcode_tpl['mod_open'] = str_replace('{MOD_WARN}', $lang['mod_warning'], $bbcode_tpl['mod_open']);209 $bbcode_tpl['mod_username_open'] = str_replace('{MOD_WARN}', $lang['mod_warning'], $bbcode_tpl['mod_username_open']);210 $bbcode_tpl['mod_username_open'] = str_replace('{USERNAME}', '\\1', $bbcode_tpl['mod_username_open']);211 // END Moderator Tags212 213 $bbcode_tpl['code_open'] = str_replace('{L_CODE}', $lang['code'], $bbcode_tpl['code_open']);214 $bbcode_tpl['offtop_open'] = str_replace('{L_OFFTOP}', $lang['offtop'], $bbcode_tpl['offtop_open']);215 216 $bbcode_tpl['img'] = str_replace('{URL}', '\\1', $bbcode_tpl['img']);217 218 // We do URLs in several different ways..219 $bbcode_tpl['url1'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']);220 $bbcode_tpl['url1'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url1']);221 222 $bbcode_tpl['url2'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']);223 $bbcode_tpl['url2'] = str_replace('{DESCRIPTION}', '\\1', $bbcode_tpl['url2']);224 225 $bbcode_tpl['url3'] = str_replace('{URL}', '\\1', $bbcode_tpl['url']);226 $bbcode_tpl['url3'] = str_replace('{DESCRIPTION}', '\\2', $bbcode_tpl['url3']);227 228 $bbcode_tpl['url4'] = str_replace('{URL}', 'http://\\1', $bbcode_tpl['url']);229 $bbcode_tpl['url4'] = str_replace('{DESCRIPTION}', '\\3', $bbcode_tpl['url4']);230 231 $bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']);232 233 define("BBCODE_TPL_READY", true);234 235 return $bbcode_tpl;236 }237 238 239 /**240 * Does second-pass bbencoding. This should be used before displaying the message in241 * a thread. Assumes the message is already first-pass encoded, and we are given the242 * correct UID as used in first-pass encoding.243 */244 function bbencode_second_pass($text, $uid)245 {246 global $lang, $bbcode_tpl;247 248 $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text);249 250 // pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0).251 // This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it.252 $text = " " . $text;253 254 // First: If there isn't a "[" and a "]" in the message, don't bother.255 if (! (strpos($text, "[") && strpos($text, "]")) )256 {257 // Remove padding, return.258 $text = substr($text, 1);259 return $text;260 }261 262 // Only load the templates ONCE..263 if (!defined("BBCODE_TPL_READY"))264 {265 // load templates from file into array.266 $bbcode_tpl = load_bbcode_template();267 268 // prepare array for use in regexps.269 $bbcode_tpl = prepare_bbcode_template($bbcode_tpl);270 }271 272 // [CODE] and [/CODE] for posting code (HTML, PHP, C etc etc) in your posts.273 $text = bbencode_second_pass_code($text, $uid, $bbcode_tpl);274 275 // [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff.276 $text = str_replace("[quote:$uid]", $bbcode_tpl['quote_open'], $text);277 $text = str_replace("[/quote:$uid]", $bbcode_tpl['quote_close'], $text);278 279 // New one liner to deal with opening quotes with usernames...280 // replaces the two line version that I had here before..281 $text = preg_replace("/\[quote:$uid=(.*?)\]/si", $bbcode_tpl['quote_username_open'], $text);282 283 // [list] and [list=x] for (un)ordered lists.284 // unordered lists285 $text = str_replace("[list:$uid]", $bbcode_tpl['ulist_open'], $text);286 // li tags287 $text = str_replace("[*:$uid]", $bbcode_tpl['listitem'], $text);288 // ending tags289 $text = str_replace("[/list:u:$uid]", $bbcode_tpl['ulist_close'], $text);290 $text = str_replace("[/list:o:$uid]", $bbcode_tpl['olist_close'], $text);291 // Ordered lists292 $text = preg_replace("/\[list=([a1]):$uid\]/si", $bbcode_tpl['olist_open'], $text);293 // BEGIN Moderator Tags294 // [mod] Moderator code [/mod]295 $text = str_replace("[mod:$uid]", $bbcode_tpl['mod_open'], $text);296 $text = str_replace("[/mod:$uid]", $bbcode_tpl['mod_close'], $text);297 $text = preg_replace("/\[mod:$uid=(.*?)\]/si", $bbcode_tpl['mod_username_open'], $text);298 // END Moderator Tags299 $text = str_replace("[offtop:$uid]", $bbcode_tpl['offtop_open'], $text);300 $text = str_replace("[/offtop:$uid]", $bbcode_tpl['offtop_close'], $text);301 // colours302 $text = preg_replace("/\[color=(\#[0-9A-F]{6}|[a-z]+):$uid\]/si", $bbcode_tpl['color_open'], $text);303 $text = str_replace("[/color:$uid]", $bbcode_tpl['color_close'], $text);304 305 // size306 $text = preg_replace("/\[size=([1-2]?[0-9]):$uid\]/si", $bbcode_tpl['size_open'], $text);307 $text = str_replace("[/size:$uid]", $bbcode_tpl['size_close'], $text);308 309 // [b] and [/b] for bolding text.310 $text = str_replace("[b:$uid]", $bbcode_tpl['b_open'], $text);311 $text = str_replace("[/b:$uid]", $bbcode_tpl['b_close'], $text);312 313 // [u] and [/u] for underlining text.314 $text = str_replace("[u:$uid]", $bbcode_tpl['u_open'], $text);315 $text = str_replace("[/u:$uid]", $bbcode_tpl['u_close'], $text);316 317 // [i] and [/i] for italicizing text.318 $text = str_replace("[i:$uid]", $bbcode_tpl['i_open'], $text);319 $text = str_replace("[/i:$uid]", $bbcode_tpl['i_close'], $text);320 321 // Patterns and replacements for URL and email tags..322 $patterns = array();323 $replacements = array();324 325 // mod img size replace with call to image parsing function326 $text = image_parse ( $text, $uid );327 328 // [img]image_url_here[/img] code..329 // This one gets first-passed..330 $patterns[] = "#\[img:$uid\]([^?](?:[^\[]+|\[(?!url))*?)\[/img:$uid\]#i";331 $replacements[] = $bbcode_tpl['img'];332 333 // matches a [url]xxxx://www.phpbb.com[/url] code..334 $patterns[] = "#\[url\]([\w]+?://([\w\#$%&~/.\-;:=,?@\]+]+|\[(?!url=))*?)\[/url\]#is";335 $replacements[] = $bbcode_tpl['url1'];336 337 // [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).338 $patterns[] = "#\[url\]((www|ftp)\.([\w\#$%&~/.\-;:=,?@\]+]+|\[(?!url=))*?)\[/url\]#is";339 $replacements[] = $bbcode_tpl['url2'];340 341 // [url=xxxx://www.phpbb.com]phpBB[/url] code..342 $patterns[] = "#\[url=([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is";343 $replacements[] = $bbcode_tpl['url3'];344 345 // [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).346 $patterns[] = "#\[url=((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is";347 $replacements[] = $bbcode_tpl['url4'];348 349 350 // [email]user@domain.tld[/email] code..351 $patterns[] = "#\[email\]([a-z0-9&\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si";352 $replacements[] = $bbcode_tpl['email'];353 354 $text = preg_replace($patterns, $replacements, $text);355 356 // Remove our padding from the string..357 $text = substr($text, 1);358 359 return $text;360 361 } // bbencode_second_pass()362 363 // Need to initialize the random numbers only ONCE364 mt_srand( (double) microtime() * 1000000);365 366 function make_bbcode_uid()367 {368 // Unique ID for this message..369 370 $uid = md5(mt_rand());371 $uid = substr($uid, 0, BBCODE_UID_LEN);372 373 return $uid;374 }375 376 function bbencode_first_pass($text, $uid)377 {378 // pad it with a space so we can distinguish between FALSE and matching the 1st char (index 0).379 // This is important; bbencode_quote(), bbencode_list(), and bbencode_code() all depend on it.380 $text = " " . $text;381 382 // [CODE] and [/CODE] for posting code (HTML, PHP, C etc etc) in your posts.383 $text = bbencode_first_pass_pda($text, $uid, '[code]', '[/code]', '', true, '');384 385 $text = bbencode_first_pass_pda($text, $uid, '[offtop]', '[/offtop]', '', false, '');386 387 // [QUOTE] and [/QUOTE] for posting replies with quote, or just for quoting stuff.388 $text = bbencode_first_pass_pda($text, $uid, '[quote]', '[/quote]', '', false, '');389 $text = bbencode_first_pass_pda($text, $uid, '/\[quote=(.*?)\]/is', '[/quote]', '', false, '', "[quote:$uid=\\1]");390 391 // [list] and [list=x] for (un)ordered lists.392 $open_tag = array();393 $open_tag[0] = "[list]";394 395 // unordered..396 $text = bbencode_first_pass_pda($text, $uid, $open_tag, "[/list]", "[/list:u]", false, 'replace_listitems');397 398 $open_tag[0] = "[list=1]";399 $open_tag[1] = "[list=a]";400 401 // ordered.402 $text = bbencode_first_pass_pda($text, $uid, $open_tag, "[/list]", "[/list:o]", false, 'replace_listitems');403 // BEGIN Moderator Tags404 $text = bbencode_first_pass_pda($text, $uid, '[mod]', '[/mod]', '', false, '');405 $text = bbencode_first_pass_pda($text, $uid, '/\[mod=(.*?)\]/is', '[/mod]', '', false, '', "[mod:$uid=\\1]");406 // END Moderator Tags407 // [color] and [/color] for setting text color408 $text = preg_replace("#\[color=(\#[0-9A-F]{6}|[a-z\-]+)\](.*?)\[/color\]#si", "[color=\\1:$uid]\\2[/color:$uid]", $text);409 410 // [size] and [/size] for setting text size411 $text = preg_replace("#\[size=([1-2]?[0-9])\](.*?)\[/size\]#si", "[size=\\1:$uid]\\2[/size:$uid]", $text);412 413 // [b] and [/b] for bolding text.414 $text = preg_replace("#\[b\](.*?)\[/b\]#si", "[b:$uid]\\1[/b:$uid]", $text);415 416 // [u] and [/u] for underlining text.417 $text = preg_replace("#\[u\](.*?)\[/u\]#si", "[u:$uid]\\1[/u:$uid]", $text);418 419 // [i] and [/i] for italicizing text.420 $text = preg_replace("#\[i\](.*?)\[/i\]#si", "[i:$uid]\\1[/i:$uid]", $text);421 422 // mod max img size changed the first pass thingo423 preg_match_all( "#\[(img.*?)\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", $text, $matches );424 // now we go through these matches and do what's needed425 foreach ( $matches[0] as $i => $m )426 {427 // easier use428 $tag = $matches[1][$i];429 $url1 = $matches[2][$i];430 $url2 = $matches[4][$i];431 432 // if we already tagged this one then we leave it be ;)433 preg_match( '#img.*?:(\d+):(\d+)#i', $tag, $match );434 if ( empty( $match ) )435 {436 // get the size so we can store it437 if ( !$size = @getimagesize( $url1 . $url2 ) )438 { // image will not get resized439 $width = '';440 $height = '';441 }442 else443 {444 $width = $size[0];445 $height = $size[1];446 }447 }448 else449 { // we already have the size450 $width = $match[1];451 $height = $match[2];452 }453 $tag = explode( ':', $tag ); // remove any possible left over : stuff454 $tag = $tag[0];455 // lastly we replace it within the text456 $text = str_replace( $m, '[' . $tag . ':' . $width . ':' . $height . ':' . $uid . ']' . $url1 . $url2 . '[/img:' . $uid . ']', $text );457 }458 459 // [img]image_url_here[/img] code..460 //$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);461 // end mod img size changes462 463 // Remove our padding from the string..464 return substr($text, 1);;465 466 } // bbencode_first_pass()467 468 /**469 * $text - The text to operate on.470 * $uid - The UID to add to matching tags.471 * $open_tag - The opening tag to match. Can be an array of opening tags.472 * $close_tag - The closing tag to match.473 * $close_tag_new - The closing tag to replace with.474 * $mark_lowest_level - boolean - should we specially mark the tags that occur475 * at the lowest level of nesting? (useful for [code], because476 * we need to match these tags first and transform HTML tags477 * in their contents..478 * $func - This variable should contain a string that is the name of a function.479 * That function will be called when a match is found, and passed 2480 * parameters: ($text, $uid). The function should return a string.481 * This is used when some transformation needs to be applied to the482 * text INSIDE a pair of matching tags. If this variable is FALSE or the483 * empty string, it will not be executed.484 * If open_tag is an array, then the pda will try to match pairs consisting of485 * any element of open_tag followed by close_tag. This allows us to match things486 * like [list=A]...[/list] and [list=1]...[/list] in one pass of the PDA.487 *488 * NOTES: - this function assumes the first character of $text is a space.489 * - every opening tag and closing tag must be of the [...] format.490 */491 function bbencode_first_pass_pda($text, $uid, $open_tag, $close_tag, $close_tag_new, $mark_lowest_level, $func, $open_regexp_replace = false)492 {493 $open_tag_count = 0;494 495 if (!$close_tag_new || ($close_tag_new == ''))496 {497 $close_tag_new = $close_tag;498 }499 500 $close_tag_length = strlen($close_tag);501 $close_tag_new_length = strlen($close_tag_new);502 $uid_length = strlen($uid);503 504 $use_function_pointer = ($func && ($func != ''));505 506 $stack = array();507 508 if (is_array($open_tag))509 {510 if (0 == count($open_tag))511 {512 // No opening tags to match, so return.513 return $text;514 }515 $open_tag_count = count($open_tag);516 }517 else518 {519 // only one opening tag. make it into a 1-element array.520 $open_tag_temp = $open_tag;521 $open_tag = array();522 $open_tag[0] = $open_tag_temp;523 $open_tag_count = 1;524 }525 526 $open_is_regexp = false;527 528 if ($open_regexp_replace)529 {530 $open_is_regexp = true;531 if (!is_array($open_regexp_replace))532 {533 $open_regexp_temp = $open_regexp_replace;534 $open_regexp_replace = array();535 $open_regexp_replace[0] = $open_regexp_temp;536 }537 }538 539 if ($mark_lowest_level && $open_is_regexp)540 {541 trigger_error("Unsupported operation for bbcode_first_pass_pda().");542 return;543 }544 545 // Start at the 2nd char of the string, looking for opening tags.546 $curr_pos = 1;547 while ($curr_pos && ($curr_pos < strlen($text)))548 {549 $curr_pos = strpos($text, "[", $curr_pos);550 551 // If not found, $curr_pos will be 0, and the loop will end.552 if ($curr_pos)553 {554 // We found a [. It starts at $curr_pos.555 // check if it's a starting or ending tag.556 $found_start = false;557 $which_start_tag = "";558 $start_tag_index = -1;559 560 for ($i = 0; $i < $open_tag_count; $i++)561 {562 // Grab everything until the first "]"...563 $possible_start = substr($text, $curr_pos, strpos($text, ']', $curr_pos + 1) - $curr_pos + 1);564 565 //566 // We're going to try and catch usernames with "[' characters.567 //568 if( preg_match('#\[quote=#si', $possible_start, $match) && !preg_match('#\[quote=(.*?)\]#si', $possible_start) )569 {570 // OK we are in a quote tag that probably contains a ] bracket.571 // Grab a bit more of the string to hopefully get all of it..572 if ($close_pos = strpos($text, '"]', $curr_pos + 14))573 {574 if (strpos(substr($text, $curr_pos + 14, $close_pos - ($curr_pos + 14)), '[quote') === false)575 {576 $possible_start = substr($text, $curr_pos, $close_pos - $curr_pos + 7);577 }578 }579 }580 581 // BEGIN Moderator Tags582 //583 // We're going to try and catch usernames with "[' characters.584 //585 if( preg_match('#\[mod=#si', $possible_start, $match) && !preg_match('#\[mod=(.*?)\]#si', $possible_start) )586 {587 // OK we are in a mod tag that probably contains a ] bracket.588 // Grab a bit more of the string to hopefully get all of it..589 if ($close_pos = strpos($text, '"]', $curr_pos + 14))590 {591 if (strpos(substr($text, $curr_pos + 14, $close_pos - ($curr_pos + 14)), '[mod') === false)592 {593 $possible_start = substr($text, $curr_pos, $close_pos - $curr_pos + 7);594 }595 }596 }597 // END Moderator Tags598 // Now compare, either using regexp or not.599 if ($open_is_regexp)600 {601 $match_result = array();602 if (preg_match($open_tag[$i], $possible_start, $match_result))603 {604 $found_start = true;605 $which_start_tag = $match_result[0];606 $start_tag_index = $i;607 break;608 }609 }610 else611 {612 // straightforward string comparison.613 if (0 == strcasecmp($open_tag[$i], $possible_start))614 {615 $found_start = true;616 $which_start_tag = $open_tag[$i];617 $start_tag_index = $i;618 break;619 }620 }621 }622 623 if ($found_start)624 {625 // We have an opening tag.626 // Push its position, the text we matched, and its index in the open_tag array on to the stack, and then keep going to the right.627 $match = array("pos" => $curr_pos, "tag" => $which_start_tag, "index" => $start_tag_index);628 array_push($stack, $match);629 //630 // Rather than just increment $curr_pos631 // Set it to the ending of the tag we just found632 // Keeps error in nested tag from breaking out633 // of table structure..634 //635 $curr_pos += strlen($possible_start);636 }637 else638 {639 // check for a closing tag..640 $possible_end = substr($text, $curr_pos, $close_tag_length);641 if (0 == strcasecmp($close_tag, $possible_end))642 {643 // We have an ending tag.644 // Check if we've already found a matching starting tag.645 if (sizeof($stack) > 0)646 {647 // There exists a starting tag.648 $curr_nesting_depth = sizeof($stack);649 // We need to do 2 replacements now.650 $match = array_pop($stack);651 $start_index = $match['pos'];652 $start_tag = $match['tag'];653 $start_length = strlen($start_tag);654 $start_tag_index = $match['index'];655 656 if ($open_is_regexp)657 {658 $start_tag = preg_replace($open_tag[$start_tag_index], $open_regexp_replace[$start_tag_index], $start_tag);659 }660 661 // everything before the opening tag.662 $before_start_tag = substr($text, 0, $start_index);663 664 // everything after the opening tag, but before the closing tag.665 $between_tags = substr($text, $start_index + $start_length, $curr_pos - $start_index - $start_length);666 667 // Run the given function on the text between the tags..668 if ($use_function_pointer)669 {670 $between_tags = $func($between_tags, $uid);671 }672 673 // everything after the closing tag.674 $after_end_tag = substr($text, $curr_pos + $close_tag_length);675 676 // Mark the lowest nesting level if needed.677 if ($mark_lowest_level && ($curr_nesting_depth == 1))678 {679 if ($open_tag[0] == '[code]')680 {681 $code_entities_match = array('#<#', '#>#', '#"#', '#:#', '#\[#', '#\]#', '#\(#', '#\)#', '#\{#', '#\}#');682 $code_entities_replace = array('<', '>', '"', ':', '[', ']', '(', ')', '{', '}');683 $between_tags = preg_replace($code_entities_match, $code_entities_replace, $between_tags);684 }685 $text = $before_start_tag . substr($start_tag, 0, $start_length - 1) . ":$curr_nesting_depth:$uid]";686 $text .= $between_tags . substr($close_tag_new, 0, $close_tag_new_length - 1) . ":$curr_nesting_depth:$uid]";687 }688 else689 {690 if ($open_tag[0] == '[code]')691 {692 $text = $before_start_tag . '[code]';693 $text .= $between_tags . '[/code]';694 }695 else696 {697 if ($open_is_regexp)698 {699 $text = $before_start_tag . $start_tag;700 }701 else702 {703 $text = $before_start_tag . substr($start_tag, 0, $start_length - 1) . ":$uid]";704 }705 $text .= $between_tags . substr($close_tag_new, 0, $close_tag_new_length - 1) . ":$uid]";706 }707 }708 709 $text .= $after_end_tag;710 711 // Now.. we've screwed up the indices by changing the length of the string.712 // So, if there's anything in the stack, we want to resume searching just after it.713 // otherwise, we go back to the start.714 if (sizeof($stack) > 0)715 {716 $match = array_pop($stack);717 $curr_pos = $match['pos'];718 // bbcode_array_push($stack, $match);719 // ++$curr_pos;720 }721 else722 {723 $curr_pos = 1;724 }725 }726 else727 {728 // No matching start tag found. Increment pos, keep going.729 ++$curr_pos;730 }731 }732 else733 {734 // No starting tag or ending tag.. Increment pos, keep looping.,735 ++$curr_pos;736 }737 }738 }739 } // while740 741 return $text;742 743 } // bbencode_first_pass_pda()744 745 /**746 * Does second-pass bbencoding of the [code] tags. This includes747 * running htmlspecialchars() over the text contained between748 * any pair of [code] tags that are at the first level of749 * nesting. Tags at the first level of nesting are indicated750 * by this format: [code:1:$uid] ... [/code:1:$uid]751 * Other tags are in this format: [code:$uid] ... [/code:$uid]752 */753 function bbencode_second_pass_code($text, $uid, $bbcode_tpl)754 {755 global $lang;756 757 $code_start_html = $bbcode_tpl['code_open'];758 $code_end_html = $bbcode_tpl['code_close'];759 760 // First, do all the 1st-level matches. These need an htmlspecialchars() run,761 // so they have to be handled differently.762 $match_count = preg_match_all("#\[code:1:$uid\](.*?)\[/code:1:$uid\]#si", $text, $matches);763 764 for ($i = 0; $i < $match_count; $i++)765 {766 $before_replace = $matches[1][$i];767 $after_replace = $matches[1][$i];768 769 // Replace 2 spaces with " " so non-tabbed code indents without making huge long lines.770 $after_replace = str_replace(" ", " ", $after_replace);771 // now Replace 2 spaces with " " to catch odd #s of spaces.772 $after_replace = str_replace(" ", " ", $after_replace);773 774 // Replace tabs with " " so tabbed code indents sorta right without making huge long lines.775 $after_replace = str_replace("\t", " ", $after_replace);776 777 // now Replace space occurring at the beginning of a line778 $after_replace = preg_replace("/^ {1}/m", ' ', $after_replace);779 780 $str_to_match = "[code:1:$uid]" . $before_replace . "[/code:1:$uid]";781 782 $replacement = $code_start_html;783 $replacement .= $after_replace;784 $replacement .= $code_end_html;785 786 $text = str_replace($str_to_match, $replacement, $text);787 }788 789 // Now, do all the non-first-level matches. These are simple.790 $text = str_replace("[code:$uid]", $code_start_html, $text);791 $text = str_replace("[/code:$uid]", $code_end_html, $text);792 793 return $text;794 795 } // bbencode_second_pass_code()796 797 /**798 * Rewritten by Nathan Codding - Feb 6, 2001.799 * - Goes through the given string, and replaces xxxx://yyyy with an HTML <a> tag linking800 * to that URL801 * - Goes through the given string, and replaces www.xxxx.yyyy[zzzz] with an HTML <a> tag linking802 * to http://www.xxxx.yyyy[/zzzz]803 * - Goes through the given string, and replaces xxxx@yyyy with an HTML mailto: tag linking804 * to that email address805 * - Only matches these 2 patterns either after a space, or at the beginning of a line806 *807 * Notes: the email one might get annoying - it's easy to make it more restrictive, though.. maybe808 * have it require something like xxxx@yyyy.zzzz or such. We'll see.809 */810 function make_clickable($text)811 {812 $text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text);813 814 // pad it with a space so we can match things at the start of the 1st line.815 $ret = ' ' . $text;816 817 // matches an "xxxx://yyyy" URL at the start of a line, or after a space.818 // xxxx can only be alpha characters.819 // yyyy is anything up to the first space, newline, comma, double quote or <820 $ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]|+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);821 822 // matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing823 // Must contain at least 2 dots. xxxx contains either alphanum, or "-"824 // zzzz is optional.. will contain everything up to the first space, newline,825 // comma, double quote or <.826 $ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]|+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret);827 828 // matches an email@domain type address at the start of a line, or after a space.829 // Note: Only the followed chars are valid; alphanums, "-", "_" and or ".".830 $ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret);831 832 // Remove our padding..833 $ret = substr($ret, 1);834 835 return($ret);836 }837 838 /**839 * Nathan Codding - Feb 6, 2001840 * Reverses the effects of make_clickable(), for use in editpost.841 * - Does not distinguish between "www.xxxx.yyyy" and "http://aaaa.bbbb" type URLs.842 *843 */844 function undo_make_clickable($text)845 {846 $text = preg_replace("#<!-- BBCode auto-link start --><a href=\"(.*?)\" target=\"_blank\">.*?</a><!-- BBCode auto-link end -->#i", "\\1", $text);847 $text = preg_replace("#<!-- BBcode auto-mailto start --><a href=\"mailto:(.*?)\">.*?</a><!-- BBCode auto-mailto end -->#i", "\\1", $text);848 849 return $text;850 851 }852 853 /**854 * This is used to change a [*] tag into a [*:$uid] tag as part855 * of the first-pass bbencoding of [list] tags. It fits the856 * standard required in order to be passed as a variable857 * function into bbencode_first_pass_pda().858 */859 function replace_listitems($text, $uid)860 {861 $text = str_replace("[*]", "[*:$uid]", $text);862 863 return $text;864 }865 866 /**867 * Escapes the "/" character with "\/". This is useful when you need868 * to stick a runtime string into a PREG regexp that is being delimited869 * with slashes.870 */871 function escape_slashes($input)872 {873 $output = str_replace('/', '\/', $input);874 return $output;875 }876 877 /**878 * This function does exactly what the PHP4 function array_push() does879 * however, to keep phpBB compatable with PHP 3 we had to come up with our own880 * method of doing it.881 * This function was deprecated in phpBB 2.0.18882 */883 function bbcode_array_push(&$stack, $value)884 {885 $stack[] = $value;886 return(sizeof($stack));887 }888 889 /**890 * This function does exactly what the PHP4 function array_pop() does891 * however, to keep phpBB compatable with PHP 3 we had to come up with our own892 * method of doing it.893 * This function was deprecated in phpBB 2.0.18894 */895 function bbcode_array_pop(&$stack)896 {897 $arrSize = count($stack);898 $x = 1;899 900 while(list($key, $val) = each($stack))901 {902 if($x < count($stack))903 {904 $tmpArr[] = $val;905 }906 else907 {908 $return_val = $val;909 }910 $x++;911 }912 $stack = $tmpArr;913 914 return($return_val);915 }916 917 67 ?> phpBB2/includes/functions_post.php
r258 r269 1 1 <?php 2 2 /*************************************************************************** 3 * functions_post.php4 * -------------------5 * begin : Saturday, Feb 13, 20016 * copyright : (C) 2001 The phpBB Group7 * email : support@phpbb.com3 * functions_post.php 4 * ------------------- 5 * begin : Saturday, Feb 13, 2001 6 * copyright : (C) 2001 The phpBB Group 7 * email : support@phpbb.com 8 8 * 9 9 * $Id: functions_post.php,v 1.9.2.39 2005/09/18 16:17:20 acydburn Exp $ … … 23 23 if (!defined('IN_PHPBB')) 24 24 { 25 die('Hacking attempt');25 die('Hacking attempt'); 26 26 } 27 27 … … 32 32 $unhtml_specialchars_replace = array('>', '<', '"', '&'); 33 33 34 function prepare_message($message, $html_on, $bbcode_on, $smile_on, $bbcode_uid = 0) 35 { 36 global $config, $html_entities_match, $html_entities_replace; 37 38 // 39 // Clean up the message 40 // 41 42 if ($html_on) 43 { 44 // If HTML is on, we try to make it safe 45 // This approach is quite agressive and anything that does not look like a valid tag 46 // is going to get converted to HTML entities 47 $html_match = '#<[^\w<]*(\w+)((?:"[^"]*"|\'[^\']*\'|[^<>\'"])+)?>#'; 48 $matches = array(); 49 50 $message_split = preg_split($html_match, $message); 51 preg_match_all($html_match, $message, $matches); 52 53 $message = ''; 54 55 foreach ($message_split as $part) 56 { 57 $tag = array(array_shift($matches[0]), array_shift($matches[1]), array_shift($matches[2])); 58 $message .= preg_replace($html_entities_match, $html_entities_replace, $part) . clean_html($tag); 59 } 60 61 $message = str_replace('"', '\"', $message); 62 } 63 //else 64 //{ 65 // $message = preg_replace($html_entities_match, $html_entities_replace, $message); 66 //} 67 68 if($bbcode_on && $bbcode_uid != '') 69 { 70 $message = bbencode_first_pass($message, $bbcode_uid); 71 } 72 73 return $message; 34 function prepare_message($message, $html_on, $bbcode_on, $smile_on) 35 { 36 global $config, $html_entities_match, $html_entities_replace; 37 38 // 39 // Clean up the message 40 // 41 42 if ($html_on) 43 { 44 // If HTML is on, we try to make it safe 45 // This approach is quite agressive and anything that does not look like a valid tag 46 // is going to get converted to HTML entities 47 $html_match = '#<[^\w<]*(\w+)((?:"[^"]*"|\'[^\']*\'|[^<>\'"])+)?>#'; 48 $matches = array(); 49 50 $message_split = preg_split($html_match, $message); 51 preg_match_all($html_match, $message, $matches); 52 53 $message = ''; 54 55 foreach ($message_split as $part) 56 { 57 $tag = array(array_shift($matches[0]), array_shift($matches[1]), array_shift($matches[2])); 58 $message .= preg_replace($html_entities_match, $html_entities_replace, $part) . clean_html($tag); 59 } 60 61 $message = str_replace('"', '\"', $message); 62 } 63 //else 64 //{ 65 // $message = preg_replace($html_entities_match, $html_entities_replace, $message); 66 //} 67 68 return $message; 74 69 } 75 70 76 71 function unprepare_message($message) 77 72 { 78 global $unhtml_specialchars_match, $unhtml_specialchars_replace;79 80 return preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, $message);73 global $unhtml_specialchars_match, $unhtml_specialchars_replace; 74 75 return preg_replace($unhtml_specialchars_match, $unhtml_specialchars_replace, $message); 81 76 } 82 77 // … … 85 80 function submit_merged_post($post_id, $forum_id, $subject, $message, &$return_message, &$return_meta) 86 81 { 87 global $config, $db, $lang, $phpEx, $root_path; 88 89 include($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_merge.' . $phpEx); 90 include($root_path . 'phpBB2/includes/functions_search.'.$phpEx); 91 92 $current_time = time(); 93 94 // Check message 95 if ( empty($message) ) 96 { 97 trigger_error($lang['empty_message']); 98 return; 99 } 100 101 $sql = "SELECT p.post_created, p.post_time, p.enable_html, p.enable_bbcode, p.enable_smilies, pt.* 102 FROM " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE ." pt 103 WHERE p.post_id = $post_id 104 AND pt.post_id = p.post_id"; 105 $result = $db->sql_query($sql); 106 107 $last_post_data = $db->sql_fetchrow($result); 108 109 // Flood control 110 if ( ($current_time - intval($last_post_data['post_time'])) < intval($config['merge_flood_interval']) ) 111 { 112 trigger_error($lang['flood_error']); 113 return; 114 } 115 116 $last_post_created = $last_post_data['post_created']; 117 $last_post_time = $last_post_data['post_time']; 118 $last_html = $last_post_data['enable_html']; 119 $last_bbcode = $last_post_data['enable_bbcode']; 120 $last_smilies = $last_post_data['enable_smilies']; 121 $last_bbcode_uid = $last_post_data['bbcode_uid']; 122 $last_subject = $last_post_data['post_subject']; 123 $last_message = $last_post_data['post_text']; 124 125 $db->sql_freeresult($result); 126 127 if ($last_bbcode_uid != '') 128 { 129 $last_message = preg_replace('/\:(([a-z0-9]:)?)' . $last_bbcode_uid . '/s', '', $last_message); 130 } 131 132 $last_message = unprepare_message($last_message); 133 134 // Preparing separator 135 $merged_after = ($current_time - $last_post_time); 136 $merged_sec = $merged_after % 60; 137 $merged_min = ($merged_after/60) % 60; 138 $merged_hours = ($merged_after/3600) % 24 ; 139 $merged_days = ($merged_after/86400) % 31; 140 141 $s_st = ($merged_sec) ? seconds_st($merged_sec) : ''; 142 $m_st = ($merged_min) ? minutes_st($merged_min) : ''; 143 $h_st = ($merged_hours) ? hours_st($merged_hours) : ''; 144 $d_st = ($merged_days) ? days_st($merged_days) : ''; 145 146 $separator = sprintf($lang['merge_separator'],$d_st,$h_st,$m_st,$s_st); 147 $separator .= ( !empty($subject) && ($subject != $last_subject) ) ? sprintf($lang['merge_post_subject'], $subject) : ''; 148 $separator = str_replace("'", "''", $separator); 149 150 $message = ($message != $last_message) ? htmlspecialchars($last_message) . $separator . trim($message) : trim($message); 151 $message = prepare_message($message, $last_html, $last_bbcode, $last_smilies, $last_bbcode_uid); 152 153 // This replacement was borrowed from posting.php 154 $last_subject = str_replace("\'", "''", $last_subject); 155 $last_message = str_replace("\'", "''", $last_message); 156 157 $sql = "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '" . $db->sql_escape($message) . "' WHERE post_id = $post_id"; 158 $result = $db->sql_query($sql); 159 160 $sql = "UPDATE " . POSTS_TABLE . " SET post_time = $current_time WHERE post_id = $post_id"; 161 $result = $db->sql_query($sql); 162 163 $sql = "UPDATE " . FORUMS_TABLE . " SET forum_last_post_id = $post_id WHERE forum_id = $forum_id"; 164 $result = $db->sql_query($sql); 165 166 // Search routines 167 remove_search_post($post_id); 168 add_search_words('single', $post_id, $message, $subject); 169 170 // Meta & return message 171 $return_meta = '<meta http-equiv="refresh" content="3;url=' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">'; 172 $return_message = $lang['stored'] . '<br /><br />' . sprintf($lang['click_view_message'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id") . '">', '</a>'); 82 global $config, $db, $lang, $phpEx, $root_path; 83 84 include($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_merge.' . $phpEx); 85 include($root_path . 'phpBB2/includes/functions_search.'.$phpEx); 86 87 $current_time = time(); 88 89 // Check message 90 if ( empty($message) ) 91 { 92 trigger_error($lang['empty_message']); 93 return; 94 } 95 96 $sql = "SELECT p.post_created, p.post_time, p.enable_html, p.enable_bbcode, p.enable_smilies, pt.* 97 FROM " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE ." pt 98 WHERE p.post_id = $post_id 99 AND pt.post_id = p.post_id"; 100 $result = $db->sql_query($sql); 101 102 $last_post_data = $db->sql_fetchrow($result); 103 104 // Flood control 105 if ( ($current_time - intval($last_post_data['post_time'])) < intval($config['merge_flood_interval']) ) 106 { 107 trigger_error($lang['flood_error']); 108 return; 109 } 110 111 $last_post_created = $last_post_data['post_created']; 112 $last_post_time = $last_post_data['post_time']; 113 $last_html = $last_post_data['enable_html']; 114 //$last_bbcode = $last_post_data['enable_bbcode']; 115 $last_smilies = $last_post_data['enable_smilies']; 116 117 $last_subject = $last_post_data['post_subject']; 118 $last_message = $last_post_data['post_text']; 119 120 $db->sql_freeresult($result); 121 122 $last_message = unprepare_message($last_message); 123 124 // Preparing separator 125 $merged_after = ($current_time - $last_post_time); 126 $merged_sec = $merged_after % 60; 127 $merged_min = ($merged_after/60) % 60; 128 $merged_hours = ($merged_after/3600) % 24 ; 129 $merged_days = ($merged_after/86400) % 31; 130 131 $s_st = ($merged_sec) ? seconds_st($merged_sec) : ''; 132 $m_st = ($merged_min) ? minutes_st($merged_min) : ''; 133 $h_st = ($merged_hours) ? hours_st($merged_hours) : ''; 134 $d_st = ($merged_days) ? days_st($merged_days) : ''; 135 136 $separator = sprintf($lang['merge_separator'],$d_st,$h_st,$m_st,$s_st); 137 $separator .= ( !empty($subject) && ($subject != $last_subject) ) ? sprintf($lang['merge_post_subject'], $subject) : ''; 138 $separator = str_replace("'", "''", $separator); 139 140 $message = ($message != $last_message) ? htmlspecialchars($last_message) . $separator . trim($message) : trim($message); 141 $message = prepare_message($message, $last_html, 0, $last_smilies); 142 143 // This replacement was borrowed from posting.php 144 $last_subject = str_replace("\'", "''", $last_subject); 145 $last_message = str_replace("\'", "''", $last_message); 146 147 $sql = "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '" . $db->sql_escape($message) . "' WHERE post_id = $post_id"; 148 $result = $db->sql_query($sql); 149 150 $sql = "UPDATE " . POSTS_TABLE . " SET post_time = $current_time WHERE post_id = $post_id"; 151 $result = $db->sql_query($sql); 152 153 $sql = "UPDATE " . FORUMS_TABLE . " SET forum_last_post_id = $post_id WHERE forum_id = $forum_id"; 154 $result = $db->sql_query($sql); 155 156 // Search routines 157 remove_search_post($post_id); 158 add_search_words('single', $post_id, $message, $subject); 159 160 // Meta & return message 161 $return_meta = '<meta http-equiv="refresh" content="3;url=' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">'; 162 $return_message = $lang['stored'] . '<br /><br />' . sprintf($lang['click_view_message'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id") . '">', '</a>'); 173 163 } 174 164 … … 176 166 // Prepare a message for posting 177 167 // 178 function prepare_post(&$mode, &$post_data, &$bbcode_on, &$html_on, &$smilies_on, &$error_msg, &$username, &$ bbcode_uid, &$subject, &$message, &$poll_title, &$poll_options, &$poll_length)179 { 180 global $config, $userdata, $lang, $phpEx, $root_path, $is_auth;181 182 $error_msg = '';168 function prepare_post(&$mode, &$post_data, &$bbcode_on, &$html_on, &$smilies_on, &$error_msg, &$username, &$subject, &$message, &$poll_title, &$poll_options, &$poll_length) 169 { 170 global $config, $userdata, $lang, $phpEx, $root_path, $is_auth; 171 172 $error_msg = ''; 183 173 // Check username 184 if (!empty($username)) 185 { 186 $username = phpbb_clean_username($username); 187 188 if (!$userdata['session_logged_in'] || ($userdata['session_logged_in'] && $username != $userdata['name'])) 189 { 190 require($root_path . 'include/functions_check.'.$phpEx); 191 192 $result = check_username($username); 193 if ($result['error']) 194 { 195 $error_msg .= (!empty($error_msg)) ? '<br />' . $result['error_msg'] : $result['error_msg']; 196 } 197 } 198 else 199 { 200 $username = ''; 201 } 202 } 203 204 // Check subject 205 if (!empty($subject)) 206 { 207 $subject = trim($subject); 208 } 209 else if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) 210 { 211 $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['empty_subject'] : $lang['empty_subject']; 212 } 213 214 // Check message 215 if (!empty($message)) 216 { 217 $bbcode_uid = ($bbcode_on) ? make_bbcode_uid() : ''; 218 $message = prepare_message(trim($message), $html_on, $bbcode_on, $smilies_on, $bbcode_uid); 219 // BEGIN Moderator Tags 220 // Tags [mod] [/mod] are prohibited for everyone except moderators and administrators (post) 221 if ( check_mod_tags($is_auth['auth_mod'], $message) ) 222 { 223 trigger_error($lang['mod_reserved']); 224 } 225 // END Moderator Tags 226 227 } 228 else if ($mode != 'delete' && $mode != 'poll_delete') 229 { 230 $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['empty_message'] : $lang['empty_message']; 231 } 232 233 // 234 // Handle poll stuff 235 // 236 if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) 237 { 238 $poll_length = (isset($poll_length)) ? max(0, intval($poll_length)) : 0; 239 240 if (!empty($poll_title)) 241 { 242 $poll_title = trim($poll_title); 243 } 244 245 if(!empty($poll_options)) 246 { 247 $temp_option_text = array(); 248 while(list($option_id, $option_text) = @each($poll_options)) 249 { 250 $option_text = trim($option_text); 251 if (!empty($option_text)) 252 { 253 $temp_option_text[intval($option_id)] = $option_text; 254 } 255 } 256 $option_text = $temp_option_text; 257 258 if (sizeof($poll_options) < 2) 259 { 260 $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['to_few_poll_options'] : $lang['to_few_poll_options']; 261 } 262 else if (sizeof($poll_options) > $config['max_poll_options']) 263 { 264 $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['to_many_poll_options'] : $lang['to_many_poll_options']; 265 } 266 else if ($poll_title == '') 267 { 268 $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['empty_poll_title'] : $lang['empty_poll_title']; 269 } 270 } 271 } 272 273 if ( !empty($error_msg) ) { 274 trigger_error($error_msg); 275 } 276 277 return; 174 if (!empty($username)) 175 { 176 $username = phpbb_clean_username($username); 177 178 if (!$userdata['session_logged_in'] || ($userdata['session_logged_in'] && $username != $userdata['name'])) 179 { 180 require($root_path . 'include/functions_check.'.$phpEx); 181 182 $result = check_username($username); 183 if ($result['error']) 184 { 185 $error_msg .= (!empty($error_msg)) ? '<br />' . $result['error_msg'] : $result['error_msg']; 186 } 187 } 188 else 189 { 190 $username = ''; 191 } 192 } 193 194 // Check subject 195 if (!empty($subject)) 196 { 197 $subject = trim($subject); 198 } 199 else if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) 200 { 201 $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['empty_subject'] : $lang['empty_subject']; 202 } 203 204 // Check message 205 if (!empty($message)) 206 { 207 $message = prepare_message(trim($message), $html_on, $bbcode_on, $smilies_on); 208 // BEGIN Moderator Tags 209 // Tags [mod] [/mod] are prohibited for everyone except moderators and administrators (post) 210 if ( check_mod_tags($is_auth['auth_mod'], $message) ) 211 { 212 trigger_error($lang['mod_reserved']); 213 } 214 // END Moderator Tags 215 216 } 217 else if ($mode != 'delete' && $mode != 'poll_delete') 218 { 219 $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['empty_message'] : $lang['empty_message']; 220 } 221 222 // 223 // Handle poll stuff 224 // 225 if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) 226 { 227 $poll_length = (isset($poll_length)) ? max(0, intval($poll_length)) : 0; 228 229 if (!empty($poll_title)) 230 { 231 $poll_title = trim($poll_title); 232 } 233 234 if(!empty($poll_options)) 235 { 236 $temp_option_text = array(); 237 while(list($option_id, $option_text) = @each($poll_options)) 238 { 239 $option_text = trim($option_text); 240 if (!empty($option_text)) 241 { 242 $temp_option_text[intval($option_id)] = $option_text; 243 } 244 } 245 $option_text = $temp_option_text; 246 247 if (sizeof($poll_options) < 2) 248 { 249 $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['to_few_poll_options'] : $lang['to_few_poll_options']; 250 } 251 else if (sizeof($poll_options) > $config['max_poll_options']) 252 { 253 $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['to_many_poll_options'] : $lang['to_many_poll_options']; 254 } 255 else if ($poll_title == '') 256 { 257 $error_msg .= (!empty($error_msg)) ? '<br />' . $lang['empty_poll_title'] : $lang['empty_poll_title']; 258 } 259 } 260 } 261 262 if ( !empty($error_msg) ) { 263 trigger_error($error_msg); 264 } 265 266 return; 278 267 } 279 268 … … 281 270 // Post a new topic/reply/poll or edit existing post/poll 282 271 // 283 function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid,$post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length)284 { 285 global $config, $lang, $db, $root_path, $phpEx;286 global $userdata, $user_ip;287 288 include($root_path . 'phpBB2/includes/functions_search.'.$phpEx);289 290 $current_time = time();291 292 if ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost')293 {294 //295 // Flood control296 //297 $where_sql = ($userdata['uid'] == ANONYMOUS) ? "poster_ip = '$user_ip'" : 'poster_id = ' . $userdata['uid'];298 $sql = "SELECT MAX(post_time) AS last_post_time299 FROM " . POSTS_TABLE . "300 WHERE $where_sql";301 if ($result = $db->sql_query($sql))302 {303 if ($row = $db->sql_fetchrow($result))304 {305 if (intval($row['last_post_time']) > 0 && ($current_time - intval($row['last_post_time'])) < intval($config['flood_interval']))306 {307 trigger_error($lang['flood_error']);308 return;309 }310 }311 }312 }313 314 if ($mode == 'editpost')315 {316 remove_search_post($post_id);317 }318 319 if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post']))320 {321 $topic_vote = (!empty($poll_title) && count($poll_options) >= 2) ? 1 : 0;322 323 $sql = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('" . $db->sql_escape($post_subject) . "', " . $userdata['uid'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '" . $db->sql_escape($post_subject) . "', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";324 $db->sql_query($sql);325 326 if ($mode == 'newtopic')327 {328 $topic_id = $db->sql_nextid();329 }330 }331 332 $edited_sql = ($mode == 'editpost' && !$post_data['last_post'] && $post_data['poster_post']) ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : "";333 $sql = ($mode != "editpost") ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, post_created, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $userdata['uid'] . ", '" . $db->sql_escape($post_username) . "', $current_time, $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig)" : "UPDATE " . POSTS_TABLE . " SET post_username = '$post_username', enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" . $edited_sql . " WHERE post_id = $post_id";334 $db->sql_query($sql);335 336 if ($mode != 'editpost')337 {338 $post_id = $db->sql_nextid();339 }340 341 $sql = ($mode != 'editpost') ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text) VALUES ($post_id, '" . $db->sql_escape($post_subject) . "', '$bbcode_uid', '" . $db->sql_escape($post_message) . "')" : "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '" . $db->sql_escape($post_message) . "', bbcode_uid = '$bbcode_uid', post_subject = '" . $db->sql_escape($post_subject) . "' WHERE post_id = $post_id";342 $db->sql_query($sql);343 344 add_search_words('single', $post_id, $post_message, $post_subject);345 346 //347 // Add poll348 //349 if (($mode == 'newtopic' || ($mode == 'editpost' && $post_data['edit_poll'])) && !empty($poll_title) && count($poll_options) >= 2)350 {351 $sql = (!$post_data['has_poll']) ? "INSERT INTO " . VOTE_DESC_TABLE . " (topic_id, vote_text, vote_start, vote_length) VALUES ($topic_id, '$poll_title', $current_time, " . ($poll_length * 86400) . ")" : "UPDATE " . VOTE_DESC_TABLE . " SET vote_text = '$poll_title', vote_length = " . ($poll_length * 86400) . " WHERE topic_id = $topic_id";352 $db->sql_query($sql);353 354 $delete_option_sql = '';355 $old_poll_result = array();356 if ($mode == 'editpost' && $post_data['has_poll'])357 {358 $sql = "SELECT vote_option_id, vote_result359 FROM " . VOTE_RESULTS_TABLE . "360 WHERE vote_id = $poll_id361 ORDER BY vote_option_id ASC";362 $result = $db->sql_query($sql);363 364 while ($row = $db->sql_fetchrow($result))365 {366 $old_poll_result[$row['vote_option_id']] = $row['vote_result'];367 368 if (!isset($poll_options[$row['vote_option_id']]))369 {370 $delete_option_sql .= ($delete_option_sql != '') ? ', ' . $row['vote_option_id'] : $row['vote_option_id'];371 }372 }373 }374 else375 {376 $poll_id = $db->sql_nextid();377 }378 379 @reset($poll_options);380 381 $poll_option_id = 1;382 while (list($option_id, $option_text) = each($poll_options))383 {384 if (!empty($option_text))385 {386 $option_text = str_replace("\'", "''", $option_text);387 $poll_result = ($mode == "editpost" && isset($old_poll_result[$option_id])) ? $old_poll_result[$option_id] : 0;388 389 $sql = ($mode != "editpost" || !isset($old_poll_result[$option_id])) ? "INSERT INTO " . VOTE_RESULTS_TABLE . " (vote_id, vote_option_id, vote_option_text, vote_result) VALUES ($poll_id, $poll_option_id, '$option_text', $poll_result)" : "UPDATE " . VOTE_RESULTS_TABLE . " SET vote_option_text = '$option_text', vote_result = $poll_result WHERE vote_option_id = $option_id AND vote_id = $poll_id";390 $db->sql_query($sql);391 $poll_option_id++;392 }393 }394 395 if ($delete_option_sql != '')396 {397 $sql = "DELETE FROM " . VOTE_RESULTS_TABLE . "398 WHERE vote_option_id IN ($delete_option_sql)399 AND vote_id = $poll_id";400 $db->sql_query($sql);401 }402 }403 404 //$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">';405 $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">';406 //$message = $lang['stored'] . '<br /><br />' . sprintf($lang['click_view_message'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');407 $message = $lang['stored'] . '<br /><br />' . sprintf($lang['click_view_message'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');408 409 return false;272 function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length) 273 { 274 global $config, $lang, $db, $root_path, $phpEx; 275 global $userdata, $user_ip; 276 277 include($root_path . 'phpBB2/includes/functions_search.'.$phpEx); 278 279 $current_time = time(); 280 281 if ($mode == 'newtopic' || $mode == 'reply' || $mode == 'editpost') 282 { 283 // 284 // Flood control 285 // 286 $where_sql = ($userdata['uid'] == ANONYMOUS) ? "poster_ip = '$user_ip'" : 'poster_id = ' . $userdata['uid']; 287 $sql = "SELECT MAX(post_time) AS last_post_time 288 FROM " . POSTS_TABLE . " 289 WHERE $where_sql"; 290 if ($result = $db->sql_query($sql)) 291 { 292 if ($row = $db->sql_fetchrow($result)) 293 { 294 if (intval($row['last_post_time']) > 0 && ($current_time - intval($row['last_post_time'])) < intval($config['flood_interval'])) 295 { 296 trigger_error($lang['flood_error']); 297 return; 298 } 299 } 300 } 301 } 302 303 if ($mode == 'editpost') 304 { 305 remove_search_post($post_id); 306 } 307 308 if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post'])) 309 { 310 $topic_vote = (!empty($poll_title) && count($poll_options) >= 2) ? 1 : 0; 311 312 $sql = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('" . $db->sql_escape($post_subject) . "', " . $userdata['uid'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '" . $db->sql_escape($post_subject) . "', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id"; 313 $db->sql_query($sql); 314 315 if ($mode == 'newtopic') 316 { 317 $topic_id = $db->sql_nextid(); 318 } 319 } 320 321 $edited_sql = ($mode == 'editpost' && !$post_data['last_post'] && $post_data['poster_post']) ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : ""; 322 $sql = ($mode != "editpost") ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, post_created, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $userdata['uid'] . ", '" . $db->sql_escape($post_username) . "', $current_time, $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig)" : "UPDATE " . POSTS_TABLE . " SET post_username = '$post_username', enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" . $edited_sql . " WHERE post_id = $post_id"; 323 $db->sql_query($sql); 324 325 if ($mode != 'editpost') 326 { 327 $post_id = $db->sql_nextid(); 328 } 329 330 $sql = ($mode != 'editpost') ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, post_text) VALUES ($post_id, '" . $db->sql_escape($post_subject) . "', '" . $db->sql_escape($post_message) . "')" : "UPDATE " . POSTS_TEXT_TABLE . " SET post_text = '" . $db->sql_escape($post_message) . "', post_subject = '" . $db->sql_escape($post_subject) . "' WHERE post_id = $post_id"; 331 $db->sql_query($sql); 332 333 add_search_words('single', $post_id, $post_message, $post_subject); 334 335 // 336 // Add poll 337 // 338 if (($mode == 'newtopic' || ($mode == 'editpost' && $post_data['edit_poll'])) && !empty($poll_title) && count($poll_options) >= 2) 339 { 340 $sql = (!$post_data['has_poll']) ? "INSERT INTO " . VOTE_DESC_TABLE . " (topic_id, vote_text, vote_start, vote_length) VALUES ($topic_id, '$poll_title', $current_time, " . ($poll_length * 86400) . ")" : "UPDATE " . VOTE_DESC_TABLE . " SET vote_text = '$poll_title', vote_length = " . ($poll_length * 86400) . " WHERE topic_id = $topic_id"; 341 $db->sql_query($sql); 342 343 $delete_option_sql = ''; 344 $old_poll_result = array(); 345 if ($mode == 'editpost' && $post_data['has_poll']) 346 { 347 $sql = "SELECT vote_option_id, vote_result 348 FROM " . VOTE_RESULTS_TABLE . " 349 WHERE vote_id = $poll_id 350 ORDER BY vote_option_id ASC"; 351 $result = $db->sql_query($sql); 352 353 while ($row = $db->sql_fetchrow($result)) 354 { 355 $old_poll_result[$row['vote_option_id']] = $row['vote_result']; 356 357 if (!isset($poll_options[$row['vote_option_id']])) 358 { 359 $delete_option_sql .= ($delete_option_sql != '') ? ', ' . $row['vote_option_id'] : $row['vote_option_id']; 360 } 361 } 362 } 363 else 364 { 365 $poll_id = $db->sql_nextid(); 366 } 367 368 @reset($poll_options); 369 370 $poll_option_id = 1; 371 while (list($option_id, $option_text) = each($poll_options)) 372 { 373 if (!empty($option_text)) 374 { 375 $option_text = str_replace("\'", "''", $option_text); 376 $poll_result = ($mode == "editpost" && isset($old_poll_result[$option_id])) ? $old_poll_result[$option_id] : 0; 377 378 $sql = ($mode != "editpost" || !isset($old_poll_result[$option_id])) ? "INSERT INTO " . VOTE_RESULTS_TABLE . " (vote_id, vote_option_id, vote_option_text, vote_result) VALUES ($poll_id, $poll_option_id, '$option_text', $poll_result)" : "UPDATE " . VOTE_RESULTS_TABLE . " SET vote_option_text = '$option_text', vote_result = $poll_result WHERE vote_option_id = $option_id AND vote_id = $poll_id"; 379 $db->sql_query($sql); 380 $poll_option_id++; 381 } 382 } 383 384 if ($delete_option_sql != '') 385 { 386 $sql = "DELETE FROM " . VOTE_RESULTS_TABLE . " 387 WHERE vote_option_id IN ($delete_option_sql) 388 AND vote_id = $poll_id"; 389 $db->sql_query($sql); 390 } 391 } 392 393 //$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">'; 394 $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">'; 395 //$message = $lang['stored'] . '<br /><br />' . sprintf($lang['click_view_message'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>'); 396 $message = $lang['stored'] . '<br /><br />' . sprintf($lang['click_view_message'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=" . $post_id) . '#' . $post_id . '">', '</a>') . '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id") . '">', '</a>'); 397 398 return false; 410 399 } 411 400 … … 415 404 function update_post_stats(&$mode, &$post_data, &$forum_id, &$topic_id, &$post_id, &$user_id) 416 405 { 417 global $db;418 419 $sign = ($mode == 'delete') ? '- 1' : '+ 1';420 $forum_update_sql = "forum_posts = forum_posts $sign";421 $topic_update_sql = '';422 423 if ($mode == 'delete')424 {425 if ($post_data['last_post'])426 {427 if ($post_data['first_post'])428 {429 $forum_update_sql .= ', forum_topics = forum_topics - 1';430 }431 else432 {433 434 $topic_update_sql .= 'topic_replies = topic_replies - 1';435 436 $sql = "SELECT MAX(post_id) AS last_post_id437 FROM " . POSTS_TABLE . "438 WHERE topic_id = $topic_id";439 $result = $db->sql_query($sql);440 441 if ($row = $db->sql_fetchrow($result))442 {443 $topic_update_sql .= ', topic_last_post_id = ' . $row['last_post_id'];444 }445 }446 447 if ($post_data['last_topic'])448 {449 $sql = "SELECT MAX(post_id) AS last_post_id450 FROM " . POSTS_TABLE . "451 WHERE forum_id = $forum_id";452 $result = $db->sql_query($sql);453 454 if ($row = $db->sql_fetchrow($result))455 {456 $forum_update_sql .= ($row['last_post_id']) ? ', forum_last_post_id = ' . $row['last_post_id'] : ', forum_last_post_id = 0';457 }458 }459 }460 else if ($post_data['first_post'])461 {462 $sql = "SELECT MIN(post_id) AS first_post_id463 FROM " . POSTS_TABLE . "464 WHERE topic_id = $topic_id";465 $result = $db->sql_query($sql);466 467 if ($row = $db->sql_fetchrow($result))468 {469 $topic_update_sql .= 'topic_replies = topic_replies - 1, topic_first_post_id = ' . $row['first_post_id'];470 }471 }472 else473 {474 $topic_update_sql .= 'topic_replies = topic_replies - 1';475 }476 }477 else if ($mode != 'poll_delete')478 {479 $forum_update_sql .= ", forum_last_post_id = $post_id" . (($mode == 'newtopic') ? ", forum_topics = forum_topics $sign" : "");480 $topic_update_sql = "topic_last_post_id = $post_id" . (($mode == 'reply') ? ", topic_replies = topic_replies $sign" : ", topic_first_post_id = $post_id");481 }482 else483 {484 $topic_update_sql .= 'topic_vote = 0';485 }486 487 if ($mode != 'poll_delete')488 {489 $sql = "UPDATE " . FORUMS_TABLE . " SET490 $forum_update_sql491 WHERE forum_id = $forum_id";492 $db->sql_query($sql);493 }494 if ($topic_update_sql != '')495 {496 $sql = "UPDATE " . TOPICS_TABLE . " SET497 $topic_update_sql498 WHERE topic_id = $topic_id";499 $db->sql_query($sql);500 }501 502 if ($mode != 'poll_delete')503 {504 $sql = "UPDATE " . USERS_TABLE . "505 SET user_posts = user_posts $sign506 WHERE uid = $user_id";507 $db->sql_query($sql);508 }509 510 return;406 global $db; 407 408 $sign = ($mode == 'delete') ? '- 1' : '+ 1'; 409 $forum_update_sql = "forum_posts = forum_posts $sign"; 410 $topic_update_sql = ''; 411 412 if ($mode == 'delete') 413 { 414 if ($post_data['last_post']) 415 { 416 if ($post_data['first_post']) 417 { 418 $forum_update_sql .= ', forum_topics = forum_topics - 1'; 419 } 420 else 421 { 422 423 $topic_update_sql .= 'topic_replies = topic_replies - 1'; 424 425 $sql = "SELECT MAX(post_id) AS last_post_id 426 FROM " . POSTS_TABLE . " 427 WHERE topic_id = $topic_id"; 428 $result = $db->sql_query($sql); 429 430 if ($row = $db->sql_fetchrow($result)) 431 { 432 $topic_update_sql .= ', topic_last_post_id = ' . $row['last_post_id']; 433 } 434 } 435 436 if ($post_data['last_topic']) 437 { 438 $sql = "SELECT MAX(post_id) AS last_post_id 439 FROM " . POSTS_TABLE . " 440 WHERE forum_id = $forum_id"; 441 $result = $db->sql_query($sql); 442 443 if ($row = $db->sql_fetchrow($result)) 444 { 445 $forum_update_sql .= ($row['last_post_id']) ? ', forum_last_post_id = ' . $row['last_post_id'] : ', forum_last_post_id = 0'; 446 } 447 } 448 } 449 else if ($post_data['first_post']) 450 { 451 $sql = "SELECT MIN(post_id) AS first_post_id 452 FROM " . POSTS_TABLE . " 453 WHERE topic_id = $topic_id"; 454 $result = $db->sql_query($sql); 455 456 if ($row = $db->sql_fetchrow($result)) 457 { 458 $topic_update_sql .= 'topic_replies = topic_replies - 1, topic_first_post_id = ' . $row['first_post_id']; 459 } 460 } 461 else 462 { 463 $topic_update_sql .= 'topic_replies = topic_replies - 1'; 464 } 465 } 466 else if ($mode != 'poll_delete') 467 { 468 $forum_update_sql .= ", forum_last_post_id = $post_id" . (($mode == 'newtopic') ? ", forum_topics = forum_topics $sign" : ""); 469 $topic_update_sql = "topic_last_post_id = $post_id" . (($mode == 'reply') ? ", topic_replies = topic_replies $sign" : ", topic_first_post_id = $post_id"); 470 } 471 else 472 { 473 $topic_update_sql .= 'topic_vote = 0'; 474 } 475 476 if ($mode != 'poll_delete') 477 { 478 $sql = "UPDATE " . FORUMS_TABLE . " SET 479 $forum_update_sql 480 WHERE forum_id = $forum_id"; 481 $db->sql_query($sql); 482 } 483 if ($topic_update_sql != '') 484 { 485 $sql = "UPDATE " . TOPICS_TABLE . " SET 486 $topic_update_sql 487 WHERE topic_id = $topic_id"; 488 $db->sql_query($sql); 489 } 490 491 if ($mode != 'poll_delete') 492 { 493 $sql = "UPDATE " . USERS_TABLE . " 494 SET user_posts = user_posts $sign 495 WHERE uid = $user_id"; 496 $db->sql_query($sql); 497 } 498 499 return; 511 500 } 512 501 … … 516 505 function delete_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id) 517 506 { 518 global $config, $lang, $db, $root_path, $phpEx;519 global $userdata, $user_ip;520 521 $forum_update_sql = '';522 523 if ($mode != 'poll_delete')524 {525 include($root_path . 'phpBB2/includes/functions_search.'.$phpEx);526 527 $sql = "DELETE FROM " . POSTS_TABLE . "528 WHERE post_id = $post_id";529 $db->sql_query($sql);530 531 $sql = "DELETE FROM " . POSTS_TEXT_TABLE . "532 WHERE post_id = $post_id";533 $db->sql_query($sql);534 535 $sql = 'DELETE FROM ' . SIMPATY_TABLE . ' WHERE simpid = ' . $post_id . ' AND type = ' . SIMPATY_FORUM_POST;536 $db->sql_query($sql);537 538 if ($post_data['last_post'])539 {540 if ($post_data['first_post'])541 {542 $forum_update_sql .= ', forum_topics = forum_topics - 1';543 $sql = "DELETE FROM " . TOPICS_TABLE . "544 WHERE topic_id = $topic_id545 OR topic_moved_id = $topic_id";546 $db->sql_query($sql);547 548 $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . "549 WHERE topic_id = $topic_id";550 $db->sql_query($sql);551 }552 }553 554 remove_search_post($post_id);555 }556 557 if ($mode == 'poll_delete' || ($mode == 'delete' && $post_data['first_post'] && $post_data['last_post']) && $post_data['has_poll'] && $post_data['edit_poll'])558 {559 $sql = "DELETE FROM " . VOTE_DESC_TABLE . "560 WHERE topic_id = $topic_id";561 $db->sql_query($sql);562 563 $sql = "DELETE FROM " . VOTE_RESULTS_TABLE . "564 WHERE vote_id = $poll_id";565 $db->sql_query($sql);566 567 $sql = "DELETE FROM " . VOTE_USERS_TABLE . "568 WHERE vote_id = $poll_id";569 $db->sql_query($sql);570 }571 572 if ($mode == 'delete' && $post_data['first_post'] && $post_data['last_post'])573 {574 //$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $forum_id) . '">';575 $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . '=' . $forum_id) . '">';576 $message = $lang['deleted'];577 }578 else579 {580 //$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $topic_id) . '">';581 $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . '=' . $topic_id) . '">';582 //$message = (($mode == 'poll_delete') ? $lang['poll_delete'] : $lang['deleted']) . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');583 $message = (($mode == 'poll_delete') ? $lang['poll_delete'] : $lang['deleted']) . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>');584 }585 586 //$message .= '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');587 $message .= '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id") . '">', '</a>');588 589 return;507 global $config, $lang, $db, $root_path, $phpEx; 508 global $userdata, $user_ip; 509 510 $forum_update_sql = ''; 511 512 if ($mode != 'poll_delete') 513 { 514 include($root_path . 'phpBB2/includes/functions_search.'.$phpEx); 515 516 $sql = "DELETE FROM " . POSTS_TABLE . " 517 WHERE post_id = $post_id"; 518 $db->sql_query($sql); 519 520 $sql = "DELETE FROM " . POSTS_TEXT_TABLE . " 521 WHERE post_id = $post_id"; 522 $db->sql_query($sql); 523 524 $sql = 'DELETE FROM ' . SIMPATY_TABLE . ' WHERE simpid = ' . $post_id . ' AND type = ' . SIMPATY_FORUM_POST; 525 $db->sql_query($sql); 526 527 if ($post_data['last_post']) 528 { 529 if ($post_data['first_post']) 530 { 531 $forum_update_sql .= ', forum_topics = forum_topics - 1'; 532 $sql = "DELETE FROM " . TOPICS_TABLE . " 533 WHERE topic_id = $topic_id 534 OR topic_moved_id = $topic_id"; 535 $db->sql_query($sql); 536 537 $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " 538 WHERE topic_id = $topic_id"; 539 $db->sql_query($sql); 540 } 541 } 542 543 remove_search_post($post_id); 544 } 545 546 if ($mode == 'poll_delete' || ($mode == 'delete' && $post_data['first_post'] && $post_data['last_post']) && $post_data['has_poll'] && $post_data['edit_poll']) 547 { 548 $sql = "DELETE FROM " . VOTE_DESC_TABLE . " 549 WHERE topic_id = $topic_id"; 550 $db->sql_query($sql); 551 552 $sql = "DELETE FROM " . VOTE_RESULTS_TABLE . " 553 WHERE vote_id = $poll_id"; 554 $db->sql_query($sql); 555 556 $sql = "DELETE FROM " . VOTE_USERS_TABLE . " 557 WHERE vote_id = $poll_id"; 558 $db->sql_query($sql); 559 } 560 561 if ($mode == 'delete' && $post_data['first_post'] && $post_data['last_post']) 562 { 563 //$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . '=' . $forum_id) . '">'; 564 $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . '=' . $forum_id) . '">'; 565 $message = $lang['deleted']; 566 } 567 else 568 { 569 //$meta = '<meta http-equiv="refresh" content="3;url=' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . '=' . $topic_id) . '">'; 570 $meta = '<meta http-equiv="refresh" content="3;url=' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . '=' . $topic_id) . '">'; 571 //$message = (($mode == 'poll_delete') ? $lang['poll_delete'] : $lang['deleted']) . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>'); 572 $message = (($mode == 'poll_delete') ? $lang['poll_delete'] : $lang['deleted']) . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id") . '">', '</a>'); 573 } 574 575 //$message .= '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id") . '">', '</a>'); 576 $message .= '<br /><br />' . sprintf($lang['click_return_forum'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id") . '">', '</a>'); 577 578 return; 590 579 } 591 580 … … 595 584 function user_notification($mode, &$post_data, &$topic_title, &$forum_id, &$topic_id, &$post_id, &$notify_user) 596 585 { 597 global $config, $lang, $db, $root_path, $phpEx, $cache; 598 global $userdata, $user_ip; 599 600 $current_time = time(); 601 602 if ($mode != 'delete') 603 { 604 if ($mode == 'reply') 605 { 606 607 $sql = "SELECT u.uid, u.email, u.language 608 FROM " . TOPICS_WATCH_TABLE . " tw, " . USERS_TABLE . " u 609 WHERE tw.topic_id = $topic_id 610 AND tw.user_id NOT IN (" . $userdata['uid'] . ", " . ANONYMOUS . ") 611 AND tw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . " 612 AND u.uid = tw.user_id 613 AND u.enabled = 1"; 614 $result = $db->sql_query($sql); 615 616 $update_watched_sql = ''; 617 $bcc_list_ary = array(); 618 619 if ($row = $db->sql_fetchrow($result)) 620 { 621 // Sixty second limit 622 @set_time_limit(60); 623 624 do 625 { 626 if ($row['email'] != '') 627 { 628 $bcc_list_ary[$row['language']][] = $row['email']; 629 } 630 $update_watched_sql .= ($update_watched_sql != '') ? ', ' . $row['uid'] : $row['uid']; 631 } 632 while ($row = $db->sql_fetchrow($result)); 633 634 if (sizeof($bcc_list_ary)) 635 { 636 include_once($root_path . 'include/functions_messenger.php'); 637 $messenger = new messenger(true); 638 639 $topic_title = censor_text(unprepare_message($topic_title)); 640 641 @reset($bcc_list_ary); 642 while (list($user_lang, $bcc_list) = each($bcc_list_ary)) 643 { 644 for ($i = 0; $i < sizeof($bcc_list); $i++) 645 { 646 $messenger->template('topic_notify', $user_lang); 647 $messenger->to($bcc_list[$i], $bcc_list[$i]); 648 $messenger->assign_vars(array( 649 'SITENAME' => $config['sitename'], 650 'TOPIC_TITLE' => $topic_title, 651 'U_TOPIC' => generate_base_url() . "/phpbb2.php?page=viewtopic&" . POST_POST_URL . "=$post_id#$post_id", 652 'U_STOP_WATCHING_TOPIC' => generate_base_url() . "/phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id&unwatch=topic") 653 654 ); 655 $messenger->send(NOTIFY_EMAIL); 656 } 657 } 658 $messenger->save_queue(); 659 } 660 } 661 $db->sql_freeresult($result); 662 663 if ($update_watched_sql != '') 664 { 665 $sql = "UPDATE " . TOPICS_WATCH_TABLE . " 666 SET notify_status = " . TOPIC_WATCH_NOTIFIED . " 667 WHERE topic_id = $topic_id 668 AND user_id IN ($update_watched_sql)"; 669 $db->sql_query($sql); 670 } 671 } 672 673 $sql = "SELECT topic_id 674 FROM " . TOPICS_WATCH_TABLE . " 675 WHERE topic_id = $topic_id 676 AND user_id = " . $userdata['uid']; 677 $result = $db->sql_query($sql); 678 679 $row = $db->sql_fetchrow($result); 680 681 if (!$notify_user && !empty($row['topic_id'])) 682 { 683 $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " 684 WHERE topic_id = $topic_id 685 AND user_id = " . $userdata['uid']; 686 $db->sql_query($sql); 687 } 688 else if ($notify_user && empty($row['topic_id'])) 689 { 690 $sql = "INSERT INTO " . TOPICS_WATCH_TABLE . " (user_id, topic_id, notify_status) 691 VALUES (" . $userdata['uid'] . ", $topic_id, 0)"; 692 $db->sql_query($sql); 693 } 694 } 586 global $config, $lang, $db, $root_path, $phpEx, $cache; 587 global $userdata, $user_ip; 588 // www.phpBB-SEO.com SEO TOOLKIT BEGIN 589 global $seo; 590 // www.phpBB-SEO.com SEO TOOLKIT END 591 592 $current_time = time(); 593 594 if ($mode != 'delete') 595 { 596 if ($mode == 'reply') 597 { 598 599 $sql = "SELECT u.uid, u.email, u.language 600 FROM " . TOPICS_WATCH_TABLE . " tw, " . USERS_TABLE . " u 601 WHERE tw.topic_id = $topic_id 602 AND tw.user_id NOT IN (" . $userdata['uid'] . ", " . ANONYMOUS . ") 603 AND tw.notify_status = " . TOPIC_WATCH_UN_NOTIFIED . " 604 AND u.uid = tw.user_id 605 AND u.enabled = 1"; 606 $result = $db->sql_query($sql); 607 608 $update_watched_sql = ''; 609 $bcc_list_ary = array(); 610 611 if ($row = $db->sql_fetchrow($result)) 612 { 613 // Sixty second limit 614 @set_time_limit(60); 615 $base_url = generate_base_url(); 616 617 do 618 { 619 if ($row['email'] != '') 620 { 621 $bcc_list_ary[$row['language']][] = $row['email']; 622 } 623 $update_watched_sql .= ($update_watched_sql != '') ? ', ' . $row['uid'] : $row['uid']; 624 } 625 while ($row = $db->sql_fetchrow($result)); 626 627 if (sizeof($bcc_list_ary)) 628 { 629 include_once($root_path . 'include/functions_messenger.php'); 630 $messenger = new messenger(true); 631 632 $topic_title = censor_text(unprepare_message($topic_title)); 633 634 @reset($bcc_list_ary); 635 while (list($user_lang, $bcc_list) = each($bcc_list_ary)) 636 { 637 for ($i = 0; $i < sizeof($bcc_list); $i++) 638 { 639 // www.phpBB-SEO.com SEO TOOLKIT BEGIN 640 if ( $config['mod_rewrite_enabled'] ) { 641 $seo->set_url(htmlspecialchars_decode($topic_title), $topic_id, $seo->seo_static['topic']); 642 643 $u_topic = append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=$post_id#$post_id", false, false); 644 $u_topic = $seo->drop_sid($u_topic); 645 646 $u_stop_watching_topic = append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id&unwatch=topic", false, false); 647 $u_stop_watching_topic = $seo->drop_sid($u_stop_watching_topic); 648 } 649 // www.phpBB-SEO.com SEO TOOLKIT END 650 else { 651 $u_topic = $base_url . "phpbb2.php?page=viewtopic&" . POST_POST_URL . "=$post_id#$post_id"; 652 $u_stop_watching_topic = $base_url . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id&unwatch=topic"; 653 } 654 655 $messenger->template('topic_notify', $user_lang); 656 657 $messenger->to($bcc_list[$i], $bcc_list[$i]); 658 659 $messenger->assign_vars(array( 660 'SITENAME' => $config['sitename'], 661 'TOPIC_TITLE' => $topic_title, 662 'U_TOPIC' => $u_topic, 663 'U_STOP_WATCHING_TOPIC' => $u_stop_watching_topic 664 )); 665 666 $messenger->send(NOTIFY_EMAIL); 667 } 668 } 669 $messenger->save_queue(); 670 } 671 } 672 $db->sql_freeresult($result); 673 674 if ($update_watched_sql != '') 675 { 676 $sql = "UPDATE " . TOPICS_WATCH_TABLE . " 677 SET notify_status = " . TOPIC_WATCH_NOTIFIED . " 678 WHERE topic_id = $topic_id 679 AND user_id IN ($update_watched_sql)"; 680 $db->sql_query($sql); 681 } 682 } 683 684 $sql = "SELECT topic_id 685 FROM " . TOPICS_WATCH_TABLE . " 686 WHERE topic_id = $topic_id 687 AND user_id = " . $userdata['uid']; 688 $result = $db->sql_query($sql); 689 690 $row = $db->sql_fetchrow($result); 691 692 if (!$notify_user && !empty($row['topic_id'])) 693 { 694 $sql = "DELETE FROM " . TOPICS_WATCH_TABLE . " 695 WHERE topic_id = $topic_id 696 AND user_id = " . $userdata['uid']; 697 $db->sql_query($sql); 698 } 699 else if ($notify_user && empty($row['topic_id'])) 700 { 701 $sql = "INSERT INTO " . TOPICS_WATCH_TABLE . " (user_id, topic_id, notify_status) 702 VALUES (" . $userdata['uid'] . ", $topic_id, 0)"; 703 $db->sql_query($sql); 704 } 705 } 695 706 } 696 707 … … 702 713 function clean_html($tag) 703 714 { 704 global $config;705 706 if (empty($tag[0]))707 {708 return '';709 }710 711 $allowed_html_tags = preg_split('/, */', utf_strtolower($config['allow_html_tags']));712 $disallowed_attributes = '/^(?:style|on)/i';713 714 // Check if this is an end tag715 preg_match('/<[^\w\/]*\/[\W]*(\w+)/', $tag[0], $matches);716 if (sizeof($matches))717 {718 if (in_array(utf_strtolower($matches[1]), $allowed_html_tags))719 {720 return '</' . $matches[1] . '>';721 }722 else723 {724 return htmlspecialchars('</' . $matches[1] . '>');725 }726 }727 728 // Check if this is an allowed tag729 if (in_array(utf_strtolower($tag[1]), $allowed_html_tags))730 {731 $attributes = '';732 if (!empty($tag[2]))733 {734 preg_match_all('/[\W]*?(\w+)[\W]*?=[\W]*?(["\'])((?:(?!\2).)*)\2/', $tag[2], $test);735 for ($i = 0; $i < sizeof($test[0]); $i++)736 {737 if (preg_match($disallowed_attributes, $test[1][$i]))738 {739 continue;740 }741 $attributes .= ' ' . $test[1][$i] . '=' . $test[2][$i] . str_replace(array('[', ']'), array('[', ']'), htmlspecialchars($test[3][$i])) . $test[2][$i];742 }743 }744 if (in_array(utf_strtolower($tag[1]), $allowed_html_tags))745 {746 return '<' . $tag[1] . $attributes . '>';747 }748 else749 {750 return htmlspecialchars('<' . $tag[1] . $attributes . '>');751 }752 }753 // Finally, this is not an allowed tag so strip all the attibutes and escape it754 else755 {756 return htmlspecialchars('<' . $tag[1] . '>');757 }715 global $config; 716 717 if (empty($tag[0])) 718 { 719 return ''; 720 } 721 722 $allowed_html_tags = preg_split('/, */', utf_strtolower($config['allow_html_tags'])); 723 $disallowed_attributes = '/^(?:style|on)/i'; 724 725 // Check if this is an end tag 726 preg_match('/<[^\w\/]*\/[\W]*(\w+)/', $tag[0], $matches); 727 if (sizeof($matches)) 728 { 729 if (in_array(utf_strtolower($matches[1]), $allowed_html_tags)) 730 { 731 return '</' . $matches[1] . '>'; 732 } 733 else 734 { 735 return htmlspecialchars('</' . $matches[1] . '>'); 736 } 737 } 738 739 // Check if this is an allowed tag 740 if (in_array(utf_strtolower($tag[1]), $allowed_html_tags)) 741 { 742 $attributes = ''; 743 if (!empty($tag[2])) 744 { 745 preg_match_all('/[\W]*?(\w+)[\W]*?=[\W]*?(["\'])((?:(?!\2).)*)\2/', $tag[2], $test); 746 for ($i = 0; $i < sizeof($test[0]); $i++) 747 { 748 if (preg_match($disallowed_attributes, $test[1][$i])) 749 { 750 continue; 751 } 752 $attributes .= ' ' . $test[1][$i] . '=' . $test[2][$i] . str_replace(array('[', ']'), array('[', ']'), htmlspecialchars($test[3][$i])) . $test[2][$i]; 753 } 754 } 755 if (in_array(utf_strtolower($tag[1]), $allowed_html_tags)) 756 { 757 return '<' . $tag[1] . $attributes . '>'; 758 } 759 else 760 { 761 return htmlspecialchars('<' . $tag[1] . $attributes . '>'); 762 } 763 } 764 // Finally, this is not an allowed tag so strip all the attibutes and escape it 765 else 766 { 767 return htmlspecialchars('<' . $tag[1] . '>'); 768 } 758 769 } 759 770 phpBB2/includes/topic_review.php
r266 r269 27 27 global $userdata, $user_ip; 28 28 global $starttime; 29 global $bb_code; 29 30 30 31 if ( !$is_inline_review ) … … 86 87 } 87 88 89 if ( !isset($bb_code) ) { 90 $bb_code = new bbcode; 91 } 92 88 93 // 89 94 // Go ahead and pull all data for this topic 90 95 // 91 $sql = "SELECT u.name AS username, u.uid, p.*, pt.post_text, pt.post_subject , pt.bbcode_uid96 $sql = "SELECT u.name AS username, u.uid, p.*, pt.post_text, pt.post_subject 92 97 FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt 93 98 WHERE p.topic_id = $topic_id … … 132 137 133 138 $message = $row['post_text']; 134 $bbcode_uid = $row['bbcode_uid'];135 139 136 140 // … … 143 147 } 144 148 145 if ( $bbcode_uid != "" ) 146 { 147 $message = ( $config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message); 148 } 149 150 $message = make_clickable($message); 149 $bb_code->parse($message); 150 $message = $bb_code->get_html(); 151 151 152 152 $post_subject = censor_text($post_subject); 153 153 $message = censor_text($message); 154 155 if ( $config['allow_smilies'] && $row['enable_smilies'] )156 {157 $message = smilies_pass($message);158 }159 154 160 155 $message = str_replace("\n", '<br />', $message); phpBB2/index.php
r266 r269 399 399 $forum_data[$j]['topic_title'] = unprepare_message($forum_data[$j]['topic_title']); 400 400 $forum_data[$j]['topic_title'] = split_string($forum_data[$j]['topic_title'], 20); 401 $last_post_time = "<b>" . $lang[' posted'] . "</b>: " . create_date($forum_data[$j]['post_time']);401 $last_post_time = "<b>" . $lang['added'] . "</b>: " . create_date($forum_data[$j]['post_time']); 402 402 $last_post = $last_post_time . '<br />'; 403 403 $last_post .= ( $forum_data[$j]['uid'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? "<b>" . $lang['poster'] . "</b>: " . $forum_data[$j]['post_username'] : "<b>" . $lang['poster']. "</b>: " . $lang['guest']) : "<b>" . $lang['poster'] . "</b>: " . get_user_class_color($forum_data[$j]['class'],$forum_data[$j]['username']); phpBB2/modcp.php
r266 r269 38 38 include($root_path . 'phpBB2/includes/bbcode.'.$phpEx); 39 39 require($root_path . 'include/functions_admin.'.$phpEx); 40 include($root_path . 'include/ functions_post.'.$phpEx);40 include($root_path . 'include/bbcode/bbcode.lib.php'); 41 41 42 42 // … … 122 122 123 123 // session id check 124 if (!empty($_POST['sid']) || !empty($_GET['sid'])) 125 { 126 $sid = (!empty($_POST['sid'])) ? $_POST['sid'] : $_GET['sid']; 127 } 128 else 129 { 130 $sid = ''; 131 } 124 $sid = request_var('sid', ''); 132 125 133 126 // … … 184 177 // End session management 185 178 // 179 180 /* */ 181 $bb_code = new bbcode; 182 /* */ 186 183 187 184 // session id check … … 380 377 { 381 378 //$redirect_page = "viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&sid=" . $userdata['session_id']; 382 $redirect_page = "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id&sid=" . $userdata['session_id'];379 $redirect_page = $root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id&sid=" . $userdata['session_id']; 383 380 $l_redirect = sprintf($lang['click_return_forum'], '<a href="' . $redirect_page . '">', '</a>'); 384 381 } … … 386 383 { 387 384 //$redirect_page = "modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id&sid=" . $userdata['session_id']; 388 $redirect_page = "phpbb2.php?page=modcp&" . POST_FORUM_URL . "=$forum_id&sid=" . $userdata['session_id'];385 $redirect_page = $root_path . "phpbb2.php?page=modcp&" . POST_FORUM_URL . "=$forum_id&sid=" . $userdata['session_id']; 389 386 $l_redirect = sprintf($lang['click_return_modcp'], '<a href="' . $redirect_page . '">', '</a>'); 390 387 } … … 521 518 { 522 519 //$redirect_page = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&sid=" . $userdata['session_id']; 523 $redirect_page = "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id&sid=" . $userdata['session_id'];520 $redirect_page = append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id"); 524 521 $message .= sprintf($lang['click_return_topic'], '<a href="' . $redirect_page . '">', '</a>'); 525 522 } … … 527 524 { 528 525 //$redirect_page = "modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id&sid=" . $userdata['session_id']; 529 $redirect_page = "phpbb2.php?page=modcp&" . POST_FORUM_URL . "=$forum_id&sid=" . $userdata['session_id'];526 $redirect_page = append_sid($root_path . "phpbb2.php?page=modcp&" . POST_FORUM_URL . "=$forum_id"); 530 527 $message .= sprintf($lang['click_return_modcp'], '<a href="' . $redirect_page . '">', '</a>'); 531 528 } 532 529 533 530 //$message = $message . '<br \><br \>' . sprintf($lang['click_return_forum'], '<a href="' . "viewforum.$phpEx?" . POST_FORUM_URL . "=$old_forum_id&sid=" . $userdata['session_id'] . '">', '</a>'); 534 $message = $message . '<br \><br \>' . sprintf($lang['click_return_forum'], '<a href="' . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$old_forum_id&sid=" . $userdata['session_id']. '">', '</a>');535 536 meta_refresh(3, append_sid($redirect_page));531 $message = $message . '<br \><br \>' . sprintf($lang['click_return_forum'], '<a href="' . append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$old_forum_id") . '">', '</a>'); 532 533 meta_refresh(3, $redirect_page); 537 534 538 535 trigger_error($message); … … 656 653 { 657 654 //$redirect_page = "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&sid=" . $userdata['session_id']; 658 $redirect_page = "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id&sid=" . $userdata['session_id']; 655 $redirect_page = "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id"; 656 $redirect_page = append_sid($redirect_page, false, true, $userdata['session_id']); 659 657 $message = sprintf($lang['click_return_topic'], '<a href="' . $redirect_page . '">', '</a>'); 660 658 } … … 662 660 { 663 661 //$redirect_page = "modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id&sid=" . $userdata['session_id']; 664 $redirect_page = "phpbb2.php?page=modcp&" . POST_FORUM_URL . "=$forum_id&sid=" . $userdata['session_id']; 662 $redirect_page = "phpbb2.php?page=modcp&" . POST_FORUM_URL . "=$forum_id"; 663 $redirect_page = append_sid($root_path . $redirect_page, false, true, $userdata['session_id']); 665 664 $message = sprintf($lang['click_return_modcp'], '<a href="' . $redirect_page . '">', '</a>'); 666 665 } 667 666 668 667 //$message = $message . '<br \><br \>' . sprintf($lang['click_return_forum'], '<a href="' . "viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&sid=" . $userdata['session_id'] . '">', '</a>'); 669 $message = $message . '<br \><br \>' . sprintf($lang['click_return_forum'], '<a href="' . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id&sid=" . $userdata['session_id'] . '">', '</a>'); 668 $url = append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL . "=$forum_id", false, true, $userdata['session_id']); 669 $message = $message . '<br \><br \>' . sprintf($lang['click_return_forum'], '<a href="' . $url . '">', '</a>'); 670 670 671 671 meta_refresh(3, append_sid($redirect_page)); … … 766 766 // done with getting topic_id 767 767 // now, get forum id for destination topic 768 $sql = "SELECT forum_id 769 FROM " . TOPICS_TABLE . " 770 WHERE topic_id = $destination_topic_id"; 768 $sql = "SELECT t.forum_id, f.forum_name, t.topic_title 769 FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f 770 WHERE topic_id = $destination_topic_id 771 AND t.forum_id = f.forum_id"; 771 772 $result = $db->sql_query($sql); 772 773 $row = $db->sql_fetchrow($result); 773 774 $destination_forum_id = $row['forum_id']; 775 $destination_forum_name = $row['forum_name']; 776 $destination_topic_title = $row['topic_title']; 774 777 $db->sql_freeresult($result); 775 778 … … 820 823 sync('forum', $forum_id); 821 824 822 meta_refresh(3, append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$destination_topic_id")); 823 824 $message = $lang['topic_split'] . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$destination_topic_id&sid=" . $userdata['session_id'] . '">', '</a>'); 825 $url = append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$destination_topic_id", false, true, $userdata['session_id']); 826 827 meta_refresh(3, $url); 828 829 $message = $lang['topic_split'] . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . $url . '">', '</a>'); 825 830 trigger_error($message); 826 831 } … … 849 854 while ($row = $db->sql_fetchrow($result)); 850 855 851 $post_subject = trim(htmlspecialchars($_POST['subject']));856 $post_subject = request_var('subject', ''); 852 857 if (empty($post_subject)) 853 858 { … … 856 861 } 857 862 858 $new_forum_id = intval($_POST['new_forum_id']); 863 $new_forum_id = request_var('new_forum_id', 0); 864 859 865 $topic_time = time(); 860 866 … … 897 903 sync('forum', $forum_id); 898 904 899 meta_refresh(3, append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id")); 905 $url = append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id", false, true, $userdata['session_id']); 906 meta_refresh(3, $url); 900 907 901 908 //$message = $lang['topic_split'] . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . "viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&sid=" . $userdata['session_id'] . '">', '</a>'); 902 $message = $lang['topic_split'] . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id&sid=" . $userdata['session_id']. '">', '</a>');909 $message = $lang['topic_split'] . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . $url . '">', '</a>'); 903 910 trigger_error($message); 904 911 return; … … 931 938 $template->assign_vars(array( 932 939 'PARENT_FORUM' => 1, 933 'U_VIEW_PARENT_FORUM' => append_sid($root_path . " viewforum.$phpEx?" . POST_FORUM_URL .'=' . $all_forums[$i]['forum_id']),940 'U_VIEW_PARENT_FORUM' => append_sid($root_path . "phpbb2.php?page=viewforum&" . POST_FORUM_URL .'=' . $all_forums[$i]['forum_id']), 934 941 'PARENT_FORUM_NAME' => $all_forums[$i]['forum_name'], 935 942 )); … … 939 946 // End Simple Subforums MOD 940 947 941 $sql = "SELECT u.name AS username, p.*, pt.post_text, pt. bbcode_uid, pt.post_subject, p.post_username948 $sql = "SELECT u.name AS username, p.*, pt.post_text, pt.post_subject, p.post_username 942 949 FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt 943 950 WHERE p.topic_id = $topic_id … … 968 975 $post_date = create_date($postrow['post_time']); 969 976 970 $bbcode_uid = $postrow['bbcode_uid'];971 977 $message = $postrow['post_text']; 972 978 $post_subject = $postrow['post_subject']; … … 984 990 } 985 991 986 if ( $bbcode_uid != '' ) 987 { 988 $message = ( $config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message); 989 } 992 $bb_code->parse($message); 993 $message = $bb_code->get_html(); 994 990 995 $post_subject = censor_text($post_subject); 991 996 $message = censor_text($message); 992 993 $message = make_clickable($message);994 995 if ( $config['allow_smilies'] && $postrow['enable_smilies'] )996 {997 $message = smilies_pass($message);998 }999 997 1000 998 $message = str_replace("\n", '<br />', $message); … … 1084 1082 sync('forum', $forum_id); 1085 1083 1086 meta_refresh(3, append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id")); 1087 1088 $message = $lang['delete_posts_succesfully'] . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id&sid=" . $userdata['session_id'] . '">', '</a>'); 1084 $url = append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id", false, true, $userdata['session_id']); 1085 1086 meta_refresh(3, $url); 1087 1088 $message = $lang['delete_posts_succesfully'] . '<br /><br />' . sprintf($lang['click_return_topic'], '<a href="' . $url . '">', '</a>'); 1089 1089 trigger_error($message); 1090 1090 … … 1096 1096 // 1097 1097 1098 $sql = "SELECT u.name AS username, p.*, pt.post_text, pt. bbcode_uid, pt.post_subject, p.post_username1098 $sql = "SELECT u.name AS username, p.*, pt.post_text, pt.post_subject, p.post_username 1099 1099 FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt 1100 1100 WHERE p.topic_id = $topic_id … … 1128 1128 $post_date = create_date($postrow['post_time']); 1129 1129 1130 $bbcode_uid = $postrow['bbcode_uid'];1131 1130 $message = $postrow['post_text']; 1132 $post_subject = ( $postrow['post_subject'] != '' ) ? $postrow['post_subject'] : $topic_title;1131 $post_subject = ( $postrow['post_subject'] != '' ) ? $postrow['post_subject'] : ''; 1133 1132 1134 1133 // … … 1144 1143 } 1145 1144 1146 if ( $bbcode_uid != '' ) 1147 { 1148 $message = ( $config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message); 1149 } 1145 $bb_code->parse($message); 1146 $message = $bb_code->get_html(); 1150 1147 1151 1148 $post_subject = censor_text($post_subject); 1152 1149 $message = censor_text($message); 1153 1154 $message = make_clickable($message);1155 1156 if ( $config['allow_smilies'] && $postrow['enable_smilies'] )1157 {1158 $message = smilies_pass($message);1159 }1160 1150 1161 1151 $message = str_replace("\n", '<br />', $message); … … 1431 1421 1432 1422 //$u_view_topic = "modcp.$phpEx?mode=split&" . POST_TOPIC_URL . "=$topic_id&sid=" . $userdata['session_id']; 1433 $u_view_topic = "phpbb2.php?page=modcp&mode=split&" . POST_TOPIC_URL . "=$topic_id&sid=" . $userdata['session_id']; 1423 1424 $u_view_topic = append_sid("phpbb2.php?page=modcp&mode=split&" . POST_TOPIC_URL . "=$topic_id", false, true, $userdata['session_id']); 1434 1425 $topic_replies = $row['topic_replies']; 1435 1426 phpBB2/posting.php
r266 r269 30 30 include($root_path . 'phpBB2/includes/bbcode.'.$phpEx); 31 31 include($root_path . 'phpBB2/includes/functions_post.'.$phpEx); 32 include($root_path . 'include/bbcode/bbcode.lib.php'); 32 33 include($root_path . 'include/functions_post.'.$phpEx); 33 34 … … 205 206 } 206 207 207 //$select_sql = (!$submit) ? ', t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.name AS username, u.uid, u.user_sig, u.user_sig_bbcode_uid' : '';208 //$select_sql = (!$submit) ? ', t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, u.name AS username, u.uid, u.user_sig' : ''; 208 209 //$from_sql = ( !$submit ) ? ", " . POSTS_TEXT_TABLE . " pt, " . USERS_TABLE . " u" : ''; 209 210 //$where_sql = ( !$submit ) ? "AND pt.post_id = p.post_id AND u.uid = p.poster_id" : ''; 210 $select_sql = ', t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, p.post_time, pt.post_subject, pt.post_text, pt.bbcode_uid, u.name AS username, u.uid, u.user_sig, u.user_sig_bbcode_uid';211 $select_sql = ', t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, p.post_time, pt.post_subject, pt.post_text, u.name AS username, u.uid, u.user_sig'; 211 212 $from_sql = ", " . POSTS_TEXT_TABLE . " pt, " . USERS_TABLE . " u"; 212 213 $where_sql = "AND pt.post_id = p.post_id AND u.uid = p.poster_id"; … … 587 588 if (!$merge) 588 589 { 589 $bbcode_uid = ''; 590 591 prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $bbcode_uid, $subject, $message, $poll_title, $poll_options, $poll_length); 590 591 prepare_post($mode, $post_data, $bbcode_on, $html_on, $smilies_on, $error_msg, $username, $subject, $message, $poll_title, $poll_options, $poll_length); 592 592 593 593 if ( $error_msg == '' ) … … 595 595 $topic_type = ( $topic_type != $post_data['topic_type'] && !$is_auth['auth_sticky'] && !$is_auth['auth_announce'] ) ? $post_data['topic_type'] : $topic_type; 596 596 597 submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid,str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length);597 submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length); 598 598 } 599 599 } … … 686 686 { 687 687 $user_sig = ( $post_info['user_sig'] != '' && $config['allow_sig'] ) ? $post_info['user_sig'] : ''; 688 $userdata['user_sig_bbcode_uid'] = $post_info['user_sig_bbcode_uid'];689 688 } 690 689 691 690 if( $preview ) 692 691 { 693 $bbcode_uid = ( $bbcode_on ) ? make_bbcode_uid() : ''; 694 $preview_message = prepare_message(unprepare_message($message), $html_on, $bbcode_on, $smilies_on, $bbcode_uid); 692 693 $bb_code = new bbcode; 694 695 $preview_message = prepare_message(unprepare_message($message), $html_on, $bbcode_on, $smilies_on); 695 696 $preview_subject = $subject; 696 697 $preview_username = $username; … … 707 708 // Finalise processing as per viewtopic 708 709 // 709 $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace ('#((\r)+?(\n)+?)*(\[url( :'.$userdata['user_sig_bbcode_uid'].')?(.*)\])?\[img:'.$userdata['user_sig_bbcode_uid'].'\](.+)\[/img:'.$userdata['user_sig_bbcode_uid'].'\](\[/url(:'.$userdata['user_sig_bbcode_uid'].')?\])?#i', '', $user_sig) : $user_sig ;710 $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace ('#((\r)+?(\n)+?)*(\[url(.*)\])?\[img\](.+)\[/img\](\[/url\])?#i', '', $user_sig) : $user_sig ; 710 711 if( !$html_on ) 711 712 { … … 715 716 } 716 717 } 717 if( $attach_sig && $user_sig != '' && $userdata['user_sig_bbcode_uid'] ) 718 { 719 $user_sig = bbencode_second_pass($user_sig, $userdata['user_sig_bbcode_uid']); 718 719 if( $attach_sig && $user_sig != '' ) 720 { 721 $bb_code->parse($user_sig); 722 $user_sig = $bb_code->get_html(); 720 723 } 721 724 722 725 if( $bbcode_on ) 723 726 { 724 $preview_message = bbencode_second_pass($preview_message, $bbcode_uid); 725 } 727 $bb_code->parse($preview_message); 728 $preview_message = $bb_code->get_html(); 729 } 730 731 726 732 727 733 $preview_username = censor_text($preview_username); … … 729 735 $preview_message = censor_text($preview_message); 730 736 731 732 if( $user_sig != '' )733 {734 $user_sig = make_clickable($user_sig);735 }736 $preview_message = make_clickable($preview_message);737 738 if( $smilies_on )739 {740 if( $user_sig != '' )741 {742 $user_sig = smilies_pass($user_sig);743 }744 745 $preview_message = smilies_pass($preview_message);746 }747 737 if( $attach_sig && $user_sig != '' ) 748 738 { … … 836 826 } 837 827 838 if ( $post_info['bbcode_uid'] != '' )839 {840 $message = preg_replace('/\:(([a-z0-9]:)?)' . $post_info['bbcode_uid'] . '/s', '', $message);841 }842 843 828 $message = str_replace('<', '<', $message); 844 829 $message = str_replace('>', '>', $message); … … 851 836 // Use trim to get rid of spaces placed there by MS-SQL 2000 852 837 $quote_username = ( trim($post_info['post_username']) != '' ) ? $post_info['post_username'] : $post_info['username']; 853 $message = '[quote= ' . $quote_username . ']' . $message . '[/quote]';838 $message = '[quote="' . $quote_username . '"]' . $message . '[/quote]'; 854 839 855 840 // BEGIN Moderator Tags phpBB2/search.php
r266 r269 30 30 include($root_path . 'phpBB2/includes/bbcode.'.$phpEx); 31 31 include($root_path . 'phpBB2/includes/functions_search.'.$phpEx); 32 include($root_path . 'include/ functions_post.'.$phpEx);32 include($root_path . 'include/bbcode/bbcode.lib.php'); 33 33 34 34 // … … 40 40 // End session management 41 41 // 42 43 /* */ 44 $bb_code = new bbcode; 45 /* */ 42 46 43 47 // … … 731 735 if ( $show_results == 'posts' ) 732 736 { 733 $sql = "SELECT pt.post_text, pt. bbcode_uid, pt.post_subject, p.*, f.forum_id, f.forum_name, t.*, u.name AS username, u.uid737 $sql = "SELECT pt.post_text, pt.post_subject, p.*, f.forum_id, f.forum_name, t.*, u.name AS username, u.uid 734 738 FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt 735 739 WHERE p.post_id IN ($search_results) … … 882 886 if ( isset($return_chars) ) 883 887 { 884 $bbcode_uid = $searchset[$i]['bbcode_uid'];885 888 886 889 // … … 891 894 { 892 895 $message = strip_tags($message); 893 $message = preg_replace("/\[.*?:$bbcode_uid:?.*?\]/si", '', $message);894 896 $message = preg_replace('/\[url\]|\[\/url\]/si', '', $message); 895 897 $message = ( utf_strlen($message) > $return_chars ) ? substr($message, 0, $return_chars) . ' ...' : $message; … … 899 901 if ( !$config['allow_html'] ) 900 902 { 901 if ( $ postrow[$i]['enable_html'] )903 if ( $searchset[$i]['enable_html'] ) 902 904 { 903 905 $message = preg_replace('#(<)([\/]?.*?)(>)#is', '<\\2>', $message); … … 905 907 } 906 908 907 if ( $bbcode_uid != '' ) 908 { 909 $message = ( $config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace('/\:[0-9a-z\:]+\]/si', ']', $message); 910 } 911 912 $message = make_clickable($message); 909 $bb_code->parse($message); 910 $message = $bb_code->get_html(); 913 911 914 912 if ( $highlight_active ) … … 991 989 $post_subject = ( $searchset[$i]['post_subject'] != '' ) ? censor_text($searchset[$i]['post_subject']) : $topic_title; 992 990 $message = censor_text($message); 993 994 if ($config['allow_smilies'] && $searchset[$i]['enable_smilies'])995 {996 $message = smilies_pass($message);997 }998 991 999 992 $message = str_replace("\n", '<br />', $message); phpBB2/viewforum.php
r266 r269 234 234 while( $row = $db->sql_fetchrow($result) ) 235 235 { 236 $moderators[] = '<a href="' . append_sid( 'userdetails.php?id=' . $row['uid']) . '">' . get_user_class_color($row['class'], $row['username']) . '</a>';236 $moderators[] = '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $row['uid']) . '">' . get_user_class_color($row['class'], $row['username']) . '</a>'; 237 237 } 238 238 … … 655 655 $view_topic_url = append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_TOPIC_URL . "=$topic_id"); 656 656 657 $topic_author = ($topic_rowset[$i]['uid'] == ANONYMOUS ) ? (($topic_rowset[$i]['post_username'] != '' ) ? $topic_rowset[$i]['post_username'] : $lang['guest'] ) : '<a href="' . append_sid( 'userdetails.php?id=' . $topic_rowset[$i]['uid']) . '">' . get_user_class_color($topic_rowset[$i]['class1'],$topic_rowset[$i]['username']) . '</a>';657 $topic_author = ($topic_rowset[$i]['uid'] == ANONYMOUS ) ? (($topic_rowset[$i]['post_username'] != '' ) ? $topic_rowset[$i]['post_username'] : $lang['guest'] ) : '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $topic_rowset[$i]['uid']) . '">' . get_user_class_color($topic_rowset[$i]['class1'],$topic_rowset[$i]['username']) . '</a>'; 658 658 659 659 $first_post_time = create_date($topic_rowset[$i]['topic_time']); … … 661 661 $last_post_time = create_date($topic_rowset[$i]['post_time']); 662 662 663 $last_post_author = ( $topic_rowset[$i]['id2'] == ANONYMOUS ) ? ( ( isset($topic_rowset[$i]['post_username2']) ) ? $topic_rowset[$i]['post_username2'] . ' ' : $lang['guest'] . ' ' ) : '<a href="' . append_sid( 'userdetails.php?id=' . $topic_rowset[$i]['id2']) . '">' . get_user_class_color($topic_rowset[$i]['class2'],$topic_rowset[$i]['user2']) . '</a>';663 $last_post_author = ( $topic_rowset[$i]['id2'] == ANONYMOUS ) ? ( ( isset($topic_rowset[$i]['post_username2']) ) ? $topic_rowset[$i]['post_username2'] . ' ' : $lang['guest'] . ' ' ) : '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $topic_rowset[$i]['id2']) . '">' . get_user_class_color($topic_rowset[$i]['class2'],$topic_rowset[$i]['user2']) . '</a>'; 664 664 665 665 $last_post_url = '<a href="' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . '=' . $topic_rowset[$i]['topic_last_post_id']) . '#' . $topic_rowset[$i]['topic_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" alt="' . $lang['view_latest_post'] . '" title="' . $lang['view_latest_post'] . '" border="0" /></a>'; … … 834 834 while( $row = $db->sql_fetchrow($result) ) 835 835 { 836 $subforum_moderators[$row['forum_id']][] = '<a href="' . append_sid( 'userdetails.php?id=' . $row['uid']) . '">' . $row['username'] . '</a>';836 $subforum_moderators[$row['forum_id']][] = '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $row['uid']) . '">' . $row['username'] . '</a>'; 837 837 } 838 838 $db->sql_freeresult($result); … … 923 923 $last_post = $last_post_time . '<br />'; 924 924 925 $last_post .= ( $subforum_data[$j]['uid'] == ANONYMOUS ) ? ( ($subforum_data[$j]['post_username'] != '' ) ? $subforum_data[$j]['post_username'] . ' ' : $lang['guest'] . ' ' ) : '<a href="' . append_sid( 'userdetails.php?id=' . $subforum_data[$j]['uid']) . '">' . $subforum_data[$j]['username'] . '</a> ';925 $last_post .= ( $subforum_data[$j]['uid'] == ANONYMOUS ) ? ( ($subforum_data[$j]['post_username'] != '' ) ? $subforum_data[$j]['post_username'] . ' ' : $lang['guest'] . ' ' ) : '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $subforum_data[$j]['uid']) . '">' . $subforum_data[$j]['username'] . '</a> '; 926 926 927 927 $last_post .= '<a href="' . append_sid($root_path . "phpbb2.php?page=viewtopic&" . POST_POST_URL . '=' . $subforum_data[$j]['forum_last_post_id']) . '#' . $subforum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['view_latest_post'] . '" title="' . $lang['view_latest_post'] . '" /></a>'; phpBB2/viewtopic.php
r266 r269 940 940 { 941 941 //$temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$poster_id"); 942 $temp_url = append_sid( "userdetails.php?id=" . $postrow[$i]['uid']);942 $temp_url = append_sid($root_path . "userdetails.php?id=" . $postrow[$i]['uid']); 943 943 $profile_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_profile'] . '" alt="' . $lang['read_profile'] . '" title="' . $lang['read_profile'] . '" border="0" /></a>'; 944 944 $profile = '<a href="' . $temp_url . '">' . $lang['read_profile'] . '</a>'; … … 984 984 985 985 //$temp_url = append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$poster_id"); 986 $temp_url = append_sid( "userdetails.php?id=" . $postrow[$i]['uid']);986 $temp_url = append_sid($root_path . "userdetails.php?id=" . $postrow[$i]['uid']); 987 987 //$msn_img = ( $postrow[$i]['user_msnm'] ) ? '<a href="' . $temp_url . '"><img src="' . $images['icon_msnm'] . '" alt="' . $lang['msnm'] . '" title="' . $lang['msnm'] . '" border="0" /></a>' : ''; 988 988 $msn_img = ( $postrow[$i]['msn'] ) ? '<a href="' . $temp_url . '"><img src="' . $images['icon_msnm'] . '" alt="' . $lang['msnm'] . '" title="' . $lang['msnm'] . '" border="0" /></a>' : ''; … … 1278 1278 $userslist .= ( $userslist ? ', ' : '' ); 1279 1279 1280 $userslist .= '<a href="' . append_sid($root_path . 'userdetails.php?id=' ) . $users['uid']. '"><span class="' . ( $users['simpaty'] ? 'usergoodResp' : 'userbadResp' ) . '">' . $users['name'] . '</span></a>';1280 $userslist .= '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $users['uid']) . '"><span class="' . ( $users['simpaty'] ? 'usergoodResp' : 'userbadResp' ) . '">' . $users['name'] . '</span></a>'; 1281 1281 } 1282 1282 releases.php
r241 r269 2 2 $root_path = './'; 3 3 require ($root_path . 'include/config.php'); 4 require ($root_path . 'include/functions_post.php');5 4 require ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_upload_templates.php'); 6 5 requests.php
r266 r269 2 2 $root_path = './'; 3 3 require ($root_path . 'include/config.php'); 4 require ($root_path . 'include/functions_post.php');5 4 require ($root_path . 'include/functions_selects.php'); 6 5 require ($root_path . 'include/functions_check.php'); … … 170 169 171 170 $filled_torrent_id = (int) $matches[1]; 172 $sql = 'SELECT name FROM ' . TORRENTS_TABLE . ' WHERE fid = ' . $filled_torrent_id . ' AND moderated = 1 AND banned = 0 AND hidden = 0';173 $result = $db->sql_query($sql); 174 if ( ! ($row = $db->sql_fetchrow($result)) ) {171 $sql = 'SELECT name, category FROM ' . TORRENTS_TABLE . ' WHERE fid = ' . $filled_torrent_id . ' AND moderated = 1 AND banned = 0 AND hidden = 0'; 172 $result = $db->sql_query($sql); 173 if ( !$row = $db->sql_fetchrow($result) ) { 175 174 trigger_error($lang['invalid_url_for_uploaded_torrent']); 176 175 } 177 176 $torrent_name = censor_text($row['name']); 177 $cats = $cache->obtain_cats(); 178 179 $cat_id = $row['category']; 180 $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 181 if ( $config['mod_rewrite_enabled'] ) { 182 $u_request = append_sid($root_path . 'requests.php?id=' . $id, false, true, ''); 183 $u_userdetails = append_sid($root_path . 'userdetails.php?id=' . $userdata['uid'], false, true, ''); 184 $u_details = append_sid($root_path . 'details.php?id=' . $filled_torrent_id, false, true, ''); 185 } 186 else { 187 $base_url = generate_base_url(); 188 $u_request = $base_url . '/requests.php?id=' . $id; 189 $u_userdetails = $base_url . '/userdetails.php?id=' . $userdata['uid']; 190 $u_details = $base_url . '/details.php?id=' . $filled_torrent_id; 191 } 178 192 179 193 $sql = 'SELECT a.userid, u.language, u.name, u.email, u.notifs, u.language, u.class … … 190 204 'sender' => 0, 191 205 'receiver' => $arr['userid'], 192 'msg' => sprintf($lang['pm_request_filled_body'], generate_base_url(), $id , $requests_name, generate_base_url(), $userdata['uid'], $userdata['name'], generate_base_url(), $filled_torrent_id, $torrent_name),206 'msg' => sprintf($lang['pm_request_filled_body'], $u_request, $requests_name, $u_userdetails, $userdata['name'], $u_details, $torrent_name), 193 207 'subject' => $lang['pm_request_filled_subject'], 194 208 'name' => $arr['name'], … … 265 279 $result = $db->sql_query($sql); 266 280 267 if ( ! ($row = $db->sql_fetchrow($result)) ) {281 if ( !$row = $db->sql_fetchrow($result) ) { 268 282 trigger_error (sprintf($lang['invalid_id'], $id)); 269 283 } 284 285 /* */ 286 require ($root_path . 'include/bbcode/bbcode.lib.php'); 287 require ($root_path . 'include/functions_post.php'); 288 /* */ 270 289 271 290 if ( $row['userid'] <> ANONYMOUS ) { … … 282 301 } 283 302 303 $description = censor_text($row['descr']); 304 $bb_code = new bbcode($description); 305 $description = $bb_code->get_html(); 284 306 285 307 $template->assign_vars(array( … … 295 317 'REQUEST_DETAILS' => sprintf($lang['request_details'], $row['request']), 296 318 'REQUEST_NAME' => censor_text($row['request']), 297 'DESCRIPTION' => format_comment(censor_text($row['descr'])),319 'DESCRIPTION' => $description, 298 320 'ADDED' => create_date($row['added']), 299 321 'TYPE' => $row['cat_name'], … … 331 353 $tracking_requests = ( isset($_COOKIE[$config['cookie_name'] . '_r']) ) ? unserialize($_COOKIE[$config['cookie_name'] . '_r']) : array(); 332 354 333 if ( !empty($tracking_ offers[$id]) )355 if ( !empty($tracking_requests[$id]) ) 334 356 { 335 357 $req_comment_last_read = $tracking_requests[$id]; … … 478 500 list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, 'requests.php?' . $search_arr . 'sort=' . $sort . '&' ); 479 501 480 $sql = 'SELECT u.downloaded, u.uploaded, u.name, u.class, r.filled, r.filledby, r.id, r.userid, r.request, r.added, r.hits, r.comments, u2.name AS filledby_username, u2.uid AS filledby_id, r.cat, t.name AS torrent_name 502 $sql = 'SELECT u.downloaded, u.uploaded, u.name, u.class, r.filled, r.filledby, r.id, r.userid, r.request, r.added, r.hits, r.comments, u2.name AS filledby_username, u2.uid AS filledby_id, r.cat, t.name AS torrent_name, t.category AS t_category 481 503 FROM ' . REQUESTS_TABLE . ' r 482 504 LEFT JOIN ' . USERS_TABLE . ' u2 ON r.filledby = u2.uid … … 526 548 $filled = ( $row['filled'] ? append_sid($root_path . 'details.php?id=' . $row['filled']) : '' ); 527 549 $comment = ( $row['comments'] ?'<a href="' . append_sid('requests.php?id=' . $row['id']) . '#startcomments"><b>' . $row['comments'] . '</b></a>' : 0); 528 $filled_by = ( $row['filled'] ? $lang['filled_by'] .' <a href="' . append_sid( 'userdetails.php?id=' . $row['filledby_id']) . '">' . $row['filledby_username'] . '</a>':'');550 $filled_by = ( $row['filled'] ? $lang['filled_by'] .' <a href="' . append_sid($root_path . 'userdetails.php?id=' . $row['filledby_id']) . '">' . $row['filledby_username'] . '</a>':''); 529 551 $vote_link = ( $row['filled'] ? '' : '<a href="' . append_sid('requests.php?action=vote&voteid=' . $row['id']) . '">' . $lang['vote'] . '</a>' ); 530 552 … … 534 556 'U_CAT' => append_sid('requests.php?cat=' . $row['cat']), 535 557 'U_REQUEST' => ( $filled ? $filled : append_sid('requests.php?id=' . $row['id']) ), 536 'U_REQUESTER' => append_sid( 'userdetails.php?id=' . $row['userid']),558 'U_REQUESTER' => append_sid($root_path . 'userdetails.php?id=' . $row['userid']), 537 559 'U_VOTES' => append_sid('requests.php?action=voteview&requestid=' . $row['id']), 538 560 'CAT_NAME_DISPLAY' => $cat_name_display, rss.php
r266 r269 3 3 $root_path = './'; 4 4 require ($root_path . 'include/config.php'); 5 require ($root_path . 'include/ functions_post.php');5 require ($root_path . 'include/bbcode/bbcode.lib.php'); 6 6 7 7 function ExitWithHeader( $output, $message = '' ) { … … 58 58 $userdata = array('uid' => $row['uid'], 'tzoffset' => $row['tzoffset'], 'language' => $row['language'], 'user_style' => $row['user_style'], 'user_dst' => $row['user_dst']); 59 59 60 setup_style($userdata['user_style']); 61 @include($root_path . 'languages/lang_' . $userdata['language'] . '/lang_main.php'); 60 init_userprefs($userdata); 62 61 } 63 62 else { … … 86 85 87 86 $template->set_filenames(array( 88 'rss_tpl' => 'rss.html') 89 ); 87 'rss_tpl' => 'rss.html' 88 )); 89 90 $base_url = generate_base_url(); 90 91 91 92 $template->assign_vars(array( 92 93 'XML_HEADER' => '<?xml version="1.0" encoding="utf-8" ?>' . "\n", 93 'URL' => generate_base_url(),94 'IMAGE_URL' => ($config['cookie_secure'] ? 'https://' : 'http://' ) . $config['server_name'] . ($config['server_port'] <> 80 ? ':' . trim($config['server_port']) : '' ) . '/SZ.gif',94 'URL' => $base_url, 95 'IMAGE_URL' => $base_url . '/logo88x31.gif', 95 96 'TITLE' => htmlspecialchars($config['sitename']), 96 97 'DESCRIPTION' => htmlspecialchars($config['site_desc']), … … 129 130 $result = $db->sql_query($sql, 30 * 60); 130 131 132 $bb_code = new bbcode(); 133 131 134 while ( $row = $db->sql_fetchrow($result) ) { 132 135 136 $cat_id = $row['category']; 137 $cat_parent_id = ( isset($cats_arr[$cats_arr[$cat_id]['cat_parent']]['cat_id']) ? $cats_arr[$cats_arr[$cat_id]['cat_parent']]['cat_id'] : 0 ); 138 $id = $row['fid']; 133 139 134 $link = ( isset($_GET['feed']) ? 'details.php?id=' . $row['fid'] . '&action=download' : 'details.php?id=' . $row['fid'] ); 135 $description = format_comment($row['descr']); 136 $description = str_replace('onload="imgFit(this, 500);"', '', $description); 137 $description = str_replace('onclick="imgFit(this, 500);"', '', $description); 140 $description = censor_text($row['descr']); 141 $bb_code->parse($description); 142 $description = $bb_code->get_html(); 143 144 $link = ( isset($_GET['feed']) ? 'details.php?id=' . $id . '&action=download' : 'details.php?id=' . $id ); 138 145 $size = mksize($row['size']); 139 $category = $cats_arr[$ row['category']]['cat_name'];146 $category = $cats_arr[$cat_id]['cat_name']; 140 147 $date = create_date($row['ctime'], $tzoffset); 141 148 $owner = ( $row['owner'] ? ( $row['privacy'] == PRIVACY_LEVEL_HIGH && $row['owner'] <> $userdata['uid'] ? $lang['anonymous'] : $row['name'] ) : $lang['unknown'] ); 142 149 143 150 if ( $config['mod_rewrite_enabled'] ) { 144 $u_link = append_sid($root_path . $link );145 $u_reply = append_sid($root_path . 'comment.php?type=main&action=add&tid=' . $ row['fid']);146 $u_category = append_sid($root_path . 'browse.php?cat=' . $ row['category']);151 $u_link = append_sid($root_path . $link, false, true, ''); 152 $u_reply = append_sid($root_path . 'comment.php?type=main&action=add&tid=' . $id, false, true, ''); 153 $u_category = append_sid($root_path . 'browse.php?cat=' . $cat_id, false, true, ''); 147 154 } 148 155 else { 149 $u_link = generate_base_url(). '/' . $link;150 $u_reply = generate_base_url() . '/comment.php?type=main&action=add&tid=' . $row['fid'];151 $u_category = generate_base_url() . '/browse.php?cat=' . $row['category'];156 $u_link = $base_url . '/' . $link; 157 $u_reply = $base_url . '/comment.php?type=main&action=add&tid=' . $id; 158 $u_category = $base_url . '/browse.php?cat=' . $cat_id; 152 159 } 153 160 … … 156 163 'AUTHOR' => htmlspecialchars($row['name']), 157 164 'CATEGORY' => htmlspecialchars($category), 158 'CAT_ID' => $ row['category'],165 'CAT_ID' => $cat_id, 159 166 'SIZE' => $size, 160 167 'ADDED' => $date, scrape.php
r241 r269 3 3 $root_path = './'; 4 4 require ($root_path . 'include/config.php'); 5 require ($root_path . 'include/ benc.php');5 require ($root_path . 'include/functions_announce.php'); 6 6 7 7 signup.php
r245 r269 3 3 require ($root_path . 'include/config.php'); 4 4 require ($root_path . 'include/functions_check.php'); 5 require ($root_path . 'include/benc.php');6 5 7 6 $userdata = session_pagestart($user_ip); … … 24 23 $db->sql_freeresult($result); 25 24 26 $sec = hash_pad($row['editsecret']);25 $sec = str_pad($row['editsecret'], 20); 27 26 28 27 $sql = 'UPDATE ' . USERS_TABLE . ' SET editsecret=\'\', email=' . "'" . $db->sql_escape($email) . "'" . ' WHERE uid=' . $id . ' AND editsecret=' . "'" . $db->sql_escape($row['editsecret']) . "'"; simpaty.php
r266 r269 119 119 $userslist .= ( $userslist ? ', ' : '' ); 120 120 121 $userslist .= '<a href="' . append_sid('userdetails.php?id=') . $row['uid'] . '"><span class="' . ( $row['simpaty'] ? 'usergoodResp' : 'userbadResp' ) . '">' . $row['name'] . '</span></a>'; 121 122 $userslist .= '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $row['uid']) . '"><span class="' . ( $row['simpaty'] ? 'usergoodResp' : 'userbadResp' ) . '">' . $row['name'] . '</span></a>'; 122 123 } 123 124 sql.sql
r260 r269 414 414 ('count_candidates_waiting', '0', 1), 415 415 ('points_settings', '', 0), 416 ('mod_rewrite_enabled', '0', '0'); 416 ('mod_rewrite_enabled', '0', '0'), 417 ('tags_max_allow', '10', 0), 418 ('tags_max_length', '50', 0), 419 ('tags_min_length', '3', 0); 417 420 418 421 -- -------------------------------------------------------- … … 768 771 CREATE TABLE IF NOT EXISTS `forum_posts_text` ( 769 772 `post_id` mediumint(8) unsigned NOT NULL default '0', 770 `bbcode_uid` varchar(10) default NULL,771 773 `post_subject` varchar(60) default NULL, 772 774 `post_text` mediumtext, … … 1090 1092 `news_comments` int(10) default '0', 1091 1093 `news_disable_comments` tinyint(1) default '0', 1092 PRIMARY KEY (`id`), 1093 KEY `added` (`added`) 1094 PRIMARY KEY (`id`) 1094 1095 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; 1095 1096 … … 1683 1684 `themes_id` mediumint(8) unsigned NOT NULL auto_increment, 1684 1685 `template_name` varchar(30) default NULL, 1685 `bbcode_bitfield` blob,1686 1686 `style_name` varchar(30) default NULL, 1687 1687 `is_use_right_menu` tinyint(1) default '0', … … 1738 1738 -- 1739 1739 1740 INSERT INTO `themes` (`themes_id`, `template_name`, ` bbcode_bitfield`, `style_name`, `is_use_right_menu`, `is_use_left_menu`, `head_stylesheet`, `body_background`, `body_bgcolor`, `body_text`, `body_link`, `body_vlink`, `body_alink`, `body_hlink`, `tr_color1`, `tr_color2`, `tr_color3`, `tr_class1`, `tr_class2`, `tr_class3`, `th_color1`, `th_color2`, `th_color3`, `th_class1`, `th_class2`, `th_class3`, `td_color1`, `td_color2`, `td_color3`, `td_class1`, `td_class2`, `td_class3`, `fontface1`, `fontface2`, `fontface3`, `fontsize1`, `fontsize2`, `fontsize3`, `fontcolor1`, `fontcolor2`, `fontcolor3`, `span_class1`, `span_class2`, `span_class3`, `img_size_poll`, `img_size_privmsg`, `online_color`, `offline_color`, `hidden_color`, `hidden_torrent_color`) VALUES1741 (1, 'main', 0x6b4e673d,'main', 1, 1, 'main.css', '', 'E5E5E5', '000000', '006699', '5493B4', '', 'DD6900', 'EFEFEF', 'DEE3E7', 'D1D7DC', '', '', '', '98AAB1', '006699', 'FFFFFF', 'cellpic1.gif', 'cellpic3.gif', 'cellpic2.jpg', 'FAFAFA', 'FFFFFF', '', 'row1', 'row2', '', 'Verdana, Arial, Helvetica, sans-serif', 'Trebuchet MS', 'Courier, ''Courier New'', sans-serif', 10, 11, 12, '444444', '006600', 'FFA34F', '', '', '', NULL, NULL, '008500', 'DF0000', 'EBD400', ''),1742 (2, 'reflection', 0x6b4e673d,'reflection', 0, 0, 'reflection.css', '', 'E5E5E5', '000000', '006699', '5493B4', '', 'DD6900', 'EFEFEF', 'DEE3E7', 'D1D7DC', '', '', '', '98AAB1', '006699', 'FFFFFF', 'cellpic1.gif', 'cellpic3.gif', 'cellpic2.jpg', 'FAFAFA', 'FFFFFF', '', 'row1', 'row2', '', 'Verdana, Arial, Helvetica, sans-serif', 'Trebuchet MS', 'Courier, \\\\''Courier New\\\\'', sans-serif', 10, 11, 12, '444444', '006600', 'FFA34F', '', '', '', 0, 0, '008500', 'DF0000', 'EBD400', 'CCCCCC'),1743 (3, 'bithdtv', 0x6b4e673d,'bithdtv', 0, 0, 'bithdtv.css', '', 'E5E5E5', '000000', '006699', '5493B4', '', 'DD6900', 'EFEFEF', 'DEE3E7', 'D1D7DC', '', '', '', '98AAB1', '006699', 'FFFFFF', 'cellpic1.gif', 'cellpic3.gif', 'cellpic2.jpg', 'FAFAFA', 'FFFFFF', '', 'row1', 'row2', '', 'Verdana, Arial, Helvetica, sans-serif', 'Trebuchet MS', 'Courier, \\''Courier New\\'', sans-serif', 10, 11, 12, '444444', '006600', 'FFA34F', '', '', '', 0, 0, '008500', 'DF0000', 'EBD400', 'CCCCCC');1740 INSERT INTO `themes` (`themes_id`, `template_name`, `style_name`, `is_use_right_menu`, `is_use_left_menu`, `head_stylesheet`, `body_background`, `body_bgcolor`, `body_text`, `body_link`, `body_vlink`, `body_alink`, `body_hlink`, `tr_color1`, `tr_color2`, `tr_color3`, `tr_class1`, `tr_class2`, `tr_class3`, `th_color1`, `th_color2`, `th_color3`, `th_class1`, `th_class2`, `th_class3`, `td_color1`, `td_color2`, `td_color3`, `td_class1`, `td_class2`, `td_class3`, `fontface1`, `fontface2`, `fontface3`, `fontsize1`, `fontsize2`, `fontsize3`, `fontcolor1`, `fontcolor2`, `fontcolor3`, `span_class1`, `span_class2`, `span_class3`, `img_size_poll`, `img_size_privmsg`, `online_color`, `offline_color`, `hidden_color`, `hidden_torrent_color`) VALUES 1741 (1, 'main', 'main', 1, 1, 'main.css', '', 'E5E5E5', '000000', '006699', '5493B4', '', 'DD6900', 'EFEFEF', 'DEE3E7', 'D1D7DC', '', '', '', '98AAB1', '006699', 'FFFFFF', 'cellpic1.gif', 'cellpic3.gif', 'cellpic2.jpg', 'FAFAFA', 'FFFFFF', '', 'row1', 'row2', '', 'Verdana, Arial, Helvetica, sans-serif', 'Trebuchet MS', 'Courier, ''Courier New'', sans-serif', 10, 11, 12, '444444', '006600', 'FFA34F', '', '', '', NULL, NULL, '008500', 'DF0000', 'EBD400', ''), 1742 (2, 'reflection', 'reflection', 0, 0, 'reflection.css', '', 'E5E5E5', '000000', '006699', '5493B4', '', 'DD6900', 'EFEFEF', 'DEE3E7', 'D1D7DC', '', '', '', '98AAB1', '006699', 'FFFFFF', 'cellpic1.gif', 'cellpic3.gif', 'cellpic2.jpg', 'FAFAFA', 'FFFFFF', '', 'row1', 'row2', '', 'Verdana, Arial, Helvetica, sans-serif', 'Trebuchet MS', 'Courier, \\\\''Courier New\\\\'', sans-serif', 10, 11, 12, '444444', '006600', 'FFA34F', '', '', '', 0, 0, '008500', 'DF0000', 'EBD400', 'CCCCCC'), 1743 (3, 'bithdtv', 'bithdtv', 0, 0, 'bithdtv.css', '', 'E5E5E5', '000000', '006699', '5493B4', '', 'DD6900', 'EFEFEF', 'DEE3E7', 'D1D7DC', '', '', '', '98AAB1', '006699', 'FFFFFF', 'cellpic1.gif', 'cellpic3.gif', 'cellpic2.jpg', 'FAFAFA', 'FFFFFF', '', 'row1', 'row2', '', 'Verdana, Arial, Helvetica, sans-serif', 'Trebuchet MS', 'Courier, \\''Courier New\\'', sans-serif', 10, 11, 12, '444444', '006600', 'FFA34F', '', '', '', 0, 0, '008500', 'DF0000', 'EBD400', 'CCCCCC'); 1744 1744 1745 1745 -- -------------------------------------------------------- … … 1888 1888 `birthday` date default '0000-00-00', 1889 1889 `autodemote` tinyint(1) default '1', 1890 `client` varchar(30) default NULL,1891 `simpaty` int(10) default '0',1892 1890 `language` varchar(255) default NULL, 1893 1891 `total_seed_time` int(11) default '0', … … 1901 1899 `notify_forum` tinyint(1) default '1', 1902 1900 `user_sig` text, 1903 `user_sig_bbcode_uid` varchar(10) default NULL,1904 1901 `user_style` tinyint(3) default '0', 1905 1902 `can_leech` tinyint(4) default '1', … … 1919 1916 KEY `download` (`download`), 1920 1917 KEY `parked` (`parked`), 1921 KEY `client` (`client`),1922 1918 KEY `points` (`user_reputation`), 1923 1919 KEY `class` (`class`) … … 1928 1924 -- 1929 1925 1930 INSERT INTO `users` (`uid`, `name`, `old_password`, `pass`, `secret`, `email`, `status`, `added`, `editsecret`, `privacy`, `acceptpms`, `ip`, `class`, `avatar`, `uploaded`, `downloaded`, `title`, `country`, `notifs`, `modcomment`, `enabled`, `avatars`, `donor`, `warneduntil`, `warn`, `torrentsperpage`, `deletepms`, `savepms`, `torrent_pass`, `tzoffset`, `user_dst`, `hiddentorrents`, `parked`, `invites`, `invited_by`, `download`, `upload`, `icq`, `msn`, `aim`, `yahoo`, `skype`, `commentpm`, `gender`, `birthday`, `autodemote`, ` client`, `simpaty`, `language`, `total_seed_time`, `user_reputation`, `user_reputation_level`, `user_session_time`, `user_session_page`, `user_level`, `user_posts`, `user_lastvisit`, `notify_forum`, `user_sig`, `user_sig_bbcode_uid`, `user_style`, `can_leech`, `wait_time`, `peers_limit`, `torrents_limit`, `torrent_pass_secret`, `user_unread_pms`, `user_rank_id`) VALUES1931 (0, 'Anonymous', '', '', '', '', 1, 943909200, '', 1, 1, '0.0.0.0', 1, '', 0, 0, '', 0, '', '', 1, 1, 0, 0, 0, 0, 1, 0, 'fbc807cec4a079dd5add35845ec9d059', 0.00, 0, 0, 0, 0, 0, 65536, 65536, '', '', '', '', '', 1, 0, '0000-00-00', 1, ' ', 0, 'russian', 3600000, 0, 0, 943909200, '0', NULL, 0, 0, 1, NULL, NULL, 1, 1, 0, 0, 5, 0, 0, 0),1932 (1, 'admin', '', 'd41d8cd98f00b204e9800998ecf8427e', '', 'EMAIL@ADDRESS.COM', 1, UNIX_TIMESTAMP(NOW()), '', 3, 1, '127.0.0.1', 7, '', 0, 0, '', 3, '', '', 1, 1, 0, 0, 0, 60, 1, 1, MD5(UNIX_TIMESTAMP(NOW())), 3.00, 1, 0, 0, 0, 0, 10485760, 10485760, '', '', '', '', '', 1, 0, '0000-00-00', 1, ' ', 0, 'english', 0, 0, 0, 0, '', 1, 0, UNIX_TIMESTAMP(NOW()), 1, '', NULL, 1, 1, 0, 0, 0, 0, 0, 0);1926 INSERT INTO `users` (`uid`, `name`, `old_password`, `pass`, `secret`, `email`, `status`, `added`, `editsecret`, `privacy`, `acceptpms`, `ip`, `class`, `avatar`, `uploaded`, `downloaded`, `title`, `country`, `notifs`, `modcomment`, `enabled`, `avatars`, `donor`, `warneduntil`, `warn`, `torrentsperpage`, `deletepms`, `savepms`, `torrent_pass`, `tzoffset`, `user_dst`, `hiddentorrents`, `parked`, `invites`, `invited_by`, `download`, `upload`, `icq`, `msn`, `aim`, `yahoo`, `skype`, `commentpm`, `gender`, `birthday`, `autodemote`, `language`, `total_seed_time`, `user_reputation`, `user_reputation_level`, `user_session_time`, `user_session_page`, `user_level`, `user_posts`, `user_lastvisit`, `notify_forum`, `user_sig`, `user_sig_bbcode_uid`, `user_style`, `can_leech`, `wait_time`, `peers_limit`, `torrents_limit`, `torrent_pass_secret`, `user_unread_pms`, `user_rank_id`) VALUES 1927 (0, 'Anonymous', '', '', '', '', 1, 943909200, '', 1, 1, '0.0.0.0', 1, '', 0, 0, '', 0, '', '', 1, 1, 0, 0, 0, 0, 1, 0, 'fbc807cec4a079dd5add35845ec9d059', 0.00, 0, 0, 0, 0, 0, 65536, 65536, '', '', '', '', '', 1, 0, '0000-00-00', 1, 'russian', 3600000, 0, 0, 943909200, '0', NULL, 0, 0, 1, NULL, NULL, 1, 1, 0, 0, 5, 0, 0, 0), 1928 (1, 'admin', '', 'd41d8cd98f00b204e9800998ecf8427e', '', 'EMAIL@ADDRESS.COM', 1, UNIX_TIMESTAMP(NOW()), '', 3, 1, '127.0.0.1', 7, '', 0, 0, '', 3, '', '', 1, 1, 0, 0, 0, 60, 1, 1, MD5(UNIX_TIMESTAMP(NOW())), 3.00, 1, 0, 0, 0, 0, 10485760, 10485760, '', '', '', '', '', 1, 0, '0000-00-00', 1, 'english', 0, 0, 0, 0, '', 1, 0, UNIX_TIMESTAMP(NOW()), 1, '', NULL, 1, 1, 0, 0, 0, 0, 0, 0); 1933 1929 1934 1930 -- -------------------------------------------------------- … … 2015 2011 -- 2016 2012 2013 CREATE TABLE IF NOT EXISTS tags ( 2014 tag_name varchar(255) NOT NULL, 2015 tag_type tinyint(1) NOT NULL, 2016 tag_for_id int(10) NOT NULL, 2017 tag_count int(10) NOT NULL DEFAULT '0', 2018 KEY tag_type (tag_type), 2019 KEY tag_for_id (tag_for_id) 2020 ) ENGINE=MyISAM DEFAULT CHARSET=utf8; 2021 2022 CREATE TABLE IF NOT EXISTS tags_users ( 2023 tag_users_uid int(10) NOT NULL, 2024 tag_users_for_id int(10) NOT NULL, 2025 tag_users_type tinyint(1) NOT NULL, 2026 tag_users_name varchar(255) NOT NULL, 2027 KEY tag_users_type (tag_users_type), 2028 KEY tag_users_for_id (tag_users_for_id), 2029 KEY tag_users_uid (tag_users_uid) 2030 ) ENGINE=MyISAM DEFAULT CHARSET=utf8; tags.php
r241 r269 2 2 $root_path = './'; 3 3 require ($root_path . 'include/config.php'); 4 require ($root_path . 'include/ functions_post.php');4 require ($root_path . 'include/bbcode/bbcode.lib.php'); 5 5 6 6 $userdata = session_pagestart($user_ip); … … 9 9 10 10 require_once ($root_path . 'languages/lang_' . $userdata['language'] . '/lang_bbcode.php'); 11 12 /* */ 13 $bb_code = new bbcode; 14 /* */ 11 15 12 16 $test = request_var('test', ''); … … 17 21 ); 18 22 19 if ($test) { 23 if ( $test ) { 24 25 $bb_code->parse($test); 26 $test = $bb_code->get_html(); 27 20 28 $template->assign_block_vars('test_zone', array( 21 'FORMATTED_TEST' => format_comment($test))22 );29 'FORMATTED_TEST' => $test 30 )); 23 31 } 24 32 for ($i = 0; $i < sizeof($bbcode_faq_lang); $i++) { 25 33 26 $result = format_comment($bbcode_faq_lang[$i][3]); 34 $result = $bbcode_faq_lang[$i][3]; 35 $bb_code->parse($result); 36 $result = $bb_code->get_html(); 37 27 38 $template->assign_block_vars('tags_row', array( 28 39 'NAME' => $bbcode_faq_lang[$i][0], 29 'RESULT' => format_comment($bbcode_faq_lang[$i][3]),40 'RESULT' => $result, 30 41 'DESCRIPTION' => $bbcode_faq_lang[$i][1], 31 42 'SYNTAX' => $bbcode_faq_lang[$i][2], templates/bithdtv/bbcode.html
r225 r269 1 <!-- BEGIN ulist_open --><ul class="liststyle"><!-- END ulist_open -->2 <!-- BEGIN ulist_open_default --><ul><!-- END ulist_open_default -->3 <!-- BEGIN ulist_close --></ul><!-- END ulist_close -->4 5 <!-- BEGIN olist_open --><ol style="list-style-type: {LIST_TYPE}"><!-- END olist_open -->6 <!-- BEGIN olist_close --></ol><!-- END olist_close -->7 8 <!-- BEGIN listitem --><li><!-- END listitem -->9 <!-- BEGIN listitem_close --></li><!-- END listitem_close -->10 11 1 <!-- BEGIN quote_username_open --> 12 2 <div class="quotetitle">{USERNAME} {L_POSTED}:</div><div class="quotecontent"> … … 20 10 </div> 21 11 <!-- END quote_close --> 12 13 <!-- BEGIN spoiler_header_open --> 14 <div class="quotetitle"><a href="javascript:;" onclick="$(this).parents('div:first').next('div').toggle('slow');">{TEXT}:</a></div><div class="quotecontent" style="display:none;"> 15 <!-- END spoiler_header_open --> 16 17 <!-- BEGIN spoiler_open --> 18 <div class="quotetitle"><a href="javascript:;" onclick="$(this).parents('div:first').next('div').toggle('slow');">{L_SPOILER}:</a></div><div class="quotecontent" style="display:none"> 19 <!-- END spoiler_open --> 20 21 <!-- BEGIN spoiler_close --> 22 </div> 23 <!-- END spoiler_close --> 22 24 23 25 <!-- BEGIN pre --> … … 33 35 <!-- END code_close --> 34 36 35 <!-- BEGIN offtop_open --> </span>36 < span class="offtop"><b>{L_OFFTOP}:</b><!-- END offtop_open -->37 < !-- BEGIN offtop_close --></span>38 < span class="postbody"><!-- END offtop_close-->37 <!-- BEGIN offtop_open --> 38 </span> 39 <span class="offtop"><b>{L_OFFTOP}:</b> 40 <!-- END offtop_open --> 39 41 40 <!-- BEGIN b_open --><strong><!-- END b_open --> 41 <!-- BEGIN b_close --></strong><!-- END b_close --> 42 43 <!-- BEGIN u_open --><u><!-- END u_open --> 44 <!-- BEGIN u_close --></u><!-- END u_close --> 45 46 <!-- BEGIN i_open --><em><!-- END i_open --> 47 <!-- BEGIN i_close --></em><!-- END i_close --> 48 49 <!-- BEGIN color_open --><span style="color: {COLOR}"><!-- END color_open --> 50 <!-- BEGIN color_close --></span><!-- END color_close --> 51 52 <!-- BEGIN size_open --><span style="font-size: {SIZE}px; line-height: normal"><!-- END size_open --> 53 <!-- BEGIN size_close --></span><!-- END size_close --> 54 55 <!-- BEGIN font --><span style="font-family: {FONT_FAMILY};">{CONTENT}</span><!-- END font --> 56 57 <!-- BEGIN img --><img src="{URL}" alt="" onload="imgFit(this, 500);" onclick="imgFit(this, 500);" /><!-- END img --> 58 59 <!-- BEGIN url --><a href="{URL}" target="_blank">{DESCRIPTION}</a><!-- END url --> 60 61 <!-- BEGIN email --><a href="mailto:{EMAIL}">{DESCRIPTION}</a><!-- END email --> 42 <!-- BEGIN offtop_close --> 43 </span><br /> 44 <span class="postbody"> 45 <!-- END offtop_close --> 62 46 63 47 <!-- BEGIN mod_username_open --> … … 83 67 <!-- END mod_close --> 84 68 85 <!-- BEGIN thmbimg -->86 <div align="{ALIGN}">87 <table border="0">88 <tr>89 <td><img src="{IMAGE}" align="center" border="0" {SIZE} onclick="window.open( '{IMAGE}', 'imgpop', 'width={WIDTH},height={HEIGHT},status=no,toolbar=no,menubar=no' );return false" /></td>90 </tr>91 <tr>92 <td align="center" class="gensmall"><i>{NOTICE}</i></td>93 </tr>94 </table>95 </div>96 <!-- END thmbimg -->97 98 69 <!-- BEGIN flash --> 99 70 <object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0" width="{WIDTH}" height="{HEIGHT}"> templates/bithdtv/bithdtv.cfg
r87 r269 139 139 $config['vote_graphic_length'] = 300; 140 140 141 $config['min_tag_size'] = '11'; //min tag size in pixeils 142 $config['max_tag_size'] = '25'; //max tag size in pixeils 143 141 144 // Start add - Online/Offline/Hidden Mod 142 145 $images['icon_online'] = $current_template_images . '/{LANG}/icon_online.png'; templates/bithdtv/bithdtv.css
r240 r269 667 667 a.postlink:hover { text-decoration: underline; color : #DD6900} 668 668 669 /* Quote & Code blocks */ 669 /* Copyright and bottom info */ 670 .copyright { font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #444444; letter-spacing: -1px;} 671 a.copyright { color: #444444; text-decoration: none;} 672 a.copyright:hover { color: #000000; text-decoration: underline;} 673 674 /* The text input fields background colour */ 675 input.post, textarea.post, select { 676 background-color : #FFFFFF; 677 } 678 679 /* The main submit button option */ 680 input.mainoption { 681 background-color : #FAFAFA; 682 font-weight : bold; 683 } 684 685 /* None-bold submit button */ 686 input.liteoption { 687 background-color : #FAFAFA; 688 font-weight : normal; 689 } 690 691 /* This is the line in the posting page which shows the rollover 692 help line. This is actually a text box, but if set to be the same 693 colour as the background no one will know ;) 694 */ 695 .helpline { background-color: #DEE3E7; border-style: none; } 696 /* Set Image style */ 697 img, .forumline img { 698 border: 0; 699 } 700 /* Begin Simple Subforums MOD */ 701 a.topic-new, a.topic-new:visited { color: #DD6900; } 702 a.topic-new:hover, a.topic-new:active { color: #006699; } 703 /* End Simple Subforums MOD */ 704 705 .mod { 706 margin: 10px 5px 0px 5px; 707 line-height: 125%; 708 font-size:10px; background-color:#FFFFFF; 709 border-color: #A9B8C2; 710 border-width: 1px 1px 1px 1px; 711 border-style: solid; 712 } 713 .modtable { 714 background-color: #ff6060; 715 height:50px; width: 40px; 716 text-align:center; 717 } 718 .exclamation { 719 font-weight: bold; 720 font-family: Times New Roman, Verdana; 721 font-size : 45px; 722 color: #ffffff; 723 } 724 /* Mail.ru Keyboard buttons styles 725 */ 726 .b30 { width: 18px; background-color : white; } 727 .b80 { width: 70px; background-color : white; } 728 .b100 { width: 80px; background-color : white; } 729 .b300 { width: 250px; background-color : white; } 730 731 .pager_page { 732 padding:2px; 733 font-weight:bold; 734 } 735 736 .pager_page_selected { 737 padding:2px; 738 font-weight:bold; 739 } 740 741 a.upReputationLink:link, 742 a.upReputationLink:visited 743 { 744 font-size: 1em; 745 line-height: 10px; 746 background: transparent url(images/arrow-up-v2.gif) no-repeat 0 1px; 747 padding: 3px 6px; 748 text-decoration: none; 749 } 750 751 a.upReputationLink:hover, 752 a.upReputationLink:active 753 { 754 background: transparent url(images/arrow-up-v2.gif) no-repeat 0 -15px; 755 } 756 757 a.downReputationLink:link, 758 a.downReputationLink:visited 759 { 760 font-size: 1em; 761 line-height: 10px; 762 background: transparent url(images/arrow-down-v2.gif) no-repeat 0 1px; 763 padding: 3px 6px; 764 text-decoration: none; 765 } 766 767 a.downReputationLink:hover, 768 a.downReputationLink:active 769 { 770 background: transparent url(images/arrow-down-v2.gif) no-repeat 0 -15px; 771 } 772 773 span.goodResp 774 { 775 background: #D6FEDB; 776 border: 1px solid #B6C9B9; 777 padding: 1px 3px 2px 3px; 778 } 779 780 span.badResp 781 { 782 background: #FED5CD; 783 border: 1px solid #D0AEAE; 784 padding: 1px 3px 2px 3px; 785 } 786 787 .usergoodResp 788 { 789 color: #009900; 790 } 791 792 .userbadResp 793 { 794 color: #ff3300; 795 } 796 797 .respectUserList { 798 border-top:1px solid; 799 white-space: normal; 800 } 801 802 span.goodUserResp 803 { 804 background: #ff9933; 805 border: 1px solid #ff6600; 806 padding: 0 3px 0 3px; 807 color: #ffffff; 808 } 809 810 span.badUserResp 811 { 812 background: #ff6600; 813 border: 1px solid #cc6600; 814 padding: 0 3px 0 3px; 815 color: #ffffff; 816 } 817 818 /* bb tags */ 670 819 .codetitle { 671 820 margin: 10px 5px 0px 5px; … … 727 876 } 728 877 729 .liststyle { 730 margin-left:20px; 731 } 732 733 /* Copyright and bottom info */ 734 .copyright { font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #444444; letter-spacing: -1px;} 735 a.copyright { color: #444444; text-decoration: none;} 736 a.copyright:hover { color: #000000; text-decoration: underline;} 737 738 /* The text input fields background colour */ 739 input.post, textarea.post, select { 740 background-color : #FFFFFF; 741 } 742 743 /* The main submit button option */ 744 input.mainoption { 745 background-color : #FAFAFA; 746 font-weight : bold; 747 } 748 749 /* None-bold submit button */ 750 input.liteoption { 751 background-color : #FAFAFA; 752 font-weight : normal; 753 } 754 755 /* This is the line in the posting page which shows the rollover 756 help line. This is actually a text box, but if set to be the same 757 colour as the background no one will know ;) 758 */ 759 .helpline { background-color: #DEE3E7; border-style: none; } 760 /* Set Image style */ 761 img, .forumline img { 762 border: 0; 763 } 764 /* Begin Simple Subforums MOD */ 765 a.topic-new, a.topic-new:visited { color: #DD6900; } 766 a.topic-new:hover, a.topic-new:active { color: #006699; } 767 /* End Simple Subforums MOD */ 768 769 .mod { 770 margin: 10px 5px 0px 5px; 771 line-height: 125%; 772 font-size:10px; background-color:#FFFFFF; 773 border-color: #A9B8C2; 774 border-width: 1px 1px 1px 1px; 775 border-style: solid; 776 } 777 .modtable { 778 background-color: #ff6060; 779 height:50px; width: 40px; 780 text-align:center; 781 } 782 .exclamation { 783 font-weight: bold; 784 font-family: Times New Roman, Verdana; 785 font-size : 45px; 786 color: #ffffff; 787 } 788 /* Mail.ru Keyboard buttons styles 789 */ 790 .b30 { width: 18px; background-color : white; } 791 .b80 { width: 70px; background-color : white; } 792 .b100 { width: 80px; background-color : white; } 793 .b300 { width: 250px; background-color : white; } 794 795 .pager_page { 796 padding:2px; 797 font-weight:bold; 798 } 799 800 .pager_page_selected { 801 padding:2px; 802 font-weight:bold; 803 } 804 805 a.upReputationLink:link, 806 a.upReputationLink:visited 807 { 808 font-size: 1em; 809 line-height: 10px; 810 background: transparent url(images/arrow-up-v2.gif) no-repeat 0 1px; 811 padding: 3px 6px; 812 text-decoration: none; 813 } 814 815 a.upReputationLink:hover, 816 a.upReputationLink:active 817 { 818 background: transparent url(images/arrow-up-v2.gif) no-repeat 0 -15px; 819 } 820 821 a.downReputationLink:link, 822 a.downReputationLink:visited 823 { 824 font-size: 1em; 825 line-height: 10px; 826 background: transparent url(images/arrow-down-v2.gif) no-repeat 0 1px; 827 padding: 3px 6px; 828 text-decoration: none; 829 } 830 831 a.downReputationLink:hover, 832 a.downReputationLink:active 833 { 834 background: transparent url(images/arrow-down-v2.gif) no-repeat 0 -15px; 835 } 836 837 span.goodResp 838 { 839 background: #D6FEDB; 840 border: 1px solid #B6C9B9; 841 padding: 1px 3px 2px 3px; 842 } 843 844 span.badResp 845 { 846 background: #FED5CD; 847 border: 1px solid #D0AEAE; 848 padding: 1px 3px 2px 3px; 849 } 850 851 .usergoodResp 852 { 853 color: #009900; 854 } 855 856 .userbadResp 857 { 858 color: #ff3300; 859 } 860 861 .respectUserList { 862 border-top:1px solid; 863 white-space: normal; 864 } 865 866 span.goodUserResp 867 { 868 background: #ff9933; 869 border: 1px solid #ff6600; 870 padding: 0 3px 0 3px; 871 color: #ffffff; 872 } 873 874 span.badUserResp 875 { 876 background: #ff6600; 877 border: 1px solid #cc6600; 878 padding: 0 3px 0 3px; 879 color: #ffffff; 880 } 878 ul.bb, ol.bb { 879 padding-left:25px; 880 } 881 882 .jqifade{ 883 position: absolute; 884 background-color: #aaaaaa; 885 } 886 div.jqi{ 887 width: 400px; 888 font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; 889 position: absolute; 890 background-color: #ffffff; 891 font-size: 11px; 892 text-align: left; 893 border: solid 1px #eeeeee; 894 -moz-border-radius: 10px; 895 -webkit-border-radius: 10px; 896 padding: 7px; 897 } 898 div.jqi .jqicontainer{ 899 font-weight: bold; 900 } 901 div.jqi .jqiclose{ 902 position: absolute; 903 top: 4px; right: -2px; 904 width: 18px; 905 cursor: default; 906 color: #bbbbbb; 907 font-weight: bold; 908 } 909 div.jqi .jqimessage{ 910 padding: 10px; 911 line-height: 20px; 912 color: #444444; 913 } 914 div.jqi .jqibuttons{ 915 text-align: right; 916 padding: 5px 0 5px 0; 917 border: solid 1px #eeeeee; 918 background-color: #f4f4f4; 919 } 920 div.jqi button{ 921 padding: 3px 10px; 922 margin: 0 10px; 923 background-color: #2F6073; 924 border: solid 1px #f4f4f4; 925 color: #ffffff; 926 font-weight: bold; 927 font-size: 12px; 928 } 929 div.jqi button:hover{ 930 background-color: #728A8C; 931 } 932 div.jqi button.jqidefaultbutton{ 933 background-color: #BF5E26; 934 } 935 .jqiwarning .jqi .jqibuttons{ 936 background-color: #BF5E26; 937 } 938 939 .ac_results { 940 padding: 0px; 941 border: 1px solid WindowFrame; 942 background-color: Window; 943 overflow: hidden; 944 } 945 946 .ac_results ul { 947 width: 100%; 948 list-style-position: outside; 949 list-style: none; 950 padding: 0; 951 margin: 0; 952 } 953 954 .ac_results iframe { 955 display:none;/*sorry for IE5*/ 956 display/**/:block;/*sorry for IE5*/ 957 position:absolute; 958 top:0; 959 left:0; 960 z-index:-1; 961 filter:mask(); 962 width:3000px; 963 height:3000px; 964 } 965 966 .ac_results li { 967 margin: 0px; 968 padding: 2px 5px; 969 cursor: pointer; 970 display: block; 971 width: 100%; 972 font: menu; 973 font-size: 12px; 974 overflow: hidden; 975 } 976 977 .ac_over { 978 background-color: Highlight; 979 color: HighlightText; 980 } templates/bithdtv/browse.html
r259 r269 28 28 <table width=700 class=main border=0 cellpadding=5> 29 29 <tr> 30 <td class=detail align=center width=35%><b>{L_SEARCH} </b><input type="text" name="search" size="35" value="{SEARCH_STRING}" onmouseover="return overlib( '{L_JS_SEARCH_EXPLAIN}');" onmouseout="return nd();" /></td>30 <td class=detail align=center width=35%><b>{L_SEARCH} </b><input type="text" name="search" size="35" value="{SEARCH_STRING}" onmouseover="return overlib(L_JS_SEARCH_EXPLAIN);" onmouseout="return nd();" /></td> 31 31 <td class=detail align=center width=28%><b>{L_IN} </b>{CAT_DROP_DOWN}</td> 32 <td class=detail align=center width=17%><b>{L_IN} </b> <select name="search_in"><option value="1" {SEARCH_IN_CHECKED_1}>{L_NAME}</option><option value="2" {SEARCH_IN_CHECKED_2}>{L_DESCRIPTION}</option></select></td>32 <td class=detail align=center width=17%><b>{L_IN} </b>{SEARCH_IN_SELECT}</td> 33 33 <tr> 34 34 <td colspan=5 align=center><input type="submit" value="{L_SEARCH}" /></td> templates/bithdtv/details.html
r259 r269 3 3 <script type="text/javascript" src="{ROOT_PATH}js/ajax.js"></script> 4 4 <script type="text/javascript" src="{ROOT_PATH}js/ajax_common.js"></script> 5 <script type="text/javascript">6 var sos_confirm = '{L_SOS_CONFIRM}';7 var simpaty_descr = '{L_SIMPATY_DESCR}';8 var resp = '{L_RESPECT}';9 var antiresp = '{L_ANTIRESPECT}';10 var L_JS_SEE_FULL_LIST = '{L_SEE_FULL_LIST}';11 var L_JS_HIDE_LIST = '{L_HIDE_LIST}';12 </script>13 5 14 <!-- BEGIN torrent_details -->15 6 <!-- IF MESSAGE1 --><h1>{MESSAGE1}</h1><!-- ENDIF --> 16 7 <!-- IF MESSAGE2 --><p>{MESSAGE2}</p><!-- ENDIF --> … … 40 31 </tr> 41 32 <!-- END switch_nfo_section --> 42 <!-- BEGIN switch_banned_section-->33 <!-- IF S_USER_IS_MOD --> 43 34 <tr> 44 35 <td class="detail" valign="top" align="right">{L_BANNED}</td> 45 36 <td class="detail" valign="top" align="left">{BANNED}</td> 46 37 </tr> 47 <!-- END switch_banned_section-->38 <!-- ENDIF --> 48 39 <tr> 49 40 <td class="detail" valign="top" align="right">{L_TYPE}</td> 50 41 <td class="detail" valign="top" align="left">{TYPE}</td> 42 </tr> 43 <tr> 44 <td class="detail" valign="top" align="right">{L_TAGS}</td> 45 <td class="detail" valign="top" align="left"><!-- INCLUDE tags_view_form.html --></td> 51 46 </tr> 52 47 <tr> … … 64 59 <select name="rating" id="rating_select"> 65 60 <option value="0">({L_ADD_RATING})</option> 66 { torrent_details.switch_rating_form.RATING_OPTIONS}61 {switch_rating_form.RATING_OPTIONS} 67 62 </select> 68 63 <input type="button" value="{L_VOTE}!" onclick="rating('{ID}', document.getElementById('rating_select').value );return false;" id="rating_button" /> … … 86 81 <td class="detail" valign="top" align="right"><a name="snatchedlist" id="snatchedlist"></a>{L_SNATCHED_USERS}<br /> 87 82 <a href="javascript:void(0);" onclick="view_details_ext('snatchedlist', '{ID}', 'details');" id="snatchedlist_href">[<!-- IF SNATCHEDLIST_TPL -->{L_HIDE_LIST}<!-- ELSE -->{L_SEE_FULL_LIST}<!-- ENDIF -->]</a></td> 88 <td class="detail" valign="top" align="left">{ torrent_details.switch_simple_snatched.SIMPLE_SNATCHED_COUNT}<div id="snatchedlist_row">{SNATCHEDLIST_TPL}</div></td>83 <td class="detail" valign="top" align="left">{switch_simple_snatched.SIMPLE_SNATCHED_COUNT}<div id="snatchedlist_row">{SNATCHEDLIST_TPL}</div></td> 89 84 </tr> 90 85 <!-- END switch_simple_snatched --> … … 127 122 </tr> 128 123 <!-- END switch_sos_section --> 129 <tr> 130 <td class="detail" valign="top" align="right">{L_THANKS_USERS}</td> 131 <td class="detail" valign="top" align="left"> 132 <!-- BEGIN switch_thanks --> 133 <input type="button" id="thanks_button" value="{L_THANKS}" onclick="thanks('{ID}', <!-- IF torrent_details.switch_thanks.THANKS_USERS -->1<!-- ELSE -->0<!-- ENDIF -->);return false;" {torrent_details.switch_thanks.DISABLED} /> 134 <span id="thanks_users"><!-- IF torrent_details.switch_thanks.THANKS_USERS -->{torrent_details.switch_thanks.THANKS_USERS}<!-- ELSE -->{L_NO_THANKS}<!-- ENDIF --></span> 135 <!-- END switch_thanks --> 136 </td> 137 </tr> 124 125 <tr> 126 <td class="detail" valign="top" align="right">{L_THANKS_USERS}</td> 127 <td class="detail" valign="top" align="left"><input type="button" id="thanks_button" value="{L_THANKS}" onclick="thanks('{ID}', 0);return false;" /> 128 <a href="javascript:;" onclick="view_details_ext('thanks', '{ID}', 'details');" id="thanks_href">[{L_SEE_FULL_LIST}]</a><div id="thanks_row"></div></td> 129 </tr> 130 138 131 </table> 139 <!-- END torrent_details -->140 132 141 142 <!-- BEGIN switch_comments_details_head --> 143 144 <h1>{switch_comments_details_head.COMMENTS_FOR}</h1> 145 <!-- END switch_comments_details_head --> 146 <br /> 147 <!-- BEGIN switch_no_comments_details --> 148 <h1>{L_NO_COMMENTS_YET}</h1> 149 <!-- IF switch_no_comments_details.DISABLE_COMMENTS == 0 --><a href="{switch_no_comments_details.U_ADD_COMMENT}">{switch_no_comments_details.L_ADD_NEW_COMMENT}</a> 150 151 <!-- IF switch_no_comments_details.U_CHECK --><a href="{switch_no_comments_details.U_CHECK}">{switch_no_comments_details.CHECK_TITLE}</a><!-- ENDIF --><!-- ELSE -->{L_COMMENTS_DISABLED}<!-- ENDIF --> 133 <!-- INCLUDE details_comments.html --> 152 134 153 135 <!-- INCLUDE overall_footer.html --> 154 155 <!-- END switch_no_comments_details -->156 157 158 <!-- BEGIN switch_comments_details -->159 <!-- IF switch_comments_details.DISABLE_COMMENTS == 0 --><a href="{switch_comments_details.U_ADD_COMMENT}">{switch_comments_details.L_ADD_NEW_COMMENT}</a>160 161 <!-- IF switch_comments_details.U_CHECK --><a href="{switch_comments_details.U_CHECK}">{switch_comments_details.CHECK_TITLE}</a><!-- ENDIF --><!-- ELSE -->{L_COMMENTS_DISABLED}<!-- ENDIF -->162 <br />163 {switch_comments_details.PAGERTOP}164 <br />165 <a name="startcomments" id="startcomments"></a>166 {COMMENTS_TABLE}167 {switch_comments_details.PAGERBOTTOM}168 <!-- IF switch_comments_details.DISABLE_COMMENTS == 0 --><a href="{switch_comments_details.U_ADD_COMMENT}">{switch_comments_details.L_ADD_NEW_COMMENT}</a>169 170 <!-- IF switch_comments_details.U_CHECK --><a href="{switch_comments_details.U_CHECK}">{switch_comments_details.CHECK_TITLE}</a><!-- ENDIF --><!-- ELSE -->{L_COMMENTS_DISABLED}<!-- ENDIF -->171 172 <!-- INCLUDE overall_footer.html -->173 <!-- END switch_comments_details -->templates/bithdtv/forum/index_body.tpl
r87 r269 8 8 </td> 9 9 <td align="right" valign="bottom"> 10 <!-- BEGIN switch_curuser_view-->10 <!-- IF S_USER_LOGGED_IN --> 11 11 <a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br /><a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_YOUR_POSTS}</a><br /> 12 <!-- END switch_curuser_view-->12 <!-- ENDIF --> 13 13 <a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a></td> 14 14 </tr> … … 49 49 <tr> 50 50 <td align="left"> 51 <!-- BEGIN switch_curuser_view-->51 <!-- IF S_USER_LOGGED_IN --> 52 52 <span class="gensmall"><a href="{U_MARK_READ}" class="gensmall">{L_MARK_ALL_FORUMS}</a></span> 53 <!-- END switch_curuser_view-->53 <!-- ENDIF --> 54 54 </td> 55 55 <td align="right"><span class="gensmall">{S_TIMEZONE}</span></td> templates/bithdtv/forum/modcp_delete_posts.tpl
r87 r269 31 31 <table width="100%" cellspacing="0" cellpadding="3" border="0"> 32 32 <tr> 33 <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="templates/main/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_ POSTED}:33 <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="templates/main/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_ADDED}: 34 34 {postrow.POST_DATE} {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 35 35 </tr> templates/bithdtv/forum/modcp_split.tpl
r87 r269 52 52 <table width="100%" cellspacing="0" cellpadding="3" border="0"> 53 53 <tr> 54 <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="templates/main/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_ POSTED}:54 <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="templates/main/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_ADDED}: 55 55 {postrow.POST_DATE} {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 56 56 </tr> templates/bithdtv/forum/posting_body.tpl
r259 r269 372 372 <option style="color:black; background-color: {T_TD_COLOR1}" value="black" class="genmed">{L_COLOR_BLACK}</option> 373 373 </select> <select name="addbbcodefontsize" onChange="bbfontstyle('[size=' + this.form.addbbcodefontsize.options[this.form.addbbcodefontsize.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;" onMouseOver="helpline('f')"> 374 <option value="0" selected="selected">{L_ TEXT_SIZE}</option>375 <option value=" 7" class="genmed">{L_FONT_TINY}</option>376 <option value=" 9" class="genmed">{L_FONT_SMALL}</option>377 <option value=" 12" class="genmed">{L_FONT_NORMAL}</option>378 <option value=" 18" class="genmed">{L_FONT_LARGE}</option>379 <option value=" 24" class="genmed">{L_FONT_HUGE}</option>374 <option value="0" selected="selected">{L_FONT_SIZE}</option> 375 <option value="1" class="genmed">{L_FONT_TINY}</option> 376 <option value="2" class="genmed">{L_FONT_SMALL}</option> 377 <option value="3" class="genmed">{L_FONT_NORMAL}</option> 378 <option value="5" class="genmed">{L_FONT_LARGE}</option> 379 <option value="7" class="genmed">{L_FONT_HUGE}</option> 380 380 </select> 381 381 </span></td> templates/bithdtv/forum/posting_preview.tpl
r87 r269 1 1 <table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0"> 2 <tr> 2 <tr> 3 3 <th height="25" class="thHead">{L_PREVIEW}</th> 4 4 </tr> 5 <tr> 6 <td class="row1" align="left"><img src="templates/main/images/icon_minipost.gif" alt="{L_POST}" /><span class="postdetails">{L_ POSTED}: {POST_DATE} {L_POST_SUBJECT}: {POST_SUBJECT}</span></td>5 <tr> 6 <td class="row1" align="left"><img src="templates/main/images/icon_minipost.gif" alt="{L_POST}" /><span class="postdetails">{L_ADDED}: {POST_DATE} {L_POST_SUBJECT}: {POST_SUBJECT}</span></td> 7 7 </tr> 8 <tr> 8 <tr> 9 9 <td class="row1"><table width="100%" border="0" cellspacing="0" cellpadding="0"> 10 10 <tr> … … 15 15 </table></td> 16 16 </tr> 17 <tr> 17 <tr> 18 18 <td class="spaceRow" height="1"><img src="templates/main/images/spacer.gif" width="1" height="1" /></td> 19 19 </tr> templates/bithdtv/forum/posting_topic_review.tpl
r87 r269 19 19 <td class="{postrow.ROW_CLASS}" height="28" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> 20 20 <tr> 21 <td width="100%"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_ POSTED}: {postrow.POST_DATE}<span class="gen"> </span> {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>21 <td width="100%"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_ADDED}: {postrow.POST_DATE}<span class="gen"> </span> {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 22 22 </tr> 23 23 <tr> templates/bithdtv/forum/search_results_posts.tpl
r87 r269 28 28 {L_VIEWS}: <b>{searchresults.TOPIC_VIEWS}</b></span><br /> 29 29 </td> 30 <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_FORUM}: <b><a href="{searchresults.U_FORUM}" class="postdetails">{searchresults.FORUM_NAME}</a></b> {L_ POSTED}: {searchresults.POST_DATE} {L_SUBJECT}: <b><a href="{searchresults.U_POST}">{searchresults.POST_SUBJECT}</a></b></span></td>30 <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_FORUM}: <b><a href="{searchresults.U_FORUM}" class="postdetails">{searchresults.FORUM_NAME}</a></b> {L_ADDED}: {searchresults.POST_DATE} {L_SUBJECT}: <b><a href="{searchresults.U_POST}">{searchresults.POST_SUBJECT}</a></b></span></td> 31 31 </tr> 32 32 <tr> templates/bithdtv/forum/topic_search_results.tpl
r87 r269 26 26 <br /> 27 27 </td> 28 <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails"> {L_ POSTED}: {searchresults.POST_DATE} </span></td>28 <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails"> {L_ADDED}: {searchresults.POST_DATE} </span></td> 29 29 </tr> 30 30 <tr> templates/bithdtv/forum/viewtopic_body.tpl
r259 r269 85 85 <td class="{postrow.ROW_CLASS}" height="28" valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"> 86 86 <tr> 87 <td class="{postrow.ROW_CLASS}" align="left"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_ POSTED}: {postrow.POST_DATE}<span class="gen"> </span> {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>87 <td class="{postrow.ROW_CLASS}" align="left"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_ADDED}: {postrow.POST_DATE}<span class="gen"> </span> {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 88 88 <td valign="top" nowrap="nowrap" class="{postrow.ROW_CLASS}" align="right">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td> 89 89 </tr> templates/bithdtv/overall_header.html
r260 r269 12 12 <link href="{TEMPLATE_PATH}/bithdtv.css" rel="stylesheet" type="text/css" media="screen" /> 13 13 <script type="text/javascript" src="{ROOT_PATH}js/functions.js"></script> 14 <script type="text/javascript" src="{ROOT_PATH}js/jquery.js"></script> 14 15 <script type="text/javascript"> 15 var sizes_ary = {'{L_KILOBYTES}':1024,'{L_MEGABYTES}':1024*1024,'{L_GIGABYTES}':1024*1024*1024,'{L_TERABYTES}':1024*1024*1024*1024};16 16 var SID = '{SID}'; 17 17 var TRACKER_URL = '{ROOT_PATH}'; 18 var l_post_something = '{L_POST_SOMETHING}';19 var L_JS_MARKED = '{L_MARKED}';20 18 var ol_fgcolor = "#FFFFFF"; 19 20 <!-- BEGIN javascript_lang --> 21 var {javascript_lang.KEY} = '{javascript_lang.VALUE}'; 22 <!-- END --> 21 23 </script> 22 24 </head> … … 28 30 <div id="logo"> 29 31 <table width="852"> 30 <!-- BEGIN switch_curuser_view-->32 <!-- IF S_USER_LOGGED_IN --> 31 33 <tr> 32 34 <td class="btnbg2" align="center"><a href="{U_MY}">{L_CONTROL_PANEL}</a></td> … … 58 60 <td class="btnbg2" align="center"><a href="{U_DONATE}">{L_DONATE}</a></td> 59 61 </tr> 60 <!-- END switch_curuser_view-->62 <!-- ENDIF --> 61 63 62 <!-- BEGIN switch_moderator_view-->64 <!-- IF S_USER_IS_MOD --> 63 65 <tr> 64 66 <td class="btnbg2" align="center"><a href="{U_HELPDESC}"><!-- IF HELPDESC_NUM > 0 --><span style="color:red;"><b>{L_HELPDESC} ({HELPDESC_NUM})</b></span><!-- ELSE --><span>{L_HELPDESC}</span><!-- ENDIF --></a></td> … … 70 72 <td class="btnbg2" align="center"><a href="{U_USERSEARCH}"><span>{L_USER_SEARCH}</span></a></td> 71 73 <td class="per">::</td> 72 <!-- END switch_moderator_view-->74 <!-- ENDIF --> 73 75 <!-- BEGIN switch_admin_view --> 74 76 <td class="btnbg2" align="center"><a href="{U_RELEASES_ADD}"><span>{L_RELEASES}</span></a></td> … … 83 85 </div> 84 86 85 <!-- BEGIN user_panel-->87 <!-- IF S_USER_LOGGED_IN --> 86 88 <div id="statusbar"> 87 89 <table cellpadding="4" cellspacing="1" border="0" width="852"> 88 90 <tr> 89 <td>{L_HELLO}<a href="{U_USERDETAILS_LINK}">{ user_panel.CURUSER_NAME}</a> {user_panel.CURUSER_ICONS}91 <td>{L_HELLO}<a href="{U_USERDETAILS_LINK}">{CURRENT_USER_NAME}</a> {CURRENT_USER_ICONS} 90 92 91 93 <span class="<!-- IF CURRENT_USER_POINTS_LEVEL < 0 -->badUserResp<!-- ELSE -->goodUserResp<!-- ENDIF -->">{CURRENT_USER_POINTS_LEVEL}</span> … … 93 95 [<a href="{U_LOGOUT}">{L_LOGOUT}</a>]<br /> 94 96 95 <span style="color:#BE5101">{L_RATIO}:</span> { user_panel.RATIO}96 <span style="color:green">{L_UPLOADED}:</span> { user_panel.UPED}97 <span style="color:red">{L_DOWNLOADED}:</span> { user_panel.DOWNED}98 { user_panel.WARN_PANEL}</td>99 <td align="right">{ user_panel.S_CURRENT_TIME}<br />100 <a href="{U_MESSAGES_INBOX}"><img src="{ user_panel.INBOX_PM_PIC}" height="14" alt="{user_panel.PM_TITLE}" /></a> {L_INBOX}101 <a href="{U_MESSAGES_SENTBOX}"> <img src="{ user_panel.SENTBOX_PIC}" height="14" alt="{L_SENTBOX}" /></a> {L_SENTBOX}102 <a href="{U_MY_FRIENDS}"><img src="{ user_panel.BUDDYLIST_PIC}" height="14" alt="{L_BUDDYLIST}" /></a></td>97 <span style="color:#BE5101">{L_RATIO}:</span> {CURRENT_USER_RATIO} 98 <span style="color:green">{L_UPLOADED}:</span> {CURRENT_USER_UPED} 99 <span style="color:red">{L_DOWNLOADED}:</span> {CURRENT_USER_DOWNED} 100 {CURRENT_USER_WARN_PANEL}</td> 101 <td align="right">{S_CURRENT_TIME}<br /> 102 <a href="{U_MESSAGES_INBOX}"><img src="{INBOX_PM_PIC}" height="14" alt="{PM_TITLE}" /></a> {L_INBOX} 103 <a href="{U_MESSAGES_SENTBOX}"> <img src="{SENTBOX_PIC}" height="14" alt="{L_SENTBOX}" /></a> {L_SENTBOX} 104 <a href="{U_MY_FRIENDS}"><img src="{BUDDYLIST_PIC}" height="14" alt="{L_BUDDYLIST}" /></a></td> 103 105 </tr> 104 106 </table> … … 109 111 clock.tik_tak(); 110 112 </script> 111 <!-- END user_panel-->113 <!-- ENDIF --> 112 114 113 115 <div id="menuwrapper" align="center"> … … 122 124 <td class="btnbg" align="center"><a href="{U_UPLOAD}">{L_UPLOAD}</a></td> 123 125 <!-- END switch_uploader_view --> 124 <!-- BEGIN switch_non_curuser_view-->126 <!-- IF not S_USER_LOGGED_IN --> 125 127 <td class="btnbg" align="center"><a href="{U_LOGIN}">{L_LOGIN}</a></td> 126 128 <td class="btnbg" align="center"><a href="{U_SIGNUP}">{L_SIGNUP}</a></td> 127 <!-- END switch_non_curuser_view-->129 <!-- ENDIF --> 128 130 <td class="btnbg" align="center"><a href="{U_FORUM}">{L_FORUMS}</a></td> 129 131 <td class="btnbg" align="center"><a href="{U_RULES}">{L_RULES}</a></td> 130 132 <td class="btnbg" align="center"><a href="{U_FAQ}">{L_FAQ}</a></td> 131 <!-- BEGIN switch_curuser_view-->133 <!-- IF S_USER_LOGGED_IN --> 132 134 <td class="btnbg" align="center"><a href="{U_TOPTEN}">{L_TOP10}</a></td> 133 135 <td class="btnbg" align="center"><a href="{U_LOG}">{L_LOG}</a></td> 134 136 <td class="btnbg" align="center"><a href="{U_HELPDESC}">{L_HELPDESC}</a></td> 135 <!-- END switch_curuser_view-->137 <!-- ENDIF --> 136 138 <td class="btnbg" align="center"><a href="{U_STAFF}">{L_STAFF}</a></td> 137 139 </tr> templates/bithdtv/textbbcode.html
r259 r269 279 279 </select> 280 280 281 <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;"> 282 <option value="0" selected="selected">{L_TEXT_SIZE}</option> 283 <option value="7" class="genmed">{L_SMALL}</option> 284 <option value="11" class="genmed">{L_STANDART}</option> 285 <option value="16" class="genmed">{L_BIG}</option> 286 <option value="24" class="genmed">{L_VERY_BIG}</option> 281 <select name="addbbcode30" onchange="bbfontstyle('[size=' + this.form.addbbcode30.options[this.form.addbbcode30.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;"> 282 <option value="0" selected="selected">{L_FONT_SIZE}</option> 283 <option value="1" class="genmed">{L_FONT_TINY}</option> 284 <option value="2" class="genmed">{L_FONT_SMALL}</option> 285 <option value="3" class="genmed">{L_FONT_NORMAL}</option> 286 <option value="5" class="genmed">{L_FONT_LARGE}</option> 287 <option value="7" class="genmed">{L_FONT_HUGE}</option> 287 288 </select> 288 289 templates/bithdtv/userdetails.html
r260 r269 3 3 <script type="text/javascript" src="{ROOT_PATH}js/ajax.js"></script> 4 4 <script type="text/javascript" src="{ROOT_PATH}js/ajax_common.js"></script> 5 <script type="text/javascript">6 var L_JS_SEE_FULL_LIST = '{L_SEE_FULL_LIST}';7 var L_JS_HIDE_LIST = '{L_HIDE_LIST}';8 </script>9 5 10 6 <p> templates/main/bbcode.html
r225 r269 1 <!-- BEGIN ulist_open --><ul class="liststyle"><!-- END ulist_open -->2 <!-- BEGIN ulist_open_default --><ul><!-- END ulist_open_default -->3 <!-- BEGIN ulist_close --></ul><!-- END ulist_close -->4 5 <!-- BEGIN olist_open --><ol style="list-style-type: {LIST_TYPE}"><!-- END olist_open -->6 <!-- BEGIN olist_close --></ol><!-- END olist_close -->7 8 <!-- BEGIN listitem --><li><!-- END listitem -->9 <!-- BEGIN listitem_close --></li><!-- END listitem_close -->10 11 1 <!-- BEGIN quote_username_open --> 12 2 <div class="quotetitle">{USERNAME} {L_POSTED}:</div><div class="quotecontent"> … … 20 10 </div> 21 11 <!-- END quote_close --> 12 13 <!-- BEGIN spoiler_header_open --> 14 <div class="quotetitle"><a href="javascript:;" onclick="$(this).parents('div:first').next('div').toggle('slow');">{TEXT}:</a></div><div class="quotecontent" style="display:none;"> 15 <!-- END spoiler_header_open --> 16 17 <!-- BEGIN spoiler_open --> 18 <div class="quotetitle"><a href="javascript:;" onclick="$(this).parents('div:first').next('div').toggle('slow');">{L_SPOILER}:</a></div><div class="quotecontent" style="display:none"> 19 <!-- END spoiler_open --> 20 21 <!-- BEGIN spoiler_close --> 22 </div> 23 <!-- END spoiler_close --> 22 24 23 25 <!-- BEGIN pre --> … … 33 35 <!-- END code_close --> 34 36 35 <!-- BEGIN offtop_open --> </span>36 < span class="offtop"><b>{L_OFFTOP}:</b><!-- END offtop_open -->37 < !-- BEGIN offtop_close --></span>38 < span class="postbody"><!-- END offtop_close-->37 <!-- BEGIN offtop_open --> 38 </span> 39 <span class="offtop"><b>{L_OFFTOP}:</b> 40 <!-- END offtop_open --> 39 41 40 <!-- BEGIN b_open --><strong><!-- END b_open --> 41 <!-- BEGIN b_close --></strong><!-- END b_close --> 42 43 <!-- BEGIN u_open --><u><!-- END u_open --> 44 <!-- BEGIN u_close --></u><!-- END u_close --> 45 46 <!-- BEGIN i_open --><em><!-- END i_open --> 47 <!-- BEGIN i_close --></em><!-- END i_close --> 48 49 <!-- BEGIN color_open --><span style="color: {COLOR}"><!-- END color_open --> 50 <!-- BEGIN color_close --></span><!-- END color_close --> 51 52 <!-- BEGIN size_open --><span style="font-size: {SIZE}px; line-height: normal"><!-- END size_open --> 53 <!-- BEGIN size_close --></span><!-- END size_close --> 54 55 <!-- BEGIN font --><span style="font-family: {FONT_FAMILY};">{CONTENT}</span><!-- END font --> 56 57 <!-- BEGIN img --><img src="{URL}" alt="" onload="imgFit(this, 500);" onclick="imgFit(this, 500);" /><!-- END img --> 58 59 <!-- BEGIN url --><a href="{URL}" target="_blank">{DESCRIPTION}</a><!-- END url --> 60 61 <!-- BEGIN email --><a href="mailto:{EMAIL}">{DESCRIPTION}</a><!-- END email --> 42 <!-- BEGIN offtop_close --> 43 </span><br /> 44 <span class="postbody"> 45 <!-- END offtop_close --> 62 46 63 47 <!-- BEGIN mod_username_open --> … … 83 67 <!-- END mod_close --> 84 68 85 <!-- BEGIN thmbimg -->86 <div align="{ALIGN}">87 <table border="0">88 <tr>89 <td><img src="{IMAGE}" align="center" border="0" {SIZE} onclick="window.open( '{IMAGE}', 'imgpop', 'width={WIDTH},height={HEIGHT},status=no,toolbar=no,menubar=no' );return false" /></td>90 </tr>91 <tr>92 <td align="center" class="gensmall"><i>{NOTICE}</i></td>93 </tr>94 </table>95 </div>96 <!-- END thmbimg -->97 98 69 <!-- BEGIN flash --> 99 70 <object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0" width="{WIDTH}" height="{HEIGHT}"> templates/main/browse.html
r259 r269 32 32 33 33 <fieldset> 34 {L_SEARCH} <input type="text" name="search" size="40" value="{SEARCH_STRING}" onmouseover="return overlib('{L_JS_SEARCH_EXPLAIN}');" onmouseout="return nd();" /> {L_IN} {CAT_DROP_DOWN} {L_IN} 35 <select name="search_in"> 36 <option value="1" {SEARCH_IN_CHECKED_1}>{L_NAME}</option> 37 <option value="2" {SEARCH_IN_CHECKED_2}>{L_DESCRIPTION}</option> 38 </select> 34 {L_SEARCH} <input type="text" name="search" size="40" value="{SEARCH_STRING}" onmouseover="return overlib(L_JS_SEARCH_EXPLAIN);" onmouseout="return nd();" /> {L_IN} {CAT_DROP_DOWN} {L_IN} 35 {SEARCH_IN_SELECT} 39 36 <input type="submit" value="{L_SEARCH}" /><br /> 40 37 templates/main/details.html
r259 r269 4 4 <script type="text/javascript" src="{ROOT_PATH}js/ajax_common.js"></script> 5 5 <script type="text/javascript" src="{ROOT_PATH}js/overlib.js"></script> 6 <script type="text/javascript">7 var sos_confirm = '{L_SOS_CONFIRM}';8 var L_JS_SEE_FULL_LIST = '{L_SEE_FULL_LIST}';9 var L_JS_HIDE_LIST = '{L_HIDE_LIST}';10 </script>11 6 12 <!-- BEGIN torrent_details -->13 7 <!-- IF MESSAGE1 --><h1>{MESSAGE1}</h1><!-- ENDIF --> 14 8 <!-- IF MESSAGE2 --><p>{MESSAGE2}</p><!-- ENDIF --> … … 17 11 <tr> 18 12 <td>{L_DOWNLOAD}</td> 19 <td><a href="{U_DOWNLOAD}" onclick="alert('{L_DOWNLOAD_WARNING}'); return true;"<!-- IF U_DOWNLOAD_AS_GZIP --> onmouseover="return overlib('<a href="{U_DOWNLOAD_AS_GZIP}">{L_DOWNLOAD_AS_GZIP_ARCHIVE}</a>', STICKY, MOUSEOFF);" onmouseout="return nd();"<!-- ENDIF -->>{TORRENT_FILENAME}</a><!-- IF L_ADD_TO_BOOKMARKS --> [<a href="{U_ADD_TO_BOOKMARKS}">{L_ADD_TO_BOOKMARKS}</a>] 13 <td><a href="{U_DOWNLOAD}" onclick="alert('{L_DOWNLOAD_WARNING}'); return true;"<!-- IF U_DOWNLOAD_AS_GZIP --> onmouseover="return overlib('<a href="{U_DOWNLOAD_AS_GZIP}">{L_DOWNLOAD_AS_GZIP_ARCHIVE}</a>', STICKY, MOUSEOFF);" onmouseout="return nd();"<!-- ENDIF -->>{TORRENT_FILENAME}</a> 14 <!-- IF S_USER_LOGGED_IN --> 15 16 [<a href="{U_ADD_TO_BOOKMARKS}">{L_ADD_TO_BOOKMARKS}</a>] 20 17 <!-- BEGIN switch_add_to_index --> 21 18 [<a href="{switch_add_to_index.U_ADD_TO_INDEX}">{L_ADD_TO_INDEX}</a>] 22 19 <!-- END switch_add_to_index --> 23 <!-- ENDIF --> 20 21 <!-- ENDIF --> 24 22 </td> 25 23 </tr> … … 38 36 </tr> 39 37 <!-- END switch_nfo_section --> 40 <!-- BEGIN switch_banned_section-->38 <!-- IF S_USER_IS_MOD --> 41 39 <tr> 42 40 <td>{L_BANNED}</td> 43 41 <td>{BANNED}</td> 44 42 </tr> 45 <!-- END switch_banned_section-->43 <!-- ENDIF --> 46 44 <tr> 47 45 <td>{L_TYPE}</td> 48 46 <td>{TYPE}</td> 47 </tr> 48 <tr> 49 <td>{L_TAGS}</td> 50 <td><!-- INCLUDE tags_view_form.html --></td> 49 51 </tr> 50 52 <tr> … … 62 64 <select name="rating" id="rating_select"> 63 65 <option value="0">({L_ADD_RATING})</option> 64 { torrent_details.switch_rating_form.RATING_OPTIONS}66 {switch_rating_form.RATING_OPTIONS} 65 67 </select> 66 68 <input type="button" value="{L_VOTE}!" onclick="rating('{ID}', document.getElementById('rating_select').value );return false;" id="rating_button" /> … … 80 82 <td>{HITS}</td> 81 83 </tr> 84 85 <!-- IF S_USER_LOGGED_IN --> 86 82 87 <!-- BEGIN switch_simple_snatched --> 83 88 <tr> 84 89 <td valign="top"><a name="snatchedlist" id="snatchedlist"></a>{L_SNATCHED_USERS}<br /> 85 90 <a href="javascript:void(0);" onclick="view_details_ext('snatchedlist', '{ID}', 'details');" id="snatchedlist_href">[<!-- IF SNATCHEDLIST_TPL -->{L_HIDE_LIST}<!-- ELSE -->{L_SEE_FULL_LIST}<!-- ENDIF -->]</a></td> 86 <td valign="top">{ torrent_details.switch_simple_snatched.SIMPLE_SNATCHED_COUNT}<div id="snatchedlist_row">{SNATCHEDLIST_TPL}</div></td>91 <td valign="top">{switch_simple_snatched.SIMPLE_SNATCHED_COUNT}<div id="snatchedlist_row">{SNATCHEDLIST_TPL}</div></td> 87 92 </tr> 88 93 <!-- END switch_simple_snatched --> … … 93 98 </tr> 94 99 <!-- END switch_hidden_section --> 100 101 <!-- ENDIF --> 102 95 103 <tr> 96 104 <td>{L_UPLOADED}</td> … … 111 119 <td valign="top">{NUM_FILES}<div id="filelist_row">{FILELIST_TPL}</div></td> 112 120 </tr> 121 122 <!-- IF S_USER_LOGGED_IN --> 123 113 124 <tr> 114 125 <td valign="top">{L_PEERS}<br /><a href="javascript:void(0);" onclick="view_details_ext('peerlist', '{ID}', 'details');" id="peerlist_href">[<!-- IF PEERLIST_TPL -->{L_HIDE_LIST}<!-- ELSE -->{L_SEE_FULL_LIST}<!-- ENDIF -->]</a></td> … … 127 138 <tr> 128 139 <td valign="top">{L_THANKS_USERS}</td> 129 <td valign="top"> 130 <!-- BEGIN switch_thanks --> 131 <input type="button" id="thanks_button" value="{L_THANKS}" onclick="thanks('{ID}', <!-- IF torrent_details.switch_thanks.THANKS_USERS -->1<!-- ELSE -->0<!-- ENDIF -->);return false;" {torrent_details.switch_thanks.DISABLED} /> 132 <span id="thanks_users"><!-- IF torrent_details.switch_thanks.THANKS_USERS -->{torrent_details.switch_thanks.THANKS_USERS}<!-- ELSE -->{L_NO_THANKS}<!-- ENDIF --></span> 133 <!-- END switch_thanks --> 134 </td> 140 <td valign="top"><input type="button" id="thanks_button" value="{L_THANKS}" onclick="thanks('{ID}', 0);return false;" /> 141 <a href="javascript:;" onclick="view_details_ext('thanks', '{ID}', 'details');" id="thanks_href">[{L_SEE_FULL_LIST}]</a><div id="thanks_row"></div></td> 135 142 </tr> 143 144 <!-- ENDIF --> 145 136 146 </table> 137 <!-- END torrent_details -->138 147 139 140 <!-- BEGIN switch_comments_details_head --> 141 142 <h1>{switch_comments_details_head.COMMENTS_FOR}</h1> 143 <!-- END switch_comments_details_head --> 144 <br /> 145 <!-- BEGIN switch_no_comments_details --> 146 <h1>{L_NO_COMMENTS_YET}</h1> 147 <!-- IF switch_no_comments_details.DISABLE_COMMENTS == 0 --><a href="{switch_no_comments_details.U_ADD_COMMENT}">{switch_no_comments_details.L_ADD_NEW_COMMENT}</a> 148 149 <!-- IF switch_no_comments_details.U_CHECK --><a href="{switch_no_comments_details.U_CHECK}">{switch_no_comments_details.CHECK_TITLE}</a><!-- ENDIF --><!-- ELSE -->{L_COMMENTS_DISABLED}<!-- ENDIF --> 148 <!-- INCLUDE details_comments.html --> 150 149 151 150 <!-- INCLUDE overall_footer.html --> 152 153 <!-- END switch_no_comments_details -->154 155 156 <!-- BEGIN switch_comments_details -->157 <!-- IF switch_comments_details.DISABLE_COMMENTS == 0 --><a href="{switch_comments_details.U_ADD_COMMENT}">{switch_comments_details.L_ADD_NEW_COMMENT}</a>158 159 <!-- IF switch_comments_details.U_CHECK --><a href="{switch_comments_details.U_CHECK}">{switch_comments_details.CHECK_TITLE}</a><!-- ENDIF --><!-- ELSE -->{L_COMMENTS_DISABLED}<!-- ENDIF -->160 <br />161 {switch_comments_details.PAGERTOP}162 <br />163 <a name="startcomments" id="startcomments"></a>164 {COMMENTS_TABLE}165 {switch_comments_details.PAGERBOTTOM}166 <!-- IF switch_comments_details.DISABLE_COMMENTS == 0 --><a href="{switch_comments_details.U_ADD_COMMENT}">{switch_comments_details.L_ADD_NEW_COMMENT}</a>167 168 <!-- IF switch_comments_details.U_CHECK --><a href="{switch_comments_details.U_CHECK}">{switch_comments_details.CHECK_TITLE}</a><!-- ENDIF --><!-- ELSE -->{L_COMMENTS_DISABLED}<!-- ENDIF -->169 170 <!-- INCLUDE overall_footer.html -->171 <!-- END switch_comments_details -->templates/main/forum/index_body.tpl
r89 r269 8 8 </td> 9 9 <td align="right" valign="bottom"> 10 <!-- BEGIN switch_curuser_view-->10 <!-- IF S_USER_LOGGED_IN --> 11 11 <a href="{U_SEARCH_NEW}" class="gensmall">{L_SEARCH_NEW}</a><br /><a href="{U_SEARCH_SELF}" class="gensmall">{L_SEARCH_YOUR_POSTS}</a><br /> 12 <!-- END switch_curuser_view-->12 <!-- ENDIF --> 13 13 <a href="{U_SEARCH_UNANSWERED}" class="gensmall">{L_SEARCH_UNANSWERED}</a></td> 14 14 </tr> … … 49 49 <tr> 50 50 <td align="left"> 51 <!-- BEGIN switch_curuser_view-->51 <!-- IF S_USER_LOGGED_IN --> 52 52 <span class="gensmall"><a href="{U_MARK_READ}" class="gensmall">{L_MARK_ALL_FORUMS}</a></span> 53 <!-- END switch_curuser_view-->53 <!-- ENDIF --> 54 54 </td> 55 55 <td align="right"><span class="gensmall">{S_TIMEZONE}</span></td> templates/main/forum/modcp_delete_posts.tpl
r89 r269 31 31 <table width="100%" cellspacing="0" cellpadding="3" border="0"> 32 32 <tr> 33 <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_ POSTED}:33 <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_ADDED}: 34 34 {postrow.POST_DATE} {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 35 35 </tr> templates/main/forum/modcp_split.tpl
r89 r269 52 52 <table width="100%" cellspacing="0" cellpadding="3" border="0"> 53 53 <tr> 54 <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_ POSTED}:54 <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_ADDED}: 55 55 {postrow.POST_DATE} {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 56 56 </tr> templates/main/forum/posting_body.tpl
r259 r269 46 46 // Define the bbCode tags 47 47 bbcode = new Array(); 48 bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[offtop]','[/offtop]','[ mod={EDITOR_NAME}]','[/mod]');48 bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[offtop]','[/offtop]','[spoiler]','[/spoiler]','[mod={EDITOR_NAME}]','[/mod]'); 49 49 imageTag = false; 50 50 … … 372 372 <option style="color:black; background-color: {T_TD_COLOR1}" value="black" class="genmed">{L_COLOR_BLACK}</option> 373 373 </select> <select name="addbbcodefontsize" onChange="bbfontstyle('[size=' + this.form.addbbcodefontsize.options[this.form.addbbcodefontsize.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;" onMouseOver="helpline('f')"> 374 <option value="0" selected="selected">{L_ TEXT_SIZE}</option>375 <option value=" 7" class="genmed">{L_FONT_TINY}</option>376 <option value=" 9" class="genmed">{L_FONT_SMALL}</option>377 <option value=" 12" class="genmed">{L_FONT_NORMAL}</option>378 <option value=" 18" class="genmed">{L_FONT_LARGE}</option>379 <option value=" 24" class="genmed">{L_FONT_HUGE}</option>374 <option value="0" selected="selected">{L_FONT_SIZE}</option> 375 <option value="1" class="genmed">{L_FONT_TINY}</option> 376 <option value="2" class="genmed">{L_FONT_SMALL}</option> 377 <option value="3" class="genmed">{L_FONT_NORMAL}</option> 378 <option value="5" class="genmed">{L_FONT_LARGE}</option> 379 <option value="7" class="genmed">{L_FONT_HUGE}</option> 380 380 </select> 381 381 </span></td> templates/main/forum/posting_preview.tpl
r89 r269 4 4 </tr> 5 5 <tr> 6 <td class="row1" align="left"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}" /><span class="postdetails">{L_ POSTED}: {POST_DATE} {L_POST_SUBJECT}: {POST_SUBJECT}</span></td>6 <td class="row1" align="left"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}" /><span class="postdetails">{L_ADDED}: {POST_DATE} {L_POST_SUBJECT}: {POST_SUBJECT}</span></td> 7 7 </tr> 8 8 <tr> templates/main/forum/posting_topic_review.tpl
r89 r269 19 19 <td class="{postrow.ROW_CLASS}" height="28" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> 20 20 <tr> 21 <td width="100%"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_ POSTED}: {postrow.POST_DATE}<span class="gen"> </span> {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>21 <td width="100%"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_ADDED}: {postrow.POST_DATE}<span class="gen"> </span> {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 22 22 </tr> 23 23 <tr> templates/main/forum/search_results_posts.tpl
r89 r269 28 28 {L_VIEWS}: <b>{searchresults.TOPIC_VIEWS}</b></span><br /> 29 29 </td> 30 <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_FORUM}: <b><a href="{searchresults.U_FORUM}" class="postdetails">{searchresults.FORUM_NAME}</a></b> {L_ POSTED}: {searchresults.POST_DATE} {L_SUBJECT}: <b><a href="{searchresults.U_POST}">{searchresults.POST_SUBJECT}</a></b></span></td>30 <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_FORUM}: <b><a href="{searchresults.U_FORUM}" class="postdetails">{searchresults.FORUM_NAME}</a></b> {L_ADDED}: {searchresults.POST_DATE} {L_SUBJECT}: <b><a href="{searchresults.U_POST}">{searchresults.POST_SUBJECT}</a></b></span></td> 31 31 </tr> 32 32 <tr> templates/main/forum/topic_search_results.tpl
r85 r269 26 26 <br /> 27 27 </td> 28 <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails"> {L_ POSTED}: {searchresults.POST_DATE} </span></td>28 <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails"> {L_ADDED}: {searchresults.POST_DATE} </span></td> 29 29 </tr> 30 30 <tr> templates/main/forum/viewtopic_body.tpl
r259 r269 23 23 l_no_text_selected = "{L_NO_TEXT_SELECTED}"; 24 24 bbcode = new Array(); 25 bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[offtop]','[/offtop]','[ mod={S_EDITOR_NAME}]','[/mod]');25 bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[offtop]','[/offtop]','[spoiler]','[/spoiler]','[mod={S_EDITOR_NAME}]','[/mod]'); 26 26 imageTag = false; 27 27 //--> … … 87 87 <td class="{postrow.ROW_CLASS}" height="28" valign="top"><table border="0" cellspacing="0" cellpadding="0" width="100%"> 88 88 <tr> 89 <td class="{postrow.ROW_CLASS}" align="left"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_ POSTED}: {postrow.POST_DATE}<span class="gen"> </span> {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>89 <td class="{postrow.ROW_CLASS}" align="left"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_ADDED}: {postrow.POST_DATE}<span class="gen"> </span> {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 90 90 <td valign="top" nowrap="nowrap" class="{postrow.ROW_CLASS}" align="right">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td> 91 91 </tr> templates/main/main.cfg
r83 r269 143 143 $config['vote_graphic_length'] = 205; 144 144 145 $config['min_tag_size'] = '11'; //min tag size in pixeils 146 $config['max_tag_size'] = '30'; //max tag size in pixeils 147 145 148 // Start add - Online/Offline/Hidden Mod 146 149 $images['icon_online'] = $current_template_images . '/{LANG}/icon_online.png'; templates/main/main.css
r234 r269 1174 1174 a.postlink:hover { text-decoration: underline; color : #DD6900} 1175 1175 1176 /* Quote & Code blocks */ 1176 .liststyle { 1177 margin-left:20px; 1178 } 1179 1180 /* Copyright and bottom info */ 1181 .copyright { font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #444444; letter-spacing: -1px;} 1182 a.copyright { color: #444444; text-decoration: none;} 1183 a.copyright:hover { color: #000000; text-decoration: underline;} 1184 1185 /* The text input fields background colour */ 1186 input.post, textarea.post, select { 1187 background-color : #FFFFFF; 1188 } 1189 1190 /* The main submit button option */ 1191 input.mainoption { 1192 background-color : #FAFAFA; 1193 font-weight : bold; 1194 } 1195 1196 /* None-bold submit button */ 1197 input.liteoption { 1198 background-color : #FAFAFA; 1199 font-weight : normal; 1200 } 1201 1202 /* This is the line in the posting page which shows the rollover 1203 help line. This is actually a text box, but if set to be the same 1204 colour as the background no one will know ;) 1205 */ 1206 .helpline { background-color: #DEE3E7; border-style: none; } 1207 /* Set Image style */ 1208 img, .forumline img { 1209 border: 0; 1210 } 1211 /* Begin Simple Subforums MOD */ 1212 a.topic-new, a.topic-new:visited { color: #DD6900; } 1213 a.topic-new:hover, a.topic-new:active { color: #006699; } 1214 /* End Simple Subforums MOD */ 1215 --> 1216 1217 .pager_page { 1218 padding:2px; 1219 font-weight:bold; 1220 } 1221 1222 .pager_page_selected { 1223 padding:2px; 1224 font-weight:bold; 1225 } 1226 1227 a.upReputationLink:link, 1228 a.upReputationLink:visited 1229 { 1230 font-size: 1em; 1231 line-height: 10px; 1232 background: transparent url(images/arrow-up-v2.gif) no-repeat 0 1px; 1233 padding: 3px 6px; 1234 text-decoration: none; 1235 } 1236 1237 a.upReputationLink:hover, 1238 a.upReputationLink:active 1239 { 1240 background: transparent url(images/arrow-up-v2.gif) no-repeat 0 -15px; 1241 } 1242 1243 a.downReputationLink:link, 1244 a.downReputationLink:visited 1245 { 1246 font-size: 1em; 1247 line-height: 10px; 1248 background: transparent url(images/arrow-down-v2.gif) no-repeat 0 1px; 1249 padding: 3px 6px; 1250 text-decoration: none; 1251 } 1252 1253 a.downReputationLink:hover, 1254 a.downReputationLink:active 1255 { 1256 background: transparent url(images/arrow-down-v2.gif) no-repeat 0 -15px; 1257 } 1258 1259 span.goodResp 1260 { 1261 background: #D6FEDB; 1262 border: 1px solid #B6C9B9; 1263 padding: 1px 3px 2px 3px; 1264 } 1265 1266 span.badResp 1267 { 1268 background: #FED5CD; 1269 border: 1px solid #D0AEAE; 1270 padding: 1px 3px 2px 3px; 1271 } 1272 1273 .usergoodResp 1274 { 1275 color: #009900; 1276 } 1277 1278 .userbadResp 1279 { 1280 color: #ff3300; 1281 } 1282 1283 .respectUserList { 1284 border-top:1px solid; 1285 white-space: normal; 1286 } 1287 1288 span.goodUserResp 1289 { 1290 background: #0099cc; 1291 border: 1px solid #006699; 1292 padding: 0 3px 0 3px; 1293 color: #ffffff; 1294 } 1295 1296 span.badUserResp 1297 { 1298 background: #006699; 1299 border: 1px solid #003366; 1300 padding: 0 3px 0 3px; 1301 color: #ffffff; 1302 } 1303 1304 /* bb tags */ 1177 1305 .codetitle { 1178 1306 margin: 10px 5px 0px 5px; … … 1204 1332 } 1205 1333 1206 .quotetitle, . attachtitle {1334 .quotetitle, .spoilertitle { 1207 1335 margin: 10px 5px 0px 5px; 1208 1336 padding: 4px; … … 1216 1344 } 1217 1345 1218 .quotetitle .quotetitle {1346 .quotetitle, .spoilertitle { 1219 1347 font-size: 1em; 1220 1348 } 1221 1349 1222 .quotecontent, . attachcontent {1350 .quotecontent, .spoilercontent { 1223 1351 margin: 0px 5px 10px 5px; 1224 1352 padding: 5px; … … 1234 1362 } 1235 1363 1236 .liststyle { 1237 margin-left:20px; 1238 } 1239 1240 /* Copyright and bottom info */ 1241 .copyright { font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #444444; letter-spacing: -1px;} 1242 a.copyright { color: #444444; text-decoration: none;} 1243 a.copyright:hover { color: #000000; text-decoration: underline;} 1244 1245 /* The text input fields background colour */ 1246 input.post, textarea.post, select { 1247 background-color : #FFFFFF; 1248 } 1249 1250 /* The main submit button option */ 1251 input.mainoption { 1252 background-color : #FAFAFA; 1253 font-weight : bold; 1254 } 1255 1256 /* None-bold submit button */ 1257 input.liteoption { 1258 background-color : #FAFAFA; 1259 font-weight : normal; 1260 } 1261 1262 /* This is the line in the posting page which shows the rollover 1263 help line. This is actually a text box, but if set to be the same 1264 colour as the background no one will know ;) 1265 */ 1266 .helpline { background-color: #DEE3E7; border-style: none; } 1267 /* Set Image style */ 1268 img, .forumline img { 1269 border: 0; 1270 } 1271 /* Begin Simple Subforums MOD */ 1272 a.topic-new, a.topic-new:visited { color: #DD6900; } 1273 a.topic-new:hover, a.topic-new:active { color: #006699; } 1274 /* End Simple Subforums MOD */ 1275 --> 1276 1277 .pager_page { 1278 padding:2px; 1279 font-weight:bold; 1280 } 1281 1282 .pager_page_selected { 1283 padding:2px; 1284 font-weight:bold; 1285 } 1286 1287 a.upReputationLink:link, 1288 a.upReputationLink:visited 1289 { 1290 font-size: 1em; 1291 line-height: 10px; 1292 background: transparent url(images/arrow-up-v2.gif) no-repeat 0 1px; 1293 padding: 3px 6px; 1294 text-decoration: none; 1295 } 1296 1297 a.upReputationLink:hover, 1298 a.upReputationLink:active 1299 { 1300 background: transparent url(images/arrow-up-v2.gif) no-repeat 0 -15px; 1301 } 1302 1303 a.downReputationLink:link, 1304 a.downReputationLink:visited 1305 { 1306 font-size: 1em; 1307 line-height: 10px; 1308 background: transparent url(images/arrow-down-v2.gif) no-repeat 0 1px; 1309 padding: 3px 6px; 1310 text-decoration: none; 1311 } 1312 1313 a.downReputationLink:hover, 1314 a.downReputationLink:active 1315 { 1316 background: transparent url(images/arrow-down-v2.gif) no-repeat 0 -15px; 1317 } 1318 1319 span.goodResp 1320 { 1321 background: #D6FEDB; 1322 border: 1px solid #B6C9B9; 1323 padding: 1px 3px 2px 3px; 1324 } 1325 1326 span.badResp 1327 { 1328 background: #FED5CD; 1329 border: 1px solid #D0AEAE; 1330 padding: 1px 3px 2px 3px; 1331 } 1332 1333 .usergoodResp 1334 { 1335 color: #009900; 1336 } 1337 1338 .userbadResp 1339 { 1340 color: #ff3300; 1341 } 1342 1343 .respectUserList { 1344 border-top:1px solid; 1345 white-space: normal; 1346 } 1347 1348 span.goodUserResp 1349 { 1350 background: #0099cc; 1351 border: 1px solid #006699; 1352 padding: 0 3px 0 3px; 1353 color: #ffffff; 1354 } 1355 1356 span.badUserResp 1357 { 1358 background: #006699; 1359 border: 1px solid #003366; 1360 padding: 0 3px 0 3px; 1361 color: #ffffff; 1362 } 1363 1364 ul.bb, ol.bb { 1365 padding-left:25px; 1366 } 1367 1368 .jqifade{ 1369 position: absolute; 1370 background-color: #aaaaaa; 1371 } 1372 div.jqi{ 1373 width: 400px; 1374 font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; 1375 position: absolute; 1376 background-color: #ffffff; 1377 font-size: 11px; 1378 text-align: left; 1379 border: solid 1px #eeeeee; 1380 -moz-border-radius: 10px; 1381 -webkit-border-radius: 10px; 1382 padding: 7px; 1383 } 1384 div.jqi .jqicontainer{ 1385 font-weight: bold; 1386 } 1387 div.jqi .jqiclose{ 1388 position: absolute; 1389 top: 4px; right: -2px; 1390 width: 18px; 1391 cursor: default; 1392 color: #bbbbbb; 1393 font-weight: bold; 1394 } 1395 div.jqi .jqimessage{ 1396 padding: 10px; 1397 line-height: 20px; 1398 color: #444444; 1399 } 1400 div.jqi .jqibuttons{ 1401 text-align: right; 1402 padding: 5px 0 5px 0; 1403 border: solid 1px #eeeeee; 1404 background-color: #f4f4f4; 1405 } 1406 div.jqi button{ 1407 padding: 3px 10px; 1408 margin: 0 10px; 1409 background-color: #2F6073; 1410 border: solid 1px #f4f4f4; 1411 color: #ffffff; 1412 font-weight: bold; 1413 font-size: 12px; 1414 } 1415 div.jqi button:hover{ 1416 background-color: #728A8C; 1417 } 1418 div.jqi button.jqidefaultbutton{ 1419 background-color: #BF5E26; 1420 } 1421 .jqiwarning .jqi .jqibuttons{ 1422 background-color: #BF5E26; 1423 } 1424 1425 .ac_results { 1426 padding: 0px; 1427 border: 1px solid WindowFrame; 1428 background-color: Window; 1429 overflow: hidden; 1430 } 1431 1432 .ac_results ul { 1433 width: 100%; 1434 list-style-position: outside; 1435 list-style: none; 1436 padding: 0; 1437 margin: 0; 1438 } 1439 1440 .ac_results iframe { 1441 display:none;/*sorry for IE5*/ 1442 display/**/:block;/*sorry for IE5*/ 1443 position:absolute; 1444 top:0; 1445 left:0; 1446 z-index:-1; 1447 filter:mask(); 1448 width:3000px; 1449 height:3000px; 1450 } 1451 1452 .ac_results li { 1453 margin: 0px; 1454 padding: 2px 5px; 1455 cursor: pointer; 1456 display: block; 1457 width: 100%; 1458 font: menu; 1459 font-size: 12px; 1460 overflow: hidden; 1461 } 1462 1463 .ac_over { 1464 background-color: Highlight; 1465 color: HighlightText; 1466 } templates/main/overall_header.html
r260 r269 12 12 <link href="{TEMPLATE_PATH}/main.css" rel="stylesheet" type="text/css" media="screen" /> 13 13 <script type="text/javascript" src="{ROOT_PATH}js/functions.js"></script> 14 <script type="text/javascript" src="{ROOT_PATH}js/jquery.js"></script> 14 15 <script type="text/javascript"> 15 var sizes_ary = {'{L_KILOBYTES}':1024,'{L_MEGABYTES}':1024*1024,'{L_GIGABYTES}':1024*1024*1024,'{L_TERABYTES}':1024*1024*1024*1024};16 16 var SID = '{SID}'; 17 17 var TRACKER_URL = '{ROOT_PATH}'; 18 var l_post_something = '{L_POST_SOMETHING}';19 var L_JS_MARKED = '{L_MARKED}';20 18 var ol_bgcolor = "#FFFFFF"; 19 20 <!-- BEGIN javascript_lang --> 21 var {javascript_lang.KEY} = '{javascript_lang.VALUE}'; 22 <!-- END --> 21 23 </script> 22 24 </head> … … 25 27 <div id="page-header"> </div> 26 28 27 <!-- BEGIN user_panel --> 29 <!-- IF S_USER_LOGGED_IN --> 30 28 31 <div id="userbar"> 29 <span class="left">{L_HELLO}<a href="{U_USERDETAILS_LINK}"><b>{ user_panel.CURUSER_NAME}</b></a> {user_panel.CURUSER_ICONS}32 <span class="left">{L_HELLO}<a href="{U_USERDETAILS_LINK}"><b>{CURRENT_USER_NAME}</b></a> {CURRENT_USER_ICONS} 30 33 31 34 <span class="<!-- IF CURRENT_USER_POINTS_LEVEL < 0 -->badUserResp<!-- ELSE -->goodUserResp<!-- ENDIF -->">{CURRENT_USER_POINTS_LEVEL}</span> 32 35 <!-- IF CURRENT_USER_RANK_NAME --> [{CURRENT_USER_RANK_NAME}]<!-- ENDIF -->, {L_REPUTATION}: {CURRENT_USER_POINTS} 33 [<a href="{U_LOGOUT}">{L_LOGOUT}</a>]<br />{L_RATIO}: { user_panel.RATIO}34 35 <img alt="{L_UPLOADED}" title="{L_UPLOADED}" src="pic/arrowup.gif" /> { user_panel.UPED} <img alt="{L_DOWNLOADED}" title="{L_DOWNLOADED}" src="pic/arrowdown.gif" /> {user_panel.DOWNED} {user_panel.WARN_PANEL}</span>36 <span class="right">{ user_panel.S_CURRENT_TIME}<br />37 <a href="{U_MESSAGES_INBOX}"><img src="{ user_panel.INBOX_PM_PIC}" height="14" alt="{user_panel.PM_TITLE}" /></a> {L_INBOX}38 <a href="{U_MESSAGES_SENTBOX}"> <img src="{ user_panel.SENTBOX_PIC}" height="14" alt="{L_SENTBOX}" /></a> {L_SENTBOX}39 <a href="{U_MY_FRIENDS}"><img src="{ user_panel.BUDDYLIST_PIC}" height="14" alt="{L_BUDDYLIST}" /></a></span>36 [<a href="{U_LOGOUT}">{L_LOGOUT}</a>]<br />{L_RATIO}: {CURRENT_USER_RATIO} 37 38 <img alt="{L_UPLOADED}" title="{L_UPLOADED}" src="pic/arrowup.gif" /> {CURRENT_USER_UPED} <img alt="{L_DOWNLOADED}" title="{L_DOWNLOADED}" src="pic/arrowdown.gif" /> {CURRENT_USER_DOWNED} {CURRENT_USER_WARN_PANEL}</span> 39 <span class="right">{S_CURRENT_TIME}<br /> 40 <a href="{U_MESSAGES_INBOX}"><img src="{INBOX_PM_PIC}" height="14" alt="{PM_TITLE}" /></a> {L_INBOX} 41 <a href="{U_MESSAGES_SENTBOX}"> <img src="{SENTBOX_PIC}" height="14" alt="{L_SENTBOX}" /></a> {L_SENTBOX} 42 <a href="{U_MY_FRIENDS}"><img src="{BUDDYLIST_PIC}" height="14" alt="{L_BUDDYLIST}" /></a></span> 40 43 </div> 41 44 … … 44 47 clock.tik_tak(); 45 48 </script> 46 <!-- END user_panel --> 49 50 <!-- ENDIF --> 47 51 48 52 <div id="page-body"> … … 51 55 <li<!-- IF CURRENT_PAGE == U_INDEX --> id="activetab"<!-- ENDIF -->><a href="{U_INDEX}"><span>{L_INDEX}</span></a></li> 52 56 <li<!-- IF CURRENT_PAGE == U_BROWSE --> id="activetab"<!-- ENDIF -->><a href="{U_BROWSE}"><span>{L_BROWSE}</span></a></li> 57 53 58 <!-- BEGIN switch_non_uploader_view --> 59 54 60 <li<!-- IF CURRENT_PAGE == U_UPLOADAPP --> id="activetab"<!-- ENDIF -->><a href="{U_UPLOADAPP}"><span>{L_UPLOAD}</span></a></li> 61 55 62 <!-- END switch_non_uploader_view --> 63 56 64 <!-- BEGIN switch_uploader_view --> 65 57 66 <li<!-- IF CURRENT_PAGE == U_UPLOAD --> id="activetab"<!-- ENDIF -->><a href="{U_UPLOAD}"><span>{L_UPLOAD}</span></a></li> 67 58 68 <!-- END switch_uploader_view --> 59 <!-- BEGIN switch_non_curuser_view --> 69 70 <!-- IF not S_USER_LOGGED_IN --> 71 60 72 <li<!-- IF CURRENT_PAGE == U_LOGIN --> id="activetab"<!-- ENDIF -->><a href="{U_LOGIN}"><span>{L_LOGIN}</span></a></li> 61 73 <li<!-- IF CURRENT_PAGE == U_SIGNUP --> id="activetab"<!-- ENDIF -->><a href="{U_SIGNUP}"><span>{L_SIGNUP}</span></a></li> 62 <!-- END switch_non_curuser_view --> 74 75 <!-- ENDIF --> 76 63 77 <li<!-- IF CURRENT_PAGE == U_FORUM --> id="activetab"<!-- ENDIF -->><a href="{U_FORUM}"><span>{L_FORUMS}</span></a></li> 64 78 <li<!-- IF CURRENT_PAGE == U_RULES --> id="activetab"<!-- ENDIF -->><a href="{U_RULES}"><span>{L_RULES}</span></a></li> 65 79 <li<!-- IF CURRENT_PAGE == U_FAQ --> id="activetab"<!-- ENDIF -->><a href="{U_FAQ}"><span>{L_FAQ}</span></a></li> 66 <!-- BEGIN switch_curuser_view --> 80 81 <!-- IF S_USER_LOGGED_IN --> 82 67 83 <li<!-- IF CURRENT_PAGE == U_HELPDESC --> id="activetab"<!-- ENDIF -->><a href="{U_HELPDESC}"><span>{L_HELPDESC}</span></a></li> 68 <!-- END switch_curuser_view --> 84 85 <!-- ENDIF --> 86 69 87 <li<!-- IF CURRENT_PAGE == U_STAFF --> id="activetab"<!-- ENDIF -->><a href="{U_STAFF}"><span>{L_STAFF}</span></a></li> 70 88 </ul> … … 77 95 <div id="menu"> 78 96 <ul> 79 <!-- BEGIN switch_curuser_view --> 97 98 <!-- IF S_USER_LOGGED_IN --> 80 99 81 100 <li class="header">{L_TORRENTS}</li> … … 85 104 <li<!-- IF CURRENT_PAGE == U_OFFERS --> id="activemenu"<!-- ENDIF -->><a href="{U_OFFERS}"><span>{L_OFFERS}</span></a></li> 86 105 87 <!-- END switch_curuser_view-->106 <!-- ENDIF --> 88 107 89 108 <!-- BEGIN switch_non_uploader_view --> … … 98 117 99 118 <!-- END switch_uploader_view --> 100 101 119 <li class="header">{L_COMMUNITY}</li> 102 120 <li<!-- IF CURRENT_PAGE == U_FORUM --> id="activemenu"<!-- ENDIF -->><a href="{U_FORUM}"><span>{L_FORUMS}</span></a></li> … … 105 123 <li<!-- IF CURRENT_PAGE == U_CHAT --> id="activemenu"<!-- ENDIF -->><a href="{U_CHAT}"><span>{L_CHAT}</span></a></li> 106 124 107 <!-- BEGIN switch_curuser_view-->125 <!-- IF S_USER_LOGGED_IN --> 108 126 109 127 <li class="header">{L_PERSONAL}</li> … … 127 145 <!-- ENDIF --> 128 146 129 <!-- END switch_curuser_view-->147 <!-- ENDIF --> 130 148 131 149 <li class="header">{L_OTHER}</li> … … 139 157 <li<!-- IF CURRENT_PAGE == U_LOG --> id="activemenu"<!-- ENDIF -->><a href="{U_LOG}"><span>{L_LOG}</span></a></li> 140 158 141 <!-- BEGIN switch_moderator_view-->159 <!-- IF S_USER_IS_MOD --> 142 160 143 161 <li<!-- IF CURRENT_PAGE == U_HELPDESC --> id="activemenu"<!-- ENDIF -->><a href="{U_HELPDESC}"><!-- IF HELPDESC_NUM > 0 --><span style="color:red;"><b>{L_HELPDESC} ({HELPDESC_NUM})</b></span><!-- ELSE --><span>{L_HELPDESC}</span><!-- ENDIF --></a></li> … … 146 164 <li<!-- IF CURRENT_PAGE == U_USERSEARCH --> id="activemenu"<!-- ENDIF -->><a href="{U_USERSEARCH}"><span>{L_USER_SEARCH}</span></a></li> 147 165 148 <!-- END switch_moderator_view-->166 <!-- ENDIF --> 149 167 150 168 <!-- BEGIN switch_admin_view --> templates/main/textbbcode.html
r259 r269 57 57 // Define the bbCode tags 58 58 bbcode = new Array(); 59 bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[pre]','[/pre]','[*]','[*]','[*]','[*]','[img]','[/img]','[url]','[/url]','[mod={EDITOR_NAME}]','[/mod]' );59 bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[pre]','[/pre]','[*]','[*]','[*]','[*]','[img]','[/img]','[url]','[/url]','[mod={EDITOR_NAME}]','[/mod]','[spoiler]','[/spoiler]'); 60 60 imageTag = false; 61 61 … … 256 256 <input type="button" accesskey="m" name="addbbcode18" value="MOD" style="width:35px" onclick="bbstyle(18)" /> 257 257 <!-- END switch_mod_section --> 258 259 <input type="button" accesskey="s" name="addbbcode20" value="{L_SPOILER}" style="width:60px" onclick="bbstyle(20)" /> 260 258 261 <input type="button" value="..]" style="width:35px" onclick="javascript:bbstyle(-1)" /> 259 262 </td> … … 280 283 </select> 281 284 282 <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;"> 283 <option value="0" selected="selected">{L_TEXT_SIZE}</option> 284 <option value="7" class="genmed">{L_SMALL}</option> 285 <option value="11" class="genmed">{L_STANDART}</option> 286 <option value="16" class="genmed">{L_BIG}</option> 287 <option value="24" class="genmed">{L_VERY_BIG}</option> 285 <select name="addbbcode30" onchange="bbfontstyle('[size=' + this.form.addbbcode30.options[this.form.addbbcode30.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;"> 286 <option value="0" selected="selected">{L_FONT_SIZE}</option> 287 <option value="1" class="genmed">{L_FONT_TINY}</option> 288 <option value="2" class="genmed">{L_FONT_SMALL}</option> 289 <option value="3" class="genmed">{L_FONT_NORMAL}</option> 290 <option value="5" class="genmed">{L_FONT_LARGE}</option> 291 <option value="7" class="genmed">{L_FONT_HUGE}</option> 288 292 </select> 289 293 templates/main/userdetails.html
r260 r269 3 3 <script type="text/javascript" src="{ROOT_PATH}js/ajax.js"></script> 4 4 <script type="text/javascript" src="{ROOT_PATH}js/ajax_common.js"></script> 5 <script type="text/javascript">6 var L_JS_SEE_FULL_LIST = '{L_SEE_FULL_LIST}';7 var L_JS_HIDE_LIST = '{L_HIDE_LIST}';8 </script>9 5 10 6 <h1>{USERNAME} {USER_ICONS} <span class="<!-- IF USER_POINTS_LEVEL < 0 -->badUserResp<!-- ELSE -->goodUserResp<!-- ENDIF -->">{USER_POINTS_LEVEL}</span> … … 206 202 <tr> 207 203 <td align="center"> 208 < input type="button" value="{L_SEND_PM_SHORT}" onclick="javascript: location.href='{switch_buttons.U_SEND_PM}'" />204 <span class="tbut"><a href="{switch_buttons.U_SEND_PM}">{L_SEND_PM_SHORT}</a></span> 209 205 </td> 210 206 <td align="center"> 211 <input type="button" value="{L_REPORT_TO_USER}" onclick="javascript: location.href='{switch_buttons.U_REPORT}'" />207 <span class="tbut"><a href="{switch_buttons.U_REPORT}">{L_REPORT_TO_USER}</a></span> 212 208 </td> 213 209 </tr> templates/reflection/bbcode.html
r225 r269 1 <!-- BEGIN ulist_open --><ul class="liststyle"><!-- END ulist_open -->2 <!-- BEGIN ulist_open_default --><ul><!-- END ulist_open_default -->3 <!-- BEGIN ulist_close --></ul><!-- END ulist_close -->4 5 <!-- BEGIN olist_open --><ol style="list-style-type: {LIST_TYPE}"><!-- END olist_open -->6 <!-- BEGIN olist_close --></ol><!-- END olist_close -->7 8 <!-- BEGIN listitem --><li><!-- END listitem -->9 <!-- BEGIN listitem_close --></li><!-- END listitem_close -->10 11 1 <!-- BEGIN quote_username_open --> 12 2 <div class="quotetitle">{USERNAME} {L_POSTED}:</div><div class="quotecontent"> … … 20 10 </div> 21 11 <!-- END quote_close --> 12 13 <!-- BEGIN spoiler_header_open --> 14 <div class="quotetitle"><a href="javascript:;" onclick="$(this).parents('div:first').next('div').toggle('slow');">{TEXT}:</a></div><div class="quotecontent" style="display:none;"> 15 <!-- END spoiler_header_open --> 16 17 <!-- BEGIN spoiler_open --> 18 <div class="quotetitle"><a href="javascript:;" onclick="$(this).parents('div:first').next('div').toggle('slow');">{L_SPOILER}:</a></div><div class="quotecontent" style="display:none"> 19 <!-- END spoiler_open --> 20 21 <!-- BEGIN spoiler_close --> 22 </div> 23 <!-- END spoiler_close --> 22 24 23 25 <!-- BEGIN pre --> … … 33 35 <!-- END code_close --> 34 36 35 <!-- BEGIN offtop_open --> </span>36 < span class="offtop"><b>{L_OFFTOP}:</b><!-- END offtop_open -->37 < !-- BEGIN offtop_close --></span>38 < span class="postbody"><!-- END offtop_close-->37 <!-- BEGIN offtop_open --> 38 </span> 39 <span class="offtop"><b>{L_OFFTOP}:</b> 40 <!-- END offtop_open --> 39 41 40 <!-- BEGIN b_open --><strong><!-- END b_open --> 41 <!-- BEGIN b_close --></strong><!-- END b_close --> 42 43 <!-- BEGIN u_open --><u><!-- END u_open --> 44 <!-- BEGIN u_close --></u><!-- END u_close --> 45 46 <!-- BEGIN i_open --><em><!-- END i_open --> 47 <!-- BEGIN i_close --></em><!-- END i_close --> 48 49 <!-- BEGIN color_open --><span style="color: {COLOR}"><!-- END color_open --> 50 <!-- BEGIN color_close --></span><!-- END color_close --> 51 52 <!-- BEGIN size_open --><span style="font-size: {SIZE}px; line-height: normal"><!-- END size_open --> 53 <!-- BEGIN size_close --></span><!-- END size_close --> 54 55 <!-- BEGIN font --><span style="font-family: {FONT_FAMILY};">{CONTENT}</span><!-- END font --> 56 57 <!-- BEGIN img --><img src="{URL}" alt="" onload="imgFit(this, 500);" onclick="imgFit(this, 500);" /><!-- END img --> 58 59 <!-- BEGIN url --><a href="{URL}" target="_blank">{DESCRIPTION}</a><!-- END url --> 60 61 <!-- BEGIN email --><a href="mailto:{EMAIL}">{DESCRIPTION}</a><!-- END email --> 42 <!-- BEGIN offtop_close --> 43 </span><br /> 44 <span class="postbody"> 45 <!-- END offtop_close --> 62 46 63 47 <!-- BEGIN mod_username_open --> … … 83 67 <!-- END mod_close --> 84 68 85 <!-- BEGIN thmbimg -->86 <div align="{ALIGN}">87 <table border="0">88 <tr>89 <td><img src="{IMAGE}" align="center" border="0" {SIZE} onclick="window.open( '{IMAGE}', 'imgpop', 'width={WIDTH},height={HEIGHT},status=no,toolbar=no,menubar=no' );return false" /></td>90 </tr>91 <tr>92 <td align="center" class="gensmall"><i>{NOTICE}</i></td>93 </tr>94 </table>95 </div>96 <!-- END thmbimg -->97 98 69 <!-- BEGIN flash --> 99 70 <object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0" width="{WIDTH}" height="{HEIGHT}"> templates/reflection/browse.html
r259 r269 22 22 23 23 <fieldset class="catNamesBlock"> 24 {L_SEARCH} <input type="text" name="search" size="40" value="{SEARCH_STRING}" onmouseover="return overlib( '{L_JS_SEARCH_EXPLAIN}');" onmouseout="return nd();" /> {L_IN} {CAT_DROP_DOWN} {L_IN}25 <select name="search_in"><option value="1" {SEARCH_IN_CHECKED_1}>{L_NAME}</option><option value="2" {SEARCH_IN_CHECKED_2}>{L_DESCRIPTION}</option></select>24 {L_SEARCH} <input type="text" name="search" size="40" value="{SEARCH_STRING}" onmouseover="return overlib(L_JS_SEARCH_EXPLAIN);" onmouseout="return nd();" /> {L_IN} {CAT_DROP_DOWN} {L_IN} 25 {SEARCH_IN_SELECT} 26 26 <input type="submit" value="{L_SEARCH}" /> 27 27 </fieldset> templates/reflection/details.html
r259 r269 4 4 <script type="text/javascript" src="{ROOT_PATH}js/ajax_common.js"></script> 5 5 <script type="text/javascript" src="{ROOT_PATH}js/overlib.js"></script> 6 <script type="text/javascript">7 var sos_confirm = '{L_SOS_CONFIRM}';8 var simpaty_descr = '{L_SIMPATY_DESCR}';9 var resp = '{L_RESPECT}';10 var antiresp = '{L_ANTIRESPECT}';11 var L_JS_SEE_FULL_LIST = '{L_SEE_FULL_LIST}';12 var L_JS_HIDE_LIST = '{L_HIDE_LIST}';13 </script>14 6 15 <!-- BEGIN torrent_details -->16 7 <!-- IF MESSAGE1 --><h1>{MESSAGE1}</h1><!-- ENDIF --> 17 8 <!-- IF MESSAGE2 --><p>{MESSAGE2}</p><!-- ENDIF --> … … 39 30 <!-- END switch_nfo_section --> 40 31 41 <!-- BEGIN switch_banned_section-->32 <!-- IF S_USER_IS_MOD --> 42 33 <div class="torrentViewLeft">{L_BANNED}</div> 43 34 <div class="torrentViewRight">{BANNED}</div> 44 <!-- END switch_banned_section-->35 <!-- ENDIF --> 45 36 46 37 <div class="torrentViewLeft">{L_TYPE}</div> 47 38 <div class="torrentViewRight">{TYPE}</div> 39 40 <div class="torrentViewLeft">{L_TAGS}</div> 41 <div class="torrentViewRight"><!-- INCLUDE tags_view_form.html --></div> 48 42 49 43 <div class="torrentViewLeft">{L_LAST_SEEDER}</div> … … 58 52 <select name="rating" id="rating_select"> 59 53 <option value="0">({L_ADD_RATING})</option> 60 { torrent_details.switch_rating_form.RATING_OPTIONS}54 {switch_rating_form.RATING_OPTIONS} 61 55 </select> 62 56 <input type="button" value="{L_VOTE}!" onclick="rating('{ID}', document.getElementById('rating_select').value );return false;" id="rating_button" /> … … 76 70 <div class="torrentViewLeft"><a name="snatchedlist" id="snatchedlist"></a>{L_SNATCHED_USERS}<br /> 77 71 <a href="javascript:void(0);" onclick="view_details_ext('snatchedlist', '{ID}', 'details');" id="snatchedlist_href">[<!-- IF SNATCHEDLIST_TPL -->{L_HIDE_LIST}<!-- ELSE -->{L_SEE_FULL_LIST}<!-- ENDIF -->]</a></div> 78 <div class="torrentViewRight">{ torrent_details.switch_simple_snatched.SIMPLE_SNATCHED_COUNT}<div id="snatchedlist_row">{SNATCHEDLIST_TPL}</div></div>72 <div class="torrentViewRight">{switch_simple_snatched.SIMPLE_SNATCHED_COUNT}<div id="snatchedlist_row">{SNATCHEDLIST_TPL}</div></div> 79 73 <br /><br /><br /><br /> 80 74 <!-- END switch_simple_snatched --> … … 109 103 <div class="torrentViewLeft">{L_THANKS_USERS}</div> 110 104 <div class="torrentViewRight"> 111 <!-- BEGIN switch_thanks --> 112 <input type="button" id="thanks_button" value="{L_THANKS}" onclick="thanks('{ID}', <!-- IF torrent_details.switch_thanks.THANKS_USERS -->1<!-- ELSE -->0<!-- ENDIF -->);return false;" {torrent_details.switch_thanks.DISABLED} /> 113 <span id="thanks_users"><!-- IF torrent_details.switch_thanks.THANKS_USERS -->{torrent_details.switch_thanks.THANKS_USERS}<!-- ELSE -->{L_NO_THANKS}<!-- ENDIF --></span> 114 <!-- END switch_thanks --> 105 <input type="button" id="thanks_button" value="{L_THANKS}" onclick="thanks('{ID}', 0);return false;" /> 106 <a href="javascript:;" onclick="view_details_ext('thanks', '{ID}', 'details');" id="thanks_href">[{L_SEE_FULL_LIST}]</a><div id="thanks_row"></div> 115 107 </div> 108 116 109 </div> 117 110 <br clear="all" /> 118 111 119 <!-- END torrent_details --> 120 121 122 <!-- BEGIN switch_comments_details_head --> 123 124 <h1>{switch_comments_details_head.COMMENTS_FOR}</h1> 125 <!-- END switch_comments_details_head --> 126 <!-- BEGIN switch_no_comments_details --> 127 <h1>{L_NO_COMMENTS_YET}</h1> 128 <!-- IF switch_no_comments_details.DISABLE_COMMENTS == 0 --><a href="{switch_no_comments_details.U_ADD_COMMENT}">{switch_no_comments_details.L_ADD_NEW_COMMENT}</a> 129 130 <!-- IF switch_no_comments_details.U_CHECK --><a href="{switch_no_comments_details.U_CHECK}">{switch_no_comments_details.CHECK_TITLE}</a><!-- ENDIF --><!-- ELSE -->{L_COMMENTS_DISABLED}<!-- ENDIF --> 112 <!-- INCLUDE details_comments.html --> 131 113 132 114 <!-- INCLUDE overall_footer.html --> 133 134 <!-- END switch_no_comments_details -->135 136 137 <!-- BEGIN switch_comments_details -->138 139 <!-- IF switch_comments_details.DISABLE_COMMENTS == 0 --><a href="{switch_comments_details.U_ADD_COMMENT}">{switch_comments_details.L_ADD_NEW_COMMENT}</a>140 141 <!-- IF switch_comments_details.U_CHECK --><a href="{switch_comments_details.U_CHECK}">{switch_comments_details.CHECK_TITLE}</a><!-- ENDIF --><!-- ELSE -->{L_COMMENTS_DISABLED}<!-- ENDIF -->142 <br />143 {switch_comments_details.PAGERTOP}144 <br />145 <a name="startcomments" id="startcomments"></a>146 {COMMENTS_TABLE}147 {switch_comments_details.PAGERBOTTOM}148 <!-- IF switch_comments_details.DISABLE_COMMENTS == 0 --><a href="{switch_comments_details.U_ADD_COMMENT}">{switch_comments_details.L_ADD_NEW_COMMENT}</a>149 150 <!-- IF switch_comments_details.U_CHECK --><a href="{switch_comments_details.U_CHECK}">{switch_comments_details.CHECK_TITLE}</a><!-- ENDIF --><!-- ELSE -->{L_COMMENTS_DISABLED}<!-- ENDIF -->151 152 <!-- INCLUDE overall_footer.html -->153 <!-- END switch_comments_details -->templates/reflection/forum/index_body.tpl
r90 r269 49 49 <tr> 50 50 <td align="left"> 51 <!-- BEGIN switch_curuser_view-->51 <!-- IF S_USER_LOGGED_IN --> 52 52 <span class="gensmall"><a href="{U_MARK_READ}" class="gensmall">{L_MARK_ALL_FORUMS}</a></span> 53 <!-- END switch_curuser_view-->53 <!-- ENDIF --> 54 54 </td> 55 55 <td align="right"><span class="gensmall">{S_TIMEZONE}</span></td> templates/reflection/forum/modcp_delete_posts.tpl
r90 r269 31 31 <table width="100%" cellspacing="0" cellpadding="3" border="0"> 32 32 <tr> 33 <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_ POSTED}:33 <td valign="middle" class="{postrow.ROW_CLASS}" align="left"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_ADDED}: 34 34 {postrow.POST_DATE} {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 35 35 </tr> templates/reflection/forum/modcp_split.tpl
r90 r269 52 52 <table width="100%" cellspacing="0" cellpadding="3" border="0"> 53 53 <tr> 54 <td valign="middle"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_ POSTED}:54 <td valign="middle"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}"><span class="postdetails">{L_ADDED}: 55 55 {postrow.POST_DATE} {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 56 56 </tr> templates/reflection/forum/posting_body.tpl
r259 r269 46 46 // Define the bbCode tags 47 47 bbcode = new Array(); 48 bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[offtop]','[/offtop]','[ mod={EDITOR_NAME}]','[/mod]');48 bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[offtop]','[/offtop]','[spoiler]','[/spoiler]','[mod={EDITOR_NAME}]','[/mod]'); 49 49 imageTag = false; 50 50 … … 357 357 </select> 358 358 <select name="addbbcodefontsize" onChange="bbfontstyle('[size=' + this.form.addbbcodefontsize.options[this.form.addbbcodefontsize.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;" onMouseOver="helpline('f')"> 359 <option value="0" selected="selected">{L_ TEXT_SIZE}</option>360 <option value="7" class="genmed">{L_FONT_TINY}</option>361 <option value="9" class="genmed">{L_FONT_SMALL}</option>362 <option value="12" class="genmed">{L_FONT_NORMAL}</option>363 <option value="18" class="genmed">{L_FONT_LARGE}</option>364 <option value="24" class="genmed">{L_FONT_HUGE}</option>359 <option value="0" selected="selected">{L_FONT_SIZE}</option> 360 <option value="1" class="genmed">{L_FONT_TINY}</option> 361 <option value="2" class="genmed">{L_FONT_SMALL}</option> 362 <option value="3" class="genmed">{L_FONT_NORMAL}</option> 363 <option value="5" class="genmed">{L_FONT_LARGE}</option> 364 <option value="7" class="genmed">{L_FONT_HUGE}</option> 365 365 </select> 366 366 </td> templates/reflection/forum/posting_preview.tpl
r90 r269 5 5 </tr> 6 6 <tr> 7 <td class="row1"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}" /><span class="postdetails">{L_ POSTED}: {POST_DATE} {L_POST_SUBJECT}: {POST_SUBJECT}</span></td>7 <td class="row1"><img src="{TEMPLATE_PATH}/images/icon_minipost.gif" alt="{L_POST}" /><span class="postdetails">{L_ADDED}: {POST_DATE} {L_POST_SUBJECT}: {POST_SUBJECT}</span></td> 8 8 </tr> 9 9 <tr> templates/reflection/forum/posting_topic_review.tpl
r90 r269 19 19 <td class="{postrow.ROW_CLASS}" height="28" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0"> 20 20 <tr> 21 <td width="100%"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_ POSTED}: {postrow.POST_DATE}<span class="gen"> </span> {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>21 <td width="100%"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_ADDED}: {postrow.POST_DATE}<span class="gen"> </span> {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 22 22 </tr> 23 23 <tr> templates/reflection/forum/search_results_posts.tpl
r90 r269 28 28 {L_VIEWS}: <b>{searchresults.TOPIC_VIEWS}</b></span><br /> 29 29 </td> 30 <td width="100%" valign="top" class="row1"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_FORUM}: <b><a href="{searchresults.U_FORUM}" class="postdetails">{searchresults.FORUM_NAME}</a></b> {L_ POSTED}: {searchresults.POST_DATE} {L_SUBJECT}: <b><a href="{searchresults.U_POST}">{searchresults.POST_SUBJECT}</a></b></span></td>30 <td width="100%" valign="top" class="row1"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails">{L_FORUM}: <b><a href="{searchresults.U_FORUM}" class="postdetails">{searchresults.FORUM_NAME}</a></b> {L_ADDED}: {searchresults.POST_DATE} {L_SUBJECT}: <b><a href="{searchresults.U_POST}">{searchresults.POST_SUBJECT}</a></b></span></td> 31 31 </tr> 32 32 <tr> templates/reflection/forum/topic_search_results.tpl
r83 r269 26 26 <br /> 27 27 </td> 28 <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails"> {L_ POSTED}: {searchresults.POST_DATE} </span></td>28 <td width="100%" valign="top" class="row1" align="left"><img src="{searchresults.MINI_POST_IMG}" width="12" height="9" alt="{searchresults.L_MINI_POST_ALT}" title="{searchresults.L_MINI_POST_ALT}" border="0" /><span class="postdetails"> {L_ADDED}: {searchresults.POST_DATE} </span></td> 29 29 </tr> 30 30 <tr> templates/reflection/forum/viewtopic_body.tpl
r259 r269 23 23 l_no_text_selected = "{L_NO_TEXT_SELECTED}"; 24 24 bbcode = new Array(); 25 bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[offtop]','[/offtop]','[ mod={S_EDITOR_NAME}]','[/mod]');25 bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[offtop]','[/offtop]','[spoiler]','[/spoiler]','[mod={S_EDITOR_NAME}]','[/mod]'); 26 26 imageTag = false; 27 27 //--> … … 91 91 <table width="100%" border="0" cellspacing="0" cellpadding="0"> 92 92 <tr> 93 <td width="100%"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_ POSTED}: {postrow.POST_DATE}<span class="gen"> </span> {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td>93 <td width="100%"><a href="{postrow.U_MINI_POST}"><img src="{postrow.MINI_POST_IMG}" width="12" height="9" alt="{postrow.L_MINI_POST_ALT}" title="{postrow.L_MINI_POST_ALT}" border="0" /></a><span class="postdetails">{L_ADDED}: {postrow.POST_DATE}<span class="gen"> </span> {L_POST_SUBJECT}: {postrow.POST_SUBJECT}</span></td> 94 94 <td valign="top" nowrap="nowrap" class="{postrow.ROW_CLASS}" align="right">{postrow.QUOTE_IMG} {postrow.EDIT_IMG} {postrow.DELETE_IMG} {postrow.IP_IMG}</td> 95 95 </tr> templates/reflection/overall_header.html
r260 r269 27 27 28 28 <script type="text/javascript" src="{ROOT_PATH}js/functions.js"></script> 29 <script type="text/javascript" src="{ROOT_PATH}js/jquery.js"></script> 29 30 <script type="text/javascript"> 30 var sizes_ary = {'{L_KILOBYTES}':1024,'{L_MEGABYTES}':1024*1024,'{L_GIGABYTES}':1024*1024*1024,'{L_TERABYTES}':1024*1024*1024*1024};31 31 var SID = '{SID}'; 32 32 var TRACKER_URL = '{ROOT_PATH}'; 33 var l_post_something = '{L_POST_SOMETHING}';34 var L_JS_MARKED = '{L_MARKED}';35 33 var ol_bgcolor = "#FFFFFF"; 34 35 <!-- BEGIN javascript_lang --> 36 var {javascript_lang.KEY} = '{javascript_lang.VALUE}'; 37 <!-- END --> 36 38 </script> 37 39 … … 54 56 <!-- Menu is displayed in reverse order from how you define it (caused by float: right) --> 55 57 <a href="{U_STAFF}" class="lastMenuItem">{L_STAFF}</a> 56 <!-- BEGIN switch_curuser_view-->58 <!-- IF S_USER_LOGGED_IN --> 57 59 <a href="{U_HELPDESC}">{L_HELPDESC}</a> 58 <!-- END switch_curuser_view-->60 <!-- ENDIF --> 59 61 <a href="{U_FORUM}">{L_FORUMS}</a> 60 62 <a href="{U_RULES}">{L_RULES}</a> 61 63 <a href="{U_FAQ}">{L_FAQ}</a> 62 <!-- BEGIN switch_non_curuser_view-->64 <!-- IF not S_USER_LOGGED_IN --> 63 65 <a href="{U_LOGIN}">{L_LOGIN}</a> 64 66 <a href="{U_SIGNUP}">{L_SIGNUP}</a> 65 <!-- END switch_non_curuser_view-->67 <!-- ENDIF --> 66 68 <!-- BEGIN switch_non_uploader_view --> 67 69 <a href="{U_UPLOADAPP}">{L_UPLOAD}</a> … … 81 83 82 84 <div id="contentLeftWrapper"> 83 <!-- BEGIN user_panel-->85 <!-- IF S_USER_LOGGED_IN --> 84 86 <p> 85 87 <span class="header">{L_MY_PROFILE}</span> 86 {L_HELLO}<a href="{U_USERDETAILS_LINK}"><b>{ user_panel.CURUSER_NAME}</b></a> {user_panel.CURUSER_ICONS}88 {L_HELLO}<a href="{U_USERDETAILS_LINK}"><b>{CURRENT_USER_NAME}</b></a> {CURRENT_USER_ICONS} 87 89 88 90 <span class="<!-- IF CURRENT_USER_POINTS_LEVEL < 0 -->badUserResp<!-- ELSE -->goodUserResp<!-- ENDIF -->">{CURRENT_USER_POINTS_LEVEL}</span> … … 90 92 [<a href="{U_LOGOUT}">{L_LOGOUT}</a>]<br /> 91 93 92 {L_RATIO}: { user_panel.RATIO} <img alt="{L_UPLOADED}" title="{L_UPLOADED}" src="pic/arrowup.gif" /> {user_panel.UPED} <img alt="{L_DOWNLOADED}" title="{L_DOWNLOADED}" src="pic/arrowdown.gif" /> {user_panel.DOWNED}<br />93 <!-- IF WARN_PANEL -->{user_panel.WARN_PANEL}<br /><!-- ENDIF -->94 <a href="{U_MESSAGES_INBOX}"><img src="{ user_panel.INBOX_PM_PIC}" height="14" alt="{user_panel.PM_TITLE}" /></a> {L_INBOX}95 <a href="{U_MESSAGES_SENTBOX}"> <img src="{ user_panel.SENTBOX_PIC}" height="14" alt="{L_SENTBOX}" /></a> {L_SENTBOX}96 <a href="{U_MY_FRIENDS}"><img src="{ user_panel.BUDDYLIST_PIC}" height="14" alt="{L_BUDDYLIST}" /></a><br />97 { user_panel.S_CURRENT_TIME}94 {L_RATIO}: {CURRENT_USER_RATIO} <img alt="{L_UPLOADED}" title="{L_UPLOADED}" src="pic/arrowup.gif" /> {CURRENT_USER_UPED} <img alt="{L_DOWNLOADED}" title="{L_DOWNLOADED}" src="pic/arrowdown.gif" /> {CURRENT_USER_DOWNED}<br /> 95 <!-- IF CURRENT_USER_WARN_PANEL -->{CURRENT_USER_WARN_PANEL}<br /><!-- ENDIF --> 96 <a href="{U_MESSAGES_INBOX}"><img src="{INBOX_PM_PIC}" height="14" alt="{PM_TITLE}" /></a> {L_INBOX} 97 <a href="{U_MESSAGES_SENTBOX}"> <img src="{SENTBOX_PIC}" height="14" alt="{L_SENTBOX}" /></a> {L_SENTBOX} 98 <a href="{U_MY_FRIENDS}"><img src="{BUDDYLIST_PIC}" height="14" alt="{L_BUDDYLIST}" /></a><br /> 99 {S_CURRENT_TIME} 98 100 <script type="text/javascript"> 99 101 clock.add_clock('{CURRENT_TIME}', 'clock'); … … 101 103 </script> 102 104 </p> 103 <!-- END user_panel-->104 105 <p> 106 <!-- BEGIN switch_curuser_view-->105 <!-- ENDIF --> 106 107 <p> 108 <!-- IF S_USER_LOGGED_IN --> 107 109 <span class="header">{L_TORRENTS}</span> 108 110 <a href="{U_BROWSE}">{L_BROWSE}</a><br /> … … 110 112 <a href="{U_REQUESTS}">{L_REQUESTS}</a><br /> 111 113 <a href="{U_OFFERS}">{L_OFFERS}</a><br /> 112 <!-- END switch_curuser_view-->114 <!-- ENDIF --> 113 115 <!-- BEGIN switch_non_uploader_view --> 114 116 <a href="{U_UPLOADAPP}">{L_UPLOAD}</a> … … 127 129 </p> 128 130 129 <!-- BEGIN switch_curuser_view-->131 <!-- IF S_USER_LOGGED_IN --> 130 132 <p> 131 133 <span class="header">{L_PERSONAL}</span> … … 140 142 <!-- IF U_MY_INVITES --><a href="{U_MY_INVITES}">{L_MY_INVITES}</a><!-- ENDIF --> 141 143 </p> 142 <!-- END switch_curuser_view --> 144 <!-- ENDIF --> 145 143 146 144 147 <p> … … 154 157 <a href="{U_STAFF}">{L_STAFF}</a><br /> 155 158 <a href="{U_LOG}">{L_LOG}</a><br /> 156 <!-- BEGIN switch_moderator_view-->159 <!-- IF S_USER_IS_MOD --> 157 160 <a href="{U_HELPDESC}"><!-- IF HELPDESC_NUM > 0 --><span style="color:red;"><b>{L_HELPDESC} ({HELPDESC_NUM})</b></span><!-- ELSE -->{L_HELPDESC}<!-- ENDIF --></a><br /> 158 161 <a href="{U_UPLOADAPP}"><!-- IF CANDIDATES_NUM > 0 --><span style="color:red;"><b>{L_CANDIDATES} ({CANDIDATES_NUM})</b></span><!-- ELSE -->{L_CANDIDATES}<!-- ENDIF --></a><br /> 159 162 <a href="{U_REPORTS}"><!-- IF REPORTS_NUM > 0 --><span style="color:red;"><b>{L_REPORTS} ({REPORTS_NUM})</b></span><!-- ELSE -->{L_REPORTS}<!-- ENDIF --></a><br /> 160 163 <a href="{U_USERSEARCH}"><span>{L_USER_SEARCH}</span></a><br /> 161 <!-- END switch_moderator_view-->164 <!-- ENDIF --> 162 165 163 166 <!-- BEGIN switch_admin_view --> templates/reflection/reflection.cfg
r83 r269 141 141 $config['vote_graphic_length'] = 205; 142 142 143 $config['min_tag_size'] = '11'; //min tag size in pixeils 144 $config['max_tag_size'] = '25'; //max tag size in pixeils 145 143 146 // Start add - Online/Offline/Hidden Mod 144 147 $images['icon_online'] = $current_template_images . '/{LANG}/icon_online.png'; templates/reflection/reflection.css
r234 r269 809 809 .helpline { background-color: #DEE3E7; border-style: none; } 810 810 811 /* Quote & Code blocks */ 811 .liststyle { 812 margin-left:20px; 813 } 814 815 /* Copyright and bottom info */ 816 .copyright { font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #444444; letter-spacing: -1px;} 817 a.copyright { color: #444444; text-decoration: none;} 818 a.copyright:hover { color: #000000; text-decoration: underline;} 819 820 /* The text input fields background colour */ 821 input.post, textarea.post, select { 822 background-color : #FFFFFF; 823 } 824 825 /* The main submit button option */ 826 input.mainoption { 827 background-color : #FAFAFA; 828 font-weight : bold; 829 } 830 831 /* None-bold submit button */ 832 input.liteoption { 833 background-color : #FAFAFA; 834 font-weight : normal; 835 } 836 837 /* This is the line in the posting page which shows the rollover 838 help line. This is actually a text box, but if set to be the same 839 colour as the background no one will know ;) 840 */ 841 .helpline { background-color: #DEE3E7; border-style: none; } 842 /* Set Image style */ 843 img, .forumline img { 844 border: 0; 845 } 846 /* Begin Simple Subforums MOD */ 847 a.topic-new, a.topic-new:visited { color: #DD6900; } 848 a.topic-new:hover, a.topic-new:active { color: #006699; } 849 /* End Simple Subforums MOD */ 850 851 .pager_page { 852 padding:2px; 853 font-weight:bold; 854 } 855 856 .pager_page_selected { 857 padding:2px; 858 font-weight:bold; 859 } 860 861 a.upReputationLink:link, 862 a.upReputationLink:visited 863 { 864 font-size: 1em; 865 line-height: 10px; 866 background: transparent url(images/arrow-up-v2.gif) no-repeat 0 1px; 867 padding: 1px 5px; 868 text-decoration: none; 869 } 870 871 a.upReputationLink:hover, 872 a.upReputationLink:active 873 { 874 background: transparent url(images/arrow-up-v2.gif) no-repeat 0 -15px; 875 } 876 877 a.downReputationLink:link, 878 a.downReputationLink:visited 879 { 880 font-size: 1em; 881 line-height: 10px; 882 background: transparent url(images/arrow-down-v2.gif) no-repeat 0 1px; 883 padding: 1px 6px; 884 text-decoration: none; 885 } 886 887 a.downReputationLink:hover, 888 a.downReputationLink:active 889 { 890 background: transparent url(images/arrow-down-v2.gif) no-repeat 0 -15px; 891 } 892 893 span.goodResp 894 { 895 background: #66cc66; 896 border: 1px solid #339966; 897 padding: 1px 3px 2px 3px; 898 } 899 900 span.badResp 901 { 902 background: #ff6666; 903 border: 1px solid #ff3333; 904 padding: 1px 3px 2px 3px; 905 } 906 907 span.usergoodResp 908 { 909 color: #66cc66; 910 } 911 912 span.userbadResp 913 { 914 color: #ff3333; 915 } 916 917 .respectUserList { 918 border-top:1px solid #696969; 919 white-space: normal; 920 } 921 922 .message_msg p {font-size: 10px; color: #000000; margin:8px 0px 0px 0px;} 923 924 .mod { 925 margin: 10px 5px 0px 5px; 926 line-height: 125%; 927 font-size:10px; background-color:#FFFFFF; 928 border-color: #A9B8C2; 929 border-width: 1px 1px 1px 1px; 930 border-style: solid; 931 color:#000000; 932 } 933 .modtable { 934 background-color: #ff6060; 935 height:50px; width: 40px; 936 text-align:center; 937 } 938 .exclamation { 939 font-weight: bold; 940 font-family: Times New Roman, Verdana; 941 font-size : 45px; 942 color: #ffffff; 943 } 944 945 span.goodUserResp 946 { 947 background: #cccc00; 948 border: 1px solid #999900; 949 padding: 0 3px 0 3px; 950 color: #ffffff; 951 } 952 953 span.badUserResp 954 { 955 background: #999900; 956 border: 1px solid #666600; 957 padding: 0 3px 0 3px; 958 color: #ffffff; 959 } 960 961 /* bb tags */ 812 962 .codetitle { 813 963 margin: 10px 5px 0px 5px; … … 869 1019 } 870 1020 871 .liststyle { 872 margin-left:20px; 873 } 874 875 /* Copyright and bottom info */ 876 .copyright { font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; color: #444444; letter-spacing: -1px;} 877 a.copyright { color: #444444; text-decoration: none;} 878 a.copyright:hover { color: #000000; text-decoration: underline;} 879 880 /* The text input fields background colour */ 881 input.post, textarea.post, select { 882 background-color : #FFFFFF; 883 } 884 885 /* The main submit button option */ 886 input.mainoption { 887 background-color : #FAFAFA; 888 font-weight : bold; 889 } 890 891 /* None-bold submit button */ 892 input.liteoption { 893 background-color : #FAFAFA; 894 font-weight : normal; 895 } 896 897 /* This is the line in the posting page which shows the rollover 898 help line. This is actually a text box, but if set to be the same 899 colour as the background no one will know ;) 900 */ 901 .helpline { background-color: #DEE3E7; border-style: none; } 902 /* Set Image style */ 903 img, .forumline img { 904 border: 0; 905 } 906 /* Begin Simple Subforums MOD */ 907 a.topic-new, a.topic-new:visited { color: #DD6900; } 908 a.topic-new:hover, a.topic-new:active { color: #006699; } 909 /* End Simple Subforums MOD */ 910 911 .pager_page { 912 padding:2px; 913 font-weight:bold; 914 } 915 916 .pager_page_selected { 917 padding:2px; 918 font-weight:bold; 919 } 920 921 a.upReputationLink:link, 922 a.upReputationLink:visited 923 { 924 font-size: 1em; 925 line-height: 10px; 926 background: transparent url(images/arrow-up-v2.gif) no-repeat 0 1px; 927 padding: 1px 5px; 928 text-decoration: none; 929 } 930 931 a.upReputationLink:hover, 932 a.upReputationLink:active 933 { 934 background: transparent url(images/arrow-up-v2.gif) no-repeat 0 -15px; 935 } 936 937 a.downReputationLink:link, 938 a.downReputationLink:visited 939 { 940 font-size: 1em; 941 line-height: 10px; 942 background: transparent url(images/arrow-down-v2.gif) no-repeat 0 1px; 943 padding: 1px 6px; 944 text-decoration: none; 945 } 946 947 a.downReputationLink:hover, 948 a.downReputationLink:active 949 { 950 background: transparent url(images/arrow-down-v2.gif) no-repeat 0 -15px; 951 } 952 953 span.goodResp 954 { 955 background: #66cc66; 956 border: 1px solid #339966; 957 padding: 1px 3px 2px 3px; 958 } 959 960 span.badResp 961 { 962 background: #ff6666; 963 border: 1px solid #ff3333; 964 padding: 1px 3px 2px 3px; 965 } 966 967 span.usergoodResp 968 { 969 color: #66cc66; 970 } 971 972 span.userbadResp 973 { 974 color: #ff3333; 975 } 976 977 .respectUserList { 978 border-top:1px solid #696969; 979 white-space: normal; 980 } 981 982 .message_msg p {font-size: 10px; color: #000000; margin:8px 0px 0px 0px;} 983 984 .mod { 985 margin: 10px 5px 0px 5px; 986 line-height: 125%; 987 font-size:10px; background-color:#FFFFFF; 988 border-color: #A9B8C2; 989 border-width: 1px 1px 1px 1px; 990 border-style: solid; 991 color:#000000; 992 } 993 .modtable { 994 background-color: #ff6060; 995 height:50px; width: 40px; 996 text-align:center; 997 } 998 .exclamation { 999 font-weight: bold; 1000 font-family: Times New Roman, Verdana; 1001 font-size : 45px; 1002 color: #ffffff; 1003 } 1004 1005 span.goodUserResp 1006 { 1007 background: #cccc00; 1008 border: 1px solid #999900; 1009 padding: 0 3px 0 3px; 1010 color: #ffffff; 1011 } 1012 1013 span.badUserResp 1014 { 1015 background: #999900; 1016 border: 1px solid #666600; 1017 padding: 0 3px 0 3px; 1018 color: #ffffff; 1019 } 1021 ul.bb, ol.bb { 1022 padding-left:25px; 1023 } 1024 1025 .jqifade{ 1026 position: absolute; 1027 background-color: #aaaaaa; 1028 } 1029 div.jqi{ 1030 width: 400px; 1031 font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; 1032 position: absolute; 1033 background-color: #ffffff; 1034 font-size: 11px; 1035 text-align: left; 1036 border: solid 1px #eeeeee; 1037 -moz-border-radius: 10px; 1038 -webkit-border-radius: 10px; 1039 padding: 7px; 1040 } 1041 div.jqi .jqicontainer{ 1042 font-weight: bold; 1043 } 1044 div.jqi .jqiclose{ 1045 position: absolute; 1046 top: 4px; right: -2px; 1047 width: 18px; 1048 cursor: default; 1049 color: #bbbbbb; 1050 font-weight: bold; 1051 } 1052 div.jqi .jqimessage{ 1053 padding: 10px; 1054 line-height: 20px; 1055 color: #444444; 1056 } 1057 div.jqi .jqibuttons{ 1058 text-align: right; 1059 padding: 5px 0 5px 0; 1060 border: solid 1px #eeeeee; 1061 background-color: #f4f4f4; 1062 } 1063 div.jqi button{ 1064 padding: 3px 10px; 1065 margin: 0 10px; 1066 background-color: #2F6073; 1067 border: solid 1px #f4f4f4; 1068 color: #ffffff; 1069 font-weight: bold; 1070 font-size: 12px; 1071 } 1072 div.jqi button:hover{ 1073 background-color: #728A8C; 1074 } 1075 div.jqi button.jqidefaultbutton{ 1076 background-color: #BF5E26; 1077 } 1078 .jqiwarning .jqi .jqibuttons{ 1079 background-color: #BF5E26; 1080 } 1081 1082 .ac_results { 1083 padding: 0px; 1084 border: 1px solid WindowFrame; 1085 background-color: Window; 1086 overflow: hidden; 1087 } 1088 1089 .ac_results ul { 1090 width: 100%; 1091 list-style-position: outside; 1092 list-style: none; 1093 padding: 0; 1094 margin: 0; 1095 } 1096 1097 .ac_results iframe { 1098 display:none;/*sorry for IE5*/ 1099 display/**/:block;/*sorry for IE5*/ 1100 position:absolute; 1101 top:0; 1102 left:0; 1103 z-index:-1; 1104 filter:mask(); 1105 width:3000px; 1106 height:3000px; 1107 } 1108 1109 .ac_results li { 1110 margin: 0px; 1111 padding: 2px 5px; 1112 cursor: pointer; 1113 display: block; 1114 width: 100%; 1115 font: menu; 1116 font-size: 12px; 1117 overflow: hidden; 1118 } 1119 1120 .ac_over { 1121 background-color: Highlight; 1122 color: HighlightText; 1123 } templates/reflection/textbbcode.html
r259 r269 279 279 </select> 280 280 281 <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;"> 282 <option value="0" selected="selected">{L_TEXT_SIZE}</option> 283 <option value="7" class="genmed">{L_SMALL}</option> 284 <option value="11" class="genmed">{L_STANDART}</option> 285 <option value="16" class="genmed">{L_BIG}</option> 286 <option value="24" class="genmed">{L_VERY_BIG}</option> 281 <select name="addbbcode30" onchange="bbfontstyle('[size=' + this.form.addbbcode30.options[this.form.addbbcode30.selectedIndex].value + ']', '[/size]');this.selectedIndex=0;"> 282 <option value="0" selected="selected">{L_FONT_SIZE}</option> 283 <option value="1" class="genmed">{L_FONT_TINY}</option> 284 <option value="2" class="genmed">{L_FONT_SMALL}</option> 285 <option value="3" class="genmed">{L_FONT_NORMAL}</option> 286 <option value="5" class="genmed">{L_FONT_LARGE}</option> 287 <option value="7" class="genmed">{L_FONT_HUGE}</option> 287 288 </select> 288 289 templates/reflection/userdetails.html
r260 r269 3 3 <script type="text/javascript" src="{ROOT_PATH}js/ajax.js"></script> 4 4 <script type="text/javascript" src="{ROOT_PATH}js/ajax_common.js"></script> 5 <script type="text/javascript">6 var L_JS_SEE_FULL_LIST = '{L_SEE_FULL_LIST}';7 var L_JS_HIDE_LIST = '{L_HIDE_LIST}';8 </script>9 5 10 6 <h1>{USERNAME}{USER_ICONS} <span class="<!-- IF USER_POINTS_LEVEL < 0 -->badUserResp<!-- ELSE -->goodUserResp<!-- ENDIF -->">{USER_POINTS_LEVEL}</span> … … 224 220 <!-- BEGIN switch_buttons --> 225 221 <div class="tableRow"> 226 <div class="leftCell" style="width:100%"> 227 <input type="button" value="{L_SEND_PM_SHORT}" onclick="javascript: location.href='{switch_buttons.U_SEND_PM}'" /> 228 <input type="button" value="{L_REPORT_TO_USER}" onclick="javascript: location.href='{switch_buttons.U_REPORT}'" /> 222 <div class="leftCell" style="width:100%;padding:5px;"> 223 <div class="commentButtonsBlock"> 224 <a href="{switch_buttons.U_SEND_PM}">{L_SEND_PM_SHORT}</a> 225 <a href="{switch_buttons.U_REPORT}">{L_REPORT_TO_USER}</a> 226 227 </div> 229 228 </div> 230 229 <div class="clear"> </div> upload.php
r266 r269 2 2 $root_path = './'; 3 3 require ($root_path . 'include/config.php'); 4 require ($root_path . 'include/functions_post.php');5 4 require ($root_path . 'include/functions_check.php'); 6 5 require ($root_path . 'include/functions_selects.php'); … … 15 14 $cat_id = request_var('cat', 0); 16 15 $cats = $cache->obtain_cats(); 16 17 if ( defined('USE_XBTT') ) { 18 $base_announce = generate_base_url() . ':' . $config['xbt_listen_port'] . '/' . ( $userdata['session_logged_in'] ? $userdata['torrent_pass'] . '/' : '' ) . 'announce/'; 19 } 20 else { 21 $base_announce = generate_base_url() . '/announce.php' . ( $userdata['session_logged_in'] ? '?passkey=' . $userdata['torrent_pass'] : '' ); 22 } 17 23 18 24 if ( !check_user_class($config['min_class_allow_upload']) ) { … … 113 119 } 114 120 else { 115 require ($root_path . 'include/benc.php');116 117 121 $hidden = ( isset($_POST['hidden']) && ( $userdata['hiddentorrents'] || $userdata['class'] >= UC_MODERATOR ) ? 1 : 0); 118 122 119 //start torrent check120 if ( !isset($_FILES['file']) ) {121 trigger_error($lang['dont_empty_fields']);122 }123 list($tmpname, $infohash, $fname, $totallen, $filelist, $dname, $dict, $private) = check_torrent($_FILES['file']);124 //end torrent check125 123 126 124 //start nfo check … … 135 133 @unlink($root_path . '/cache/' . $nfofile['name']); 136 134 $nfo = str_replace('\x0d\x0a', "\n", $nfo); 135 $nfo = trim($nfo); 137 136 138 137 if ( function_exists('iconv') ) { … … 145 144 // end nfo check 146 145 146 //start torrent check 147 if ( !isset($_FILES['file']) ) { 148 trigger_error($lang['dont_empty_fields']); 149 } 150 list($infohash, $fname, $totallen, $filelist, $dname, $filename) = check_torrent($_FILES['file']); 151 //end torrent check 152 147 153 if ( $config['default_type_moderated_torrents'] == MODERATED_ALL_TORRENTS ) { 148 154 $moderated = 0; … … 154 160 $moderated = 1; 155 161 } 156 157 $sql = 'SELECT name, fid FROM ' . TORRENTS_TABLE . ' WHERE info_hash = ' . "'" . $db->sql_escape($infohash) . "'"; 162 $torrent_dir = $root_path . ( !empty($config['torrent_dir']) ? $config['torrent_dir'] : 'torrents'); 163 164 $sql = 'SELECT name, fid, category FROM ' . TORRENTS_TABLE . ' WHERE info_hash = ' . "'" . $db->sql_escape($infohash) . "'"; 158 165 $result = $db->sql_query($sql); 159 166 160 167 if ( $row = $db->sql_fetchrow($result) ) { 161 $message = sprintf($lang['torrent_already_uploaded'], generate_base_url() . '/details.php?id=' . $row['fid'], $row['name']); 168 169 if ( isset($cats[$cats[$row['category']]['cat_parent']]['cat_name']) ) { 170 // www.phpBB-SEO.com SEO TOOLKIT BEGIN 171 $seo->set_url($cat_parent['cat_name'], $cat_parent['cat_id'], $seo->seo_static['browse']); 172 $seo->set_parent($cats[$row['category']]['cat_id'], $seo->seo_static['browse'], $cat_parent['cat_id'], $seo->seo_static['browse']); 173 // www.phpBB-SEO.com SEO TOOLKIT END 174 } 175 176 @unlink($torrent_dir . DIRECTORY_SEPARATOR . $filename . '.torrent'); 177 $message = sprintf($lang['torrent_already_uploaded'], append_sid($root_path . 'details.php?id=' . $row['fid']), $row['name']); 162 178 trigger_error($message); 163 179 } … … 180 196 181 197 $sql = 'INSERT INTO ' . TORRENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); 182 183 $db->sql_query($sql); 184 198 $db->sql_query($sql); 185 199 $id = $db->sql_nextid(); 186 200 187 $torrent_dir = $root_path . ( !empty($config['torrent_dir']) ? $config['torrent_dir'] : 'torrents'); 188 189 if ( @move_uploaded_file($tmpname, $torrent_dir . DIRECTORY_SEPARATOR . $id . '.torrent') !== false ) { 190 191 $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (checkcomm_userid, checkcomm_for_id, checkcomm_type) VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . TYPE_TORRENT . ')'; 201 @rename($torrent_dir . DIRECTORY_SEPARATOR . $filename . '.torrent', $torrent_dir . DIRECTORY_SEPARATOR . $id . '.torrent'); 202 203 $sql = 'INSERT INTO ' . COMMENTS_NOTIFY_TABLE . ' (checkcomm_userid, checkcomm_for_id, checkcomm_type) VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . TYPE_TORRENT . ')'; 204 $db->sql_query($sql); 205 206 $sql = 'DELETE FROM ' . FILES_TABLE . ' WHERE torrent = ' . $id; 207 $db->sql_query($sql); 208 foreach ( $filelist AS $file ) { 209 $sql = 'INSERT INTO ' . FILES_TABLE . ' (torrent, filename, size) VALUES (' . $id . ", '" . $db->sql_escape($file[0]) . "'," . $file[1] . ')'; 210 $db->sql_query($sql); 211 } 212 213 /* start tags */ 214 215 $tags_name = request_var('tag_name', ''); 216 $tag_type = TYPE_TORRENT; 217 218 if ( strpos($tags_name, ',') !== false ) { 219 $tags_name = explode(',', $tags_name); 220 } 221 else { 222 $tags_name = array($tags_name); 223 } 224 225 foreach ( $tags_name AS $_null => $tag_name ) { 226 $tag_name = trim($tag_name); 227 $tag_name = preg_replace('/[\.,:\^]/', '', $tag_name); 228 $tag_length = utf_strlen($tag_name); 229 230 if ( !$tag_name ) { 231 continue; 232 } 233 234 if ( $config['tags_max_length'] && $tag_length > $config['tags_max_length'] ) { 235 continue; 236 } 237 238 if ( $config['tags_min_length'] && $tag_length < $config['tags_min_length'] ) { 239 continue; 240 } 241 242 $sql = 'INSERT INTO ' . TAGS_TABLE . ' VALUES (LOWER(\'' . $db->sql_escape($tag_name) . '\'), ' . $tag_type . ', ' . $id . ', 1)'; 192 243 $db->sql_query($sql); 193 244 194 $sql = 'DELETE FROM ' . FILES_TABLE . ' WHERE torrent = ' . $id; 195 $db->sql_query($sql); 196 foreach ( $filelist AS $file ) { 197 $sql = 'INSERT INTO ' . FILES_TABLE . ' (torrent, filename, size) VALUES (' . $id . ", '" . $db->sql_escape($file[0]) . "'," . $file[1] . ')'; 198 $db->sql_query($sql); 199 } 200 //private tracker start 201 if ( !$private ) { 202 if ( $fp = @fopen($torrent_dir . DIRECTORY_SEPARATOR . $id . '.torrent', 'w') ) { 203 @fwrite($fp, benc($dict), strlen(benc($dict))); 204 fclose($fp); 205 } 206 } 207 //private tracker end 208 209 write_log( sprintf($lang['log_torrent_uploaded'], 'details_' . $id, $name, $userdata['name']) ); 210 211 if ( $moderated ) { 212 update_reputation($userdata, $simpaty_type, 1); 213 } 214 215 redirect( append_sid($root_path . 'details.php?id=' . $id . '&uploaded=1')); 216 } 217 else { 218 $sql = 'DELETE FROM ' . TORRENTS_TABLE . ' WHERE fid = ' . $id; 219 $db->sql_query($sql); 220 if ( !file_exists($torrent_dir) || !is_writable($torrent_dir . DIRECTORY_SEPARATOR) ) { 221 trigger_error($lang['dir_not_exist_or_not_writable']); 222 } 223 else { 224 trigger_error($lang['file_cannot_be_uploaded']); 225 } 226 } 245 $sql = 'INSERT INTO ' . TAGS_USERS_TABLE . ' VALUES (' . $userdata['uid'] . ', ' . $id . ', ' . $tag_type . ', LOWER(\'' . $db->sql_escape($tag_name) . '\'))'; 246 $db->sql_query($sql); 247 } 248 249 /* end tags */ 250 251 write_log( sprintf($lang['log_torrent_uploaded'], $id, $name, $userdata['uid'], $userdata['name']) ); 252 253 if ( $moderated ) { 254 update_reputation($userdata, $simpaty_type, 1); 255 } 256 257 if ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_name']) ) { 258 // www.phpBB-SEO.com SEO TOOLKIT BEGIN 259 $seo->set_url($cat_parent['cat_name'], $cat_parent['cat_id'], $seo->seo_static['browse']); 260 $seo->set_parent($cats[$cat_id]['cat_id'], $seo->seo_static['browse'], $cat_parent['cat_id'], $seo->seo_static['browse']); 261 // www.phpBB-SEO.com SEO TOOLKIT END 262 } 263 264 redirect( append_sid($root_path . 'details.php?id=' . $id . '&uploaded=1')); 265 227 266 } 228 267 } … … 249 288 'CATEGORY' => $cat_id, 250 289 'TYPE' => $type, 251 'S_ANNOUNCE_ADDRESS' => sprintf($lang['tracker_announce_address'], generate_base_url() . '/announce.php') ) 252 ); 290 'S_ANNOUNCE_ADDRESS' => sprintf($lang['tracker_announce_address'], $base_announce) 291 )); 292 253 293 if ( ( $userdata['hiddentorrents'] || $userdata['class'] >= UC_MODERATOR ) && $type == 'main' ) { 254 $template->assign_block_vars('uploading.switch_hidden_section', array( 255 'HIDDEN_CHECKED' => (isset($_POST['hidden']) ? ' checked="checked"' : '') ) 256 ); 257 } 258 $template->assign_block_vars('uploading.uploading_preview', array( 294 $template->assign_block_vars('switch_hidden_section', array( 295 'HIDDEN_CHECKED' => ( isset($_POST['hidden']) ? ' checked="checked"' : '') 296 )); 297 } 298 299 $descr = censor_text($descr); 300 $bb_code = new bbcode($descr); 301 $descr = $bb_code->get_html(); 302 303 $template->assign_block_vars('uploading_preview', array( 259 304 'NAME' => censor_text($name), 260 'DESCRIPTION' => format_comment(censor_text($descr)) )261 ) ;305 'DESCRIPTION' => $descr 306 )); 262 307 263 308 stdhead($heading, false); 264 309 $template->set_filenames(array( 265 'body' => 'upload .html')266 ) ;310 'body' => 'upload_body.html' 311 )); 267 312 stdfoot(); 268 313 } … … 273 318 } 274 319 $template->set_filenames(array( 275 'template' => '../upload_templates/' . $cat_id . '.html' )276 );320 'template' => '../upload_templates/' . $cat_id . '.html' 321 )); 277 322 278 323 $sql = 'SELECT pic_url, group_name FROM ' . RELEASE_GROUPS_TABLE . ' ORDER by group_name ASC'; … … 283 328 } 284 329 285 286 287 $template->assign_block_vars('main_body', array());288 289 330 $template->assign_vars(array( 290 331 'S_FORM_ACTION' => append_sid('upload.php'), 291 332 'TYPE' => $type, 292 333 'CATEGORY' => $cat_id, 293 'ANNOUNCE_URL' => ( $type == 'main'? generate_base_url() . '/announce.php': '' ),334 'ANNOUNCE_URL' => ( $type == 'main'? $base_announce : '' ), 294 335 'L_JS_UNFILLED_FIELDS' => str_replace("'", "\'", $lang['js_unfilled_fields']), 295 336 'RELEASE_GROUP_OPTIONS' => $release_group_options ) … … 300 341 stdhead($heading, false); 301 342 $template->set_filenames(array( 302 'body' => 'upload .html')303 ) ;343 'body' => 'upload_template_body.html' 344 )); 304 345 stdfoot(); 305 346 } … … 308 349 309 350 $s .= '<input type="hidden" name="sid" value="' . $userdata['session_id'] . '" />'; 310 $template->assign_block_vars('cat_select', array());311 351 312 352 $template->assign_vars(array( 313 353 'S_FORM_ACTION' => append_sid('upload.php'), 314 354 'CATS_SELECT' => $s, 315 'TYPE' => $type )316 ) ;355 'TYPE' => $type 356 )); 317 357 318 358 stdhead($heading); 319 359 $template->set_filenames(array( 320 'body' => ' upload.html')321 ) ;360 'body' => 'cats_select_body.html' 361 )); 322 362 stdfoot(); 323 363 } uploadapp.php
r266 r269 2 2 $root_path = './'; 3 3 require ($root_path . 'include/config.php'); 4 require ($root_path . 'include/functions_post.php');5 4 require ($root_path . 'languages/lang_' . $config['default_lang'] . '/lang_modcomment_log.php'); 6 5 … … 293 292 } 294 293 294 /* */ 295 require ($root_path . 'include/bbcode/bbcode.lib.php'); 296 $bb_code = new bbcode(); 297 /* */ 298 295 299 $template->assign_vars(array( 296 300 'MESSAGE' => ( isset($message) ? $message : '' ), … … 324 328 $upload = ($row['upload'] / 1048576) . ' ' . utf_ucfirst(utf_strtolower($lang['megabytes'])) . '/' . $lang['seconds_short']; 325 329 } 330 } 331 332 if ( $row['content'] ) { 333 $bb_code->parse($row['content']); 334 $row['content'] = $bb_code->get_html(); 335 } 336 337 if ( $row['comment'] ) { 338 $bb_code->parse($row['comment']); 339 $row['comment'] = $bb_code->get_html(); 340 } 341 342 if ( $row['modcomments'] ) { 343 $bb_code->parse($row['modcomments']); 344 $row['modcomments'] = $bb_code->get_html(); 326 345 } 327 346 … … 345 364 'SHOW_CLOSE_INPUT' => ( $userdata['class'] >= UC_ADMINISTRATOR && $row['active'] ? TRUE : FALSE ), 346 365 'SHOW_DELETE_INPUT' => ( $userdata['class'] >= UC_ADMINISTRATOR ? TRUE : FALSE ), 347 'CONTENT' => format_comment($row['content']),348 'COMMENT' => format_comment($row['comment']),349 'MODCOMMENTS' => ( $row['modcomments'] ? format_comment($row['modcomments']): ( $row['active'] ? $lang['no_comments_yet'] : '' ) ),366 'CONTENT' => $row['content'], 367 'COMMENT' => $row['comment'], 368 'MODCOMMENTS' => ( $row['modcomments'] ? $row['modcomments'] : ( $row['active'] ? $lang['no_comments_yet'] : '' ) ), 350 369 'DISABLED' => ( $row['active'] ? '' : 'disabled="disabled"') 351 370 )); userdetails.php
r266 r269 2 2 $root_path = './'; 3 3 require ($root_path . 'include/config.php'); 4 require ($root_path . 'include/ functions_post.php');4 require ($root_path . 'include/bbcode/bbcode.lib.php'); 5 5 require ($root_path . 'include/functions_selects.php'); 6 6 … … 11 11 function maketable( $row ) 12 12 { 13 global $config, $lang, $template, $db, $images, $user, $userdata, $cats ;13 global $config, $lang, $template, $db, $images, $user, $userdata, $cats, $root_path; 14 14 15 15 for ( $i = 0; $i < sizeof( $row ); ++$i ) { … … 27 27 $ttl .= '<br />' . ( $ttl == 1? $lang['hour']: $lang['hours'] ); 28 28 } 29 30 $cat_id = $row[$i]['category']; 31 $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 29 32 30 33 … … 83 86 switch ( $view ) { 84 87 case 'uploaded_torrents': 85 $template->set_filenames( array( 'uploaded_torrents_tpl' => 'userdetails_uploaded_torrents.html' ) 86 ); 87 $sql = 'SELECT t.fid, t.name, t.seeders, t.leechers, t.category, t.ctime, t.free, t.ratingsum, t.numratings, COUNT(th.torrentid) AS thanks_per_torrent 88 $template->set_filenames( 89 array( 'uploaded_torrents_tpl' => 'userdetails_uploaded_torrents.html' 90 )); 91 $sql = 'SELECT t.fid, t.name, t.seeders, t.leechers, t.category, t.ctime, t.free, t.ratingsum, t.numratings 88 92 FROM ' . TORRENTS_TABLE . ' t 89 LEFT JOIN ' . THANKS_TABLE . ' th ON t.fid = th.torrentid90 93 WHERE t.owner = ' . $id . ' 91 94 ' . $where . ' … … 97 100 $added = create_date($row['ctime']); 98 101 99 $template->assign_block_vars( 'uploaded_torrents_row', array( 102 $cat_id = $row['category']; 103 $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 104 105 106 $template->assign_block_vars('uploaded_torrents_row', array( 100 107 'U_DETAILS' => append_sid($root_path . 'details.php?id=' . $row['fid'] ), 101 'U_PEERLIST' => append_sid( $root_path . 'details.php?id=' . $row['fid'] . '&view=peerlist' ),108 'U_PEERLIST' => append_sid($root_path . 'details.php?id=' . $row['fid'] . '&view=peerlist' ), 102 109 'CAT_PIC' => $cats[$row['category']]['cat_pic'], 103 110 'CAT_NAME' => $cats[$row['category']]['cat_name'], … … 106 113 'SEEDERS' => $row['seeders'], 107 114 'LEECHERS' => $row['leechers'], 108 'ADDED' => str_replace( ' ', '<br />', $added ) ) 109 ); 110 } while ( $row = $db->sql_fetchrow( $result ) ); 115 'ADDED' => $added 116 )); 117 } 118 while ( $row = $db->sql_fetchrow($result) ); 111 119 } 112 120 $db->sql_freeresult(); … … 158 166 ORDER BY t.name'; 159 167 $result = $db->sql_query( $sql ); 160 if ( $ a= $db->sql_fetchrow( $result ) ) {168 if ( $row = $db->sql_fetchrow( $result ) ) { 161 169 do { 162 $ratio = get_ratio( $ a['uploaded'], $a['downloaded'] );170 $ratio = get_ratio( $row['uploaded'], $row['downloaded'] ); 163 171 $ratio_color = get_ratio_color( $ratio ); 164 172 173 $cat_id = $row['category']; 174 $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 165 175 166 176 $template->assign_block_vars( 'downloaded_torrents_row', array( 167 'U_DETAILS' => append_sid($root_path . 'details.php?id=' . $ a['fid'] ),168 'U_PEERLIST' => append_sid( $root_path . 'details.php?id=' . $ a['fid'] . '&view=peerlist' ),177 'U_DETAILS' => append_sid($root_path . 'details.php?id=' . $row['fid'] ), 178 'U_PEERLIST' => append_sid( $root_path . 'details.php?id=' . $row['fid'] . '&view=peerlist' ), 169 179 'RATIO' => ( $user['privacy'] <> PRIVACY_LEVEL_LOW && $userdata['class'] < UC_MODERATOR && $userdata['uid'] <> $id ? '---' : $ratio ), 170 180 'RATIO_COLOR' => $ratio_color, 171 'CAT_PIC' => $cats[$a['category']]['cat_pic'], 172 'CAT_NAME' => $cats[$a['category']]['cat_name'], 173 'ID' => $a['fid'], 174 'NAME' => $a['name'] . ( $a['free'] ? '<img src="' . $images['freedownload'] . '" alt="" />' : '' ), 175 'SEEDERS' => $a['seeders'], 176 'LEECHERS' => $a['leechers'], 177 'UPLOADED' => ( $user['privacy'] <> PRIVACY_LEVEL_LOW && $userdata['class'] < UC_MODERATOR && $userdata['uid'] <> $id ? '---' : mksize( $a['uploaded'] ) ), 178 'DOWNLOADED' => ( $user['privacy'] <> PRIVACY_LEVEL_LOW && $userdata['class'] < UC_MODERATOR && $userdata['uid'] <> $id ? '---' : mksize( $a['downloaded'] ) ) ) 179 ); 180 } while ( $a = $db->sql_fetchrow( $result ) ); 181 'CAT_PIC' => $cats[$row['category']]['cat_pic'], 182 'CAT_NAME' => $cats[$row['category']]['cat_name'], 183 'ID' => $row['fid'], 184 'NAME' => $row['name'] . ( $row['free'] ? '<img src="' . $images['freedownload'] . '" alt="" />' : '' ), 185 'SEEDERS' => $row['seeders'], 186 'LEECHERS' => $row['leechers'], 187 'UPLOADED' => ( $user['privacy'] <> PRIVACY_LEVEL_LOW && $userdata['class'] < UC_MODERATOR && $userdata['uid'] <> $id ? '---' : mksize( $row['uploaded'] ) ), 188 'DOWNLOADED' => ( $user['privacy'] <> PRIVACY_LEVEL_LOW && $userdata['class'] < UC_MODERATOR && $userdata['uid'] <> $id ? '---' : mksize( $row['downloaded'] ) ) 189 )); 190 } 191 while ( $row = $db->sql_fetchrow( $result ) ); 181 192 } 182 193 $db->sql_freeresult(); … … 203 214 ORDER BY t.name'; 204 215 $result = $db->sql_query( $sql ); 205 if ( $ a= $db->sql_fetchrow( $result ) ) {216 if ( $row = $db->sql_fetchrow( $result ) ) { 206 217 do { 207 $ratio = get_ratio( $ a['uploaded'], $a['downloaded'] );218 $ratio = get_ratio( $row['uploaded'], $row['downloaded'] ); 208 219 $ratio_color = get_ratio_color( $ratio ); 209 220 221 $cat_id = $row['category']; 222 $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 210 223 211 224 $template->assign_block_vars( 'helped_torrents_row', array( 212 'U_DETAILS' => append_sid($root_path . 'details.php?id=' . $ a['fid'] ),213 'U_PEERLIST' => append_sid( $root_path . 'details.php?id=' . $ a['fid'] . '&view=peerlist' ),225 'U_DETAILS' => append_sid($root_path . 'details.php?id=' . $row['fid'] ), 226 'U_PEERLIST' => append_sid( $root_path . 'details.php?id=' . $row['fid'] . '&view=peerlist' ), 214 227 'RATIO' => ( $user['privacy'] <> PRIVACY_LEVEL_LOW && $userdata['class'] < UC_MODERATOR && $userdata['uid'] <> $id ? '---' : $ratio ), 215 228 'RATIO_COLOR' => $ratio_color, 216 'CAT_PIC' => $cats[$a['category']]['cat_pic'], 217 'CAT_NAME' => $cats[$a['category']]['cat_name'], 218 'ID' => $a['fid'], 219 'NAME' => $a['name'] . ( $a['free'] ? '<img src="' . $images['freedownload'] . '" alt="" />' : '' ), 220 'SEEDERS' => $a['seeders'], 221 'LEECHERS' => $a['leechers'], 222 'UPLOADED' => ( $user['privacy'] <> PRIVACY_LEVEL_LOW && $userdata['class'] < UC_MODERATOR && $userdata['uid'] <> $id ? '---' : mksize( $a['uploaded'] ) ) ) 223 ); 224 } while ( $a = $db->sql_fetchrow( $result ) ); 229 'CAT_PIC' => $cats[$row['category']]['cat_pic'], 230 'CAT_NAME' => $cats[$row['category']]['cat_name'], 231 'ID' => $row['fid'], 232 'NAME' => $row['name'] . ( $row['free'] ? '<img src="' . $images['freedownload'] . '" alt="" />' : '' ), 233 'SEEDERS' => $row['seeders'], 234 'LEECHERS' => $row['leechers'], 235 'UPLOADED' => ( $user['privacy'] <> PRIVACY_LEVEL_LOW && $userdata['class'] < UC_MODERATOR && $userdata['uid'] <> $id ? '---' : mksize( $row['uploaded'] ) ) 236 )); 237 } 238 while ( $row = $db->sql_fetchrow($result) ); 225 239 } 226 240 $db->sql_freeresult(); … … 236 250 237 251 $id = request_var('id', 0); 252 $username = request_var('un', ''); 238 253 239 254 $sql = 'SELECT u.*, co.flagpic AS country_pic, co.name AS country_name, u.user_posts 240 255 FROM ' . USERS_TABLE . ' u, ' . COUNTRIES_TABLE . ' co 241 WHERE u.uid = ' . $id .' AND u.country = co.id';256 WHERE ' . ( $username ? 'u.name = \'' . $db->sql_escape($username) . '\'' : 'u.uid = ' . $id ) . ' AND u.country = co.id'; 242 257 $result = $db->sql_query( $sql ); 243 if ( ! ( $user = $db->sql_fetchrow( $result ) ) || !$id) {258 if ( !$user = $db->sql_fetchrow($result) ) { 244 259 trigger_error( sprintf( $lang['invalid_id'], $id ) ); 245 260 } 246 261 $db->sql_freeresult(); 262 263 $id = $user['uid']; 247 264 248 265 if ( !$user['status'] ) { … … 265 282 $count = ( $row = $db->sql_fetchrow( $result ) ) ? $row['count'] : 0; 266 283 267 list( $pagertop, $pagerbottom, $limit ) = pager( $config['posts_per_page'], $count, 'userdetails.php? comments_history=1&id=' . $id . '&' );268 269 $subject = '<a href="' . append_sid( 'userdetails.php?id=' . $id) . '"><b>' . $user['name'] . '</b></a>' . get_user_icons( $user, true );270 271 $sql = "SELECT t.name, c.comment_id, c.comment_for_id, c.comment_added, c.comment_text, c.comment_type, r.request AS request_name, o.name AS offer_name, r.id AS request_id, o.id AS offer_id284 list( $pagertop, $pagerbottom, $limit ) = pager( $config['posts_per_page'], $count, 'userdetails.php?id=' . $id . '&comments_history=1&' ); 285 286 $subject = '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $id) . '"><b>' . $user['name'] . '</b></a>' . get_user_icons( $user, true ); 287 288 $sql = "SELECT t.name, t.category AS t_category, c.comment_id, c.comment_for_id, c.comment_added, c.comment_text, c.comment_type, r.request AS request_name, o.name AS offer_name, r.id AS request_id, o.id AS offer_id 272 289 FROM $from_is 273 290 WHERE c.comment_user = " . $id . " … … 275 292 $result = $db->sql_query( $sql ); 276 293 277 $template->assign_vars( array( 'SUBJECT' => sprintf( $lang['history_comments'], $subject ), 294 $template->assign_vars( array( 295 'SUBJECT' => sprintf( $lang['history_comments'], $subject ), 278 296 'PAGERTOP' => $pagertop, 279 'PAGERBOTTOM' => $pagerbottom ) 280 ); 297 'PAGERBOTTOM' => $pagerbottom 298 )); 299 300 $bb_code = new bbcode(); 301 $cats = $cache->obtain_cats(); 281 302 282 303 if ( $row = $db->sql_fetchrow( $result ) ) { … … 291 312 case TYPE_TORRENT: 292 313 314 $cat_id = $row['t_category']; 315 $cat_parent_id = ( isset($cats[$cats[$cat_id]['cat_parent']]['cat_id']) ? $cats[$cats[$cat_id]['cat_parent']]['cat_id'] : 0 ); 316 293 317 $name = $lang['torrent']; 294 318 $link = '<a href="' . append_sid($root_path . 'details.php?id=' . $row['comment_for_id'] ) . '#startcomments">' . $torrent . '</a>'; … … 309 333 } 310 334 311 $template->assign_block_vars( 'viewcomm_row', array( 'ADDED' => $added, 335 $comment_text = censor_text($row['comment_text']); 336 $bb_code->parse($comment_text); 337 $comment_text = $bb_code->get_html(); 338 339 $template->assign_block_vars( 'viewcomm_row', array( 340 'ADDED' => $added, 312 341 'NAME' => $name, 313 342 'LINK' => $link, 314 343 'COMMENT_LINK' => $comment_link, 315 'BODY' => format_comment( censor_text( $row['comment_text'] ) ) )316 );344 'BODY' => $comment_text 345 )); 317 346 } 318 347 while ( $row = $db->sql_fetchrow( $result ) ); … … 376 405 if ( $user_sig ) { 377 406 // now we delete imgs if config allow_sig == 2 378 $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace( '#((\r)+?(\n)+?)*(\[url(:' . $user['user_sig_bbcode_uid'] . ')?(.*)\])?\[img.*?:' . $user['user_sig_bbcode_uid'] . '\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img.*?:' . $user['user_sig_bbcode_uid'] . '\](\[/url(:' . $user['user_sig_bbcode_uid'] . ')?\])?#i', '', $user_sig ) : $user_sig; 379 // now we remove bbcode uid from sig, because bbcode uid uses only at forum 380 $user_sig = preg_replace( '#:' . $user['user_sig_bbcode_uid'] . '#', '', $user_sig ); 407 $user_sig = ( $config['allow_sig'] == 2 ) ? preg_replace( '#((\r)+?(\n)+?)*(\[url?(.*)\])?\[img.*?\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img.*?\](\[/url\])?#i', '', $user_sig ) : $user_sig; 381 408 // and now we format sig 382 $user_sig = preg_replace( '/\[img(.*?)\]/', '[img]', $user_sig);383 $user_sig = format_comment( $user_sig);409 $bb_code = new bbcode($user_sig); 410 $user_sig = $bb_code->get_html(); 384 411 } 385 412 … … 528 555 'AGE' => $age, 529 556 'BIRTHDAY' => $user['birthday'], 530 'COMMENTS' => ( $user['comments_count'] ? '<a href="' . append_sid( 'userdetails.php?id=' . $id . '&comments_history=1' ) . '">' . $user['comments_count'] . '</a>' : 0 ),557 'COMMENTS' => ( $user['comments_count'] ? '<a href="' . append_sid($root_path . 'userdetails.php?id=' . $id . '&comments_history=1' ) . '">' . $user['comments_count'] . '</a>' : 0 ), 531 558 'FORUM_POSTS' => ( $user['user_posts'] ? '<a href="' . append_sid( 'phpbb2.php?page=search&search_author=' . $user['name'] ) . '">' . $user['user_posts'] . '</a>' : 0 ), 532 559 'USER_SIGNATURE' => censor_text( $user_sig ),
