vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   phpAdsNew Banner Ads integration (advertisements, classified ads, Adsense, etc.) (https://vborg.vbsupport.ru/showthread.php?t=100229)

The M.I.P. 11-05-2005 10:00 PM

phpAdsNew Banner Ads integration (advertisements, classified ads, Adsense, etc.)
 
OpenAds / phpAdsNew Integration 1.0.4 for vBulletin 3.[56].x
2006-06-08 by mip

Integrates the OpenAds / phpAdsNew ads system by introducing a new template tag <ad ... />.
You can even deliver your Adsense stuff via phpAdsNew using HTML banners.

The features of phpAdsNew combined with the power of vBulletin's templating system gives you the possibility to place ads for specific user groups, forums, and keywords.

PREREQUISITES:
This plugin requires a working installation (local or remote) of a recent version ofOpenAds / phpAdsNew (free software released under the GPL).
When using OpenAds, replace phpAdsNew in this documentation with OpenAds (phpAdsNew is just the predecessor of OpenAds).

INSTALLATION:
When having a previous version of this product installed, see section UPGRADE instead.

Install product "phpadsnew-1.0.4.xml".
Set phpAdsNew path in Server Settings and Optimization Options to point to either your local phpAdsNew installation or a remote server (using XML-RPC).
It is strongly recommended to set $phpAds_config['compatibility_mode'] = true; in phpAdsNew config file, to prevent problems when phpAdsNew uses a database different from the one used by your vBulletin board.

When using XML-RPC, make sure to have lib-xmlrpc-class.inc.php and lib-xmlrpc.inc.php copied from phpAdsNew misc/samples/xmlrpc/php/ to your forum's includes/ directory (not necessary when using a local phpAdsNew installation).

Read the NOTES section below.

Click INSTALL in this thread to mark product as "installed" and receive notifications when a new version comes out.

UPGRADE:
  • 1.0.3 --> 1.0.4
    1. Import product as usual, with "Allow Overwrite" set to Yes.
  • 1.0.2 --> 1.0.3
    Upgrading is recommended, as this is a bugfix release.
    1. Import product as usual, with "Allow Overwrite" set to Yes.
    2. Recompile any templates where you experienced problems with the <ad .../> tag (notably those where this tag is used repeatedly on a line).
  • 1.0.1 --> 1.0.2
    1. Import product as usual, with "Allow Overwrite" set to Yes.
    2. Set $phpAds_config['compatibility_mode'] = true; in phpAdsNew config file.
  • 1.0 --> 1.0.1
    There's basically no need to upgrade, as the changes don't affect a working installation, but I recommend to do so, to ease possible upgrades in the future.
    1. Import product as usual, with "Allow Overwrite" set to Yes.
    2. Alter the path to phpAdsNew in vBulletin Server Settings and Optimization Options to point to your phpAdsNew installation.
      As opposed to version 1.0 of this product, a local path is not relative to the DOCUMENT_ROOT.

USAGE:
Use the newly introduced <ad ... /> tag in your templates.
The syntax is similar to phpAdsNew's view_raw() function call - the tag understands what, clientid, target, source, and withtext as arguments.

Please make yourself familiar with phpAdsNew prior to using this product. You can't expect this product to work, if you didn't check if your phpAdsNew is delivering your banners cleanly.

Examples:
  • Get banner using keywords:
    <ad what="foo|bar" />
  • Get banner for guest usergroup (in this case, "ug1" must be set as a keyword in phpADsNew, see 2nd screenshot):
    <ad what="ug$bbuserinfo['usergroupid']" />
    (same technique can be applied to deliver forum-specific ads)
  • Similar invocation using template conditionals:
    <if condition="$bbuserinfo['usergroupid']==1"><ad what="" /></if>

NOTES:
  1. Always use the latest stable version of phpAdsNew.
    Old versions had bugs and some even had severe security issues - I'll give no support for installations with an outdated phpAdsNew.
    At the time of writing, latest version is 2.0.8.
  2. Templates which make use of the ad-tag might need to get recompiled after product change.
  3. Recommendations for heavy-duty servers: Move the plugin code to files; try to avoid using xml-rpc or cache xml-rpc requests (e.g. with memcache).
  4. Have an eye on current phpAdsNew security issues
  5. This product comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.
  6. Support is provided at will.
    Don't expect help if you haven't read instructions or phpAdsNew manual, if you're using non-standard vBulletin software or if your problem descriptions are useless.

PS:
This plugin is donationware - it helps you to make some money, so please be fair and honor my work with an adequate pecuniary donation.
https://vborg.vbsupport.ru/ Donate via Paypal

Snake 11-06-2005 05:02 PM

This is great! Thank you!

michaelbenson 11-06-2005 05:28 PM

Shouldnt you attach the download file?
Looks good though.

reteep 11-06-2005 06:03 PM

Sounds very nice!

romow 11-06-2005 06:25 PM

Thanks for the mod. will try it out later.

lexx27 11-06-2005 09:22 PM

This is similar to something that i want. I want the users avatar to be placed at the header of the site!!!

The M.I.P. 11-06-2005 09:45 PM

Quote:

Originally Posted by lexx27
This is similar to something that i want. I want the users avatar to be placed at the header of the site!!!

This is not what you're looking for.
Have a look at https://vborg.vbsupport.ru/showthread.php?t=100254 instead.

jugo 11-06-2005 11:11 PM

Two excellent hacks in one day...Big Ups to you!!!

lexx27 11-07-2005 12:50 AM

Quote:

Originally Posted by The M.I.P.
This is not what you're looking for.
Have a look at https://vborg.vbsupport.ru/showthread.php?t=100254 instead.

Thank you very much!

tamarian 11-07-2005 01:12 AM

Well done :up:

LincolnForums 11-07-2005 04:18 AM

its hard to download that xml file using Firefox.

any chance of getting a zipped package?

The M.I.P. 11-07-2005 05:09 AM

Quote:

Originally Posted by LincolnForums
its hard to download that xml file using Firefox.
any chance of getting a zipped package?

For your convenience, MIME-type of phpadsnew-1.0.xml is now set to application/octet-stream which should make your browser ask to save the file instead of open it.

BTW:
There's also a "save as" dialogue in the context menu of your browser.

dreck 11-07-2005 12:04 PM

sweet.. I just install phpAdsNew just the other day.
This will definally come in handy.

Now I just have to figure out how to use it. ;)

