PEAK XOOPS - Re: backend.php & EMLH in englishin japanese

Re: backend.php & EMLH

List posts in the topic

question Re: backend.php & EMLH

msg# 1.1
depth:
1
Previous post - Next post | Parent - Children.1 | Posted on 2005/4/10 18:52
domifara  一等兵   Posts: 19
Quote:
FutureSpy wrote:
Due to the caching on backend.php, unless I comment the lines for caching on it, it won't switch the language for RSS feeds.
If you want to fix the language to English.
and if language tag is [en].

I think that it only has to specify it directly.

backend.php line 33
include 'mainfile.php';
to
include 'mainfile.php';
$easiestml_lang = 'en';


Quote:
FutureSpy wrote:
I'm just wondering if not having it cached would mean any significant load increase or it's just okay to leave it like that?
I think that you should be.

http://XOOPS_URL/xo/backend.php --> $easiestml_langs[0]

other to ok
http://XOOPS_URL/xo/backend.php?easiestml_lang=en
http://XOOPS_URL/xo/backend.php?easiestml_lang=ja

HACK for EMLH
<?php
// $Id: backend.php,v 1.12 2003/09/26 07:14:00 okazu Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    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 //
//  ------------------------------------------------------------------------ //

include 'mainfile.php';
//HACK for each lang cache hack by domifara 2005/4/10 
if (!isset( $_GET['easiestml_lang'] ) || empty( $_GET['easiestml_lang'] )){
	$easiestml_lang = $easiestml_langs[0];
}
//HACK for no error message ,error_reporting off hack by domifara 2005/4/10 
$_rss_old_error_level = error_reporting(0) ;
include_once XOOPS_ROOT_PATH.'/class/template.php';
include_once XOOPS_ROOT_PATH.'/modules/news/class/class.newsstory.php';
if (function_exists('mb_http_output')) {
	mb_http_output('pass');
}
header ('Content-Type:text/xml; charset=utf-8');
$tpl = new XoopsTpl();
$tpl->xoops_setCaching(2);
$tpl->xoops_setCacheTime(3600);
//HACK for each lang cache hack by domifara 2005/4/10 
//if (!$tpl->is_cached('db:system_rss.html')) {
$xoopsCachedTemplateId = 'backend_'.'|'.md5( __FILE__ . $easiestml_lang);
if (!$tpl->is_cached('db:system_rss.html' , $xoopsCachedTemplateId)) {
	$sarray = NewsStory::getAllPublished(10, 0);
	if (is_array($sarray)) {
		$tpl->assign('channel_title', xoops_utf8_encode(htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES)));
		$tpl->assign('channel_link', XOOPS_URL.'/');
		$tpl->assign('channel_desc', xoops_utf8_encode(htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
		$tpl->assign('channel_lastbuild', formatTimestamp(time(), 'rss'));
		$tpl->assign('channel_webmaster', $xoopsConfig['adminmail']);
		$tpl->assign('channel_editor', $xoopsConfig['adminmail']);
		$tpl->assign('channel_category', 'News');
		$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) {
			$tpl->append('items', array('title' => xoops_utf8_encode(htmlspecialchars($story->title(), ENT_QUOTES)), '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' => xoops_utf8_encode(htmlspecialchars($story->hometext(), ENT_QUOTES))));
		}
	}
}
//HACK by domifara
//$tpl->display('db:system_rss.html');
$tpl->display('db:system_rss.html' , $xoopsCachedTemplateId);
// error_reporting off hack by domifara 2004/4/8 
error_reporting($_rss_old_error_level) ;
?>
Votes:3 Average:3.33

Posts tree

  Advanced search


Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!