vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Using PHPadsnew 2 with Vbulletin 3. (https://vborg.vbsupport.ru/showthread.php?t=75475)

epic1 04-14-2005 05:49 PM

Has anyone integrated phpadsnew with magnus's AdColumns1.0 ?

I want to add a sidebar that rotates the display order on my forum on every refresh. I already have the zone and ads setup, just not sure how to deliver it with this script.

bL@De 04-16-2005 11:04 AM

Hi,
I've struck a slight problem which I can't workout. I have tested the following on my internal test site which works flawlessly following the instructions on page 1 however no matter what I do it doesn't show the banner.

My phpinclude_start is as follows
Quote:

if (@include(getenv('DOCUMENT_ROOT').'/sponsors/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('', 0, '_blank', '', '0', $phpAds_context);
}
I've then put in my header
Quote:

<center>$phpAds_raw[html] <center />
I've removed the 'center' part but the problem is persisting that's for sure. No error bounces back just no banners are displayed and the pages looks as normal as it normally is.

Any ideas would be great.

Cheers
Darren

Pulsorock 04-20-2005 01:44 AM

I'm using Max Media Manager 0.1x (same as PAN2.1) but I can't make it work. The phpinclude_start has this:
PHP Code:

ob_start();
    if (@include(
getenv('DOCUMENT_ROOT').'/maxserver/phpadsnew.inc.php')) {
        if (!isset(
$phpAds_context)) $phpAds_context = array();
        
$phpAds_raw view_local (''500'_blank''''0'$phpAds_context);
    }
ob_end_clean(); 

But on the forum I get Database error
Quote:

Database error in vBulletin 3.0.3:

Invalid SQL:
SELECT
user.username, (user.options & 512) AS invisible, user.usergroupid,
session.userid, session.inforum, session.lastactivity,
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid
FROM session AS session
LEFT JOIN user AS user ON(user.userid = session.userid)
WHERE session.lastactivity > 1113963706
ORDER BY username ASC

mysql error: Table 'maxmediamanager.user' doesn't exist

mysql error number: 1146

Date: Tuesday 19th of April 2005 10:36:46 PM
Script: http://www.pulsorock6.com:8081/foro/?styleid=5
Any idea? :disappointed:

Michael Morris 04-21-2005 11:29 AM

Quote:

Originally Posted by Pulsorock
I'm using Max Media Manager 0.1x (same as PAN2.1) but I can't make it work. The phpinclude_start has this:
PHP Code:

ob_start();
    if (@include(
getenv('DOCUMENT_ROOT').'/maxserver/phpadsnew.inc.php')) {
        if (!isset(
$phpAds_context)) $phpAds_context = array();
        
$phpAds_raw view_local (''500'_blank''''0'$phpAds_context);
    }
ob_end_clean(); 

But on the forum I get Database error

Any idea? :disappointed:

Not familiar with MaxMediaManager, but your view_local function call isn't specifying a zone, and the PHP Ads new function is view_raw.

Also, is you're ad server on the same machine as your vbulletin? If not that would explain the SQL error, which appears to be caused by the SQL server you're talking to not having the appropriate table.

sdsvtdriver 04-27-2005 05:13 AM

Michael,

Thanks for the information. It works great.

Oddly enough, on my first site, it gives me the option to use local invocation, but on the second, only javascript.

This is probably due to the fact the second site is on a different webserver, but alas, it works.

Thanks again

cerebro 06-14-2005 03:03 AM

i have a logout problem whit this code...some1 test if can logout whit this code on?

GetGamer.com 06-17-2005 09:51 PM

For the life of me, I can't get this to work. Here is my phpinclude_start template:
PHP Code:

/*
// Example of how to include a seperate file:

ob_start();
include('yourheader.html');
$your_code = ob_get_contents();
ob_end_clean();

// Now place a reference to $your_code where you want the resulting HTML to be displayed.
// This will most likely be the header or footer template.
*/

    
if (@include(getenv('DOCUMENT_ROOT').'/a/phpadsnew.inc.php')) {
        if (!isset(
$phpAds_context)) $phpAds_context = array();
        
$phpAds_raw view_raw ('zone:24'0'''''0'$phpAds_context);
    } 

The invocation code was cut-and-pasted from phpAdsNew (which I've been using successfully with Javascript invocation for ages).

And here is a snippet from my footer template showing two different zones, one with local invocation and the other with javascript:
PHP Code:

<!-- 120 x 600 zone -->            
$phpAds_raw[html]
<
br />
<!-- 
120 x 240 zone -->
<
script language='JavaScript' type='text/javascript'>
<!--
   if (!
document.phpAds_useddocument.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.bigblueball.com/a/adjs.php?n=" phpAds_random);
   
document.write ("&amp;what=zone:19");
   
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.bigblueball.com/a/adclick.php?n=aa4c0db4' target='_blank'><img src='http://www.bigblueball.com/a/adview.php?what=zone:19&amp;n=aa4c0db4' border='0' alt=''></a></noscript

The javascript invocation method works fine, but not the local method. You can see this in action here. Note that the ads actually appear in the right-hand column, even though the are part of the footer template.

Any ideas as to why I can't get local invocation to work?

EDIT: As a test, I tried local invocation on a non-forum page at the same site, and it works fine. You can see this on http://www.bigblueball.com/index.php (it's serving the 120x90 ad in in the right column). Still can't get it to work in the forums though.

EDIT: After re-pasting the invocation code a second time, it seems to be working now. Nevermind..... :)

Trana 06-23-2005 05:43 AM

I am experiencing a strange problem when using this script.

To begin with, I originally added the banner to my page with the ob method described on the vbulletin website. When I found this thread, I removed those methods and added the php code directly to the include file as described here.

The banners work fine.

Unfortunately, I have a "shoutbox" module (CMPS) which is not working now that I added the phpadsnew script to my header. The shoutbox has not displayed properly with either method of calling the phpadsnew script.

The reason that I know these two are related, is that in the shoutbox module window, I get the following error message:

Table 'bannerads.adv_shoutbox' doesn't exist

So obviously, phpadsnew is changing the database from "forum" to "bannerads", running the script, and then for some reason not going back to the original database. I am guessing that it needs to do a USE FORUM sql statement in order to get the default database back into the focus.

So, do you think it is the phpadsnew or the shoutbox that needs the tweak? Any ideas on what could be causing this?

Thanks.

jsharper 07-06-2005 03:02 PM

Quote:

Originally Posted by cerebro
i have a logout problem whit this code...some1 test if can logout whit this code on?

I'm also having a logout problem. Whenever my phpinclude_start is calling phpadsnew.inc.php, my vBulletin logout function is broken. clicking Log Out just returns a blank page and doesn't actually perform the logout.

Ideas? I'm using vBulletin 3.0.7 and phpAdsNew 2.0.5. I did try both with and without "Use database compatibility mode".

Razasharp 07-07-2005 04:04 PM

Thanks for a brill tutorial Michael!

Can I just ask you to check what I'm doing is ok please? (It all seems to be working ok)

I have two zones on the same page and this is how I've set it up:

My phpinclude star file contains:

HTML Code:

if (@include(getenv('DOCUMENT_ROOT').'/adserver/phpadsnew.inc.php'))

if (!isset($phpAds_context))
{
    $phpAds_context = array();
        $phpAds_raw = view_raw ('zone:2', 0, '_blank', '', '0', $phpAds_context);
}
{

$phpAds_context2 = array();
        $phpAds_raw2 = view_raw ('zone:3', 0, '_blank', '', '0', $phpAds_context2);
 }

And the pages contain:

$phpAds_raw[html] -where I want the first zones ads to show, and,

$phpAds_raw2[html] -where I want zone two ads to show.

It all seems to be working fine, but just wondered if I have done it right or not!

Thanks for looking.


All times are GMT. The time now is 09:41 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02578 seconds
  • Memory Usage 1,781KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (4)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete