Jump to content


Photo
* * * * * 1 votes

Ads on iphone showing only in first page

iphone ipad ipod iavs

  • Please log in to reply
6 replies to this topic

#1 nanroig

nanroig

    Junior Member

  • Members
  • Pip
  • 14 posts

Posted 05 May 2011 - 03:15 PM

Hi all,

After installing the iphone module i put the AdAgency code in order to show ads in the mobile version of mytube site, but the ads are showing only in the first page. When you go to another page by clicking 'next' or any link, the videos are showing but the ads are not showing.

i have modified the code from:
/templates/frontend/mobile_default/mobile_videos.tpl

The code modified is this:
...
{if $videos}
{section name=i loop=$videos}
<script src="http://www.adultmoda.com/ads/jsbannertext.php?v=4&l=javascript&z=7638"></script>
<li>
<div class="left">
<embed height="90" width="120" autoplay="false"
...
...
}

perhaps the code is repeated elsewhere?

anyone knows how to make it appear always?

Thanks,

#2 dargre

dargre

    Senior Member

  • Members
  • PipPipPipPipPip
  • 988 posts

Posted 06 May 2011 - 07:49 PM

Can't say a lot as I don't know what is you full html and layout, however this is not correct to put javascript into smarty section.

{section name=i loop=$videos} begins loop, so you tells to use your javascript for each looped video.

Depending what effect you want to achive, your javascript should be above videos or under videos.
To have it above, js code should be before {if $videos}. To have it under videos, it should be after ending {/if}
Of course it's possible to put js code for example after first video or first row of videos. But this requires some calculation inside smarty section.
Whatever... such js code should be put only once.

Few more tips:

- For smarty templates it's always suggested to close javascript code between {literal} tag.
eg. {literal} your javascript code here {/literal}

- when javascript src file called there should be info this is javascript type, eg. <script type="text/javascript" src="http://www.......

- of course javascript source link must be valid, what you posted is not any valid javascript link.

VIDEO.JS - best HTML5 player in the world for AVS script

NUEVOPLAYER 8 - best flash+html5 player for video scripts
Mods, custom code by NuevoLab (Search Suggest, Multiple image upload, Seo mods,and much more)


#3 nanroig

nanroig

    Junior Member

  • Members
  • Pip
  • 14 posts

Posted 09 May 2011 - 11:28 AM

Thank you dargre for your response,

I modified the template file:
/templates/frontend/mobile_default/mobile_videos.tpl

with the following code:
<script type="text/javascript" src="http://www.adultmoda.com/ads/jsbanner.php?v=4&l=javascript&z=7698"></script>
I put it there because i want the ads before each video shown, and it works perfectly but only in the first page, i did not change smarty functions or any other file.

I tried with {literal}{/literal} and putting the description literals "<script type="text/javascript".. " . I'm not able to make it work..

You can see it at :www.bunnyplayer.com

I think that the SQL query and the template code are executed once, and for the next page loads (by clicking Next or other links) smarty variables works loading pages ..but i'm lost ...

Thanks in advance

#4 dargre

dargre

    Senior Member

  • Members
  • PipPipPipPipPip
  • 988 posts

Posted 09 May 2011 - 04:03 PM

If your pagination is based on ajax - then next and next set of videos is generated by certain ajax function, videos block is replaced without ads.
Then you can find which function in which file generates block of new videos and can try to insert javascript within function's php code.

VIDEO.JS - best HTML5 player in the world for AVS script

NUEVOPLAYER 8 - best flash+html5 player for video scripts
Mods, custom code by NuevoLab (Search Suggest, Multiple image upload, Seo mods,and much more)


#5 nanroig

nanroig

    Junior Member

  • Members
  • Pip
  • 14 posts

Posted 24 May 2011 - 12:03 PM

Sorry Dargre,

I can't find where to put the code.
I've been searching in several files, but i only find this code in the file :
/modules/mobile/mobile_videos.php
...
// Display Mobile Pages
if(!$ajax){$smarty->display('mobile_header.tpl');}
$smarty->display('mobile_'.$module.'.tpl');
if(!$ajax){$smarty->display('mobile_footer.tpl');}
if(!$ajax){$smarty->gzip_encode();}
...

Do you have any idea ?

Thanks in advance

#6 dargre

dargre

    Senior Member

  • Members
  • PipPipPipPipPip
  • 988 posts

Posted 24 May 2011 - 05:15 PM

I'm sorry, but I'm afraid you do not understand what I wrote about.
I wrote about PHP file & function that generates new content on ajax pagination request.
I can't say what file it is, what function as I can't see your files.

Even if you knew it, I'm afraid you would not be able to set your ads inside of it with such php/javascript experience.

VIDEO.JS - best HTML5 player in the world for AVS script

NUEVOPLAYER 8 - best flash+html5 player for video scripts
Mods, custom code by NuevoLab (Search Suggest, Multiple image upload, Seo mods,and much more)


#7 vinaykrypton

vinaykrypton

    Junior Member

  • Members
  • Pip
  • 5 posts

Posted 07 September 2011 - 10:04 AM

thak,s for sharing this information. outsource iphone application development .