PEAK XOOPS - News in englishin japanese

Archive | RSS |
  
Poster : GIJOE on 2007-06-08 04:36:37 (9975 reads)

in englishin japanese
minahito has suggested new rule for the language directory.


(language name)_(encoding)   (*) all should be small letters

Of course, this change should be graced for the compatibilities.

eg)
French encoded ISO-8859-* should be named "french" as conventional.
French encoded UTF-8 should be named "fr_utf8" newly.

Though my modules contains "japaneseutf" as "Japanese encoded UTF-8",
they should be renamed "ja_utf8" gradually.

0 comments

Poster : GIJOE on 2007-06-03 06:40:29 (9438 reads)

in englishin japanese
Do you know 'intaller attack'?
If you leave 'install' folder in the public area of the server, attacker can know your DB password, DB prefix etc.
You should know attackers know the folder of 'install' can be renamed '_install' etc.

This is certainly a mistake of the user.
But I find checking a constant '_INSTALL_CHARSET' can protects your xoops from such attacks.

I've just updated the module Protector numbered 3.03 with the feature.

If you dare to use the installer after installing Protector, remove the precheck line from your mainfile.php


Poster : GIJOE on 2007-05-08 03:54:37 (12050 reads)

in englishin japanese
I had written language constants of D3 modules can be override by putting files under XOOPS_ROOT_PATH/modules/(dirname)/langauge/ from XOOPS_TRUST_PATH/modules/(trustdirname)/language/

But I found it is hard to use. (eg. Newly appended constants can be displayed its name instead of its value)

And I think CMS should be change its language constants not only via FTP but also "control panel".

Then, I've just implemented Language constants overriding system into altsys-0.5.

- mylangadmin
A controller called by each module's admin area. (like myblocksadmin or mytplsadmin)
This controller saves user values into DB(altsys_language_constants), then makes a cache file under XOOPS_ROOT_PATH/cache/

- D3LanguageManager
A singleton class for module/core on including language constants.
This class can be used like...


require_once XOOPS_TRUST_PATH.'/libs/altsys/class/D3LanguageManager.class.php' ;
$langman =& D3LanguageManager::getInstance() ;
$langman->read( 'main.php' , $mydirname , $mytrustdirname ) ;


At first, I've just added this feature into pico-1.31.
Let's try this. (Both altsys-0.5 and pico-1.31)

When the module increase its language constants, just update the cache via mylangadmin, again.

Perhaps, this overriding system can be used for almost modules running with XoopsCube Legacy 2.1 just by making a preload. (also, altsys should be modified a little)


Poster : GIJOE on 2007-04-27 05:16:04 (10104 reads)

in englishin japanese
It is quite easy to create a joint for d3pipes.
This is a sample to get renewal announcement from HTML.

With d3pipes, all you have to do is creating a class of parse joint.

Make a class definition file under
XOOPS_TRUST_PATH/modules/d3pipes/joints/parse/

In this document, the class is named as Simplehtml.

ClassName: D3pipesParseSimplehtml
FileName: D3pipesParseSimplehtml.class.php

Just write a method of execute() in the file.
execute() of "Parse" joint gets a string and returns array of entries.

Each entry should have 4 parameters.

'heading' : heading
'pubtime' : UnixTimestamp (Set it if you can)
'link' : URI of the article (Set it if you can)
'fingerprint' : ID of the article

With the sample joint of D3pipesParseSimplehtml, you can make a pipe like this.
(The site describe each renewal annoucement in <h2>)


 0 Fetching from outside  snoopy    (URI of the site)
10 Transfer to UTF-8     (asyoulike)  The encoding of the site
20 Parsing XML           simplehtml  #\<h2\>([^<]*)\</h2\>#iU
30 Transfer from UTF-8   (asyoulike)  Internal encoding of your site
40 Reassign              defaultlink (URI of the site)
50 Clipping into local    moduledb   86400

Read more... | 514 bytes more |0 comments

Poster : GIJOE on 2007-04-23 17:53:02 (11306 reads)

in englishin japanese
Look the flow of (A) with detail.

(A) Outer XML fetch/parse pattern
XML fetching -> convert to UTF8 -> XML parsing -> convert to internal encoding -> extraction -> clipping

1) fetching XML string (fetch)
This must be used with parser.
This joint passes a XML sting to next joint. (without input)

2) converting XML string to UTF-8 (utf8to)
This joint converts from a XML string to a XML string.
This joints is disabled default because almost all RSS are encoded by UTF-8

3) XML parsing into array (parse)
This joint converts from a XML string to some entries can be treated as pipe data.

4) converting entries from UTF-8 to internal encoding (utf8to)
This joint converts from pipe data to pipe data recursively

5) extracting entries (filter)
This joint filters entries.
Input should be pipe data, also output is pipe data.
This joint can be placed after clip, union etc.

6) clipping into local (clip)
This joint stores entries into DB etc.
It is important that clipping_id is assigned for each entries.
Using clipping_id, you can post a comment/mark to an entry.

To distinguish the entry is stored formerly or not, "fingerprint" field is used.
With RSS2, <guid> of <item> should be the fingerprint, though <id> of <entry> should be fingerprint with ATOM.


« 1 ... 8 9 10 (11) 12 13 14 ... 55 »
Login
Username or e-mail:

Password:

Remember Me

Lost Password?

Register now!