Skip to:
Content
Pages
Categories
Search
Top
Bottom

MP3 upload profile field

  • @canadianmusicnetwork

    Participant

    I am tired of searching for days on end for this solution. As it’s my last step before I launch..

    How Do I add a .MP3 upload to profile registration and show in the user profile page tab with a player?

    Without using RTMEDIA or other Plugins. . I know there is a way with bp-custom.php but can’t figure out the correct way.

    THANK YOU VERY MUCH IN ADVANCED! 🙂

Viewing 8 replies - 1 through 8 (of 8 total)
  • @danbp

    Participant

    Hi, no need to shout, writing in capitals is really rough. [Mod – topic title modified]

    In a WordPress system, you can only upload allowed medias. You already know (probably) that you can embed videos in post by simply copy/pasting the video link into it. This works also with BuddyPress when you enter a video URL to a profile field, it plays automatically, without any additionnal player.

    MP3 is an audio format and you can use the same technique as for videos. Read here.

    For more advanced display, you have several possibilities by plugins (rtMedia or MediaPress) or by building a custom display which fits exactly to your need. You don’t want a plugin (?), so i’m affraid you have to do something from scratch.

    That said, keep in mind that allowing users to upload “big” data files to your site is a mess. First because of the upload limitation in WordPress (by default 2 mo max.) This can only be increased if you have access to the server settings (eg. php_ini and httpd_conf). And if you have some traffic and many MP3, you need a generous bandwith. That’s why it’s recommended to use external services to store these datas. But if you follow this, you can only use what WP allows.

    Before thinking about a miraculous snippet in bp-custom, give more details about the scenario you imagine for users (file amount, file size, why do you want this during registering and not later, and so on…).

    Depending your answers, the solution can be very simple or very complicated.

    @canadianmusicnetwork

    Participant

    Thanks so much for the professional reply. I really enjoy Buddypress & The Support Community. I suggest this service to everyone else in the Canadian Music Industry. Sorry about the capital lock! Didn’t proof read before hitting submit! Lesson Learned 🙂

    Anyways, I want to be able to create a Profile Field when Users/Artists sign up where they can upload (2) mp3 files so it will automatically display in their profile. This is the main page where there (2) Featured Songs will be displayed. The rest will be displayed in RTMEDIA or BuddyMedia.

    I have some experience with coding, but was wondering how would I add a profile field that says audio to my drop down list in profile fields & output the mp3 player on the user end?

    First Example (Second To Follow)

    Second:

    Thanks in advanced!

    @venutius

    Moderator

    The only thing close I have seen is BP Profile Widgets but this is a far cry from what you are looking for.

    @danbp

    Participant

    @canadianmusicnetwork,

    i never used BuddyForms, so i can’t help you with this. Ask on their support if a specific audio field exist or can be added, and how.

    That said, WP comes with all of this, but later. Meaning by this that a user will be able to upload an audio file once it is already registered.

    It is commonly accepted that nothing can be added to a site as long as a new user is not validated or pending.

    On a standart install, i would use a simple text field on a new field group named Audio. And, eg., if you allow 5 files, use 5 fields.

    BP strips HTML on prfoile fields, so it’ not possible by default to get the automatted embed like in a post. Why is unclear to me, as embed is implemented since BP 1.6 for activities, groups, but not profiles… Anyway, a little bp-custom snippet magic (here it is ! ) will let you do this.

    function set_audio_field( $field_value ) {
    	$bp_this_field_name = bp_get_the_profile_field_name();
    	// field name (case sensitive)
    	if( $bp_this_field_name == 'N° 1' || $bp_this_field_name == 'N° 2' ) {
    		$field_value = strip_tags( $field_value );
    		$field_value = '[audio mp3 ="'.$field_value.'"]';
    	}
    	return $field_value;
    }
    add_filter( 'bp_get_the_profile_field_value','set_audio_field');

    That’s it for site admin. Now for the user.

    The new user capability should be “author”, so he can upload files. This is default, but you can change that, if you search a bit on WP’s codex.

    First he have to upload his file. From Toolbar: Dashbord > Media > add new. Then he has to copy the file URL avaible on the media upload page, under “edit” and then in the right menu.

    User goes to his profile > edit > audio tab and paste the file URL into the audio field, save and voila ! Here the result:

    audio display on profile

    That’s only one possibility. the’re others, like custom post type…

    @canadianmusicnetwork

    Participant

    Perfect! Works great! Thanks so much for the reply! 🙂

    You mentioned there were other ways to display this?

    Can the user directly upload through profile fields & then automatically display in tabs like you showed without entering the url?

    @danbp

    Participant

    Hum… copy/pasting is not very complicated. Another way would be to use MediaPress, which works great on profiles. Or even custom post type, but this would be longer to get it to work within profiles. Depends of your php knowledge.
    Also, custom work like this is over the scope of this forum.
    I give you a BuddyPress way to do that. Now it’s your turn to decide and to do. 😉

    @canadianmusicnetwork

    Participant

    DanBP> You have no idea how much you helped me! This has been an on going project for a while now. I used to use a different CMS prior for the industry, but it was horrible. Now I’m switching to Buddypress & Glad I Did ..

    One Last Question.

    Is there anyway to embed RTMEDIA or MediaPress in the TAB where Info, Bio is?

    How would I add a HTML/PHP code for one of those so it would show up on the page?

    Thanks again in advanced! hopefully I’m not asking too many questions…

    @danbp

    Participant

    hopefully I’m not asking too many questions… You do, but with a guitar, so i don’t be too afraid (i have 3 near me)

    If you use rtmedia, there is no reason to use mediapress as both do more or less, the same thing. And vice versa.

    I don’t use rtmedia so i don’t know how it works and display content in BP.
    What is the tab with bio, info ? Do you mean the original WP profile page ? Are you speaking about the admin profile page ?

    Embeding a wp content is not very difficult. Search the forum for embed post on profile. I answered one of this question a few days back with a complete solution.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘MP3 upload profile field’ is closed to new replies.
Skip to toolbar