Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 12-22-2011, 07:26 AM   #1
AAB
Confirmed User
 
AAB's Avatar
 
Join Date: Apr 2009
Location: Alberta
Posts: 874
:tongue No Ads for Logged In Members - WP Plugin?

Donncha's "No Ad for Friends" was last updated in 2007 and doesn't work. Does anybody know of a plugin that would block display of ads for logged in members?
AAB is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-22-2011, 07:38 AM   #2
Stephen
Consigliere
 
Industry Role:
Join Date: Feb 2003
Posts: 1,771
I avoid 3rd party plugins. You can use cookies and conditionals to do what you want.
Stephen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-22-2011, 07:47 AM   #3
AAB
Confirmed User
 
AAB's Avatar
 
Join Date: Apr 2009
Location: Alberta
Posts: 874
Sadly, plugins are a feasible alternative for webmasters who are not programmers. I can imagine this may not be a big deal for someone good with PHP, but that ain't me
AAB is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-22-2011, 10:21 AM   #4
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 54,868
Quote:
Originally Posted by AAB View Post
Sadly, plugins are a feasible alternative for webmasters who are not programmers. I can imagine this may not be a big deal for someone good with PHP, but that ain't me
wouldnt be hard to do, adrotate is a good plugin.

prob just a single function to add to only show ads for non members.
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Tube Themes
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-22-2011, 11:34 AM   #5
just a punk
So fuckin' bored
 
just a punk's Avatar
 
Industry Role:
Join Date: Jun 2003
Posts: 32,376
This code will do the trick (insert it right into your WP theme):

Code:
<?php
if (!is_user_logged_in()) {
  echo "your annoying ad is here";
}
?>
Or do you want it made as a widget or so?
__________________
Obey the Cowgod
just a punk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-22-2011, 11:45 AM   #6
AAB
Confirmed User
 
AAB's Avatar
 
Join Date: Apr 2009
Location: Alberta
Posts: 874
Let me give this a try, cyber :D

UPDATE: Would it work if I pasted the code in the widgetized sidebar as "Text"?

Last edited by AAB; 12-22-2011 at 11:46 AM..
AAB is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-22-2011, 11:58 AM   #7
AAB
Confirmed User
 
AAB's Avatar
 
Join Date: Apr 2009
Location: Alberta
Posts: 874
What would be the trick to make it work with widgets? When I use the code in a "Text" widget, it shows nothing when I log out, but displays ;}?> when I log in.
AAB is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-22-2011, 12:03 PM   #8
just a punk
So fuckin' bored
 
just a punk's Avatar
 
Industry Role:
Join Date: Jun 2003
Posts: 32,376
If you don't want to make it managed as a widget, you can use it as is. Just insert the mentioned above code into your sidebar.php.

P.S. Fuck and replace your avatar with something neutral according to the GFY rules.
__________________
Obey the Cowgod
just a punk is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-22-2011, 01:18 PM   #9
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 54,868
Quote:
Originally Posted by AAB View Post
Donncha's "No Ad for Friends" was last updated in 2007 and doesn't work. Does anybody know of a plugin that would block display of ads for logged in members?
adrotate is a good plugin

http://adrotateplugin.com/page/features.php

and if you wanted to disable the ads for logged in users.

Code:
function adrotate_shortcode_strip() {
	if (!is_user_logged_in()) {
		remove_shortcode('adrotate');
	}	
}

add_filter('the_content', 'adrotate_shortcode_strip');
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Tube Themes
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-23-2011, 12:17 PM   #10
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 54,868
Quote:
Originally Posted by AAB View Post
Donncha's "No Ad for Friends" was last updated in 2007 and doesn't work. Does anybody know of a plugin that would block display of ads for logged in members?
actually if you are using a text widget, you could run a filter on the widget to only show it to non members.

Code:
add_filter( 'widget_text', 'non_members' );

function non_members($content = null ) {

	/* If the user is logged in, return nothing. */
	if ( is_user_logged_in() || is_null( $content ) )
		return '';

	/* Return the content. */
	return do_shortcode( $content );
}
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Tube Themes
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-23-2011, 12:50 PM   #11
Stephen
Consigliere
 
Industry Role:
Join Date: Feb 2003
Posts: 1,771
Quote:
Originally Posted by cyberxxx View Post
This code will do the trick (insert it right into your WP theme):

Code:
 <?php
if (!is_user_logged_in()) {
  echo "your annoying ad is here";
}
?>
Or do you want it made as a widget or so?
That works well with the WP login system, but I like to use straight .htaccess (CCBill) with a similar check for a "members" cookie:

Code:
<?php if (isset($_COOKIE['Members'])) { include("members.php"); } ?>
Stephen is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-25-2011, 08:17 AM   #12
AAB
Confirmed User
 
AAB's Avatar
 
Join Date: Apr 2009
Location: Alberta
Posts: 874
Quote:
Originally Posted by cyberxxx View Post
This code will do the trick (insert it right into your WP theme):

Code:
<?php
if (!is_user_logged_in()) {
  echo "your annoying ad is here";
}
?>
Or do you want it made as a widget or so?
The double quotes seem to make this code unusable. Because every ad code will contain double quotes somewhere within it, it will break the echo which is exactly what happened when I tried it.
AAB is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
ads, plugin, wordpress



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.