Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1981 2012-06-21 19:30:57

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: MLP - The Multi-Lingual Publishing Pack

smd_query… good idea…

Consider sharing the solution here :)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#1982 2012-06-21 20:09:09

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: MLP - The Multi-Lingual Publishing Pack

Ah, I found my post with the example code to fetch an article’s renditions (using – what else ;) – smd_query). Don’t know if it can help you, Jeroen, but you might want to have a look at it.

Offline

#1983 2012-06-21 22:10:35

jeroen
Member
From: brussels.be
Registered: 2012-06-15
Posts: 16

Re: MLP - The Multi-Lingual Publishing Pack

smd_query is nice indeed..
I was making things more complicated then I should have been. Should have RTFM
The populate=“article” attribute solved quite some headaches. (processing custom fields etc)

Every entry has only one rendition in it’s original language.
For every available site language, a custom field holds the part I do want to have translated (in this case, where the writer came from (eg “a family from Belgium”, “een familie van België”, “une famille venant de la Belgique”).
I’m ordering by title (which contains the date of the entry in the physical guestbook) as I’m not sure they will be inputting them in order.

<txp:smd_query 
       query="SELECT * FROM 
              (
                SELECT *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod FROM l10n_txp_en_gb
                UNION ALL
                SELECT *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod FROM l10n_txp_nl_nl
                UNION ALL
                SELECT *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod FROM l10n_txp_fr_fr
              ) ALIAS
               WHERE 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section IN ('guestbook')
              ORDER BY Title DESC"
         populate="article"
         form="guestbook_entry" />

EDIT: I took the SQL statements from a regular article_custom query. The fields and dates etc are needed for the populate attribute to work. /EDIT

Thanks to the populate=“article” attribute you can use the regular article related tags in the used form.

Any opinions on putting the SQL WHERE clause just at the end or in all separate SELECT statements?

Now I just have to add the filtering (probably just a show all languages/show user language toggle). And look in to pagination. Indeed, I did not really RTFM on everything about smd_query… But these things are probably better off in another thread. But I’d welcome any pointer :)

I’m happy. I tamed MLP :)
Thank you both for your help!

Cheers,
Jeroen

Last edited by jeroen (2012-06-21 22:13:35)

Offline

#1984 2012-06-22 18:05:23

jeremywood
Member
Registered: 2007-12-12
Posts: 26

Re: MLP - The Multi-Lingual Publishing Pack

Is it possible to suppress URL rewriting for the default language? Essentially, I want /en to go away.

Thanks,

Jeremy

Offline

#1985 2012-07-12 09:04:14

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 453
Website

Re: MLP - The Multi-Lingual Publishing Pack

I just updated one of my sites to txp to 4.4.1 and the latest MLP pack (featuring plugin 4.3.0.12). Now, no articles are displayed anymore. Not as a list, and not as a single article. I have looked at the tags and the syntax, and everything appears to be OK…

I am totally stumped!

Any suggestions as to how I should approach fixing this problem?


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

#1986 2012-07-12 12:53:10

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: MLP - The Multi-Lingual Publishing Pack

Hi Kjeld

1) Backup the database
2) Just to breath more calm, check if the articles are there in the DB
3) Repeat/review the installation & upgrade process in case you missed something (for example, to replace txplib_db.php).
4) Finally, you could try running the uninstall MLP wizard, and then, running the install wizard again.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#1987 2012-07-12 13:04:25

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 453
Website

Re: MLP - The Multi-Lingual Publishing Pack

maniqui wrote:

1) Backup the database
2) Just to breath more calm, check if the articles are there in the DB
3) Repeat/review the installation & upgrade process in case you missed something (for example, to replace txplib_db.php).
4) Finally, you could try running the uninstall MLP wizard, and then, running the install wizard again.

Thanks, maniqui!

I haven’t yet done the above, but I am getting the following errors:

