• Hi,

    I have a website which is designed on MyListing theme.

    Users create their own listings and I have set it up so that they can upload their own files, most specificlly a PDF of their qualification.

    At the moment, I have to go into the back end to find their listing. I then have to copy their file URL, use a plugin called simple download monitor and the create a shortcode to paste back into their listing.

    I am looking at having developed a way where a user can fill in their listing, upload PDF and set their own password. This will then automatically publish on their profile with the password protection in place.

    I have no idea where to start so any help or ideas would be massively appreciated!

    • This topic was modified 4 years, 10 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Developing with WordPress topic
Viewing 2 replies - 1 through 2 (of 2 total)
  • I think you’ll want to customize the template of the listing page to generate the Simple Download Monitor shortcode and embed it.

    If you haven’t already modified your theme, it’s a good idea to set up a child theme. Please refer to https://developer.www.ads-software.com/themes/advanced-topics/child-themes/

    Then you’ll have to either identify the template file relevant to the pages you are targeting or ask the theme supplier for assistance to figure it out. Your purchased theme might already have documentation about this.

    Finally, add a do_shortcode statement to the template, but you’ll also have to find a way to retrieve the right file identifier.

    Please see what you can figure out and ask further for more assistance where needed.

    Moderator bcworkz

    (@bcworkz)

    you’ll also have to find a way to retrieve the right file identifier

    Quite so. As you may know, when files are uploaded through the media library, they are associated with an “attachment” post type, which is in turn often associated with a specific post, though “attachment” posts are not necessarily associated with a specific post.

    It’s not clear how user uploads are accomplished, so perhaps none of this attachment stuff happens. In any case, you need to relate a specific user to the PDF file they uploaded. It’d be easiest to simply record the path to the uploaded file in user meta as the file is being uploaded. But if there’s an attachment post type created you could save its ID in user meta instead.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘User upload file and password protect automatically’ is closed to new replies.