Guilherme Two.

Send private message

You must be logged in to send a private message.

Friends

No friends yet.

Group membership

  • Beginning Developers

    Beginning Developers

    This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking
  • Feedback and Planning

    Feedback and Planning

    Discussions about the past, present, and future of Elgg and this community site.

Activity

  • Guilherme Two. replied on the discussion topic separated upload files
    yeah, I'll try to use the mimetype data. thank you so much bros! view reply
  • Guilherme Two. added a new discussion topic separated upload files in the group Feedback and Planning
    Hello everyone! So, I'm trying to develop an elgg mod. I want to upload different types of files to different places or just tag/identify this files so I can display them in different pages, like one page for images, other for videos and another...
    • @itstheshawnp - no need to have physical sections. What you're talking about is quite simple to do I believe. 

      1) get all files in the group (get by container_guid)

      2) sort them into individual arrays by mimetype (foreach $files as $file etc.)

      3) create dynamic tabs for each array if it's not empty

      Ok, there's a bit more too it than that, with a couple of checks etc. but it's not too difficult. No need to worry about different upload forms or setting more metadata. 

      P.S. For those who ask about "What happens when the mimetype doesn't get saved properly?", my solution would be to have an array of accepted mimetypes to create these individual arrays from. Any types that aren't listed in said array go into a special 'Misc' array. That way you don't lose files if the system hiccups while uploading.

    • how would i go about doing that?  would you have an example code to test?  especially since i have been looking into editing the tabs at the top of the site.

    • I don't work with 1.8 so I've not got any code example. On further thought you might wanna think about organizing by simpletype instead of mimetype, because you'll have less tabs to deal with.

  • Guilherme Two. has a new avatar
    Guilherme Two.
  • Guilherme Two. added a new discussion topic separate upload files in the group Beginning Developers
    Hello everyone! So, I'm trying to develop an elgg mod. I want to upload different types of files to different places or just tag/identify this files so I can display them in different pages, like one page for images, other for videos and another...
    • thanks elgg community, you're the best!

    • i too just posted this question.  i want the same thing...files for misc docs and files, gallery for photos, and video for videos.  basically the same plugin, but each rewritten to show as either files, photos, or videos...and each with their own seperate file restrictions so people dont upload vids to the photo gallery etc...  i am with you on this...would make elgg much much better!  i am trying!