292421
hsalazar
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/7/20 0:06

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


Daigoro:

The postscript meant if you don't change also header.php in the pagetitle part, the whole string appears in the title of the page, on top of the browser.

As to extending the hack to serve other modules, I'm not sure. I'm in fact using somebody else's hacks and just extended what I needed. But whatever I do, I'll share here gladly.



292422
Daigoro
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/7/19 23:59

  • Daigoro

  • Quite a regular

  • Posts: 223

  • Since: 2003/7/3 2



Hsalazar,
I've successfully completed the changes you describe in your last two posts. I've not found any side-effects. Good work!

I don't understand your PS in the last post. Please elaborate.

I'm not much of an php-shark so I'm unable to make similar changes to various modules. Do you plan to "extend your service" to also make hacks for the available 2.0 modules?
(Polls and tinyevent comes to mind.) (^_^)

Best regards!



292423
Dziurlaj
encrypted passwords
  • 2003/7/19 19:47

  • Dziurlaj

  • Just popping in

  • Posts: 1

  • Since: 2003/7/2 2


I am trying to link together a mail application (UBmail) with Xoops. The only problem I’m having is that $xoopsUser->getVar('pass'); returns the encrypted MD5 password, which to my knowledge cannot be decrypted. My question is then, is it possible to create two variables, one encrypted for XOOPS internal usuage, and one unencrypted so the Mail program will be able to automatically get the information? If this would pose security concerns, information on that would be helpful too. Thanks!

John Dziurlaj



292424
hsalazar
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/7/19 19:08

  • hsalazar

  • Just popping in

  • Posts: 78

  • Since: 2003/2/6 1


Chad, All:

I've successfully hacked my way to translation of menu items. All I had to do was to modify, within the file modules/system/blocks/system_blocks.php the function b_system_main_show().

Three changes:

1) Added instantiation of text sanitizer

2) Where it says
Quote:

$modules[$i]->getVar('name')

I put
Quote:

$myts->makeTboxData4Show($modules[$i]->getVar('name'))

And where it says:
Quote:

$sublink['name']

I put
Quote:

$myts->makeTboxData4Show($sublink['name'])

So far, so good. Please try the hack and let me know if it works. Cheers.

PS: Also had to repeat the procedure in the file header.php to pass through the decoder the variable xoops_pagetitle.



292425
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?



292426
Chado
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/7/19 17:25

  • Chado

  • Not too shy to talk

  • Posts: 113

  • Since: 2003/6/6 7


Making Multi-lingual Menu items
Quote:
hsalazar wrote: Bang! It worked!...Still missing: a way to change titles in blocks,... and a way to change tags in the main menu.

Hsalazar, Glad to hear that the hacks are working out! Your site is looking great!

I have a couple ideas for how to make custom multi-lingual menus that I am experimenting with on my site. Right now these deal with the menu items only and not the menu title. Maybe one of them will help you with your site there.

Idea #1: Make a custom PHP block and put the following code in and obviously change it to fit your language and links.
Quote:
global $xoopsConfig;
$arr[key] = value;
//put as many Japanese links here as needed
if ($xoopsConfig['language'] == "japanese") {
$Mylink["ホーム"] = "{X_SITEURL}modules/wfsection/article.php?articleid=8";
$Mylink["CLCFamilyについて"] = "{X_SITEURL}";
$Mylink["セレブレーションサンデー!!"] = "{X_SITEURL}modules/wfsection/article.php?articleid=5";
$Mylink["ハウス チャーチ"] = "{X_SITEURL}";
$Mylink["聖書の英会話"] = "{X_SITEURL}";
$Mylink["FAQ"] = "{X_SITEURL}modules/xoopsfaq/";
$Mylink["FORUM"] = "{X_SITEURL}modules/newbb/";
//put English links here
} else {
$Mylink["Home"] = "{X_SITEURL}modules/wfsection/article.php?articleid=8";
$Mylink["About Us"] = "{X_SITEURL}";
$Mylink["Celebration Sunday!"] = "{X_SITEURL}modules/wfsection/article.php?articleid=5";
$Mylink["House Churches"] = "{X_SITEURL}";
$Mylink["English Bible Classes"] = "{X_SITEURL}";
$Mylink["FAQ"] = "{X_SITEURL}modules/xoopsfaq/";
$Mylink["Forum"] = "{X_SITEURL}modules/newbb/";
}
//build table based on links
echo "<div class='blockContent'><table cellspacing=0>";
foreach ($Mylink as $Show => $Link) {
echo "<tr><td id='mainmenu'>
<a class='menuMain' href=$Link>$Show</a></td></tr>";
}
echo "</table></div>";


I don’t think too many of you will have the same Menu items as me! My site, clcfamily.net, for a church in Osaka, Japan is very much under contruction and there isn't too much content up, except the FAQ, but it would give you an idea of how all these multi-lingual hacks are working.

Using that idea you can make as many menus or other types of pages that you need…

Idea #2: Using the recently released iMenu 2 – in blocks/imenu.php file change line 30 to this:
Quote:
$out='<a class="menuMain" target="'.$fc_item['target'].'" href="'.$fc_item['link'].'">· '.$myts->makeTboxData4Show($fc_item['title']).'</a>';

That will force the menu titles to go through to XOOPS decoder.

I hope that helps!
Chad
clcfamily.net



292427
gstarrett
"Best" place to put custom theme functions?
  • 2003/7/19 7:28

  • gstarrett

  • Friend of XOOPS

  • Posts: 174

  • Since: 2002/3/12


Where is the recommended place to put theme-related functions in a XOOPS theme? Is there a themedir/function.php that would be included to handle defines of theme-specific functions?

Specifically, I am converting my current site into a XOOPS2 smarty theme. I'm making good progress, but I have the theater's time in the headerbar area (just below where the banner typically goes if you look at the link). I'm not sure where to put that.

Also, there are likely some other things that, if I do a straight transition, would need custom functions like the user agent info and the navigation section (top left--it's extremely basic on the site now but with more advanced navigation I could see more levels of path appearing).

Thoughts? I'm hoping I don't need to hack XOOPS core because I'm trying to keep my hacks seperate from my theme.

Thanks!



292428
GPrix2K
Re: WYSIWYG other options?
  • 2003/7/18 23:31

  • GPrix2K

  • Just popping in

  • Posts: 1

  • Since: 2003/7/18


Has anyone installed HTMLarea on Xoops? Have you had success with this?



292429
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!



292430
mvandam
Re: SOLVED - Making Xoops CONTENT Multilingual *Fixed Code Quote problem*
  • 2003/7/18 20:56

  • mvandam

  • Quite a regular

  • Posts: 253

  • Since: 2003/2/7 2


Ah, yes good point dawilby... In many places, the title is truncated, just in case someone puts in a really long title (i.e. so they don't mess up your page layout). This trucation happens to the original full string... it is not until afterwards that the language hack occurs. Thus for the english one, the truncated title is "[spanish]...[/spanish][engl"... and then after the language hack, the 'spanish' part is stripped out, leaving only [engl...

Maybe this indicates a bug... need to look into it







Login

Who's Online

228 user(s) are online (151 user(s) are browsing Support Forums)


Members: 0


Guests: 228


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