1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Search and display images in form with redirect plugin

Discussion in 'Community' started by pier67, Oct 2, 2017.

  1. pier67

    pier67 Pierantonio

    Level: Community
    I have a database with 90.000 people data where about 800 of them have a photo stored in joomgalley.
    I have a search page with a fabrik module and a redirect plugin to a search results page.
    I want to search in Fabrik form for people who have a photo in joomgallery, and display it in result detail form.
    So I think I will need:
    1. To create a column named "PHOTO" inside the db table with people data (already done).
    2. To create a sql query that for each record (column name+column surname) in people's table look for filename in the Joomgallery's table (column name and surname) and, in case of a name+surname match, then store the file url in "PHOTO" column of people table. This have to be done once, because the database is static.
    3. To add, in Fabrik search module, an element dropdown to choose from "null" and "yes". If "yes" is choosen then the module have to tell to the redirect page to search for records where "PHOTO" column is not null. How can I do?
    4. In search results list I want to display an icon in the PHOTO column to indicate that a photo is availabe.
    5. In search result detail I want to display the photos from joomgallery path. May I use an image element? Or a file upload element?
    The reference page for module search is http://www.joomla3.unirr.it/ricerche/ricerca-nell-elenco-dei-caduti, but soon it will be moved to http://www.unirr.it/ricerche/ricerca-nell-elenco-dei-caduti.
    I need some step-by-step help to choose the right way. I know that the second point is not Fabrik strictly related, but any help is welcome.
    Thank you.
     
  2. pier67

    pier67 Pierantonio

    Level: Community
    Point 1, 4 and 5 solved! I have used a fileupload plugin to display images in detail view and icons in list view. Still need a help for point 2 (create a query to populate image colum from joomgallery table) and 3 (search for record that have a path stored in image column).
    Thank you.
     
  3. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    For 2, I guess just do it by hand in phpMyAdmin (or whatever)

    First test the selection with something like ...

    SELECT * FROM yourtable INNER JOIN joomtable ON yourtable.name = joomtable.name AND yourtable.surname = joomtable.surname

    If that returns the set of 800 rows you expect, then ...

    UPDATE yourtable INNER JOIN joomtable ON yourtable.name = joomtable.name AND yourtable.surname = joomtable.surname SET yourtable.photo = joomtable.photo

    If the photo in the JoomGallery table is a filepath and you want to create an actual URL or an img, you can CONCAT("<img serc='", joomtable.photo, "/>") or whatever.

    Of course, back up your tables before doing anything like this.

    -- hugh
     
    pier67 likes this.
  4. pier67

    pier67 Pierantonio

    Level: Community
    Great job Hugh!
    I followed your steps and it worked very well. Thank you very much!
    Now I have associated 854 photos, even if I have only 773 files, so there will be 81 duplicate records (people with the same name and surname). I cannot identify the correct record of each duplicate, so I'm gonna put a question mark near possible duplicates.
    Now it would be nice to have in detail view a next/previous button to move from records to records without exiting. Do you think is it possible?
     
  5. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    The 'paginate' form plugin should do that.

    -- hugh
     
  6. pier67

    pier67 Pierantonio

    Level: Community
    Thanks. I've tried to download and install the paginate form plugin v 3.7. Joomla says that the installation was successful, but the plugin won't show in J! plugin list and in Fabrik form plugin section. I'am using J! 3.8 and Fabrik 3.8 update from Github. Any ideas?
     
  7. jfquestiaux

    jfquestiaux Well-Known Member

    Level: Community
    Try to "Discover" it in the J! extensions manager. If it does not appear in the list, check that it is included in the 3.8 Github and upload it on your server via FTP, then discover it.
     
  8. pier67

    pier67 Pierantonio

    Level: Community
    Found in "discover" extension manager and installed! Thanks.
    ----------------
    First question:
    This plugin have a problem with images. When I click on plugin buttons I can jump from a record to another, and browse through data, but the photos displayed in the module (file upload plugin) remain the same (the first one). If i exit from detail view and click on another record, then the correct photo is displayed. Is it an issue with this plugin?
    ---------------
    Second question:
    I need to filter the selection of photos that contain duplicates and keep only photos withot any duplicate. This exclude a set of photos that I cannot assign to a record for sure.
    I have the following query:
    SELECT foto FROM caduti GROUP BY foto HAVING count(foto)=1
    This filter all the records that have a unique 'foto' id, but now I need to store the data in 'foto' column to a new column named 'foto_ok'.
    I have tried several update queries but without fortune. Any help?
    Thank you.
     
  9. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    I've gone about as far as I can with Community support.

    -- hugh
     
  10. pier67

    pier67 Pierantonio

    Level: Community
    Ok, sorry, but I think the first question is of interest to the community as there may be a problem with your plugin
     
  11. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    No need to apologize, I was just letting you know, so you weren't sitting there waiting for answers that weren't going to be forthcoming.

    Fabrik has (last time I checked) about a third of a million lines of code and well over 100 plugins, with (to all intents and purposes) an infinite number of permutations of how those plugins can be combined (it's a number with about 150 zeros after it) - you've hit an issue with the way the upload and pagination plugins interact. We simply can't track and fix every anomaly reported in Community support. My rules of thumb are that I'll fix issues reported in Community if they affect 80% of users (or "the large majority", 80% comes from an old Microsoft rule of thumb), or involve security or potential data loss. Other than that, tracking and fixing issues is part of what support subs pay for.

    -- hugh
     
    Last edited: Oct 5, 2017
  12. pier67

    pier67 Pierantonio

    Level: Community
    Ok, Hugh, I found the answer elsewhere and solve my problem with sql, but your support was precious to me. For pagination plugin I found that my options are to disable aiax or disable pagination for details view, and both are minor issue that I can live with. Thank you.
     
    cheesegrits likes this.

Share This Page