]> git.mxchange.org Git - friendica.git/commitdiff
freeform text area for private contact info - notes or things you just want to rememb...
authorFriendika <info@friendika.com>
Tue, 28 Dec 2010 09:06:34 +0000 (01:06 -0800)
committerFriendika <info@friendika.com>
Tue, 28 Dec 2010 09:06:34 +0000 (01:06 -0800)
boot.php
database.sql
mod/contacts.php
update.php
view/contact_head.tpl [new file with mode: 0644]
view/en/contact_edit.tpl
view/it/contact_edit.tpl

index 6565d40bd823d1a1eecef8f632766df9f0d30178..197b6d2381c98c9dd8927379f068d138f05b67c2 100644 (file)
--- 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"     );
index bb151da27cc4f46d1edb5faed759470bcc731f23..4a8350f84fdf8bf6e30d495e9bcab61b4d5386a0 100644 (file)
@@ -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`),
index 29ef8a8cd76a24d2d7e416745430f18166a77ac9..33d1955a54b2c51ac056651a1b3407979a90ab62 100644 (file)
@@ -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']),
index d6fab4255a286e633b374ef4d2d1b027299469aa..afa3b58a4344b1421ce4f21b68b25d85752a9699 100644 (file)
@@ -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 (file)
index 0000000..6a80c21
--- /dev/null
@@ -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>
+
index a5c8dc4abbc6b769923f73049bbcfa8cbe5b9c9e..79a7651c1c754aa9d8695472526da0889a0115e9 100644 (file)
@@ -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.
index cc4db7c15cc7ad1e32e61a919d92bee91eb09ae7..80446f044dd87b0fccc613b0c4fc2c78118d626d 100644 (file)
@@ -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>