0
Welcome Guest! Login
0 items Join Now

SOLVED RokSprocket: adding items with SQL query directly in MySQL

  • SOLVED RokSprocket: adding items with SQL query directly in MySQL

    Posted 9 years 11 months ago
    • I need to add a lot of items to a RokSprocket module, I thought to add these items using phpmyadmin and running an sql query to directly writing data into MySQL database, but I can't correctly insert these data infacts what I write into the database is not shown in module view.

      Is it possible?

      Best regards
      Alessandro "gallus" Gallieri
    • Who?'s Avatar
    • Who?
    • Preeminent Rocketeer
    • Posts: 25562
    • Thanks: 613
    • Joomla freelancer

    Re: SOLVED RokSprocket: adding items with SQL query directly in MySQL

    Posted 9 years 11 months ago
    • That is not possible. Why don't you create those articles in some category and then filter that category in RokSprocket? All items from that category will be added automatically
    • Check my services at: Mihha-Vision
  • Re: SOLVED RokSprocket: adding items with SQL query directly in MySQL

    Posted 9 years 11 months ago
    • Dear Igor,
      I solved my problem with this insert query:


      INSERT INTO `jdbprefix_roksprocket_items` (`id`, `module_id`, `provider`, `provider_id`, `order`, `params`) VALUES
      (null, '1234', 'simple', '1', 0, '{"_article_title":"Simple Item 1","mosaic_item_title":"-none-","mosaic_item_description":"<a data-rokbox=\\"\\" href=\\"\\/images\\/myfolder\\/myFirstPicture.png\\" data-rokbox-album=\\"myAlbum\\">\\n    <img class=\\"rt-image\\" src=\\"\\/images\\/myfolder\\/myFirstPicture.png\\">\\n<\\/a>","mosaic_item_image":"-default-","mosaic_item_link":"-default-","mosaic_item_tags":"myTag","tabs_item_title":"-default-","lists_item_title":"-default-","strips_item_title":"-default-","tabs_item_icon":"-default-","tabs_item_link":"-default-","strips_item_image":"-default-","lists_item_image":"-default-","strips_item_link":"-default-","lists_item_link":"-default-","tabs_item_description":"-default-","features_item_title":"-default-","lists_item_description":"-default-","headlines_item_image":"-default-","features_item_description":"-default-","strips_item_description":"-default-","features_item_image":"-default-","headlines_item_link":"-default-","headlines_item_description":"-default-","features_item_link":"-default-"}'),
      (null, '1234', 'simple', '2', 1, '{"_article_title":"Simple Item 2","mosaic_item_title":"-none-","mosaic_item_description":"<a data-rokbox=\\"\\" href=\\"\\/images\\/myfolder\\/myFirstPicture.png\\" data-rokbox-album=\\"myAlbum\\">\\n    <img class=\\"rt-image\\" src=\\"\\/images\\/myfolder\\/mySecondPicture.png\\">\\n<\\/a>","mosaic_item_image":"-default-","mosaic_item_link":"-default-","mosaic_item_tags":"myTag","tabs_item_title":"-default-","lists_item_title":"-default-","strips_item_title":"-default-","tabs_item_icon":"-default-","tabs_item_link":"-default-","strips_item_image":"-default-","lists_item_image":"-default-","strips_item_link":"-default-","lists_item_link":"-default-","tabs_item_description":"-default-","features_item_title":"-default-","lists_item_description":"-default-","headlines_item_image":"-default-","features_item_description":"-default-","strips_item_description":"-default-","features_item_image":"-default-","headlines_item_link":"-default-","headlines_item_description":"-default-","features_item_link":"-default-"}');

      The only thing that is important to understand is: the module_id and that PRIMARY KEY (`id`), KEY `idx_module` (`module_id`), KEY `idx_module_order` (`module_id`,`order`)

      I can generate this query with a script and populating the db looking the content of a folder. Now I have to manage 148 items and with that sql query I did in one time instead of repeat n times the same thing. It was not possible for me to use articles.

      I share with you my solution and I hope could be usefull someone else if I will find a way to optimize everything I will suggest.

      Regards
      Alessandro "gallus" Gallieri
    • Who?'s Avatar
    • Who?
    • Preeminent Rocketeer
    • Posts: 25562
    • Thanks: 613
    • Joomla freelancer

    Re: SOLVED RokSprocket: adding items with SQL query directly in MySQL

    Posted 9 years 11 months ago
    • Thank you for your contribution
    • Check my services at: Mihha-Vision

Time to create page: 0.051 seconds