Tellli I need your Help!!! Please this is driving me nuts!

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   Tellli I need your Help!!! Please this is driving me nuts!
xtrax1
CZ Active Member
 Codezwiz Site Donator
xtrax1 has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Feb 18, 2005
0.01 posts per day
Posts: 107
Points: 3,824
   
What I'm trying to do is display who's a subscribed member using the User Info Block.

I found this in my tables nuke_subscriptions but is there a way to accomplish this for just those members only?

If it helps here is the User-Info block we use


<?PHP
      /****************************//*********************************************/
     /*All Info Block            *//*This program is free software. You can     */
    /*Author: Alex Hession      *//*redistribute it and/or modify it under the */
   /*Web: http://gnaunited.com *//*terms of the GNU General Public Licesnse as*/
  /*block-User_Info.php       *//*published by the Free Software Foundation; */
/*Version 1.0               *//*either version 2 of the License.           */
/****************************//*********************************************/
if (eregi("block-User_Info.php", $PHP_SELF)) die("Access Denied");
global $user, $cookie, $prefix, $user_prefix, $db, $anonymous, $sitekey, $gfx_chk;
$content = "";
function last_user()
   {
   global $db, $user_prefix;
   $sql = "SELECT username FROM ".$user_prefix."_users ORDER BY user_id DESC LIMIT 0,1";
   $result = $db->sql_query($sql);
   $row = $db->sql_fetchrow($result);
   $lastuser = $row[username];
   return $lastuser;
   }
function numusers()
   {
    global $user_prefix, $db;
   $sql = "SELECT * FROM ".$user_prefix."_users";
   $res = $db->sql_query($sql);
   $numrows = $db->sql_numrows($res);
   return $numrows;
   }
function who_online()
   {
    global $prefix, $db;
   $sql = "SELECT uname, guest FROM ".$prefix."_session WHERE guest = 0";
   $result = $db->sql_query($sql);
   $member_online_num = $db->sql_numrows($result);
   $who_online_now = "";
   $i = 1;
   while($session = $db->sql_fetchrow($result))
       {
       if(isset($session["guest"]) and $session["guest"] == 0)
           {
         if($i != 1) $br = "<br>";
           if ($i < 10)
               {
               $who_online_now .= $br."0".$i.":&nbsp;<A HREF=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$session[uname]\">$session[uname]</a>\n";
               }
           else
               {
               $who_online_now .= $br.$i.":&nbsp;<A HREF=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=$session[uname]\">$session[uname]</a>\n";
               }
           $who_online_now .= ($i != $member_online_num ? "  " : "");
           $i++;
           }
       }
   return $who_online_now;
   }
function new_users()
   {
    global $user_prefix, $db;
   $Today = getdate();
   $month = $Today[month];
   $mday = $Today[mday];
   $year = $Today[year];
   $pmonth = $Today[month];
   $pmday = $Today[mday];
   $pmday = $mday - 1;
   $pyear = $Today[year];
   if ($pmonth == "January") $pmonth = 1;
   elseif ($pmonth == "February") $pmonth = 2;
   elseif ($pmonth == "March") $pmonth = 3;
   elseif ($pmonth == "April") $pmonth = 4;
   elseif ($pmonth == "May") $pmonth = 5;
   elseif ($pmonth == "June") $pmonth = 6;
   elseif ($pmonth == "July") $pmonth = 7;
   elseif ($pmonth == "August") $pmonth = 8;
   elseif ($pmonth == "September") $pmonth = 9;
   elseif ($pmonth == "October") $pmonth = 10;
   elseif ($pmonth == "November") $pmonth = 11;
   elseif ($pmonth == "December") $pmonth = 12;
   $test = mktime (0, 0, 0, $pmonth, $pmday, $pyear, 1);
   $curDate2 = "%".$month[0].$month[1].$month[2]."%".$mday."%".$year."%";
   $preday = strftime ("%d",$test);
   $premonth = strftime ("%B",$test);
   $preyear = strftime ("%Y",$test);
   $curDateP = "%".$premonth[0].$premonth[1].$premonth[2]."%".$preday."%".$preyear."%";
   $sql = "SELECT * FROM ".$user_prefix."_users WHERE user_regdate LIKE '$curDate2'";
   $result = $db->sql_query($sql);
   $userCount[1]  = $db->sql_numrows($result);
   $sql = "SELECT * FROM ".$user_prefix."_users WHERE user_regdate LIKE '$curDateP'";
   $result = $db->sql_query($sql);
   $userCount[2] = $db->sql_numrows($result);
   return $userCount;
   }
