vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Member Archives (https://vborg.vbsupport.ru/forumdisplay.php?f=202)
-   -   Ad banners for unregistered users (https://vborg.vbsupport.ru/showthread.php?t=35357)

James Cridland 02-23-2002 03:49 PM

1 Attachment(s)
I loathe and detest ad banners.

But when you run a board where 50% 'unregistered users' use it, and you want to increase the amount of users you have registered, it might be worth experimenting with an ad banner for unregistered users only.

Enclosed is the code to do that: it's modifying two templates.


This is v2 of the code, with the following enhancements:
- Hide ad banners for users who have donated
- Bug fix: I didn't close the 'normalfont' tag!
- Force users to both register AND verify e-mail addresses

Plus, enhanced information for users, following feedback here


Good sources of ad banners are www.valueclick.com and www.advertwizard.com

James Cridland 02-23-2002 03:49 PM

And a screenshot:

https://vborg.vbsupport.ru/

Users who want to see what this does: the forums are at http://forums.mediauk.com/

Your username and password are both "vbulletinorg"

Floris 02-24-2002 01:28 AM

Hey now :) That IS handy :P
We have been thinking about ways of implementing a banner system .. I believe you found a solution!
I thank you very much!

James Cridland 02-24-2002 03:17 PM

Great pleasure. It works for me, so... :)

nafae 02-24-2002 04:24 PM

looks great I am about to install this!

eoc_Jason 04-10-2002 04:45 AM

This is very cool! Very simple addition and it sure serves a purpose! :bunny:

chrisroo 04-13-2002 02:27 PM

i cant get it to work

James Cridland 04-13-2002 06:09 PM

Quote:

Originally posted by chrisroo
i cant get it to work
What problems are you having, and I'll see if I can help...

chrisroo 04-13-2002 10:23 PM

I cant add html without it freaking out...

James Cridland 04-14-2002 03:06 PM

Aha, thanks.

You need to be careful when using " characters... either use ' or "escape" them by putting a \ character in front.

i.e...

a href="link.html"

won't work, and will result in an error.

a href='link.html'
or
a href=\"link.html\"

will both work just fine.

chrisroo 04-14-2002 09:49 PM

what? now
what about the image code.

chrisroo 04-14-2002 09:52 PM

nevermind i figured the shiz out.

Velocd 04-15-2002 01:35 AM

How bout more feedback? How many of you who installed this hack actually think you're getting more members because of it?? I'm thinking about installing this, it seems worth a try.

James Cridland 04-15-2002 06:09 AM

I'm getting approx twice the amount of member sign-ons and around 20% more posts.

SaintDog 04-15-2002 02:30 PM

Could this be modified to where only those that have made a donation can have the ads removed? I know you would have to manually add them to a usergroup if I wanted to do this, but that would be fine.

I added a usergroup call Contributing Members, but I am not sure of the # it is, such as an admin has a set usergroup number, as do mods, and super mods (I have not added any other usergroups).

Any help would be appreciated.

Thanks,

SaintDog

James Cridland 04-15-2002 03:41 PM

Quote:

Originally posted by SaintDog
Could this be modified to where only those that have made a donation can have the ads removed? I know you would have to manually add them to a usergroup if I wanted to do this, but that would be fine.
Very easy to fix: I'll do this later tonight for you.

SaintDog 04-15-2002 06:50 PM

Ok thanks, I appreciate it :)

SaintDog

James Cridland 04-15-2002 07:25 PM

I've updated the hack for you, as you'll see in the top message.

Just like your site, I now accept donations!

SaintDog 04-15-2002 09:21 PM

Thanks :)

SaintDog

thehobbyforum 04-16-2002 02:12 AM

Looks great - my site is supported by advertisers so I can't use it but a great hack none the less!!

James Cridland 06-09-2002 02:21 PM

Quote:

Originally posted by SaintDog
Could this be modified to where only those that have made a donation can have the ads removed? I know you would have to manually add them to a usergroup if I wanted to do this, but that would be fine.
Yes, this is quite easy.

Change the line that says
if ($bbuserinfo['userid']<"1") {
to say
if ($bbuserinfo['usergroupid']!="13") {

...where '13' is the usergroup you've added called something like "Contributing Members".

This will then show ads for everyone EXCEPT contributing members.

Quote:

I added a usergroup call Contributing Members, but I am not sure of the # it is, such as an admin has a set usergroup number, as do mods, and super mods (I have not added any other usergroups).
The way I do it...

Click on "User Groups - Modify" in your control panel.
Hold your mouse over the edit link for the 'Contributing Members' group
...look at the end of that URL, where it'll say something like usergroupid=13.
That means 13 is the number.


BTW, this all works fine in v2.2.6.

Andy R 06-11-2002 01:50 AM

What about having unregistered members having the largest banner, regular members having a smaller text link & contributing members have no ads.

Thanks,

Andy

danrak 06-11-2002 12:05 PM

This may be simple but I'm still learning PHP. Anyway, is there a way to add multiable groups? For example, I would prerfer my mentors and moderators not to see the ads since they help out.

BTW, this is a great hack, thanks.

James Cridland 06-11-2002 05:56 PM

It's very easy to modify, this hack.

For a "ad banner for unreg / text ad for registered / no ad for donated" then...
PHP Code:

    if ($bbuserinfo['userid']<"1") {
    
$adcode="your ad banner for unregistered users";
    }
    elseif (
$bbuserinfo['usergroupid']=="13") {
    
$adcode="(no ad banner)";
    }
    else {
    
$adcode="your text ad";
    } 

You need to know the category number for your user group of people who have donated - I've used 13 here. Skim further up the thread to find out how this is done.

I'm running a much more complicated version of this hack, which rotates ad banners. One day I might document that, if anyone's interested.


Quote:

Originally posted by danrak
This may be simple but I'm still learning PHP. Anyway, is there a way to add multiable groups? For example, I would prerfer my mentors and moderators not to see the ads since they help out.
PHP is really easy(ish).

$bbuserinfo['userid'] is the user number, and will always be "0" (or not exist) if the user isn't registered.

$bbuserinfo['usergroupid'] is the group that the user is in.

if ($bbuserinfo['usergroupid']=="5") {echo "Hello world";} will do the thing in curly brackets - print "Hello world" in this example - if the usergroupid = 5.

if ($bbuserinfo['usergroupid']!="5") {echo "Hello world";} will do the thing in curly brackets if the usergroupid is NOT 5.

if ($bbuserinfo['usergroupid']>="5") {echo "Hello world";} will do the thing in curly brackets if the usergroupid is 5 OR LARGER.

and if ($bbuserinfo['usergroupid']=="5") {echo "Hello world";}else {echo "Goodbye world";} will only print "Hello world" if the usergroupid is 5 (as above), but will print "Goodbye world" if the usergroupid is anything else.

Does that help work out how you'd show one thing to one user group and another thing to another? Hope so.

Chris M 06-11-2002 07:04 PM

Just a quick Q...

Why is this in Template Moficiations???:confused:

Satan

James Cridland 06-11-2002 07:11 PM

Because it's a modification of the php_include template.

Andy R 06-11-2002 10:41 PM

Especially for adding the limited tutorial at the end! That really helps those of us who are learning and starting from ground zero.

MrBojangle1 06-15-2002 03:44 PM

I am quite confused on how to sign up for ads and picking that stuff. Any help would be appreciated if you can help me with the two ad places in first post contact me on AIM SSJ4Gohan354

funflyer 06-22-2002 02:31 AM

I need a way placing rotating banners on my forums. Is there any code or a site where I can how to put banners on my site? I want to have multi banners so each time the person refreshes the page the banner will change and is there any way of keeping track of all the stats so I could tell how many hits, and times it has been showed. Somebody told me about phpadds, Annybody use this?

Here the links, once you create and add banners how do you get them in your templates??

http://sourceforge.net/projects/phpadsnew/

thehobbyforum 06-22-2002 04:49 AM

You have to add the place the addclick code to the template where you want it to show - in the admin section of phpadsnew if will give you the banner invocation script - you then take that and place it in the template of you choice - mine is in the header template of my forums - that way it will show up automatically on all pages of the forum

DrkFusion 06-24-2002 03:46 AM

I have accomplished this via editing index.php, and it uses tables, i released it as a forum home modification, as an addon to Welcome Panel, but it can be removed from Welcome Panel, and used by itself in ForumHome.

It can be editied easily to fit any of your needs, especially Saint Dogs, or Organic-Hosting.

Michael2 07-10-2002 12:16 AM

Can I replace the ad banner code and table that you have now with a code for a pop up? I want unregistered users to get pops but not registered users.

halloweennation 08-19-2002 04:06 PM

Well,
I've got this installed, but when I changed the color (white text on light grey didn't go) the color wasn't dark grey, but red AND the "register to remove this banner......" was moved to above the bar, instead of inside the middle of it. Help!
I'd also like the links to pop upon into a new page, and rotating banners instead of just one. Any ideas? Please email directly to Vlad@halloweennation.com
Thanks in advance,
-Chris
http://forums.halloweennation.com/

James Cridland 08-19-2002 06:04 PM

Quote:

Originally posted by Michael2
Can I replace the ad banner code and table that you have now with a code for a pop up? I want unregistered users to get pops but not registered users.
You can, no problem at all. Instead of the "$adcode" being an ad, you can chuck your nasty pop-up code in there. Then, call $adcode in your footer template rather than the header template (because then the popup code will activate once the page is fully loaded, and not before).

Just remember to escape any " characters - i.e. turn them into \".

Quote:

Originally posted by halloweennation
I've got this installed, but when I changed the color (white text on light grey didn't go) the color wasn't dark grey, but red AND the "register to remove this banner......" was moved to above the bar, instead of inside the middle of it. Help!
I'd also like the links to pop upon into a new page, and rotating banners instead of just one. Any ideas? Please email directly to (snip)

The first one's an HTML thing, and something I can't really help on. Sounds like you've removed a </td> when you shouldn't have.

Links to pop-up a new browser window is fairly easy: <a href="foo.html">This</a> will open in the same browser window. <a href="foo.html" target=_blank>This</a> will open in a new one. How you author your ad code is really up to you.

Rotating ad banners? Well, I've got these: there must be an easier way, but this is how I've done it.

Replace the $adcode="<TABLE..... bit of your code with the following:
PHP Code:

$adcoderandom rand(1,4); \\picks a random number between 1 and 4

if ($adcoderandom==1) {$adcode "<TABLE><TR><TD>BUY FISH</TD></TR></TABLE>"; } //this ad shows if random number is "1"
if ($adcoderandom==2) {$adcode "<TABLE><TR><TD>BUY SAUSAGES</TD></TR></TABLE>"; } //this one if it's "2"
if ($adcoderandom==3) {$adcode "<TABLE><TR><TD>BUY TROUSERS</TD></TR></TABLE>"; } // etc
if ($adcoderandom==4) {$adcode "<TABLE><TR><TD>BUY CHEESE</TD></TR></TABLE>"; } 

Sorry, but I'll never mail support direct to someone; it's not what community forums are all about.

halloweennation 08-19-2002 06:33 PM

Tried the popup "_blank" thing, but there's a restriction on using "'s in the code, so it didn't take too well.

Still can't get the "register to make this banner disappear....." text into the middle of the box beside the banner, as opposed to above it,

And am a novice about code, so need it spelled out really plain to get a rotating banner. Here's what I've got online.

// This code is PHP4 only:
// ob_start();
// require("yourheader.html");
// $header = ob_get_contents();
// ob_end_clean();
//ad banner
$adcode="";
if ($bbuserinfo['userid']<"1") {
$adcode="<TABLE width='100%' bgcolor='#000000><TR><TD align='center'><normalfont><B><a href=\"register.php?s=$session[sessionhash]&action=signup\">Register free</a> to remove this ad banner</b></normalfont></td><TD align='right'>
<a href=\"http://www.sideshowtoy.com\"><img src=\"http://www.halloweennation.com/Images/sst.jpg\">
</td></tr></table>";
}
//end

James Cridland 08-19-2002 07:01 PM

Quote:

Originally posted by halloweennation
Tried the popup "_blank" thing, but there's a restriction on using "'s in the code, so it didn't take too well.
<a href=\"http://www.sideshowtoy.com\">
should become
<a href=\"http://www.sideshowtoy.com\" target=\"_blank\">

Quote:

[/b]Still can't get the "register to make this banner disappear....." text into the middle of the box beside the banner, as opposed to above it[/b]
The code looks fine - just dunno what it's been put into. If the space for the table is less than 468x60, it'll not fit properly anyway. Can't help much with that, sorry.

This hack's really for people that have a vague inkling about PHP (you don't need much, just a vague inkling). If you copied the code above for four rotating ad banners, but put your own ad code into the holes, it should work just fine for you.

monstergamer 05-30-2003 01:56 AM

clicks installed*


All times are GMT. The time now is 04:46 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.01253 seconds
  • Memory Usage 1,827KB
  • 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_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (37)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete