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-25 23:13:33
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'
Unknown User
2009-01-26 00:32:35
I have an image like that, when any friend is online appears the phrase "No friends online" and that appeared the avatar of the person, and bottom of each friend a line separating them, the end of the block reads "View all friends" a link that would lead to the page friends.php

thanks.



imagem2.jpg
imagem2.jpg
friends_online.jpg
friends_online.jpg
Unknown User
2009-01-26 05:02:14
I started doing the way that the MOD Chujh2 but I wanted to go to sleep, lack some things, like when you're not no friend Online does not appear anyone, and get the space that is appearing at the beginning of the block.

ALL THE MERITS OF THIS MOD TO GO nightmare, ME BASI IN HIS MOD.

Thank you nightmare

Hugs to everyone even more.

<?php
begin_block("Amigos");

if ($site_config["MEMBERSONLY"] && !$CURUSER) {

echo "<BR><BR><b><CENTER>Voc

semtitulo.jpg
semtitulo.jpg
Unknown User
2009-01-26 12:09:13
Quote:
Yes good idea i take a look

Thanks

Because this is my site...



lol
friends_online.jpg
friends_online.jpg
Unknown User
2009-01-26 13:30:54
Unknown column 'friendid' in 'field list'
Unknown User
2009-01-26 13:33:30
You have to had the Friends mod installed first daffy
Unknown User
2009-01-26 13:33:52
"daffy, post: 52490":
Unknown column 'friendid' in 'field list'

you need to install the friends mod. in the title it says "Addonc for Friends Mod"
Unknown User
2009-01-26 14:24:00
someone could modify the code that I posted up there, only to appear on the block that the friend is online, and when there is no written up a sentence "There is no online friends?

thank you very much
Unknown User
2009-01-26 15:10:41
just need to add a condition to the query like WHERE last access > $dt and add a if clause.
Unknown User
2009-01-26 21:02:12
there is a problem when you delete a friend he leaves the block, he continues in that block you from deleting it Friend.php
Unknown User
2009-01-26 21:39:17
If the friens is deleted it's impossible that he still in block caus the query are done in the table friends : $sql = "SELECT id, friendid FROM friends WHERE userid = '$CURUSER[id]'";

so if the friend is deleted, this query returns nothing, if it return a "deleted" friend, you have a problem in takedelfriends.php, that your friend is
Unknown User
2009-01-26 22:08:05
I'm with other problem is showing the phrase "No friends online" in the same amount of friends aicionados, as I do to appear only once?

About friend deleted not leave the block you think is the takedelfriends.php?

How would you get this code will not appear for any online friend when you're not anyone online?

<?php
if (!$site_config["MEMBERSONLY"] || $CURUSER) {

begin_block("Amigos");

/*if ($site_config["MEMBERSONLY"] && !$CURUSER) {

echo "<BR><BR><b><CENTER>Voc
Unknown User
2009-01-26 23:09:15
if you put this line: print ("<center><br>Nenhum Amigo Online.</center></br>"); inside a while, it wil be repeated with each match, you have to put your condition before the while, and your condition is wrong.

Se poes esta ligna dentro de um while, ela sera repetida para cada pessoa encontrada, tens de por a condicao antes do while e a condicao que puseste nao da nada esta errado.
Unknown User
2009-01-27 03:37:34
be the same in account.php

find in account.php

		<?print("<a href=account.php><b>Account Profile</b></a>");?>
&nbsp;|&nbsp;

after add

		<?print("<a href=friend.php><b>My Friends</b></a>");?>
&nbsp;|&nbsp;

Unknown User
2009-01-27 13:22:58
Nightmare I'm not getting the code to make friends who are not online does not appear on the Block, which would be how you get the code that I will post here and then post to me correctly?

<?php
if (!$site_config["MEMBERSONLY"] || $CURUSER) {

begin_block("Amigos");

/*if ($site_config["MEMBERSONLY"] && !$CURUSER) {

echo "<BR><BR><b><CENTER>Voc
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: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728