Taiwan
|
I think we should all know DIY use.
The DIY title does not support multi-language conversion.
After following modifications can it support multiple languages.
I try to clearly explanation.
General DIY Block: (By Traditional Chinese)
but English:
DIY Block can't conversion.
Hack after: By Traditional Chinese
By English:
For versions: Discuz! ML X2.0, Discuz! ML X2.5
File: /source/function/function_block.php
Line: About 110~120 lines
Find this lines.- function block_display_batch($bid) {
- echo block_fetch_content($bid);
- }
Copy the Code Modify to:- function block_display_batch($bid) {
- //echo block_fetch_content($bid);
- ml_block_display_batch($bid);
- }
- function ml_block_display_batch($bid){
- global $_G;
-
- $code = block_fetch_content($bid);
- preg_match_all('/\{lang\(\'(.*?)\',[\s]?\'(\w+)\'\)\}/simx', $code, $result);
- for ($i = 0; $i < count($result[0]); $i++) {
- $lang=lang($result[1][$i], $result[2][$i]);
- $code = str_replace($result[0][$i], "<!--<".$result[0][$i].">-->".$lang, $code);
- }
- echo $code;
- }
Copy the Code
Use:
ml-code Example:
You can found "blockclass_thread_script_threadnew" in /source/language/*/lang_blockclass.php- {lang('blockclass', 'blockclass_thread_script_threadnew')}
Copy the Code attach forum custom block xml-file:
import in forum DIY.
|
This post contains more resources
You have to Login for download or view attachment(s). No Account? Register
x
|