PDA

View Full Version : Interdoctery Video



Kemoid Wilson
August 4, 2013, 05:07 AM
Can someone please help me? I am trying to create a field where users can upload a video advertisement about their company. Either locally or share it from youtube, something similar to the one in the listing page.

610

When the video is uploaded it can be viewed frm z seller info tab

Viktor
August 5, 2013, 03:57 AM
Hello Kemoid Wilson,

Do you want this field in registration page or in add listing page?

Kemoid Wilson
August 5, 2013, 11:48 AM
[QUOTE=Viktor;6266]Hello Kemoid Wilson,

Do you want this field in registration page or in add listing page?[/QUOTE

Hello,
On the registration page so a user can add a video ad about their company. See the pic below.
611

Viktor
August 6, 2013, 03:42 AM
Hello Kemoid Wilson,

If it will be only youtube video it will be easy for creation and I can write explanation here but if you want local too you should create a ticket and it will be like customization for you.

Kemoid Wilson
August 6, 2013, 04:46 AM
Thanks for your reply,

Think it would be best to try out just the youtube video for now. If response is what I expect I will submit the ticket for local video.

Kemoid Wilson
August 8, 2013, 10:59 AM
Hello Kemoid Wilson,

If it will be only youtube video it will be easy for creation and I can write explanation here but if you want local too you should create a ticket and it will be like customization for you.

Hello Viktor,

Still going to post to code to add the youtube video like you promised

Kemoid Wilson
August 10, 2013, 03:18 PM
Still no word? :(

Viktor
August 13, 2013, 09:26 AM
Hello All,

Sorry for delay,very busy.

Instruction about add field for youtube video. I created it with minimal changes in source code.

Please go to Admin Panel >> Account Fields >> Add a Field

Then I set key for my new field like 'you_tube'
and Type 'text' with 100 characters. (Don't touch 'Checking condition') Other fields doesn't metter. save it.

Then go to Account Types select any type for example Dealers click 'build' Icon and select 'Build Registration form: controller=account_types&action=build&form=reg_form&key=dealer

And add this new field from right to left column, then save.

Then go to ftp://templates>>your_template>>tpl>>blocks>>open file: field_out.tpl

and remove all code from this file and add new:



<!-- field output tpl -->

<tr id="df_field_{$item.Key}">
{if $item.Key != 'you_tube'}
<td class="name">{$item.name}:</td>
{/if}
<td class="value{if $smarty.foreach.fListings.first} first{/if}{if $item.Type == 'phone'} phone{/if}" {if $item.Key == 'you_tube'}colspan="2"{/if}>
{if $item.Type == 'checkbox' && $item.Opt1}
{if $item.Opt2}
{assign var='col_num' value=$item.Opt2}
{else}
{assign var='col_num' value=3}
{/if}
<table class="checkboxes{if $col_num > 2} fixed{/if}">
<tr>
{foreach from=$item.Values item='tile' name='checkboxF'}
<td>
{if !empty($item.Condition)}
{assign var="tit_source" value=$tile.Key}
{else}
{assign var="tit_source" value=$tile.ID}
{/if}
<div title="{$lang[$tile.pName]}" class="checkbox{if $tit_source|in_array:$item.source}_active{/if}">
{if $tit_source|in_array:$item.source}<img src="{$rlTplBase}img/blank.gif" alt="" />{/if}
{$lang[$tile.pName]}
</div>
</td>
{if $smarty.foreach.checkboxF.iteration%$col_num == 0 && !$smarty.foreach.checkboxF.last}
</tr>
<tr>
{/if}
{/foreach}
</tr>
</table>
{else}
{if $item.Key == 'you_tube'}
<script type="text/javascript">
var you_tube_val = '{$item.value}';
{literal}
$(document).ready(function(){
you_tube_url = you_tube_val.split('=')[1];

if(!you_tube_url || you_tube_url == undefined)
{
you_tube_url = you_tube_val.split('/')[3];
}
var width = $('#df_field_you_tube td.value').width();
var height = parseInt(width / 1.3333);
var embed = '<iframe src="http://www.youtube.com/embed/'+you_tube_url+'" width="'+width+'" height="'+height+'" frameborder="0" allowfullscreen></iframe>';

$('#df_field_you_tube td.value').html(embed);
})
{/literal}
</script>
{else}
{$item.value}
{/if}
{/if}
</td>
</tr>

<!-- field output tpl end -->



save and try do add it.

You can add 2 type links for this field:

1. http://www.youtube.com/watch?v=uKstwk4EUPM
2. http://youtu.be/uKstwk4EUPM

both type will work.

Please try it.

Kemoid Wilson
August 13, 2013, 11:41 AM
Big help. Thanks a lot Viktor

Kemoid Wilson
August 13, 2013, 12:07 PM
Hello,
This works okay when you view it from the "Sellers Account" page but when you click on a listing and click the "Seller Info" tab the video is not showing.