News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Where to insert Banner invocation code

Started by JeF4y, September 13, 2004, 08:49:43 AM

Previous topic - Next topic

JeF4y

Hoping someone can help.

I'm a YaBBSE kinda guy and am running another forum using the new SMF (beta5).  I run PHPadsNEW for banners, and need to know where to insert the invocation code.

Unfortunately I'm not incredibly PHP savvy, so I don't really know where to put the code to make it appear properly. 

My forum is at:  http://www.cbr1000rr.net/forum/index.php

Ideally the banners would be centered below the buttons (home/help/search/etc...).

Any help would be greatly appreciated.

TIA

-Jeff

Vinoth

do u use PHP code, or Javascript generated code,

u can check in my forum, http://www.webhoststalk.com/forum

just tell me, i will help u
Vinoth And Sachin ( SpecHackers Team )
The Best  Way to Help Poor Is not Becoming One Of Them.

JeF4y

"remote invocation for javascript"

Here's the code that needs to go in I just don't know where to put it...


<center>
<script language='JavaScript' type='text/javascript'>
<!--
   if (!document.phpAds_used) document.phpAds_used = ',';
   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
   
   document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
   document.write ("http://www.cbr1000rr.net/phpAdsNew-2.0/adjs.php?n=" + phpAds_random);
   document.write ("&amp;what=zone:1");
   document.write ("&amp;exclude=" + document.phpAds_used);
   if (document.referer)
      document.write ("&amp;referer=" + escape(document.referer));
   document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://www.cbr1000rr.net/phpAdsNew-2.0/adclick.php?n=aa4398ed'; target='_blank'><img src='http://www.cbr1000rr.net/phpAdsNew-2.0/adview.php?what=zone:1&amp;n=aa4398ed'; border='0' alt=''></a></noscript>
</center>

Jay?

If you have not finished this up yet.  Let me know - I'll PM you my header that has the AD's installed.

-Jay

JeF4y

Nope, I haven't finished it.  I'm still waiting for a pointer as to where to put it... (yes, I know how bad that sounds  :P  8) )

Jay?

#5
I have added the index.template.php file on this post.  The main portion of code you are interested in is between lines 157 and 160.

Anyway - you can see this in action at smfhacks.com/forum

Cannot add the file :|

You can download it here: http://www.smfhacks.com/files/pafiledb.php?action=file&id=5


-Jay

JeF4y

No dice... The file is empty and I can't right click to save target as...  :-\

Jay?

It has been fixed - sorry about that.  BTW - the link was also updated!

It did not like tring to download the .php extension - so I zipped it real quick.

-Jay

JeF4y

7 hours, no luck...  my GOD why is this so hard  >:(

Jay, I tried to look through your template, but I see nothing related to my banner code or anything resembling banner invocation code on the lines you mention (or surrounding areas).

I've tried inserting it in various places, but either it comes up in locations that make no sense, or the entire page stops working...

This is frustrating as hell because I know html pretty good, but PHP simply makes no sense to me.  I can't figure out the relationships and structures.  The claim of these templates being "written in html inside of the php" is about the farthest thing from the truth. 

Sorry for venting, I just can't stand wasting this much time on something so seemingly simple.

If anyone can help, please please do...

Jay?

Okay e-mail me your template file, and your invocation code (php version) and I will put it all together.

Or get me on IM and I will work with you there..
-Jay

JeF4y

Jay,

Thank you again for your offer to help.  I just emailed you the particulars.  The forum is located at
www.cbr1000rr.net/forum  if you're interested.

Thanks again.

[Unknown]

Add this code:

<center>
<script language="JavaScript" type="text/javascript">
<!--
   if (!document.phpAds_used) document.phpAds_used = ",";
   phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
   
   document.write ("<" + "script language=\"JavaScript\" type=\"text/javascript\" src=\"");
   document.write ("http://www.cbr1000rr.net/phpAdsNew-2.0/adjs.php?n=" + phpAds_random);
   document.write ("&amp;what=zone:1");
   document.write ("&amp;exclude=" + document.phpAds_used);
   if (document.referer)
      document.write ("&amp;referer=" + escape(document.referer));
   document.write ("\"><" + "/script>");
//-->
</script><noscript><a href="http://www.cbr1000rr.net/phpAdsNew-2.0/adclick.php?n=aa4398ed" target="_blank"><img src="http://www.cbr1000rr.net/phpAdsNew-2.0/adview.php?what=zone:1&amp;n=aa4398ed" border="0" alt=""></a></noscript>
</center>


-[Unknown]

JeF4y

Quote from: [Unknown] on September 14, 2004, 02:15:11 AM
Add this code:


Well, yeah!  This is the code I provided above that I need to add somewhere, but the question is where!?!

Jay?

Provide the php version of the invocation code..

-Jay

JeF4y

Jay,

Here's the code.  I emailed this to you this morning...  For reference, I have *never* been able to get local mode invocation to work with any banners, and IIRC, it will not work with flash banners.  However, remote for javascript has always worked.

Anyhow, here it is...

<?php
    if (@include(getenv('DOCUMENT_ROOT').'/phpAdsNew-2.0/phpadsnew.inc.php')) {
        if (!isset($phpAds_context)) $phpAds_context = array();
        $phpAds_raw = view_raw ('zone:1', 0, '', '', '0', $phpAds_context);
        echo $phpAds_raw['html'];
    }
?>

[Unknown]

Quote from: JeF4y on September 14, 2004, 07:45:17 AM
Quote from: [Unknown] on September 14, 2004, 02:15:11 AM
Add this code:


Well, yeah!  This is the code I provided above that I need to add somewhere, but the question is where!?!

No, actually, I changed it considerably - this one would actually work.  Where do you want it?

-[Unknown]

JeF4y

http://www.cbr1000rr.net/forum

Centered Above or Below the buttons (home/help/search/etc) or even centered in the top of the darker gray background that start the forum topics (next to the folder - cbr1000rr)


JeF4y

Quote from: [Unknown] on September 14, 2004, 02:15:11 AM
No, actually, I changed it considerably - this one would actually work.  Where do you want it?

-[Unknown]

Ahhh. now I see the differences.  However, I can't find where to put it.  I keep trying sensible areas, like after the section that show folder_open.gif in index.template.php, but anywhere that I put it either winds up at the top of the page, or the page comes up totally blank (as in no forum showing up)

[Unknown]

Find:

// Show the menu here, according to the menu sub template.
template_menu();

echo '
</div>';


Replace:
// Show the menu here, according to the menu sub template.
template_menu();

echo '
</div>

THE CODE I GAVE YOU HERE.

';


-[Unknown]

JeF4y

THANK YOU THANK YOU THANK YOU!!!!!

Many hours & much frustration now over. 

Performing *exactly* as I expect.  Thank you so much, once again...  (if you ever have any motorcycle needs, come see me!!)

-Jeff

Advertisement: