Private Notes

How can we do something like this:

Scenario:

I as a Standard user with hundreds of friends on Dolphin site...;

As such I would like to have a Block like "My private Notes" on my friends profile page where I would be able to add some info, memo, about my friends.  Of course this block should be visable only to me and/or admin.

Any idea how to do it?

Greetings

Mayki

"When things get tough the tough get going..."
Quote · 9 Sep 2013

Check out the Global Notes module.

Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz
Quote · 9 Sep 2013

modzzz, thank you, I believe Global notes is great module but it is not what I need.

I need simple HTML input block which will show on my friends profile so I can add some personal notes about friends which will be visible only to owner (and/or admin) of the notes. I do not want those notes anywhere else on the site.

Again: just a simple plain notes or if I call it a remainder (tinyMCE support would be great) which will allow members to make notes on their friends profile page and of course those notes should be stored in MySQL table.

Regards

Mayki

"When things get tough the tough get going..."
Quote · 28 Jan 2014

First - create a table in your database called personal_notes with the following fields: note_id, profile_id, personal_note, date (make this update on submit), input_by

then put this in a php block:

 

$profileID = getID( $_GET['ID'] );

$gNote = mysql_query("SELECT * FROM personal_notes WHERE `profile_id` = '" . $profileID . "' AND `input_by` = '" . $_COOKIE['memberID'] . "' ORDER BY note_id DESC LIMIT 1");

while($row = mysql_fetch_array($gNote ))
  {
  $pNote = $row['personal_note'];
  }

$aForm = array(
            'form_attrs' => array(
                'name'     => 'form_personal_note',
                'method'   => 'post',
            ),

            'params' => array (
              
                      'db' => array(
                    'table' => 'personal_note', // table name
                    'key' => 'personal_note_id', // key field name
                    'uri' => '', // uri field name
                    'uri_title' => '', // title field to generate uri from
                    'submit_name' => 'submit_personal_note_form', // some filed name with non empty value to determine if the for was submitted,
                                                       // in most cases it is submit button name
                ),
                'csrf' => array(
                      'disable' => true, //if it wasn't set or has some other value then CSRF checking is enabled for current form, take a look at sys_security_form_token_enable to disable CSRF checking completely.
                )
              ),

            'inputs' => array(
                'header1' => array(
                    'type' => 'block_header',
                ),
                'personal_note' => array(
                    'type' => 'textarea',
                    'name' => 'personal_note',
                    'html' =>  true,
                    'value' =>  '$pNote',
                    'colspan' => 2,              
                      'db' => array (
                        'pass' => 'XssHtml', 
                    ),
                ),
                'profile_id' => array(
                    'type' => 'hidden',
                    'name' => 'profile_id',
                    'value' => $profileID,   
                      'db' => array (
                        'pass' => 'Xss', 
                    ),
                ),
                'input_by' => array(
                    'type' => 'hidden',
                    'name' => 'input_by',
                    'value' => $_COOKIE['memberID'],   
                      'db' => array (
                        'pass' => 'Xss', 
                    ),
                ),
               
             'submit_send' => array(
            'type' => 'submit',
            'name' => 'submit_personal_note_form',
            'colspan' => true,
           
            'value' => _t("_update_personal_note"),
        ),
             ),

        );

        $oForm = new BxTemplFormView ($aForm);
        $oForm->initChecker();

        if ($oForm->isSubmittedAndValid ()) {

            // add additional vars to database, in this case creation date field is added
            $aValsAdd = array (
            );
if ($oForm->insert ($aValsAdd)) {
$sStatusText = '_personal_note_updated';
            }
        }
                if($sStatusText) {
            $sStatusText = MsgBox(_t($sStatusText), 3);
                }
        return array($sStatusText . $oForm->getCode(), array(), array(), false);

 

 Then create your language keys and clear your cache.

I have not tested, but should give you a starting point.

caredesign.net
Quote · 28 Jan 2014

Thanks Professor.  I seem to recall that this was done before.  No idea how to find the old forum topic for this.  Someone wanted something very close to this exact same thing.  Might be nice to be able to find it though to compare.

 

Edit, Smacks head: I just look and see this is originally from Sept 2013 so that is why I recall it. LOL

Geeks, making the world a better place
Quote · 28 Jan 2014

Hello ProfessorSr,

First of all I want to thank you for your time, helping me with this idea of "Personal Notes"

Here is current status:

 

I have created table  " personal_notes "  in my Dolphin DB.

 

Then I created new PHP Block on Profile page (with a help of Deanos Tools).

Here is what I got:

(never mind input button caption, language keys are to be done later...)

 

But when some text is entered and  button is pressed I got Database query error:

 

I hope fore some further help on this.

Thanks again!

Greetings 

Mayki

mysql_table.png · 48.6K · 301 views
new_php_block.png · 163.1K · 329 views
database_query_error.png · 1.7K · 308 views
"When things get tough the tough get going..."
Quote · 28 Jan 2014

There is a mistake in the code provided by ProfessorSr. See the fix below :

 
Find :
     'key' => 'personal_note_id', // key field name

Replace with :
   'key' => 'note_id', // key field name

Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz
Quote · 28 Jan 2014

Also :

'value' =>  '$pNote',

Should be :

'value' =>  $pNote,

Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz
Quote · 28 Jan 2014

 

Thanks Professor.  I seem to recall that this was done before.  No idea how to find the old forum topic for this.  Someone wanted something very close to this exact same thing.  Might be nice to be able to find it though to compare.

 

Edit, Smacks head: I just look and see this is originally from Sept 2013 so that is why I recall it. LOL

 

 @geek_girl:

Long time no see Wink; I am still hoping if you could find some time to see why DeeEmm's TinyMCE Media Browser won't work in Reply to a message from Mailbox?

Greetings

Mayki

"When things get tough the tough get going..."
Quote · 28 Jan 2014

Hi modzzz,

I did what you wrote,

now the initial text input box is empty

but still DB error after entering some text and submit.

Please do not give up on me.

Greetings

Mayki

new_php_block_02.png · 157K · 312 views
"When things get tough the tough get going..."
Quote · 28 Jan 2014

'table' => 'personal_note', // table name

should be

'table' => 'personal_notes', // table name

Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz
Quote · 28 Jan 2014

 

'table' => 'personal_note', // table name

should be

'table' => 'personal_notes', // table name

 You have been faster modzz for a few seconds Wink

So:

Just one more typo and now it works:

'table' => 'personal_notes', // table name  -- "s" was missing

Now it works, no error on Submit.

Just a bit more help please  - how to make input box bigger?

So instead:

 

 

to be input box size as the size of the gray line in the picture above ??

 

Thank you guys (ProfessorSr &  modzz ) for your great help!

Greetings Mayki

 

ps:

Attached is a file with all the corrections "private_notes_by_ProfessorSr_and_modzz.txt"

new_php_block_02.png · 157K · 316 views
"When things get tough the tough get going..."
Quote · 28 Jan 2014

 

 @geek_girl:

Long time no see Wink; I am still hoping if you could find some time to see why DeeEmm's TinyMCE Media Browser won't work in Reply to a message from Mailbox?

Greetings

Mayki

Because the email reply is separate from the initial compose email.  It doesn't work because the bits needed to make it work have not been added.  I might find some time for this at some point; rather busy at the moment.

Geeks, making the world a better place
Quote · 28 Jan 2014

Thank you  geek_girl for your reply. If I knew how to find those bits I would, but I don't. So, I'll wait. Wink

Mayki

"When things get tough the tough get going..."
Quote · 28 Jan 2014

 

Just a bit more help please  - how to make input box bigger?

 

 Anyone?

"When things get tough the tough get going..."
Quote · 29 Jan 2014

Find :

     'html' =>  true,

Replace with :

    'html' =>  2,

The above change should give you the bigger version of the textarea.

Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz
Quote · 31 Jan 2014

Thank you modzzz,

 

And I also wish to thank to geek_girl for kindly help me with same solution but on PM.

And if someone want to disable TinyMCE just use:

'html' =>  0,

or

'html' =>  false,

 

Regards

Mayki

new_php_block_03-ok.png · 150.6K · 249 views
"When things get tough the tough get going..."
Quote · 31 Jan 2014

Hi,

it's been a while this modification is working on our site but I have a question:

I've noticed that if a member saves some notes about another member it contents gets saved into DB. When the same member adds some more notes on same member or alter old notes and clicks on Save button the DB entry should get updated but instead it gets new entry.... which is not OK.

Anyone can help on that?

Regards

Mayki

"When things get tough the tough get going..."
Quote · 11 Aug 2014
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.