1
DavidChiou
Re: New Dokuwiki for Xoops release
  • 2008/12/8 5:26

  • DavidChiou

  • Just popping in

  • Posts: 8

  • Since: 2007/12/21


> You can just write a program to rename those files and things will work again.

Here's a very simple Perl program on UNIX that does the trick. It's not at all well written so it's just for your reference. It will not work unless you make necessary modification (following the CHANGEME keyword.) Run it in every directory with the problem, especially the pages, and attic directories. Also, remember to backup everything before doing so.

#!/usr/local/bin/perl

# CHANGEME
$SEPCHAR="_";

@files=glob("*");

foreach $file (@files){
# decode the file name to original text.
$name=urldecode($file);
$newname=convertname($name);
if($name ne $newname){
handlechange($name, $newname);
}

}


########################
sub urldecode {
my $theURL = $_[0];
$theURL =~ tr/+/ /;
$theURL =~ s/%([a-fA-F0-9]{2,2})/chr(hex($1))/eg;
$theURL =~ s/<!??.|\n)*??//g;
return $theURL;
}
########################
sub urlencode {
my $theURL = $_[0];
$theURL =~ s/([\W])/"%" . uc(sprintf("%2.2x",ord($1)))/eg;
return $theURL;
}
########################
sub convertname{
my $name=$_[0];

# CHANGEME
# Make sure the following covers all your cases of separate characters.
$name=~s/?/$SEPCHAR/g;
$name=~s/?/$SEPCHAR/g;
$name=~s/?/$SEPCHAR/g;
$name=~s/?/$SEPCHAR/g;
$name=~s/?/$SEPCHAR/g;
$name=~s/?/$SEPCHAR/g;
$name=~s/?/$SEPCHAR/g;

return $name;
}
########################
sub handlechange{
my $name=$_[0];
my $newname=$_[1];

my $displayname=$name;
my $displaynewname=$newname;

my $namefile;
my $newnamefile;

# CHANGEME
# display in big5 encoding
$displayname=`echo "$name" |iconv -f utf-8 -t big5`;
chomp($displayname);
# $displayname=$name; // use this one if your display encoding is same as file content.
$displaynewname=`echo "$newname" |iconv -f utf-8 -t big5`;
chomp($displaynewname);
# $displaynewname=$newname; // use this one if your display encoding is same as file content.

$name=~m/(^.*?)\.(.*$)/;
$namefile=urlencode($1).".".$2;
$newname=~m/(^.*?)\.(.*$)/;
$newnamefile=urlencode($1).".".$2;

print "Rename $displayname to $displaynewname? (y/n) y is default.\n";
$input=<STDIN>;
chomp($input);
if($input ne 'n' && $input ne 'N'){
if(-e $newnamefile){
print "!! $displaynewname already exists! !!\n";
#unlink($newnamefile);
}else{
if(rename($namefile,$newnamefile)){
print "Done.\n";
}else{
print "!! Error renaming file. !!\n";
}
}
}

}
########################



2
DavidChiou
Re: New Dokuwiki for Xoops release
  • 2008/12/8 5:19

  • DavidChiou

  • Just popping in

  • Posts: 8

  • Since: 2007/12/21


Thank you so much jayjay! We are so lucky to have you build the new version! It solves one of the biggest problem of using dokuwiki on XOOPS for asian users. For example, Chinese characters now can be searched correctly with double quotes "".

I have two issues of upgrading the dokuwiki from an older version to the new version directly with old data. They are not dokuwiki's fault. Just in case some other people encounter the issues, here's how to solve them:

1. For big wiki pages (e.g. > 100K in one page), the newly included "linebreak" plugin slows the performance significantly. If your computer is slow, it takes 30~60 seconds to load a page larger than 100K, consuming 100% of CPU during the period. Therefore, if you suddenly encounter significant performance issue, just uninstall the plugin and you'll be fine. (I suspect the xbr plugin might have better performance as a replacement but I haven't tried.)

2. The new version of dokuwiki correctly identifies separators in Chinese and replaces them with SEPCHAR (e.g. '_'). However, the old version didn't. As a result, based on the old data, all wiki entries with a separator in the title are now missing when read by the new dokuwiki. You can just write a program to rename those files and things will work again.

Good luck!



3
DavidChiou
Re: Left menu doesn't display
  • 2008/10/11 0:55

  • DavidChiou

  • Just popping in

  • Posts: 8

  • Since: 2007/12/21


Check the group configuration (modules/system/admin.php?fct=groups), see if registered users have access to the module which is shown on the left column. It is most likely that somehow you granted the privilege to guest while not registered user.

Otherwise, it's strange... Are the theme.html exactly the same? Among the different configuration you compared, only "magic_quotes_gpc" might have marginal effect on the program (while it shouldn't disable the left column). You may try to turn it on in the php.ini and see if there's any difference.



4
DavidChiou
in case you have problem using xconv
  • 2007/12/27 9:40

  • DavidChiou

  • Just popping in

  • Posts: 8

  • Since: 2007/12/21


xconv is replacement for iconv. In case after you use xconv, you always get a blank page, try do this:

For xconv v1.63:

line 44 of class/xconv.php:
if(!($this->getConvFunc())) $this = false;
change it to
if(!($this->getConvFunc())) unset($this);

The old version may result in the following error for some PHP:
Fatal error: Cannot re-assign $this in /XOOPS_ROOT/modules/xconv/class/xconv.php on line 44



5
DavidChiou
Re: always logged in?
  • 2007/12/23 8:04

  • DavidChiou

  • Just popping in

  • Posts: 8

  • Since: 2007/12/21


I have some dummy questions. Please kindly advise:

> the standard Remember Me function in XOOPS using custom
> PHP sessions (configurable in XOOPS, but requires PHP 4.2.x+).
> In SysAdmin | Prefs | General, turn on custom sessions and set
> a long time (10080 is one week, 43200 is 30 days, etc.).

Does this mean that the session will be kept alive on the server for a long time. If I set it to 3 years, will it likely cause any trouble for the server loading in the future? or basically just cost some disk space?

> Then it's up to the user if they want to use the Remember Me
> function (make sure it's not commented out in the login block
> and/or the user.php page).

Just for confirmation: in 2.0.17.1, is it related to the following option in user.php: "Store my user name in a cookie for 1 year" at all? Or basically the user.php feature is not working anyway?

I cannot find any other "Remember Me" option in login block and/or user.php page in 2.0.17.1 though.

Thank you for your advice.




TopTop



Login

Who's Online

58 user(s) are online (27 user(s) are browsing Support Forums)


Members: 0


Guests: 58


more...

Donat-O-Meter

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

Latest GitHub Commits