Keyword

Copy a new item in two tables

  • greenslot
  • greenslot's Avatar Topic Author
  • Offline
  • New Member
More
13 years 5 months ago #91290 by greenslot
Copy a new item in two tables was created by greenslot
Hi,I am searching for the INSERT statement for a new item in the k2_item table.I would like to create a copy of some details that ends up in another table.Please excuse my bad english! :)

Please Log in or Create an account to join the conversation.

More
13 years 5 months ago #91291 by Jiliko.net
Replied by Jiliko.net on topic Copy a new item in two tables
Hi Greenslot,

Here's an example of an insert query for the #__k2_items table :

INSERT INTO `dev_k2_items` (`id`, `title`, `alias`, `catid`, `published`, `introtext`, `fulltext`, `video`, `gallery`, `extra_fields`, `extra_fields_search`, `created`, `created_by`, `created_by_alias`, `checked_out`, `checked_out_time`, `modified`, `modified_by`, `publish_up`, `publish_down`, `trash`, `access`, `ordering`, `featured`, `featured_ordering`, `image_caption`, `image_credits`, `video_caption`, `video_credits`, `hits`, `params`, `metadesc`, `metadata`, `metakey`, `plugins`) VALUES
(1, 'Welcome to Joomla!', 'welcome-to-joomla', 5, 1, 'Joomla! is a free open source framework and content publishing system designed for quickly creating highly interactive multi-language Web sites, online communities, media portals, blogs and eCommerce applications.
Joomla! provides an easy-to-use graphical user interface that simplifies the management and publishing of large volumes of content including HTML, documents, and rich media. Joomla! is used by organisations of all sizes for intranets and extranets and is supported by a community of tens of thousands of users.

', 'With a fully documented library of developer resources, Joomla! allows the customisation of every aspect of a Web site including presentation, layout, administration, and the rapid integration with third-party applications.Joomla! now provides more developer power while making the user experience all the more friendly. For those who always wanted increased extensibility, Joomla! 1.5 can make this happen.

A new framework, ground-up refactoring, and a highly-active development team brings the excitement of ''the next generation CMS'' to your fingertips. Whether you are a systems architect or a complete ''noob'' Joomla! can take you to the next level of content delivery. ''More than a CMS'' is something we have been playing with as a catchcry because the new Joomla! API has such incredible power and flexibility, you are free to take whatever direction your creative mind takes you and Joomla! can help you get there so much more easily than ever before.

Thinking Web publishing? Think Joomla!

', NULL, NULL, NULL, '', '2008-08-12 10:00:00', 62, '', 0, '0000-00-00 00:00:00', '2008-08-12 10:00:00', 62, '2006-01-03 01:00:00', '0000-00-00 00:00:00', 0, 0, 1, 0, 0, '', '', '', '', 92, 'catItemTitle=\ncatItemTitleLinked=\ncatItemFeaturedNotice=\ncatItemAuthor=\ncatItemDateCreated=\ncatItemRating=\ncatItemImage=\ncatItemIntroText=\ncatItemExtraFields=\ncatItemHits=\ncatItemCategory=\ncatItemTags=\ncatItemAttachments=\ncatItemAttachmentsCounter=\ncatItemVideo=\ncatItemVideoWidth=\ncatItemVideoHeight=\ncatItemVideoAutoPlay=\ncatItemImageGallery=\ncatItemDateModified=\ncatItemReadMore=\ncatItemCommentsAnchor=\n =Advanced\ncatItemK2Plugins=\nitemDateCreated=\nitemTitle=\nitemFeaturedNotice=\nitemAuthor=\nitemFontResizer=\nitemPrintButton=\nitemEmailButton=\nitemSocialButton=\nitemVideoAnchor=\nitemImageGalleryAnchor=\nitemCommentsAnchor=\nitemRating=\nitemImage=\nitemImgSize=\nitemImageMainCaption=\nitemImageMainCredits=\nitemIntroText=\nitemFullText=\nitemExtraFields=\nitemDateModified=\nitemHits=\nitemTwitterLink=\nitemCategory=\nitemTags=\nitemShareLinks=\nitemAttachments=\nitemAttachmentsCounter=\nitemRelated=\nitemRelatedLimit=\nitemVideo=\nitemVideoWidth=\nitemVideoHeight=\nitemVideoAutoPlay=\nitemVideoCaption=\nitemVideoCredits=\nitemImageGallery=\nitemNavigation=\nitemComments=\nitemAuthorBlock=\nitemAuthorImage=\nitemAuthorDescription=\nitemAuthorURL=\nitemAuthorEmail=\nitemAuthorLatest=\nitemAuthorLatestLimit=\nitemK2Plugins=\n\n', '', 'robots=\nauthor=', '', '');
Olivier

Please Log in or Create an account to join the conversation.

  • greenslot
  • greenslot's Avatar Topic Author
  • Offline
  • New Member
More
13 years 5 months ago #91292 by greenslot
Replied by greenslot on topic Copy a new item in two tables
Hi,
in which file is the INSERT statement?
So that I can add there another INSERT statement.

Please Log in or Create an account to join the conversation.

More
13 years 5 months ago #91293 by Jiliko.net
Replied by Jiliko.net on topic Copy a new item in two tables
Greenslot,

Sorry, misunderstood your first post.

the insert item is done in this file :
'administrator/components/com_k2/models/item.php' in the save function

The best way top do what you want to do is to create a K2 plugin that intercept the item save event and do what you want in this plugin : sql queries and other things...

This avoids K2 core files modifications and so K2 updates problems.

Olivier


greenslot said:Hi, in which file is the INSERT statement?
So that I can add there another INSERT statement.

Please Log in or Create an account to join the conversation.

  • greenslot
  • greenslot's Avatar Topic Author
  • Offline
  • New Member
More
13 years 5 months ago #91294 by greenslot
Replied by greenslot on topic Copy a new item in two tables
Oh, I don't know how to create such a plugin.
And I also don't find the correct place in the item.php to place an new INSERT statement.
I will only a INSERT statement of some details in a other table. Thats all.

Can you help to place the INSERT statement in the item.php only for new items.

I will add the details in the venues table of eventlist. There is no plugin for?

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum