COMMUNITY FORUM
Search Results (Searched for: Re Error SQL)
- william white
Is there a limit of items for each category?
Category: English K2 Community
I havent seen a published limit on records in the tables, (there may be one, but it will be limited by your sql install and server storage, probably not k2 or joomla
What else have you added to your site that may be causing things to act funny at this point
- Oltech
[Solved] The plugin could not locate the folder:
Category: Simple Image Gallery PRO
- PHP 5.3.14
- MySQL 5.5.19-55
J 2.5.6
- K2 2.5.7
- JCE 2.2.6
- JoomSEF 4.2.8
- AkeebaBackUp 3.6.3
- SIG Pro v 2.5.8
- CookieConfirm 2.0.0
When I try to add a new Gallery in a K2 item, I get following error:
There was a problem rendering your image gallery. Please make sure that the folder you are using in the Simple Image Gallery Pro plugin tags exists and contains valid image files. The plugin could not locate the folder: media/k2/galleries/59
In the plugin settings -> Basic Options
Root folder for image galleries: images
Searching this forum did not bring a solution, anyone with a clue?
Regards
Beuvema
- Majid
K2 menu items don't work
Category: English K2 Community
"Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /home/.../domains/mashhadsara.com/public_html/libraries/joomla/database/database/mysql.php on line 712"
Now what is the solution?
Thanks again...
- Lefteris
K2 tags & user groups stopped working
Category: English K2 Community
- Cleiviane Cardoso da Costa
Table is full
Category: English K2 Community
This is part of the real message:
500 - Ocorreu um erro.
The table 'qod9e_finder_tokens' is full SQL=INSERT INTO `qod9e_finder_tokens` (`term`,`stem`,`common`,`phrase`,`weight`,`context`) VALUES ('cultivá-la', 'cultivá-la', 0, 0, 0.6667, 2),('o', 'o', 0, 0, 0.0667, 2),('nosso', 'nosso', 0, 0, 0.3333, 2),('desejo', 'desejo', 0, 0, 0.4, 2),('nessas', 'nessa', 0, 0, 0.4, 2),('palavras', 'palavra', 0, 0, 0.5333, 2),('é', 'é', 0, 0, 0.0667, 2),('encorajar', 'encorajar', 0, 0, 0.6, 2),('você', 'você', 0, 0, 0.2667, 2),('a', 'a', 0, 0, 0.0667, 2),('tomar', 'tomar', 0, 0, 0.3333, 2),('ou', 'ou', 0, 0, 0.1333, 2),('mesmo', 'mesmo', 0, 0, 0.3333, 2),('retomar', 'retomar', 0, 0, 0.4667, 2),('uma', 'uma', 0, 0, 0.2, 2),('decisão', 'decisão', 0, 0, 0.4667, 2),('de', 'de', 0, 0, 0.1333, 2),('cultivar', 'cultivar', 0, 0, 0.5333, 2),('este', 'est', 0, 0, 0.2667, 2),('aspecto', 'aspecto', 0, 0, 0.4667, 2),('do', 'do', 0, 0, 0.1333, 2),('seu', 'seu', 0, 0, 0.2, 2),('caráter', 'caráter', 0, 0, 0.4667, 2),('sabendo', 'sabendo', 0, 0, 0.4667, 2),('que', 'que', 0, 0, 0.2, 2),('algo', 'algo', 0, 0, 0.2667, 2),('tão', 'tão', 0, 0, 0.2, 2),('nós', 'nó', 0, 0, 0.2, 2),('também', 'também', 0, 0, 0.4, 2),('queremos', 'queremo', 0, 0, 0.5333, 2),('agora', 'agora', 0, 0, 0.3333, 2),('dar', 'dar', 0, 0, 0.2, 2),('alguns', 'algun', 0, 0, 0.4, 2),('conselhos', 'conselho', 0, 0, 0.6, 2),('que', 'que', 0, 0, 0.2, 2),('ao', 'ao', 0, 0, 0.1333, 2),('mesmo', 'mesmo', 0, 0, 0.3333, 2),('tempo', 'tempo', 0, 0, 0.3333, 2),('serão', 'serão', 0, 0, 0.3333, 2),('como', 'como', 0, 0, 0.2667, 2),('testes', 'test', 0, 0, 0.4, 2),('para', 'para', 0, 0, 0.2667, 2),('que', 'que', 0, 0, 0.2, 2),('você', 'você', 0, 0, 0.2667, 2),('possa', 'possa', 0, 0, 0.3333, 2),('saber', 'saber', 0, 0, 0.3333, 2),('se', 'se', 0, 0, 0.1333, 2),('estás', 'está', 0, 0, 0.3333, 2),('entre', 'entr', 0, 0, 0.3333, 2),('aqueles', 'aquel', 0, 0, 0.4667, 2),('que', 'que', 0, 0, 0.2, 2),('têm', 'têm', 0, 0, 0.2, 2),('buscado', 'buscado', 0, 0, 0.4667, 2),('a', 'a', 0, 0, 0.0667, 2),('humildade', 'humildad', 0, 0, 0.6, 2),('1º', '1º', 0, 0, 0.1333, 2),('avalie-se', 'avalie-s', 0, 0, 0.6, 2),('a', 'a', 0, 0, 0.0667, 2),('si', 'si', 0, 0, 0.1333, 2),('mesmo', 'mesmo', 0, 0, 0.3333, 2),('honestamente', 'honestament', 0, 0, 0.8, 2),('humildade', 'humildad', 0, 0, 0.6, 2),('não', 'não', 0, 0, 0.2, 2),('é', 'é', 0, 0, 0.0667, 2),('o', 'o', 0, 0, 0.0667, 2),('mesmo', 'mesmo', 0, 0, 0.3333, 2),('que', 'que', 0, 0, 0.2, 2),('baixa', 'baixa', 0, 0, 0.3333, 2),('autoestima', 'autoestima', 0, 0, 0.6667, 2),('ser', 'ser', 0, 0, 0.2, 2),('humilde', 'humild', 0, 0, 0.4667, 2),('não', 'não', 0, 0, 0.2, 2),('significa', 'significa', 0, 0, 0.6, 2),('que', 'que', 0, 0, 0.2, 2),('você', 'você', 0, 0, 0.2667, 2),('acha', 'acha', 0, 0, 0.2667, 2),('que', 'que', 0, 0, 0.2, 2),('não', 'não', 0, 0, 0.2, 2),('tem', 'tem', 0, 0, 0.2, 2),('nada', 'nada', 0, 0, 0.2667, 2),('a', 'a', 0, 0, 0.0667, 2),('oferecer', 'oferec', 0, 0, 0.5333, 2),('mas', 'ma', 0, 0, 0.2, 2),('sim', 'sim', 0, 0, 0.2, 2),('que', 'que', 0, 0, 0.2, 2),('você', 'você', 0, 0, 0.2667, 2),('sabe', 'sabe', 0, 0, 0.2667, 2),('exatamente', 'exatament', 0, 0, 0.6667, 2),('o', 'o', 0, 0, 0.0667, 2),('que', 'que', 0, 0, 0.2, 2),('tem', 'tem', 0, 0, 0.2, 2),('a', 'a', 0, 0, 0.0667, 2),('oferecer', 'oferec', 0, 0, 0.5333, 2),('e', 'e', 0, 0, 0.0667, 2),('não', 'não', 0, 0, 0.2, 2),('mais', 'mai', 0, 0, 0.2667, 2),('significa', 'significa', 0, 0, 0.6, 2),('que', 'que', 0, 0, 0.2, 2),('você', 'você', 0, 0, 0.2667, 2),('sabe', 'sabe', 0, 0, 0.2667, 2),('quem', 'quem', 0, 0, 0.2667, 2),('é', 'é', 0, 0, 0.0667, 2),('deus', 'deu', 0, 0, 0.2667, 2),('e', 'e', 0, 0, 0.0667, 2),('quem', 'quem', 0, 0, 0.2667, 2),('é', 'é', 0, 0, 0.0667, 2),('você', 'você', 0, 0, 0.2667, 2),('e', 'e', 0, 0, 0.0667, 2),('por', 'por', 0, 0, 0.2, 2),('isto', 'isto', 0, 0, 0.2667, 2),('você', 'você', 0, 0, 0.2667, 2),('depende', 'depend', 0, 0, 0.4667, 2),('de', 'de', 0, 0, 0.1333, 2),('deus', 'deu', 0, 0, 0.2667, 2),('confia', 'confia', 0, 0, 0.4, 2),('e', 'e', 0, 0, 0.0667, 2),('dá', 'dá', 0, 0, 0.1333, 2),('glórias', 'glória', 0, 0, 0.4667, 2),('a', 'a', 0, 0, 0.0667, 2),('ele', 'el', 0, 0, 0.2, 2)).
- swedeboy71
Urgent help - Fatal error: Cannot redeclare class
Category: English K2 Community
Hope someone can help us solve this issue.
When we try to save articles we're getting the following error
Fatal error: Cannot redeclare class K2HelperPermissions in /home/queermag/public_html/components/com_k2/helpers/permissions.php on line 15
This is the reply we got from our host
If in the code you include both of the files then you'll get this error. Essentially, you click save in backend and it goes to a particular php script. That script has includes or requires which take other scripts and include them (to use the code inside of those scripts). The scripts which are included have more includes and requires and so on. The first time you access (include or require) one of the files below the class gets declared. Then at some point another script includes another one of the files and the class tries to declare again which is what causes the error.
components/com_k2/helpers/permissions.j16.php
components/com_k2/helpers/permissions.php
development/components/com_k2/helpers/permissions.j16.php
development/components/com_k2/helpers/permissions.php
This is a programming safety feature so that all classes have to be declared and can only be declared one time.
After that reply we uninstalled the K2 component from our development server.
New response from our host
Yes, I see the two development files gone, but the two which are left are each have a call named K2HelperPermissions. I've looked at the classes and they are very different of one another. I was hoping they were the same so I could simply remove one of them and link the files together.
I've edited administrator/components/com_aceftp/quixplorer/_include/fun_admin.php and changed:
require "./_include/permissions.php";
To:
require_once "./_include/permissions.php";
Does this make any difference?
That didn't help
What can be wrong?
Right now we can't publish or save any articles
System Information
Web Server: Apache
PHP version: 5.3.15
MySQL version: 5.1.63-cll
GD image library: bundled (2.0.34 compatible)
Multibyte string support: Enabled
Upload limit: 20M
Memory limit: 232M
Open remote files (allow url fopen): Yes
- Leonid
500 internal server error on K2 links after Akeeba
Category: English K2 Community
"As a side note, we might also add that some third party components, such as DOCman 1.4.x and VirtueMart 1.x, store absolute paths in their configuration files. If you restored to a different location / server than the one you originally had the site you backed up, trying to access your new web site's public front-end might result in blank pages or HTTP Error 500. You will have to edit the configuration of those components and ensure that you have changed the paths to reflect the correct paths on your new server / location. Special notes for VirtueMart are available in the previous page of this troubleshooter.
Some other software store the database table prefix of your site in their configuration. For instance, SQL2Excel stores the database table prefix of your site inside the SQL queries attached to each worksheet. If you changed the database table prefix when restoring the site you also have to change these SQL queries. If unsure, ask the developer of that specific software. We can't know how all 6,000+ Joomla! extensions listed on the Joomla! Extensions Directory work. We can only provide support for our own software."
So I'm here!
- Stefano Messina
Error assigning users to group
Category: English K2 Community
So i created a group of K2 users, but when i try to assign a user to it i get this error:
TableK2User: :store fallito - Unknown column 'ip' in 'field list' SQL=INSERT INTO `g6jr4_k2_users` (`id`,`userID`,`userName`,`gender`,`description`,`url`,`group`,`ip`,`hostname`,`notes`) VALUES ('','43','Cliente','m','
','','1','','','')
There's something wrong with te db tables, but i know next to nothing of mysql so i don't really know what to do...
K2 version is 2.5.7, Joomla is 1.7
- Omar Almeida
Error saving Iten in Joomla 2.5 !
Category: English K2 Community
"The table 'ptre_finder_tokens' is full SQL = INSERT INTO` ptre_finder_tokens `(` term `,` stem `,` common `,` phrase `,` weight `,` context `) VALUES ('localized', 'located' 0, 0, 0.6667, 2), ('no', 'no', 0, 0, 0.1333, 2), ('center', 'center', 0, 0, 0.4, 2),
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, and inform Them This email address is being protected from spambots. You need JavaScript enabled to view it. of the team the error occurred, and anything you might have done That may have Caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while Trying to use an ErrorDocument to handle the request. "
I'm using K2 v2.5.7 and this error has been happening in previous versions. It saves the Item despite this. It happens every time a new item is saved.
Please, what is happening and how it could solve?
Thank you.
Olá, estou com problemas ao Salvar Itens no K2. Veja parte do erro no Joomla 2.5.4:
" The table 'ptre_finder_tokens' is full SQL=INSERT INTO `ptre_finder_tokens` (`term`,`stem`,`common`,`phrase`,`weight`,`context`) VALUES ('localizado', 'localizado', 0, 0, 0.6667, 2),('no', 'no', 0, 0, 0.1333, 2),('centro', 'centro', 0, 0, 0.4, 2),
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, This email address is being protected from spambots. You need JavaScript enabled to view it. and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. "
Estou usando o K2 v2.5.7 e este erro já vem acontecendo em versões anteriores. Ele salva o Item apesar disto. Acontece toda vez que é salvo um novo item.
Por favor, o que está acontecendo e como poderia resolver?
Obrigado.
- alejandro flain
TableK2User: :store failed
Category: English K2 Community
Im a brand new user in k2... now facing a rather strange bug
the site is in joomla 2.5.6 and k2 in 2.5.7
users imported from joomla
and I try to update a k2 user information
it return the following error:
TableK2User: :store failed
Unknown column 'ip' in 'field list' SQL=INSERT INTO `kfpne_k2_users` (`id`,`userID`,`userName`,`gender`,`description`,`url`,`group`,`ip`,`hostname`,`notes`) VALUES ('','3','Super User','m','
adsf asdf asdf asdf asdf
','','2','','','')
could someone give me a clue?
thanks in advance
alejandro
- Carl Smith
Frontpage Slideshow - Joomfish slide image translation problem
Category: Frontpage Slideshow
I have a Joomla 1.5 site running FPSS 3.2.0, with the latest Joomfish release V2.2.3.
I can translate some of the slide content but, most importantly for me, I'm not able to change the slide image being referenced for other languages: it's not an option in the Joomfish translation page.
I can see how I can add more to the fpss_slides.xml in the Joomfish 'administrator/components/com_joomfish/contentelements' file BUT the extra lines I would add to reference changing the slide image can't be found in the database. So I've opened up the table 'jos_fpss_slides' in the database but can't find a field to reference the image path.
So here's an example of the extra lines to add to the XML file:
<field type="text" name="path" translate="1">Image</field>
<field type="text" name="path_type" translate="0" >Path_type</field>
<field type="text" name="thumb" translate="1">Thumb</field>
However, this is obviously creating the following error in Joomfish because the fields don't exist in the 'jos_fpss_slides' table:
No valid database connection: DB function failed with error number 1054
Unknown column 'c.path' in 'field list' SQL=SELECT c.id, c.title, c.custom, c.text, c.tagline, c.path, c.path_type, c.thumb, jfc.id as jfc_id, jfc.value as titleTranslation, jfc.modified as lastchanged, jfc.published as published, jfc.language_id, jfl.title as language, jfc.reference_id as jfc_refid FROM jos_fpss_slides as c LEFT JOIN jos_jf_content as jfc ON c.id=jfc.reference_id AND jfc.reference_field='title' AND jfc.reference_table='fpss_slides' AND jfc.language_id=3 LEFT JOIN jos_languages as jfl ON jfc.language_id=jfl.lang_id ORDER BY c.title LIMIT 0, 20
So, the question in short :) is please can someone help me translate images for slides in Joomfish?
Thanks in advance.
- apatheticfrog
500 - Hata oluştu
Category: Türkçe K2 Topluluğu
K2 eklentisi kullanarak sayfama makale eklemeye çalıştığımda birkaç dakika bekledikten sonra aşağıdaki hatayı alıyorum. Makale sayfaya ekleniyor ama sayfada ciddi bir yavaşlama var. Bu hatayı nasıl düzeltebileceğim konusunda önerisi olan var mıdır?
500 - Hata oluştu.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 SQL=UPDATE `iey46_finder_taxonomy_map` SET `link_id`='62',`node_id`='3' WHERE
- Rick Gonzalez
erro al crear categoria
Category: Comunidad hispana oficial de K2
Al tratar de crear una categoria me aparecer este error
TableK2Category: :no almacenar
Table 'santiago_.pn15o_k2_categories' doesn't exist SQL=INSERT INTO `pn15o_k2_categories` (`id`,`name`,`alias`,`description`,`parent`,`published`,`access`,`ordering`,`params`,`language`) VALUES ('','dfjglkhuiytrew','qewadtkiul','
rtegrqwqw
','0','1','1','','{\"inheritFrom\":\"0\",\"theme\":\"orisite\",\"num_leading_items\":\"2\",\"num_leading_columns\":\"1\",\"leadingImgSize\":\"Large\",\"num_primary_items\":\"4\",\"num_primary_columns\":\"2\",\"primaryImgSize\":\"Medium\",\"num_secondary_items\":\"4\",\"num_secondary_columns\":\"1\",\"secondaryImgSize\":\"Small\",\"num_links\":\"4\",\"num_links_columns\":\"1\",\"linksImgSize\":\"XSmall\",\"catCatalogMode\":\"0\",\"catFeaturedItems\":\"1\",\"catOrdering\":\"\",\"catPagination\":\"2\",\"catPaginationResults\":\"1\",\"catTitle\":\"1\",\"catTitleItemCounter\":\"1\",\"catDescription\":\"1\",\"catImage\":\"1\",\"catFeedLink\":\"1\",\"catFeedIcon\":\"1\",\"subCategories\":\"1\",\"subCatColumns\":\"2\",\"subCatOrdering\":\"\",\"subCatTitle\":\"1\",\"subCatTitleItemCounter\":\"1\",\"subCatDescription\":\"1\",\"subCatImage\":\"1\",\"itemImageXS\":\"\",\"itemImageS\":\"\",\"itemImageM\":\"\",\"itemImageL\":\"\",\"itemImageXL\":\"\",\"catItemTitle\":\"1\",\"catItemTitleLinked\":\"1\",\"catItemFeaturedNotice\":\"0\",\"catItemAuthor\":\"1\",\"catItemDateCreated\":\"1\",\"catItemRating\":\"0\",\"catItemImage\":\"1\",\"catItemIntroText\":\"1\",\"catItemIntroTextWordLimit\":\"\",\"catItemExtraFields\":\"0\",\"catItemHits\":\"0\",\"catItemCategory\":\"1\",\"catItemTags\":\"1\",\"catItemAttachments\":\"0\",\"catItemAttachmentsCounter\":\"0\",\"catItemVideo\":\"0\",\"catItemVideoWidth\":\"\",\"catItemVideoHeight\":\"\",\"catItemAudioWidth\":\"\",\"catItemAudioHeight\":\"\",\"catItemVideoAutoPlay\":\"0\",\"catItemImageGallery\":\"0\",\"catItemDateModified\":\"0\",\"catItemReadMore\":\"1\",\"catItemCommentsAnchor\":\"1\",\"catItemK2Plugins\":\"1\",\"itemDateCreated\":\"1\",\"itemTitle\":\"1\",\"itemFeaturedNotice\":\"1\",\"itemAuthor\":\"1\",\"itemFontResizer\":\"1\",\"itemPrintButton\":\"1\",\"itemEmailButton\":\"1\",\"itemSocialButton\":\"1\",\"itemVideoAnchor\":\"1\",\"itemImageGalleryAnchor\":\"1\",\"itemCommentsAnchor\":\"1\",\"itemRating\":\"1\",\"itemImage\":\"1\",\"itemImgSize\":\"Large\",\"itemImageMainCaption\":\"1\",\"itemImageMainCredits\":\"1\",\"itemIntroText\":\"1\",\"itemFullText\":\"1\",\"itemExtraFields\":\"1\",\"itemDateModified\":\"1\",\"itemHits\":\"1\",\"itemCategory\":\"1\",\"itemTags\":\"1\",\"itemAttachments\":\"1\",\"itemAttachmentsCounter\":\"1\",\"itemVideo\":\"1\",\"itemVideoWidth\":\"\",\"itemVideoHeight\":\"\",\"itemAudioWidth\":\"\",\"itemAudioHeight\":\"\",\"itemVideoAutoPlay\":\"0\",\"itemVideoCaption\":\"1\",\"itemVideoCredits\":\"1\",\"itemImageGallery\":\"1\",\"itemNavigation\":\"1\",\"itemComments\":\"1\",\"itemTwitterButton\":\"1\",\"itemFacebookButton\":\"1\",\"itemGooglePlusOneButton\":\"1\",\"itemAuthorBlock\":\"1\",\"itemAuthorImage\":\"1\",\"itemAuthorDescription\":\"1\",\"itemAuthorURL\":\"1\",\"itemAuthorEmail\":\"0\",\"itemAuthorLatest\":\"1\",\"itemAuthorLatestLimit\":\"5\",\"itemRelated\":\"1\",\"itemRelatedLimit\":\"5\",\"itemRelatedTitle\":\"1\",\"itemRelatedCategory\":\"0\",\"itemRelatedImageSize\":\"0\",\"itemRelatedIntrotext\":\"0\",\"itemRelatedFulltext\":\"0\",\"itemRelatedAuthor\":\"0\",\"itemRelatedMedia\":\"0\",\"itemRelatedImageGallery\":\"0\",\"itemK2Plugins\":\"1\",\"catMetaDesc\":\"\",\"catMetaKey\":\"\",\"catMetaRobots\":\"\",\"catMetaAuthor\":\"\"}','*')
- Dominic Reid
Can't move Joomla Users to K2 User Groups
Category: English K2 Community
JDatabaseMySQL::query: 1136 - Column count doesn't match value count at row 1 SQL=INSERT INTO r86h3_k2_users VALUES ('', 683, '02JJbarbie', '', '', '', '', 4, '')
- Dominic Reid
Can't move Joomla Users to K2 User Groups
Category: English K2 Community
# Function Location
1 JAdministrator->dispatch() /var/www/joomla/administrator/index.php:46
2 JComponentHelper::renderComponent() /var/www/joomla/administrator/includes/application.php:153
3 JComponentHelper::executeComponent() /var/www/joomla/libraries/joomla/application/component/helper.php:351
4 require_once() /var/www/joomla/libraries/joomla/application/component/helper.php:383
5 JController->execute() /var/www/joomla/administrator/components/com_k2/admin.k2.php:123
6 K2ControllerUsers->saveMove() /var/www/joomla/libraries/joomla/application/component/controller.php:760
7 K2ModelUsers->saveMove() /var/www/joomla/administrator/components/com_k2/controllers/users.php:70
8 JDatabase->query() /var/www/joomla/administrator/components/com_k2/models/users.php:393
9 JDatabaseMySQL->execute() /var/www/joomla/libraries/joomla/database/database.php:1253
10 JError::raiseError() /var/www/joomla/libraries/joomla/database/database/mysql.php:548
11 JError::raise() /var/www/joomla/libraries/joomla/error/error.php:251
- Lefteris
K2 Items Not Showing In Front End
Category: English K2 Community
- citydan
K2 Items Not Showing In Front End
Category: English K2 Community
I have created menu items for K2 category view, K2 tag view and K2 Item view, but can not see any K2 content in the front-end of the site.
I have also created a joomla article and can't get it to show either. I've never seen this before and this is my 15th joomla site.
I don't get any errors, just blank pages. I can see all my content as expected in the back-end.
Caching is off.
I thought it might be a timezone problem, so I changed the created and published dates of my items and an article to 3 days ago, but it didn't help.
All K2 plugins are published.
I'm using Joomla 2.5.6
K2 v2.5.7
Web Server Apache
PHP version 5.2.17
MySQL version 5.0.92-log
Memory limit 128M
Any ideas on what else to check?
- iChris
Hello ! K2 Error + blank page
Category: English K2 Community
Hello,
Christian, from Belgium. I use K2 for a long time, it is the only good free tool to manage an item. Thank you!
I would contact you because I have a problem with K2.
I develop a Joomla extension that I want the system compatible with K2, because I think your brilliant concept!
Articles must be imported into K2 from an external source.
Currently, the import completes successfully but in FRONTEND, I get this error: "Fatal error: Call to undefined method K2ModelItem :: getUserProfile () in / home/www/fashion/components/com_k2/helpers/utilities.php it line 63 "and a blank page.
I use the class ". ModelItem :: save" slightly modified. (Item entire model is imported into the extension).
In the database, everything seems OK (I compared with native recording) FRONTEND but nothing works.
Could you help me and tell me what I missed please?
Thanking you in advance.
Here k2 modified class I use:
function save($front = false, $toStore)
{
$mainframe = &JFactory::getApplication();
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.archive');
require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'lib'.DS.'class.upload.php');
$db = &JFactory::getDBO();
$user = &JFactory::getUser();
$row = &JTable::getInstance('K2Item', 'Table');
$params = &JComponentHelper::getParams('com_k2');
$nullDate = $db->getNullDate();
define( 'K2_JVERSION', '16' );
$jpath = JPATH_SITE.DS.'components'.DS.'com_k2';
define( 'JPATH_COMPONENT', $jpath );
if (!$row->bind($toStore))
{
$mainframe->redirect('index.php?option=com_k2&view=items', $row->getError(), 'error');
}
if ($front && $row->id == NULL)
{
JLoader::register('K2HelperPermissions', JPATH_SITE.DS.'components'.DS.'com_k2'.DS.'helpers'.DS.'permissions.php');
if (!K2HelperPermissions::canAddItem($row->catid))
{
$mainframe->redirect('index.php?option=com_k2&view=item&task=add&tmpl=component', JText::_('K2_YOU_ARE_NOT_ALLOWED_TO_POST_TO_THIS_CATEGORY_SAVE_FAILED'), 'error');
}
}
($row->id) ? $isNew = false : $isNew = true;
if ($params->get('mergeEditors'))
{
$text = $row->introtext;
if ($params->get('xssFiltering'))
{
$filter = new JFilterInput( array(), array(), 1, 1, 0);
$text = $filter->clean($text);
}
$pattern = '#<hr\s+id=("|\')system-readmore("|\')\s*\/*>#i';
$tagPos = preg_match($pattern, $text);
if ($tagPos == 0)
{
$row->introtext = $text;
$row->fulltext = '';
}
else
list($row->introtext, $row->fulltext) = preg_split($pattern, $text, 2);
}
else
{
$row->introtext = JRequest::getVar('introtext', '', 'post', 'string', 2);
$row->fulltext = JRequest::getVar('fulltext', '', 'post', 'string', 2);
if ($params->get('xssFiltering'))
{
$filter = new JFilterInput( array(), array(), 1, 1, 0);
$row->introtext = $filter->clean($row->introtext);
$row->fulltext = $filter->clean($row->fulltext);
}
}
if ($row->id)
{
$datenow = &JFactory::getDate();
$row->modified = $datenow->toMySQL();
$row->modified_by = $user->get('id');
}
else
{
$row->ordering = $row->getNextOrder("catid = {$row->catid} AND trash = 0");
if ($row->featured)
$row->featured_ordering = $row->getNextOrder("featured = 1 AND trash = 0", 'featured_ordering');
}
$row->created_by = $row->created_by ? $row->created_by : $user->get('id');
if ($front)
{
$K2Permissions = &K2Permissions::getInstance();
if (!$K2Permissions->permissions->get('editAll'))
{
$row->created_by = $user->get('id');
}
}
if ($row->created && strlen(trim($row->created)) <= 10)
{
$row->created .= ' 00:00:00';
}
$config = &JFactory::getConfig();
$tzoffset = $config->getValue('config.offset');
$date = &JFactory::getDate($row->created, $tzoffset);
$row->created = $date->toMySQL();
if (strlen(trim($row->publish_up)) <= 10)
{
$row->publish_up .= ' 00:00:00';
}
$date = &JFactory::getDate($row->publish_up, $tzoffset);
$row->publish_up = $date->toMySQL();
if (trim($row->publish_down) == JText::_('K2_NEVER') || trim($row->publish_down) == '')
{
$row->publish_down = $nullDate;
}
else
{
if (strlen(trim($row->publish_down)) <= 10)
{
$row->publish_down .= ' 00:00:00';
}
$date = &JFactory::getDate($row->publish_down, $tzoffset);
$row->publish_down = $date->toMySQL();
}
$metadata = JRequest::getVar('meta', null, 'post', 'array');
if (is_array($metadata))
{
$txt = array();
foreach ($metadata as $k => $v)
{
if ($k == 'description')
{
$row->metadesc = $v;
}
elseif ($k == 'keywords')
{
$row->metakey = $v;
}
else
{
$txt[] = "$k=$v";
}
}
$row->metadata = implode("\n", $txt);
}
if (!$row->check())
{
$mainframe->redirect('index.php?option=com_k2&view=item&cid='.$row->id, $row->getError(), 'error');
}
$dispatcher = &JDispatcher::getInstance();
JPluginHelper::importPlugin('k2');
$result = $dispatcher->trigger('onBeforeK2Save', array(&$row, $isNew));
if (in_array(false, $result, true))
{
JError::raiseError(500, $row->getError());
return false;
}
//Trigger the finder before save event
$dispatcher = JDispatcher::getInstance();
JPluginHelper::importPlugin('finder');
$results = $dispatcher->trigger('onFinderBeforeSave', array('com_k2.item', $row, $isNew));
// Try to save the video if there is no need to wait for item ID
if (!JRequest::getBool('del_video'))
{
if (!isset($files))
{
if (JRequest::getVar('remoteVideo'))
{
$fileurl = JRequest::getVar('remoteVideo');
$filetype = JFile::getExt($fileurl);
$row->video = '{'.$filetype.'remote}'.$fileurl.'{/'.$filetype.'remote}';
}
if (JRequest::getVar('videoID'))
{
$provider = JRequest::getWord('videoProvider');
$videoID = JRequest::getVar('videoID');
$row->video = '{'.$provider.'}'.$videoID.'{/'.$provider.'}';
}
if (JRequest::getVar('embedVideo', '', 'post', 'string', JREQUEST_ALLOWRAW))
{
$row->video = JRequest::getVar('embedVideo', '', 'post', 'string', JREQUEST_ALLOWRAW);
}
}
}
// JoomFish! Front-end editing compatibility
if ($mainframe->isSite() && JFile::exists(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_joomfish'.DS.'joomfish.php'))
{
if (version_compare(phpversion(), '5.0') < 0)
{
$tmpRow = $row;
}
else
{
$tmpRow = clone($row);
}
}
if (!$row->store())
{
$mainframe->redirect('index.php?option=com_k2&view=items', $row->getError(), 'error');
}
// JoomFish! Front-end editing compatibility
if ($mainframe->isSite() && JFile::exists(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_joomfish'.DS.'joomfish.php'))
{
$itemID = $row->id;
$row = $tmpRow;
$row->id = $itemID;
}
if (!$params->get('disableCompactOrdering'))
{
$row->reorder("catid = {$row->catid} AND trash = 0");
}
if ($row->featured && !$params->get('disableCompactOrdering'))
{
$row->reorder("featured = 1 AND trash = 0", 'featured_ordering');
}
$files = JRequest::get('files');
//Image
if ((int)$params->get('imageMemoryLimit'))
{
ini_set('memory_limit', (int)$params->get('imageMemoryLimit').'M');
}
$existingImage = JRequest::getVar('existingImage');
if (($files === 0 || $existingImage) && !JRequest::getBool('del_image'))
{
if ($files === 0)
{
$image = $files;
}
else
{
$image = JPATH_SITE.DS.JPath::clean($existingImage);
}
$handle = new Upload($image);
$handle->allowed = array('image/*');
if ($handle->uploaded)
{
//Image params
$category = &JTable::getInstance('K2Category', 'Table');
$category->load($row->catid);
$cparams = new JParameter($category->params);
if ($cparams->get('inheritFrom'))
{
$masterCategoryID = $cparams->get('inheritFrom');
$query = "SELECT * FROM #__k2_categories WHERE id=".(int)$masterCategoryID;
$db->setQuery($query, 0, 1);
$masterCategory = $db->loadObject();
$cparams = new JParameter($masterCategory->params);
}
$params->merge($cparams);
//Original image
$savepath = JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'src';
$handle->image_convert = 'jpg';
$handle->jpeg_quality = 100;
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = md5("Image".$row->id);
$handle->Process($savepath);
$filename = $handle->file_dst_name_body;
$savepath = JPATH_SITE.DS.'media'.DS.'k2'.DS.'items'.DS.'cache';
//XLarge image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_XL';
if (JRequest::getInt('itemImageXL'))
{
$imageWidth = JRequest::getInt('itemImageXL');
}
else
{
$imageWidth = $params->get('itemImageXL', '800');
}
$handle->image_x = $imageWidth;
$handle->Process($savepath);
//Large image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_L';
if (JRequest::getInt('itemImageL'))
{
$imageWidth = JRequest::getInt('itemImageL');
}
else
{
$imageWidth = $params->get('itemImageL', '600');
}
$handle->image_x = $imageWidth;
$handle->Process($savepath);
//Medium image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_M';
if (JRequest::getInt('itemImageM'))
{
$imageWidth = JRequest::getInt('itemImageM');
}
else
{
$imageWidth = $params->get('itemImageM', '400');
}
$handle->image_x = $imageWidth;
$handle->Process($savepath);
//Small image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_S';
if (JRequest::getInt('itemImageS'))
{
$imageWidth = JRequest::getInt('itemImageS');
}
else
{
$imageWidth = $params->get('itemImageS', '200');
}
$handle->image_x = $imageWidth;
$handle->Process($savepath);
//XSmall image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_XS';
if (JRequest::getInt('itemImageXS'))
{
$imageWidth = JRequest::getInt('itemImageXS');
}
else
{
$imageWidth = $params->get('itemImageXS', '100');
}
$handle->image_x = $imageWidth;
$handle->Process($savepath);
//Generic image
$handle->image_resize = true;
$handle->image_ratio_y = true;
$handle->image_convert = 'jpg';
$handle->jpeg_quality = $params->get('imagesQuality');
$handle->file_auto_rename = false;
$handle->file_overwrite = true;
$handle->file_new_name_body = $filename.'_Generic';
$imageWidth = $params->get('itemImageGeneric', '300');
$handle->image_x = $imageWidth;
$handle->Process($savepath);
if ($files === 0)
$handle->Clean();
}
else
{
$mainframe->redirect('index.php?option=com_k2&view=items', $handle->error, 'error');
}
}
if (JRequest::getBool('del_image'))
{
$current = &JTable::getInstance('K2Item', 'Table');
$current->load($row->id);
$filename = md5("Image".$current->id);
if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'src'.DS.$filename.'.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'src'.DS.$filename.'.jpg');
}
if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_XS.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_XS.jpg');
}
if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_S.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_S.jpg');
}
if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_M.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_M.jpg');
}
if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_L.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_L.jpg');
}
if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_XL.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_XL.jpg');
}
if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_Generic.jpg'))
{
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'items'.DS.'cache'.DS.$filename.'_Generic.jpg');
}
$row->image_caption = '';
$row->image_credits = '';
}
//Attachments
$attachments = JRequest::getVar('attachment_file', NULL, 'FILES', 'array');
$attachments_names = JRequest::getVar('attachment_name', '', 'POST', 'array');
$attachments_titles = JRequest::getVar('attachment_title', '', 'POST', 'array');
$attachments_title_attributes = JRequest::getVar('attachment_title_attribute', '', 'POST', 'array');
$attachments_existing_files = JRequest::getVar('attachment_existing_file', '', 'POST', 'array');
$attachmentFiles = array();
if (count($attachments))
{
foreach ($attachments as $k => $l)
{
foreach ($l as $i => $v)
{
if (!array_key_exists($i, $attachmentFiles))
$attachmentFiles[$i] = array();
$attachmentFiles[$i][$k] = $v;
}
}
$path = $params->get('attachmentsFolder', NULL);
if (is_null($path))
{
$savepath = JPATH_ROOT.DS.'media'.DS.'k2'.DS.'attachments';
}
else
{
$savepath = $path;
}
$counter = 0;
foreach ($attachmentFiles as $key => $file)
{
if ($file["tmp_name"] || $attachments_existing_files[$key])
{
$attachmentCleanUpFlag = true;
if ($attachments_existing_files[$key])
{
$file = JPATH_SITE.DS.JPath::clean($attachments_existing_files[$key]);
$attachmentCleanUpFlag = false;
}
$handle = new Upload($file);
if ($handle->uploaded)
{
$handle->file_auto_rename = true;
$handle->allowed[] = 'application/x-zip';
$handle->allowed[] = 'application/download';
$handle->Process($savepath);
$filename = $handle->file_dst_name;
if ($attachmentCleanUpFlag)
{
$handle->Clean();
}
$attachment = &JTable::getInstance('K2Attachment', 'Table');
$attachment->itemID = $row->id;
$attachment->filename = $filename;
$attachment->title = ( empty($attachments_titles[$counter])) ? $filename : $attachments_titles[$counter];
$attachment->titleAttribute = ( empty($attachments_title_attributes[$counter])) ? $filename : $attachments_title_attributes[$counter];
$attachment->store();
}
else
{
$mainframe->redirect('index.php?option=com_k2&view=items', $handle->error, 'error');
}
}
$counter++;
}
}
//Gallery
$flickrGallery = JRequest::getVar('flickrGallery');
if ($flickrGallery)
{
$row->gallery = '{gallery}'.$flickrGallery.'{/gallery}';
}
if (isset($files) && $files == 0 && !JRequest::getBool('del_gallery'))
{
$handle = new Upload($files);
$handle->file_auto_rename = true;
$savepath = JPATH_ROOT.DS.'media'.DS.'k2'.DS.'galleries';
$handle->allowed = array("application/download", "application/rar", "application/x-rar-compressed", "application/arj", "application/gnutar", "application/x-bzip", "application/x-bzip2", "application/x-compressed", "application/x-gzip", "application/x-zip-compressed", "application/zip", "multipart/x-zip", "multipart/x-gzip", "application/x-unknown", "application/x-zip");
if ($handle->uploaded)
{
$handle->Process($savepath);
$handle->Clean();
if (JFolder::exists($savepath.DS.$row->id))
{
JFolder::delete($savepath.DS.$row->id);
}
if (!JArchive::extract($savepath.DS.$handle->file_dst_name, $savepath.DS.$row->id))
{
$mainframe->redirect('index.php?option=com_k2&view=items', JText::_('K2_GALLERY_UPLOAD_ERROR_CANNOT_EXTRACT_ARCHIVE'), 'error');
}
else
{
$row->gallery = '{gallery}'.$row->id.'{/gallery}';
}
JFile::delete($savepath.DS.$handle->file_dst_name);
$handle->Clean();
}
else
{
$mainframe->redirect('index.php?option=com_k2&view=items', $handle->error, 'error');
}
}
if (JRequest::getBool('del_gallery'))
{
$current = &JTable::getInstance('K2Item', 'Table');
$current->load($row->id);
if (JFolder::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'galleries'.DS.$current->id))
{
JFolder::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'galleries'.DS.$current->id);
}
$row->gallery = '';
}
//Video
if (!JRequest::getBool('del_video'))
{
if (isset($files) && $files == 0)
{
$videoExtensions = array("flv", "mp4", "ogv", "webm", "f4v", "m4v", "3gp", "3g2", "mov", "mpeg", "mpg", "avi", "wmv", "divx");
$audioExtensions = array("mp3", "aac", "m4a", "ogg", "wma");
$validExtensions = array_merge($videoExtensions, $audioExtensions);
$filetype = JFile::getExt($files);
if (!in_array($filetype, $validExtensions))
{
$mainframe->redirect('index.php?option=com_k2&view=items', JText::_('K2_INVALID_VIDEO_FILE'), 'error');
}
if (in_array($filetype, $videoExtensions))
{
$savepath = JPATH_ROOT.DS.'media'.DS.'k2'.DS.'videos';
}
else
{
$savepath = JPATH_ROOT.DS.'media'.DS.'k2'.DS.'audio';
}
$filename = JFile::stripExt($files);
JFile::upload($files, $savepath.DS.$row->id.'.'.$filetype);
$filetype = JFile::getExt($files);
$row->video = '{'.$filetype.'}'.$row->id.'{/'.$filetype.'}';
}
}
else
{
$current = &JTable::getInstance('K2Item', 'Table');
$current->load($row->id);
preg_match_all("#^{(.*?)}(.*?){#", $current->video, $matches, PREG_PATTERN_ORDER);
$videotype = $matches[1][0];
$videofile = $matches[2][0];
if (in_array($videotype, $videoExtensions))
{
if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'videos'.DS.$videofile.'.'.$videotype))
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'videos'.DS.$videofile.'.'.$videotype);
}
if (in_array($videotype, $audioExtensions))
{
if (JFile::exists(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'audio'.DS.$videofile.'.'.$videotype))
JFile::delete(JPATH_ROOT.DS.'media'.DS.'k2'.DS.'audio'.DS.$videofile.'.'.$videotype);
}
$row->video = '';
$row->video_caption = '';
$row->video_credits = '';
}
//Extra fields
$objects = array();
$variables = JRequest::get('post', 4);
foreach ($variables as $key => $value)
{
if (( bool )JString::stristr($key, 'K2ExtraField_'))
{
$object = new JObject;
$object->set('id', JString::substr($key, 13));
$object->set('value', $value);
unset($object->_errors);
$objects[] = $object;
}
}
$csvFiles = JRequest::get('files');
foreach ($csvFiles as $key => $file)
{
if (( bool )JString::stristr($key, 'K2ExtraField_'))
{
$object = new JObject;
$object->set('id', JString::substr($key, 13));
$csvFile = $file[0];
if (!empty($csvFile) && JFile::getExt($file[0]) == 'csv')
{
$handle = @fopen($csvFile, 'r');
$csvData = array();
while (($data = fgetcsv($handle, 1000)) !== FALSE)
{
$csvData[] = $data;
}
fclose($handle);
$object->set('value', $csvData);
}
else
{
require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'lib'.DS.'JSON.php');
$json = new Services_JSON;
$object->set('value', $json->decode(JRequest::getVar('K2CSV_'.$object->id)));
if (JRequest::getBool('K2ResetCSV_'.$object->id))
$object->set('value', null);
}
unset($object->_errors);
$objects[] = $object;
}
}
require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'lib'.DS.'JSON.php');
$json = new Services_JSON;
$row->extra_fields = $json->encode($objects);
require_once (JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'models'.DS.'extrafield.php');
$extraFieldModel = new K2ModelExtraField;
$row->extra_fields_search = '';
foreach ($objects as $object)
{
$row->extra_fields_search .= $extraFieldModel->getSearchValue($object->id, $object->value);
$row->extra_fields_search .= ' ';
}
//Tags
if ($user->gid < 24 && $params->get('lockTags'))
$params->set('taggingSystem', 0);
$db = &JFactory::getDBO();
$query = "DELETE FROM #__k2_tags_xref WHERE itemID={intval($row->id)}";
$db->setQuery($query);
$db->query();
if ($params->get('taggingSystem'))
{
if ($user->gid < 24 && $params->get('lockTags'))
JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
$tags = JRequest::getVar('tags', NULL, 'POST', 'array');
if (count($tags))
{
$tags = array_unique($tags);
foreach ($tags as $tag)
{
$tag = str_replace('-', '', $tag);
$query = "SELECT id FROM #__k2_tags WHERE name=".$db->Quote($tag);
$db->setQuery($query);
$tagID = $db->loadResult();
if ($tagID)
{
$query = "INSERT INTO #__k2_tags_xref (`id`, `tagID`, `itemID`) VALUES (NULL, {intval($tagID)}, {intval($row->id)})";
$db->setQuery($query);
$db->query();
}
else
{
$K2Tag = &JTable::getInstance('K2Tag', 'Table');
$K2Tag->name = $tag;
$K2Tag->published = 1;
$K2Tag->check();
$K2Tag->store();
$query = "INSERT INTO #__k2_tags_xref (`id`, `tagID`, `itemID`) VALUES (NULL, {intval($K2Tag->id)}, {intval($row->id)})";
$db->setQuery($query);
$db->query();
}
}
}
}
else
{
$tags = JRequest::getVar('selectedTags', NULL, 'POST', 'array');
if (count($tags))
{
foreach ($tags as $tagID)
{
$query = "INSERT INTO #__k2_tags_xref (`id`, `tagID`, `itemID`) VALUES (NULL, {intval($tagID)}, {intval($row->id)})";
$db->setQuery($query);
$db->query();
}
}
}
if ($front)
{
if (!K2HelperPermissions::canPublishItem($row->catid) && $row->published)
{
$row->published = 0;
$mainframe->enqueueMessage(JText::_('K2_YOU_DONT_HAVE_THE_PERMISSION_TO_PUBLISH_ITEMS'), 'notice');
}
}
$query = "UPDATE #__k2_items SET
video_caption = ".$db->Quote($row->video_caption).",
video_credits = ".$db->Quote($row->video_credits).", ";
if (!is_null($row->video))
{
$query .= " video = ".$db->Quote($row->video).", ";
}
if (!is_null($row->gallery))
{
$query .= " gallery = ".$db->Quote($row->gallery).", ";
}
$query .= " extra_fields = ".$db->Quote($row->extra_fields).",
extra_fields_search = ".$db->Quote($row->extra_fields_search)." ,
published = ".$db->Quote($row->published)."
WHERE id = ".$row->id;
$db->setQuery($query);
if (!$db->query())
{
$mainframe->redirect('index.php?option=com_k2&view=items', $db->getErrorMsg(), 'error');
}
$row->checkin();
$cache = &JFactory::getCache('com_k2');
$cache->clean();
$dispatcher->trigger('onAfterK2Save', array(&$row, $isNew));
if (K2_JVERSION == '16')
{
$dispatcher->trigger('onContentAfterSave', array(&$row, $isNew));
}
else
{
$dispatcher->trigger('onAfterContentSave', array(&$row, $isNew));
}
//Trigger the finder after save event
$dispatcher = JDispatcher::getInstance();
JPluginHelper::importPlugin('finder');
$results = $dispatcher->trigger('onFinderAfterSave', array('com_k2.item', $row, $isNew));
switch (JRequest::getCmd('task'))
{
case 'apply' :
$msg = JText::_('K2_CHANGES_TO_ITEM_SAVED');
$link = 'index.php?option=com_k2&view=item&cid='.$row->id;
break;
case 'saveAndNew' :
$msg = JText::_('K2_ITEM_SAVED');
$link = 'index.php?option=com_k2&view=item';
break;
case 'save' :
default :
$msg = JText::_('K2_ITEM_SAVED');
if ($front)
$link = 'index.php?option=com_k2&view=item&task=edit&cid='.$row->id.'&tmpl=component&Itemid='.JRequest::getInt('Itemid');
else
$link = 'index.php?option=com_k2&view=items';
break;
}
return $row->id;
}
- serchmon
[Solved] gallery does not work
Category: Simple Image Gallery PRO
'm repeating myself but I tried everything you have said and I have not succeeded in solving the problem
www.restaurantesdeadeje.com/torito/es/galeria.html
There was a problem rendering your image gallery. Please make sure that the folder you are using in the Simple Image Gallery Pro plugin tags exists and contains valid image files. The plugin could not locate the folder: images/stories/galeria
Database: Mysqli
Joomla: 1.5.26
Simple Gallery Pro 2.5.7
permissions folder
image 777
stories 777
galeria 777
in article
{gallery}galeria{/gallery}
thanks
- knd
[Solved] Unknown Archive Type - Gallery upload error. Cannot extract archive
Category: Simple Image Gallery PRO
I changed my joomla folder, and after that everything works, except the Gallery inside de K2 items.
When I had a ZIP (tried to create the file with winrar, 7zip) I get an error:
"
Unknown Archive Type
Gallery upload error. Cannot extract archive.
"
The other galleries I've add before changing the folders, are still working. But now I can't add new files to any gallery.
PHP version 5.2.17
MySQL version 5.0.92-community-log
GD image library bundled (2.0.34 compatible)
Multibyte string support Enabled
Upload limit 20M
Memory limit 256M
Open remote files (allow url fopen) Yes
Directory permissionsCheck Result
media/k2 Writable
media/k2/attachments Writable
media/k2/categories Writable
media/k2/galleries Writable
media/k2/items Writable
media/k2/users Writable
media/k2/videos Writable
cache Writable
K2 ModulesCheck Result
mod_k2_comments Installed
mod_k2_content Installed
mod_k2_login Installed
mod_k2_tools Installed
mod_k2_user Installed
mod_k2_users Installed
mod_k2_quickicons (administrator) Installed
mod_k2_stats (administrator) Installed
K2 PluginsCheck Result
System - K2 Installed - Enabled
User - K2 Installed - Enabled
Search - K2 Installed - Enabled
Third-party ExtensionsCheck Result
AllVideos (plugin) Not Installed
Simple Image Gallery Pro (plugin) Installed
K2 v2.5.4 | Copyright © 2006-2011 JoomlaWorks Ltd.
Thank you for all help