jDiction Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

jDiction 2.2.0 released. http://jdiction.org/downloads

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - zigzo

Pages: [1]
1
General Questions / Re: Not translated when sql contains count()
« on: July 15, 2014, 03:54:05 am »
It did not work at first but after I commented around line 420 as well, it works!  Thanks! :)

Code: [Select]
if (stripos(substr($this->sql, 0, stripos($this->sql, 'FROM')), 'COUNT(') !== false) {
         // $translate = false;
        }

2
General Questions / Not translated when sql contains count()
« on: July 11, 2014, 08:22:47 am »
Hello,

I am using the below query where the cc.title is bilingual.  However it cannot be translated.
Code: [Select]
$query = 'SELECT cc.title AS text, cc.id AS id, cc.parent_id as parentid, cc.alias as alias, cc.access as access'
. ', cc.accessuserid as accessuserid, cc.owner_id as owner_id '
. ', count(cc.id) as number'
. ' FROM `#__phocagallery_categories` AS cc'
. ' INNER JOIN `#__photos` AS a ON cc.id = a.catid'
. ' WHERE cc.published = 1'
. ' AND cc.approved = 1'
. ' AND a.published = 1'
. ' GROUP BY cc.id'
. ' ORDER BY cc.id DESC'
. ' LIMIT 100'; 

After some trial-and-errors,  I found that the title can be translated successfully if I replace "count(cc.id) as number" with "1 as number". 

I am using joomla 3.3.0 and jdiction 1.2.0.  When I move the whole module back to my old site (joomla 3.1.5 with jdiction 0.9.9.10), it works.  Is it a problem of incompatibility with joomla 3.3.0 or is there a problem with the count() in sql?  Thanks!



3
General Questions / Re: 404 when switching language
« on: October 01, 2013, 08:54:08 am »
ok, thanks for the reply~

4
General Questions / Re: 404 when switching language
« on: September 30, 2013, 04:20:33 pm »
I see...
Is there a place of the code that I may hardcode some rules for jdiction to create the link?

5
General Questions / 404 when switching language
« on: September 30, 2013, 03:58:02 am »
Hello,

I have SEF turned on and I have phocagallery on my menu.
When I try to view the list of categories by clicking the menu, it works. And it can switch to different languages as well.

But when I click into one of the categories (which works) and then try to switch the language, a 404 page is shown.

The correct link of the category is: http://mysite/index.php/en/menu_item_name/category/2-cat-name

But I can see the link my language button wants to go is: http://mysite/index.php/en/menu_item_name?view=category

I did try to add a "category" item in a hidden menu, it works for that given category but not the others.

Similar problem happens when I click the "comment image" link for each image.
It seems that the correct SEF url can't be passed to the language switching buttons.

Is it a problem in phocagallery or language switcher?

Thanks!

6
General Questions / Re: Retrieving translated category by SQL
« on: September 29, 2013, 11:35:39 am »
I see. Thanks a lot!!

7
General Questions / Re: Retrieving translated category by SQL
« on: September 28, 2013, 05:50:55 pm »
All of them work. So it must be some manipulation inside the chronoforms...

I have just tried your code for the sql query instead of the default chronoform action and it works now~

Thanks for your help!

8
General Questions / Re: Retrieving translated category by SQL
« on: September 28, 2013, 05:12:53 pm »
Thanks for your reply!
The 1st one works.  And when I added ` for all fields, it works too.

The 1-line query code doesn't work though.

9
General Questions / Re: Retrieving translated category by SQL
« on: September 28, 2013, 11:22:13 am »
The query is like this:
SELECT `id`, `owner_id`, `title`, `userfolder`, `latitude`, `longitude`
  FROM `cwosjm_phocagallery_categories` AS `myCategory`
  WHERE  owner_id = 852

And then I refer to the 'title' field to display in dropdown box.

10
General Questions / Re: Retrieving translated category by SQL
« on: September 28, 2013, 09:58:49 am »
Hi, thanks for your reply.

Actually I'm using chronoforms to generate the DB query to select the id, title...etc. from _phocagallery_categories.  The title is translated using jdiction. 
I have attached the related php code.

Thanks for helping!!
 

11
General Questions / Retrieving translated category by SQL
« on: September 27, 2013, 11:11:57 am »
Hello,

I am using jDiction and Phoca Gallery and with the jdiction.xml in another thread I could translate the category names successfully. Thanks!

However, I got a problem when trying to write some codes to select categories from the category table.  When I use select title from the category table, it can only retrieve the original names. 
How can I get the translated titles according to my site language? Do I need to refer to the jdiction sql table in my code as well?   Thanks!

Pages: [1]