Tag error: <txp:article form="single" listform="default" limit="4" searchall="1" /> -> Textpattern Warning: Unknown column 'Expires' in 'where clause' select count(*) from mainl10n_txp_en_us as l10n_txp_en_us where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section != 'about' and Section != 'books' and Section != 'map' and Section != 'bibliography' textpattern/lib/txplib_db.php:264 getThing() on line 113 textpattern/lib/txplib_db.php:113 trigger_error() textpattern/lib/txplib_db.php:344 safe_query() textpattern/lib/txplib_db.php:264 getThing() textpattern/publish.php:791 safe_count() textpattern/publish.php:964 doArticles() textpattern/publish.php:592 parseArticles() textpattern/publish.php:1188 article() textpattern/publish.php:1100 processTags() textpattern/publish/taghandlers.php:3586 parse() textpattern/publish.php:1188 if_search()

Tag error: <txp:article form="single" listform="default" limit="4" searchall="1" /> -> Textpattern Warning: Unknown column 'Expires' in 'field list' select *, unix_timestamp(Posted) as uPosted, unix_timestamp(Expires) as uExpires, unix_timestamp(LastMod) as uLastMod from mainl10n_txp_en_us as l10n_txp_en_us where 1=1 and Status = 4 and Posted <= now() and (now() <= Expires or Expires = '0000-00-00 00:00:00') and Section != 'about' and Section != 'books' and Section != 'map' and Section != 'bibliography' order by Posted desc limit 0, 4 textpattern/lib/txplib_db.php:258 startRows() on line 113 textpattern/lib/txplib_db.php:113 trigger_error() textpattern/lib/txplib_db.php:323 safe_query() textpattern/lib/txplib_db.php:258 startRows() textpattern/publish.php:815 safe_rows_start() textpattern/publish.php:964 doArticles() textpattern/publish.php:592 parseArticles() textpattern/publish.php:1188 article() textpattern/publish.php:1100 processTags() textpattern/publish/taghandlers.php:3586 parse() textpattern/publish.php:1188 if_search()

I think this may be the key issue: Textpattern Warning: Unknown column 'Expires' in 'where clause'


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

#1988 2012-07-12 13:19:51

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: MLP - The Multi-Lingual Publishing Pack

Did you log in in the admin side? It may be that the update script for 4.4.1 hasn’t been run yet.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#1989 2012-07-12 13:25:21

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 453
Website

Re: MLP - The Multi-Lingual Publishing Pack

maniqui wrote:

Did you log in in the admin side? It may be that the update script for 4.4.1 hasn’t been run yet.

Yes, I thought of that, too. Logged out and back in several times. Even re-uploaded the Update folder, but no luck…


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

#1990 2012-07-12 13:26:46

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 453
Website

Re: MLP - The Multi-Lingual Publishing Pack

I updated several sites today and this is the only one where this problem occurred, so it is not my server and PHP settings either.


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

#1991 2012-07-12 19:28:55

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: MLP - The Multi-Lingual Publishing Pack

Hi Kjeld, run the MLP cleanup wizard (don’t check #s 3 and 4!), then the install wizard again. Could it be that this particular site was an older Txp version?

Offline

#1992 2012-07-12 21:19:18

Kjeld
Member
From: Tokyo, Japan
Registered: 2005-02-05
Posts: 453
Website

Re: MLP - The Multi-Lingual Publishing Pack

Els wrote:

Hi Kjeld, run the MLP cleanup wizard (don’t check #s 3 and 4!), then the install wizard again. Could it be that this particular site was an older Txp version?

Thanks, Els!

What do I do after running the cleanup wizard? Do I:

a) continue with “The MLP Pack l10n plugin can now be disabled and/or uninstalled.” and click “next” or

b) ignore “next” and click on the wizard link to run “MLP Pack Setup”
b2) should I leave #9 “Insert MLP tags into pages” checked?

By the way, I updated from txp 4. But I also updated another site from txp 4 yesterday without this problem occurring.


Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
JapaneseStreets.com – Japanese street fashion (mostly txp)

Offline

Board footer

Powered by FluxBB