How Do U Add

Started on the old forum in January 2008 · view the original in the archive · old links redirect here

5 replies · 429 views · started 18 years ago · 1 min read

4 participants
Guest #1

when a member is looking at sum1s profile when u are online list it says

Viewing Users Profile

how do u add viewing "members username" profile

hope u can understand it thanks

synergyx Developer · 100 posts #2

you gonna have to use sql db for that, i have the code on my script but havent got access to my pc now... will check for u tho

mcKeny Developer · 130 posts #3

if your talking the lava script i think this will work

 $person = getnick_uid($who);
addonline(getuid_sid($sid),"viewing $person profile","");

External image (may be gone)

R.M.C

PHP Adovocate B)

ori Lead · 512 posts #4

i did that ages ago its piss easy lol

Guest #5

i did that ages ago its piss easy lol

how then ori huni

SpiderWap Lead · 622 posts #6
else if($action=="online")
{

  addonline(getuid_sid($sid),"Online List - xHTML","");
$pstyle = gettheme($sid);
    echo xhtmlhead("Online List",$pstyle);

  //////ALL LISTS SCRIPT <<

    if($page=="" || $page<=0)$page=1;
    $num_items = getnumonline(); //changable
    $items_per_page= 10;
    $num_pages = ceil($num_items/$items_per_page);
    if($page>$num_pages)$page= $num_pages;
    $limit_start = ($page-1)*$items_per_page;

    //changable sql
    $sql = "SELECT
            a.name, b.place, b.userid, sex FROM ibwf_users a
            INNER JOIN ibwf_online b ON a.id = b.userid
            GROUP BY 1,2
            LIMIT $limit_start, $items_per_page
    ";
    echo "

[size="1"]";
    $mols = mysql_fetch_array(mysql_query("SELECT name, value FROM ibwf_settings WHERE id='2'"));
    print "Most online: [b]$mols[1][/b]
";
    $mols = mysql_fetch_array(mysql_query("SELECT ppl, dtm FROM ibwf_mpot WHERE ddt='".date("d m y")."'"));
    print "Most online today only: [b]$mols[0][/b]
";
    $items = mysql_query($sql);
    echo mysql_error();
    while ($item = mysql_fetch_array($items))
    {
      if ($item[3]=="M"){
      $icon = "<img src=\"images/male.gif\" alt=\"M\"/>";
      }else
      if ($item[3]=="F"){
      $icon = "<img src=\"images/female.gif\" alt=\"F\"/>";
      }
      $lnk = "<a href=\"index.php?action=viewuser&who=$item[2]&sid=$sid\">$item[0]</a>";
      echo "$icon $lnk - $item[1] 
";
    }
    echo "[/size]</p>";
    echo "<p align=\"center\">";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"index.php?action=online&page=$ppage&sid=$sid\">«PREV</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"index.php?action=online&page=$npage&sid=$sid\">Next»</a>";
    }
    echo "
$page/$num_pages
";
    if($num_pages>2)
    {
      echo getjumper($action, $sid,"index");
    }
    echo "</p>";
  ////// UNTILL HERE >>

  echo "<p align=\"center\">";
  $thid = mysql_fetch_array(mysql_query("SELECT themeid FROM ibwf_users WHERE id='".$uid."'"));
    $themeimageset = mysql_fetch_array(mysql_query("SELECT themedir FROM ibwf_iconset WHERE id='".$thid[0]."'"));  
    echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/themes/$themeimageset[0]/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p>";
  echo xhtmlfoot();
}
else if($action=="viewpl")
{
  $who = $_GET["who"];
  addonline(getuid_sid($sid),"Viewing a poll - xHTML","");
$pstyle = gettheme($sid);
    echo xhtmlhead("View A Poll",$pstyle);
    echo "

";
    $uid = getuid_sid($sid);
    $pollid = mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_users WHERE id='".$who."'"));
    if($pollid[0]>0)
    {
        $polli = mysql_fetch_array(mysql_query("SELECT id, pqst, opt1, opt2, opt3, opt4, opt5, pdt FROM ibwf_polls WHERE id='".$pollid[0]."'"));
        if(trim($polli[1])!="")
        {
            $qst = parsepm($polli[1], $sid);
            echo $qst."

";
            $vdone = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE uid='".$uid."' AND pid='".$pollid[0]."'"));
            $nov = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE pid='".$pollid[0]."'"));
            $nov = $nov[0];
            if($vdone[0]>0)
            {
              $voted= true;
            }else{
              $voted = false;
            }
            $opt1 = $polli[2];
            if (trim($opt1)!="")
            {
              $opt1 = htmlspecialchars($opt1);
              $nov1 = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE pid='".$pollid[0]."' AND ans='1'"));
              $nov1 = $nov1[0];
              if($nov>0)
              {
              $per = floor(($nov1/$nov)*100);
              $rests = "Votes: $nov1($per%)";
              }else{
                $rests = "Votes: 0(0%)";
              }
                if($voted)
                {
                  $lnk = "1.$opt1 [size="1"]$rests[/size]
";
                }else{
              $lnk = "1.<a href=\"genproc.php?action=votepl&sid=$sid&plid=$pollid[0]&ans=1\">$opt1</a> [size="1"]$rests[/size]
";
              }
              echo "$lnk";
            }
            $opt2 = $polli[3];
            if (trim($opt2)!="")
            {
              $opt2 = htmlspecialchars($opt2);
              $nov2 = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE pid='".$pollid[0]."' AND ans='2'"));
              $nov2 = $nov2[0];
              if($nov>0)
              {
              $per = floor(($nov2/$nov)*100);
              $rests = "Votes: $nov2($per%)";
              }else{
                $rests = "Votes: 0(0%)";
              }
              if($voted)
                {
                  $lnk = "2.$opt2 [size="1"]$rests[/size]
";
                }else{
              $lnk = "2.<a href=\"genproc.php?action=votepl&sid=$sid&plid=$pollid[0]&ans=2\">$opt2</a> [size="1"]$rests[/size]
";
              }
              echo "$lnk";
            }
            $opt3 = $polli[4];
            if (trim($opt3)!="")
            {
              $opt3 = htmlspecialchars($opt3);
              $nov3 = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE pid='".$pollid[0]."' AND ans='3'"));
              $nov3 = $nov3[0];
              if($nov>0)
              {
              $per = floor(($nov3/$nov)*100);
              $rests = "Votes: $nov3($per%)";
              }else{
                $rests = "Votes: 0(0%)";
              }
              if($voted)
                {
                  $lnk = "3.$opt3 [size="1"]$rests[/size]
";
                }else{
              $lnk = "3.<a href=\"genproc.php?action=votepl&sid=$sid&plid=$pollid[0]&ans=3\">$opt3</a> [size="1"]$rests[/size]
";
              }
              echo "$lnk";
            }
            $opt4 = $polli[5];
            if (trim($opt4)!="")
            {
              $opt4 = htmlspecialchars($opt4);
              $nov4 = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE pid='".$pollid[0]."' AND ans='4'"));
              $nov4 = $nov4[0];
              if($nov>0)
              {
              $per = floor(($nov4/$nov)*100);
              $rests = "Votes: $nov4($per%)";
              }else{
                $rests = "Votes: 0(0%)";
              }
              if($voted)
                {
                  $lnk = "4.$opt4 [size="1"]$rests[/size]
";
                }else{
              $lnk = "4.<a href=\"genproc.php?action=votepl&sid=$sid&plid=$pollid[0]&ans=4\">$opt4</a> [size="1"]$rests[/size]
";
              }
              echo "$lnk";
            }
            $opt5 = $polli[6];
            if (trim($opt5)!="")
            {
              $opt5 = htmlspecialchars($opt5);
              $nov5 = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_presults WHERE pid='".$pollid[0]."' AND ans='5'"));
              $nov5 = $nov5[0];
              if($nov>0)
              {
              $per = floor(($nov5/$nov)*100);
              $rests = "Votes: $nov5($per%)";
              }else{
                $rests = "Votes: 0(0%)";
              }
              if($voted)
                {
                  $lnk = "5.$opt5 [size="1"]$rests[/size]
";
                }else{
              $lnk = "5.<a href=\"genproc.php?action=votepl&sid=$sid&plid=$pollid[0]&ans=5\">$opt5</a> [size="1"]$rests[/size]
";
              }
              echo "$lnk";
            }
            echo "[size="1"]".date("d m y - H:i",$polli[7])."[/size]";
        }else{
            echo "<img src=\"images/notok.gif\" alt=\"x\"/>This poll doesn't exist";
        }
    }else{
        echo "<img src=\"images/notok.gif\" alt=\"x\"/>This user have no poll";
    }
    echo "</p>";
    echo "<p align=\"center\">";
    $thid = mysql_fetch_array(mysql_query("SELECT themeid FROM ibwf_users WHERE id='".$uid."'"));
    $themeimageset = mysql_fetch_array(mysql_query("SELECT themedir FROM ibwf_iconset WHERE id='".$thid[0]."'"));  
    echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/themes/$themeimageset[0]/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p>";
  echo xhtmlfoot();
    
}

You'll just have to replace xhtml head and foot with your own, should work 100% then.

Sign in to reply.

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close