81
panwac
Re: News 1.67 Final released for XOOPS 2.5.5
  • 2012/8/1 11:00

  • panwac

  • Just popping in

  • Posts: 62

  • Since: 2005/11/12


I'm going to do it today (at work, in coffee time).

82
panwac
Re: News 1.67 Final released for XOOPS 2.5.5
  • 2012/8/1 21:21

  • panwac

  • Just popping in

  • Posts: 62

  • Since: 2005/11/12


Mamba,
A file was checked. Conclusion: sth is wrong with func. xoops_utf8_encode(); XoopsLocal::convert_encoding() works fine.

Below you've got a code with signs, were is an old code (a red color). You will see, were an old code is enable or not and were a new part was deactivated by me. In this moment a file backendt.php with this code working fine in my website.

Quote:
// $Id: backendt.php 9767 2012-07-02 06:02:52Z beckmi $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System VVV //
// 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 //
// ------------------------------------------------------------------------ //
/**
* RSS per topics
*
* This script is used to generate RSS feeds for each topic.
* You can enable and disable this feature with the module's option named "Enable RSS feeds per topics ?"
* The script uses the permissions to know what to display.
*
* @package News
* @author Xoops Modules Dev Team
* @copyright (c) The Xoops Project - http://www.xoops.org
* @param type $nomvariable description
*/
//include_once 'header.php'; //panwac - code from an old file
include_once '../../mainfile.php';
include_once XOOPS_ROOT_PATH.'/class/template.php';
include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php';
include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newstopic.php';
include_once XOOPS_ROOT_PATH.'/modules/news/include/functions.php';

error_reporting(0);
$GLOBALS['xoopsLogger']->activated = false;

if(!news_getmoduleoption('topicsrss')) {
exit();
}

$topicid = isset($_GET['topicid']) ? intval($_GET['topicid']) : 0;
if($topicid == 0) {
exit();
}

if (function_exists('mb_http_output')) {
mb_http_output('pass');
}

$restricted = news_getmoduleoption('restrictindex');
$newsnumber = news_getmoduleoption('storyhome');

$charset = 'utf-8';

header ('Content-Type:text/xml; charset='.$charset);
$story = new NewsStory();
$tpl = new XoopsTpl();
//$tpl->xoops_setCaching(2); //panwac - code from an old file
$tpl->caching=2; //panwac - code from a new file
$tpl->xoops_setCacheTime(5); // Change this to the value you want
if (!$tpl->is_cached('db:news_rss.html', $topicid)) {
xoops_load('XoopsLocal'); //panwac - code from an old file
$xt = new NewsTopic($topicid);
$sarray = $story->getAllPublished($newsnumber, 0, $restricted, $topicid);
if (is_array($sarray) && count($sarray)>0) {
$sitename = htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES);
$slogan = htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES);
$tpl->assign('channel_title', XoopsLocal::convert_encoding($sitename)); //panwac - code from an old file
//$tpl->assign('channel_title', xoops_utf8_encode($sitename)); //panwac - code from a new file
$tpl->assign('channel_link', XOOPS_URL.'/');
$tpl->assign('channel_desc', XoopsLocal::convert_encoding($slogan)); //panwac - code from an old file
//$tpl->assign('channel_desc', xoops_utf8_encode($slogan)); //panwac - code from a new file
$tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss'));
$tpl->assign('channel_webmaster', checkEmail($xoopsConfig['adminmail'],true)); // Fed up with spam
$tpl->assign('channel_editor', checkEmail($xoopsConfig['adminmail'],true)); // Fed up with spam
$tpl->assign('channel_category', $xt->topic_title());
$tpl->assign('channel_generator', 'XOOPS');
$tpl->assign('channel_language', _LANGCODE);
$tpl->assign('image_url', XOOPS_URL.'/images/logo.gif');
$dimention = getimagesize(XOOPS_ROOT_PATH.'/images/logo.gif');
if (empty($dimention[0])) {
$width = 88;
} else {
$width = ($dimention[0] > 144) ? 144 : $dimention[0];
}
if (empty($dimention[1])) {
$height = 31;
} else {
$height = ($dimention[1] > 400) ? 400 : $dimention[1];
}
$tpl->assign('image_width', $width);
$tpl->assign('image_height', $height);
$count = $sarray;
foreach ($sarray as $story) {
$storytitle = $story->title();
//if we are allowing html, we need to use htmlspecialchars or any bug will break the output
//$description = htmlspecialchars($story->hometext(), ENT_QUOTES); //panwac - code from an old file
$description = htmlspecialchars($story->hometext()); //panwac - code from a new file
$tpl->append('items', array(
'title' => XoopsLocal::convert_encoding(htmlspecialchars($storytitle, ENT_QUOTES)) , //panwac - code from an old file
//'title' => xoops_utf8_encode($storytitle), //panwac - code from a new file
'link' => XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(),
'guid' => XOOPS_URL.'/modules/news/article.php?storyid='.$story->storyid(),
'pubdate' => formatTimestamp($story->published(), 'rss'),
'description' => XoopsLocal::convert_encoding($description))); //panwac - code from an old file
//'description' => xoops_utf8_encode($description))); //panwac - code from a new file
}
}
}
$tpl->display('db:news_rss.html', $topicid);
?>

83
black_beard
Re: News 1.67 Final released for XOOPS 2.5.5

Hello,
a new version 1.03 of tcpdf_for_xoops is available here, I have considered your comments. Here are the changes made ​​to the frameworks:
Quote:

- PHP TCPDF class has been updated (5.9.172 => 5.9.176)
- Exotic font has been deleted
- Creating a separate package for Japanese, Chinese simplified,
Chinese Taiwanese, Korean fonts. You can install them in
the directories ./Frameworks/tcpdf/fonts or ./language/fonts
- Adding the support Ukrainian language (./Frameworks/tcpdf/config/lang/ukrainian.php)
- Adding support Chinese simplified language (./Frameworks/tcpdf/config/lang/schinese.php)
- Adding support Chinese taiwanese language (./Frameworks/tcpdf/config/lang/tchinese.php)
- Adding file : ./Frameworks/tcpdf/docs/changelog.txt
- Adding file : ./Frameworks/tcpdf/docs/README.txt
- Adding makepdf.php for 'newbb' mobule

84
chnwalkman
Re: News 1.67 Final released for XOOPS 2.5.5

Hi, I tested tcpdf_for_xoops 1.03, and downloaded local_font zip.

I found that "local_font.php" must be copied into "/language/local_language/fonts/" to be valid, if copied into "/Frameworks/tcpdf/fonts", then the invalid.

Thank you.

85
black_beard
Re: News 1.67 Final released for XOOPS 2.5.5

hello chnwalkman,

for fix this bug, remplace in ./Frameworks/tcpdf/config/tcpdf_config.php line 35
if (!is_dir(XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/fonts') OR !array_key_exists($xoopsConfig['language'],$tableau_font)) {


with

if (!array_key_exists($xoopsConfig['language'],$tableau_font)) {


I'm updating version

86
irmtfan
Re: News 1.67 Final released for XOOPS 2.5.5
  • 2012/8/7 10:03

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


I test in my test website and it is a miracle that finally i could see the persian words instead of ????
It works great in newbb and news.
Thank you very much black beard.
I will test in my production websites.
I will investigate your changes in makepdf.php files in news and newbb.

Thank you again.


87
black_beard
Re: News 1.67 Final released for XOOPS 2.5.5

Thanks irmtfan,

I prepare a manual (french and english version) for creating file makepdf.php, the draft is here

88
chnwalkman
Re: News 1.67 Final released for XOOPS 2.5.5
  • 2012/8/7 14:22

  • chnwalkman

  • Just popping in

  • Posts: 35

  • Since: 2004/8/25


Quote:

black_beard wrote:

for fix this bug, remplace in ./Frameworks/tcpdf/config/tcpdf_config.php line 35
if (!is_dir(XOOPS_ROOT_PATH.'/language/'.$xoopsConfig['language'].'/fonts') OR !array_key_exists($xoopsConfig['language'],$tableau_font)) {


with

if (!array_key_exists($xoopsConfig['language'],$tableau_font)) {


I'm updating version


That's great now. Thank you, black_beard.

89
irmtfan
Re: News 1.67 Final released for XOOPS 2.5.5
  • 2012/8/8 9:26

  • irmtfan

  • Module Developer

  • Posts: 3419

  • Since: 2003/12/7


Black beard:
I test tcpdf deeply and it is amazing.
Just i wonder that why you add the lang config and dont use it at all?
in newbb/makepdf.php
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');
}


IMO there is no need for this config file in XOOPS.
there are 3 configs there:
eg for persian.php
$l['a_meta_charset'] = 'UTF-8';
$l['a_meta_dir'] = 'rtl';
$l['a_meta_language'] = 'fa';


We already have _CHARSET and _LANGCODE. we just still dont have _RTL definition which is a pity

we can add that _RTL in global.php easy.
define('_RTL'true);


anyway im still wonder why you not use that so in RTL language we should add something like this to newbb/makepdf.php
// Restore RTL direction
global $l;
$pdf->setLanguageArray($l);


But i think it is better to define that _RTL in xoops and then remove Frameworks/tcpdf/config/lang/*.php

so we can sue it like this in our makepdf.php:
// Restore RTL direction
$pdf->setRTL(_RTL);


I like the above method.

So black_beard please choose one of the above methods because you knows better. then we can follow in makepdf.php files.

But as i said i think that _RTL definitions is very nice!

Edit:
Also one thing that i forgot.
It can not read the [en] [/en] and [fa] [/fa] codes.
I mean when the website is english it just should makepdf from english content and vice verse.
*/

90
Mamba
Re: News 1.67 Final released for XOOPS 2.5.5
  • 2012/8/8 10:06

  • Mamba

  • Moderator

  • Posts: 11397

  • Since: 2004/4/23


Quote:
So black_beard please choose one of the above methods because you knows better. then we can follow in makepdf.php files.

It's great to hear that TCPDF works with Farsi, since you guys had some issues in the past with FPDF, if I remember correctly.

Black_beard, whatever you choose, I hope that it will reflect the structure of TCPDF files, i.e. if the next version of TCPDF comes out, we only need to copy the selected files to the /Frameworks/tcpdf directory, and we are done, i.e. we don't have to make any changes to any files, and we don't have to change directories.

Of course, as long as TCPDF people don't make any changes in their folder structure
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

Login

Who's Online

145 user(s) are online (44 user(s) are browsing Support Forums)


Members: 0


Guests: 145


more...

Donat-O-Meter

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

Latest GitHub Commits