4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started 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 :
"charset" => $lang['charset'],
add after
"advertby" => $lang['advertby'],
"byadvert" => $lang['byadvert'],
save and exit.
Open lang/english/main.php
find :
?>
add before
$lang['byadvert'] = "Skip Advert";
$lang['advertby'] = "image loading.Please wait..";
now...
Open templates/yourtemplate/details.html
find :
{image}
replace
<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.
-
wow.. thanks alot... ill reply ater tring it
-
Thank youuuu!
-
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.
-
thanks friends.
-
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!
-
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
-
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
-
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
-
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:
<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>
-
is there a demo of this ??
thanks
-
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)
-
wow
thanks alot bro, is this also google approved? its pretty cool
-
wow
thanks alot bro, is this also google approved? its pretty cool
Yes! I´m updated my code
-
Hi,
thanks for this MOD, google ads working fine ;)
Greetz X23