Author Topic: [MOD] Buddy List || Friend List  (Read 136220 times)

0 Members and 1 Guest are viewing this topic.

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
[MOD] Buddy List || Friend List
« on: May 14, 2007, 06:56:49 PM »
COMMENTS BY AUTHOR
   My second mod to 4images. :)  I wanted to install this mod allways and
   now I have maked it for all us.  This is the first version and I tested
   in 1.7.3 , and the other users : 1.7.1 and 1.7 4images version.

DESCRIPTION
   This mod make a buddy list (or friend list) for user registered. The user
   will can delete all the list or a friend. At the moment the user can add
   his list a friend in comments from details or member_profile page.

DOWNLOAD
: With an english and spanish install version
DEMO: http://www.myart.es   user:test  pass: test

ADDONS:
- Letter Select
- Icon and Order by User Sex/Gender
- Member Personal Photo in the list
- PM icon in the list

- User Status => by Loda
- Users List that added as a friend in profile
- Send PM to users that added you as a friend for notify that you have uploaded a file
- Avatar MOD no Userpic mod
« Last Edit: December 01, 2007, 10:00:07 AM by ccsakuweb »
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: [MOD] Buddy List || Friend List
« Reply #1 on: May 14, 2007, 08:12:26 PM »
hello!
thank you very much! great work!
it's running on 1.7, too!
a little mitake in the friendslist.php:
change
Code: [Select]
include(ROOT_PATH.'includes/paging.php');to this:
Code: [Select]
include(ROOT_PATH.'includes/user_paging.php');

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD] Buddy List || Friend List
« Reply #2 on: May 14, 2007, 08:32:21 PM »
ups! thank you I forgot. I have user_paging.php because memberlist mod XD

I'm very happy! thanks for you reply ^^

If your interested I have posted some addons here

And in my gallery I added other atribute in users table.  Because in profiles of my gallery the users can show who added their to friends list. If you are interested i will post that version.
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: [MOD] Buddy List || Friend List
« Reply #3 on: May 16, 2007, 11:36:20 AM »
yes! I'm very interesting in your addons! can you post it? thank you very much.
another question:
is it possible to show the number of new images from a buddy (amigo) in the friendslist ?

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD] Buddy List || Friend List
« Reply #4 on: May 16, 2007, 11:53:29 AM »
I did the addon because I want to send a notify by pm when a user upload a picture.
So If you added me as a friend, and when I upload a picture you receive a pm with name, thumbnail, url... from the new picture

I think that your idea is possible but it is like my idea, what idea do you like more?? Because, at the moment I don't have time, I have to study, maybe this weekend I will try the best idea

:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: [MOD] Buddy List || Friend List
« Reply #5 on: May 16, 2007, 12:49:06 PM »
I did the addon because I want to send a notify by pm when a user upload a picture.
So If you added me as a friend, and when I upload a picture you receive a pm with name, thumbnail, url... from the new picture
that's it!! yes!!

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Buddy List || Friend List
« Reply #6 on: May 16, 2007, 01:16:56 PM »
... if Loda has tested this MOD and he said ... all OK ... the MOD is running ... then this MOD is ok and works ...
... the MOD is moved to Mods & Plugins (Releases & Support) ...
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD] Buddy List || Friend List
« Reply #7 on: May 16, 2007, 01:33:05 PM »
 :lol: great! hehe thanks!!!

@Loda: ok! Then this weekend I will try that XD

maybe someone could help me to fix search a friend in friendslist .
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: [MOD] Buddy List || Friend List
« Reply #8 on: May 16, 2007, 10:24:25 PM »
hello,
nice to here that! i'm still waiting..  :wink:
i think the mistake is that you search for the user_name. maybe you search for the user_friend_ids
the same mistake with the integration of the letterbits-mod? have you tried this?

@mawenzi:  :oops: the mod works fine ... the search in the friendlist is not necessarily for me.

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD] Buddy List || Friend List
« Reply #9 on: May 16, 2007, 11:51:58 PM »
hi! i fixed the problem in search  :lol:  i forgot to add the condition XD
ok!

Search:
Code: [Select]
//----------------------------
//---- Sort ------------------
//----------------------------

add before:
Code: [Select]
$condition = "";
$user_search = "";

Search:
Code: [Select]
$sql = "SELECT *
        FROM ".USERS_TABLE."
WHERE user_id IN ($friends_id_sql)
        ORDER BY $order_by
        LIMIT $offset, $user_per_page";

Replace to:
Code: [Select]
$sql = "SELECT *
        FROM ".USERS_TABLE."
WHERE user_id IN ($friends_id_sql) ".$condition."
        ORDER BY $order_by
        LIMIT $offset, $user_per_page";

Search:
Code: [Select]
$sql = "SELECT COUNT(user_id) AS total_friends
       FROM ".USERS_TABLE."
   WHERE user_id IN ($friends_id_sql) ";

