Advertisement
Guest User

phpbb3 auto-translate Vana'diel

a guest
Feb 16th, 2011
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 21.67 KB | None | 0 0
  1. diff -c -r -b ff14/includes/functions_content.php phpbb_stock_ff14/includes/functions_content.php
  2. *** ff14/includes/functions_content.php 2011-02-16 08:50:37.000000000 -0500
  3. --- phpbb_stock_ff14/includes/functions_content.php 2009-11-16 12:10:34.000000000 -0500
  4. ***************
  5. *** 715,779 ****
  6.     return $text;
  7.   }
  8.  
  9. - // MOD : Auto-translate Vana'diel (v0.1.0) - START
  10. - function translate_text($text)
  11. - {
  12. -     global $user;
  13. -
  14. -         // Nothing to do?
  15. -         if ($text === '')
  16. -         {
  17. -                 return '';
  18. -         }
  19. -   //echo "in translate, comparing against ".$text."\n";
  20. -         if ( preg_match_all('|\[translate=([a-z]{2})(.*)\](.*)\[\/translate(.*)\]|',$text,$matches) )
  21. -   {
  22. -           //echo "in match_all, matched on $text\n";
  23. -       $final = $text;
  24. -       $results = Array();
  25. -             //echo "<pre>".print_r($matches)."</pre> TEST:".$matches[1][0];
  26. -             if ( count($matches) > 0 )
  27. -             {
  28. -          //echo "in first if\n";
  29. -                global $db;
  30. -                  $i=0;
  31. -                while( $i < count($matches[0]))
  32. -                {
  33. -       $newstr = htmlspecialchars_decode($matches[3][$i],ENT_QUOTES);
  34. -                  $sql = 'SELECT * FROM phpbb_auto_trans WHERE '.$matches[1][$i].'_txt = "'.$newstr.'"';
  35. -        //echo "in while, sql: ".$sql."\n";
  36. -                  $result = $db->sql_query($sql);
  37. -                  if ($row = $db->sql_fetchrow($result))
  38. -                  {
  39. -               $results[] = $row;
  40. -                  }
  41. -                  $db->sql_freeresult($result);
  42. -                 if ( count($results) > 0 && $results[$i] )
  43. -                 {
  44. -             //echo "\n[------------------------\n|REPLACING '".$matches[3][$i]."' in ".$final."|\n";
  45. -                 $str = '<span style="background-color: #000000"><span style="color: #00FF00">{</span><span style="color: #FFFFFF">'.$results[$i][$user->data['user_lang'].'_txt'].'</span><span style="color: #FF0000">}</span></span>';
  46. -             //echo "\n|REPLACED TO ".$i."==".preg_replace('/\[translate=([a-z]{2})(.*)\]'.$matches[3][$i].'\[\/translate(.*)\]/',$str,$final,-1,$ct)."|\n";
  47. -                       $final = preg_replace('/\[translate=([a-z]{2})(.*?)\]'.preg_quote($matches[3][$i]).'\[\/translate(.*?)\]/',$str,$final,-1,$ct);
  48. -             //echo "\n|FINAL is now ".$final."|\n";
  49. -             //$final = preg_replace('/\[translate=([a-z]{2})(.*)\]'.$matches[3][$i].'\[\/translate(.*)\]/',$matches[3][$i],$final);
  50. -             //echo "\n(Replaced ".$ct." phrases)\n------------------------]\n";
  51. -             }
  52. -         else //invalid phrase
  53. -         {
  54. -             //echo "INVALID PHRASE, replacing with normal text\n";
  55. -             $str = $newstr;
  56. -                       $final = preg_replace('/\[translate=([a-z]{2})(.*)\]'.preg_quote($matches[3][$i]).'\[\/translate(.*)\]/',$str,$final,-1,$ct);
  57. -
  58. -         }
  59. -       $i++;
  60. -                } //end while
  61. -             } //end count matches
  62. -     return $final;
  63. -         } //end if preg_match_all
  64. -         return $text;
  65. - } //end fn
  66. - // MOD : Auto-translate Vana'diel (v0.1.0) - END
  67. -
  68.   /**
  69.   * custom version of nl2br which takes custom BBCodes into account
  70.   */
  71. --- 715,720 ----
  72. diff -c -r -b ff14/includes/functions_display.php phpbb_stock_ff14/includes/functions_display.php
  73. *** ff14/includes/functions_display.php 2011-02-16 08:52:20.000000000 -0500
  74. --- phpbb_stock_ff14/includes/functions_display.php 2009-11-16 12:10:34.000000000 -0500
  75. ***************
  76. *** 880,900 ****
  77.     // Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing)
  78.     $num_predefined_bbcodes = 22;
  79.  
  80. -   // MOD : Auto-translate Vana'diel (v0.1.0) - START
  81. -   $sql = "SELECT ".$user->data['user_lang']."_txt FROM phpbb_auto_trans ORDER BY ".$user->data['user_lang']."_txt DESC";
  82. -         $result = $db->sql_query($sql);
  83. -         $i = 0;
  84. -   $translist = "";
  85. -         while ($row = $db->sql_fetchrow($result))
  86. -   {
  87. -      $translist .= $row[$user->data['user_lang'].'_txt'].',';
  88. -   }
  89. -         $template->assign_vars(array(
  90. -                 'TRANS_LIST'   => $translist
  91. -         ));
  92. -         $db->sql_freeresult($result);
  93. -         // MOD : Auto-translate Vana'diel (v0.1.0) - END
  94. -
  95.     $sql = 'SELECT bbcode_id, bbcode_tag, bbcode_helpline
  96.         FROM ' . BBCODES_TABLE . '
  97.         WHERE display_on_posting = 1
  98. --- 880,885 ----
  99. diff -c -r -b ff14/memberlist.php phpbb_stock_ff14/memberlist.php
  100. *** ff14/memberlist.php 2011-02-16 08:54:21.000000000 -0500
  101. --- phpbb_stock_ff14/memberlist.php 2009-11-16 12:10:33.000000000 -0500
  102. ***************
  103. *** 559,568 ****
  104.             'POSTS_PCT'         => sprintf($user->lang['POST_PCT'], $percentage),
  105.  
  106.             'OCCUPATION'    => (!empty($member['user_occ'])) ? censor_text($member['user_occ']) : '',
  107. -
  108. -           // MOD : Auto-translate Vana'diel (v0.1.0) - START
  109. -           'USER_LANG'     => $member['user_lang'],
  110. -           // MOD : Auto-translate Vana'diel (v0.1.0) - END
  111.             'INTERESTS'     => (!empty($member['user_interests'])) ? censor_text($member['user_interests']) : '',
  112.             'SIGNATURE'     => $member['user_sig'],
  113.             'POSTS_IN_QUEUE'=> $member['posts_in_queue'],
  114. --- 559,564 ----
  115. diff -c -r -b ff14/posting.php phpbb_stock_ff14/posting.php
  116. *** ff14/posting.php    2011-02-16 09:02:04.000000000 -0500
  117. --- phpbb_stock_ff14/posting.php    2009-11-16 12:10:33.000000000 -0500
  118. ***************
  119. *** 1139,1147 ****
  120.     $post_data['post_time'] = ($mode == 'edit') ? $post_data['post_time'] : $current_time;
  121.  
  122.     $preview_message = $message_parser->format_display($post_data['enable_bbcode'], $post_data['enable_urls'], $post_data['enable_smilies'], false);
  123. -         // MOD : Auto-translate Vana'diel (v0.1.0) - START
  124. -   $preview_message = translate_text($preview_message);
  125. -         // MOD : Auto-translate Vana'diel (v0.1.0) - END
  126.  
  127.     $preview_signature = ($mode == 'edit') ? $post_data['user_sig'] : $user->data['user_sig'];
  128.     $preview_signature_uid = ($mode == 'edit') ? $post_data['user_sig_bbcode_uid'] : $user->data['user_sig_bbcode_uid'];
  129. --- 1139,1144 ----
  130. ***************
  131. *** 1166,1175 ****
  132.  
  133.     $preview_subject = censor_text($post_data['post_subject']);
  134.  
  135. -   // MOD : Auto-translate Vana'diel (v0.1.0) - START
  136. -         $preview_subject = translate_text($post_data['post_subject']);
  137. -         // MOD : Auto-translate Vana'diel (v0.1.0) - END
  138. -
  139.     // Poll Preview
  140.     if (!$poll_delete && ($mode == 'post' || ($mode == 'edit' && $post_id == $post_data['topic_first_post_id']/* && (!$post_data['poll_last_vote'] || $auth->acl_get('m_edit', $forum_id))*/))
  141.     && $auth->acl_get('f_poll', $forum_id))
  142. --- 1163,1168 ----
  143. ***************
  144. *** 1249,1268 ****
  145.   {
  146.     if ($config['allow_bbcode'])
  147.     {
  148. !       // MOD : Auto-translate Vana'diel (v0.1.0) - START
  149. !       //$message_parser->message = '[quote=&quot;' . $post_data['quote_username'] . '&quot;]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
  150. !       $message_parser->message = '[quote=&quot;' . $post_data['quote_username'] . '&quot;]' . translate_text(censor_text(trim($message_parser->message))) . "[/quote]\n";
  151. !       // MOD : Auto-translate Vana'diel (v0.1.0) - END
  152.     }
  153.     else
  154.     {
  155.         $offset = 0;
  156.         $quote_string = "&gt; ";
  157. !       // MOD : Auto-translate Vana'diel (v0.1.0) - START
  158. !       //$message = censor_text(trim($message_parser->message));
  159. !       $message = translate_text(censor_text(trim($message_parser->message)));
  160. !       // MOD : Auto-translate Vana'diel (v0.1.0) - END
  161. !
  162.         // see if we are nesting. It's easily tricked but should work for one level of nesting
  163.         if (strpos($message, "&gt;") !== false)
  164.         {
  165. --- 1242,1254 ----
  166.   {
  167.     if ($config['allow_bbcode'])
  168.     {
  169. !       $message_parser->message = '[quote=&quot;' . $post_data['quote_username'] . '&quot;]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
  170.     }
  171.     else
  172.     {
  173.         $offset = 0;
  174.         $quote_string = "&gt; ";
  175. !       $message = censor_text(trim($message_parser->message));
  176.         // see if we are nesting. It's easily tricked but should work for one level of nesting
  177.         if (strpos($message, "&gt;") !== false)
  178.         {
  179. ***************
  180. *** 1406,1415 ****
  181.  
  182.     'FORUM_NAME'            => $post_data['forum_name'],
  183.     'FORUM_DESC'            => ($post_data['forum_desc']) ? generate_text_for_display($post_data['forum_desc'], $post_data['forum_desc_uid'], $post_data['forum_desc_bitfield'], $post_data['forum_desc_options']) : '',
  184. ! // MOD : Auto-translate Vana'diel (v0.1.0) - START
  185. !         //TOPIC_TITLE'            => censor_text($post_data['topic_title']),
  186. !   'TOPIC_TITLE'           => translate_text(censor_text($post_data['topic_title'])),
  187. ! // MOD : Auto-translate Vana'diel (v0.1.0) - END
  188.     'MODERATORS'            => (sizeof($moderators)) ? implode(', ', $moderators[$forum_id]) : '',
  189.     'USERNAME'              => ((!$preview && $mode != 'quote') || $preview) ? $post_data['username'] : '',
  190.     'SUBJECT'               => $post_data['post_subject'],
  191. --- 1392,1398 ----
  192.  
  193.     'FORUM_NAME'            => $post_data['forum_name'],
  194.     'FORUM_DESC'            => ($post_data['forum_desc']) ? generate_text_for_display($post_data['forum_desc'], $post_data['forum_desc_uid'], $post_data['forum_desc_bitfield'], $post_data['forum_desc_options']) : '',
  195. !   'TOPIC_TITLE'           => censor_text($post_data['topic_title']),
  196.     'MODERATORS'            => (sizeof($moderators)) ? implode(', ', $moderators[$forum_id]) : '',
  197.     'USERNAME'              => ((!$preview && $mode != 'quote') || $preview) ? $post_data['username'] : '',
  198.     'SUBJECT'               => $post_data['post_subject'],
  199. diff -c -r -b ff14/styles/prosilver/template/memberlist_view.html phpbb_stock_ff14/styles/prosilver/template/memberlist_view.html
  200. *** ff14/styles/prosilver/template/memberlist_view.html 2011-02-16 09:06:53.000000000 -0500
  201. --- phpbb_stock_ff14/styles/prosilver/template/memberlist_view.html 2009-11-16 12:10:34.000000000 -0500
  202. ***************
  203. *** 26,34 ****
  204.             <!-- IF RANK_TITLE --><dt>{L_RANK}:</dt> <dd>{RANK_TITLE}</dd><!-- ENDIF -->
  205.             <!-- IF RANK_IMG --><dt><!-- IF RANK_TITLE -->&nbsp;<!-- ELSE -->{L_RANK}:<!-- ENDIF --></dt> <dd>{RANK_IMG}</dd><!-- ENDIF -->
  206.         <!-- ENDIF -->
  207. -                 <!-- MOD : Auto-translate Vana'diel (v0.1.0) - START -->
  208. -       <dt>Language:</td> <dd>{USER_LANG}</dd>
  209. -                 <!-- MOD : Auto-translate Vana'diel (v0.1.0) - END -->
  210.         <!-- IF S_USER_INACTIVE --><dt>{L_USER_IS_INACTIVE}:</dt> <dd>{USER_INACTIVE_REASON}</dd><!-- ENDIF -->
  211.         <!-- IF LOCATION --><dt>{L_LOCATION}:</dt> <dd>{LOCATION}</dd><!-- ENDIF -->
  212.         <!-- IF AGE --><dt>{L_AGE}:</dt> <dd>{AGE}</dd><!-- ENDIF -->
  213. --- 26,31 ----
  214. diff -c -r -b ff14/styles/prosilver/template/posting_buttons.html phpbb_stock_ff14/styles/prosilver/template/posting_buttons.html
  215. *** ff14/styles/prosilver/template/posting_buttons.html 2011-02-16 09:13:00.000000000 -0500
  216. --- phpbb_stock_ff14/styles/prosilver/template/posting_buttons.html 2009-11-16 12:10:33.000000000 -0500
  217. ***************
  218. *** 1,66 ****
  219. - <!-- MOD : Auto-translate Vana'diel (v0.1.0) - START -->
  220. -
  221. - <script type="text/javascript" src="styles/prosilver/template/jquery.js"></script>
  222. - <script type="text/javascript" src="styles/prosilver/template/jquery.autocomplete.js"></script>
  223.  
  224.   <script type="text/javascript">
  225.   // <![CDATA[
  226. -
  227. - var list = "{TRANS_LIST}";
  228. -
  229. - function translatestyle(text)
  230. - {
  231. -     var val = document.getElementById('query').value;
  232. -     var lang = '{S_USER_LANG}'.substring(0,2);
  233. -     var arr = list.match(val);
  234. -     if ( arr == null )
  235. -     {
  236. -       alert('That is not a valid translation term.');
  237. -     }
  238. -     else
  239. -     {
  240. -       insert_text('[translate='+lang+']'+val+'[/translate]');
  241. -       document.forms[form_name].elements[text_name].focus();
  242. -     }
  243. - }
  244. -
  245. -
  246. -   var a2;
  247. -  
  248. -   jQuery(function() {
  249. -  
  250. -     var onAutocompleteSelect = function(value, data) {
  251. -       $('#selection').html('<img src="\/global\/flags\/small\/' + data + '.png" alt="" \/> ' + value);
  252. -       alert(data);
  253. -     }
  254. -  
  255. -     var options = {
  256. -       serviceUrl: '/projects/autocomplete/service/autocomplete.ashx',
  257. -       matchContains: true,
  258. -       width: 300,
  259. -       delimiter: /(,|;)\s*/,
  260. -       onSelect: onAutocompleteSelect,
  261. -       deferRequestBy: 0, //miliseconds
  262. -     };
  263. -  
  264. -     a2 = $('#query').autocomplete({
  265. -       matchContains: true,
  266. -       width: 300,
  267. -       delimiter: /(,|;)\s*/,
  268. -       lookup: list.split(',')
  269. -     });
  270. -  
  271. -     $('#navigation a').each(function() {
  272. -       $(this).click(function(e) {
  273. -         var element = $(this).attr('href');
  274. -         $('html').animate({ scrollTop: $(element).offset().top }, 300, null, function() { document.location = element; });
  275. -         e.preventDefault();
  276. -       });
  277. -     });
  278. -  
  279. -   });
  280. - <!-- MOD : Auto-translate Vana'diel (v0.1.0) - END -->
  281. -
  282.     var form_name = 'postform';
  283.     var text_name = <!-- IF $SIG_EDIT -->'signature'<!-- ELSE -->'message'<!-- ENDIF -->;
  284.     var load_draft = false;
  285. --- 1,6 ----
  286. ***************
  287. *** 101,135 ****
  288.   <script type="text/javascript" src="{T_TEMPLATE_PATH}/editor.js"></script>
  289.  
  290.   <!-- IF S_BBCODE_ALLOWED -->
  291. - <!-- MOD : Auto-translate Vana'diel (v0.1.0) - START -->
  292. - <div id="translate_box" style="display: none;">
  293. -         <dl style="clear: left;">
  294. -                 <dt><label>Translate:</label></dt>
  295. -                 <dd>
  296. -                       <script type="text/javascript">
  297. -                 // <![CDATA[
  298. -                         function toggle_translate_box()
  299. -                         {
  300. -                                 dE('translate_box');
  301. -                                 e = document.getElementById('translate_box');
  302. -                                 if (e.style.display == 'block')
  303. -                                 {
  304. -                                         document.getElementById('translate_button').value = 'Hide translate box';
  305. -                                 }
  306. -                                 else
  307. -                                 {
  308. -                                         document.getElementById('translate_button').value = 'Translate';
  309. -                                 }
  310. -           }
  311. -                 // ]]>
  312. -                 </script>
  313. -
  314. -         <input type="text" name="q" id="query" class="textbox" /> <input name="TransPost" type="button" value="OK" onClick="translatestyle('blah');" />
  315. -                 </dd>
  316. -         </dl>
  317. - </div>
  318. - <!-- MOD : Auto-translate Vana'diel (v0.1.0) - END -->
  319. -
  320.   <div id="colour_palette" style="display: none;">
  321.     <dl style="clear: left;">
  322.         <dt><label>{L_FONT_COLOR}:</label></dt>
  323. --- 41,46 ----
  324. ***************
  325. *** 190,198 ****
  326.         <!-- ENDIF -->
  327.     </select>
  328.     <input type="button" class="button2" name="bbpalette" id="bbpalette" value="{L_FONT_COLOR}" onclick="change_palette();" title="{L_BBCODE_S_HELP}" />
  329. -         <!-- MOD : Auto-translate Vana'diel (v0.1.0) - START -->
  330. -         <input type="button" class="button2" name="translate_button" id="translate_button" value="Translate" onclick="toggle_translate_box();" title="Auto Translate: [translate=en]All right![/translate]">
  331. -         <!-- MOD : Auto-translate Vana'diel (v0.1.0) - END -->
  332.     <!-- BEGIN custom_tags -->
  333.         <input type="button" class="button2" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" title="{custom_tags.BBCODE_HELPLINE}" />
  334.     <!-- END custom_tags -->
  335. --- 101,106 ----
  336. diff -c -r -b ff14/styles/prosilver/template/viewtopic_body.html phpbb_stock_ff14/styles/prosilver/template/viewtopic_body.html
  337. *** ff14/styles/prosilver/template/viewtopic_body.html  2011-02-16 09:17:55.000000000 -0500
  338. --- phpbb_stock_ff14/styles/prosilver/template/viewtopic_body.html  2009-11-16 12:10:33.000000000 -0500
  339. ***************
  340. *** 183,191 ****
  341.         <dd>&nbsp;</dd>
  342.  
  343.         <!-- IF postrow.POSTER_POSTS != '' --><dd><strong>{L_POSTS}:</strong> {postrow.POSTER_POSTS}</dd><!-- ENDIF -->
  344. -       <!-- MOD : Auto-translate Vana'diel (v0.1.0) - START -->
  345. -       <dd><strong>Language:</strong> {postrow.POSTER_LANG}</dd>
  346. -       <!-- MOD : Auto-translate Vana'diel (v0.1.0) - END -->
  347.         <!-- IF postrow.POSTER_JOINED --><dd><strong>{L_JOINED}:</strong> {postrow.POSTER_JOINED}</dd><!-- ENDIF -->
  348.         <!-- IF postrow.POSTER_FROM --><dd><strong>{L_LOCATION}:</strong> {postrow.POSTER_FROM}</dd><!-- ENDIF -->
  349.  
  350. --- 183,188 ----
  351. diff -c -r -b ff14/styles/prosilver/theme/forms.css phpbb_stock_ff14/styles/prosilver/theme/forms.css
  352. *** ff14/styles/prosilver/theme/forms.css   2011-02-16 09:23:38.000000000 -0500
  353. --- phpbb_stock_ff14/styles/prosilver/theme/forms.css   2009-11-16 12:10:33.000000000 -0500
  354. ***************
  355. *** 382,392 ****
  356.   .narrow { width: 25%;}
  357.   .tiny { width: 10%;}
  358.  
  359. - /* MOD : Auto-translate Vana'diel (v0.1.0) - START */
  360. - .autocomplete-w1 { background:url(img/shadow.png) no-repeat bottom right; position:absolute; top:0px; left:0px; margin:6px 0 0 6px; /* IE6 fix: */ _background:none; _margin:1px 0 0 0; }
  361. - .autocomplete { border:1px solid #999; background:#FFF; cursor:default; text-align:left; max-height:350px; overflow:auto; margin:-6px 6px 6px -6px; /* IE6 specific: */ _height:350px;  _margin:0; _overflow-x:hidden; }
  362. - .autocomplete .selected { background:#F0F0F0; }
  363. - .autocomplete div { padding:2px 5px; white-space:nowrap; overflow:hidden; }
  364. - .autocomplete strong { font-weight:normal; color:#3399FF; }
  365. - /* MOD : Auto-translate Vana'diel (v0.1.0) - END */
  366. -
  367. --- 382,384 ----
  368. diff -c -r -b ff14/viewforum.php phpbb_stock_ff14/viewforum.php
  369. *** ff14/viewforum.php  2011-02-16 09:24:39.000000000 -0500
  370. --- phpbb_stock_ff14/viewforum.php  2009-11-16 12:10:35.000000000 -0500
  371. ***************
  372. *** 639,648 ****
  373.             'PAGINATION'        => topic_generate_pagination($replies, $view_topic_url),
  374.             'REPLIES'           => $replies,
  375.             'VIEWS'             => $row['topic_views'],
  376. !           // MOD : Auto-translate Vana'diel (v0.1.0) - START
  377. !           //'TOPIC_TITLE'     => censor_text($row['topic_title']),
  378. !           'TOPIC_TITLE'       => translate_text($row['topic_title']),
  379. !           // MOD : Auto-translate Vana'diel (v0.1.0) - END
  380.             'TOPIC_TYPE'        => $topic_type,
  381.  
  382.             'TOPIC_FOLDER_IMG'      => $user->img($folder_img, $folder_alt),
  383. --- 639,645 ----
  384.             'PAGINATION'        => topic_generate_pagination($replies, $view_topic_url),
  385.             'REPLIES'           => $replies,
  386.             'VIEWS'             => $row['topic_views'],
  387. !           'TOPIC_TITLE'       => censor_text($row['topic_title']),
  388.             'TOPIC_TYPE'        => $topic_type,
  389.  
  390.             'TOPIC_FOLDER_IMG'      => $user->img($folder_img, $folder_alt),
  391. diff -c -r -b ff14/viewtopic.php phpbb_stock_ff14/viewtopic.php
  392. *** ff14/viewtopic.php  2011-02-16 09:29:08.000000000 -0500
  393. --- phpbb_stock_ff14/viewtopic.php  2009-11-16 12:10:34.000000000 -0500
  394. ***************
  395. *** 578,589 ****
  396.   // Replace naughty words in title
  397.   $topic_data['topic_title'] = censor_text($topic_data['topic_title']);
  398.  
  399. - // MOD : Auto-translate Vana'diel (v0.1.0) - START
  400. - $topic_notranslate = $topic_data['topic_title'];
  401. - //This also replaces/breaks Quick Reply subject textbox?
  402. - $topic_data['topic_title'] = translate_text($topic_data['topic_title']);
  403. - // MOD : Auto-translate Vana'diel (v0.1.0) - END
  404. -
  405.   // Send vars to template
  406.   $template->assign_vars(array(
  407.     'FORUM_ID'      => $forum_id,
  408. --- 578,583 ----
  409. ***************
  410. *** 1112,1120 ****
  411.                 'from'          => (!empty($row['user_from'])) ? $row['user_from'] : '',
  412.  
  413.                 'sig'                   => $user_sig,
  414. -               // MOD : Auto-translate Vana'diel (v0.1.0) - START
  415. -               'user_lang'     =>   $row['user_lang'],
  416. -               // MOD : Auto-translate Vana'diel (v0.1.0) - END
  417.                 'sig_bbcode_uid'        => (!empty($row['user_sig_bbcode_uid'])) ? $row['user_sig_bbcode_uid'] : '',
  418.                 'sig_bbcode_bitfield'   => (!empty($row['user_sig_bbcode_bitfield'])) ? $row['user_sig_bbcode_bitfield'] : '',
  419.  
  420. --- 1106,1111 ----
  421. ***************
  422. *** 1355,1365 ****
  423.     // Parse the message and subject
  424.     $message = censor_text($row['post_text']);
  425.  
  426. -   // MOD : Auto-translate Vana'diel (v0.1.0) - START
  427. -   $message = translate_text($row['post_text']);
  428. -   // MOD : Auto-translate Vana'diel (v0.1.0) - END
  429. -
  430. -
  431.     // Second parse bbcode here
  432.     if ($row['bbcode_bitfield'])
  433.     {
  434. --- 1346,1351 ----
  435. ***************
  436. *** 1377,1386 ****
  437.     // Replace naughty words such as farty pants
  438.     $row['post_subject'] = censor_text($row['post_subject']);
  439.  
  440. -   // MOD : Auto-translate Vana'diel (v0.1.0) - START
  441. -         $row['post_subject'] = translate_text($row['post_subject']);
  442. -         // MOD : Auto-translate Vana'diel (v0.1.0) - END
  443. -
  444.     // Highlight active words (primarily for search)
  445.     if ($highlight_match)
  446.     {
  447. --- 1363,1368 ----
  448. ***************
  449. *** 1510,1518 ****
  450.         'RANK_IMG'          => $user_cache[$poster_id]['rank_image'],
  451.         'RANK_IMG_SRC'      => $user_cache[$poster_id]['rank_image_src'],
  452.         'POSTER_JOINED'     => $user_cache[$poster_id]['joined'],
  453. -       // MOD : Auto-translate Vana'diel (v0.1.0) - START
  454. -       'POSTER_LANG'       => $user_cache[$poster_id]['user_lang'],
  455. -       // MOD : Auto-translate Vana'diel (v0.1.0) - END
  456.         'POSTER_POSTS'      => $user_cache[$poster_id]['posts'],
  457.         'POSTER_FROM'       => $user_cache[$poster_id]['from'],
  458.         'POSTER_AVATAR'     => $user_cache[$poster_id]['avatar'],
  459. --- 1492,1497 ----
  460. ***************
  461. *** 1732,1745 ****
  462.             'S_QUICK_REPLY'         => true,
  463.             'U_QR_ACTION'           => append_sid("{$phpbb_root_path}posting.$phpEx", "mode=reply&amp;f=$forum_id&amp;t=$topic_id"),
  464.             'QR_HIDDEN_FIELDS'      => build_hidden_fields($qr_hidden_fields),
  465. !           // MOD : Auto-translate Vana'diel (v0.1.0) - START
  466. !           //'SUBJECT'             => 'Re: ' . censor_text($topic_data['topic_title']),
  467. !           'SUBJECT'           => 'Re: ' . $topic_notranslate,
  468. !           // MOD : Auto-translate Vana'diel (v0.1.0) - END
  469.         ));
  470.     }
  471.   }
  472. -
  473.   // now I have the urge to wash my hands :(
  474.  
  475.  
  476. --- 1711,1720 ----
  477.             'S_QUICK_REPLY'         => true,
  478.             'U_QR_ACTION'           => append_sid("{$phpbb_root_path}posting.$phpEx", "mode=reply&amp;f=$forum_id&amp;t=$topic_id"),
  479.             'QR_HIDDEN_FIELDS'      => build_hidden_fields($qr_hidden_fields),
  480. !           'SUBJECT'               => 'Re: ' . censor_text($topic_data['topic_title']),
  481.         ));
  482.     }
  483.   }
  484.   // now I have the urge to wash my hands :(
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement