Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's
Author Message
SmackDaddy
Involved
Involved



Joined: Jun 02, 2004
Posts: 268
Location: Englewood, OH

PostPosted: Wed Oct 13, 2004 9:40 am Reply with quote

I have a question....first off, I know I can make a phpnuke member a "subscribed member" and can have modules or blocks turned off or on based upon this membership.

What I'd like to know is if there is a way to check for this with something that ISN'T in a block or module.....such as a banner ad or google ad added to the theme.php template file.

In basic terms "IF Not Subscribed, show, if subscribed, don't show"....that sort of thing?

For those who contribute time or money to the site I run, I want to make sure they don't see any of the banner ads. I have two of them in blocks, but the other two are coded into the theme.php file. One is using Bob's Banner Clients script, and the other is identified as "$showbanners" for the random banner ad from the phpnuke banner ad system.

I certainly hope that made sense. And I certainly hope someone knows how I can accomplish this.

Thanks in advance.

_________________
Smack out...
[ Only registered users can see links on this board! Get registered or login! ]

Image 
View user's profile Send private message Send e-mail Visit poster's website
sixonetonoffun
Spouse Contemplates Divorce



Joined: Jan 02, 2003
Posts: 2496

PostPosted: Wed Oct 13, 2004 12:30 pm Reply with quote

Something like this in your theme header function might work.
if ($banners) AND ($sub == 0 OR ($sub == 1 AND !paid())) {
include("banners.php");
echo "<br>";
}

_________________
[b][size=5]openSUSE 11.4-x86 | Linux 2.6.37.1-1.2desktop i686 | KDE: 4.6.41>=4.7 | XFCE 4.8 | AMD Athlon(tm) XP 3000+ | MSI K7N2 Delta-L | 3GB Black Diamond DDR
| GeForce 6200@433Mhz 512MB | Xorg 1.9.3 | NVIDIA 270.30[/size:2b8 
View user's profile Send private message
SmackDaddy







PostPosted: Wed Oct 13, 2004 6:13 pm Reply with quote

So what you are suggesting is if the code is as follows:

Code:


function themeheader() {
    global  $admin, $user, $banners, $sitename, $slogan, $cookie, $prefix, $db, $nukeurl, $anonymous, $name, $index, $blockside;
    if ($banners == 1) {
        include("includes/banners1.php");


To change it to this:

Code:


function themeheader() {
    global  $admin, $user, $banners, $sitename, $slogan, $cookie, $prefix, $db, $nukeurl, $anonymous, $name, $index, $blockside, $sub;
    if ($banners == 1) AND ($sub == 0) {
        include("includes/banners1.php");


Is that correct? (wouldn't $sub have to be a global value?) -- pardon me as I am not very adept at programming.....especially at php...


Last edited by SmackDaddy on Wed Oct 13, 2004 10:54 pm; edited 1 time in total 
sixonetonoffun







PostPosted: Wed Oct 13, 2004 8:12 pm Reply with quote

Yep I was going to mention that and got distracted while posting earlier. Sorry.

But yeah I'd use the !paid part too. Assuming the site outlasts the subscriptions wink*
 
SmackDaddy







PostPosted: Wed Oct 13, 2004 9:37 pm Reply with quote

!paid -- ?? What is that?
 
SmackDaddy







PostPosted: Wed Oct 13, 2004 10:58 pm Reply with quote

I put in the edited code (that I listed above) and got a parse error....hmmm....didn't work for some reason.....

Code:
Parse error: parse error, unexpected T_LOGICAL_AND


Confused
 
sixonetonoffun







PostPosted: Thu Oct 14, 2004 8:30 am Reply with quote

if (($banners==1) AND ($sub == 0 OR ($sub == 1 AND !paid()))) {
include("banners1.php");
echo "<br>";
}


!paid = Not Paid
 
SmackDaddy







PostPosted: Thu Oct 14, 2004 11:13 am Reply with quote

I don't get what variable that is (!paid) and where it's coming from and how the themeheader would know what it is or what it's supposed to be.

I have put what you have shown in one of the themes to test it out, and I still see the banners.....and when I tried to just have it as:

Code:
if (($banners==1) AND ($sub == 0)) {


It did the same thing......nothing.

*sigh* Six....I do appreciate your help with this....and I have been wracking my brain trying to figure it out myself despite not knowing programming, so when I have taken the time to post this, it's not without some prior effort to resolve it on my part. Just wanted to let you know. Again, thanks.
 
sixonetonoffun







PostPosted: Thu Oct 14, 2004 3:15 pm Reply with quote

As long as you replaced or commented out the original banner code that should work. I actually did test that last snippet and it worked great. Confused
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> How To's

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©