Home Forums Plugin Support WP User Frontend Pro PHP coding not showing when using HTML

This topic is: not resolved

Tagged: , ,

This topic contains 7 replies, has 2 voices, and was last updated by  Nayem 3 years, 9 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #70592

    Burnett
    Member
    Post count: 19

    I have a problem. I'm inserting PHP into the HTML element in the form and it's not working. It's the php file that is used on the back end for me to add a special post for songs. I want to add it on the front end so I don't need to be the one to add each song for users and they can add their own. Can you help????

    #70699

    Nayem
    Moderator
    Post count: 6480

    Hello Burnett,

    I am not clear about your question. Please make me more clear about your question. Can you show me those codes?

    #70726

    Burnett
    Member
    Post count: 19

    here is the php code. It's used on the backend for me to upload songs, etc. But I want my subscribers to upload it themselves and this plugin doesn't have the right elements to do that, so I'm trying to use the php for the backend form on the frontend in a form.

    < ?php /* T20 Music Player ----------------------------------------------------*/ vc_map( array( "name" => __(“Music Player”, “T20”),
    “base” => “T20_player”,
    “icon” => “ot-icon-music”,
    “category” => ‘T20',
    “description” => __(“Add new music player with unlimited tracks.”,”T20″),
    “as_parent” => array(‘only' => ‘T20_player_tracks'),
    “content_element” => true,
    “show_settings_on_create”=> true,
    “params” => array(
    array(
    “type” => “textfield”,
    “heading” => __(“Player ID”, “T20”),
    “param_name” => “extra_id”,
    “value” => “player_1”
    ),
    array(
    “type” => “dropdown”,
    “heading” => __(“Auto Play”, “T20”),
    “param_name” => “autoplay”,
    “value” => array(
    __(“true”, “T20”) => ‘true',
    __(“false”, “T20”) => ‘false'
    )
    ),
    array(
    “type” => “dropdown”,
    “heading” => __(“Show cover”, “T20”),
    “param_name” => “showcover”,
    “value” => array(
    __(“Yes”, “T20”) => ‘yes',
    __(“No”, “T20”) => ‘no'
    )
    ),
    array(
    “type” => “dropdown”,
    “heading” => __(“Player inside block”, “T20”),
    “param_name” => “defblock”,
    “value” => array(
    __(“No”, “T20”) => ‘no-def',
    __(“Yes”, “T20”) => ‘def-block'
    )
    ),
    array(
    “type” => “textfield”,
    “heading” => __(“Extra Class”, “T20”),
    “param_name” => “extra_class”,
    “value” => “”
    )
    ),
    “js_view” => ‘VcColumnView'
    ) );
    vc_map( array(
    “name” => __(“Track”, “T20”),
    “base” => “T20_player_tracks”,
    “description” => __(“Add new track”,”T20″),
    “icon” => “ot-icon-play”,
    “content_element” => true,
    “as_child” => array(‘only' => ‘T20_player'),
    “params” => array(
    array(
    “type” => “textfield”,
    “heading” => __(“Title”, “T20”),
    “param_name” => “title”,
    “admin_label” => true
    ),
    array(
    “type” => “attach_image”,
    “heading” => __(“Track Cover”, “T20”),
    “param_name” => “cover”
    ),
    array(
    “type” => “textfield”,
    “heading” => __(“Artist”, “T20”),
    “param_name” => “artist”,
    “admin_label” => true
    ),
    array(
    “type” => “textfield”,
    “heading” => __(“MP3 url”, “T20”),
    “param_name” => “mp3”,
    “description” => __(“Upload MP3 or insert radio stream url or external audio”, “T20”)
    ),
    array(
    “type” => “textfield”,
    “heading” => __(“Radio IP (If you want show radio history please insert radio ip ex: 198.254.25.22)”, “T20”),
    “param_name” => “radioip”
    ),
    array(
    “type” => “textfield”,
    “heading” => __(“Radio Port ex: 7004”, “T20”),
    “param_name” => “radioport”
    ),
    array(
    “type” => “textfield”,
    “heading” => __(“Buy Title 1”, “T20”),
    “param_name” => “buy_title_a”
    ),
    array(
    “type” => “dropdown”,
    “heading” => __(“Buy Icon 1”, “T20”),
    “param_name” => “buy_icon_a”,
    “value” => array(
    __(“Download”, “T20”) => ‘cloud-download',
    __(“Shopping Cart”, “T20”) => ‘shopping-cart',
    __(“Apple itunes”, “T20”) => ‘apple',
    __(“Credit Card”, “T20”) => ‘credit-card',
    __(“Soundcloud”, “T20”) => ‘soundcloud',
    __(“Spotify”, “T20”) => ‘spotify',
    __(“Reverbnation”, “T20”) => ‘star',
    __(“Youtube”, “T20”) => ‘youtube-play',
    __(“Chain”, “T20”) => ‘chain'
    )
    ),
    array(
    “type” => “textfield”,
    “heading” => __(“Buy Link 1”, “T20”),
    “param_name” => “buy_link_a”
    ),
    array(
    “type” => “textfield”,
    “heading” => __(“Buy Title 2”, “T20”),
    “param_name” => “buy_title_b”
    ),
    array(
    “type” => “dropdown”,
    “heading” => __(“Buy Icon 2”, “T20”),
    “param_name” => “buy_icon_b”,
    “value” => array(
    __(“Download”, “T20”) => ‘cloud-download',
    __(“Shopping Cart”, “T20”) => ‘shopping-cart',
    __(“Apple itunes”, “T20”) => ‘apple',
    __(“Credit Card”, “T20”) => ‘credit-card',
    __(“Soundcloud”, “T20”) => ‘soundcloud',
    __(“Spotify”, “T20”) => ‘spotify',
    __(“Reverbnation”, “T20”) => ‘star',
    __(“Youtube”, “T20”) => ‘youtube-play',
    __(“Chain”, “T20”) => ‘chain'
    )
    ),
    array(
    “type” => “textfield”,
    “heading” => __(“Buy Link 2”, “T20”),
    “param_name” => “buy_link_b”
    ),
    array(
    “type” => “textfield”,
    “heading” => __(“Buy Title 3”, “T20”),
    “param_name” => “buy_title_c”
    ),
    array(
    “type” => “dropdown”,
    “heading” => __(“Buy Icon 3”, “T20”),
    “param_name” => “buy_icon_c”,
    “value” => array(
    __(“Download”, “T20”) => ‘cloud-download',
    __(“Shopping Cart”, “T20”) => ‘shopping-cart',
    __(“Apple itunes”, “T20”) => ‘apple',
    __(“Credit Card”, “T20”) => ‘credit-card',
    __(“Soundcloud”, “T20”) => ‘soundcloud',
    __(“Spotify”, “T20”) => ‘spotify',
    __(“Reverbnation”, “T20”) => ‘star',
    __(“Youtube”, “T20”) => ‘youtube-play',
    __(“Chain”, “T20”) => ‘chain'
    )
    ),
    array(
    “type” => “textfield”,
    “heading” => __(“Buy Link 3”, “T20”),
    “param_name” => “buy_link_c”
    ),
    array(
    “type” => “textfield”,
    “heading” => __(“Buy Title 4”, “T20”),
    “param_name” => “buy_title_d”
    ),
    array(
    “type” => “dropdown”,
    “heading” => __(“Buy Icon 4”, “T20”),
    “param_name” => “buy_icon_d”,
    “value” => array(
    __(“Download”, “T20”) => ‘cloud-download',
    __(“Shopping Cart”, “T20”) => ‘shopping-cart',
    __(“Apple itunes”, “T20”) => ‘apple',
    __(“Credit Card”, “T20”) => ‘credit-card',
    __(“Soundcloud”, “T20”) => ‘soundcloud',
    __(“Spotify”, “T20”) => ‘spotify',
    __(“Reverbnation”, “T20”) => ‘star',
    __(“Youtube”, “T20”) => ‘youtube-play',
    __(“Chain”, “T20”) => ‘chain'
    )
    ),
    array(
    “type” => “textfield”,
    “heading” => __(“Buy Link 4”, “T20”),
    “param_name” => “buy_link_d”
    ),
    array(
    “type” => “textfield”,
    “heading” => __(“Custom buy text, link, code, icon, etc.”, “T20”),
    “param_name” => “buy_custom”
    ),
    array(
    “type” => “textfield”,
    “heading” => __(“Info or Lyric icon title”, “T20”),
    “param_name” => “lyric_title”
    ),
    array(
    “type” => “textfield”,
    “heading” => __(“Info or Lyric”, “T20”),
    “param_name” => “lyric”
    )
    )
    ) );
    // Your “container” content element
    class WPBakeryShortCode_T20_player extends WPBakeryShortCodesContainer {}
    class WPBakeryShortCode_T20_player_tracks extends WPBakeryShortCode {}

    /* MusicPlayer Out
    —————————————————-*/
    if (!function_exists(‘T20_player')) {
    function T20_player($atts, $content = null) {
    extract(shortcode_atts(array(
    ‘trackstoshow' => ”,
    ‘autoplay' => ”,
    ‘showcover' => ”,
    ‘extra_class' => ”,
    ‘defblock' => ”,
    ‘extra_id' => ”
    ), $atts));

    global $T20_options;
    $out = $outradio = ”;
    $new_content = str_replace(‘[T20_player_tracks', ‘[T20_player_tracks', $content);
    if ( $showcover === ‘no' ) {
    $outcover = ‘

    ‘;
    } else {
    $outcover = ‘

    ‘;
    }

    $outradio = ‘function get_radio_history() {
    if ($(“.jp-playlist-current #unq_ip”).html() != “”){
    getnewnonce = { action: “T20_getnewnonce”};
    $.ajax({
    url: ajaxurl_T20,data: getnewnonce,dataType: “html”,type: “post”,
    success: function(data) {
    var lanid = $(“.jp-playlist-current #unq_ip”).html(),
    landid = $(“.jp-playlist-current #unq_port”).html(),
    lannonce = data;
    datahistory = { action: “T20_history”, lanid: lanid, landid: landid, lannonce: lannonce};
    $.ajax({
    url: ajaxurl_T20,data: datahistory,dataType: “html”,type: “post”,
    success: function(response) {
    if (response != “-1”) {
    $(“#history”).html(response);
    $(“#history”).prepend(“

    “);
    $(“.update_history”).click(function(){
    $(“.update_history i”).addClass(“fa-spin”);
    $(“#history table”).animate({opacity: 0}, “fast”);
    get_radio_history();
    });
    $(“#history table”).animate({opacity: 1}, “slow”);
    } else {
    $(“#history”).html(“Error, Please reload track or refresh page.”);
    }
    }
    });
    }
    });
    } else {
    $(“#history”).html(“”);
    }
    }';

    $out .= ‘

    ‘.$outcover.'

    ‘;

    return $out;
    }
    }
    add_shortcode( ‘T20_player', ‘T20_player' );

    /* Tracks Out
    —————————————————-*/
    if (!function_exists(‘T20_player_tracks')) {
    function T20_player_tracks($atts, $content = null) {
    extract(shortcode_atts(array(
    ‘title' => ”,
    ‘artist' => ”,
    ‘mp3' => ”,
    ‘radioip' => ”,
    ‘radioport' => ”,
    ‘cover' => ”,
    ‘lyric' => ”,
    ‘lyric_title' => ”,
    ‘buy_title_a' => ”,
    ‘buy_icon_a' => ”,
    ‘buy_link_a' => ”,
    ‘buy_title_b' => ”,
    ‘buy_icon_b' => ”,
    ‘buy_link_b' => ”,
    ‘buy_title_c' => ”,
    ‘buy_icon_c' => ”,
    ‘buy_link_c' => ”,
    ‘buy_title_d' => ”,
    ‘buy_icon_d' => ”,
    ‘buy_link_d' => ”,
    ‘buy_custom' => ”
    ), $atts));
    global $T20_options;

    $out = ”;
    $out .= ‘{‘.”\n”;
    $dataAttrs = ‘“‘.$title;
    $out .= “title:'”.$dataAttrs;
    $out .= ‘ – ‘;
    $out .= $artist;
    $out .= “

    “;
    if ( $buy_title_a ) {
    if ( $buy_icon_a === ‘cloud-download' ) {
    $out .= ‘‘;
    } else {
    $out .= ‘‘;
    }
    }
    if ( $buy_title_b ) {
    if ( $buy_icon_b === ‘cloud-download' ) {
    $out .= ‘‘;
    } else {
    $out .= ‘‘;
    }
    }
    if ( $buy_title_c ) {
    if ( $buy_icon_c === ‘cloud-download' ) {
    $out .= ‘‘;
    } else {
    $out .= ‘‘;
    }
    }
    if ( $buy_title_d ) {
    if ( $buy_icon_d === ‘cloud-download' ) {
    $out .= ‘‘;
    } else {
    $out .= ‘‘;
    }
    }
    $out .= isset($buy_custom) ? str_replace(“‘”, ‘”‘, $buy_custom) : ”;
    if ( $lyric_title ) {
    $randnum = rand();
    $out .= ‘‘;
    $out .= ‘

    ‘;
    }
    $out .= “

    ‘,”;
    $out .= ‘mp3:”‘.$mp3.'”,';
    $out .= ‘m4a:”‘.$mp3.'”,';
    $out .= ‘oga:”‘.$mp3.'”,';
    $imageIn = ”;
    $player_cover = wp_get_attachment_image_src( $cover, ‘cover');
    if ( $player_cover ) {
    $imageIn = $player_cover[0];
    }
    $out .= ‘poster:”‘.$imageIn.'”‘;
    $out .= ‘},'.”\n”;

    return $out;
    }
    }
    add_shortcode( ‘T20_player_tracks', ‘T20_player_tracks' );

    #70995

    Nayem
    Moderator
    Post count: 6480

    Hello,

    It seems like you are customizing the plugin and those codes are not in our plugin. I am really sorry to say that we can not help you on this. Because we do not provide support for customization. We only provide support for our built-in feature, configuration and installation.

    Thanks.

    #71206

    Burnett
    Member
    Post count: 19

    I only wanted customization because this plugin only works partially with my theme. I have a music theme and when I add songs or videos it posts as a post type entry. I was able to make a form using some of the elements you have in this plugin but after it posts the song doesn't actually appear on the post but just uploads to my site. The same thing with the video, except I don't want videos to be uploaded I just want them to use the code from Youtube or Vimeo. Can you still help?

    #71233

    Nayem
    Moderator
    Post count: 6480

    Hello Burnett,

    You have already posted here- https://wedevs.com/support/topic/makings-forms-for-special-theme-not-posting-all-content/#post-70677. Towhid will check your site. Please co-operate with him by giving your site details.

    Thanks.

    #71466

    Burnett
    Member
    Post count: 19

    No matter what I do the post doesn't display the uploaded files. I also sent my information from the other post and still haven't gotten a reply or help.

    #71471

    Nayem
    Moderator
    Post count: 6480

    Hello Burnett,

    @towhid will check your site. We were in weekend and, for this reason, you did not get any feedback from us. You will get a reply on the other topic which you have created before.

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘PHP coding not showing when using HTML’ is closed to new replies.