share This tool integration

alt=
@luis789
7 years ago
88 posts
Hello!
I'm having issues adding the Share This tool in the Beat Slinger Skin.

I tried modifying the feedback.tpl with the below code but is not working. It only shows a blank page. See Image.

{jrShareThis item=$item module="jrAudio"}
{jrShareThis module="jrAudio" item=$item}

for test purpose, I also refereed to this link https://www.jamroom.net/the-jamroom-network/documentation/modules/2598/sharethis and when I enter an ID it generate errors.

Any help will be highly appreciated.



tool.PNG.png
tool.PNG.png  •  39KB


updated by @luis789: 12/14/17 12:38:12AM
douglas
@douglas
7 years ago
2,773 posts
My guess would be that the variable $item is not available in the feedback.tpl template.

Try adding the function to your skins/jrBeatSlinger/jrAudio_item_detail.tpl file.

The only problem with this is that you will most likely have two sets of buttons because the detail page features, ie. comments, sharethis, tags etc... are added via a function:

Bottom of the jrAudio_item_detail.tpl
{jrCore_item_detail_features module="jrAudio" item=$item}

You can arrange the order of the detail features in your ACP here:
/core/module_detail_features

I'm not aware of a way to exclude the ShareThis module from the jrCore_item_detail_features function.

Hope this helps!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
gary.moncrieff
gary.moncrieff
@garymoncrieff
7 years ago
865 posts
douglas:
I'm not aware of a way to exclude the ShareThis module from the jrCore_item_detail_features function.

That might be a useful addition, if possible, if items could be excluded using the exclude="" attribute, then in every template, if required, one could show which item details elements to show.
michael
@michael
7 years ago
7,697 posts
Use the {debug} tool to see if $item is available

Docs: "{debug}"
https://www.jamroom.net/the-jamroom-network/documentation/module-developer-guide/1477/debug

If its not available, then the share this module isnt going to know what to needs sharing.

copy+paste the errors into a [ c o d e] block here. Errors are there to help you understand whats going on, each one will have a meaning that helps you solve your issue.
alt=
@luis789
7 years ago
88 posts
THis is the code for jrAudio_item_detail.tpl
When running the Debug it found about 97 errors and 75 warnings
{jrCore_module_url module="jrAudio" assign="murl"}

{jrProfile_disable_header}
{jrProfile_disable_sidebar}
HERE IS THE OUTPUT OF conf {$_conf}
<div class="page_nav clearfix">
    <div class="breadcrumbs">
        {jrCore_include template="profile_header_minimal.tpl"}
        {jrBeatSlinger_breadcrumbs module="jrAudio" profile_url=$item.profile_url profile_name=$item.profile_name page="detail" item=$item}
    </div>
    <div class="action_buttons">
        {jrCore_item_detail_buttons module="jrAudio" item=$item  field="audio_file"}
    </div>
</div>

<div class="col8">
    <div class="box">
        {jrBeatSlinger_sort template="icons.tpl" nav_mode="jrAudio" profile_url=$profile_url}
        <div class="box_body">
            <div class="wrap detail_section">
                {if isset($item.audio_active) && $item.audio_active == 'off' && isset($item.quota_jrAudio_audio_conversions) && $item.quota_jrAudio_audio_conversions == 'on'}
                    <div class="item" style="text-align: center;">
                        <p class="pending">{jrCore_lang module="jrAudio" id="40" default="This audio file is currently being processed and will appear here when complete."}</p>
                    </div>
                {elseif $item.audio_file_extension == 'mp3'}
                    {jrCore_media_player module="jrAudio" field="audio_file" item=$item autoplay=$_conf.jrBeatSlinger_auto_play}
                {/if}
                <div class="detail_box">
                    <div class="basic-info">
                        <div class="trigger"><span>{jrCore_lang skin="jrBeatSlinger" id="115" default="Basic Info"}</span></div>
                        <div class="item" style="display: none; padding: 0; margin: 5px auto 0;">
                            <div style="display: table; width: 100%;">
                                <div class="header">
                                    <div>{jrCore_lang skin="jrBeatSlinger" id=21 default="Album"}</div>
                                    <div>{jrCore_lang skin="jrBeatSlinger" id=39 default="Genre"}</div>
                                    <div>{jrCore_lang skin="jrBeatSlinger" id=40 default="Created"}</div>
                                    <div>{jrCore_lang skin="jrBeatSlinger" id=38 default="Plays"}</div>
                                </div>
                                <div class="details">
                                    <div>{$item.audio_album}</div>
                                    <div>{$item.audio_genre}</div>
                                    <div>{$item._created|jrCore_date_format:"relative"}</div>
                                    <div>{$item.audio_file_stream_count|jrCore_number_format}</div>
                                </div>
                            </div>
                        </div>
                    </div>
                    {if strlen($item.audio_text) > 0}
                        <div class="description">
                            <div class="trigger"><span>{jrCore_lang skin="jrBeatSlinger" id="47" default="Description"}</span></div>
                            <div class="item" style="display: none;">
                                {$item.audio_text}
                            </div>
                        </div>
                    {/if}
                    {if strlen($item.audio_lyrics) > 0}
                        <div class="lyrics">
                            <div class="trigger"><span>{jrCore_lang skin="jrBeatSlinger" id="116" default="Lyrics"}</span></div>
                            <div class="item" style="display: none;">
                                {$item.audio_lyrics}
                            </div>
                        </div>
                    {/if}
                </div>
                {* bring in module features *}
                <div class="action_feedback" style="padding: 0">
                    {jrBeatSlinger_feedback_buttons module="jrAudio" item=$item}
                    {if jrCore_module_is_active('jrRating')}
                        <div class="rating" id="jrAudio_{$item._item_id}_rating">{jrCore_module_function
                            function="jrRating_form"
                            type="star"
                            module="jrAudio"
                            index="1"
                            item_id=$item._item_id
                            current=$item.audio_rating_1_average_count|default:0
                            votes=$item.audio_rating_1_number|default:0}</div>
                    {/if}
                    {jrCore_item_detail_features module="jrAudio" item=$item}
                </div>
              
              {*Added *}

<div class="item clearfix">
{if $item.action_module != 'jrShareThis'}
{jrShareThis item=$item module="jrAudio"}
{jrShareThis module="jrAudio" item=$item}

{/if} 


</div> 

                
            </div>
        </div>
    </div>
</div>
<div class="col4 last">
    <div class="box">
        {jrBeatSlinger_sort template="icons.tpl" nav_mode="jrAudio" profile_url=$profile_url}
        <span>{jrCore_lang skin="jrBeatSlinger" id="111" default="You May Also Like"}</span>
        <div class="box_body">
            <div class="wrap">
                <div id="list" class="sidebar">
                    {jrCore_list
                    module="jrAudio"
                    profile_id=$item.profile_id
                    order_by='_created RANDOM'
                    pagebreak=8
                    template="chart_audio.tpl"}
                </div>
            </div>
        </div>
    </div>
    {* Added *}
        <div class="box">
             {jrBeatSlinger_sort template="icons.tpl" nav_mode="jrInfo" profile_url=$profile_url}
             <span>{jrCore_lang skin="jrBeatSlinger" id="111" default="You May Also Like"}</span>
           </div>    
</div>

and this is the code for the feedback.tpl page:

{jrCore_module_url module="jrUser" assign="uurl"}

{if isset($data.like_profile_url)}
    {$profile_url = $data.like_profile_url}
{elseif isset($data.rating_profile_url)}
    {$profile_url = $data.rating_profile_url}
{elseif isset($data.profile_url)}
    {$profile_url = $data.profile_url}
{else}
    {$profile_url = $item.profile_url}
{/if}

{if !isset($item_id)}
    {$item_id = $item._item_id}
{/if}

