• [MOD]Displaying Advertisement before the image. 5 0 5 1
Currently:  

Author Topic: [MOD]Displaying Advertisement before the image.  (Read 17675 times)

0 Members and 1 Guest are viewing this topic.

Offline AKIN

  • Full Member
  • ***
  • Posts: 121
    • View Profile
    • Resim
[MOD]Displaying Advertisement before the image.
« 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.

Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Re: [MOD]Displaying Advertisement before the image.
« Reply #1 on: April 17, 2009, 08:54:29 PM »
wow.. thanks alot... ill reply ater tring it
I'm Back :)

Offline Sumale.my

  • Addicted member
  • ******
  • Posts: 1.790
  • I ♥ 4I
    • View Profile
Re: [MOD]Displaying Advertisement before the image.
« Reply #2 on: April 18, 2009, 12:03:14 AM »
Thank youuuu!
Beste Grüße
Sumale.my

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD]Displaying Advertisement before the image.
« Reply #3 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.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline sanko86

  • Sr. Member
  • ****
  • Posts: 310
    • View Profile
    • Elemegim
Re: [MOD]Displaying Advertisement before the image.
« Reply #4 on: April 20, 2009, 09:17:45 AM »
thanks friends.
Web site:http://www.anlatiyoruz.com
Hayat zorluklarla doludur.Ama en zoru insanın insana düşmanlığıdır.

Offline Anarchology

  • Jr. Member
  • **
  • Posts: 60
  • I LULZ too much!
    • View Profile
    • Tainted Pix
Re: [MOD]Displaying Advertisement before the image.
« Reply #5 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!
A personal THANK YOU to all of the great programmers on this site for helping me get my site from something basic to what it is today!

My site: http://taintedpix.com
(warning: some adult content)

Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Re: [MOD]Displaying Advertisement before the image.
« Reply #6 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
I'm Back :)

Offline GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Re: [MOD]Displaying Advertisement before the image.
« Reply #7 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
I'm Back :)

Offline OWNED91

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: [MOD]Displaying Advertisement before the image.
« Reply #8 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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Administrator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD]Displaying Advertisement before the image.
« Reply #9 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>
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [MOD]Displaying Advertisement before the image.
« Reply #10 on: July 31, 2010, 09:32:42 PM »
is there a demo of this ??

thanks

Offline Sumale.my

  • Addicted member
  • ******
  • Posts: 1.790
  • I ♥ 4I
    • View Profile
Beste Grüße
Sumale.my

Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [MOD]Displaying Advertisement before the image.
« Reply #12 on: August 02, 2010, 09:38:26 PM »
wow

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

Offline Sumale.my

  • Addicted member
  • ******
  • Posts: 1.790
  • I ♥ 4I
    • View Profile
Re: [MOD]Displaying Advertisement before the image.
« Reply #13 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
Beste Grüße
Sumale.my

Offline x23piracy

  • Sr. Member
  • ****
  • Posts: 420
    • View Profile
    • FHG
Re: [MOD]Displaying Advertisement before the image.
« Reply #14 on: October 21, 2010, 01:02:44 AM »
Hi,

thanks for this MOD, google ads working fine ;)


Greetz X23

Don't trust in md5 it's unsafe change your 4i galerys password hash algorythm! second pw db field, create new hashes over some time, deny old hash. Help members that cry, send informationen mail to the rest. Camouflage new pw hash in cookie. Done!

--(◔̯◔)--