[geeklog-devtalk] multi language version of static pages out for testing

arthur arthur at eggplantmedia.com
Tue Feb 3 01:08:57 EST 2004


Hi-

I've been hacking at GL to create a site that can switch between
English and Spanish _content_ on the fly. In order to do this, I've
done quite a bit of modification. Because I've definately done this as
more of a hack, I'm only releasing a modified version of the Static
Pages plugin for the mean time. I want to see if there is interest and
support to do this correctly application wide- though, you can see my
dev area which does do this here:

http://red.eggplantmedia.com/tlc/public_html/staticpages/index.php?
page=2004020223513791

basically what i have done is added fields to the content entry area
for spanish titles and body text (for the articles, I also added the
intro text). Based on the cookie's language setting, either english or
spanish content is displayed.

you can download the WAY WAY beta release here:
http://eggplantmedia.com/~arthur/StaticPagesML-0.2.tgz

if you follow the readme, this will add a second static pages to your
site and add the staticpages_ml to your database. You should not run
this on a production site. It's not tested enough, and it's a hack.
It's working for me, but you should play with it before you trust me.

I've posted the read me file here so that you can get a sense of
things. I've never ever released anything before, so I don't really
know how to do this. I basically just stole the whole structure of the
existing static pages install and changed it around to fit my needs. If
you play with this, let me know- I'd like to hear if this is useful for
people.....

If you're more interested, I've gone through the process of modify the
calendar, blocks, and stories
Basically the crux of this is that i've replaced lots of the calls to
the database results:
$A['title'] has become $A[$title_lang] in the display logic sections

If content areas are defined which could have the possibility of being
multi language in the future, then this will save lots of work. It's
then possible to define $title_lang as "title". $language Once this
gets connected back to an intelligent content language system, it would
be possible to add different kinds of languages as the user needs. Of
course, it means that plugins need to declare what their content fields
are to the language module, but then there could be standardized fields
like title_languageName content_languageName etc. Is anybody interested
in working on this kind of modification with me?





Static Pages With Multi Language Support version .2
----------------------------------------------
* This hack is based on: *
* Staticpages Geeklog Plug-in version 1.3.2 *
* September 12, 2003 *
----------------------------------------------

arthur at eggplantmedia.com did the work, but this is still a major hack.

This document has been modifed to reflect the multi language support

ML = multi language. Right now, this is main/spanish support, where
main can be any language. ML support means that content changes based
on cookie data- if the user chooses to display the site in spanish, and
there is spanish content in the ML static page they are viewing, the
spanish content will be displayed. If they choose another language, the
default language will be displayed.


In This Document
----------------

Welcome
List of Files with Descriptions
License
Support
How To Help
Known Issues
System Requirements and Installation
Security Issues
Uninstalling
Special Thanks

Welcome
-------
This Staticpages Geeklog Plug-in is the source code and database that
is used to
for creating multi language staticpages in Geeklog. Like Geeklog this
has is released under the GNU General Public License. It is a bona fide
Open
Source / Free Software project.

The 1.3.x modification have been made by: Alex Richardson.
alexx at eyedocgreg.com

Original Authors: Tony Bibbs - tony at tonybibbs.com
Tom Willett - twillett at users.sourceforge.net



LIST OF FILES WITH DESCRIPTIONS
-------------------------------

FILE: /path/to/geeklog/public_html/admin/plugins/staticpages/install.php
DESCRIPTION: Will modify your database for static pages with ML support

FILE: /path/to/geeklog/public_html/admin/plugins/staticpages/index.php
DESCRIPTION: Static page editor code. Has ML support

FILE: /path/to/geeklog/public_html/staticpages_ml/index.php
DESCRIPTION: This is the code to display multi-language static pages.

FILE: /path/to/geeklog/plugins/staticpages/functions.inc
DESCRIPTION: Implements the Geeklog Plugin-API and has any common
functions

FILE:
/path/to/geeklog/plugins/staticpages_ml/templates/admin/editor.thtml
DESCRIPTION: Template file for displaying the static page editor. Has
been edited
for ML support

LICENSE
-------
Like GeekLog, the Static Page Plug-in is licensed under the: GPL. There
should be an included LICENSE file
if it really interests you (or you having trouble sleeping) go ahead a
read it.

In a nice gesture you could provide a link back to Geeklog and the
Static Page Geeklog Plug-in:

http://geeklog.sourceforge.net/
http://sourceforge.net/projects/geeklogplugins

SUPPORT
-------
If you have questions abou my modifications, contact me at

arthur at eggplantmedia.com

Additionally the GeekLog home page is a good source of information at:
http://www.geeklog.net

Finally, you can try the Geeklog Mailing list at:
http://lists.sourceforge.net/mailman/listinfo/geeklog-devel.


SYSTEM REQUIREMENTS AND INSTALLATION
------------------------------------
You must install this plugin-in with Geeklog version 1.3.8.x. This
plug-in was
developed on 1.3.8-1 and has not been tested on earlier versions. THIS
PLUGIN IS INCOMPLETE.
I HAVE NOT DONE EXTENSIVE TESTING it works for me, but your milage my
very.

Geeklog 1.3.8 includes Staticpages 1.3, This distribution includes only
the files needed

to upgrade from 1.3 (or 1.3.x) to 1.3.3.



UPGRADING (As noted above, this package is only used to upgrade from
1.3.x to 1.3.3)

---------
To install:

1) BACKUP YOUR EXISTING FILES FIRST. DO A DATABASE BACK UP. NOT JOKING!

2) After unziping the package, replace the following files with the
files in this package.

3) Move the admin/staticpages_ml/index.php and
admin/staticpages_ml/install.php files to
/path/to/geeklog/public_html/admin/plugins/staticpages_ml/
NOTE: you must use that directory name

4) Move the public_html/staticpages_ml/index.php file to
/path/to/geeklog/public_html/staticpages_ml/
NOTE: you must use that directory name

5) Move: plugins/staticpages_ml/functions.inc
plugins/staticpages_ml/config.inc
plugins/staticpages_ml/language/
plugins/staticpages_ml/templates/

to /path/to/geeklog/plugins/staticpages_ml/
NOTE: you must use that directory name


6) Add the following to /path/to/geeklog/system/lib-database.php

// the ML static pages plugin
$_TABLES['staticpages_ml'] = $_DB_table_prefix . 'staticpages_ml';

you should be able to see where this fits in- there is a list of lines
that are
extremely similar to this- tag it on just underneath the normal static
pages entry.

7) That's it!



SECURITY ISSUES
---------------
It is up to you to properly secure your database, web server and host
settings. If you are looking for information in securing your system
some starting points that are recommended are:

http://www.php.net
http://www.mysql.com
http://www.apache.org
http://www.devshed.com
http://www.securityfocus.com
http://www.linux.com

ENJOY!
-------------------------------------------------------------------
arthur at eggplantmedia.com | www.eggplantmedia.com




More information about the geeklog-devtalk mailing list