4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: AKIN on March 07, 2009, 04:07:58 PM

Title: [MOD]Displaying Advertisement before the image.
Post by: AKIN on March 07, 2009, 04:07:58 PM
Hi all.
It's my first mod, please excuse my English.
Advertisement codes are displayed before the image is loaded which we add.
We can skip the advertisement without waiting.
Display time of advertisement can be adjusted.
The package includes "loading images".


Open includes/page_header.php
find :
Code: [Select]
  "charset" => $lang['charset'], add after
Code: [Select]
  "advertby" => $lang['advertby'],
  "byadvert" => $lang['byadvert'],
save and exit.

 Open lang/english/main.php
find :
Code: [Select]
?> add before
Code: [Select]
$lang['byadvert'] = "Skip Advert";
$lang['advertby'] = "image loading.Please wait..";


now...

 Open templates/yourtemplate/details.html
find :
Code: [Select]
{image}replace

Code: [Select]
<script>
window.setTimeout("document.getElementById('adverts').style.display = 'none';document.getElementById('himself').style.display = '';",5000);
</script>

<div id="adverts">
<div align="right"><font face="Arial" style="font-size: 10pt; font-weight: 700"><a href="#" onclick="document.getElementById('adverts').style.display = 'none';document.getElementById('himself').style.display = '';">
    {byadvert}</font></div>
<center>
<font face="Arial" style="font-size: 9pt; ">{advertby}</font><font face="Arial" style="font-size: 9pt; font-weight: 700"><br>
</font><img border="0" src="{template_url}/images/load.gif"><br>
YOUR ADVERT CODE.

</div>

<div id="himself" style="display:none";>

{image}

</div> 
 




note: using google adsense is forbidden. please use codes of other advertising companies.

[EDIT by V@no]
moved "find:" out of the code block.
Title: Re: [MOD]Displaying Advertisement before the image.
Post by: GaYan on April 17, 2009, 08:54:29 PM
wow.. thanks alot... ill reply ater tring it
Title: Re: [MOD]Displaying Advertisement before the image.
Post by: Sunny C. on April 18, 2009, 12:03:14 AM
Thank youuuu!
Title: Re: [MOD]Displaying Advertisement before the image.
Post by: V@no on April 18, 2009, 01:27:57 AM
note: using google adsense is forbidden. please use codes of other advertising companies.

Just out of curiosity, why is it forbidden?

P.S.
please don't put anything else but the code people supposed to find into code block, it's confusing and might create problems when searching for needed part of the code.
Title: Re: [MOD]Displaying Advertisement before the image.
Post by: sanko86 on April 20, 2009, 09:17:45 AM
thanks friends.
Title: Re: [MOD]Displaying Advertisement before the image.
Post by: Anarchology on April 22, 2009, 04:22:32 AM
Hi,

Is there any demo of this mod? This mod sounds pretty interesting. Also, is there a way to alternate through page views before someone can see the advertisement? It would be very nice to be able to make the ad show up every X amount of page views rather than on every image view for my application.

Thanks in advance!
Title: Re: [MOD]Displaying Advertisement before the image.
Post by: GaYan on April 29, 2009, 09:34:59 AM
y cant i add google adds in thier .. i saw that i many web sites .... i changed the sript slightly////...............

now ,, i will never think that google will tell anything on placing adds ..

i modified it.. even after the image is loaded .. the add is  thier ... its below the rael image ... if u like to see a working demo .. PM me .. i cant spam the board :D
Title: Re: [MOD]Displaying Advertisement before the image.
Post by: GaYan on December 31, 2009, 10:10:52 AM
cant we modify this like to a manner like this,

if the image is higher than 1mb - show the advertisement 20 seconds and if its less than 1mb show the advertisement 10 seconds
Title: Re: [MOD]Displaying Advertisement before the image.
Post by: OWNED91 on March 03, 2010, 01:23:04 AM
cant we modify this like to a manner like this,

if the image is higher than 1mb - show the advertisement 20 seconds and if its less than 1mb show the advertisement 10 seconds

I can explain how this is, please, sorry for my english
Title: Re: [MOD]Displaying Advertisement before the image.
Post by: V@no on March 03, 2010, 02:49:12 AM
In includes/functions.php find:
      $file_size = format_file_size($file_size);

Insert above:
      $file_size_real = $file_size;



Find:
    "image_file_size" => $file_size,

Insert below:
    "image_file_size_real" => @$file_size_real ? $file_size_real : 0,



In details.html template replace javascript code from code above with this:
Code: [Select]
<script>
var size = {image_file_size_real};
var adTime = 5000;
if (size > 2048) //start with the largest number
{
  adTime = 20000;
}
else if (size > 1024)
{
  adTime = 10000;
}
window.setTimeout("document.getElementById('adverts').style.display = 'none';document.getElementById('himself').style.display = '';",adTime);
</script>
Title: Re: [MOD]Displaying Advertisement before the image.
Post by: zakaria666 on July 31, 2010, 09:32:42 PM
is there a demo of this ??

thanks
Title: Re: [MOD]Displaying Advertisement before the image.
Post by: Sunny C. on August 02, 2010, 09:34:35 PM
Here is my Version: [MOD] Displaying Advertisement before the image / Zeige Werbung vor dem Bild  (http://www.4homepages.de/forum/index.php?topic=27625.0)
Title: Re: [MOD]Displaying Advertisement before the image.
Post by: zakaria666 on August 02, 2010, 09:38:26 PM
wow

thanks alot bro, is this also google approved? its pretty cool
Title: Re: [MOD]Displaying Advertisement before the image.
Post by: Sunny C. on August 02, 2010, 10:19:09 PM
wow

thanks alot bro, is this also google approved? its pretty cool

Yes! I´m updated my code
Title: Re: [MOD]Displaying Advertisement before the image.
Post by: x23piracy on October 21, 2010, 01:02:44 AM
Hi,

thanks for this MOD, google ads working fine ;)


Greetz X23