101
DCrussader
Re: News 1.67 Final released for XOOPS 2.5.5

Quote:

I'll repeat myself. Xoops is written in iso or utf-8. The day will be 100% Xoops utf-8, we can remove some lines of code. Meanwhile, we must ensure coexistence between utf-8 and iso.*/


This days are now:
2.5.6 & 2.6.0 must support only UTF-8. Those thing was planed for 2.4.x, but still is not fully implemented. There is no coexistence between utf-8 and iso, both are not acceptable. There was several reasons in past to hack 2.0.18 and to provide additional patches with every translation made in UTF-8 by me for 2.0 core. ISO is no longer welcome anywhere.

102
irmtfan
Re: News 1.67 Final released for XOOPS 2.5.5
  • 2012/8/11 4:50

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


DCrussader,
the removing of those configs is not related to ISO and UTF-8.
the point is they are not used in the creating pdf files because if you want to use them you should have this command in makepdf.php
$pdf->setLanguageArray($l);

when you dont have the above command the requirement of ./Frameworks/tcpdf/config/lang/*.php is meaningless.

you can safely remove those lines and also lang folder.*/

103
black_beard
Re: News 1.67 Final released for XOOPS 2.5.5

@DCrussader
Quote:

2.5.6 & 2.6.0 must support only UTF-8. Those thing was planed for 2.4.x, but still is not fully implemented. There is no coexistence between utf-8 and iso, both are not acceptable. There was several reasons in past to hack 2.0.18 and to provide additional patches with every translation made in UTF-8 by me for 2.0 core. ISO is no longer welcome anywhere.


100% agree with you.
Xoops 2.5.6 or 2.6 when released; tcpdf_for_xoops will support the UTF-8 only (the version is ready).
Meanwhile, tcpdf_for_xoops handles charsets UTF-8 & ISO

@irmtfan
Thanks irmtfan.
I already try, but this solution is valid for one site 100% UTF-8.
I have character problems with ISO-8859-1.

104
Mamba
Re: News 1.67 Final released for XOOPS 2.5.5
  • 2012/8/11 6:12

  • Mamba

  • Moderator

  • Posts: 11366

  • Since: 2004/4/23


Quote:
100% agree with you.
Xoops 2.5.6 or 2.6 when released; tcpdf_for_xoops will support the UTF-8 only (the version is ready).

Let's make it then happen.

I did create a XOOPS 2.5.6 Alpha that would support PHP 5.4.5, but it needs to be tested by some experts. So far, I didn't hear from anybody.

XOOPS 2.6.0 Alpha 1 will be released soon too.

We need now some UTF-8/ISO experts who could make sure that both versions is fully UTF-8 compliant. Who can take the lead on this?
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

105
black_beard
Re: News 1.67 Final released for XOOPS 2.5.5

I can do tests Xoops 2.5.6 when I get 5 minutes available (next weekend). Possible test on server iso-8859-1, iso-8859-15 and UTF-8.

But PHP version is not too high ?

Debian does not offer a version 5.3.3 in the standard installation for production servers.
Few of the host offers PHP 5.4.5

106
irmtfan
Re: News 1.67 Final released for XOOPS 2.5.5
  • 2012/8/11 7:20

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


I dont have any problem with ISO-8859-1 in english, french and persian
i went to global.php and changed the charset:
define('_CHARSET', 'ISO-8859-1');

then i go to newbb viewtopic and reload the page.

and create a pdf.
see:
http://www.jadoogaran.org/test255/modules/jsj.pdf

contain english, persian and french characters.

Also one below change is good to have topic_title.pdf instead of the default doc.pdf

$pdf->Output($forumtopic->getVar('topic_title'));

Anyway tcpdf itself still have some minor issues with arabic and persian that i can not explain for you easily.
In persian and arabic we have "sticky words" eg: "Ishould" instead of "I should" and tcpdf can not recognize between them.

I should follow from their websites and forums. (IMO there is no way for solving this issue but anyway i will follow there)

Edit:
IMO the size of the pdf file is still a little high. (90Kb for one page)
I still work on it.


107
black_beard
Re: News 1.67 Final released for XOOPS 2.5.5

can you give me the collation of your MySQL database and tables 'prefix_stories' ?

108
irmtfan
Re: News 1.67 Final released for XOOPS 2.5.5
  • 2012/8/11 7:36

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


we talked about page charset not database charset.
we can not do anything about the database charset
Also tcpdf is a user side application.

Anyway, IMO the database charset is not important at all.

In my test website the Collation is utf8_general_ci
but in the running website it is latin1_swedish_ci
i test in both and no problem.

Anyway i still test in newbb, i dont test in news until now.

Edit:
black_beard:
You have issue when you remove these lines?
if (is_file(XOOPS_ROOT_PATH.'/Frameworks/tcpdf/config/lang/'.$xoopsConfig['language'].'.php')) {
    require_once( 
XOOPS_ROOT_PATH.'/Frameworks/tcpdf/config/lang/'.$xoopsConfig['language'].'.php');
} else {
    require_once( 
XOOPS_ROOT_PATH.'/Frameworks/tcpdf/config/lang/english.php');
}

this is not possible because you never use the above configuration files in makepdf.php

you should have below command:
$pdf->setLanguageArray($l);

unless the above lines is not readed.
and i can not find any "setLanguageArray" in the tcpdf for xoops package.

109
black_beard
Re: News 1.67 Final released for XOOPS 2.5.5

anyway, I'm going to need the list to add the option of multi-language (this is also why all the files have been renamed)

110
irmtfan
Re: News 1.67 Final released for XOOPS 2.5.5
  • 2012/8/12 10:06

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Quote:

I'm going to need the list to add the option of multi-language (this is also why all the files have been renamed)

1- we dont need those files for ML too because we have _LANGCODE definition in our hands.
2- I put 2 hours of my precious time and finally could implement great EMLH by GIJ. So you dont need to do more work on this area.( of course it maybe takes 2 minutes for a developer like you)

As for the crappy buggy Xlanguage. I dont know. I just recommend as always:
uninstall it and install EMLH.

You can implement GIJ easiestML hack very easy.

here is the newbb/makepdf.php + RTL + ML
<?php
// $Id: makepdf.php,v 1.1.1.1 2005/10/19 15:58:07 phppp Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
//  Author: phppp (D.J., infomax@gmail.com)                                  //
//  URL: http://xoopsforge.com, https://xoops.org.cn                          //
//  Project: Article Project                                                 //
//  ------------------------------------------------------------------------ //


// a complete rewrite by irmtfan to enhance: 1- RTL 2- Multilanguage
error_reporting(0);
 
include_once 
dirname(__FILE__) . "/header.php";

$cat        = isset($_GET['cat']) ? intval($_GET['cat']) : 0;
$forum         = isset($_GET['forum']) ? intval($_GET['forum']) : 0;
$topic_id     = isset($_GET['topic_id']) ? intval($_GET['topic_id']) : 0;
$post_id     = !empty($_GET['post_id']) ? intval($_GET['post_id']) : 0;
if (!
is_file(XOOPS_ROOT_PATH.'/Frameworks/tcpdf/tcpdf.php')) {
    
redirect_header(XOOPS_URL.'/modules/'.$xoopsModule->getVar('dirname').'/viewtopic.php?topic_id='.$topic_id,3,'TCPF for Xoops not installed');
}
 
if ( empty(
$post_id) )  die(_MD_ERRORTOPIC);

$post_handler xoops_getmodulehandler('post''newbb');
$post $post_handler->get($post_id);
if(!
$approved $post->getVar('approved'))    die(_MD_NORIGHTTOVIEW);

$post_data $post_handler->getPostForPDF($post);
    
$topic_handler xoops_getmodulehandler('topic''newbb');
$forumtopic $topic_handler->getByPost($post_id);
$topic_id $forumtopic->getVar('topic_id');
if(!
$approved $forumtopic->getVar('approved'))    die(_MD_NORIGHTTOVIEW);

$forum_handler xoops_getmodulehandler('forum''newbb');
$forum = ($forum) ? $forum $forumtopic->getVar('forum_id');
$viewtopic_forum $forum_handler->get($forum);
if (!
$forum_handler->getPermission($viewtopic_forum))    die(_MD_NORIGHTTOACCESS);
if (!
$topic_handler->getPermission($viewtopic_forum$forumtopic->getVar('topic_status'), "view"))   die(_MD_NORIGHTTOVIEW);
$category_handler xoops_getmodulehandler('category''newbb');
$cat = ($cat) ? $cat $viewtopic_forum->getVar('cat_id');
$viewtopic_cat $category_handler->get($cat);

$GLOBALS["xoopsOption"]["pdf_cache"] = 0;

$pdf_data['author'] = $myts->undoHtmlSpecialChars($post_data['author']);
$pdf_data['title'] = $myts->undoHtmlSpecialChars($post_data['subject']);
$content '';
$content .= '<b>'.$pdf_data['title'].'</b><br /><br />';
$content .= _MD_AUTHORC.' ' $pdf_data['author'].'<br />';
$content .= _MD_POSTEDON ' ' formatTimestamp($post_data['date']).'<br /><br /><br />';
$content .= $myts->undoHtmlSpecialChars($post_data['text']) . '<br />';
$pdf_data['content'] = str_replace('[pagebreak]','<br />',$content);
$pdf_data['topic_title']=$forumtopic->getVar('topic_title');
$pdf_data['forum_title']=$viewtopic_forum->getVar('forum_name');
$pdf_data['cat_title']=$viewtopic_cat->getVar('cat_title');
$pdf_data['subject']=NEWBB_PDF_SUBJECT.': '.$pdf_data['topic_title'];
$pdf_data['keywords']=XOOPS_URL ', '.'SIMPLE-XOOPS, '.$pdf_data['topic_title'];
$pdf_data['HeadFirstLine']=$xoopsConfig['sitename'].' - '.$xoopsConfig['slogan'];
$pdf_data['HeadSecondLine']=$xoopsModule->getVar('name').' - '.$pdf_data['cat_title'].' - '.$pdf_data['forum_title'].' - '.$pdf_data['topic_title'];

// START irmtfan to implement EMLH by GIJ
if (function_exists('easiestml')) {
    
$pdf_data easiestml($pdf_data);
}
// END irmtfan to implement EMLH by GIJ
    
require_once (XOOPS_ROOT_PATH.'/Frameworks/tcpdf/tcpdf.php');

//create the A4-PDF...
$pdf=new TCPDF(PDF_PAGE_ORIENTATIONPDF_UNITPDF_PAGE_FORMATtrue_CHARSETfalse);
// START irmtfan hack to add RTL-LTR local
// until _RTL added to core 2.6.0
if (!defined('_RTL')) {
    
define('_RTL',false);
}
$pdf->setRTL(_RTL);
// END irmtfan hack to add RTL-LTR local

// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor(PDF_AUTHOR);
$pdf->SetTitle($pdf_data['forum_title'].' - '.$pdf_data['subject']);
$pdf->SetSubject($pdf_data['subject']);
$pdf->SetKeywords($pdf_data['keywords']);

$pdf->SetHeaderData('''5'$pdf_data['HeadFirstLine'], $pdf_data['HeadSecondLine']);

//set margins
$pdf->SetMargins(PDF_MARGIN_LEFTPDF_MARGIN_TOP PDF_MARGIN_RIGHT);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
//set auto page breaks
$pdf->SetAutoPageBreak(true25);

$pdf->setHeaderFont(Array(PDF_FONT_NAME_SUB''PDF_FONT_SIZE_SUB));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA''PDF_FONT_SIZE_DATA));
$pdf->setFooterData($tc=array(0,64,0), $lc=array(0,64,128));

$pdf->Open();
$pdf->AddPage();
$pdf->SetFont(PDF_FONT_NAME_MAIN,PDF_FONT_STYLE_MAINPDF_FONT_SIZE_MAIN);
$pdf->writeHTML($pdf_data['content'], true0);
$pdf->Output($pdf_data['topic_title'].'_'.$post_id.'.pdf');
?>


I still work on the above codes to make it more clean.
One more issue with persian-arabic: tcpdf dont accept them in filename.pdf

Login

Who's Online

230 user(s) are online (122 user(s) are browsing Support Forums)


Members: 0


Guests: 230


more...

Donat-O-Meter

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

Latest GitHub Commits