Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Draugų listas

Parašė TaduXxX0· 2008 Lie. 5 09:07:50
#1

sveiki...noriu padaryti,jog draugus rodytų su avator...Paaiškinsiu:


Dabar rodo taip:






O noriu,jog rodytų taip:







Štai kodas:

opentable("Vartotojo <b>".$data['user_name']."</b>  draugai:");

echo"<table border='0' cellpadding='0' cellspacing='1'><tr><td>\n";
$result=dbquery("SELECT * FROM ".$db_prefix."users ORDER BY user_name");

while($data_buddy = dbarray($result)) {

$result_from=dbquery("SELECT * FROM ".$db_prefix."buddys WHERE
buddy_from = ".$data['user_id']." AND buddy_to = ".$data_buddy['user_id']."");
$data_from = dbarray($result_from);

$result_to=dbquery("SELECT * FROM ".$db_prefix."buddys WHERE
buddy_to = ".$data['user_id']." AND buddy_from = ".$data_buddy['user_id']."");
$data_to = dbarray($result_to);

if($data_to['buddy_id'] != "" AND $data_from['buddy_id'] != ""){

echo "<a href='".BASEDIR."profile.php?lookup=".$data_buddy['user_id']."' target='_parent'>".$data_buddy['user_name']."</a> | ";

}

}

echo"</td></tr></table>\n";
closetable();





Gal kas galite padėti?

Parašė Gugiss· 2008 Lie. 5 09:07:13
#2

Bandyk
opentable("Vartotojo <b>".$data['user_name']."</b>  draugai:");

echo"<table border='0' cellpadding='0' cellspacing='1'><tr><td>\n";
$result=dbquery("SELECT * FROM ".$db_prefix."users ORDER BY user_name");

while($data_buddy = dbarray($result)) {

$result_from=dbquery("SELECT * FROM ".$db_prefix."buddys WHERE
buddy_from = ".$data['user_id']." AND buddy_to = ".$data_buddy['user_id']."");
$data_from = dbarray($result_from);

$result_to=dbquery("SELECT * FROM ".$db_prefix."buddys WHERE
buddy_to = ".$data['user_id']." AND buddy_from = ".$data_buddy['user_id']."");
$data_to = dbarray($result_to);

if($data_to['buddy_id'] != "" AND $data_from['buddy_id'] != ""){

echo "<img src='".IMAGES."avatars/".$data['user_avatar']."'><br>
<a href='".BASEDIR."profile.php?lookup=".$data_buddy['user_id']."' target='_parent'>".$data_buddy['user_name']."</a><br>";

}

}

echo"</td></tr></table>\n";
closetable();




Redagavo Gugiss· 2008 Lie. 5 10:07:18

Parašė Dandžu· 2008 Lie. 5 09:07:24
#3

Na tai dasirašyk kur reikia user_avatar ir viskas, bet gi tu toks kietas programuotojas ir nemoki net tiek? Gugy tavo variantas neveiks. :]

Redagavo Dandžu· 2008 Lie. 5 09:07:12

Parašė TaduXxX0· 2008 Lie. 5 10:07:32
#4

tai gal gali padarytu tu gerą? nes pvz aš pridedu avator,tai negražiai išdėsto...

Parašė Žmogus· 2008 Lie. 5 10:07:44
#5

Nu tai išsiimk kodą iš Naujausi nariai

Parašė Gugiss· 2008 Lie. 5 10:07:32
#6

nu tai bl pasiziurek padariau as

Parašė TaduXxX0· 2008 Lie. 5 10:07:38
#7

Gugys parašė:
nu tai bl pasiziurek padariau as



tu tai padarei nesamone... tiek is as matau,manau turet but userdata ir pan

Parašė Gugiss· 2008 Lie. 5 10:07:17
#8

Kas ne taip? Redagavau juk as

Parašė Dandžu· 2008 Lie. 5 10:07:04
#9

Koks dar userdata. ;D Bandyk šitą.
opentable("Vartotojo <b>".$data['user_name']."</b>  draugai:");

echo"<table border='0' cellpadding='0' cellspacing='1'><tr><td>\n";
$result=dbquery("SELECT * FROM ".$db_prefix."users ORDER BY user_name, user_avatar");

while($data_buddy = dbarray($result)) {

$result_from=dbquery("SELECT * FROM ".$db_prefix."buddys WHERE
buddy_from = ".$data['user_id']." AND buddy_to = ".$data_buddy['user_id']."");
$data_from = dbarray($result_from);

$result_to=dbquery("SELECT * FROM ".$db_prefix."buddys WHERE
buddy_to = ".$data['user_id']." AND buddy_from = ".$data_buddy['user_id']."");
$data_to = dbarray($result_to);

if($data_to['buddy_id'] != "" AND $data_from['buddy_id'] != ""){
if ($data_buddy['user_avatar'] != "") {
echo "<img src='".IMAGES."avatars/".$data_buddy['user_avatar']."'>";
 } else {
 echo "<img src='".IMAGES."avatars/noavatar.gif'>";
}
echo "<br><a href='".BASEDIR."profile.php?lookup=".$data_buddy['user_id']."' target='_parent'>".$data_buddy['user_name']."</a> | ";

}

}

echo"</td></tr></table>\n";
closetable();




Parašė TaduXxX0· 2008 Lie. 5 10:07:52
#10

Sharkman parašė:
Koks dar userdata. ;D Bandyk šitą.
opentable("Vartotojo <b>".$data['user_name']."</b>  draugai:");

echo"<table border='0' cellpadding='0' cellspacing='1'><tr><td>\n";
$result=dbquery("SELECT * FROM ".$db_prefix."users ORDER BY user_name, user_avatar");

while($data_buddy = dbarray($result)) {

$result_from=dbquery("SELECT * FROM ".$db_prefix."buddys WHERE
buddy_from = ".$data['user_id']." AND buddy_to = ".$data_buddy['user_id']."");
$data_from = dbarray($result_from);

$result_to=dbquery("SELECT * FROM ".$db_prefix."buddys WHERE
buddy_to = ".$data['user_id']." AND buddy_from = ".$data_buddy['user_id']."");
$data_to = dbarray($result_to);

if($data_to['buddy_id'] != "" AND $data_from['buddy_id'] != ""){
if ($data_buddy['user_avatar'] != "") {
echo "<img src='".IMAGES."avatars/".$data_buddy['user_avatar']."'>";
 } else {
 echo "<img src='".IMAGES."avatars/noavatar.gif'>";
}
echo "<br><a href='".BASEDIR."profile.php?lookup=".$data_buddy['user_id']."' target='_parent'>".$data_buddy['user_name']."</a> | ";

}

}

echo"</td></tr></table>\n";
closetable();






stai kaip rodo:





Parašė Dandžu· 2008 Lie. 5 10:07:16
#11

Nu tai su table, tr ir td susidėliok.

Parašė bruzgis· 2008 Lie. 5 11:07:04
#12

Duodu uzuomina:
<p><br><center><table width='80%'><tr><td colspan='3' class='tbl2'><center>Vartotojo <b>".$data['user_realname']." </b>draugai</center></td></tr><tr ><td>";
}
$result = dbquery("


SELECT
      user.user_mood user_mood,
      user.user_id user_id,
      user.user_realname user_realname,
      user.user_avatar user_avatar,
      user.gender gender
FROM
   `pingvin_buddys` buddy
   INNER JOIN `pingvin_users` user ON buddy.buddy_to = user.user_id
   
WHERE
   1=1
   and buddy.buddy_from ='$lookup'
   and user.user_realname!=''
   and user.user_id!=''
");

$friends = '';

echo "<table>";
while ($b_data = dbarray($result) )   {

   $friends.="<tr>";
   if ($b_data['user_avatar']) {
         $c ="'".BASEDIR."images/avatars/".$b_data['user_avatar']."'";
         }
         else if ($b_data['gender'] == 0) {
         $c ="'".BASEDIR."images/no.gif'";
         }
         else if ($b_data['gender'] == 1) {
         $c ="'".BASEDIR."images/vyras.gif'";
         } elseif ($b_data['gender'] == 2) {
         $c ="'".BASEDIR."images/moteris.gif'";
         }
if ($b_data != 0) {   $b = "<td class='tbl1'><center>
      <table border='0' background=$c' cellpadding='0' cellspacing='0'  width='100' height='100' style='background-repeat:no-repeat; background-position: center;'>
        <tr>
          <td width='100%' height='90'>
          <table border='0' cellpadding='0' cellspacing='0'  width='100%'  height='100'>
            <tr>
              <td width='70' height='74' rowspan='2'>&nbsp;</td>
              <td width='30' height='20'>
              <img src='".BASEDIR."images/mood/";
           $b .= $b_data['user_mood'] == NULL ? "NULL" : $b_data['user_mood'];
           $b.= ".gif' width='20' height='20' style='border: 2px solid #FFFFFF;'></td>
            </tr>
            <tr>
              <td width='30' height='54'>&nbsp;</td>
            </tr>
          </table>
          </td>
        </tr>
      </table><br><a href='".BASEDIR."profilis.php?lookup=".$b_data['user_id']."'>".$b_data['user_realname']."</a>

      </center></td>";}
    
   $b_data = dbarray($result); 
   if ($b_data['user_avatar']) {
         $c ="'".BASEDIR."images/avatars/".$b_data['user_avatar']."'";
         }
         else if ($b_data['gender'] == 0) {
         $c ="'".BASEDIR."images/no.gif'";
         }
         else if ($b_data['gender'] == 1) {
         $c ="'".BASEDIR."images/vyras.gif'";
         } elseif ($b_data['gender'] == 2) {
         $c ="'".BASEDIR."images/moteris.gif'";
         }
   if ($b_data != 0) { $b .= "<td class='tbl1'><center>
      <table border='0' background=$c' cellpadding='0' cellspacing='0'  width='100' height='100' style='background-repeat:no-repeat; background-position: center;'>
        <tr>
          <td width='100%' height='90'>
          <table border='0' cellpadding='0' cellspacing='0'  width='100%'  height='100'>
            <tr>
              <td width='70' height='74' rowspan='2'>&nbsp;</td>
              <td width='30' height='20'>
              <img src='".BASEDIR."images/mood/";
           $b .= $b_data['user_mood'] == NULL ? "NULL" : $b_data['user_mood'];
           $b.= ".gif' width='20' height='20' style='border: 2px solid #FFFFFF;'></td>
            </tr>
            <tr>
              <td width='30' height='54'>&nbsp;</td>
            </tr>
          </table>
          </td>
        </tr>
      </table><br><a href='".BASEDIR."profilis.php?lookup=".$b_data['user_id']."'>".$b_data['user_realname']."</a>

      </center></td>";}
   $b_data = dbarray($result); 
   if ($b_data['user_avatar']) {
         $c ="'".BASEDIR."images/avatars/".$b_data['user_avatar']."'";
         }
         else if ($b_data['gender'] == 0) {
         $c ="'".BASEDIR."images/no.gif'";
         }
         else if ($b_data['gender'] == 1) {
         $c ="'".BASEDIR."images/vyras.gif'";
         } elseif ($b_data['gender'] == 2) {
         $c ="'".BASEDIR."images/moteris.gif'";
         }
if ($b_data != 0) {   $b .= "<td class='tbl1'><center>
      <table border='0' background=$c' cellpadding='0' cellspacing='0'  width='100' height='100' style='background-repeat:no-repeat; background-position: center;'>
        <tr>
          <td width='100%' height='90'>
          <table border='0' cellpadding='0' cellspacing='0'  width='100%'  height='100'>
            <tr>
              <td width='70' height='74' rowspan='2'>&nbsp;</td>
              <td width='30' height='20'>
              <img src='".BASEDIR."images/mood/";
           $b .= $b_data['user_mood'] == NULL ? "NULL" : $b_data['user_mood'];
           $b.= ".gif' width='20' height='20' style='border: 2px solid #FFFFFF;'></td>
            </tr>
            <tr>
              <td width='30' height='54'>&nbsp;</td>
            </tr>
          </table>
          </td>
        </tr>
      </table><br><a href='".BASEDIR."profilis.php?lookup=".$b_data['user_id']."'>".$b_data['user_realname']."</a>
      </center></td>"; }
   $friends .= $b."</tr>";
   
   
   
   }
echo "</table>";
echo "".substr($friends,0,strlen($friends)-2);
echo "</td></tr></table></center>




Toliau susitvarkysi pats