Replace:
Code: [Select]
$sql = "SELECT COUNT(user_id) AS total_friends
       FROM ".USERS_TABLE."
   WHERE user_id IN ($friends_id_sql) ".$condition."";

Download UPDATED.

I don't use the letterbits but do you want it??
« Last Edit: May 17, 2007, 10:31:45 AM by ccsakuweb »
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: [MOD] Buddy List || Friend List
« Reply #10 on: May 17, 2007, 09:32:09 AM »
yes i want..
and tried it but no result..  :cry:
i have change this:
Code: [Select]
$sql = "SELECT COUNT(user_id) AS total_friends
       FROM ".USERS_TABLE."
   WHERE user_id IN ($friends_id_sql)";
to this:
Code: [Select]
$sql = "SELECT COUNT(user_id) AS total_friends
       FROM ".USERS_TABLE."
   WHERE user_id IN ($friends_id_sql) ".$condition."";
but without success..
do you have any idea?

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD] Buddy List || Friend List
« Reply #11 on: May 17, 2007, 10:36:29 AM »
Yes I forgot change that sql sentence.

I tried it and works.
Search:
Code: [Select]
$condition = "";
$user_search = "";

After add:
Code: [Select]
//--------------------------------
//------ Letter Select ----------
//--------------------------------

$ltr = "";
$letter = "num";
$letterbits = "<TABLE width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" class=\"bordercolor\">\n<tr>\n<TD>\n<TABLE width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">\n<TR align=\"center\"><td class=\"row1\">";
if (isset($HTTP_GET_VARS['ltr']) || isset($HTTP_POST_VARS['ltr'])) {
$ltr = (isset($HTTP_POST_VARS['ltr'])) ? $HTTP_POST_VARS['ltr'] : $HTTP_GET_VARS['ltr'];
}
if ($ltr) {
$letterbits .= "<normalfont><a href=\"".$site_sess->url(ROOT_PATH."friendslist.php")."\">".$lang['lang_all']."</a></normalfont>";
  if ($ltr == "num") {
$condition = " AND ".get_user_table_field("", "user_name")." NOT REGEXP(\"^[a-zA-Z]\")";
}else{
$ltr = chr(intval(ord($ltr)));
$condition = ($ltr) ? " AND ".get_user_table_field("", "user_name")." LIKE '".addslashes($ltr)."%'" : "";
}
$user_search = "ltr=".$ltr;
}else{
$letterbits .= "<normalfont>[<b>".$lang['lang_all']."</b>]</normalfont>";
}
if ($ltr == $letter) {
$letterbits .= "&nbsp;.&nbsp;<normalfont>[<b>#</b>]</normalfont>";
} else {
$letterbits .= "&nbsp;.&nbsp;<normalfont><a href=\"".$site_sess->url(ROOT_PATH."friendslist.php?ltr=$letter")."\">#</a></normalfont>";
}
for ($i = 65; $i < 91; $i++) {
$letter = chr($i); $linkletter = $letter;
if ($ltr == $letter) {
$letterbits .= "&nbsp;.&nbsp;<normalfont>[<b>$letter</b>]</normalfont>";
} else {
$letterbits .= "&nbsp;.&nbsp;<normalfont><a href=\"".$site_sess->url(ROOT_PATH."friendslist.php?ltr=$letter")."\">$letter</a></normalfont>";
}
}
$letterbits .= "</td></TR>\n</TABLE>\n</TD>\n</TR>\n</TABLE>";
//---- End Letter Select ----

Search:
Code: [Select]
'mode_action' => $site_sess->url(ROOT_PATH."friendslist.php".(($user_search) ? "?$user_search" : "")))
Before adD:
Code: [Select]
'letterbits' => $letterbits,

Use {letterbits} where you want in friendslist.html
in my list i use like that:
Code: [Select]
{if friendslist}{letterbits}
<table width="450" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="head1">
                        <table width="100%" border="0" cellspacing="0" cellpadding="3">

                          <tr>
                            <td class="row2" valign="top">{friendslist}</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>
  {endif friendslist}


Please tell me if it works. If it doesn't work please say me what is your problem
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD] Buddy List || Friend List
« Reply #12 on: May 17, 2007, 10:42:27 AM »
@Loda it would be great that you post your main changes and the friendslist button in english :wink:
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: [MOD] Buddy List || Friend List
« Reply #13 on: May 17, 2007, 11:06:20 AM »
ok..
it works..
i found my mistake.. i have insert the part "letterselect" before and not after "$condition = "";
$user_search = "";

i'm an idiot..

my friedlist buttons:

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD] Buddy List || Friend List
« Reply #14 on: May 17, 2007, 11:11:01 AM »
ok! doesn't matter. thank you for the icons I will put them in fiendslist mod If you let me ^^
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more