Author |
Message |
SmackDaddy
Involved


Joined: Jun 02, 2004
Posts: 268
Location: Englewood, OH
|
Posted:
Wed Oct 13, 2004 9:40 am |
|
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...
http://www.pctoolbin.com
Only registered users can see links on this board! Get registered or login! |
|
|
 |
sixonetonoffun
Spouse Contemplates Divorce

Joined: Jan 02, 2003
Posts: 2496
|
Posted:
Wed Oct 13, 2004 12:30 pm |
|
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 |
|
|
 |
SmackDaddy

|
Posted:
Wed Oct 13, 2004 6:13 pm |
|
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

|
Posted:
Wed Oct 13, 2004 8:12 pm |
|
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

|
Posted:
Wed Oct 13, 2004 9:37 pm |
|
!paid -- ?? What is that? |
|
|
|
 |
SmackDaddy

|
Posted:
Wed Oct 13, 2004 10:58 pm |
|
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
|
 |
|
|
|
 |
sixonetonoffun

|
Posted:
Thu Oct 14, 2004 8:30 am |
|
if (($banners==1) AND ($sub == 0 OR ($sub == 1 AND !paid()))) {
include("banners1.php");
echo "<br>";
}
!paid = Not Paid |
|
|
|
 |
SmackDaddy

|
Posted:
Thu Oct 14, 2004 11:13 am |
|
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

|
Posted:
Thu Oct 14, 2004 3:15 pm |
|
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.  |
|
|
|
 |
|