Stripping CVS keywords
[project/buddylist.git] / README.txt
CommitLineData
2be3942d
DN
1Readme
2------
6172d5d4 3This module allows users to put each other on a personal 'Buddy List'.
2be3942d 4
6172d5d4 5Features include buddy groups and the ability to track your buddies' recent posts.
2be3942d 6
6172d5d4 7Send comments to Robert Douglass at: http://drupal.org/user/5449/contact
2be3942d
DN
8
9
6172d5d4
RD
10Requirements
11------------
18909951 12This module requires Drupal 5.x.
2be3942d 13
6172d5d4 14This module does not yet offer PostgreSQL support. If you would like to contribute to this module by creating the appropriate PostgreSQL schema, please submit your code at http://drupal.org/project/issues/buddylist
2be3942d
DN
15
16
2be3942d 17
6172d5d4
RD
18Installation
19------------
201. Copy the buddylist.module to the Drupal modules/ directory.
2be3942d 21
6172d5d4 222. Enable buddy list in the "site settings | modules" administration screen.
2be3942d 23
6172d5d4
RD
24 Enabling the buddylist module will trigger the creation of the database schema. If you are shown error messages you may have to create the schema by hand. Please see the database definition at the end of this file.
25
263. Enable buddy list blocks you want in the "blocks" administration screen.
27
284. Optionally add the following theme function to your PHPTemplate's template.php file:
29
30function phptemplate_username($object) {
31 global $user;
32 /* Use the default theme_username for anonymous users, nodes by this user */
33 if ($user->uid == 0 || $object->uid == $user->uid || $object->uid == 0) {
34 return theme_username($object);
35 }
36 if (!user_access('maintain buddy list')) {
37 return theme_username($object);
38 }
39
40 /* an array, keyed on buddy uids */
41 $buddies = buddylist_get_buddies($user->uid);
42 /* Find out if this buddy is in the user's buddy list */
43 foreach ($buddies as $buddyuid => $buddystructure) {
44 if ($buddyuid == $object->uid) {
45 $output .= theme_username($object);
46 $output .= ' (';
47 $output .= theme('remove_from_buddylist_link', $object);
48 $output .= ')';
49 return $output;
50 }
51 }
52 /* The user is not in the buddylist, give a link to add */
53 $output .= theme_username($object);
54 $output .= ' (';
55 $output .= theme('add_to_buddylist_link', $object);
56 $output .= ')';
57 return $output;
58}
59
60
61Database Schema
62---------------
63If the automatic creation of the database tables was unsuccessful you can try creating the tables by hand using the following SQL:
64
65CREATE TABLE `buddylist` (
66 `uid` int(10) unsigned NOT NULL default '0',
67 `buddy` int(10) unsigned NOT NULL default '0',
68 `timestamp` int(11) NOT NULL default '0',
69 `received` tinyint(1) NOT NULL default '0',
70 UNIQUE KEY `uid-buddy-label` (`uid`,`buddy`),
71 KEY `uid` (`uid`)
72) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;
73
74--
75-- Table structure for table `buddylist_buddy_group`
76--
77
78CREATE TABLE `buddylist_buddy_group` (
79 `uid` int(11) NOT NULL default '0',
80 `buddy` int(11) NOT NULL default '0',
81 `label_id` int(11) NOT NULL default '0',
82 PRIMARY KEY (`uid`,`buddy`,`label_id`)
83) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;
84
85--
86-- Table structure for table `buddylist_groups`
87--
88
89CREATE TABLE `buddylist_groups` (
90 `uid` int(11) NOT NULL default '0',
91 `label_id` int(11) NOT NULL default '0',
92 `label` varchar(255) NOT NULL default '',
93 `visible` tinyint(1) NOT NULL default '0',
94 PRIMARY KEY (`uid`,`label_id`)
95) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;
96
97
98Credits
99-------
100Written by Adrian Rossouw.
101Thanks to Ratko Kovacina for the comments/debugging info
102Browsing improvements by Doug Sikora
103
104Maintainer: Robert Douglass
105Status: maintained (Feb. 2006)
106
e4cefdd6
RD
107Request/Approval Feature by Ankur Rishi, courtesy of Jewcy.com
108
6172d5d4
RD
109TODO
110----
1111. PGSQL schema (see buddylist.install, buddylist_install())
1122. Rework texts so that one is not stuck with "buddy" but could choose "contact", for example
1133. Make a workflow whereby a buddy request is sent to the buddy for confirmation which is required before the buddy can be added.
1144. Make the notification that someone added you to their buddylist use the privatemsg module, if available.
1155. Consider possible Views module integration.