/install

LincolnForums 11-07-2005 09:04 PM

Quote:

Originally Posted by The M.I.P.
For your convenience, MIME-type of phpadsnew-1.0.xml is now set to application/octet-stream which should make your browser ask to save the file instead of open it.

BTW:
There's also a "save as" dialogue in the context menu of your browser.

thank you very much

tamborinegal 11-08-2005 02:07 AM

This looks like just what I need, but can I place an ad anywhere else or only in the header template? I'd love it if I could use it after the first post in a thread for example.

Thanks :)

jimporter 11-08-2005 09:41 AM

Quote:

Originally Posted by tamborinegal
This looks like just what I need, but can I place an ad anywhere else or only in the header template? I'd love it if I could use it after the first post in a thread for example.

Thanks :)

Tamborinegal, see this post How To Show A Banner After The First Post In A Thread and amend accordingly.

Milez 11-08-2005 11:05 AM

Testing this on a busy board. Problem is my ads will not display and since they display normally on non vbulletin pages I am assuming it is the setting in the admincp for the path to PAN. Since my PAN install is outside of the vbb document root the setting does not seem to work: /web/adserve. I have tried ../web/adserve and no go either.

Anyone run into this?

What a shame. I really do not want to guinea pig the XML-RPC method.

The M.I.P. 11-08-2005 12:03 PM

Quote:

Originally Posted by tamborinegal
This looks like just what I need, but can I place an ad anywhere else or only in the header template? I'd love it if I could use it after the first post in a thread for example.

You can use the <ad ... /> tags anywhere in your templates. When using multiple <ad ... /> tags on a page, you should define an own zone for each ad in phpAdsNew - see the phpAdsNew user guide for more infos.

Milez 11-08-2005 12:55 PM

Strange still no go. I used a relative path like /web/adserve. I added a banner in my header template like: <ad what="zone:2" />

Q: Have you tested this for anything beyond .html banners I see you are using above? My banners are all images but I did not think that would make a difference.

Milez 11-08-2005 02:03 PM

Sorry...Banners are displaying now.

My issue now is that the options for the <ad> tags are not bringing up the right zones. <ad what="zone:2" /> is a rotating 468x60 banner with a few image banners but other unrelated banners are being displayed for some reason. I tried targetting specific banners with clientid="x" as well but no dice.

From looking at your code this really should be working.

Milez 11-08-2005 02:12 PM

Very sorry. I had an issue with PAN.

This script works fantabulous and I have been waiting for some time for it. Until recently I was only able to get ads to appear with the Javascript invoking method which slows most busy VB boards to a crawl. Hopefully by invoking with PHP this is MUCH faster.

Thumbs up to the new plugin system in VB3.5 and thanks to the author of this mod. I suggest anyone using PAN & VB check this out.

Corriewf 11-08-2005 03:49 PM

Too bad there is a bug in the newest version of php which prevents logging into this.....

LincolnForums 11-08-2005 03:53 PM

i keep getting this error.

Warning: in_array(): Wrong datatype for second argument in /includes/lib-xmlrpc.inc.php on line 571

I copied both the lib- files to my includes directory

The M.I.P. 11-08-2005 04:20 PM

Quote:

Originally Posted by LincolnForums
i keep getting this error.

Warning: in_array(): Wrong datatype for second argument in /includes/lib-xmlrpc.inc.php on line 571

Did you add global $xmlrpc_valid_parents; to line 76 of lib-xmlrpc.inc.php as told in the "NOTES" section of my first post?

tamborinegal 11-09-2005 04:13 AM

Quote:

Originally Posted by The M.I.P.
You can use the <ad ... /> tags anywhere in your templates. When using multiple <ad ... /> tags on a page, you should define an own zone for each ad in phpAdsNew - see the phpAdsNew user guide for more infos.

Thanks, will definately be trying this out in the next couple of days. Looks great. Will let you know how it goes.

Cheers :)

Milez 11-09-2005 05:43 AM

Quote:

Too bad there is a bug in the newest version of php which prevents logging into this.....
Referring to PAN I assume. I found this to be true on Windows boxes but not *nix.

The M.I.P. 11-09-2005 12:01 PM

There's a preliminary phpAdsNew 2.0.7 version as a workaround for the PHP 4.4.1 bug.

lsgworldl 11-09-2005 09:18 PM

this is how I have it set up, cant get it to work

Header

PHP Code:

<!-- logo -->
<
a name="top"></a>
<
table border="0" width="$stylevar[outertablewidth]cellpadding="0" cellspacing="0" align="center">
<
tr>
    <
td align="$stylevar[left]"><a href="$vboptions[forumhome].php$session[sessionurl_q]"><img src="$stylevar[titleimage]border="0" alt="$vboptions[bbtitle]/></a></td>
    <
td align="$stylevar[right]">
        <
ad what="zone:1" />
    </
td>
</
tr>
</
table>
<!-- /
logo -->

<!-- 
content table -->
$spacer_open

$_phpinclude_output 

path to adsnew

/home/lsgworld/public_html/adsnew

code from adsnew

PHP Code:

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


The M.I.P. 11-10-2005 03:53 AM

Quote:

Originally Posted by lsgworldl
path to adsnew

/home/lsgworld/public_html/adsnew

How did you specify the path to phpAdsNew in vBulletin's Server Settings and Optimization Options?
The correct setting seems to be /adsnew in your case.

Please also make sure that phpAdsNew is set up correctly and working smoothly to be able to narrow down the origin of possible problems.

lsgworldl 11-10-2005 01:18 PM

Quote:

How did you specify the path to phpAdsNew in vBulletin's Server Settings and Optimization Options?
The correct setting seems to be /adsnew in your case.
Location of phpAdsNew = /home/lsgworld/public_html/adsnew :bunny:

Quote:

If your local phpAdsNew installation is outside the DOCUMENT_ROOT of vBulletin forum, see point e) from the NOTES section of my first post.
I dont knolw what that means??? what is the DOCUMENT_ROOT??? :alien:

Quote:

Please also make sure that phpAdsNew is set up correctly and working smoothly to be able to narrow down the origin of possible problems
phpAdsNew was set up ising fantastico, so yes it is set up correct :banana:

The M.I.P. 11-10-2005 04:00 PM

@lsgworldl
Please use new version 1.0.1. This should solve the confusion concerning paths.

scottct1 11-14-2005 06:03 PM

How do I set this up so that in each forum there is a different zone shown?

Some of my forums are sponsored and in those forums I want only those ads shown, and in the unsponsored areas I want another zone shown.

Thanks.

The M.I.P. 11-15-2005 04:24 AM

Quote:

Originally Posted by scottct1
How do I set this up so that in each forum there is a different zone shown?

Some of my forums are sponsored and in those forums I want only those ads shown, and in the unsponsored areas I want another zone shown.

You do this by either using banner keywords as shown in my fourth example or you set the zones explicitly with template conditionals like I have shown in my fifth example:
Code:

<if condition="$foruminfo['forumid']==123 OR $foruminfo['forumid']==456">
  <ad what="zone:1" />
<else />
  <ad what="zone:2" />
</if>

Another possibility is the use of phpAdsNew client-ids:
Code:

<if condition="$foruminfo['forumid']==123 OR $foruminfo['forumid']==456">
  <ad clientid="1" />
<else />
  <ad clientid="2" />
</if>

You can also mix client-id with keywords, zone names, etc. - see your phpAdsNew manual for info. The ad-tag works similiar to the view_raw() function of phpAdsNew.

salsabil 11-15-2005 05:12 AM

Hi,

I'm trying to get to this work but nothing is showing up unfortunately.

I tested out phpadnews on a .php page to make sure that was functioning and it was.

I'm wondering if I've set the path wrong. My path I put was ../banners/ but the full path is /home/aussie/public_html/forums/banners/

Thankyou!

The M.I.P. 11-15-2005 05:19 AM

Quote:

Originally Posted by salsabil
I'm wondering if I've set the path wrong. My path I put was ../banners/ but the full path is /home/aussie/public_html/forums/banners/

The base directory for inclusion is your forum's directory, so in your case, the correct path would be "./banners". You can also specify the full path.

(Your "../banners" would point to "/home/aussie/public_html/forums/../banners" which translates to "/home/aussie/public_html/banners/")

salsabil 11-15-2005 05:30 AM

Ah great! :) It's working now. Amazing how much of a difference a . can make!

Thanks so much for the great plugin.

tassoman 11-15-2005 11:31 AM

Hi!
I'm still trying to get plugin working outside forum root, cause I want to manage ads also into another 3rd level domain, for now called www.

While I ask forum pages, all runs ok. Ads are called from forum.dmn.tld/adv subdir.
If i ask vbadvanced homepage into www, banners images (and links) are broken, cause theire called from www.dmn.tld/adv

I've tried to edit "Replacements" adding adlog.php, adimage.php, adclick.php for vba in admincp, but seems not works.
The /adv directory shown into templates still the same of domain where page was called.

The M.I.P. 11-15-2005 12:30 PM

@tassoman:
First try to set the full path to phpAdsNew (instead of a relative one) in the settings of this product, to be sure that inclusion of phpadsnew.inc.php also works, when you're using the templating system in scripts outside of the forum's installation directory.
Also check if your $phpAds_config['url_prefix'] setting in phpAdsNew's config.inc.php is a valid absolute URL (e.g. http://example.com/phpadsnew/).

If this doesn't solve your problems, please be more precise and also post a link to your site (or show relevant parts of code (notably the HTML between <!-- BEGIN/END ad ...--> comments) and screenshots).

tassoman 11-15-2005 11:37 PM

Both fields are ok. in admincp there's full path from root to phpadsnew dir.
On config.inc.php there's full URI for phpadsnew.

My filesystem is like this:
/ (ftproot)
www
htdocs
forum
htdocs
adv
on forum.dmn.tld is called /adv and it's ok.
on www.dmn.tld is called also /adv but there isnt' any dir here.

So I solved for now with a symlink called /adv but I feel like a dirty hack.

Brad 11-18-2005 10:06 PM

Please upload the files to our server as attachments. As stated in the forum rules.

Thank you. :)


All times are GMT. The time now is 06:27 PM.

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01864 seconds
  • Memory Usage 1,862KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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