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

0 Members and 1 Guest are viewing this topic.

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [MOD] Multi-Language support for any text
« Reply #45 on: September 10, 2005, 04:42:01 PM »
Code: [Select]
$clickstream .= $image_name."</span>";
Hm I tryed this line first an it had no effect, so I didnt change it.
Everything works without the change.
What is changed with this code

TheOracle

  • Guest
Re: [MOD] Multi-Language support for any text
« Reply #46 on: September 10, 2005, 04:57:21 PM »
Right. Sorry, I thought it was the $image_row['image_name'] string and not the $image_name. Leave it behind then. ;)

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [MOD] Multi-Language support for any text
« Reply #47 on: September 11, 2005, 02:05:43 AM »
Has anybody an idea, how to apply the
Mod "random image"
http://www.4homepages.de/forum/index.php?topic=1020.0

and the
Mod "Include NEWEST in some other page PLUG-IN" with Multi-Language support
http://www.4homepages.de/forum/index.php?topic=6816.0

The both mods print out image name without multilanguage support
The image name shows "Bild [english]picture"

Matthias

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [MOD] Multi-Language support for any text
« Reply #48 on: September 13, 2005, 09:32:09 PM »
Has anybody an idea, how to apply the
Mod "random image"
http://www.4homepages.de/forum/index.php?topic=1020.0

and the
Mod "Include NEWEST in some other page PLUG-IN" with Multi-Language support
http://www.4homepages.de/forum/index.php?topic=6816.0

The both mods print out image name without multilanguage support
The image name shows "Bild [english]picture"

Matthias

When I'm trying to change the code from the Mod "Include NEWEST in some other page PLUG-IN"
like this => changed line see below in the code: $image_name = multilang($row['image_name']);
in the original code it's: $image_name = $row['image_name'];

Code: [Select]
<?php
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('SCRIPT_URL''/********/bildergalerie/');
define('ROOT_PATH''/*******/bildergalerie/');
include(
ROOT_PATH.'config.php');
include(
ROOT_PATH.'includes/db_mysql.php');
include(
ROOT_PATH.'includes/constants.php');
$site_db = new Db($db_host$db_user$db_password$db_name);
function 
is_remote($file_name) {
  return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i'$file_name)) ? 0;
}
$sql "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_hits
        FROM "
.IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
        WHERE a.image_active=1
        AND a.cat_id = b.cat_id
        AND b.auth_viewcat="
.AUTH_ALL."
        AND b.auth_viewimage="
.AUTH_ALL."
        ORDER BY image_date DESC
        LIMIT 3"
;
$result $site_db->query($sql);
while (
$row $site_db->fetch_array($result)) {
$image_id $row['image_id'];
$cat_id $row['cat_id'];
$image_name multilang($row['image_name']);
$image_hits $row['image_hits'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo 
"<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=_parent><img src=\"".$thumb_src."\" border=\"0\"></a>\n";
echo 
"<br><b>$image_name</b><br>\n";
echo 
"Hits: $image_hits<br><br>\n";
}
?>


I get the following error
Quote
Fatal error: Call to undefined function: multilang()


Any ideas what's going wrong?
Matthias


TheOracle

  • Guest
Re: [MOD] Multi-Language support for any text
« Reply #49 on: September 14, 2005, 12:01:41 AM »
These codings involves unsafed methods and unglobalized detections towards 4images. Which is why, you actually encounter difficulties loading your quoted MOD.

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [MOD] Multi-Language support for any text
« Reply #50 on: September 14, 2005, 02:39:26 PM »
Hi TheOracle,

so the only solution ist to take out this part 
Code: [Select]
$image_name = multilang($row['image_name']);
  :cry:

Or do you have another solution?

Matthias

Offline Xyu BAM

  • Full Member
  • ***
  • Posts: 145
    • View Profile
Re: [MOD] Multi-Language support for any text
« Reply #51 on: September 14, 2005, 02:46:13 PM »
These codings involves unsafed methods and unglobalized detections towards 4images. Which is why, you actually encounter difficulties loading your quoted MOD.
o my o my...sometimes its better not to reply at all if you have no answer, instead of replying with something only you could possibly understand...

@Matthias70:
add below
Code: [Select]
include(ROOT_PATH.'includes/constants.php');this line:
Code: [Select]
include(ROOT_PATH.'includes/functions.php');
If it will give you some warnings or error messages, then add the new functions (that you've inserted in functions.php) under that line.

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [MOD] Multi-Language support for any text
« Reply #52 on: September 14, 2005, 03:49:21 PM »
These codings involves unsafed methods and unglobalized detections towards 4images. Which is why, you actually encounter difficulties loading your quoted MOD.
o my o my...sometimes its better not to reply at all if you have no answer, instead of replying with something only you could possibly understand...

@Matthias70:
add below
Code: [Select]
include(ROOT_PATH.'includes/constants.php');this line:
Code: [Select]
include(ROOT_PATH.'includes/functions.php');
If it will give you some warnings or error messages, then add the new functions (that you've inserted in functions.php) under that line.

Thank you for your answer Xyu BAM,
but now I get the following error
Quote
Fatal error: Cannot redeclare is_remote() (previously declared in /www/htdocs/****/neue4images.php:10) in /www/htdocs/****/bildergalerie/includes/functions.php on line 38

And I don't know what to change in includes.php. The mulitlang Mod is aleready installed.
The only problem is the image_name outside 4images on my homepage.
Outside 4images the image_name is shown without multilang Mod, that means the image name shows something like this Wasser[english]Water ?

Do you understand the problem?
Matthias

TheOracle

  • Guest
Re: [MOD] Multi-Language support for any text
« Reply #53 on: September 15, 2005, 12:12:44 AM »
@Matthias70:

Quote

Fatal error: Cannot redeclare is_remote() (previously declared in /www/htdocs/****/neue4images.php:10) in /www/htdocs/****/bildergalerie/includes/functions.php on line 38


Remove this part from your file :

Code: [Select]

function is_remote($file_name) {
  return (preg_match('#^https?\\:\\/\\/[a-z0-9\-]+\.([a-z0-9\-]+\.)?[a-z]+#i', $file_name)) ? 1 : 0;
}


as it is already been initialized by includes/functions.php file. ;)

TheOracle

  • Guest
Re: [MOD] Multi-Language support for any text
« Reply #54 on: September 15, 2005, 12:22:08 AM »
Quote

o my o my...sometimes its better not to reply at all if you have no answer, instead of replying with something only you could possibly understand...


Oh my, oh my, oh my. Sometimes it's better to post some MODs like I do for these users rather than critisizing...

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [MOD] Multi-Language support for any text
« Reply #55 on: September 15, 2005, 03:17:44 PM »
Thank you TheOracle,
now the code for the new.php outside of 4imaes looks like this (see below)
I'm getting no error anymore, but the image_name still prints out somthing like Wasser[english]water ???
Multilang Imagenames and and Multilang Description on my whole 4images page is O.K.
But the random image an the newest on homepage are still not working.

What else can I do?
Thanks
Matthias

Code: [Select]
<?php
// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('SCRIPT_URL''http://www.gpaed.de/bildergalerie/');
define('ROOT_PATH''/www/htdocs/******/bildergalerie/');
include(
ROOT_PATH.'config.php');
include(
ROOT_PATH.'includes/db_mysql.php');
include(
ROOT_PATH.'includes/constants.php');
include(
ROOT_PATH.'includes/functions.php');
$site_db = new Db($db_host$db_user$db_password$db_name);
$sql "SELECT a.image_id, a.cat_id, a.image_name, a.image_active, a.image_thumb_file, a.image_hits
        FROM "
.IMAGES_TABLE." a, ".CATEGORIES_TABLE." b
        WHERE a.image_active=1
        AND a.cat_id = b.cat_id
        AND b.auth_viewcat="
.AUTH_ALL."
        AND b.auth_viewimage="
.AUTH_ALL."
        ORDER BY image_date DESC
        LIMIT 3"
;
$result $site_db->query($sql);
while (
$row $site_db->fetch_array($result)) {
$image_id $row['image_id'];
$cat_id $row['cat_id'];
$image_name multilang($row['image_name']);
$image_hits $row['image_hits'];
$thumb_src = (is_remote($row['image_thumb_file'])) ? $row['image_thumb_file'] : SCRIPT_URL.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'];
echo 
"<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=_parent><img src=\"".$thumb_src."\" border=\"0\"></a>\n";
echo 
"<br><b>$image_name</b><br>\n";
echo 
"Hits: $image_hits<br><br>\n";
}
?>

TheOracle

  • Guest
Re: [MOD] Multi-Language support for any text
« Reply #56 on: September 15, 2005, 05:13:20 PM »
Well, first -

replace :

Quote

// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('SCRIPT_URL', 'http://www.gpaed.de/bildergalerie/');
define('ROOT_PATH', '/www/htdocs/******/bildergalerie/');
include(ROOT_PATH.'config.php');
include(ROOT_PATH.'includes/db_mysql.php');
include(ROOT_PATH.'includes/constants.php');
include(ROOT_PATH.'includes/functions.php');
$site_db = new Db($db_host, $db_user, $db_password, $db_name);


with :

Code: [Select]

// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define('GET_CACHES', 1);
define('SCRIPT_URL', 'http://www.gpaed.de/bildergalerie/');
define('ROOT_PATH', '/www/htdocs/******/bildergalerie/');
define('GET_USER_ONLINE', 1);
include(ROOT_PATH.'global.php');
require(ROOT_PATH.'includes/sessions.php');
$user_access = get_permission();


(Note: Still respecting your ROOT_PATH folder).

However, regarding your SCRIPT_URL, I think you forgot to mask it before posting the quote on the topic.  :mrgreen:

Then, replace this block :

Quote

echo "<a href=\"".SCRIPT_URL."details.php?image_id=$image_id\" target=_parent><img src=\"".$thumb_src."\" border=\"0\"></a>\n";
echo "<br><b>$image_name</b><br>\n";
echo "Hits: $image_hits<br><br>\n";


with this one :

Code: [Select]

echo "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id)."\" target=\"_blank\"><img src=\"".$thumb_src."\" border=\"0\"></a>\n";
echo "<br><b>".$image_name."</b><br>\n";
echo $lang['hits'] . REPLACE_EMPTY . $image_hits."<br><br>\n";


Tell me how it goes from there. ;)

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [MOD] Multi-Language support for any text
« Reply #57 on: September 15, 2005, 05:38:06 PM »
Quote
However, regarding your SCRIPT_URL, I think you forgot to mask it before posting the quote on the topic. 
That's no problem. Come and visit my site  8)

I get the following error...

Quote
Parse error: parse error, unexpected ';' in /www/htdocs/******/neue4images.php on line 26

The error is in this line
Code: [Select]
echo "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id."\" target=\"_blank\"><img src=\"".$thumb_src."\" border=\"0\"></a>\n";
Did not know that it would be so difficult
Matthias

TheOracle

  • Guest
Re: [MOD] Multi-Language support for any text
« Reply #58 on: September 15, 2005, 05:44:56 PM »
Quote

echo "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id."\" target=\"_blank\"><img src=\"".$thumb_src."\" border=\"0\"></a>\n";


I always forget a ")" when using $site_sess don't I ?  :mrgreen:

Ok, replace it with :

Code: [Select]

echo "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id)."\" target=\"_blank\"><img src=\"".$thumb_src."\" border=\"0\"></a>\n";


Should work now. ;)

Offline Matthias70

  • Full Member
  • ***
  • Posts: 199
    • View Profile
    • Bildergalerie
Re: [MOD] Multi-Language support for any text
« Reply #59 on: September 15, 2005, 06:22:36 PM »
Wow TheOracle,
it works
thank you very much.

I don't dare to ask  :oops:
What about the Mod "random image" outside 4images
http://www.4homepages.de/forum/index.php?topic=1020.0

Matthias