aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2010-12-28 01:06:34 -0800
committerFriendika <info@friendika.com>2010-12-28 01:06:34 -0800
commit7b6385df946db4a61e8fc330c1a89b1415ca68ef (patch)
treef0a5f4ba4384ee274bad694112eb0140656c3f21
parent76d92d3f6249845f5eaba573083aba0f99755afc (diff)
downloadvolse-hubzilla-7b6385df946db4a61e8fc330c1a89b1415ca68ef.tar.gz
volse-hubzilla-7b6385df946db4a61e8fc330c1a89b1415ca68ef.tar.bz2
volse-hubzilla-7b6385df946db4a61e8fc330c1a89b1415ca68ef.zip
freeform text area for private contact info - notes or things you just want to remember (addresses, phone numbers, birthdays, whatever)
-rw-r--r--boot.php2
-rw-r--r--database.sql1
-rw-r--r--mod/contacts.php8
-rw-r--r--update.php3
-rw-r--r--view/contact_head.tpl31
-rw-r--r--view/en/contact_edit.tpl8
-rw-r--r--view/it/contact_edit.tpl9
7 files changed, 60 insertions, 2 deletions
diff --git a/boot.php b/boot.php
index 6565d40bd..197b6d238 100644
--- a/boot.php
+++ b/boot.php
@@ -2,7 +2,7 @@
set_time_limit(0);
-define ( 'BUILD_ID', 1029 );
+define ( 'BUILD_ID', 1030 );
define ( 'DFRN_PROTOCOL_VERSION', '2.0' );
define ( 'EOL', "<br />\r\n" );
diff --git a/database.sql b/database.sql
index bb151da27..4a8350f84 100644
--- a/database.sql
+++ b/database.sql
@@ -87,6 +87,7 @@ CREATE TABLE IF NOT EXISTS `contact` (
`pending` tinyint(1) NOT NULL DEFAULT '1',
`rating` tinyint(1) NOT NULL DEFAULT '0',
`reason` text NOT NULL,
+ `info` MEDIUMTEXT NOT NULL AFTER `reason`,
`profile-id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `uid` (`uid`),
diff --git a/mod/contacts.php b/mod/contacts.php
index 29ef8a8cd..33d1955a5 100644
--- a/mod/contacts.php
+++ b/mod/contacts.php
@@ -65,12 +65,15 @@ function contacts_post(&$a) {
$reason = notags(trim($_POST['reason']));
- $r = q("UPDATE `contact` SET `profile-id` = %d, `priority` = %d , `rating` = %d, `reason` = '%s'
+ $info = escape_tags(trim($_POST['info']));
+
+ $r = q("UPDATE `contact` SET `profile-id` = %d, `priority` = %d , `rating` = %d, `reason` = '%s', `info` = '%s'
WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($profile_id),
intval($priority),
intval($rating),
dbesc($reason),
+ dbesc($info),
intval($contact_id),
intval(local_user())
);
@@ -190,6 +193,8 @@ function contacts_content(&$a) {
return;
}
+ $tpl = load_view_file('view/contact_head.tpl');
+ $a->page['htmlhead'] .= replace_macros($tpl, array('$baseurl' => $a->get_baseurl()));
require_once('include/contact_selectors.php');
@@ -239,6 +244,7 @@ function contacts_content(&$a) {
'$block_text' => (($r[0]['blocked']) ? t('Unblock this contact') : t('Block this contact') ),
'$ignore_text' => (($r[0]['readonly']) ? t('Unignore this contact') : t('Ignore this contact') ),
'$insecure' => (($r[0]['network'] === 'dfrn') ? '' : load_view_file('view/insecure_net.tpl')),
+ '$info' => $r[0]['info'],
'$blocked' => (($r[0]['blocked']) ? '<div id="block-message">' . t('Currently blocked') . '</div>' : ''),
'$ignored' => (($r[0]['readonly']) ? '<div id="ignore-message">' . t('Currently ignored') . '</div>' : ''),
'$rating' => contact_reputation($r[0]['rating']),
diff --git a/update.php b/update.php
index d6fab4255..afa3b58a4 100644
--- a/update.php
+++ b/update.php
@@ -274,3 +274,6 @@ function update_1028() {
q("ALTER TABLE `user` ADD `openidserver` text NOT NULL AFTER `deny_gid` ");
}
+function update_1029() {
+ q("ALTER TABLE `contact` ADD `info` MEDIUMTEXT NOT NULL AFTER `reason` ");
+}
diff --git a/view/contact_head.tpl b/view/contact_head.tpl
new file mode 100644
index 000000000..6a80c2122
--- /dev/null
+++ b/view/contact_head.tpl
@@ -0,0 +1,31 @@
+<script language="javascript" type="text/javascript"
+ src="$baseurl/tinymce/jscripts/tiny_mce/tiny_mce_src.js"></script>
+ <script language="javascript" type="text/javascript">
+
+
+tinyMCE.init({
+ theme : "advanced",
+ mode : "exact",
+ elements: "contact-edit-info",
+ plugins : "bbcode",
+ theme_advanced_buttons1 : "bold,italic,underline,undo,redo,link,unlink,image,forecolor",
+ theme_advanced_buttons2 : "",
+ theme_advanced_buttons3 : "",
+ theme_advanced_toolbar_location : "top",
+ theme_advanced_toolbar_align : "center",
+ theme_advanced_styles : "Code=codeStyle;Quote=quoteStyle",
+ content_css : "bbcode.css",
+ entity_encoding : "raw",
+ add_unload_trigger : false,
+ remove_linebreaks : false,
+ force_p_newlines : false,
+ force_br_newlines : true,
+ forced_root_block : '',
+ content_css: "$baseurl/view/custom_tinymce.css"
+
+
+});
+
+
+</script>
+
diff --git a/view/en/contact_edit.tpl b/view/en/contact_edit.tpl
index a5c8dc4ab..79a7651c1 100644
--- a/view/en/contact_edit.tpl
+++ b/view/en/contact_edit.tpl
@@ -38,6 +38,14 @@ $ignored
<form action="contacts/$contact_id" method="post" >
<input type="hidden" name="contact_id" value="$contact_id">
+<div id="contact-edit-info-wrapper">
+<h4>Contact Information / Notes</h4>
+<textarea id="contact-edit-info" rows="10" cols="72" name="info" >$info</textarea>
+</div>
+<div id="contact-edit-info-end"></div>
+
+<input class="contact-edit-submit" type="submit" name="submit" value="Submit" />
+
<div id="contact-edit-profile-select-text">
<h4>Profile Visibility</h4>
<p>Please choose the profile you would like to display to $name when viewing your profile securely.
diff --git a/view/it/contact_edit.tpl b/view/it/contact_edit.tpl
index cc4db7c15..80446f044 100644
--- a/view/it/contact_edit.tpl
+++ b/view/it/contact_edit.tpl
@@ -38,6 +38,15 @@ $ignored
<form action="contacts/$contact_id" method="post" >
<input type="hidden" name="contact_id" value="$contact_id">
+<div id="contact-edit-info-wrapper">
+<h4>Informazioni di contatto / Note</h4>
+<textarea id="contact-edit-info" rows="10" cols="72" name="info" >$info</textarea>
+</div>
+<div id="contact-edit-info-end"></div>
+
+<input class="contact-edit-submit" type="submit" name="submit" value="Aggiorna" />
+
+
<div id="contact-edit-profile-select-text">
<h4>Visibilt&agrave; Profiloe</h4>
<p>Scegli il profilo che vuoi mostrare a $name quando guarda il tuo profilo in modo sicuro.</p>