321
hsalazar
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/7/19 18:24

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


Chad, all:

I've successfully hacked the blocks titles using Chad's idea # 2. This is what I did, in case somebody points it as a mistake:

I opened the file header.php and in the final part, after line 170, there's a switch statement with five cases.

For every case, I included a line to instantiate the sanitizer, like this:
Quote:
$myts =& MyTextSanitizer::getInstance();


Then, for every instance of the string:
Quote:
'title' => $block_arr[$i]->getVar('title')

I wrapped around the call to the sanitizer, to make the variable pass through the decoder, so I changed the string to this:
Quote:
'title' => $myts->makeTboxData4Show($block_arr[$i]->getVar('title'))

Please take a look at this and tell me if it works for you.

In my case, I had to repeat the wrapping for the incblocks module, because in the inside of the box, the titles of the individual blocks weren't making the translation, but all I had to do was change a bit the file triblocks.php. Lines 59-61 used to read:
Quote:

$block['contenu'][]=$bcontent;
$block['titre'][]=$block_arr[$i]->getVar('title');

and I changed them to read:
Quote:

$myts =& MyTextSanitizer::getInstance();
$block['contenu'][]=$bcontent;
$block['titre'][]=$myts->makeTboxData4Show($block_arr[$i]->getVar('title'));

So far, this works fine. Please let me know if you can also change this successfully.

PS: As for the menu items, I understand that by using a custom block, as Chad suggests, I'd lose the functionality of having the submenus displayed for those modules that have suboptions, right?



322
hsalazar
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/7/18 21:13

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


mvandam, dawilby, all:

Thanks for your time and attention. I took the original sanitizer file, applied the hack and reuploaded the new file. Bang! It worked! You can see the results here.
For the moment, I've seen it work for the news, the forums, spotlight, and Tiny Content.
Still missing: a way to change titles in blocks (for the moment I'm using messages in both languages), and a way to change tags in the main menu.
But all in all, I'm very satisfied, and I hope I can build (with the help from everybody) a good site, a useful and "nutritious" site.
Thanks to you all!



323
hsalazar
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/7/17 18:36

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


Hi, all:

Two things. The first one is that after putting the correct code, I still had the message about some problem in the file. So I went and found this line:

return preg_replace(array("/>/i", "/</i", "/"/i", "/'/i"), array(">", "<", "\"", "'"), $text);

I pondered a bit, and then changed it to:

return preg_replace(array("/>/i", "/</i", "/\"/i", "/'/i"), array(">", "<", "\"", "'"), $text);

(notice the extra backslash)

... and I got rid of the error message and indeed the story part of the module worked allright.

The second thing is I tried the additional hacks for the story titles. And here are two issues. The first one is that even though the field in the database is 255 characters long, the form fills much faster, so I need to change the maximum number in the form creator (haven't done it yet).

The second issue is that even with short titles, the display has problems...

For instance. In the title field I write:

[spanish]Ejemplo de noticia[/spanish] [english]Sample news item[/english]

Then I go to my site and use the selector to choose Spanish. The idea is I should get:

Ejemplo de noticia

but instead I get:

Ejemplo de noticia [engli...

When I change to English, I should get:

Sample news item

but instead I get:

[engli...

I don't know if adding the backslash in the function &undoHtmlSpecialChars is affecting my results. What do you think?



LATE NIGHT EDITION: Here's another riddle: how to extend this hack to the main menu tags so that they also change with the language switch...



324
hsalazar
Re: SOLVED - Making Xoops CONTENT Multilingual
  • 2003/7/16 20:22

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


So, perhaps now the logical step would be to ask Chad if he's willing to share the code in a different format, for example a zip file sent by mail...

Chad?



325
hsalazar
Re: SOLVED - Making Xoops CONTENT Multilingual
  • 2003/7/16 17:28

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


Chad:

When I include the hack in module.textsanitizer.php, the admin side gives me this error message:

"Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/mesadepr/public_html/class/module.textsanitizer.php on line 286"

Obviously, as soon as I remove the hack everything works as usual.

Any thoughts on what is causing this?

PS: I noticed also that on line 149 there's this (I've added a space to separate the word "code" from the bracket):

$patterns[] = "/\[ code](.*)\[\/ code\]/esU";

and not this:

$patterns[] = "/[ code](.*)[/ code]/esU";

Perhaps you've used a different version of the file...



326
hsalazar
Re: WF-Sections V1 Released Not valid SQL
  • 2003/6/27 15:47

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


Catzwolf:

Grrrrrrrrrreeeeeeeeeaaaaaaaat job, man!

Slept late last night translating the language files into spanish, and early this morning I cleaned them up. Everything worked like a charm, after doing the name change.

I replaced several strings hardcoded in the files and put them in the language files. If you want, I can send you the whole bunch so that everybody can use it, or so that you can accumulate changes for a patch release as soon as you get some rest.

Anyway, this is a superb job. Congratulations!



327
hsalazar
Re: Item-Specific Page Titles in News, wfsection
  • 2003/6/25 1:54

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


ackbarr:

Thanks a lot! It's just what I was looking for!




328
hsalazar
Re: Item-Specific Page Titles in News, wfsection
  • 2003/6/24 23:14

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


Catzwolf:

The idea is that instead of having in the window title a legend such as:

XOOPS Official Site - News - Microsoft Internet Explorer

no matter what story you're in, to have

XOOPS Official Site - News - Title of the specific note - Microsoft Internet Explorer

This is far more specific and useful.




329
hsalazar
Re: Item-Specific Page Titles in News, wfsection
  • 2003/6/18 15:27

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


BelaS:

I'd also like to be able to include the story headline in the title. So far I haven't figured a way, and the reason is the page title is set in the file theme.html, while the story headline get retrieved until you click on a story link. I guess the logic would be to put an IF statement in the title tags, but I'm not sure it can be done this way... I'll keep trying, and perhaps a wiser fellow can help us...

Happy Xoopsing!



330
hsalazar
Re: how to re enable display of 'system module'
  • 2003/6/10 20:44

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


htitman:

The table would be xoops_modules, of course, and since System is the first module (mid = 1), you'd need to change its isactive setting to 1.




TopTop
« 1 ... 30 31 32 (33) 34 »



Login

Who's Online

211 user(s) are online (149 user(s) are browsing Support Forums)


Members: 0


Guests: 211


more...

Donat-O-Meter

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

Latest GitHub Commits