Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> CNB Your Account
Author Message
XtraX
Hangin' Around



Joined: Nov 03, 2004
Posts: 43

PostPosted: Wed Oct 12, 2005 5:53 pm Reply with quote

Maybe this has been answered but I have been searching for hours!!!

What we are trying to accomplish is in the edit user section of the CNB Your Account!

Right now the bio section called Extra Info: has a limit of 255 characters max! we need to adjust this as it seems a constant problem with users saying they cant input enough data!

We would like to set this to 455 characters but don’t know how!

We looked in the sql tables but it shows this

In nuke_users table we see the bio prefix but it has a value of
bio tinytext No


If anyone can help it would be appreciated.

xtrax
 
View user's profile Send private message
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Wed Oct 12, 2005 8:32 pm Reply with quote

tinytext is limited to 255 chacters. Change it to text(455)
 
View user's profile Send private message
XtraX







PostPosted: Wed Oct 12, 2005 9:32 pm Reply with quote

I'll try this Raven

Oh I hope this works and if so your a god sent!!!!

I'll let you know

xtrax! Smile
 
XtraX







PostPosted: Wed Oct 12, 2005 9:42 pm Reply with quote

Your the man of the hour I thank you raven for all your help its guys like me that look up to you and site/s like yours to guide us!

I thank you dearly!

May I test your knowledge once again!

How can one get an Icon to display next to a premium members name? using the userinfo block!

xtrax Smile
 
Raven







PostPosted: Wed Oct 12, 2005 11:24 pm Reply with quote

Well, I don't know what userinfo block you are using, but in general, do something like this
Code:
echo "<img src=\"images/someimage.gif\" alt=\"\" />&nbsp;$member_name";

Usually you want to be able to click on the image and/or the name, so you would then surround the <img> tag with an anchor, like
Code:
echo "<a href=\"http://somewhere.com/profile-u9999.html\" title=\"User Profile\"><img src=\"images/someimage.gif\" alt=\"\" /></a>&nbsp;$member_name";


Use the same technique for the member name link.
 
XtraX







PostPosted: Thu Oct 13, 2005 12:22 pm Reply with quote

Yeah but unfortunatley that adds an image next to each users name, I'm trying to get it to just do the users who are subscribed members.

Like i notice the table nuke_subscribers but is there a way to list an icon beside those members only?

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

Code:
<?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.php";
         }
       $guest = $session["guest"];
       if ($guest == 0)
          {
          $ttt = "<A HREF=\"modules.php?name=Your_Account&op=userinfo&username=$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-post-.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=\"modules.php?name=Your_Account&op=userinfo&username=$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=\"messages.html\"><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=\"account.html\" 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=\"account.html\" 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;
?>



xtrax Smile
 
Raven







PostPosted: Thu Oct 13, 2005 1:25 pm Reply with quote

As I said in general. To detect members you can use if (is_user($user)) { } logic.
 
phoenix-cms
Worker
Worker



Joined: Aug 05, 2005
Posts: 139

PostPosted: Thu Oct 13, 2005 1:30 pm Reply with quote

i would use
if ($premium members ==1) {
echo "<img src=\"images/someimage.gif\" alt=\"\" />&nbsp;$member_name";
}else{
echo "";
}

something along those lines

_________________
Evo 3.0 Developer & nukecops.com Admin
Image
coming soon [ Only registered users can see links on this board! Get registered or login! ] Smile 
View user's profile Send private message Send e-mail
XtraX







PostPosted: Thu Oct 13, 2005 2:04 pm Reply with quote

Ok Im a total noob!

How do I add this in so were it displays the user names now it would show a premium icon to those users ?

Sad

xtrax
 
phoenix-cms







PostPosted: Fri Oct 14, 2005 2:46 am Reply with quote

Give me a sec let me save your code offline so i can add it Very Happy
 
phoenix-cms







PostPosted: Fri Oct 14, 2005 2:47 am Reply with quote

actually one thing i thinking of adding a switch to admin panel what cnb you using
 
XtraX







PostPosted: Fri Oct 14, 2005 10:09 am Reply with quote

That be great we are using CNB YA 4.0 Nuke 7.3 with chatserv Patches!

Any help you could provide would be appreciated!

xtrax Smile
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> CNB Your Account

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 ©