101
kalamata
Re: Headlines
  • 2005/4/14 11:09

  • kalamata

  • Not too shy to talk

  • Posts: 121

  • Since: 2005/3/3 1


This is the code for headlinerendere.php (essentially, I only modified the latest bit).

if( ! class_exists( 'XhldRendererLocal' ) ) {
class XhldRendererLocal extends XhldRenderer
{
function XhldRendererLocal( &$headline , $mydirname='xhld0' )
{
parent::XhldRenderer( $headline , $mydirname ) ;
}

function convertFromUtf8(&$value, $key)
{
if( ! is_string( $value ) ) return ;
if( stristr( _CHARSET , 'iso-8859-1' ) ) {
$value = utf8_decode( $value ) ;
} else if( $this->_hl->getVar('headline_encoding') == 'iso-8859-1' && ! $this->_hl->getVar('headline_allowhtml') ) {
$value = htmlentities( utf8_decode( $value ) ) ;
} else {
$value = iconv( "UTF-8" , "WINDOWS-1253" , $value ) ;
}
}

function &convertToUtf8(&$xmlfile)
{
$encoding = $this->_hl->getVar('headline_encoding') ;

// auto detection
if( empty( $encoding ) ) {
$top_of_xml = substr( $xmlfile , 0 , 255 ) ;
preg_match( "/^<\?xml .* encoding=['\"]?([0-9a-z_-]+)/i", $top_of_xml , $regs ) ;
if( empty( $regs ) ) {
$encoding = 'utf-8' ;
} else {
$encoding = strtolower( $regs[1] ) ;
}
$this->_hl->setVar( 'headline_encoding' , $encoding ) ;
$headline_handler =& xoops_getmodulehandler('headline', $this->_mydirname);
$headline_handler->insert($this->_hl);
}

switch( strtolower( $encoding ) ) {
case 'iso-8859-1' :
$xmlfile = utf8_encode( $xmlfile ) ;
break ;
case 'windows-1253' :
$xmlfile = iconv( "WINDOWS-1253" , "UTF-8" , $xmlfile ) ;
break ;
case 'iso-8859-7' :
$xmlfile = iconv( "ISO-8859-7" , "UTF-8" , $xmlfile ) ;
break ;
case 'utf-8' :
default :
break ;
}

return $xmlfile;
}
}
}
?>

Is there anything I obviously did wrong?

Does my site language have to be utf-8?


The headlines have been defined as define('_AM_ENCODINGS','utf-8:UTF-8|iso-8859-1:ISO-8859-1|us-ascii:US-ASCII|windows-1253:WINDOWS-1253|iso-8859-7:ISO-8859-7') ;

Any way I can check whether the variables FOR_XOOPS_LANG_CHECKER and _AM_DBUPDATED are defined?

Thanks,
George



102
kalamata
Re: Headlines
  • 2005/4/13 12:55

  • kalamata

  • Not too shy to talk

  • Posts: 121

  • Since: 2005/3/3 1


Hi,

Is the language/english folder for the xhld module? I could only find a headlinerenderer_sample.php class there but a headlinerenderer.php was under the class directory of the module. Is that the one I am supposed to change?

Thanks,
George



103
kalamata
Documentation on Modules
  • 2005/3/30 15:58

  • kalamata

  • Not too shy to talk

  • Posts: 121

  • Since: 2005/3/3 1


Dear All,

I am trying to get hold of any documentation regarding modules and I show on the documentation site that there are two documents (xd-102 and xd-002)that refer to that; however, I haven't managed to find a site where I can download them from.

Could somebody help with this?

Thanks,
George



104
kalamata
Re: Headlines
  • 2005/3/27 16:40

  • kalamata

  • Not too shy to talk

  • Posts: 121

  • Since: 2005/3/3 1


I did, but no luck at all. Any suggestions?



105
kalamata
Headlines
  • 2005/3/25 22:55

  • kalamata

  • Not too shy to talk

  • Posts: 121

  • Since: 2005/3/3 1


Dear All,

I am using the XHLD module for generating headlines and I am faced with the following problem: I am pulling headlines from a Greek site using utf-8 encoding, a couple of other Greek sites using Greek (Windows) or Greek (ISO) as their encoding of choice and BBC and CNN using Western European.

When I load up the page, English characters load up fine. However, the others appear as questionmarks. I tried setting the charset to ISO 8859-7 for Greek ISO but that messed up all the headlines (including the Greek ones).

Is there a way of specifying what encoding is to be used for every block so that the user will not have to go through the View->Change Encoding experience?

I look forward to hearing from you soon.

Thanks in advance.

George



106
kalamata
Encoding Issues
  • 2005/3/15 17:42

  • kalamata

  • Not too shy to talk

  • Posts: 121

  • Since: 2005/3/3 1


Dear All,

I am building a portal to be viewed mainly by Greek people and I am using the xhld module to fetch the latest news from a variety of Greek sites.

The problem arises when the page is refreshed and to make the information readable, users have to go through View->Encoding->Greek (Windows). I tried changing the charset value under language/english/global.php to 8859-7 but then I got pages that I could not read even after changing encoding to Greek!!!

Any ideas as to what I should to do to get the pages displaying properly from the very beginning instead of asking the user to manually change the encoding?

Thanks,
George



107
kalamata
How to change the value for charset in XOOPS?
  • 2005/3/13 0:27

  • kalamata

  • Not too shy to talk

  • Posts: 121

  • Since: 2005/3/3 1


I would like to set it to a different value, but I am not sure which file to change.

Thanks.



108
kalamata
XHLD2.51 Support for different charsets
  • 2005/3/12 23:59

  • kalamata

  • Not too shy to talk

  • Posts: 121

  • Since: 2005/3/3 1


Dear All,

I would like to be able to read headlines from other sites using the latest release of the xhld module in encodings other than utf-8, us-ascii, iso; where can I specify the encoding?

Thanks.



109
kalamata
Re: Headlines
  • 2005/3/12 23:58

  • kalamata

  • Not too shy to talk

  • Posts: 121

  • Since: 2005/3/3 1


How would you do that? I searched through the page generated by phpinfo() for fsockopen() with no results!

Thanks,
George



110
kalamata
XHLD2.51 Support for different charsets
  • 2005/3/12 23:53

  • kalamata

  • Not too shy to talk

  • Posts: 121

  • Since: 2005/3/3 1


Dear All,

I would like to be able to read headlines from other sites using the latest release of the xhld module in encodings other than utf-8, us-ascii, iso; where can I specify the encoding?

Thanks.




TopTop
« 1 ... 8 9 10 (11) 12 »



Login

Who's Online

191 user(s) are online (107 user(s) are browsing Support Forums)


Members: 0


Guests: 191


more...

Donat-O-Meter

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

Latest GitHub Commits