diff --git a/INSTALL b/INSTALL
index ceb73c3b9c..577f3f354c 100644
--- a/INSTALL
+++ b/INSTALL
@@ -23,6 +23,7 @@ encryption support
- PHP *command line* access with register_argc_argv set to true in the
php.ini file
- curl, gd, mysql, and openssl extensions
+ - some form of email server or email gateway such that PHP mail() works
- mcrypt (optional; used for end-to-end message encryption)
- Mysql 5.x
diff --git a/boot.php b/boot.php
index 1870e059e9..9cc4d0f34f 100644
--- a/boot.php
+++ b/boot.php
@@ -2,7 +2,7 @@
set_time_limit(0);
-define ( 'BUILD_ID', 1024 );
+define ( 'BUILD_ID', 1027 );
define ( 'DFRN_PROTOCOL_VERSION', '2.0' );
define ( 'EOL', "
\r\n" );
@@ -174,8 +174,10 @@ class App {
public $pager;
public $strings;
public $path;
+ public $hooks;
public $interactive = true;
+
private $scheme;
private $hostname;
private $baseurl;
@@ -1924,7 +1926,7 @@ function profile_sidebar($profile) {
$gender = ((x($profile,'gender') == 1) ? '
' . t('Gender:') . ' ' . $profile['gender'] . '
' : '');
- $pubkey = ((x($profile,'key') == 1) ? '' . $profile['pubkey'] . '
' : '');
+ $pubkey = ((x($profile,'pubkey') == 1) ? '' . $profile['pubkey'] . '
' : '');
$marital = ((x($profile,'marital') == 1) ? '♥ ' . t('Status:') . ' ' . $profile['marital'] . '
' : '');
@@ -1945,4 +1947,58 @@ function profile_sidebar($profile) {
));
return $o;
-}}
\ No newline at end of file
+}}
+
+
+if(! function_exists('register_hook')) {
+function register_hook($hook,$file,$function) {
+
+ $r = q("INSERT INTO `hook` (`hook`, `file`, `function`) VALUES ( '%s', '%s', '%s' ) ",
+ dbesc($hook),
+ dbesc($file),
+ dbesc($function)
+ );
+ return $r;
+}}
+
+if(! function_exists('unregister_hook')) {
+function unregister_hook($hook,$file,$function) {
+
+ $r = q("DELETE FROM `hook` WHERE `hook` = '%s' AND `file` = '%s' AND `function` = '%s' LIMIT 1",
+ dbesc($hook),
+ dbesc($file),
+ dbesc($function)
+ );
+ return $r;
+}}
+
+
+if(! function_exists('load_hooks')) {
+function load_hooks() {
+ $a = get_app();
+ $r = q("SELECT * FROM `hook` WHERE 1");
+ if(count($r)) {
+ foreach($r as $rr) {
+ $a->hooks[] = array($rr['hook'], $rr['file'], $rr['function']);
+ }
+ }
+}}
+
+
+if(! function_exists('call_hooks')) {
+function call_hooks($name, $data = null) {
+ $a = get_app();
+
+ if(count($a->hooks)) {
+ foreach($a->hooks as $hook) {
+ if($hook[0] === $name) {
+ @require_once($hook[1]);
+ if(function_exists($hook[2])) {
+ $func = $hook[2];
+ $func($a,$data);
+ }
+ }
+ }
+ }
+}}
+
diff --git a/database.sql b/database.sql
index dab7c179d9..08902d8930 100644
--- a/database.sql
+++ b/database.sql
@@ -292,6 +292,7 @@ CREATE TABLE IF NOT EXISTS `profile` (
`sexual` char(255) NOT NULL,
`politic` char(255) NOT NULL,
`religion` char(255) NOT NULL,
+ `keywords` text NOT NULL,
`about` text NOT NULL,
`summary` char(255) NOT NULL,
`music` text NOT NULL,
@@ -371,6 +372,7 @@ CREATE TABLE IF NOT EXISTS `user` (
`notify-flags` int(11) unsigned NOT NULL DEFAULT '65535',
`page-flags` int(11) unsigned NOT NULL DEFAULT '0',
`pwdreset` char(255) NOT NULL,
+ `maxreq` int(11) NOT NULL DEFAULT '10',
`allow_cid` mediumtext NOT NULL,
`allow_gid` mediumtext NOT NULL,
`deny_cid` mediumtext NOT NULL,
@@ -431,3 +433,11 @@ CREATE TABLE IF NOT EXISTS `pconfig` (
) ENGINE = MYISAM DEFAULT CHARSET=utf8;
+CREATE TABLE IF NOT EXISTS `hook` (
+`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
+`hook` CHAR( 255 ) NOT NULL ,
+`file` CHAR( 255 ) NOT NULL ,
+`function` CHAR( 255 ) NOT NULL
+) ENGINE = MYISAM DEFAULT CHARSET=utf8;
+
+
diff --git a/include/profile_selectors.php b/include/profile_selectors.php
index f4b30f2118..92579f64aa 100644
--- a/include/profile_selectors.php
+++ b/include/profile_selectors.php
@@ -16,7 +16,7 @@ function gender_selector($current="",$suffix="") {
function sexpref_selector($current="",$suffix="") {
$o = '';
- $select = array('', t('Males'), t('Females'), t('No Preference'), t('Bisexual'), t('Autosexual'), t('Abstinent'), t('Virgin'), t('Deviant'), t('Fetish'), t('Oodles'), t('Nonsexual'));
+ $select = array('', t('Males'), t('Females'), t('Gay'), t('Lesbian'), t('No Preference'), t('Bisexual'), t('Autosexual'), t('Abstinent'), t('Virgin'), t('Deviant'), t('Fetish'), t('Oodles'), t('Nonsexual'));
$o .= "