41
irmtfan
Re: News 1.67 Final released for XOOPS 2.5.5
  • 2012/7/18 4:54

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


As stated in some other topics. the only solution for multi-bytes languages is using tcpdf.

Quote:

I will see to that makepdf also works with Chinese characters


Thank you very much black_beard.
To save you time, please take a look at one of phppp (DJ) modules like newbb 4.3
They all were intended to work only with tcpdf.
see in newbb/class/post.php:
if (file_exists(XOOPS_ROOT_PATH."/Frameworks/tcpdf/tcpdf.php")) {


42
chnwalkman
Re: News 1.67 Final released for XOOPS 2.5.5
  • 2012/7/18 8:50

  • chnwalkman

  • Just popping in

  • Posts: 35

  • Since: 2004/8/25


Thank you all.

For multi-bytes language (my language is Chinese ), after set "Use keywords highlighting" to true, then open the article by the search, the story's content is abnormal. Modified the class/keyhighlighter.class.php like below, it's OK now.

find:
$patterns[] = '/(?' '>' $keyword '+)/si';

replaced with:
$patterns[] = '/(?' '>' preg_quote($keyword) . ')/si';


find:
$patterns[] = '/(?' '>' $this->preg_keywords '+)/si';

replaced with:
$patterns[] = '/(?' '>' preg_quote($this->preg_keywords) . ')/si';


find:
$this->preg_keywords preg_replace ('/[^w ]/si'''$this->keywords);

replaced with:
if ( XOOPS_USE_MULTIBYTES ) { 
        
$this->preg_keywords trim($this->keywords); 
            } else { 
            
$this->preg_keywords preg_replace ('/[^w ]/si'''$this->keywords); 
            }


find:
$buffer xoops_substr($buffer1, -1);

replaced with:
$buffer substr($buffer1, -1);



Another question:
In the news admin home, here is a "News Statistics", and a stats "There are (x) News published in Home" in it, I published some news in home, and this stats is always "There are 0 News published in Home". This is there any problem?

43
black_beard
Re: News 1.67 Final released for XOOPS 2.5.5

Hello,
I adapted the TCPDF class and modify the file makepdf.php

You can download here to try it.

thank you for reporting any bugs by MP, mail or forum

language: arabic, armenian, brazilian, bulgarian, chinese, Croation, czech, danish, english, estonian, Euskara, french, galician, georgian, german, hebrew, hungarian, indonesian, italian, japanese, korean, macedonian, malaysian, maltese, nederlands, norwegian, persian, polish, portuguese, romanian, russian, serbian, slovenian, spanish, swahili, swedish, urdu

44
Mamba
Re: News 1.67 Final released for XOOPS 2.5.5
  • 2012/7/25 17:29

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


That's fantastic! Thank you so much!

The only change I would like to see, is to point to a TCPDF library located in

/xoops/Frameworks/tcpdf

the same way as it is set for the Basic Module Pack

This would be our standard installation, so all modules would use it from one and the same location, instead each module duplicating the TCPDF library.

Once again, thank you so much!!!!

Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

45
black_beard
Re: News 1.67 Final released for XOOPS 2.5.5

ok, I make the changes

46
black_beard
Re: News 1.67 Final released for XOOPS 2.5.5

'TCPDF for Xoops' : download it here

47
chnwalkman
Re: News 1.67 Final released for XOOPS 2.5.5
  • 2012/7/26 8:43

  • chnwalkman

  • Just popping in

  • Posts: 35

  • Since: 2004/8/25


Thank you black_beard.
Quote:

I adapted the TCPDF class and modify the file makepdf.php

You can download here to try it.


I download it and copied to the news module, and updated news module in the admin area, then created pdf. (Because my language's name is schinese, so I copied "/modules/news/tcpdf/config/lang/chinese.php" to "schinese.php".) It still shows abnormal, all Chinese characters are displayed as "?" in it.

48
black_beard
Re: News 1.67 Final released for XOOPS 2.5.5

test to replace line 106 of file makepdf.pdf

$pdf=new TCPDF(PDF_PAGE_ORIENTATIONPDF_UNITPDF_PAGE_FORMATtrue'UTF-8'false);


by

$pdf=new TCPDF(PDF_PAGE_ORIENTATIONPDF_UNITPDF_PAGE_FORMATtrue_CHARSETfalse);


49
irmtfan
Re: News 1.67 Final released for XOOPS 2.5.5
  • 2012/7/27 2:03

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Thank you very much black_beard.
TCPDF is really needed.
I will test your news soon.

50
chnwalkman
Re: News 1.67 Final released for XOOPS 2.5.5
  • 2012/7/27 11:35

  • chnwalkman

  • Just popping in

  • Posts: 35

  • Since: 2004/8/25


Hi, black_beard.

I edited the file, but it's at line 109.
It created pdf is same as above. All Chinese characters are displayed as "?".

Regards.

Login

Who's Online

187 user(s) are online (120 user(s) are browsing Support Forums)


Members: 0


Guests: 187


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits