Forum Replies Created

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Dario Jazbec Hrvatin

    (@helika)

    Hehe, no problem, thank you for the reply and advice! ??

    Thread Starter Dario Jazbec Hrvatin

    (@helika)

    Maybe I didn’t explain myself or my conclusion well enough. ??

    I didn’t change the media uploader in the source of WordPress. I know changing core files is bad practice because of all the reasons you listed and I personally would never use a solution that includes changing the core files.

    What I meant is… When you want to use media uploader in your own plugin or theme, you need to enqueue some files to make it work. In my case, my starting point was this tutorial: https://mikejolley.com/2012/12/using-the-new-wordpress-3-5-media-uploader-in-plugins/

    One of the things you enqueue is the jquery code that loads the media uploader (for example, you enqueue my-plugin.js file). In that code you can modify the look and features of the uploader (for example remove the sidebar).

    So, my solution/code was meant for that specific custom jquery code/file that is loaded by the custom made plugin.

    Thread Starter Dario Jazbec Hrvatin

    (@helika)

    Hello and thank you for the great answer!

    I did manage to find one more resolution for my specific problem/plugin.

    I played around with the jquery code for media uploader and changed the “original” code that gets the attachment (image) url from:
    $(‘.’ + formfieldID).val(attachment.url);

    …to:
    $(‘.’ + formfieldID).val(attachment.sizes.thumbnail.url);

    This gets the url for the thumbnail size of the selected/uploaded image. If you want/need to, you can also use your own custom image size like this:
    $(‘.’ + formfieldID).val(attachment.sizes.mysize.url);

    Since I use my plugin to get the exact custom image size, this is very simple and practical way to get the url for the exact resized version of the uploaded image.

    >>P.S. I ran into one stupid but very time-consuming problem: DO NOT give your custom image size a name that is separated by a minus sign, like “background-image”; because while WordPress part of it will work (the new image size will be visible and usable) the jquery for media uploader won’t work with it.

    If you need a separator, use underscore instead, e.g. “background_image” and it will work normally! This could be a beginner’s error on my part, but I thought it could save someone some time! ??

    Thread Starter Dario Jazbec Hrvatin

    (@helika)

    Hi!

    When I tried to import the database in phpmyadmin I got an error which pointed to WPML table “wp_icl_string_translations”, saying:
    “#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’09:54:02)’ at line 5.

    So, I opened up the SQL file in the editor and found the line which “broke” the SQL import (that’s the line that the error tells you about) and just added quotes around the timestamps.

    For example 2012-06-2909:54:02 must be surrounded with qoutes.

    As you look at the data that is in the same part of your SQL file, you will notice that all the timestamps from that WPML table are missing the quotes. So now you have to manually add the quotes to all the timestamps that are missing them.

    Don’t worry, if you happen to forget some timestamp it will just give you the same error during import and it will point you to the line in question.

    I was lucky that the database in question was for relatively small website so the manual fix took about half an hour.

    Owain from WP Remote said that they are working on the fix and that it should be included in the next version of the plugin. Since I really like the plugin and service I will manually backup my databases until then.

    Thread Starter Dario Jazbec Hrvatin

    (@helika)

    Hi!

    I just sent an email with details, screenshot and a database file to your support.

    Thanks for a quick reply and help!

    Cheers! ??
    Dario

    Wow, that was FAST!

    It’s working perfectly for .pdf, .doc and the rest filetypes now!

    Thank you so much! You rock and rule! ??

    Cheers!

    @ma9mwah, thank you very much, your solution also worked for me (for empty image links in sitemap)!

Viewing 7 replies - 1 through 7 (of 7 total)