4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: ahsancharming on October 08, 2009, 12:55:20 PM

Title: advertisement between image rows?
Post by: ahsancharming on October 08, 2009, 12:55:20 PM
can we add any size banner after the first image row? like

rows...


i m a g e s

a d d s

i m a g e s

i m a g e s

1,2,3,4,>>(paging)
Title: Re: advertisement between image rows?
Post by: V@nо on October 08, 2009, 04:17:04 PM
In categories.php find:
      $thumbnails .= "</tr>\n";
      $count = 0;


Insert below:
      if ($bgcounter == 1)
      {
        $thumbnails .= "<tr class=\"imagerow".$row_bg_number."\">\n";
        $thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
        $thumbnails .= '
your html code here, can be multiline,
don`t need escape quotes:
<a href="index.php">link</a>
';
        $thumbnails .= "\n</td>\n";
        $thumbnails .= "</tr>\n";
      }
Title: Re: advertisement between image rows?
Post by: impss on October 08, 2009, 04:42:25 PM
Change
if ($bgcounter == 2)

to

if ($bgcounter == 1)

In V@no's code to have the ad after the first row of thumbs
Title: Re: advertisement between image rows?
Post by: V@nо on October 08, 2009, 04:49:24 PM
fixed, thanks
Title: Re: advertisement between image rows?
Post by: ahsancharming on April 19, 2010, 05:14:55 AM
this dosnt work fine for me,i've pasted the code like this

Code: [Select]
      if ($bgcounter == 1)
      {
        $thumbnails .= "<tr class=\"imagerow".$row_bg_number."\">\n";
        $thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";
        $thumbnails .= '
google adsense full code here
<a>
';
        $thumbnails .= "\n</td>\n";
        $thumbnails .= "</tr>\n";
      }

when i uploaded the categories.php file my categories page messed up..i have set 3 images in a row..the google adsense banner appears but the category page was fully messed up. please fix it and let me know
thanx
Title: Re: advertisement between image rows?
Post by: V@no on April 19, 2010, 02:37:31 PM
you have extra <a> in the code.
Title: Re: advertisement between image rows?
Post by: bergblume on August 09, 2010, 07:12:37 PM
super sache...

kann man das auch irgendwie mit dem code von openx zum banner einbinden verwenden...
der code schaut so aus

Code: [Select]
<script type='text/javascript'><!--//<![CDATA[
   var m3_u = (location.protocol=='https:'?'./www/delivery/ajs.php':'http://www.via-ferrata.de/via/www/delivery/ajs.php');
   var m3_r = Math.floor(Math.random()*99999999999);
   if (!document.MAX_used) document.MAX_used = ',';
   document.write ("<scr"+"ipt type='text/javascript' src='"+m3_u);
   document.write ("?zoneid=2");
   document.write ('&amp;cb=' + m3_r);
   if (document.MAX_used != ',') document.write ("&amp;exclude=" + document.MAX_used);
   document.write (document.charset ? '&amp;charset='+document.charset : (document.characterSet ? '&amp;charset='+document.characterSet : ''));
   document.write ("&amp;loc=" + escape(window.location));
   if (document.referrer) document.write ("&amp;referer=" + escape(document.referrer));
   if (document.context) document.write ("&context=" + escape(document.context));
   if (document.mmm_fo) document.write ("&amp;mmm_fo=1");
   document.write ("'><\/scr"+"ipt>");
//]]>--></script><noscript><a href='./www/delivery/INSERT_RANDOM_NUMBER_HERE' target='_blank'><img src='./www/delivery/avw.php?zoneid=2&amp;cb=INSERT_RANDOM_NUMBER_HERE' border='0' alt='' /></a></noscript>

wenn ich das allerdings an die genannte Stelle einfüge erhalte ich:
Quote
Parse error: syntax error, unexpected T_STRING in .../categories.php on line 251

was muss ich ändern?
Title: Re: advertisement between image rows?
Post by: V@no on August 09, 2010, 08:01:56 PM
Are you trying use javascript code inside php? if so, it's never going to work. Perhaps you need insert that code in cetegories.html template instead.
Title: Re: advertisement between image rows?
Post by: bergblume on August 09, 2010, 08:05:53 PM
Are you trying use javascript code inside php? if so, it's never going to work. Perhaps you need insert that code in cetegories.html template instead.
Edit...

ok..solved by myself...
I only have to put this part in categories.php
Quote
<a href="./www/delivery/INSERT_RANDOM_NUMBER_HERE" target="_blank"><img src="./www/delivery/avw.php?zoneid=2&amp;cb=INSERT_RANDOM_NUMBER_HERE" alt="" /></a>
and the rest of the code in header.html

this works fine now!

BUt one question I have left... can I exclude somehow specific categories??

thank you, v@no!
Title: Re: advertisement between image rows?
Post by: V@no on August 09, 2010, 11:42:56 PM
oh, I see now where that code meant to go...my bad :)
I know it's irrelevant now, but the reason you got that error is because in this particular case you have to escape every single-quote in your HTML/JavaScript with a back slash: \'


As of exclude some categories, try replace
      if ($bgcounter == 1)


with:
      if ($bgcounter == 1 && !in_array($cat_id, array(1,2,3)))

(numbers 1,2,3 are the categories IDs you want to exclude)
Title: Re: advertisement between image rows?
Post by: bergblume on August 10, 2010, 09:46:10 AM
good morning v@no!

works like a charm!! thank you!! perfect modification!!

 :D
Title: Re: advertisement between image rows?
Post by: regina on August 14, 2010, 11:36:47 PM
you have extra <a> in the code.

Hi Vano  ,

How are you  8)

When I try to add my adsense code, it doesnt work.

Can you help me? Also I dont have extra <a> in the code.  :P
Title: Re: advertisement between image rows?
Post by: Szooguun on July 06, 2011, 01:17:19 PM
Sorry for my English. I refresh the topic.
Adds extensive advertising
It is inserted below the first picture.
How to add advertising to the width of the line?
Title: Re: advertisement between image rows?
Post by: willy201174 on July 06, 2011, 01:42:12 PM
i have the same trouble.
Title: Re: advertisement between image rows?
Post by: Szooguun on July 06, 2011, 01:56:01 PM
I give example:

looks like this:

http://img534.imageshack.us/img534/4495/screen1fi.jpg

is supposed to look like this:

http://img828.imageshack.us/img828/4234/screen2ec.jpg

Please help.

Title: Re: advertisement between image rows?
Post by: Rembrandt on July 07, 2011, 05:37:32 PM
....
is supposed to look like this:
...
search in the code: ( http://www.4homepages.de/forum/index.php?topic=26027.msg141892#msg141892 )
$thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

and replace:
$thumbnails .= "<td colspan=\"".$config['image_cells']."\" valign=\"top\">\n";


mfg Andi
Title: Re: advertisement between image rows?
Post by: Szooguun on July 11, 2011, 12:51:14 PM
....
is supposed to look like this:
...
search in the code: ( http://www.4homepages.de/forum/index.php?topic=26027.msg141892#msg141892 )
$thumbnails .= "<td width=\"".$imgtable_width."\" valign=\"top\">\n";

and replace:
$thumbnails .= "<td colspan=\"".$config['image_cells']."\" valign=\"top\">\n";


mfg Andi


THX :)
Title: Re: advertisement between image rows?
Post by: J.Lond on July 20, 2012, 12:37:08 PM
I have managed to get this working on the index page with new images.  Plain text and html code work fine but when I use my own custom language tags {blahblahblah} they do not show up.  The language tags work properly when placed in the home template.  I am using version 1.7.11.  Thank you.
Title: Re: advertisement between image rows?
Post by: Rembrandt on July 20, 2012, 06:43:31 PM
Hi!
you must register your custom tags in the categories.php or where ever

$site_template->register_vars("blahbla", $lang['blablub']);

or:

$site_template->register_vars(array(
"blahbla" => $lang['blablub'],
"huhu" => $lang['blubblub'],
"hallo" => $lang['huhu']
));


mfg Andi