function num_online()
   {
   global $prefix, $db;
   $sql = "SELECT uname FROM ".$prefix."_session WHERE guest = 1";
   $res = $db->sql_query($sql);
   $online_num[0] = $db->sql_numrows($res);
   $sql = "SELECT uname FROM ".$prefix."_session WHERE guest = 0";
   $res = $db->sql_query($sql);
   $online_num[1] = $db->sql_numrows($res);
   $online_num[2] = $online_num[0] + $online_num[1];
   return $online_num;
   }
function whowhere()
   {
    global $user, $cookie, $prefix, $db, $name;
   cookiedecode($user);
   $ip = $_SERVER["REMOTE_ADDR"];
   $url = $_SERVER["REQUEST_URI"];
   $uname = $cookie[1];
   if(!isset($uname))
       {
       $uname = "$ip";
       $guest = 1;
       }
   $past = time()-900;
   $sql = "DELETE FROM ".$prefix."_userinfo_where WHERE time < $past";
   $db->sql_query($sql);
   $sql = "SELECT time FROM ".$prefix."_userinfo_where WHERE username='$uname'";
   $result = $db->sql_query($sql);
   $ctime = time();
   $sql_a = "SELECT * FROM ".$prefix."_modules WHERE title = '$name'";
   $result_a = $db->sql_query($sql_a);
   $row_a = $db->sql_fetchrow($result_a);
   if ($row = $db->sql_fetchrow($result))
       {
      $sql = "UPDATE ".$prefix."_userinfo_where SET username = '$uname', time = '$ctime', host_addr = '$ip', guest = '$guest' , module = '$row_a[custom_title]', url = '$url' WHERE username = '$uname'";
      $db->sql_query($sql);
       }
   else
          {
      $sql = "INSERT INTO ".$prefix."_userinfo_where (username, time, host_addr, guest,module,url) VALUES ('$uname', '$ctime', '$ip', '$guest','$row_a[custom_title]','$url')";
      $db->sql_query($sql);
         }
   }
function adminonline()
    {
    global $admin, $prefix, $db;
    if(!is_array($admin))
       {
       $admin = base64_decode($admin);
        $admin = explode(":", $admin);
        $uname = "$admin[0]";
       $pwd = "$admin[1]";
       }
    else
        {
        $uname = "$admin[0]";
       $pwd = "$admin[1]";
       }
    $past = time()-900;
    $sql = "DELETE FROM ".$prefix."_userinfo_admin WHERE time < $past";
    $db->sql_query($sql);
    $sql = "SELECT * FROM ".$prefix."_userinfo_admin WHERE uname='$uname'";
    $result = $db->sql_query($sql);
    if(is_admin($admin))
        {
       $ctime = time();
        if ($row = $db->sql_fetchrow($result))
            {
           $sql = "UPDATE ".$prefix."_userinfo_admin SET uname='$uname', time='$ctime' WHERE uname='$uname'";
           $db->sql_query($sql);
            }
        else
           {
           $sql = "INSERT INTO ".$prefix."_userinfo_admin (uname, time) VALUES ('$uname', '$ctime')";
           $db->sql_query($sql);
            }
        }
    }
function check_pms()
   {
   global $prefix, $db, $user_prefix, $user;
   $userinfo = getusrinfo($user);
    $uid = $userinfo[user_id];
    $pms[0] = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND (privmsgs_type='5' OR privmsgs_type='1')"));
    $pms[1] = $db->sql_numrows($db->sql_query("SELECT privmsgs_to_userid FROM $prefix"._bbprivmsgs." WHERE privmsgs_to_userid='$uid' AND privmsgs_type='0'"));
    return $pms;
      }
function displayTime($sec)
    {
    $minutes = floor($sec / 60);
    $seconds = $sec % 60;
    if ($minutes == 0)
      {
      return $seconds . _SEC;
      }
    return $minutes."&#039".$seconds."&quot;";
    }
function who_where()
   {
   global $prefix, $db;
   $return = "";
    $who_online[0] = "";
   $who_online[1] = "";
   $num[0] = 1;
   $num[1] = 1;
   $result = $db->sql_query("select username, guest, module, url, UNIX_TIMESTAMP(now())-time AS time from ".$prefix."_userinfo_where order by username");
   $member_online_num  = $db->sql_numrows($result);
   while($session = $db->sql_fetchrow($result))
       {
      if(eregi("admin.php", $session[url]))
         {
         $session[module] = "Admin";
         $session[url] = "index.html";
         }
       $guest = $session["guest"];
       if ($guest == 0)
          {
          $ttt = "<A HREF=\"userinfo-.html$session[username]\">$session[username]</a> &gt;";
          }
      if($num[$guest] < 10)
          {
           $who_online[$guest] .= "0";
             }
       $who_online[$guest] .= "$num[$guest]: $ttt <a href=\"$session[url]\" target=\"_blank\">$session[module]</a><br>\n";
       $num[$guest]++;
       }
   if($who_online[0] != "")
       {
      $num[0]++;
       $content .= "<img src=\"images/userinfo/members.gif\">&nbsp;<span class=\"content\"><b>"._BMEM.":</b></span><br>$who_online[0]";
       if(count($who_online[0]) == 0) $content .= "<br>";
       }
   if($who_online[1] != "")
       {
       $content .= "<img src=\"images/userinfo/visitors.gif\">&nbsp;<span class=\"content\"><b>"._BVIS.":</b></span><br>$who_online[1]";
       }
   return $content;
   }
function staff_online()
   {
   global $prefix, $db, $user_prefix;
    $num = 0;
   $return .= "\n<hr>\n<img src=\"images/userinfo/group-3.gif\" height=\"14\" width=\"17\"> <u><b>Staff Online:</u></b><br>";
   $sql = "SELECT uname FROM ".$prefix."_userinfo_admin";
   $result = $db->sql_query($sql);
   if($db->sql_numrows($result) == "0")
       {
       $return .= "<br><i>No staff members are online!</i>";
       }
   else
       {
       while($row = $db->sql_fetchrow($result))
           {
           $num++;
           if ($num < 10)
               {
              $return .= "0";
              }
           $return .= "$num:\n ";
         $sql_a = "SELECT * FROM ".$user_prefix."_users WHERE username = '$row[uname]'";
         $result_a = $db->sql_query($sql_a);
         if($db->sql_numrows($result_a) == 1)
             {
            $row_a = $db->sql_fetchrow($result_a);
               if(is_active("Private_Messages"))
               {
               $return .= "<a href=\"messages-.html$row_a[user_id]\"><img src=\"images/userinfo/email-y.gif\" border=0 alt=\"Send a private message to $row_a[username]\"></a>";
               }
            $return .= " <a href=\"userinfo-.html$row[uname]\" title=\"View The Userinfo For $row[uname]\">$row_a[username]</a><br>";
              }
         else $return .= "$row[uname]<br>";
          }
       }
   return $return;
   }
whowhere();
adminonline();
global $user;
if(is_user($user))
      {
    $userinfo = getusrinfo($user);
      $content .= "<br><img src=\"images/userinfo/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", <b>$userinfo[username]</b>.<br>(<a href=\"modules.php?name=Your_Account&amp;op=logout\">"._LOGOUT."</a>)\n<hr>\n";
   if(is_active("Private_Messages"))
        {
        $pm = check_pms();
        $content .= "<img src=\"images/userinfo/email-y.gif\" height=\"10\" width=\"14\"> <a href=\"modules.php?name=Private_Messages\"><b>"._BPM."</b></a><br>\n";
       $content .= "<img src=\"images/userinfo/email-r.gif\" height=\"10\" width=\"14\"> "._BUNREAD.": <b>$pm[0]</b><br>\n";
       $content .= "<img src=\"images/userinfo/email-g.gif\" height=\"10\" width=\"14\"> "._BREAD.": <b>$pm[1]</b><br>\n<hr>\n";
       }
    }
else
    {
    $content .= "<form action=\"modules.php?name=Your_Account\" method=\"post\">";
    mt_srand ((double)microtime()*1000000);
   $maxran = 1000000;
   $random_num = mt_rand(0, $maxran);
    $content .= "<img src=\"images/userinfo/group-4.gif\" height=\"14\" width=\"17\"> "._BWEL.", <b>$anonymous</b>\n<hr>";
    $content .= "<form action=\"modules.php?name=Your_Account\" method=\"post\">\n";
   $content .= ""._NICKNAME.": <input type=\"text\" name=\"username\" size=\"10\" maxlength=\"25\"><br>\n";
   $content .= ""._PASSWORD.": <input type=\"password\" name=\"user_password\" size=\"10\" maxlength=\"20\"><br>\n";
   if (extension_loaded("gd") AND ($gfx_chk == 2 OR $gfx_chk == 4 OR $gfx_chk == 5 OR $gfx_chk == 7))
      {
      $content .= ""._SECURITYCODE.": <img src=\"modules.php?name=Your_Account&op=gfx&random_num=$random_num\" border=\"1\" alt=\""._SECURITYCODE."\" title=\""._SECURITYCODE."\"><br>\n"
          .""._TYPESECCODE.":</font> <input type=\"text\" NAME=\"gfx_check\" SIZE=\"7\" MAXLENGTH=\"6\"><br>\n"
          ."<input type=\"hidden\" name=\"random_num\" value=\"$random_num\"><br>\n";
       }
   $content .= "<input type=\"hidden\" name=\"op\" value=\"login\">\n"
      ."<input type=\"submit\" value=\""._LOGIN."\">\n"
      ."(<a href=\"modules.php?name=Your_Account&amp;op=new_user\">"._BREG."</a>)</form>\n";
    }
$last = new_users();
$onli = num_online();
$content .= "<img src=\"images/userinfo/group-2.gif\" height=\"14\" width=\"17\"> <b><u>"._BMEMP.":</u></b><br>\n";
$content .= "<img src=\"images/userinfo/ur-moderator.gif\" height=\"14\" width=\"17\"> "._BLATEST.": <A HREF=\"modules.php?name=Your_Account&amp;op=userinfo&amp;username=".last_user()."\"><b>".last_user()."</b></a><br>\n";
$content .= "<img src=\"images/userinfo/ur-author.gif\" height=\"14\" width=\"17\"> "._BTD.": <b>".$last[1]."</b><br>\n";
$content .= "<img src=\"images/userinfo/ur-admin.gif\" height=\"14\" width=\"17\"> "._BYD.": <b>".$last[2]."</b><br>\n";
$content .= "<img src=\"images/userinfo/ur-guest.gif\" height=\"14\" width=\"17\"> "._BOVER.": <b>".(numusers() - 1)."</b><br>\n<hr>\n";
$content .= "<img src=\"images/userinfo/group-3.gif\" height=\"14\" width=\"17\"> <b><u>"._BVISIT.":</u></b>\n<br>\n";
$content .= "<img src=\"images/userinfo/ur-anony.gif\" height=\"14\" width=\"17\"> "._BVIS.": <b>".$onli[0]."</b><br>\n";
$content .= "<img src=\"images/userinfo/ur-member.gif\" height=\"14\" width=\"17\"> "._BMEM.": <b>".$onli[1]."</b><br>\n";
$content .= "<img src=\"images/userinfo/ur-registered.gif\" height=\"14\" width=\"17\"> "._BTT.": <b>".$onli[2]."</b><br>\n";
if ($onli[1] > 0)
    {
   $whonline = who_online();
    $content .= "<hr><img src=\"images/userinfo/group-1.gif\" height=\"14\" width=\"17\"> <b><u>"._BON.":</u></b><br>".$whonline;
    }
$content .= "<hr><img src=\"images/userinfo/group-4.gif\" height=\"14\" width=\"17\"><u><b> Who Is Where:</b></u><br>";
$info = who_where();
$content .= $info;
$info = staff_online();
$content .= $info;
?>


It's simular to what you have done with donators and getting them to be highlighted is what I need but just subscribed members!

I sure hope you can help me with this!

xtrax icon_smile.gif


Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
What does the subscriptions table look like?




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#3   re: Tellli I need your Help!!! Please this is driving me nut
xtrax1
CZ Active Member
 Codezwiz Site Donator
xtrax1 has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Feb 18, 2005
0.01 posts per day
Posts: 107
Points: 3,824
   
Oh thank you telli !

Here is the table from phpmyadmin for the subscription table!

#
# Table structure for table `nuke_subscriptions`
#

CREATE TABLE `nuke_subscriptions` (
  `id` int(10) NOT NULL auto_increment,
  `userid` int(10) default '0',
  `subscription_expire` varchar(50) NOT NULL default '',
  KEY `id` (`id`,`userid`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;

#
# Dumping data for table `nuke_subscriptions`
#


Basicly I just want to have it like yours but just highlighting the subscribers

xtrax! icon_smile.gif


Back to top Reply with quote
#4   re: Tellli I need your Help!!! Please this is driving me nut
xtrax1
CZ Active Member
 Codezwiz Site Donator
xtrax1 has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Feb 18, 2005
0.01 posts per day
Posts: 107
Points: 3,824
   
Hello Telli

Would it be easier for you if I switched to the czuser info block, after looking at your block I do like some of the features.

I think i may switch over to your block but I do have a question, will it display Admin(s) and Mod(s) and whats the exact version your using here!

I pasted the tables from my phpmyadmin above to the subscription table, I hope this helps.

Xtrax! icon_smile.gif



Back to top Reply with quote
#5   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,430
   
Do you want me to add this to the CZUserInfo V5 Universal?




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
#6   re: Tellli I need your Help!!! Please this is driving me nut
xtrax1
CZ Active Member
 Codezwiz Site Donator
xtrax1 has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Feb 18, 2005
0.01 posts per day
Posts: 107
Points: 3,824
   
Actually if we can still do my prevoius block as the CZuser info block doesnt display were users or visitors are on your site, it would be appreciated I'll even gladly pay you for your time just quote me a price and I do appreciate your help!


xtrax



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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 cannot attach files in this forum
You cannot download files in this forum