BuddyDev

Search

[Resolved] Upload default image into Mediapress Uploader

  • Participant
    Level: Enlightened
    Posts: 23
    Jkk on #33829

    Hi BuddyDev Team,

    It’s possible through js add a default image into the uploader file of mediapress?
    (An attached image taken from wp-content)
    Waiting your reply.
    Thank you in advance.

    Kind Regards

  • Keymaster
    (BuddyDev Team)
    Posts: 21785
    Brajesh Singh on #33840

    Hi Jkk,
    Thank you for using MediaPress.

    I am sorry but I am unable to understand your question, Can you please help me understand it better?

    Thank you
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 23
    Jkk on #33851

    Hi Brajesh,

    Thank you for your reply.
    We want to upload a default image from our server when user go to the uploader page, where can select various images or drop into the box. So a default image pre-loaded when user go to this page.
    https://imgur.com/a/5j02Hic

    PS: How it’s possible disable the dropdown function trought jquery or js?

    Kind regards,
    Jkk

  • Keymaster
    (BuddyDev Team)
    Posts: 21785
    Brajesh Singh on #33863

    Hi Jkk,

    1. I do not see any easy option for that. It may be achievable but will need a lot of custom work.

    2. Your question:- ” How it’s possible disable the dropdown function trought jquery or js?”
    Which dropdown you are referring to. Please provide the context.

    Thank you
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 23
    Jkk on #33889

    Hi Brajesh,

    Thank you again for your reply.
    Instead of adding via script, how can we insert a default image trought the SQL Code in our custom PHP? Which query is currently inserting the image in the DB?
    Waiting your reply.

    Kind regards,
    Jkk

  • Keymaster
    (BuddyDev Team)
    Posts: 21785
    Brajesh Singh on #33903

    Hi Jkk,
    All images are WordPress atatchment with some extra metadata. Please see mpp_add_media() funciton.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 23
    Jkk on #33914

    Hi Brajesh,

    Thank you again for your reply.

    How can we upload a default image taken from the server in a specific gallery via php code? For example if we wanted to add an image called “buddy.jpg” in the gallery with ID = 39 of the user with ID = 2, how can we insert it?
    Could you give us an example of the code?

    Regards,
    jkk

  • Keymaster
    (BuddyDev Team)
    Posts: 21785
    Brajesh Singh on #33925

    Hi jkk,
    I am sorry but I am unable to offer you code due to the time it needs. It can be achieved in the following way though:-

    1. You save the file as a new WordPress attachment. Keep this attachment id for use.
    2. Use mpp_add_media to add this attachment id to your preferred gallery

    If you are not very comfortable with php, I will suggest hiring a developer to help you achieve it.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 23
    Jkk on #33939

    Hi Brajesh,

    I solved it with the mpp_add_media function!
    Thank you very much!

    Kind regards,
    Jkk

You must be logged in to reply to this topic.

This topic is: resolved