<div class="item clearfix">

    {if strlen($module) > 0 && jrCore_module_is_active('jrLike')}

        {if is_array($item.action_data)}
            {$like_module = $item.action_module}
            {$like_item_id = $item.action_item_id}
            {$like_item_data = $item.action_data}
        {else}
            {$like_module = $module}
            {$like_item_id = $item._item_id}
            {$like_item_data = $item}
        {/if}

        {if $item.action_module == 'jrLike' || $item.action_module == 'jrRating' || $item.action_module == 'jrComment'}

            {* likes go to the item *}
            {$like_module = $item.action_original_module}
            {$like_item_id = $item.action_original_item_id}
            {$like_item_data = $item.action_original_data}

        {/if}

        {if $module == 'jrAction'}
            {$like_item_data = $item}
        {/if}


        {if $_conf.jrLike_like_option == 'all' || $_conf.jrLike_like_option == 'like'}
            {jrLike_button item=$like_item_data module=$like_module action="like" item_id=$like_item_id}
        {/if}

        {if $_conf.jrLike_like_option == 'all' || $_conf.jrLike_like_option == 'dislike'}
            {jrLike_button item=$like_item_data module=$like_module action="dislike" item_id=$like_item_id}
        {/if}
    {/if}

    {if jrCore_module_is_active('jrComment')}
        <div class="like_button_box">
            {if jrUser_is_logged_in()}
                {if isset($comment_url) && strlen($comment_url) > 0}

                    {* comment module has constructed URL *}
                    <a href="{$comment_url}">

                {else}

                    {* If this action is an item detail feature we point to the item unless it is another item detail feature *}
                    {if $item.action_module == 'jrLike' || $item.action_module == 'jrRating' || $item.action_module == 'jrComment'}

                        {if $item.action_original_module == 'jrLike' || $item.action_original_module == 'jrRating' || $item.action_original_module == 'jrComment'}

                            {jrCore_module_url module='jrAction' assign="curl"}
                            {if isset($item.action_data.profile_url)}
                                <a href="{$jamroom_url}/{$item.action_data.profile_url}/{$curl}/{$item._item_id}">
                            {else}
                                <a href="{$jamroom_url}/{$item.profile_url}/{$curl}/{$item._item_id}">
                            {/if}

                        {else}

                            {jrCore_module_url module=$item.action_original_module assign="curl"}
                            {if isset($item.action_original_title_url)}
                                <a href="{$jamroom_url}/{$item.action_original_data.profile_url}/{$curl}/{$item.action_original_data._item_id}/{$item.action_original_title_url}">
                            {else}
                                <a href="{$jamroom_url}/{$item.action_original_data.profile_url}/{$curl}/{$item.action_original_data._item_id}">
                            {/if}

                        {/if}

                    {elseif $item.action_module == 'jrGroupDiscuss'}

                        {jrCore_module_url module=$item.action_module assign="curl"}
                        <a href="{$jamroom_url}/{$item.action_data.profile_url}/{$curl}/{$item.action_data._item_id}/{$item.action_data.discuss_title_url}">

                    {elseif strlen($item.action_module) > 0}

                        {jrCore_module_url module=$item.action_module assign="curl"}
                        <a href="{$jamroom_url}/{$item.profile_url}/{$curl}/{$item._item_id}">

                    {else}
                            {jrCore_module_url module=$module assign="curl"}
                            <a href="{$jamroom_url}/{$item.profile_url}/{$curl}/{$item._item_id}">
                    {/if}
                {/if}
            {else}
                <a href="{$jamroom_url}/{$uurl}/login?r=1">
            {/if}
            {jrCore_lang module="jrComment" id="2" default="Post Your Comment" assign='com'}
            {jrCore_image image="comment.png" width="24" height="24" class="like_button_img" alt='Comment' title=$com}</a>
            <span><a>{$comment_count|jrCore_number_format}</a></span>
        </div>
    {/if}

    {if isset($disable_share)}
        <div class="like_button_box">
            {jrCore_lang module="jrAction" id=35 default="You have Shared this with your Followers" assign="title"}
            {jrCore_image image="share_disabled.png" width=24 height=24 class="like_button_img" alt=$title title=$title}
            <span><a>{$item.action_original_data.action_share_count|jrCore_number_format}</a></span>
        </div>
    {elseif !isset($item.action_shared)}
        {$share_id = $item_id}
        {$share_module = $module}
        {if isset($item.action_original_item_id) && is_numeric($item.action_original_item_id)}
            {$share_id = $item.action_original_item_id}
            {$share_module = $item.action_original_module}
        {/if}
        {if $share_module == 'jrComment' && is_array($item.action_original_data)}
            {$share_module = $item.action_original_data.comment_module}
            {$share_id = $item.action_original_data.comment_item_id}
        {/if}
        <div class="like_button_box">
            {if jrUser_is_logged_in()}
            <a onclick="jrAction_share('{$share_module}','{$share_id}')">
            {else}
            <a href="{$jamroom_url}/{$uurl}/login">
            {/if}
            {jrCore_lang module="jrAction" id=34 default="Share This with your Followers" assign="title"}
            {jrCore_image image="share.png" width="24" height="24" class="like_button_img" alt=$title title=$title}</a>
            <span><a>{$item.action_data.action_share_count|jrCore_number_format}</a> </span>
        </div>
    {/if}

    {if jrCore_module_is_active('jrTags') && $timeline != true}
        <div class="like_button_box">
            {if jrUser_is_logged_in()}
            <a onclick="jrBeatSlinger_open_div('#{$module}_{$item._item_id}_tag', '#tag_text')">
            {else}
            <a href="{$jamroom_url}/{$uurl}/login">
            {/if}
                {jrCore_lang module="jrTags" id="2" default="Tag" assign='tag'}
                {jrCore_image image="tag.png" width="24" height="24" class="like_button_img" alt='Tags' title=$tag}
            </a>
            <span><a>{$tag_count|jrCore_number_format}</a></span>
        </div>
    {/if}

    {if jrCore_module_is_active('jrRating') && $timeline != true}
        <div class="like_button_box">
            {if jrUser_is_logged_in()}
            <a onclick="jrBeatSlinger_open_div('#{$module}_{$item._item_id}_rating')">
                {else}
                <a href="{$jamroom_url}/{$uurl}/login">
                    {/if}
                    {jrCore_lang module="jrRating" id="1" default="Rate" assign='rate'}
                    {jrCore_image image="star.png" width="24" height="24" class="like_button_img" alt='Rate' title=$rate}</a>
                <span><a>
                    {$rating_count|jrCore_number_format}
                </a></span>
        </div>
    {/if}

</div>
{*Added *}

<div class="item clearfix">{jrShareThis item=$item module="jrAudio"}
{jrShareThis module="jrAudio" item=$item}

</div>


Thank You

Tags