Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. Alejandro

    Import as Unpublished

    Only if you modify the code to set the default state to zero. /components/com_jreviews_addons/import/cms_compat/joomla/models/import_listing.php $listingData['Listing'][self::_LISTING_PUBLISHED] = 1;
  3. Peter Ward

    Import as Unpublished

    Is there a way to import listings as unpublished? I'd like to import listings from a web scraper then edit them (add extra details) before publishing.
  4. Alejandro

    Invalid file request Error, I can't update

    Hi. Back in May I announced the transition to a new support system and I also sent a couple of emails to users related to this. You can find it here https://forum.jreviews.com/support/ With regards to the upgrade, you can't go directly to 2.7 from 2.6 via remote updates. You need to follow the upgrade instructions, and I recommend going to JReviews 3 directly, since JReviews 2.7 will reach its end of life in September. You can find upgrade instructions here https://docs.jreviews.com/?title=Upgrading_to_JReviews_3
  5. Hi, I need to update jReviews fro v2.6.7.2 and the S2 Framework but I get the following error: S2 Framework Invalid file request. Please contact support. But the support URL and the "submit ticket" are not working as well: https://www.jreviews.com/forum/ How can I upgrade though? Thanks in advance.
  6. Yesterday
  7. Alejandro

    Custom Field choosing multiple posts

    That's a warning that can be ignored. Remember I told you that this is a "hacky" way of doing it and that hasn't changed. JReviews is trying to create the missing file on that line, so I am not sure why it's complaining that it's not there if it's trying to create it. The file it's also not needed for what you are trying to do, but it's part of the logic that runs whenever a controller action is invoked.
  8. bk-1530585905

    Custom Field choosing multiple posts

    Is there any initialization I need to perform? They are getting created during a cron job. I get: Warning: fopen(/var/www/html/wp-content/plugins/s2framework/tmp/cache/core/locale-jreviews_overrides/locale.js): failed to open stream: No such file or directory in /var/www/html/wp-content/plugins/jreviews/jreviews/controllers/my_controller.php on line 440
  9. Alejandro

    Custom Field choosing multiple posts

    To update, you include the 'id' key (it's lowercase because it's normalized for Joomla and WordPress). For new listings, to insert as a user, you need to "load the user" first and JReviews will automatically pick it up in the controller. I already gave you the code for that above so you need to uncomment it and pass the right user ID. // 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);
  10. bk-1530585905

    Custom Field choosing multiple posts

    and same for 'author' field? The plugin already specifies the author.
  11. bk-1530585905

    Custom Field choosing multiple posts

    This is awesome, Alejandro. Thanks. I'm about to embed this code into the scraper plugin I'm working on. One quick question. If I'm "updating" a listing rather than creating one, do I just supply the 'ID' key/value in the $params['data']['Listing'] ? eg. $params['data']['Listing'] = [ 'ID' => 123, 'catid' => 23, 'title' => 'Programatically submitted listing', 'introtext' => '<p>This is the listing summary.</p>', 'fulltext' => '<p>This is the listing description.</p>', ];
  12. Last week
  13. 1. The import add-ons is for listings only, not reviews, nor JReviews configuration nor setup of any kind. It also doesn't allow you to export/import media. 2. Yes you need to setup the site first as you said. However, the RapidLauncher Add-on, which is free, allows you to export/import most of the setup (categories, directories, listing types, field groups and fields), but not field options. For field options, if you export listings using the Import Add-on and import them on the other site, then they should be automatically created. 3. You can use the RapidLauncher Add-on. The Import Add-on is for listings only. 4. Sure, only those you include in the CSV file. 5. You can install the add-on in sites where you have the JReviews license for which you purchased it. If you need a dev domain added you can request that via suppor ticket. 6. Export and import time varies depending on the number of listings you have and I could be from seconds to minutes to more minutes. I hope that answers your questions.
  14. Hi, I'm not a developer or coder in any way but I can upgrade and do fresh installs etc. I notice that upgrading from 2 to 3 is not a push button process and I'm contemplating making so many changes to my existing site that a fresh install may make more sense; especially since I'd like to have a run at having JReviews do most of the heavy lifting with paid listings, user profiles, instead of using other components dedicated to those functions. So instead of hunting for all of the custom changes I made into the old JReviews which may not apply in any case, I'm thinking to start completely new, set it up with all of the same field, field groups etc., that I'll want from the old site and then import from the old database. I see there is an import add on which seems designed for what I'm considering. To determine if I can do this myself a few questions on the Import Add on: Is the process first export to CSV, upload CSV to server and then perform import? Must I first configure my new site with all of the Directories, categories, field groups etc, or will the import function automatically create these on my fresh install for me? If the answer to #2 is yes, can I use the import add-on to configure my directories, category, field groups etc. WITHOUT importing importing listings? Can I import only select listings? Will the license allow me to install the import add-on on my old site and again on my new site (new server)? How long does the process take? Thanks
  15. Alejandro

    API and zapier

    Sure, so here's how you can use Zapier to automatically import a feed as listings on your website. Again it's meant as a starting point that you can continue to develop to meet your own requirements. 1. The first step is to create the endpoint (webhook) URL on your site that will receive the POST request from Zapier with the feed data and create the listing. For this we simply use a new controller which we can place in overrides: Joomla: /templates/jreviews_overrides/controllers/zapier_listing_feed_controller.php WordPress: /jreviews_overrides/controllers/zapier_listing_feed_controller.php <?php defined( 'MVC_FRAMEWORK') or die( 'Direct Access to this location is not allowed.' ); class ZapierListingFeedController extends MyController { /** * This value must match the value you entered in Zapier in order to pass authentication validation * @var string */ protected $zapierToken = '0123456789'; public function index() { $post = $this->data; // Simple authentication to prevent direct access to the webhook without knowledge of the "token" value // that is included with the Zapier request if (!isset($post[$this->zapierToken])) { return $this->response->html()->access_denied(); } // Use filters to allow listing creation, editor use and automatic publishing regardless of the site access settings Clickfwd\Hook\Filter::add('can_create_listing', [$this,'can_create_listing'], 1); Clickfwd\Hook\Filter::add('can_use_editor_in_listing', [$this,'can_create_listing'], 1); Clickfwd\Hook\Filter::add('trusted_on_create_listing', [$this,'can_create_listing'], 1); // // Set the form token $_POST[cmsFramework::getToken()] = 1; // // Build the listing data $params = []; // You can either hard-code the category ID below or pass it with your Zapier data and read it from the $post array. That would allow you to // to have multiple zaps from different feeds and dynamically insert the listings into different categories $categoryId = 23; // Ensure that the form passes the consent checkbox validation if it's enabled $params['data']['consent'] = true; $params['data']['name'] = $post['author']; $params['data']['created_by_alias'] = $post['author']; // Add the standard fields // Catid is required and must be a JReviews category, title is required if not disabled $params['data']['Listing'] = [ 'catid' => $categoryId, 'title' => $post['title'], 'introtext' => $post['__raw']['summary'], 'fulltext' => '', ]; // The raw data below is mainly required to be able to include HTML in the summary and description $params['data']['__raw']['Listing'] = [ 'introtext' => $post['__raw']['summary'], 'fulltext' => '', ]; // // 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'] // // ]; $output = $this->requestAction('listings/_save',$params); $output = json_decode($output,true); if ($output['success'] == true) { // Listing was successfully created $listingId = $output['listing_id']; return $this->response->html()->success('Listing was successfully created'); } else { return $this->response->html()->fail('Failed to create listing'); } } /* * Override listing create permission */ public function can_create_listing($permission,$params) { return true; } /* * Override listing Wysywig editor permission */ public function can_use_editor_in_listing($permission,$params) { return true; } /* * Override listing moderation */ public function trusted_on_create_listing($trust,$params) { return true; } } 2. Clear the file registry in JReviews 3. Now you can create your zap in Zapier. I used the "New Item in Feed" for the Trigger and "Post" for the action. Below you can see the settings I used for the "Post" template. There I add the webhook URL to the controller and the variables that are sent via post, inclusing a made-up authentication value which prevents others to access this endpoint to insert data on your site. So change that value and make it difficult to guess! That's it. If you use "Test this step" you should see the listing get created on your site. Of course you need to do your own matching for the title, author, summary, etc. fields and you can hardcode custom field values if you want. If your feed as extra info then you can match that as well. I think this is a great starting point that is quite easy to do with the latest dev features in JReviews 3 so you can extend the functionality of your site without making any core changes. Let me know how it goes.
  16. radiopol

    API and zapier

    Yes please
  17. Alejandro

    API and zapier

    I also have another example now with an incoming Zapier request to insert new items from a feed as listings in JReviews. Is that something that interests you?
  18. radiopol

    API and zapier

    Woow :) I will jump on it :)
  19. Alejandro

    API and zapier

    I am going to give you some code to help you get started with creating your own Zapier integrations taking advantage of the developer events and without having to modify any core files. This is only for outgoing requests to Zapier. 1. First you need to create a new zapier listener provider in overrides: Joomla: /templates/jreviews_overrides/events/providers/zapier_listener_provider.php WordPress: /jreviews_overrides/events/providers/zapier_listener_provider.php I use the update event for testing, but it's commented below because I only want the zap to execute on new listings <?php defined( 'MVC_FRAMEWORK') or die; use Clickfwd\Listener\ListenerProvider; class ZapierListenerProvider extends ListenerProvider { protected $listen = [ 'JReviews\Events\ListingWasFirstPublished' => [ 'JReviews\Listeners\SendNewListingToZapier', ], 'JReviews\Events\ListingWasUpdated' => [ // 'JReviews\Listeners\SendNewListingToZapier', ], ]; } 2. Then you create the SendNewListingToZapier listener that will execute when the ListingWasFirstPublished event is triggered. Joomla: /templates/jreviews_overrides/events/listeners/send_new_listing_to_zapier.php WordPress: /jreviews_overrides/events/listeners/send_new_listing_to_zapier.php The code below is just for illustration purposes to help you get started with your own zaps. The listener makes a request to the Zapier hook URL for your zap and it sends the data in the $payload array. You have control over this $payload array so you can add whatever you want there. In this example I am going a bit further and doing some pre-processing for the main photo and gallery photos because I created a PDF zap and I passing the HTML directly to it. <?php namespace JReviews\Listeners; defined( 'MVC_FRAMEWORK') or die; use JReviews\Listeners\Traits\ListenerSetting; use Clickfwd\Listener\QueueableListener; use League\Event\EventInterface; use GuzzleHttp\Client as Guzzle; \S2App::import('ListenerTrait','listener_setting','jreviews'); class SendNewListingToZapier extends QueueableListener { use ListenerSetting; protected $queue = false; /** * Execution delay in seconds * @var int */ protected $queue_delay = 5*60; // Update the URL with the hook URL provided to you by Zapier protected $url = 'https://hooks.zapier.com/hooks/catch/1111111/aaaaaa/'; public function handle(EventInterface $event) { $listing = $event->getListing(); if ( $listing ) { $client = new Guzzle(); $payload = [ 'title' => $listing['Listing']['title'], 'summary' => $listing['Listing']['summary'], 'description' => $listing['Listing']['description'], 'category' => $listing['Category']['title'], 'directory' => $listing['Directory']['title'], 'owner'=> $listing['User']['username'], ]; $photos = []; $fields = []; foreach ( $listing['Field']['pairs'] AS $fname => $field) { $fields[$fname] = implode(',', $field['text']); } foreach ( \S2Array::get($listing,'Media.photo') AS $photo ) { $photos[] = '<img src="'.$photo['media_info']['image']['url'].'" />'; } $payload['main_photo'] = sprintf('<img src="%s" />', \S2Array::get($listing,'MainMedia.media_info.image.url')); $payload['photos'] = implode("\n",$photos); $payload['fields'] = $fields; $response = $client->post($this->url, [ \GuzzleHttp\RequestOptions::JSON => $payload ]); } } } 3. Clear the file registry in JReviews so it can recognize the new files. 4. Create your zap. I am using the "Catch Hook" trigger and the "Submit Print Job" action to create a PDF on Google Drive. Once you add the "Catch Hook" trigger, grab the hook URL and replace it in the listener file above. Submit a listing for testing, and then you will be able to see the $payload array keys as options to add to your PDF template as shown below: Events are executed synchronously so they will cause a delay in listing submission request response by making an external API call to Zapier. What this means is that the user will have to wait a bit longer after submitting the listing to see the success message. If you want to avoid this you can take advantage of the Queue Add-on and in the listener file above change the value of $queue from false to true. Another advantage of using the Queue Add-on to process these jobs is that you can add delays to the execution to, for example, allow the user to finish uploading media to the listing so it's included in the $payload.
  20. Alejandro

    Custom Field choosing multiple posts

    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']; }
  21. Alejandro

    GeoMaps with ony GPS

    Hello. Yes, it would work. The proximity search converts the typed address into coordinates and then performs the search using those coordinates.
  22. coll-1534497093

    GeoMaps with ony GPS

    Hello, I would like to use this for a project I have in the works, but 90% of what I would add to it, would only be from GPS coordinates. Is it possible to only have GPS and not a physical address? Would the near me function still work?
  23. Alejandro

    Map cover image

    Does the photo selected as cover appear as published or unpublished when it's hidden once the premium order expires? I tried to replicate this by unpublishing the cover photo which is what paid listings should be doing and I see the map appear in it's place. Can you create a ticket with Site Credentials added so I can look into it?
  24. Jeff Greenwood

    Google Maps Stopped working

    Thanks everyone. I'll have to check on the pricing that has already been discussed in the other thread Alejandro linked me to.
  25. Michael Pusch

    Template Mobile Menu Error

    I solved the problem. It's not caused from jreviews or IReviews template. For a dual login I need another version of jquery (3.3.1) and that caused the error.
  26. Michael Pusch

    Template Mobile Menu Error

    Updated the other site to Joomla 3.8.11 and it works there. It seems don't have to do something with the Joomla update. The only difference is an error in console and have something to do with template.min.js and dropdown. Hmmm....
  27. DanielH

    Google Maps Pricing Structure

    Personally having to pay for the different views is a bit over the top. Then there is the possibility of bots?, mistaken page loads that are immediately abandoned, and the possibility of google search results pointing users to pages with maps in top results only because of the map with content over better content with no map. OK off the soap box... For the time being maybe have the option to not load the map API or anything with the geomaps addon, at all on any page, and only load if/when users click a link or button as a choice. Not every user will actually use the map even though its loaded on the page and billed as such. Also a counter on those clicks for the billed functions would be helpful to check against ones bills from google as a checks and balances. Anyway, just my two cents worth. Cheers! Daniel
  1. Load more activity
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Please refer to our Privacy Policy.