Alejandro Posted August 17, 2018 at 02:06 PM Share Posted August 17, 2018 at 02:06 PM Here's something you can try to programmatically create listings from other extensions/plugins: <?php // Load the JReviews framework require_once JPATH_BASE.'/components/com_jreviews/jreviews/framework.php'; // Set the form token $_POST[cmsFramework::getToken()] = 1; // Let the framework know the code is accessed directly so it suppresses output headers $_REQUEST['requested'] = 1; // Build the request data $params = []; // Routing data $params['data']['controller'] = 'listings'; $params['data']['action'] = '_save'; // Ensure that the form passes the consent checkbox validation if it's enabled $params['data']['consent'] = true; // Add the standard fields // Catid is required and must be a JReviews category, title is required if not disabled $params['data']['Listing'] = [ 'catid' => 23, 'title' => 'Programatically submitted listing', 'introtext' => '<p>This is the listing summary.</p>', 'fulltext' => '<p>This is the listing description.</p>', ]; // Add the custom field data // For select,radio,checkbox fields, use the field option values // Checkbox and multiselect fields need to use array inputs $params['data']['Field']['Listing'] = [ 'jr_website' => 'http://origamiappbuilder.com', 'jr_checkbox' => ['one','two'] ]; $Dispatcher = new S2Dispatcher('jreviews'); // If running the script via cron without a specific Joomla user you will want to // set the listing owner by uncommenting the two lines below // to load it using the user ID // $auth = S2Object::make('auth'); // $auth->loadUser(46); $output = $Dispatcher->dispatch($params); $output = json_decode($output,true); if ($output['success'] == true) { // Listing was successfully created $listingId = $output['listing_id']; } Link to comment
bk-1530585905 Posted August 20, 2018 at 06:38 PM Share Posted August 20, 2018 at 06:38 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
bk-1530585905 Posted August 20, 2018 at 06:51 PM Share Posted August 20, 2018 at 06:51 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
Alejandro Posted August 20, 2018 at 07:08 PM Author Share Posted August 20, 2018 at 07:08 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
bk-1530585905 Posted August 20, 2018 at 07:51 PM Share Posted August 20, 2018 at 07:51 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
Alejandro Posted August 20, 2018 at 08:21 PM Author Share Posted August 20, 2018 at 08:21 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
bk-1530585905 Posted August 22, 2018 at 03:20 AM Share Posted August 22, 2018 at 03:20 AM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
bk-1530585905 Posted August 22, 2018 at 03:33 AM Share Posted August 22, 2018 at 03:33 AM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
bk-1530585905 Posted August 22, 2018 at 03:53 AM Share Posted August 22, 2018 at 03:53 AM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
Alejandro Posted August 22, 2018 at 11:54 AM Author Share Posted August 22, 2018 at 11:54 AM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
bk-1530585905 Posted August 22, 2018 at 02:05 PM Share Posted August 22, 2018 at 02:05 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
Alejandro Posted August 22, 2018 at 02:09 PM Author Share Posted August 22, 2018 at 02:09 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
bk-1530585905 Posted August 22, 2018 at 02:12 PM Share Posted August 22, 2018 at 02:12 PM (edited) This section is only visible with a valid subscription. If you have a valid subscription, please login. Edited August 22, 2018 at 02:16 PM by bk-1530585905 Link to comment
Alejandro Posted August 22, 2018 at 02:29 PM Author Share Posted August 22, 2018 at 02:29 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
bk-1530585905 Posted August 24, 2018 at 03:09 PM Share Posted August 24, 2018 at 03:09 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
Alejandro Posted August 25, 2018 at 01:01 PM Author Share Posted August 25, 2018 at 01:01 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
oliver hauser Posted October 31, 2018 at 04:43 PM Share Posted October 31, 2018 at 04:43 PM (edited) This section is only visible with a valid subscription. If you have a valid subscription, please login. Edited October 31, 2018 at 05:56 PM by oliver hauser Found some solutions Alejandro 1 Link to comment
Alejandro Posted October 31, 2018 at 08:52 PM Author Share Posted October 31, 2018 at 08:52 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
oliver hauser Posted November 1, 2018 at 04:45 PM Share Posted November 1, 2018 at 04:45 PM This section is only visible with a valid subscription. If you have a valid subscription, please login. Alejandro 1 Link to comment
sky Posted October 6, 2019 at 01:52 AM Share Posted October 6, 2019 at 01:52 AM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
oliver hauser Posted December 29, 2019 at 11:23 AM Share Posted December 29, 2019 at 11:23 AM This section is only visible with a valid subscription. If you have a valid subscription, please login. Link to comment
Recommended Posts