private profile code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    private profile code

    hey friends i code a private profile script, members have to send a request to view his/her profile, i m releasing to all ma friends
    PHP Code:


    add this to index main page
    //////////////////
    $reqs1 getnreqsh($uid);

      if(
    $reqs1>0)

      {

      
    $request1 "! <a href=\"lists.php?action=reqs1&amp;sid=$sid\"> $reqs1 Notification</a>";

      }
    /////////////////////////////
    add this to index.php view Profile Where u want to hide
    ///////////////////////////


      
    if (shad0w($uid$who))

      {
    //////////////////



    your code in here
    ////////////////

    }else{
    echo 
    "<b><b>Privacy Profile !!!</ b> <br/>This profile can only see members with a list of friends and members of the Administration</ b> <br/><br/> ";

    echo 
    "<a href=\"genproc.php?action=req&amp;who=$who&amp;sid=$sid&amp;todo=add\">Send Request</a><br/>";

    }

    ////////////////////////////
    add this to settingz page
    $viewpro 
    mysql_fetch_array(mysql_query("SELECT viewpro FROM ibwf_users WHERE id = '".$uid."'"));

    if(
    $viewpro[0]=="1")
    {
    echo 
    "<a href=\"genproc.php?action=viewproh&amp;sid=$sid\">Make Profile Public</a><br/>";
    }else{
    echo 
    "<a href=\"genproc.php?action=viewpron&amp;sid=$sid\">Make Profile Private</a><br/>";
    }
    //////////////////////////////////////Add this to genproc.php
    else if($action=="req")
    {
      
    $todo $_GET["todo"];
      
    $who $_GET["who"];
      
    addonline(getuid_sid($sid),"Adding/Removing ","");
          echo 
    "<head>";
          echo 
    "<title>$sitename</title>";
          echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
          echo 
    "</head>";
          echo 
    "<body>";
      echo 
    "<p align=\"center\">";
      
    //$uid = getuid_sid($sid);
        
    $unick getnick_uid($uid);
        
    $tnick getnick_uid($who);
    if(
    isignored($uid$who))
        {
        echo 
    "<img src=\"../images/notok.gif\" alt=\"X\"/><br/>";
        echo 
    "Cannot buddy $tnick they have ignored you...<br/><br/>";
        echo 
    "<b>9 </b><a accesskey=\"9\" href=\"lists.php?action=buds&amp;sid=$sid\">Buddylist</a><br/>";
        echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
        echo 
    "</p></body></html>";
        exit();
        }
      if(
    $todo=="add")
      {
        if(
    hbudres($uid,$who)!=3){
        if(
    areunhi($uid,$who))
        {
          echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>$tnick is already in your list<br/>";
        }else if(
    hbudres($uid$who)==0)
        {
            
    $res mysql_query("INSERT INTO ibwf_hide SET uid='".$uid."', tid='".$who."', reqdt='".time()."'");
            if(
    $res)
            {
         
           echo 
    "<img src=\"../images/ok.gif\" alt=\"o\"/>A request has been sent to $tnick<br/>";
     
    $id[0] = ;
    $pmtext "Allow $unick to view your private profile. [br/][br/][small][i]p.s: this is an automated pm[/i][/small]";
    $tm time();
    $res mysql_query("INSERT INTO ibwf_private SET text='".$pmtext."', byuid='".$id."', touid='".$who."', timesent='".$tm."'");

            }else{
              echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>You can't add $tnick <br/>";
            }
        }
    else if(
    hbudres($uid$who)==1)
        {
            
    $res mysql_query("UPDATE ibwf_hide SET agreed='1' WHERE uid='".$who."' AND tid='".$uid."'");
            if(
    $res)
            {
                echo 
    "<img src=\"../images/ok.gif\" alt=\"o\"/>$tnick Added  successfully<br/>";
     
     
    $id[0] = ;
    $pmtext "Your Request Have been Accepted [br/][br/][small][i]p.s: this is an automated pm[/i][/small]";
    $tm time();
    $res mysql_query("INSERT INTO ibwf_private SET text='".$pmtext."', byuid='".$id."', touid='".$who."', timesent='".$tm."'");

            }else{
              echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>You can't add $tnick <br/>";
            }
        }
        else{
            echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>You can't add $tnick <br/>";
        }
        }else{
            echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>You can't add $tnick <br/>";
        }
      }else if(
    $todo="del")
      {
        
            
          
          
    $resmysql_query("DELETE FROM ibwf_hide WHERE (uid='".$uid."' AND tid='".$who."') OR (uid='".$who."' AND tid='".$uid."')");
          if(
    $res)
            {
                echo 
    "<img src=\"../images/ok.gif\" alt=\"o\"/>$tnick removed from your  list<br/>";
     
    $id[0] = ;
    $pmtext "Your Request Have been Deny! [br/][br/][small][i]p.s: this is an automated pm[/i][/small]";
    $tm time();
    $res mysql_query("INSERT INTO ibwf_private SET text='".$pmtext."', byuid='".$id."', touid='".$who."', timesent='".$tm."'");

            }else{
              echo 
    "<img src=\"../images/notok.gif\" alt=\"x\"/>can't remove $tnick from your  list<br/>";
            }

      }
      echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo 
    "</p></body>";
    }



    else if(
    $action=="viewproh")

    {

        echo 
    "<head>";

        echo 
    "<title></title>";

        echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";

        echo 
    "</head>";

        echo 
    "<body>";

        echo 
    "<p align=\"center\">";

        
    $ncl mysql_query("UPDATE ibwf_users SET automsgs='1' WHERE id='".$uid."'");

        echo 
    "Profile changed!.<br/>";

        echo 
    "</p>";

        echo 
    "<p align=\"center\">";

        echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";

        echo 
    "</p>";

        echo 
    "</body>";

    }

    else if(
    $action=="viewprohn")

    {

        echo 
    "<head>";

        echo 
    "<title></title>";

        echo 
    "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";

        echo 
    "</head>";

        echo 
    "<body>";

        echo 
    "<p align=\"center\">";

        
    $ncl mysql_query("UPDATE ibwf_users SET automsgs='0' WHERE id='".$uid."'");

        echo 
    "Profile changed!.<br/>";

        echo 
    "</p>";

        echo 
    "<p align=\"center\">";

        echo 
    "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";

        echo 
    "</p>";

        echo 
    "</body>";

    }
    ///////////////////////Add this to core.php
    /////// 
    function shad0w($uid$who)
    {

    $pm mysql_fetch_array(mysql_query("SELECT viewpro FROM ibwf_users WHERE id='".$who."'"));
    if(
    $pm[0]=='2')
    {
    if (
    ismod($uid))
    {
    return 
    true;
    }else{

    return 
    false;
    }
    return 
    false;
    }else if(
    $pm[0]=='1')
    {
    if(
    $uid==$who||arebuds($uid,$who)||ismod($uid))
    {
    return 
    true;
    }else{
    return 
    false;
    }
    }else if(
    $pm[0]=='0')
    {
    return 
    true;
    }
    }

    /////////////////////////////////////////////Are 

    function areunhi($uid$tid)
    {
        
    $res mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_hide WHERE ((uid='".$uid."' AND tid='".$tid."') OR (uid='".$tid."' AND tid='".$uid."')) AND agreed='1'"));
        if(
    $res[0]>0)
        {
          return 
    true;
        }
        return 
    false;
    }
    /////////////////////////////////////////////can acc

    function hbudres($uid$tid)
    {
      
    //3 = can't 
      //2 = already 
      //1 = request pended
      //0 = can 
      
    if($uid==$tid)
      {
        return 
    3;
      }
      
      if (
    areunhi($uid$tid))
      {
        return 
    2;
      }
      
    $req mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_hide WHERE ((uid='".$uid."' AND tid='".$tid."') OR (uid='".$tid."' AND tid='".$uid."')) AND agreed='0'"));
      if(
    $req[0]>0)
      {
        return 
    1;
      }
      
    $notb mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_hide WHERE (uid='".$tid."' OR tid='".$tid."') AND agreed='1'"));
      global 
    $max_buds;
      if(
    $notb[0]>=$max_buds)
      {
        
        return 
    3;
      }
      
    $notb mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_hide WHERE (uid='".$uid."' OR tid='".$uid."') AND agreed='1'"));
      global 
    $max_buds;
      if(
    $notb[0]>=$max_buds)
      {

        return 
    3;
      }
      return 
    0;
    }
    /////////////////////////////get no. of requists

    function getnreqsh($uid)
    {
      
    $notb mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_hide WHERE  tid='".$uid."' AND agreed='0'"));
      return 
    $notb[0];
    }
    ///////////////////////////////SQL//////////




    --
    -- 
    Table structure for table `ibwf_hide`
    --

    CREATE TABLE IF NOT EXISTS `ibwf_hide` (
      `
    idint(100NOT NULL AUTO_INCREMENT,
      `
    uidint(100NOT NULL DEFAULT '0',
      `
    tidint(100NOT NULL DEFAULT '0',
      `
    agreedchar(1NOT NULL DEFAULT '0',
      `
    reqdtint(100NOT NULL DEFAULT '0',
      
    PRIMARY KEY (`id`),
      
    KEY `uid` (`uid`)
    ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3868 ;

    --
    -- 
    Dumping data for table `ibwf_hide`
    --




    And 
    add this to ibwf_users


    `viewproint(1NOT NULL DEFAULT '0',

    ////////////////////////////////////

    //Coded by Crash 2010/////////////// 

    //mail - admin@slhitz.com///////////

    //////////////////////////////////// 

    #2
    isnt easier to use isbuddy() function?
    Nous Ne Dansos Pas, Nous Sommes Le Danse.!

    Comment


      #3
      ill try it

      Comment


        #4
        u should have a good knowledge to add this

        Comment


          #5
          then i have added this i get a error when it send a inbox the person gets a blank inbox please help thanks and good share
          HELP THEM WHO HELPS YOU



          i only work on wapdesire v_2 coding only

          Comment


            #6
            u can add any thing for the message, i"ll check and reply

            Comment


              #7
              okk add a peson call Alert or any thing his Id should be 0 try and tell me
              Last edited by rajitha100; 26.03.10, 01:26.

              Comment


                #8
                brand find the automsg code and edit as u lyk... use the old way


                ....................................
                http://photomag.lk/
                ....................................

                Comment


                  #9
                  NiCe Try mate

                  Comment


                    #10
                    LOL it was already been here months ago ...i remeber with the word "SHADOW"
                    com site: http://vampist.net
                    download site: http://wapdloads.net
                    fb: http://www.facebook.com/pmplx

                    Comment


                      #11
                      yea just look into my posts ive placed option to make profile gallery and inbox private
                      ________________
                      Jacques
                      jacques@gw-designs.co.za
                      http://coding.biz.tm
                      Come join and lets make it a place to learn all the noobies how to code
                      __________________

                      NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

                      Comment


                        #12
                        not workink

                        Comment

                        Working...
                        X