English > Extensions and jDiction
jDiction and PhocaDownload
xgon:
--- Quote from: xgon on October 31, 2014, 05:26:28 pm ---it works GREAT!
Thanks.
--- End quote ---
Ohhh, not great yet. There's this problem: When the category list is queried from the database, we have this result, for the default language:
--- Code: ---array(13) {
[0]=>
object(stdClass)#4784 (8) {
["id"]=>
string(1) "1"
["parent_id"]=>
string(1) "0"
["title"]=>
string(6) "IO.GSM"
["alias"]=>
string(6) "io-gsm"
["access"]=>
string(1) "1"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "0"
}
[1]=>
object(stdClass)#4842 (8) {
["id"]=>
string(1) "6"
["parent_id"]=>
string(1) "5"
["title"]=>
string(10) "Documentos"
["alias"]=>
string(10) "documentos"
["access"]=>
string(1) "1"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "5"
}
[2]=>
object(stdClass)#4786 (8) {
["id"]=>
string(2) "10"
["parent_id"]=>
string(1) "9"
["title"]=>
string(10) "Documentos"
["alias"]=>
string(10) "documentos"
["access"]=>
string(1) "1"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "2"
}
[3]=>
object(stdClass)#4858 (8) {
["id"]=>
string(1) "2"
["parent_id"]=>
string(1) "1"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "6"
}
[4]=>
object(stdClass)#4917 (8) {
["id"]=>
string(1) "5"
["parent_id"]=>
string(1) "0"
["title"]=>
string(6) "IO.XEC"
["alias"]=>
string(6) "io-xec"
["access"]=>
string(1) "1"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "0"
}
[5]=>
object(stdClass)#4856 (8) {
["id"]=>
string(1) "7"
["parent_id"]=>
string(1) "5"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "9"
}
[6]=>
object(stdClass)#4915 (8) {
["id"]=>
string(2) "11"
["parent_id"]=>
string(1) "9"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "2"
}
[7]=>
object(stdClass)#4854 (8) {
["id"]=>
string(1) "3"
["parent_id"]=>
string(1) "1"
["title"]=>
string(8) "Software"
["alias"]=>
string(8) "software"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "8"
}
[8]=>
object(stdClass)#4913 (8) {
["id"]=>
string(2) "12"
["parent_id"]=>
string(1) "9"
["title"]=>
string(8) "Software"
["alias"]=>
string(8) "software"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(2) "11"
}
[9]=>
object(stdClass)#4852 (8) {
["id"]=>
string(1) "4"
["parent_id"]=>
string(1) "1"
["title"]=>
string(10) "Documentos"
["alias"]=>
string(10) "documentos"
["access"]=>
string(1) "1"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "5"
}
[10]=>
object(stdClass)#4911 (8) {
["id"]=>
string(2) "13"
["parent_id"]=>
string(1) "9"
["title"]=>
string(13) "Controladores"
["alias"]=>
string(13) "controladores"
["access"]=>
string(1) "1"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[11]=>
object(stdClass)#4853 (8) {
["id"]=>
string(1) "9"
["parent_id"]=>
string(1) "0"
["title"]=>
string(11) "IO.Control2"
["alias"]=>
string(11) "io-control2"
["access"]=>
string(1) "1"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "0"
}
[12]=>
object(stdClass)#5019 (8) {
["id"]=>
string(2) "14"
["parent_id"]=>
string(1) "0"
["title"]=>
string(14) "inforSolutions"
["alias"]=>
string(14) "inforsolutions"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(3) "841"
["numdoc"]=>
string(2) "10"
}
}
--- End code ---
but for the translated language, I have this result:
--- Code: ---array(62) {
[0]=>
object(stdClass)#5553 (8) {
["id"]=>
string(1) "1"
["parent_id"]=>
string(1) "0"
["title"]=>
string(6) "IO.GSM"
["alias"]=>
string(6) "io-gsm"
["access"]=>
string(1) "1"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "0"
}
[1]=>
object(stdClass)#5583 (8) {
["id"]=>
string(1) "6"
["parent_id"]=>
string(1) "5"
["title"]=>
string(10) "Documentos"
["alias"]=>
string(10) "documentos"
["access"]=>
string(1) "1"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[2]=>
object(stdClass)#5548 (8) {
["id"]=>
string(1) "6"
["parent_id"]=>
string(1) "5"
["title"]=>
string(10) "Documentos"
["alias"]=>
string(10) "documentos"
["access"]=>
string(1) "1"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[3]=>
object(stdClass)#5442 (8) {
["id"]=>
string(1) "6"
["parent_id"]=>
string(1) "5"
["title"]=>
string(10) "Documentos"
["alias"]=>
string(10) "documentos"
["access"]=>
string(1) "1"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[4]=>
object(stdClass)#5550 (8) {
["id"]=>
string(1) "6"
["parent_id"]=>
string(1) "5"
["title"]=>
string(10) "Documentos"
["alias"]=>
string(10) "documentos"
["access"]=>
string(1) "1"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[5]=>
object(stdClass)#5443 (8) {
["id"]=>
string(1) "6"
["parent_id"]=>
string(1) "5"
["title"]=>
string(10) "Documentos"
["alias"]=>
string(10) "documentos"
["access"]=>
string(1) "1"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[6]=>
object(stdClass)#5552 (8) {
["id"]=>
string(2) "10"
["parent_id"]=>
string(1) "9"
["title"]=>
string(10) "Documentos"
["alias"]=>
string(10) "documentos"
["access"]=>
string(1) "1"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[7]=>
object(stdClass)#5444 (8) {
["id"]=>
string(2) "10"
["parent_id"]=>
string(1) "9"
["title"]=>
string(10) "Documentos"
["alias"]=>
string(10) "documentos"
["access"]=>
string(1) "1"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[8]=>
object(stdClass)#5554 (8) {
["id"]=>
string(1) "2"
["parent_id"]=>
string(1) "1"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[9]=>
object(stdClass)#5445 (8) {
["id"]=>
string(1) "2"
["parent_id"]=>
string(1) "1"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[10]=>
object(stdClass)#5556 (8) {
["id"]=>
string(1) "2"
["parent_id"]=>
string(1) "1"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[11]=>
object(stdClass)#5558 (8) {
["id"]=>
string(1) "2"
["parent_id"]=>
string(1) "1"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[12]=>
object(stdClass)#5447 (8) {
["id"]=>
string(1) "2"
["parent_id"]=>
string(1) "1"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[13]=>
object(stdClass)#5560 (8) {
["id"]=>
string(1) "2"
["parent_id"]=>
string(1) "1"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[14]=>
object(stdClass)#5448 (8) {
["id"]=>
string(1) "5"
["parent_id"]=>
string(1) "0"
["title"]=>
string(6) "IO.XEC"
["alias"]=>
string(6) "io-xec"
["access"]=>
string(1) "1"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "0"
}
[15]=>
object(stdClass)#5562 (8) {
["id"]=>
string(1) "7"
["parent_id"]=>
string(1) "5"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[16]=>
object(stdClass)#5449 (8) {
["id"]=>
string(1) "7"
["parent_id"]=>
string(1) "5"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[17]=>
object(stdClass)#5564 (8) {
["id"]=>
string(1) "7"
["parent_id"]=>
string(1) "5"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[18]=>
object(stdClass)#5450 (8) {
["id"]=>
string(1) "7"
["parent_id"]=>
string(1) "5"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[19]=>
object(stdClass)#5566 (8) {
["id"]=>
string(1) "7"
["parent_id"]=>
string(1) "5"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[20]=>
object(stdClass)#5451 (8) {
["id"]=>
string(1) "7"
["parent_id"]=>
string(1) "5"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[21]=>
object(stdClass)#5568 (8) {
["id"]=>
string(1) "7"
["parent_id"]=>
string(1) "5"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[22]=>
object(stdClass)#5452 (8) {
["id"]=>
string(1) "7"
["parent_id"]=>
string(1) "5"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[23]=>
object(stdClass)#5570 (8) {
["id"]=>
string(1) "7"
["parent_id"]=>
string(1) "5"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[24]=>
object(stdClass)#5589 (8) {
["id"]=>
string(2) "11"
["parent_id"]=>
string(1) "9"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[25]=>
object(stdClass)#5572 (8) {
["id"]=>
string(2) "11"
["parent_id"]=>
string(1) "9"
["title"]=>
string(8) "Firmware"
["alias"]=>
string(8) "firmware"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[26]=>
object(stdClass)#5591 (8) {
["id"]=>
string(1) "3"
["parent_id"]=>
string(1) "1"
["title"]=>
string(8) "Software"
["alias"]=>
string(8) "software"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[27]=>
object(stdClass)#5574 (8) {
["id"]=>
string(1) "3"
["parent_id"]=>
string(1) "1"
["title"]=>
string(8) "Software"
["alias"]=>
string(8) "software"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[28]=>
object(stdClass)#5593 (8) {
["id"]=>
string(1) "3"
["parent_id"]=>
string(1) "1"
["title"]=>
string(8) "Software"
["alias"]=>
string(8) "software"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[29]=>
object(stdClass)#5576 (8) {
["id"]=>
string(1) "3"
["parent_id"]=>
string(1) "1"
["title"]=>
string(8) "Software"
["alias"]=>
string(8) "software"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[30]=>
object(stdClass)#5595 (8) {
["id"]=>
string(1) "3"
["parent_id"]=>
string(1) "1"
["title"]=>
string(8) "Software"
["alias"]=>
string(8) "software"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[31]=>
object(stdClass)#5578 (8) {
["id"]=>
string(1) "3"
["parent_id"]=>
string(1) "1"
["title"]=>
string(8) "Software"
["alias"]=>
string(8) "software"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[32]=>
object(stdClass)#5597 (8) {
["id"]=>
string(1) "3"
["parent_id"]=>
string(1) "1"
["title"]=>
string(8) "Software"
["alias"]=>
string(8) "software"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[33]=>
object(stdClass)#5580 (8) {
["id"]=>
string(1) "3"
["parent_id"]=>
string(1) "1"
["title"]=>
string(8) "Software"
["alias"]=>
string(8) "software"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[34]=>
object(stdClass)#5599 (8) {
["id"]=>
string(2) "12"
["parent_id"]=>
string(1) "9"
["title"]=>
string(8) "Software"
["alias"]=>
string(8) "software"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[35]=>
object(stdClass)#5582 (8) {
["id"]=>
string(2) "12"
["parent_id"]=>
string(1) "9"
["title"]=>
string(8) "Software"
["alias"]=>
string(8) "software"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
[36]=>
object(stdClass)#5601 (8) {
["id"]=>
string(2) "12"
["parent_id"]=>
string(1) "9"
["title"]=>
string(8) "Software"
["alias"]=>
string(8) "software"
["access"]=>
string(1) "2"
["description"]=>
string(0) ""
["accessuserid"]=>
string(1) "0"
["numdoc"]=>
string(1) "1"
}
}
--- End code ---
>:(this code was truncated!!!
The categories, subcategories and files work this way: Categories and subcategories are stored in the same table and each has it's own id. The files have also an id, and a category id (straight forward)
The query that retrieves this data is:
a) for the default language:
SELECT cc.id, cc.parent_id, cc.title, cc.alias, cc.access, cc.description, cc.accessuserid, COUNT(c.id) AS numdoc FROM #__phocadownload_categories AS cc LEFT JOIN #__phocadownload AS c ON c.catid = cc.id AND c.published = 1 AND c.textonly = 0 WHERE cc.published = 1 AND cc.access IN (1,1,2,3,6) AND cc.language IN ('pt-PT','*') GROUP BY cc.id ORDER BY cc.ordering ASC
b)and for the translated:
SELECT cc.id, cc.parent_id, cc.title, cc.alias, cc.access, cc.description, cc.accessuserid, COUNT(c.id) AS numdoc FROM #__phocadownload_categories AS cc LEFT JOIN #__phocadownload AS c ON c.catid = cc.id AND c.published = 1 AND c.textonly = 0 WHERE cc.published = 1 AND cc.access IN (1,1,2,3,6) AND cc.language IN ('en-GB','*') GROUP BY cc.id ORDER BY cc.ordering ASC
The column numdoc (COUNT) in the translated is always equal to 1!
The bottom line is: when the xml file is present (jdiction.xml), the category list for the default language displays correctly; for the translated language, the category list has 62 items(which is the sum of all the files included in all the categories).
There must be a group or join problem in jdiction plugin.
Please help me out.
Thanks
Harald Leithner:
upps sorry I missed this thread...
problem still exists?
Its possible that there are still group problems and it is not easy to solve them correct...
jdiction changes the query by adding all primary keys and adding them to the group clause... maybe thats not the best idea....
salher:
Hi, I know this is a a very old post but I have exactly the same issue.
Any solution yet?
--- Quote from: Harald Leithner on November 24, 2014, 06:35:26 pm ---upps sorry I missed this thread...
problem still exists?
Its possible that there are still group problems and it is not easy to solve them correct...
jdiction changes the query by adding all primary keys and adding them to the group clause... maybe thats not the best idea....
--- End quote ---
Harald Leithner:
I maybe could be solved with jdiction 2.0 only beta access atm if you like the version I can send it to you.
salher:
--- Quote from: Harald Leithner on August 04, 2016, 03:16:49 pm ---I maybe could be solved with jdiction 2.0 only beta access atm if you like the version I can send it to you.
--- End quote ---
Yes please. I would like to try that version.
Thanks.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version