Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[BLOCK] Friends Block
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2009-01-27 15:25:48
Try this, not tested:

<?php

begin_block("Amigos");

$sql = "SELECT id, friendid FROM friends WHERE userid = '$CURUSER[id]'";

$mysql_result=mysql_query($sql) or die (mysql_error());

$res = mysql_fetch_assoc($mysql_result);

$id = $res['friendid'];

$dt = get_date_time(gmtime() - 180);

$contagem = mysql_query("SELECT count(*) FROM users WHERE id = '$id' AND last_access > $dt");

if ( $contagem > 0 ) {

echo"<table widt=100%>";

echo"<tr>";

while ($row=mysql_fetch_array($mysql_result)){

$idami = $row['friendid'];

$sql2 = mysql_query("SELECT id, username, last_access, avatar FROM users WHERE id = '$idami'");

$res2= mysql_fetch_array($sql2) or die (mysql_error());

$ami = $res2['username'];

$avatar = htmlspecialchars($res2["avatar"]);

if (!$avatar) {

$avatar = "".$site_config["SITEURL"]."/images/semimagem.gif";

}

echo "<td><a href=account-details.php?id=$id><b><font size=2>".$ami."</font></b></a></td>";

echo "<td><a href=mailbox.php?compose&id=$res2[id]>". "Enviar MP</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src=$avatar width=60 height=75 border=0></td><br><br>";

}

echo"</tr>";

echo "</table>";

print ("<center><a href=friend.php>V
Unknown User
2009-01-27 17:06:47
Yes this code is correct, the only mistake is that he is not showing a friend when he is online, what would be the adjustment to appear? But apart from this error is perfect, just need to get the friend to appear online when it is not showing. What has put that to appear online?
Unknown User
2009-01-29 14:57:21
could someone help me tidy the MOD, he is showing his friends online.

Please help me.

<?php

begin_block("Amigos");

$sql = "SELECT id, friendid FROM friends WHERE userid = '$CURUSER[id]'";

$mysql_result=mysql_query($sql) or die (mysql_error());

$res = mysql_fetch_assoc($mysql_result);

$id = $res['friendid'];

$dt = get_date_time(gmtime() - 180);

$contagem = mysql_query("SELECT count(*) FROM users WHERE id = '$id' AND last_access > $dt");

if ( $contagem > 0 ) {

echo"<table widt=100%>";

echo"<tr>";

while ($row=mysql_fetch_array($mysql_result)){

$idami = $row['friendid'];

$sql2 = mysql_query("SELECT id, username, last_access, avatar FROM users WHERE id = '$idami'");

$res2= mysql_fetch_array($sql2) or die (mysql_error());

$ami = $res2['username'];

$avatar = htmlspecialchars($res2["avatar"]);

if (!$avatar) {

$avatar = "".$site_config["SITEURL"]."/images/semimagem.gif";

}

echo "<td><a href=account-details.php?id=$id><b><font size=2>".$ami."</font></b></a></td>";

echo "<td><a href=mailbox.php?compose&id=$res2[id]>". "Enviar MP</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src=$avatar width=60 height=75 border=0></td><br><br>";

}

echo"</tr>";

echo "</table>";

print ("<center><a href=friend.php>V
Unknown User
2009-01-29 19:29:18
please help me, is not showing the friends online, but is the phrase No Friend Online.

: /
Unknown User
2010-07-17 13:06:13
:blink:  Whats Code correct ??????????????????????
Unknown User
2011-05-27 21:38:03
"leandrosapia, post: 64378":
:D   Whats Code correct ??????????????????????

The two in the first post work for me, but it would be nice if the friends block would only display the friends online only, and not all friends.
Unknown User
2013-07-17 05:33:33
"nightmare, post: 52473":
create a block called: friends_block.php

<?php
begin_block("My Friends");
if ($site_config["MEMBERSONLY"] && !$CURUSER) {
echo "<BR><BR><b><CENTER>You are not logged in<br>Only registered users can vieuw this block.</CENTER><BR><BR>";
} else {
$sql = "SELECT id, friendid FROM friends WHERE userid = '$CURUSER[id]'";
$mysql_result=mysql_query($sql) or die (mysql_error());
$dt = get_date_time(gmtime() - 180);
echo"<table width=100% cellspacing=0 align=center>";
echo"<tr>";
while ($row=mysql_fetch_array($mysql_result)){
$id = $row['friendid'];
$sql2 = mysql_query("SELECT id, username, last_access FROM users WHERE id = '$id'");
$res2= mysql_fetch_array($sql2) or die (mysql_error());
$ami = $res2['username'];
echo "<tr><td><a href=account-details.php?id=$id><font color=blue>".$ami."</a></td><td><img src=images/button_o".($res2[last_access]>$dt?"n":"ff")."line.gif></td><td><a href=mailbox.php?compose&id=$res2[id]>". "<img src=images/button_pm.gif border=0></a></center></td></tr>";
}
echo"</tr>";
echo "</table>";
}
end_block();
?>If you want to display avatars use this code
<?php
begin_block("Mes Amis");
if ($site_config["MEMBERSONLY"] && !$CURUSER) {
echo "<BR><BR><b><CENTER>Vous n'ĂȘtes pas loguĂ©<br>Loguez-vous ou enregistrez un compte.</CENTER><BR><BR>";
} else {
$sql = "SELECT id, friendid FROM friends WHERE userid = '$CURUSER[id]'";
$mysql_result=mysql_query($sql) or die (mysql_error());
$dt = get_date_time(gmtime() - 180);
echo"<table width=100% cellspacing=0 align=center>";
echo"<tr>";
while ($row=mysql_fetch_array($mysql_result)){
$id = $row['friendid'];
$sql2 = mysql_query("SELECT id, username, last_access, avatar FROM users WHERE id = '$id'");
$res2= mysql_fetch_array($sql2) or die (mysql_error());
$ami = $res2['username'];
$avatar = htmlspecialchars($res2["avatar"]);
if (!$avatar) {
$avatar = "".$site_config["SITEURL"]."/images/default_avatar.gif";
}
echo "<tr><td><img src=$avatar width=60 height=75 border=0></td><td><a href=account-details.php?id=$id><font color=blue>".$ami."</a></td><td><img src=images/button_o".($res2[last_access]>$dt?"n":"ff")."line.gif></td><td><a href=mailbox.php?compose&id=$res2[id]>". "<img src=images/button_pm.gif border=0></a></center></td></tr>";
}
echo"</tr>";
echo "</table>";
}
end_block();
?>

Report if ok.
just something i noticed with the markup posted for this mod that may cause some issues, you will get a extra <tr></tr> tags at start and end of the table.

if you adding the table row tags here:

echo "<tr><td><img src=$avatar width=60 height=75 border=0></td><td><a href=account-details.php?id=$id><font color=blue>".$ami."</a></td><td><img src=images/button_o".($res2[last_access]>$dt?"n":"ff")."line.gif></td><td><a href=mailbox.php?compose&id=$res2[id]>". "<img src=images/button_pm.gif border=0></a></center></td></tr>

then these 2 lines are not needed

echo"<tr>";

and
echo"</tr>";

:)
2014-07-20 16:02:51
Thanks...

login_block v2.08




Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728