« 1 ... 6 7 8 (9) 10 11 12 »
panwac panwac
  • Just popping in
  • Just popping in
  • Joined: 2005/11/11 19:01
  • From Poland
  • Group: Registered Users
  • Posts: 62
  • Posted on: 2012/8/1 7:00
Re: News 1.67 Final released for XOOPS 2.5.5 #81
I'm going to do it today (at work, in coffee time).
panwac panwac
  • Just popping in
  • Just popping in
  • Joined: 2005/11/11 19:01
  • From Poland
  • Group: Registered Users
  • Posts: 62
  • Posted on: 2012/8/1 17:21
Re: News 1.67 Final released for XOOPS 2.5.5 #82
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:
<?php
// $Id: backendt.php 9767 2012-07-02 06:02:52Z beckmi $
// ------------------------------------------------------------------------ //
// XOOPS - PHP Content Management System VVV //
// Copyright (c) 2000 XOOPS.org //
// <http://www.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 - 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);
?>
black_beard black_beard
  • Just popping in
  • Just popping in
  • Joined: 2012/6/24 6:58
  • From Castelnau Montratier, LOT
  • Group: Registered Users
  • Posts: 59
  • Posted on: 2012/8/2 12:50
Re: News 1.67 Final released for XOOPS 2.5.5 #83
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
chnwalkman chnwalkman
  • Just popping in
  • Just popping in
  • Joined: 2004/8/24 22:54
  • Group: Registered Users
  • Posts: 35
  • Posted on: 2012/8/7 1:50
Re: News 1.67 Final released for XOOPS 2.5.5 #84
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.
black_beard black_beard
  • Just popping in
  • Just popping in
  • Joined: 2012/6/24 6:58
  • From Castelnau Montratier, LOT
  • Group: Registered Users
  • Posts: 59
  • Posted on: 2012/8/7 2:51
Re: News 1.67 Final released for XOOPS 2.5.5 #85
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
irmtfan irmtfan
  • Module Developer
  • Module Developer
  • Joined: 2003/12/7 15:14
  • From In the middle of nowhere
  • Group: Registered Users Community Coordinator (temporary)
  • Posts: 3419
  • Posted on: 2012/8/7 6:03
Re: News 1.67 Final released for XOOPS 2.5.5 #86
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.

black_beard black_beard
  • Just popping in
  • Just popping in
  • Joined: 2012/6/24 6:58
  • From Castelnau Montratier, LOT
  • Group: Registered Users
  • Posts: 59
  • Posted on: 2012/8/7 6:17
Re: News 1.67 Final released for XOOPS 2.5.5 #87
Thanks irmtfan,

I prepare a manual (french and english version) for creating file makepdf.php, the draft is here
chnwalkman chnwalkman
  • Just popping in
  • Just popping in
  • Joined: 2004/8/24 22:54
  • Group: Registered Users
  • Posts: 35
  • Posted on: 2012/8/7 10:22
Re: News 1.67 Final released for XOOPS 2.5.5 #88
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.
irmtfan irmtfan
  • Module Developer
  • Module Developer
  • Joined: 2003/12/7 15:14
  • From In the middle of nowhere
  • Group: Registered Users Community Coordinator (temporary)
  • Posts: 3419
  • Posted on: 2012/8/8 5:26
Re: News 1.67 Final released for XOOPS 2.5.5 #89
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.
*/
Mamba Mamba
  • Moderator
  • Moderator
  • Joined: 2004/4/23 14:58
  • From Ohio, USA
  • Group: Webmaster Registered Users Designer Group Super Moderator
  • Posts: 10293
  • Posted on: 2012/8/8 6:06
Re: News 1.67 Final released for XOOPS 2.5.5 #90
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
Please support XOOPS & DONATE
Use 2.5.8 | Debug | Requests | Bugs
How to effectively post a question in the Xoops forums? - Read here...
Design by: XOOPS UI/UX Team