Author Topic: advertisement between image rows?  (Read 19519 times)

0 Members and 1 Guest are viewing this topic.

Offline ahsancharming

  • Newbie
  • *
  • Posts: 39
    • View Profile
advertisement between image rows?
« 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)

Offline V@nо

  • Addicted member
  • ******
  • Posts: 1.223
    • View Profile
Re: advertisement between image rows?
« Reply #1 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";
      }
« Last Edit: October 08, 2009, 04:48:49 PM by V@nо »
Your first three "must do" before you ask a question:
If I asked you to PM me, I meant PM to my primary account, this account doesn't accept PMs.

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Re: advertisement between image rows?
« Reply #2 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

Offline V@nо

  • Addicted member
  • ******
  • Posts: 1.223
    • View Profile
Re: advertisement between image rows?
« Reply #3 on: October 08, 2009, 04:49:24 PM »
fixed, thanks
Your first three "must do" before you ask a question:
If I asked you to PM me, I meant PM to my primary account, this account doesn't accept PMs.

Offline ahsancharming

  • Newbie
  • *
  • Posts: 39
    • View Profile
Re: advertisement between image rows?
« Reply #4 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

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: advertisement between image rows?
« Reply #5 on: April 19, 2010, 02:37:31 PM »
you have extra <a> in 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 bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: advertisement between image rows?
« Reply #6 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?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: advertisement between image rows?
« Reply #7 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.
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 bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: advertisement between image rows?
« Reply #8 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!
« Last Edit: August 10, 2010, 09:47:18 AM by bergblume »

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: advertisement between image rows?
« Reply #9 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 == && !in_array($cat_id, array(1,2,3)))

(numbers 1,2,3 are the categories IDs you want to exclude)
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 bergblume

  • Sr. Member
  • ****
  • Posts: 463
  • on to the top!
    • View Profile
Re: advertisement between image rows?
« Reply #10 on: August 10, 2010, 09:46:10 AM »
good morning v@no!

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

 :D

Offline regina

  • Newbie
  • *
  • Posts: 16
    • View Profile
Re: advertisement between image rows?
« Reply #11 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

Offline Szooguun

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: advertisement between image rows?
« Reply #12 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?

Offline willy201174

  • Pre-Newbie
  • Posts: 1
    • View Profile
Re: advertisement between image rows?
« Reply #13 on: July 06, 2011, 01:42:12 PM »
i have the same trouble.

Offline Szooguun

  • Newbie
  • *
  • Posts: 47
    • View Profile
Re: advertisement between image rows?
« Reply #14 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.