ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Adding files/photos/user entries to member pages

July 10, 2012 7:30am

Subscribe [2]
  • #1 / Jul 10, 2012 7:30am

    Reverie123

    47 posts

    Currently, I am developing a music site with artist profiles. My client wants them to be able to add their own photos/music/videos/entries to their profiles. What is the best method to go about this?

    My approach would be have an option in their profile to link them to a add “media type” form.  The form would then have the same details as the entry type they want to add (photo, song, video). Also it will be submitted and tied with their member id. This is where I get confused. How does one setup the form to allow a member to add their own entry type? If I can figure this out, then this would solve many problems I am having with the site. Any detailed help would be great!

  • #2 / Jul 10, 2012 12:54pm

    Reverie123

    47 posts

    Just going to bump this, anyone have any ideas?

  • #3 / Jul 10, 2012 1:24pm

    MadWebDesigns

    147 posts

    Hi Reverie123,

    I’m not sure if this is the easiest way or if there is an add-on/plugin that can do this, but here goes.

    What I would do is create a channel that will hold the photos/music/videos etc. for each member. In this channel make sure to add a field that will store the member id. Once you have all your fields etc. setup for your channel now you can create a SafeCracker form on the front end for members to fill in with their desired photo/video/music etc. as required. Each time you save the info store the member id with the entry and to pull it up again use the member id. I hope that helps?

    Thank you,

    Mike

  • #4 / Jul 11, 2012 12:21pm

    Kevin Smith

    4784 posts

    Excellent suggestion to use SafeCracker for this, Mike. The only change I would make to what you recommended is that you shouldn’t need a field to store the member’s ID since SafeCracker designates the user as author for each entry submitted.

  • #5 / Jul 17, 2012 12:16am

    Reverie123

    47 posts

    Thanks, it works for the most part. I am having a few issues with the safecracker form. The first part is radio buttons. For some odd reason when I use the form to edit entries the radio buttons decide to ignore the values submitted. I double checked with the entry list in the CP and saw that it wasn’t making any changes. The edit form is exactly the same submission form with the values of the buttons being “Yes” and “No”. (toggleStatus just disabled an input box below if yes).

    <input type="radio" id="label" name="label" {if label == "Yes"} checked="checked" {/if} value="{label}"> Yes
              
    <input type="radio" id="label" name="label" {if label == "No"}checked="checked"{/if} value="{label}"> No

    So when I refresh the page after editing, it just stays the same. Any ideas?

    Another question that is very important, is there anyway to setup safecracker to automatically set a page_uri for an entry? Or anyone know a work around so that a member can set the page_uri through their entry submissions? This would save my client alot of time, and be more efficient for the members.

    Also sometimes the safecracker file gives me an error when I upload files, saying that it couldnt write to the location that it was designated to. I made sure the permissions were fine and that the file size wasn’t to huge but I am not quite sure whats wrong. I set it to regular file, and then it goes through, but it doesnt hold on to the file—so when I look at the entry list in the cp no file is attached to the entry. Sorry for all the questions, any help with these problems would greatly be appreciated.

  • #6 / Jul 17, 2012 2:05pm

    Reverie123

    47 posts

    I am just going to randomly reply to this thread when I find out answers (in case anyone else runs into these problems in the future).

    I fixed the safecracker file issue by turing off XSS filtering on uploaded files. This is located admin>security and Privacy>Security and session. There is an option within it.

    As for the page_uri issue, I am putting in a hidden field to give the page_uri the entry title.

    <input type="hidden" name="page_uri" id="page_uri" value="{title}">

    So far no dice, but I am going to keep trying.

    It seems the radio button isnt even taking in a value on form submission, going to explore that problem next. That would explain why the edit doesn’t work.

  • #7 / Jul 17, 2012 5:30pm

    Kevin Smith

    4784 posts

    Glad to hear you found a solution to the upload troubles you were having with SafeCracker File.

    With regards to the page_uri question, do you mean URL Title?

    The reason your radio button values aren’t being updated is because your HTML form gives all the radio inputs the same value. Check your HTML and you’ll see what I mean. They’re all outputting whatever the current value of that field is, so when you update it, it just “updates” to the same value. Try this instead:

    <input type="radio" id="label" name="label" {if label == "Yes"} checked="checked" {/if} value="Yes" {label}> Yes
              
    <input type="radio" id="label" name="label" {if label == "No"}checked="checked"{/if} value="No" {label}> No
  • #8 / Jul 17, 2012 5:39pm

    Reverie123

    47 posts

    Thanks for the help on the buttons :D

    I mean the page_uri, which usually shares the url_title, and is part of the page module. The way I have the template created, the page_uri and the url_title must be the same. Also the page won’t be generated if it doesnt have a page_uri.

    I can’t set it via the form which is a major issue.

    I also realized their is a flaw in my plan, I can’t set the value of the page_uri based on the user title, because they are inputing it into another field. Mmmm

    <input type="hidden" name="pages_uri" id="pages_uri" value="test">

    Even when I hardcode a value in, it won’t take. How should I go about this—how can I have the user set their own pages/page_uri via safecracker?

  • #9 / Jul 18, 2012 2:25pm

    Kevin Smith

    4784 posts

    I mean the page_uri, which usually shares the url_title, and is part of the page module. The way I have the template created, the page_uri and the url_title must be the same. Also the page won’t be generated if it doesnt have a page_uri.

    Oh, I see what you mean now. You’re trying to create a Pages module page with a SafeCracker entry. That’s not one of the options for SafeCracker, unfortunately. That would be a great idea for a feature though. Mind adding it to the Feature Request forum?

  • #10 / Jul 18, 2012 2:45pm

    Reverie123

    47 posts

    oh, well is there any alternative other then having to go in and set each page_uri manually?

    (made requestpost)

  • #11 / Jul 18, 2012 5:33pm

    Kevin Smith

    4784 posts

    Not at this time. You’ll need to simply edit an entry to add a Page URI after it’s been submitted by a user via SafeCracker.

  • #12 / Jul 18, 2012 7:27pm

    Reverie123

    47 posts

    So I have been looking around for a solution and the closest is:
    Pages AutoSave URI

    This sets the URL_Title to be the PAGE_URI automatically after every entry creation. I thought that this would solve the problem (wasn’t counting on it) as Safecracker allows Members to create entries. The script set the PAGE_URI to “/” meaning it accessed the PAGE_URI and set it somehow. It also reset the template to the first on the list (not sure why).

    I think this may have potential as a fix, can anyone take a look at it and see if it is plausible? Or why it is having these side effects?

  • #13 / Jul 19, 2012 3:33pm

    Kevin Smith

    4784 posts

    I’d recommend asking the developer directly if you’ve got questions about it. Looks like he put his email address on the Devot:ee page.

    I could also move this thread over to Community Help if you like. There might be some other community members you’ve tried what you’re trying.

  • #14 / Jul 19, 2012 3:36pm

    Reverie123

    47 posts

    Yep, we are already in discussion with him via mail. I will update this thread when we find a solution.

  • #15 / Jul 19, 2012 3:37pm

    Kevin Smith

    4784 posts

    Sounds good. Moved the thread to Community Help, too.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases