• Resolved dizwell

    (@dizwell)


    Hello Peter,
    I wonder if you’d mind answering two questions (I am sure they are basic, and if the answer is to simply point me to the documentation, I won’t have a problem with that!)

    First: is it possible to make that search box do a ‘negative’ search. That is, could a user type in something like “-symphony” to get all things in the table which are *not* symphonies?

    And second: if I wanted the user to be able to click on an item in the listed table and, on doing so, they see an image pop-up of the first two bars of the composition they clicked on (which I can store in the table or externally to it as, let’s say, a PNG or JPG), how would I go about doing that? Or is that sort of thing not possible? Let me make that a more generic question, too, while I’m at it: if they clicked an item in that table, could I get a few seconds of a recording of that work to play? (Assume I have the relevant MP3s on my hard disk, or stored in the table, also).

    Sorry if I am asking too much! Feel free to ignore me if I’m going off-topic too much!

    Best wishes,
    Howard

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Howard,

    I don’t mind answering your questions. No worries! ??

    (Q1) At this time only standard searches are supported. It is not possible to perform a negative search, nor can you use operators like AND and OR. This area is om my to do list for improvement. This will be added next year.

    (2) To create a list with popups you need to set colummn output to “Responsive”, type to “Modal” and show icon to “Yes”. The number of columns displayed in the table can be defined in column “Number of Columns”. All the columns above that number are shown in the popup. If you set type to “Expanded” you’ll get a kind of inline popup. My advice to you: create a new publication and play around with these settings untill you get the desired layout. You can use the link below to get an idea of the huge number of possibilities you have with jQuery DataTables. From your Data Publication you can use all options in column “Table options (advanced)”.

    https://datatables.net/extensions/responsive/examples/

    Good luck! Let me know if you need help…

    Best regards,
    Peter

    Thread Starter dizwell

    (@dizwell)

    Hi Peter: thank you for answer #1. I am happy that this enhancement may come in the future, and perfectly content that it’s not there yet ??

    In respect of #2. I was aware of how to do the responsive thing with a green ‘+’ to reveal hidden columns, which is what I think you’re getting at in your answer.

    So I think maybe I wasn’t clear in what I wanted to do. Imagine I have a table with just two columns: ID (char) and IMAGE (blob). Into that table, I insert values (‘1′,’/tmp/incipit1.jpg’). The jpg is just 7K in size. I then create a page with a link to the table, setting the responsive stuff as you mention. The second column is, indeed, hidden until I click the green ‘+’… but as the page containing the table is loaded, the table just sits there saying ‘processing’ and never completes.

    In my Oracle days, this was always a problem with binary objects loaded into the table: although a JPG might only be 7K, the database seems to delight in uncompressing it as it’s loaded and storing it as a massive uncompressed binary stream, which then screws up any front-end accessing it.

    So what I was really after was having my graphic stored outside the database at, say, /wordpress/uploads/19/12/incipit1.jpg, and when I click the record displayed in the table, it would somehow make that jpg pop-up in a modal window floating above my wordpress site altogether.

    So, summing all that up, I guess I have refined my questions down to:

    1) Is there a way to load JPGs or other binary data into a table using only WP Data Access capabilities, or do I have to do it on the backend with SQL statements?

    2) Is there a way for a click on a displayed table to call something that will load a JPG stored outside the database and cause it to be displayed in a pop-up window, distinct and separate from the browser window that contains the table data?

    Basically, I’m after a way for someone who clicks on ‘mozart’s 1st symphony’ to see a few bars of the opening of that composition appear in their browser, or hear a few bars of the music -depending on whether I call out to a JPG or an MP3, for example.

    It’s a bit specialised, I realise!

    Not a problem if I’m asking things which aren’t possible as yet …feel free to tell it to me straight!!

    Best wishes.
    Howard

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Howard,

    Your Oracle days? Looks like we have some things in common! I have been an Oracle consultant for 25 years, and a long time ago I played Bach as well… ??

    I think the plugin can help you achieve your goal. But you need to think differently with WordPress. WordPress uses a media library to store images. These images are not stored in the database (like Oracle does in a blob). WordPress stores images (and other file types) in its upload folder and stores a link to that file in the media library (MySQL database).

    The result is basically the same, although a file in an upload folder is always readable to the public while access to a blob can be restricted. For that reason I intent to do some research on storing blobs in the WordPress database for users who want to restrict access to these files. But that’s for the far future…

    Getting back to your question. The plugin supports the WordPress media library. Within the plugin you just need to define a table column as a media library column. Please have a look at the link below, specifically to column bike attachment (which fits your needs I think). The plugin makes a difference between an image (direct shown as output) and attachment (user has to click).
    https://wpdataaccess.com/home/demos/demos-data-publisher/demo-shortcode-wpdataaccess-with-images/

    You can read more information about this topic on the this page:
    https://wpdataaccess.com/docs/documentation/data-explorer/add-wordpress-media-library-to-table-columns/

    And you should also check this one:
    https://wpdataaccess.com/docs/documentation/data-explorer/add-hyperlink-to-table-column/

    The last page describes how you can use hyperlinks in your tables and might be interesting for you as well.

    Good luck Howard! Let me know if you need help….

    Best wishes,
    Peter

    Thread Starter dizwell

    (@dizwell)

    Yup, worked for Oracle Australia 1999 onwards, freelance 2003 onwards, retired 2016. The fact MySQL doesn’t know what a varchar2 is drives me insane, as I reflexively add the ‘2’ in every table definition statement I create (which then, obviously, fails miserably)!

    Anyway: your help has been really useful, so thank you for that. I almost have what I was after. If you now visit my page (https://absolutelybaching.com/music-articles/a-list-of-composers/wolfgang-amadeus-mozart/a-catalogue-of-the-works-of-wolfgang-amadeus-mozart/), you should be able to expand the first row in the table (record ID: 01002) and see the graphic I was wanting to include and a link to an audio file: works nicely all round, and I’d be happy to stop there.

    However, I say it’s almost what I’m after, because I would ideally have wanted the user to click on that music stave graphic and have the audio auto-play as a consequence. Or, for the ‘excerpt’ link to not be the word ‘mpeg’ but somehow be the WordPress audio player in-situ and thus to play within the context of the existing page, instead of opening a new one and playing there. Is any of that possible, please?!

    Otherwise, I’m 95% of the way there, and very grateful for your assistance getting me there!

    In achieving this much, however, I’ve somehow made a bit of a boo-boo on the back-end: although the table is still there and very much visible, if I click on Data Designer -> mozartcat -> Edit, the page is completely blank. That is, the tablename is shown, but no columns. If I click the [Reconcile] button, the table name is still there, with a characterset and a collation, but still no columns. A desc mozartcat; inside MySQL shows the table fully present however. Is there a quick(ish) fix for that, apart from deleting everything, dropping the table and re-creating it from scratch?

    All the best… it’s time you put your feet up for Christmas, isn’t it?!
    HJR

    Thread Starter dizwell

    (@dizwell)

    All the first records now have incipits; only numbers 1 and 4 have MPEG audio links. Record ID: 01002 was in any case a mis-type for 01001!
    Regards
    HJR

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Wow Howard! I’m impressed! ?? Looks great.

    Let me check:
    (1) You want to able to change to label (user defined text instead of mpeg)
    (2) You want the music to be played inline

    Both options sound like interesting additions to the plugin. I added them to my to do list. But it will take a little time. Coming days I’m gonna have some very nice Christmas days with my family and the week after I’m on holiday. I will pick it up when I’m back.

    I wish you a merry Christmas and a great start into the new year!

    Warm regards,
    Peter

    Thread Starter dizwell

    (@dizwell)

    Have a great break. Just to be clear, the main thing is your (2): for the music to be playable in-line (or, at least, without launching a new tab/page). If the usual WordPress player could be displayed, the label involved wouldn’t matter!

    All the very best. I hope you have a wonderful break with family and friends. You do great work, and it’s much appreciated.

    Best wishes,
    HJR

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Howard,

    The new version is out and supports playing songs (and videos) inline. It works in the same way as images and attachments, which you have already used. You can find is a smaal post here:
    https://wpdataaccess.com/2020/01/29/audio-and-video-column-support-list-tables-and-data-entry-forms-and-publications/

    Let me know if you need help.

    Best regards,
    Peter

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Negative Search and Image Popup’ is closed to new replies.