vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Targeted ads for phpAdsNew (https://vborg.vbsupport.ru/showthread.php?t=20853)

Dejan 05-23-2003 08:20 AM

try to not use "by" as keyword
or
try to add "by" in //Replace generic words


Code for your global.php is:


Quote:

// BSB - HACK - Need to populate foruminfo for targeted ads
if(isset($forumid)) {
$getforuminfo=$DB_site->query_first("SELECT title FROM forum WHERE forumid='$forumid'");
$forum_ad_keywords=strtolower($getforuminfo[title]);

// Replace generic words
$forum_ad_keywords = str_replace(" and ", " ", $forum_ad_keywords);
$forum_ad_keywords = str_replace(" the ", " ", $forum_ad_keywords);
$forum_ad_keywords = str_replace(" with ", " ", $forum_ad_keywords);
$forum_ad_keywords = str_replace(" or ", " ", $forum_ad_keywords);
$forum_ad_keywords = str_replace("/", " ", $forum_ad_keywords);
$forum_ad_keywords = str_replace(" & ", " ", $forum_ad_keywords);
$forum_ad_keywords = str_replace(" for ", " ", $forum_ad_keywords);
$forum_ad_keywords = str_replace(" by", " ", $forum_ad_keywords);

// Replace spaces with commas (for phpAdsNew OR keywords)
$forum_ad_keywords = str_replace(" ", ",", $forum_ad_keywords);
} else {
$forum_ad_keywords = 'home';
}



// Parent forum inside thread pages
if(isset($threadid)) {
$getforuminfo=$DB_site->query_first("SELECT forum.title FROM forum,thread WHERE threadid='$threadid' AND forum.forumid=thread.forumid");

$forum_ad_keywords=strtolower($getforuminfo[title]);

// Replace generic words
$forum_ad_keywords = str_replace(" and ", " ", $forum_ad_keywords);
$forum_ad_keywords = str_replace(" the ", " ", $forum_ad_keywords);
$forum_ad_keywords = str_replace(" with ", " ", $forum_ad_keywords);
$forum_ad_keywords = str_replace(" or ", " ", $forum_ad_keywords);
$forum_ad_keywords = str_replace("/", " ", $forum_ad_keywords);
$forum_ad_keywords = str_replace(" & ", " ", $forum_ad_keywords);
$forum_ad_keywords = str_replace(" for ", " ", $forum_ad_keywords);
$forum_ad_keywords = str_replace(" i ", " ", $forum_ad_keywords);
$forum_ad_keywords = str_replace(" by", " ", $forum_ad_keywords);

// Replace spaces with commas (for phpAdsNew OR keywords)
$forum_ad_keywords = str_replace(" ", ",", $forum_ad_keywords);
}

// END HACK

cleck673 07-10-2003 05:35 AM

Is anyone still using this. I can not get it working.

Beowulf33 07-13-2003 07:59 AM

I have this hack working fine on 2.3.0

Beowulf33 08-16-2003 01:39 AM

I now have this working fine on 3.0 beta 5 as well

Tuan Le 09-02-2003 01:43 PM

I got this added to the phpinclude_start

Code:

require("C:/../../phpadsnew/phpadsnew.inc.php");
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('', 0, '', '', '0', $phpAds_context);
$variable_name = $phpAds_raw['html'];


But not sure where I need to put the local invocation code generated by phpadsnew. Do you know where I need to put them? I would greatly appreciated if you can point me to the right direction. :confused: Thanks.

Code:

<?php
if (@include('C:/../../phpadsnew/phpadsnew.inc.php')) {
if (!isset($phpAds_context)) $phpAds_context = array();
$phpAds_raw = view_raw ('', 2, '', '', '0', $phpAds_context);
echo $phpAds_raw['html'];
}
?>


Imprezer 10-03-2003 03:24 AM

So far it is working great.

Is there any way to plug a banner on the main forum page? Forum Home I mean.

Thanks!

- Alex

AmericanWoman 10-20-2003 06:15 PM

I haven't been able to get the size parameters working properly...if I try to specify a size, the banner disappears altogether. :(

Here is the invocation code I'm testing (remote javascript method):

PHP Code:

<!--
   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.acuraworld.com/ads/adjs.php?n=" phpAds_random);
   
document.write ("&amp;what=$forum_ad_keywords@width:120");
   
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.acuraworld.com/ads/adclick.php?n=a1d9c3f2' target='_blank'><img src='http://www.acuraworld.com/ads/adview.php?what=home@width:120&amp;source=http%3A%2F%2Fwww.acuraworld.com&amp;n=a1d9c3f2' border='0' alt=''></a></noscript

According to the manual, I replaced the "," delimiters with a "/" and appended the "@" symbol to the end of the string to create a parameter for the entire expression - but it's not working at all. :( I've checked the output of the code to be sure it's picking up the keywords variable, and it is...

Any ideas?


All times are GMT. The time now is 08:22 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.01227 seconds
  • Memory Usage 1,749KB
  • 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
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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