Author Topic: [MOD] Multi-Language support for any text (updated 05-11-2005)  (Read 215947 times)

0 Members and 1 Guest are viewing this topic.

Offline cronk005

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • Travelingtheworldaround
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #120 on: June 30, 2006, 03:13:25 AM »
I have looked and looked and I do not know where I am going wrong. I still cannot get rid of the language tags in the 'clickstream?' At least that's where I think it is..... is there anyone who would be willing to look at my code and help me... clearly I am not getting it....

http://galleries.travelingtheworldaround.com/categories.php?cat_id=5&l=nederlands

Offline om6acw

  • Full Member
  • ***
  • Posts: 187
    • View Profile
    • My Animal's World
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #121 on: June 30, 2006, 04:12:09 AM »
I have looked and looked and I do not know where I am going wrong. I still cannot get rid of the language tags in the 'clickstream?' At least that's where I think it is..... is there anyone who would be willing to look at my code and help me... clearly I am not getting it....

http://galleries.travelingtheworldaround.com/categories.php?cat_id=5&l=nederlands


look for

Code: [Select]
$path = "<a href=\"".$site_sess->url($cat_url)."\" class=\"clickstream\">".$cat_cache[$cat_id]['cat_name']."</a>";
in include/functions.php and change like this

Code: [Select]
$path = "<a href=\"".$site_sess->url($cat_url)."\" class=\"clickstream\">".multilang($cat_cache[$cat_id]['cat_name'])."</a>";

Offline cronk005

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • Travelingtheworldaround
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #122 on: June 30, 2006, 04:39:08 AM »
This did not work either.... ????? I think V@no is laughing at me secretly. He's got this on his website with no problems.........

The thing I did notice, however, is that when you click on the next subcategory it goes to the way that it should be.

Bad Formatting:
http://galleries.travelingtheworldaround.com/categories.php?cat_id=7&l=nederlands

Good Formatting:
http://galleries.travelingtheworldaround.com/categories.php?cat_id=41&l=nederlands

Offline om6acw

  • Full Member
  • ***
  • Posts: 187
    • View Profile
    • My Animal's World
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #123 on: June 30, 2006, 04:57:03 AM »
This did not work either.... ????? I think V@no is laughing at me secretly. He's got this on his website with no problems.........

The thing I did notice, however, is that when you click on the next subcategory it goes to the way that it should be.

Bad Formatting:
http://galleries.travelingtheworldaround.com/categories.php?cat_id=7&l=nederlands

Good Formatting:
http://galleries.travelingtheworldaround.com/categories.php?cat_id=41&l=nederlands

I dont now, but everithing looks ok for me on both links.

Offline cronk005

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • Travelingtheworldaround
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #124 on: June 30, 2006, 05:05:59 AM »
yeah, sorry. I was trying something and it wasn't working. it wouldn't give me the complete file... ie: Begin > Zuid-Amerika > Bolivië   only Bolivië

Offline cronk005

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • Travelingtheworldaround
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #125 on: June 30, 2006, 05:11:23 AM »
A copy of the php files for includes/functions.php and categories.php are as follows if anyone cares to look:

functions = http://galleries.travelingtheworldaround.com/help/functions.txt
categories = http://galleries.travelingtheworldaround.com/help/categories.txt

Offline om6acw

  • Full Member
  • ***
  • Posts: 187
    • View Profile
    • My Animal's World
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #126 on: June 30, 2006, 05:53:49 AM »
A copy of the php files for includes/functions.php and categories.php are as follows if anyone cares to look:

functions = http://galleries.travelingtheworldaround.com/help/functions.txt
categories = http://galleries.travelingtheworldaround.com/help/categories.txt

look for all

Code: [Select]
$cat_cache[$category_id]['cat_name']

in functions.php and change that to

Code: [Select]
multilang($cat_cache[$category_id]['cat_name'])

Offline cronk005

  • Newbie
  • *
  • Posts: 44
    • View Profile
    • Travelingtheworldaround
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #127 on: June 30, 2006, 06:18:16 AM »
OK.... I think we are finally in business. Let us keep fingers and toes crossed for good luck..

Thank you for your time and patience.. I appreciate it ALOT!!!!

Offline adrianus

  • Pre-Newbie
  • Posts: 4
    • View Profile
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #128 on: September 28, 2006, 01:32:02 AM »
hi

Does it work with 4Images 1.7.3 ?

do you have test it ?

thanks
AD

Offline F2F

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #129 on: October 21, 2006, 01:28:56 AM »
Yes, I tested this MOD in 1.7.3 and it works (at least for image description, that is the part I'm interesting in).
Saddly, I get this:

Code: [Select]
Notice: Undefined index: date_format in global.php on line 139

Notice: Undefined index: language_dir in includes\functions.php on line 1853

Notice: Undefined index: language_list in includes\functions.php on line 1853

Notice: Undefined index: language_list in includes\functions.php on line 1857

Notice: Undefined index: language_dir_default in includes\functions.php on line 1861

Notice: Undefined index: language_list in includes\functions.php on line 1861

Notice: Undefined index: time_format in global.php on line 140

Notice: Undefined index: language_dir in includes\functions.php on line 1853

Notice: Undefined index: language_list in includes\functions.php on line 1853

Notice: Undefined index: language_list in includes\functions.php on line 1857

Notice: Undefined index: language_dir_default in includes\functions.php on line 1861

Notice: Undefined index: language_list in includes\functions.php on line 1861

Warning: Cannot modify header information - headers already sent by (output started at global.php:139) in global.php on line 442

But as I said, it works, and if you configure 4images to not to show notices and warnings, then everything should be fine. However, I would like to know how to get rid of those annoying noticies...

Regards.

Offline F2F

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #130 on: October 21, 2006, 01:49:09 AM »
Well, I just found that I can't open the ACP anymore, I get the same errors as above but nothing else, no ACP at all...  :?

UPDATE/

This is the part that is giving me the errors, and once removed everything is fine:

Code: [Select]
$config['date_format'] = multilang($config['date_format']);
$config['time_format'] = multilang($config['time_format']);

Of course, this means that I have to give up the multilang date and time part of the MOD. But for names and descriptions it simply works.

Regards.
« Last Edit: October 21, 2006, 02:40:06 AM by F2F »

Offline Alessio

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
    • Webax.it [Alessio's photogallery]
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #131 on: December 03, 2006, 01:50:42 PM »
I have installed this fantastic mod but I have some problems.

----------------------------------------------------

I have a problem with MOD Guestbook http://www.4homepages.de/forum/index.php?topic=7409.0

when I go to http://www.webax.it/guestbook.php I have this error
Notice: Undefined variable: comment_text in /mounted-storage/home28b/sub001/sc24851-FNHZ/www/guestbook.php on line 422

when I write a message I have this error
Notice: Undefined variable: user_country in /mounted-storage/home28b/sub001/sc24851-FNHZ/www/guestbook.php on line 287

when I delete a message I have these errors
Notice: Undefined variable: comments in /mounted-storage/home28b/sub001/sc24851-FNHZ/www/guestbook.php on line 447
Notice: Undefined variable: contents in /mounted-storage/home28b/sub001/sc24851-FNHZ/www/guestbook.php on line 446

----------------------------------------------------


Another problem with MOD Another Simple News Publishing Mod that I have resolved in this way


Notice: Undefined index: comment_user_name in /var/www/mysite/images/news.php on line 67

(http://www.4homepages.de/forum/index.php?topic=9064.msg43702#msg43702)

Right on the spot.

In your news.php file,

find :

Quote

$comment_user_name = htmlspecialchars($news_row[$i]['comment_user_name']);


replace with :

Code: [Select]

//$comment_user_name = htmlspecialchars($news_row[$i]['comment_user_name']);


It doesn't seem to be used anywhere else in that file.

Then, save the file and reload the page again to see if it works. ;)

« Last Edit: December 03, 2006, 06:29:10 PM by Alessio »
Alessio
my homepage: http://www.webax.it

Offline Alessio

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
    • Webax.it [Alessio's photogallery]
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #132 on: December 12, 2006, 12:38:54 PM »
I have another problem!

In "ADMIN - check new images" I have these errors

Notice: Undefined variable: caption in /mounted-storage/home28b/sub001/sc24851-FNHZ/www/admin/checkimages.php on line 1227
Notice: Undefined variable: keywords in /mounted-storage/home28b/sub001/sc24851-FNHZ/www/admin/checkimages.php on line 1228

UPDATE: I have resolved the problems adding to php file this code
error_reporting(E_ALL ^ E_NOTICE);
« Last Edit: December 12, 2006, 01:00:04 PM by Alessio »
Alessio
my homepage: http://www.webax.it

Offline host

  • Newbie
  • *
  • Posts: 31
    • View Profile
Re: [MOD] Multi-Language support for any text
« Reply #133 on: December 20, 2006, 04:54:45 PM »
Hi V@no, hello all,

I'm a 'new' user of 4images and found this fantastic MOD.
A long time ago the question about the sorting problem was discussed here:

nice thing - there's a lot to change, to have this feature working flawless :)

But there's one little problem I could not solve on my own:


If you have a category and you set sorting by image name - it will absolutely mess up the sorting in there, if you rename some of the pictures to support more languages...
See here: http://photo.overlord.cz/categories.php?cat_id=38

How would it be possible to sort the images by the shown image name, not by the "whole image name" containing [czech] etc.?

For me the general problem of the sorting order (not only with this MOD) was relevant, so I tried to fix it.

I made a small addition in the function.php:

Original
Code: [Select]
function multilang($text, $show_first = 0, $remove = 0){
  global $config;
  preg_match("#\[".$config['language_dir']."\](.*)(\[\/?".$config['language_list']."\]|$)#iDUs", $text, $match);
  if (!empty($match[1])) {
    return $match[1];
  }
  preg_match("#^(.*)\[".$config['language_list']."\]#iDUs", $text, $match);
  if (!empty($match[1])) {
    return $match[1];
  }
  preg_match("#\[".$config['language_dir_default']."\](.*)(\[\/?".$config['language_list']."\]|$)#iDUs", $text, $match);
  if (!empty($match[1])) {
    return $match[1];
  }
  if ($show_first) {
    preg_match("#\[".$config['language_list']."\](.*)(\[\/?".$config['language_list']."\]|$)#iDUs", $text, $match);
    if (!empty($match[2])) {
      return $match[2];
    }
  }
  if ($remove) {
    return preg_replace("#\[".$config['language_list']."\](.*)#iDs", "", $text);
  }
  return $text;
}

Changed:
Code: [Select]
function multilang($text, $show_first = 0, $remove = 0){
  global $config;
  preg_match("#\[".$config['language_dir']."\](.*)(\[\/?".$config['language_list']."\]|$)#iDUs", $text, $match);
  if (!empty($match[1])) {
    return $match[1];
  }


  preg_match("#\[default\](.*)(\[\/?".$config['language_list']."\]|$)#iDUs", $text, $match);
  if (!empty($match[1])) {
    return $match[1];
  }


  preg_match("#^(.*)\[".$config['language_list']."\]#iDUs", $text, $match);
  if (!empty($match[1])) {
    return $match[1];
  }
  preg_match("#\[".$config['language_dir_default']."\](.*)(\[\/?".$config['language_list']."\]|$)#iDUs", $text, $match);
  if (!empty($match[1])) {
    return $match[1];
  }
  if ($show_first) {
    preg_match("#\[".$config['language_list']."\](.*)(\[\/?".$config['language_list']."\]|$)#iDUs", $text, $match);
    if (!empty($match[2])) {
      return $match[2];
    }
  }
  if ($remove) {
    return preg_replace("#\[".$config['language_list']."\](.*)#iDs", "", $text);
  }
  return $text;
}

This little change - the 'definition' of a [default] language tag, solved for me two problems:
1. I can sort my pictures.
2. I can define text in a default mode, which is taken, if the choosen language is not present in the text.

Example:

A picture with the name: [001][default]Picture[deutsch]Bild will be shown in any language
(except german) as 'Picture' and in german as 'Bild' and the prefix [001] is used to sort my pictures within a category.

As a sorting criteria you can use everything with '[]' at the beginning... of course execpt any installed language-name


I don' know, if anybody else will find this useful, but anyway  :wink:

Cheers
HoSt


« Last Edit: December 20, 2006, 10:49:12 PM by host »

Offline Madgod

  • Pre-Newbie
  • Posts: 5
    • View Profile
    • WindNest
Re: [MOD] Multi-Language support for any text (updated 05-11-2005)
« Reply #134 on: January 12, 2007, 04:59:59 PM »
I got a idea about this mod.

is anyone trying to put the code
Code: [Select]
$text = multilang($text);  //( for all site text format)before
 
Code: [Select]
return $text;at
Code: [Select]
function format_text($text, $html = 0, $word_wrap = 0, $bbcode = 0, $bbcode_img = 0) {in the file : includes/functions.php

so that we don't have to make a lot of change of each code.

I am using 1.74

another question:
how can I sort the result of images in category.php, just like when I am in English mode or Chinese mode,the sort result of images won't be the same, I hope that system sort according the language mode, not the real name in database. can anyone help I to fix this problem.....
« Last Edit: February 01, 2007, 10:43:24 AM by Madgod »