Forums / All Other Contributions/Addons / Multi-Language Support for EZ-Pages

Multi-Language Support for EZ-Pages

Results 1 to 20 of 298
17 May 2006, 04:54
#1
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Posts:
2,361
Plugin Contributions:
1

Multi-Language Support for EZ-Pages

In response to a question in the 'Customization from the Admin' forum, I found some time and played with some code...there is a zip file attached to this post that contains a complete drop-in contribution to make the EZ-Pages fully multi-language capable just as the category and product titles and descriptions are.

There are installation instructions included in the readme.txt file

Note: this contribution is designed for v1.3.0+ only. If you want to try it on an earlier version of the cart, feel free to do so at your own risk but don't expect support for it.


USE THIS LINK TO DOWNLOAD: http://www.zen-cart.com/index.php?main_page=product_contrib_info&cPath=40_47&products_id=113






MODERATOR NOTE:THE FILE ATTACHED HERE CONTAINS SOME BUGS. You should download using the link above.
17 May 2006, 12:15
#2
femky avatar

femky

New Zenner

Join Date:
May 2006
Posts:
24
Plugin Contributions:
0

Re: Multi-Language Support for EZ-Pages

Thanks for your effords and quick response! Naturally I was hoping for a solution, but never expected it this fast ...............

Of course I tried out your solution immediately. Unfortunately I get the following error:
1146 Table 'hairsho_pmzen.zenpm_ezpages_text' doesn't exist
in:
[select count(*) as total from zenpm_ezpages e, zenpm_ezpages_text et where e.pages_id = et.pages_id and et.languages_id = '2']
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.

In the new SQL query the new table is defined as ezpages_content and the php file is looking for the ezpages_text. We tried to resolve this by changing the table name into ezpages_content but still (about) same error.
We will now try to ajust the SQL query now but all help is welcome of course. I will report back later.
17 May 2006, 12:46
#3
femky avatar

femky

New Zenner

Join Date:
May 2006
Posts:
24
Plugin Contributions:
0

Re: Multi-Language Support for EZ-Pages

A
We first changed the table name in the SQL query and the EZ pages panel within admin is now working again! If we now add a new EZ page a multi-langual form opens and in both English (admin panel) and Dutch the correct title from EZpage is shown.

However, the EZ pages do not show in the shop at all! The sidebox does show so the program 'knows' that there is a page, but does not provide the title/link in the sidebox.

B
New approach: adjusted the following files:
1. includes/extra_datafiles/ezpages_multilangauge_database_names.php
2. admin/includes/extra_datafiles/ezpages_multilangauge_database_names.php
In both files we made the following changes:
from: define('TABLE_EZPAGES_TEXT', DB_PREFIX . 'ezpages_text');
to: define('TABLE_EZPAGES_TEXT', DB_PREFIX . 'ezpages_content');

Same result unfortunately! The sidebox does show as soon as an EZ page has been made, but the EZ page itself does not show (no title/link in sidebox)
17 May 2006, 13:11
#4
femky avatar

femky

New Zenner

Join Date:
May 2006
Posts:
24
Plugin Contributions:
0

Re: Multi-Language Support for EZ-Pages

:blush: Sorry, we screwed up

We forgot to do the "files to over-ride" section of the README
Now that we did - together with step B from previous mail- everything works fine.

Thanks again!!:smile:
17 May 2006, 13:23
#5
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Posts:
2,361
Plugin Contributions:
1

Re: Multi-Language Support for EZ-Pages

apologies for the error in the table name...the result of a last-minute change of mind about the table name.

It works fine for me on two separate installations - but if there was some original content in the ezpages table that was copied into the new table by the sql patch I provided, you need to manually add the rows for the additional languages (else you just get the word Array in place of the link). I may have to rethink the inclusion of that in the sql patch and perhaps include a php install file that will populate the new table for all installed languages (but each page will have the same title/content for each language until edited).
17 May 2006, 13:31
#6
femky avatar

femky

New Zenner

Join Date:
May 2006
Posts:
24
Plugin Contributions:
0

Re: Multi-Language Support for EZ-Pages

That may be true and I can see your point, but for us it works perfectly at the moment!

Many thanks!
02 Jun 2006, 07:03
#7
pivey avatar

pivey

Zen Follower

Join Date:
Mar 2006
Posts:
192
Plugin Contributions:
0

Re: Multi-Language Support for EZ-Pages

Hello bunyip,

I installed the multi ez pages with the same error accoured to femky, fixed that by editing the two rows for the table names and the pages show up correctly in multi language.

However, I can't save the new (or edited) pages. Get always an error:
Page title for English is required
Page title for Greek is required


I'm running 3 languages: Eng, German, Greek
My default languge is English
Default editor: FCKEDITOR

Wonder why there is no error for the German Page title

Dimi
02 Jun 2006, 14:21
#8
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Posts:
2,361
Plugin Contributions:
1

Re: Multi-Language Support for EZ-Pages

Pivey - deselect FCKEDITOR and use HTMLAREA or None and let me know if you still get the errors.
02 Jun 2006, 14:54
#9
pivey avatar

pivey

Zen Follower

Join Date:
Mar 2006
Posts:
192
Plugin Contributions:
0

Re: Multi-Language Support for EZ-Pages

Yes, still the same. I tried with Htmlarea, none..the same!

Error: Page title required. (English)
Error: Page title required. (Greek)

Dimi
02 Jun 2006, 15:33
#10
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Posts:
2,361
Plugin Contributions:
1

Re: Multi-Language Support for EZ-Pages

I think I found the problem:

in admin/ezpages.php find this line of code:
if (empty($_POST['pages_title'][$i])) {


change it to this:
if (empty($_POST['pages_title'][$languages[$i]['id']])) {
02 Jun 2006, 15:52
#11
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Posts:
2,361
Plugin Contributions:
1

Re: Multi-Language Support for EZ-Pages

there's actually another place a couple of lines above that has the same problem.

This line of code:
if ($_POST['pages_html_text'][$i] !='' and strlen(trim($_POST['pages_html_text'][$i])) > 6) {

should be changed to this:
if ($_POST['pages_html_text'][$languages[$i]['id']] !='' and strlen(trim($_POST['pages_html_text'][$languages[$i]['id']])) > 6) {


I'll update the file in the downloads section to correct thes two lines.
02 Jun 2006, 15:54
#12
pivey avatar

pivey

Zen Follower

Join Date:
Mar 2006
Posts:
192
Plugin Contributions:
0

Re: Multi-Language Support for EZ-Pages

:thumbsup: Perfect!

I buy you a beer when you are in Greece....and Thank You!
Dimi
06 Jun 2006, 09:54
#13
czechboy avatar

czechboy

New Zenner

Join Date:
Jun 2006
Posts:
18
Plugin Contributions:
0

Re: Multi-Language Support for EZ-Pages

Hi, I have downloaded a new version of multilanguage support and done all steps. But there is a problem that I can not get new EZ page working. the old ez pages are still there but the content disapeared? I guess something got wrong... is there a way how to solve it?
see the page: www.mozaika.org
All Ez pages which you can see there have not the pages in admin/tools/ezpages... the whole page in tools/ezpages is empty... so I can not even delete the old ezpages.. pls help..
Oldrich Svec

PS: always I run this the pages disapear from admin but they are still on main page:

DROP TABLE IF EXISTS `ezpages_content`;
CREATE TABLE IF NOT EXISTS `ezpages_content` (
`pages_id` int(11) NOT NULL default '0',
`languages_id` int(11) NOT NULL default '1',
`pages_title` varchar(64) NOT NULL default '',
`pages_html_text` text NOT NULL,
KEY `idx_ezpages_content` (`pages_id`,`languages_id`)
) TYPE=MyISAM;

#################

## This next section copies your page titles and content across from the existing ezpages table into the new ezpages_content table
#NEXT_X_ROWS_AS_ONE_COMMAND:3
INSERT INTO ezpages_content (pages_id, pages_title, pages_html_text)
SELECT pages_id, pages_title, pages_html_text
FROM ezpages;

#################

## You don't need to do this next step, it just serves to remove the now unused fields in the ezpages table.
## To run the query, remove the comment marks from each line
##ALTER TABLE `ezpages` DROP `languages_id` ,
##DROP `pages_title` ,
##DROP `pages_html_text` ;
06 Jun 2006, 14:25
#14
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Posts:
2,361
Plugin Contributions:
1

Re: Multi-Language Support for EZ-Pages

If I go to your site and select English as the language, I see all the content for the ezpages. If I select Czech then the content is blank.

The sql tool I provided with the module takes your original content and adds it as english only in the new table. You'll need to add the Czech content separately.

From your Admin panel, try selecting English as your language, then go to Tools > Ezpages and see what is there. You should be able to add the Czech titles/content.
07 Jun 2006, 08:26
#15
czechboy avatar

czechboy

New Zenner

Join Date:
Jun 2006
Posts:
18
Plugin Contributions:
0

Re: Multi-Language Support for EZ-Pages

I see... I did so and I tried to edit one of the files but when I pressed update, it behaved normaly but when I looked in the file again all the czech content disapeared. And if I create new file and put some content in it, it saves it correctly but nothing is seen on the main page:

EZPages :: :: Shared :: Zen Cart

I am newbie in this so I am sorry if it is a trivial question.
Thank you very much for your help.
Oldrich Svec
07 Jun 2006, 13:12
#16
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Posts:
2,361
Plugin Contributions:
1

Re: Multi-Language Support for EZ-Pages

I think I've figured out what the problem is for your Czech titles and content not being saved - I'll have a fix for that shortly.

As for the titles not being displayed on your store, I don't think you installed the mod correctly. If you extracted all of the zip file you should have had a folder includes/modules/CUSTOM/ that had two files in it. That CUSTOM folder should have been renamed to match your custom template folder name before you uploaded the files.
07 Jun 2006, 13:36
#17
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Posts:
2,361
Plugin Contributions:
1

Re: Multi-Language Support for EZ-Pages

The failure of titles and content not being saved for additional languages was because of the way the update process was implemented.

After installing the module, you would have a datarow in TABLE_EZPAGES_TEXT for each page, but only for a single language. The update process was effectively trying to update a datarow that didn't exist for additional languages. I've now included checking for that so if the datarow doesn't exist, it gets inserted.

(This will also allow for a situation where additional languages are added to your store after this contribution is installed)

I've updated the module in the Downloads section, but it will take a little while to get processed before it's available. In the meantime, replace your copy of admin/ezpages.php with the new file from the attachment to this post.
07 Jun 2006, 16:05
#18
fweb avatar

fweb

New Zenner

Join Date:
Apr 2006
Posts:
31
Plugin Contributions:
1

Re: Multi-Language Support for EZ-Pages

I did above and now I have this

Parse error: parse error, unexpected T_VARIABLE, expecting '(' in /home/fwebsolu/public_html/demo001/admin/ezpages.php on line 204

lost admin altogether.

I just spent 5 days doing the french language upgrade and this would be a great addon tool.

Fantastic work.

Thanks

Peter
07 Jun 2006, 16:34
#19
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Posts:
2,361
Plugin Contributions:
1

Re: Multi-Language Support for EZ-Pages

at line 204 of admin/ezpages.php, change this code:
if $check_query->RecordCount() > 0) {

to this
if ($check_query->RecordCount() > 0) {
07 Jun 2006, 17:10
#20
fweb avatar

fweb

New Zenner

Join Date:
Apr 2006
Posts:
31
Plugin Contributions:
1

Re: Multi-Language Support for EZ-Pages

Thanks

I was just poking around myself to see it there was a missing bracket.

Anyway that solves the error message. I will play with Ezpages now for a while in french and english and see if all is fine.

Again thanks for the quick response.

Peter