You are here

README.txt in User Relationships 5.2

User Relationships Module
-------------------------
This module allows users to create named relationships between each other.

Relationship types are defined by the admins.

Multiple relationships are supported and can be enabled or disabled

Send comments to Jeff Smick: http://drupal.org/user/107579/contact, or post an issue at
http://drupal.org/project/user_relationships.


Requirements
------------
Drupal 5


Installation
------------
1. Copy the user_relationships folder to the appropriate Drupal directory.

2. Enable User Relationships in the "Site building -> modules" administration screen.

   Enabling the User Relationships 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.

3. Create relationship types in "User Management -> User Relationships -> Add relationship"



Developers
------------
I tried to make this module as modular as possible (is that a horrible sentence? I don't care).
This is the core to a more robust set of features that are built as plugins. I tried to make it as
extensible as possible. If you need something more out of the core (and I hope that you don't), please
feel free to get in contact with me (http://drupal.org/user/107579/contact) and we can talk about it.

Take a look at the following files for more information about the API and theme-able functions provided
  user_relationships_api.inc
  user_relationships_theme.inc

The module also invokes a "user_relationships" hook passing in the following argumens:
  $type will be a string of the following
    $type     | $category               | Description
    ----------------------------------------------------------------------
    insert    | type                    | before a new relationship type is created
    update    | type                    | before a relationship type is updated
    delete    | type                    | after a relationship type is deleted
    load      | type                    | after a relationship type is loaded (so you can add data to it if you'd like)

    load      | NULL                    | after a relationship is loaded
    pre-save  | request|update|approve  | before a new relationship is created or updated
    post-save | request|update|approve  | after a new relationship is created or updated
    delete    | remove                  | when a relationship is removed
    delete    | cancel                  | when a relationship request is cancelled
    delete    | disapprove              | when a relationship request is disapprove
    

  $relationship either the relationship_type or relationship object


Database Schema
---------------
MySQL
=====

--
-- Table structure for table `user_relationships`
--

CREATE TABLE IF NOT EXISTS `user_relationships` (
  `rid` int(10) unsigned NOT NULL default '0',
  `requester_id` int(11) NOT NULL default '0',
  `requestee_id` int(11) NOT NULL default '0',
  `rtid` int(11) NOT NULL default '0',
  `approved` tinyint(1) NOT NULL default '0',
  `created_at` int(11) NOT NULL,
  `updated_at` int(11) NOT NULL,
  UNIQUE KEY `requester_id_2` (`requester_id`,`requestee_id`,`rtid`),
  KEY `rid` (`rid`),
  KEY `requester_id` (`requester_id`),
  KEY `requestee_id` (`requestee_id`),
  KEY `rtid` (`rtid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

--
-- Table structure for table `user_relationship_types`
--
CREATE TABLE IF NOT EXISTS `user_relationship_types` (
`rtid` int(10) unsigned NOT NULL default '0',
`name` varchar(255) NOT NULL default '',
`plural_name` varchar(255) NOT NULL default '',
`is_oneway` tinyint(1) NOT NULL default '0',
`requires_approval` tinyint(1) NOT NULL default '0',
`expires_val` int(10) unsigned NOT NULL default 0,
PRIMARY KEY (`rtid`),
UNIQUE KEY `name` (`name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


Credits
-------
Written by Jeff Smick.
Written originally for and financially supported by OurChart Inc. (http://www.ourchart.com)
Thanks to the BuddyList module team for their inspiration

File

README.txt
View source
  1. User Relationships Module
  2. -------------------------
  3. This module allows users to create named relationships between each other.
  4. Relationship types are defined by the admins.
  5. Multiple relationships are supported and can be enabled or disabled
  6. Send comments to Jeff Smick: http://drupal.org/user/107579/contact, or post an issue at
  7. http://drupal.org/project/user_relationships.
  8. Requirements
  9. ------------
  10. Drupal 5
  11. Installation
  12. ------------
  13. 1. Copy the user_relationships folder to the appropriate Drupal directory.
  14. 2. Enable User Relationships in the "Site building -> modules" administration screen.
  15. Enabling the User Relationships module will trigger the creation of the database schema.
  16. If you are shown error messages you may have to create the schema by hand. Please
  17. see the database definition at the end of this file.
  18. 3. Create relationship types in "User Management -> User Relationships -> Add relationship"
  19. Developers
  20. ------------
  21. I tried to make this module as modular as possible (is that a horrible sentence? I don't care).
  22. This is the core to a more robust set of features that are built as plugins. I tried to make it as
  23. extensible as possible. If you need something more out of the core (and I hope that you don't), please
  24. feel free to get in contact with me (http://drupal.org/user/107579/contact) and we can talk about it.
  25. Take a look at the following files for more information about the API and theme-able functions provided
  26. user_relationships_api.inc
  27. user_relationships_theme.inc
  28. The module also invokes a "user_relationships" hook passing in the following argumens:
  29. $type will be a string of the following
  30. $type | $category | Description
  31. ----------------------------------------------------------------------
  32. insert | type | before a new relationship type is created
  33. update | type | before a relationship type is updated
  34. delete | type | after a relationship type is deleted
  35. load | type | after a relationship type is loaded (so you can add data to it if you'd like)
  36. load | NULL | after a relationship is loaded
  37. pre-save | request|update|approve | before a new relationship is created or updated
  38. post-save | request|update|approve | after a new relationship is created or updated
  39. delete | remove | when a relationship is removed
  40. delete | cancel | when a relationship request is cancelled
  41. delete | disapprove | when a relationship request is disapprove
  42. $relationship either the relationship_type or relationship object
  43. Database Schema
  44. ---------------
  45. MySQL
  46. =====
  47. --
  48. -- Table structure for table `user_relationships`
  49. --
  50. CREATE TABLE IF NOT EXISTS `user_relationships` (
  51. `rid` int(10) unsigned NOT NULL default '0',
  52. `requester_id` int(11) NOT NULL default '0',
  53. `requestee_id` int(11) NOT NULL default '0',
  54. `rtid` int(11) NOT NULL default '0',
  55. `approved` tinyint(1) NOT NULL default '0',
  56. `created_at` int(11) NOT NULL,
  57. `updated_at` int(11) NOT NULL,
  58. UNIQUE KEY `requester_id_2` (`requester_id`,`requestee_id`,`rtid`),
  59. KEY `rid` (`rid`),
  60. KEY `requester_id` (`requester_id`),
  61. KEY `requestee_id` (`requestee_id`),
  62. KEY `rtid` (`rtid`)
  63. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  64. --
  65. -- Table structure for table `user_relationship_types`
  66. --
  67. CREATE TABLE IF NOT EXISTS `user_relationship_types` (
  68. `rtid` int(10) unsigned NOT NULL default '0',
  69. `name` varchar(255) NOT NULL default '',
  70. `plural_name` varchar(255) NOT NULL default '',
  71. `is_oneway` tinyint(1) NOT NULL default '0',
  72. `requires_approval` tinyint(1) NOT NULL default '0',
  73. `expires_val` int(10) unsigned NOT NULL default 0,
  74. PRIMARY KEY (`rtid`),
  75. UNIQUE KEY `name` (`name`)
  76. ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
  77. Credits
  78. -------
  79. Written by Jeff Smick.
  80. Written originally for and financially supported by OurChart Inc. (http://www.ourchart.com)
  81. Thanks to the BuddyList module team for their inspiration