Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
phpAdsNew Banner Ads integration (advertisements, classified ads, Adsense, etc.) Details »»
phpAdsNew Banner Ads integration (advertisements, classified ads, Adsense, etc.)
Version: 1.0.4, by The M.I.P. The M.I.P. is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.5.x Rating:
Released: 11-05-2005 Last Update: 10-11-2006 Installs: 571
Uses Plugins
 
No support by the author.

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.
Donate via Paypal

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #162  
Old 01-03-2006, 06:07 AM
nexus851 nexus851 is offline
 
Join Date: Oct 2005
Location: LA
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got this error in my MEMBERINFO template when i used "<ad what="zone:1" />" in my header. I notice it conflicts with my vbfriends (buddylist) module at https://vborg.vbsupport.ru/showthrea...highlight=foes

When i disable the vbfriends plugin, the error is gone. =(

PHP Code:
Warningmysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/lendinge/public_html/forum/member.php(687) : eval()'d code on line 160 

When i disable the vbfriends plugin below, then the above error is gone. There must be a compatibility problem. Please check this script out and tell me what to change or do to fix this.

PHP Code:
if ($_REQUEST['do'] != "ignorelist") { $whichlist "buddylist"; }
else { 
$whichlist "ignorelist"; }
$whichlistshort ereg_replace("list"""$whichlist);

// (Dis)Likes
$outcounter 0;
$outuserids = array();
$outuserids explode(' 'trim($userinfo[$whichlist]));
if (
trim($userinfo[$whichlist]) != "") {
    
$outusers $vbulletin->db->query("SELECT ".TABLE_PREFIX."user.username,".TABLE_PREFIX."user.userid,".TABLE_PREFIX."usertextfield.".$whichlist." FROM
    "
.TABLE_PREFIX."user,".TABLE_PREFIX."usertextfield WHERE
    "
.TABLE_PREFIX."user.userid = ".TABLE_PREFIX."usertextfield.userid AND
    "
.TABLE_PREFIX."user.userid IN (".implode(',',$outuserids).")
    ORDER BY username"
);
    while (
$outuser mysql_fetch_array($outusers)) {
        if (
$vbulletin->userinfo['userid'] == $vbulletin->GPC['userid']) {
            
$outuserlist .= "<a class=\"smallfont\" href=\"".$vbulletin->options['bburl']."/profile.php?do=removelist&userlist=$whichlistshort&u=$outuser[userid]\">[-]</a>&nbsp;&nbsp;";
        }
        
$outuserlist .= "<a class=\"smallfont\" href=\"".$vbulletin->options['bburl']."/member.php?u=$outuser[userid]\"/>$outuser[username]</a>";
        
$outuserlist .= "<br>";
        
$outcounter++;
    }
}

// (Dis)Liked By
$inoutcounter 0;
$incounter 0;
$inusersquery "SELECT ".TABLE_PREFIX."user.username,".TABLE_PREFIX."user.userid,".TABLE_PREFIX."usertextfield.".$whichlist." FROM
"
.TABLE_PREFIX."user,".TABLE_PREFIX."usertextfield WHERE
"
.TABLE_PREFIX."user.userid = ".TABLE_PREFIX."usertextfield.userid AND
FIND_IN_SET('"
.$userinfo[userid]."', REPLACE(".TABLE_PREFIX."usertextfield.".$whichlist.", ' ', ',')) > 0
ORDER BY "
.TABLE_PREFIX."user.username";
$inusers mysql_query($inusersquery);
while (
$inuser mysql_fetch_array($inusers)) {
    
$incounter++;
    
// Bi-Directional (Dis)Like
    
if (in_array($inuser[userid], $outuserids)) {
        if (
$vbulletin->userinfo['userid'] == $vbulletin->GPC['userid']) {
            
$inuserlist .= "<a class=\"smallfont\" href=\"".$vbulletin->options['bburl']."/profile.php?do=removelist&userlist=$whichlistshort&u=$inuser[userid]\">[-]</a>&nbsp;&nbsp;";
        }
        
$outuserids2 explode(' 'trim($inuser[$whichlist]));
        
$inuserids2 = array();
        
$inuserids1 mysql_query("SELECT userid FROM ".TABLE_PREFIX."usertextfield WHERE
        FIND_IN_SET('"
.$inuser[userid]."', REPLACE(".$whichlist.", ' ', ',')) > 0");
        while (
$inuserid1 mysql_fetch_array($inuserids1)) {
            
$inuserids2[] = $inuserid1[userid];
        }
        
$inoutuserids2 array_intersect($outuserids2$inuserids2);
        
$inoutcounter2 count($inoutuserids2);
        
$avatar_url fetch_avatar_url($inuser['userid']);
        
$inuser[avatarurl] = $avatar_url[0];
        if (
$inuser[avatarurl] == "") { $inuser[avatarurl] = "clear.gif"; }
        
$inoutuserlist .= "<td class=\"smallfont\" align=\"center\" width=\"100\">";
        
$inoutuserlist .= "<a href=\"".$vbulletin->options['bburl']."/member.php?u=$inuser[userid]\"/>";
        
$inoutuserlist .= "<img width=75 height=75 border=1 src=\"$inuser[avatarurl]\"><br>";
        
$inoutuserlist .= "$inuser[username]</a><!-- ($inoutcounter2)-->";
        
$inoutuserlist .= "</td>";
        
$inoutcounter++;
        if ((
$inoutcounter 7) == 0) { $inoutuserlist .= "</tr><tr>"; }
    }
    else {
        if (
$vbulletin->userinfo['userid'] == $vbulletin->GPC['userid']) {
            
$inuserlist .= "<a class=\"smallfont\" href=\"".$vbulletin->options['bburl']."/profile.php?do=addlist&userlist=$whichlistshort&u=$inuser[userid]\">[+]</a>&nbsp;&nbsp;";
        }
    }
    
$inuserlist .= "<a class=\"smallfont\" href=\"".$vbulletin->options['bburl']."/member.php?u=$inuser[userid]\"/>$inuser[username]</a>";
    
$inuserlist .= "<br>";
}

$mutual = @round((($inoutcounter $outcounter) * 100), 0);
$avatar_url fetch_avatar_url($userinfo['userid']);
$userinfo[avatarurl] = $avatar_url[0];
if (
$userinfo[avatarurl] == "") { $userinfo[avatarurl] = "clear.gif"; }

$FRIENDSFOES "<table class=\"tborder\" cellpadding=\"$stylevar[cellpadding]\"
cellspacing=\"
$stylevar[cellspacing]\" border=\"0\" width=\"100%\" align=\"center\">";
$FRIENDSFOES .= "<tr>";
if (
$whichlist == "buddylist") { $FRIENDSFOES .= "<td class=\"tcat\" colspan=\"2\">$userinfo[username]'s Buddies ($inoutcounter) <!--... $mutual% Mutual--></td>"; }
if (
$whichlist == "ignorelist") { $FRIENDSFOES .= "<td class=\"tcat\" colspan=\"2\">$userinfo[username]'s Buddies ($inoutcounter) <!--... $mutual% Mutual--></td>"; }
$FRIENDSFOES .= "</tr><tr>";
$FRIENDSFOES .= "<td class=\"alt2\" colspan=\"2\">";
$FRIENDSFOES .= "  <table>";
$FRIENDSFOES .= "  <tr>";
$FRIENDSFOES .= $inoutuserlist;
$FRIENDSFOES .= "  </tr>";
$FRIENDSFOES .= "  </table>";
$FRIENDSFOES .= "</td>";
$FRIENDSFOES .= "</tr>";
$FRIENDSFOES .= "</table>"
Please help!
Reply With Quote
  #163  
Old 01-03-2006, 12:13 PM
Puntoboy Puntoboy is offline
 
Join Date: Sep 2005
Location: Northampton UK
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i've installed this as described above.

how do i get the ads to appear above the forum display, but below the Nav bar?
Reply With Quote
  #164  
Old 01-03-2006, 09:56 PM
PennylessZ28 PennylessZ28 is offline
 
Join Date: Mar 2002
Location: North America
Posts: 737
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got it working, learning to use phpadsnew is another story, couldn't be setup more stupidly
Reply With Quote
  #165  
Old 01-03-2006, 09:57 PM
Puntoboy Puntoboy is offline
 
Join Date: Sep 2005
Location: Northampton UK
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

sounds like i havent got a chance of getting this to work then.
Reply With Quote
  #166  
Old 01-04-2006, 05:50 AM
kevinrstruck kevinrstruck is offline
 
Join Date: Jan 2003
Posts: 61
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Puntoboy
i've installed this as described above.

how do i get the ads to appear above the forum display, but below the Nav bar?
You just need to edit your template as needed.
Reply With Quote
  #167  
Old 01-04-2006, 09:09 AM
Puntoboy Puntoboy is offline
 
Join Date: Sep 2005
Location: Northampton UK
Posts: 196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

but how, and which template?

i'm a total n00b to this, learning as i go along.

i'm not even sure i have phpadsnew configured right.
Reply With Quote
  #168  
Old 01-04-2006, 09:46 PM
FROGGYJ FROGGYJ is offline
 
Join Date: Sep 2005
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do you reverse the usage on usergroups. Say I want to display ads to all users except for site supporters.....oh and site supporters is an alternate group not a primary.
Reply With Quote
  #169  
Old 01-04-2006, 09:58 PM
FROGGYJ FROGGYJ is offline
 
Join Date: Sep 2005
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would this work?

<if condition="!$bbuserinfo['usergroupid']==1"><ad what="zone:1" /></if>

I'm pretty sure ! reverses the logic....just not sure on placement.
Reply With Quote
  #170  
Old 01-04-2006, 10:05 PM
FROGGYJ FROGGYJ is offline
 
Join Date: Sep 2005
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

woot it works!
Reply With Quote
  #171  
Old 01-05-2006, 08:05 PM
johnscanlan johnscanlan is offline
 
Join Date: Jul 2005
Location: Oceanside CA
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh my yes THANKS
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:26 AM.


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.04959 seconds
  • Memory Usage 2,377KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete