{"id":1269,"date":"2015-10-03T14:17:16","date_gmt":"2015-10-03T11:17:16","guid":{"rendered":"http:\/\/richardconsulting.ro\/blog\/?p=1269"},"modified":"2015-10-03T14:27:58","modified_gmt":"2015-10-03T11:27:58","slug":"formidable-notification-membership","status":"publish","type":"post","link":"https:\/\/richardconsulting.ro\/blog\/2015\/10\/formidable-notification-membership\/","title":{"rendered":"Notification System for Membership Websites Using Formidable Pro"},"content":{"rendered":"<p>I am sharing here my experience of building an announcement system based on Formidable Pro (currently at version 2.14).<\/p>\n<p>The notification system is created for membership websites where admins can send personalized notifications to single or multiple users.<\/p>\n<p>Components:<br \/>\n1. The form is a simple form with a textarea and 2 checkboxes. Leave the checkboxes empty but check the &#8220;Use separate values&#8221; checkbox in their properties<br \/>\n<a href=\"http:\/\/richardconsulting.ro\/blog\/wp-content\/uploads\/2015\/10\/Capture1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1270 alignnone\" src=\"http:\/\/richardconsulting.ro\/blog\/wp-content\/uploads\/2015\/10\/Capture1.png\" alt=\"Capture1\" width=\"780\" height=\"1290\" srcset=\"https:\/\/richardconsulting.ro\/blog\/wp-content\/uploads\/2015\/10\/Capture1.png 780w, https:\/\/richardconsulting.ro\/blog\/wp-content\/uploads\/2015\/10\/Capture1-218x360.png 218w, https:\/\/richardconsulting.ro\/blog\/wp-content\/uploads\/2015\/10\/Capture1-619x1024.png 619w, https:\/\/richardconsulting.ro\/blog\/wp-content\/uploads\/2015\/10\/Capture1-91x150.png 91w\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" \/><\/a><\/p>\n<p>2. The admin view and page will allow admins to create, edit and delete notifications<br \/>\n<a href=\"http:\/\/richardconsulting.ro\/blog\/wp-content\/uploads\/2015\/10\/Capture2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-1273 alignnone\" src=\"http:\/\/richardconsulting.ro\/blog\/wp-content\/uploads\/2015\/10\/Capture2-1024x652.png\" alt=\"Capture2\" width=\"500\" height=\"318\" srcset=\"https:\/\/richardconsulting.ro\/blog\/wp-content\/uploads\/2015\/10\/Capture2-1024x652.png 1024w, https:\/\/richardconsulting.ro\/blog\/wp-content\/uploads\/2015\/10\/Capture2-420x267.png 420w, https:\/\/richardconsulting.ro\/blog\/wp-content\/uploads\/2015\/10\/Capture2-150x96.png 150w, https:\/\/richardconsulting.ro\/blog\/wp-content\/uploads\/2015\/10\/Capture2.png 1137w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<p>3. The public view will allow recipients to read and &#8220;mark as read&#8221; the notifications<br \/>\n<a href=\"http:\/\/richardconsulting.ro\/blog\/wp-content\/uploads\/2015\/10\/Capture3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-1274 alignnone\" src=\"http:\/\/richardconsulting.ro\/blog\/wp-content\/uploads\/2015\/10\/Capture3-1024x266.png\" alt=\"Capture3\" width=\"500\" height=\"130\" srcset=\"https:\/\/richardconsulting.ro\/blog\/wp-content\/uploads\/2015\/10\/Capture3-1024x266.png 1024w, https:\/\/richardconsulting.ro\/blog\/wp-content\/uploads\/2015\/10\/Capture3-420x109.png 420w, https:\/\/richardconsulting.ro\/blog\/wp-content\/uploads\/2015\/10\/Capture3-150x39.png 150w, https:\/\/richardconsulting.ro\/blog\/wp-content\/uploads\/2015\/10\/Capture3.png 1125w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/a><\/p>\n<p>4. The custom code that is explained below:<\/p>\n<h3>Populate user fields (<em>Recipients<\/em> and <em>Read by<\/em> in my case or field_id 124 and 212)<\/h3>\n<pre>\r\n\/\/for fields with separate values update field definition so it can render correctly in views\r\nfunction update_bulk_options_db($list,$ids) {\r\n\tglobal $wpdb;\r\n\t$id = implode(\",\",$ids);\r\n\t$options = array();\r\n\t$j=0;\r\n\tforeach ($list as $key=>$val) {\r\n\t\t$j=$j+1;\r\n\t\t$options[$j]=array('value'=>(string)$key,'label'=>$val);\r\n\t}\r\n\t$save= serialize($options);\r\n\t$wpdb->query(\r\n\t\t\t\"UPDATE wp_frm_fields\r\n\t\t\t SET options = '$save'\r\n\t\t\t WHERE id in ($id)\r\n\t\t\t\" \r\n\t);\r\n\treturn;\r\n}\r\n\/\/populate user related fields with users. here I use s2member plugin for role management\r\nadd_filter('frm_setup_new_fields_vars', 'paperplus_populate_users', 20, 2);\r\nadd_filter('frm_setup_edit_fields_vars', 'paperplus_populate_users', 20, 2); \/\/use this function on edit too\r\nfunction paperplus_populate_users($values, $field){\r\n\tif($field->id == 124||$field->id == 212){\r\n\t\t$users1q = new WP_User_Query(array( 'role' => 'subscriber' ));\r\n\t\t$operators = $users1q->results;\r\n\t\t$users2q = new WP_User_Query(array( 'role' => 's2member_level1' ));\t\r\n\t\t$managers = $users2q->results;\r\n\t\t$users3q = new WP_User_Query(array( 'role' => 'administrator' ));\t\r\n\t\t$admins = $users3q->get_results();\r\n\t\t$users = array_unique(array_merge($operators, $managers, $admins));\t\r\n\t\tunset($values['options']);\r\n\t\t$values['options'] = array();\r\n\t\tforeach($users as $u){\r\n\t\t       $values['options'][$u->ID] = $u->display_name;\r\n\t\t}\r\n\t\tupdate_bulk_options_db ($values['options'], array(124,212));\r\n\t\t$values['use_key'] = true; \r\n\t}\r\n\treturn $values;\r\n}<\/pre>\n<p>After adding this snippet to your functions.php file in your active theme you will get prepopulated checkboxes with current users registered for the <em>subscriber<\/em>, <em>s2member_level1 <\/em>and <em>administrator <\/em>roles. Of course you will use any number of roles you like or all existing users, just format properly the <strong>WP_User_Query<\/strong><\/p>\n<h3>Filter the notifications view so that only notifications sent to current user will be displayed<\/h3>\n<p>Of course, a notification can be sent to several users at once. We need to filter entries that have current user id in the recipients list<\/p>\n<pre>\r\n\/\/filter the notifications view if the user is in the list.\r\nadd_filter('frm_where_filter', 'filter_anunturi', 10, 2);\r\nfunction filter_anunturi($where, $args){\r\n\tif ( $args['display']->ID == 82){ \/\/change 82 with your view id \r\n\t\t$user_id = get_current_user_id();\r\n\t\tif ($user_id > 0) {\r\n\t\t\t$where = \"(FIND_IN_SET('\" . $user_id . \"', fn_parse_ser_array(meta_value))>0 and fi.id='124')\";\r\n\t\t}\r\n\t}\r\n\treturn $where;\r\n}\r\n<\/pre>\n<p>You notice the mysql function call <em>fn_parse_ser_array<\/em> that is a custom made function. You need phpmyadmin access and rights to create functions on your database. This function is the mysql version of the PHP function <em>unserialize<\/em>.<\/p>\n<p>You may try this mysql command:<\/p>\n<pre class=\"lang:mysql\">\r\nBEGIN\r\ndeclare cnt int;\r\ndeclare i int;\r\ndeclare retstr varchar(2000); \r\ndeclare mystr varchar(2000);\r\n-- declare str varchar(2000);\r\nif instr(str,\"{\")>0 then\r\n    set str = right(str, length(str)-instr(str,\"{\"));\r\n    set str = replace(str,\"}\",\"\");\r\n    -- set retstr = str;\r\n    \r\n    set cnt = subStringCount2(str,\";\");\r\n    \r\n    -- select @str;\r\n    \r\n    set i = 1;\r\n    set retstr = '';\r\n    WHILE i< =cnt \r\n    DO\r\n    \r\n    if mod(i,2)=0  then\r\n         set mystr = SPLIT_STR2(str,\";\",i);\r\n         set mystr = replace(mystr, '\"','');\r\n         set mystr = SUBSTRING_INDEX(mystr, ':',-1);\r\n         if length(retstr)>0 then \r\n            set retstr = concat(retstr, ',', mystr);\r\n        else\r\n            set retstr = mystr;\r\n        end if;\r\n    end if;\r\n      set i = i +1;\r\n    END while;\r\nelse\r\n\tset retstr = str;\r\nend if;\r\nreturn retstr;\r\n\r\nEND<\/pre>\n<p>Also, we would want to hide the notifications that recipients have already marked as read. First idea is to use a negate condition on field 212 but&#8230; it does not work. In fact <\/p>\n<pre>$where = \"(FIND_IN_SET('\" . $user_id . \"', fn_parse_ser_array(meta_value))=0 and fi.id='212')\";<\/pre>\n<p> would work on its own but this will never work: <\/p>\n<pre>$where = \"(FIND_IN_SET('\" . $user_id . \"', fn_parse_ser_array(meta_value))>0 and fi.id='124') AND (FIND_IN_SET('\" . $user_id . \"', fn_parse_ser_array(meta_value))=0 and fi.id='212')\";<\/pre>\n<p>Therefore my solution was to hide the read notifications in the table itself by using <a href=\"http:\/\/datatables.net\/\" target=\"_blank\">DataTables jQuery plugin<\/a><\/p>\n<h3>Mark as read system for notifications<\/h3>\n<p>This system will both hide notifications for users that read them and will show admins who actually read their notifications<\/p>\n<p>First add this snippet to functions.php file then add the <strong>[mark_as_read entry_id='[id]&#8217;]<\/strong> shortcode into the last column of the notifications table inside the view<\/p>\n<pre>\r\n\/\/mark notifications as read by users\r\nadd_shortcode('mark_as_read','function_mark_as_read');\r\nfunction function_mark_as_read($atts) {\r\n\t$entry = $atts[\"entry_id\"];\r\n\t$val = FrmProEntriesController::get_field_value_shortcode(array('field_id' => 212, 'entry' => $entry, 'show' => 1));\r\n\tif ($val)\r\n\t\t$val = explode(\",\",str_replace(\" \",\"\",$val));\r\n\telse\r\n\t\t$val = array();\r\n\tif (in_array(get_current_user_id(),$val))\r\n\t\treturn \"Read\";\r\n\telse\r\n\t\tarray_push($val,get_current_user_id());\r\n\t\/\/$val = array_unique($val);\r\n\t$new_val = \"[\" . implode(\",\",$val) . \"]\";\r\n\t\/\/return FrmProEntriesController::entry_update_field(array('id' => $entry, 'field_id' => 212, 'label' => 'Mark as read', 'class' => '', 'value' => $new_val, 'message' => 'Succes!'));\r\n\treturn '<a href=\"#\" onclick=\"frmUpdateField('.$entry.',212,' . $new_val . ',\\'Citit\\',1);location.reload();\" id=\"frm_update_field_'.$entry.'_212_1\" class=\"frm_update_field_link \" title=\"Mark as read\">Mark as read<\/a>';\r\n}<\/pre>\n<p>Note that the attempt to use Formidable API failed in this case because instead of this new value <strong>[1,2,3]<\/strong> it will always insert this new value <strong>&#8216;[1,2,3]&#8217;<\/strong> messing the checkbox values in the database&#8230; (maybe this is a Formidable but at this moment). So I had to copy the behaviour and hardcode it in the last line.<\/p>\n<p>In the datatables initialization we need to add the searchCols filtering as in the next example:<\/p>\n<pre class=\"lang:js\">\r\njQuery(document).ready(function() {jQuery('.ppl_table').DataTable({\r\n\"language\": {\r\n    \"url\": \"\/\/cdn.datatables.net\/plug-ins\/1.10.9\/i18n\/Romanian.json\"\r\n  },\r\n  \"searchCols\": [\r\n    null,\r\n    null,\r\n    { \"search\": \"Mark\" }\r\n  ]\r\n} );} );<\/pre>\n<h3>Download<\/h3>\n<p>Below you can copy this exported definition of the form and views for your reference and save it as xml file, then import it into Formidable plugin. Please check the fields id that may change, also in the previous section I translated Mark and Read, in the original definitions they are in Romanian language<\/p>\n<pre class=\"lang:HTML\">\r\n< ?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n<channel>\r\n\t<title>Paper Plus<\/title>\r\n\t<pubdate>Sat, 03 Oct 2015 11:06:59 +0000<\/pubdate>\r\n\r\n\t<form>\r\n\t\t<id>13<\/id>\r\n\t\t<form_key>< ![CDATA[2yx0no]]><\/form_key>\r\n\t\t<name>< ![CDATA[Anunturi personalizate]]><\/name>\r\n\t\t<description>< ![CDATA[]]><\/description>\r\n\t\t<created_at>2015-08-05 08:42:57<\/created_at>\r\n\t\t<logged_in>0<\/logged_in>\r\n\t\t<is_template>0<\/is_template>\r\n\t\t<default_template>0<\/default_template>\r\n\t\t<editable>1<\/editable>\r\n\t\t<options>< ![CDATA[{\"submit_value\":\"Trimite\",\"success_action\":\"redirect\",\"success_msg\":\"Your responses were successfully submitted. Thank you!\",\"show_form\":0,\"akismet\":\"\",\"no_save\":0,\"ajax_load\":0,\"form_class\":\"\",\"custom_style\":\"1\",\"before_html\":\"<legend class=\\\\\\\"frm_hidden\\\\\\\">[form_name]< \\\/legend>\\r\\n[if form_name]<h3>[form_name]< \\\/h3>[\\\/if form_name]\\r\\n[if form_description]<div class=\\\\\\\"frm_description\\\\\\\">[form_description]< \\\/div>[\\\/if form_description]\",\"after_html\":\"\",\"submit_html\":\"<div class=\\\\\\\"frm_submit\\\\\\\">\\r\\n[if back_button]<input type=\\\\\\\"button\\\\\\\" value=\\\\\\\"[back_label]\\\\\\\" name=\\\\\\\"frm_prev_page\\\\\\\" formnovalidate=\\\\\\\"formnovalidate\\\\\\\" class=\\\\\\\"frm_prev_page\\\\\\\" [back_hook] \\\/>[\\\/if back_button]\\r\\n<input type=\\\\\\\"submit\\\\\\\" value=\\\\\\\"[button_label]\\\\\\\" [button_action] \\\/>\\r\\n<img class=\\\\\\\"frm_ajax_loading\\\\\\\" src=\\\\\\\"[frmurl]\\\/images\\\/ajax_loader.gif\\\\\\\" alt=\\\\\\\"Sending\\\\\\\"\\\/>\\r\\n[if save_draft]<a href=\\\\\\\"#\\\\\\\" class=\\\\\\\"frm_save_draft\\\\\\\" [draft_hook]>[draft_label]< \\\/a>[\\\/if save_draft]\\r\\n< \\\/div>\",\"edit_value\":\"Actualizeaza\",\"edit_msg\":\"Your submission was successfully saved.\",\"edit_action\":\"redirect\",\"edit_url\":\"\\\/admin-anunturi\\\/\",\"edit_page_id\":\"\",\"logged_in_role\":\"\",\"save_draft\":0,\"draft_msg\":\"Your draft has been saved.\",\"editable_role\":\"\",\"open_editable_role\":\"subscriber\",\"copy\":0,\"single_entry\":0,\"single_entry_type\":\"user\",\"success_page_id\":\"\",\"success_url\":\"\\\/admin-anunturi\\\/\",\"ajax_submit\":\"1\",\"cookie_expiration\":\"8000\",\"prev_value\":\"Previous\",\"submit_align\":\"\"}]]><\/a><\/div><\/div><\/h3><\/options>\r\n\t\t<status>< ![CDATA[published]]><\/status>\r\n        <parent_form_id>0<\/parent_form_id>\r\n\t\t<field>\r\n\t\t    <id>120<\/id>\r\n            <field_key>< ![CDATA[9iabnr]]><\/field_key>\r\n            <name>< ![CDATA[Mesaj nou]]><\/name>\r\n            <description>< ![CDATA[]]><\/description>\r\n            <type>< ![CDATA[textarea]]><\/type>\r\n            <default_value>< ![CDATA[]]><\/default_value>\r\n            <field_order>0<\/field_order>\r\n            <form_id>13<\/form_id>\r\n            <required><\/required>\r\n            <options>< ![CDATA[]]><\/options>\r\n            <field_options>< ![CDATA[{\"size\":\"\",\"max\":\"5\",\"label\":\"\",\"blank\":\"This field cannot be blank.\",\"required_indicator\":\"*\",\"invalid\":\"\",\"separate_value\":0,\"clear_on_focus\":0,\"default_blank\":0,\"classes\":\"frm_first frm_third\",\"custom_html\":\"<div id=\\\\\\\"frm_field_[id]_container\\\\\\\" class=\\\\\\\"frm_form_field form-field [required_class][error_class]\\\\\\\">\\r\\n    <label for=\\\\\\\"field_[key]\\\\\\\" class=\\\\\\\"frm_primary_label\\\\\\\">[field_name]\\r\\n        <span class=\\\\\\\"frm_required\\\\\\\">[required_label]< \\\/span>\\r\\n    < \\\/label>\\r\\n    [input]\\r\\n    [if description]<div class=\\\\\\\"frm_description\\\\\\\">[description]< \\\/div>[\\\/if description]\\r\\n    [if error]<div class=\\\\\\\"frm_error\\\\\\\">[error]< \\\/div>[\\\/if error]\\r\\n< \\\/div>\",\"slide\":0,\"form_select\":\"\",\"show_hide\":\"show\",\"any_all\":\"any\",\"align\":\"block\",\"hide_field\":[],\"hide_field_cond\":[\"==\"],\"hide_opt\":[],\"star\":0,\"ftypes\":[],\"data_type\":\"select\",\"restrict\":0,\"start_year\":2000,\"end_year\":2020,\"read_only\":0,\"admin_only\":\"\",\"locale\":\"\",\"attach\":false,\"minnum\":0,\"maxnum\":9999,\"step\":1,\"clock\":12,\"start_time\":\"00:00\",\"end_time\":\"23:59\",\"unique\":0,\"use_calc\":0,\"calc\":\"\",\"calc_dec\":\"\",\"dyn_default_value\":\"\",\"multiple\":0,\"unique_msg\":\"\",\"autocom\":0,\"format\":\"\",\"repeat\":0,\"add_label\":\"Add\",\"remove_label\":\"Remove\",\"conf_field\":\"\",\"conf_input\":\"\",\"conf_desc\":\"\",\"conf_msg\":\"The entered values do not match\",\"other\":0,\"custom_field\":\"\",\"post_field\":\"\",\"taxonomy\":\"category\",\"exclude_cat\":0}]]><\/div><\/div><\/span><\/label><\/field_options>\r\n\t\t<\/field>\r\n\t\t<field>\r\n\t\t    <id>124<\/id>\r\n            <field_key>< ![CDATA[9dqxn5]]><\/field_key>\r\n            <name>< ![CDATA[Destinatari]]><\/name>\r\n            <description>< ![CDATA[]]><\/description>\r\n            <type>< ![CDATA[checkbox]]><\/type>\r\n            <default_value>< ![CDATA[]]><\/default_value>\r\n            <field_order>1<\/field_order>\r\n            <form_id>13<\/form_id>\r\n            <required><\/required>\r\n            <options>< ![CDATA[{\"1\":{\"value\":\"12\",\"label\":\"anca1 Nume\"},\"2\":{\"value\":\"13\",\"label\":\"QUADRANT TEST\"},\"3\":{\"value\":\"3\",\"label\":\"Anca Badetoiu\"},\"4\":{\"value\":\"2\",\"label\":\"Emanuel I\"},\"5\":{\"value\":\"1\",\"label\":\"Richard Vencu\"}}]]><\/options>\r\n            <field_options>< ![CDATA[{\"size\":\"\",\"max\":\"\",\"label\":\"\",\"blank\":\"This field cannot be blank.\",\"required_indicator\":\"*\",\"invalid\":\"\",\"separate_value\":\"1\",\"clear_on_focus\":0,\"default_blank\":0,\"classes\":\"frm_third\",\"custom_html\":\"<div id=\\\\\\\"frm_field_[id]_container\\\\\\\" class=\\\\\\\"frm_form_field form-field [required_class][error_class]\\\\\\\">\\r\\n    <label class=\\\\\\\"frm_primary_label\\\\\\\">[field_name]\\r\\n        <span class=\\\\\\\"frm_required\\\\\\\">[required_label]< \\\/span>\\r\\n    < \\\/label>\\r\\n    <div class=\\\\\\\"frm_opt_container\\\\\\\">[input]< \\\/div>\\r\\n    [if description]<div class=\\\\\\\"frm_description\\\\\\\">[description]< \\\/div>[\\\/if description]\\r\\n    [if error]<div class=\\\\\\\"frm_error\\\\\\\">[error]< \\\/div>[\\\/if error]\\r\\n< \\\/div>\",\"slide\":0,\"form_select\":\"\",\"show_hide\":\"show\",\"any_all\":\"any\",\"align\":\"block\",\"hide_field\":[],\"hide_field_cond\":[\"==\"],\"hide_opt\":[],\"star\":0,\"ftypes\":[],\"data_type\":\"select\",\"restrict\":0,\"start_year\":2000,\"end_year\":2020,\"read_only\":0,\"admin_only\":\"\",\"locale\":\"\",\"attach\":false,\"minnum\":0,\"maxnum\":9999,\"step\":1,\"clock\":12,\"start_time\":\"00:00\",\"end_time\":\"23:59\",\"unique\":0,\"use_calc\":0,\"calc\":\"\",\"calc_dec\":\"\",\"dyn_default_value\":\"\",\"multiple\":0,\"unique_msg\":\"\",\"autocom\":0,\"format\":\"\",\"repeat\":0,\"add_label\":\"Add\",\"remove_label\":\"Remove\",\"conf_field\":\"\",\"conf_input\":\"\",\"conf_desc\":\"\",\"conf_msg\":\"The entered values do not match\",\"other\":\"0\",\"custom_field\":\"\",\"post_field\":\"\",\"taxonomy\":\"category\",\"exclude_cat\":0}]]><\/div><\/div><\/div><\/span><\/label><\/field_options>\r\n\t\t<\/field>\r\n\t\t<field>\r\n\t\t    <id>212<\/id>\r\n            <field_key>< ![CDATA[dlqcx6]]><\/field_key>\r\n            <name>< ![CDATA[Marcat ca citit de]]><\/name>\r\n            <description>< ![CDATA[]]><\/description>\r\n            <type>< ![CDATA[checkbox]]><\/type>\r\n            <default_value>< ![CDATA[]]><\/default_value>\r\n            <field_order>2<\/field_order>\r\n            <form_id>13<\/form_id>\r\n            <required><\/required>\r\n            <options>< ![CDATA[{\"1\":{\"value\":\"12\",\"label\":\"anca1 Nume\"},\"2\":{\"value\":\"13\",\"label\":\"QUADRANT TEST\"},\"3\":{\"value\":\"3\",\"label\":\"Anca Badetoiu\"},\"4\":{\"value\":\"2\",\"label\":\"Emanuel I\"},\"5\":{\"value\":\"1\",\"label\":\"Richard Vencu\"}}]]><\/options>\r\n            <field_options>< ![CDATA[{\"size\":\"\",\"max\":\"\",\"label\":\"\",\"blank\":\"This field cannot be blank.\",\"required_indicator\":\"*\",\"invalid\":\"\",\"separate_value\":\"1\",\"clear_on_focus\":0,\"default_blank\":0,\"classes\":\"frm_third\",\"custom_html\":\"<div id=\\\\\\\"frm_field_[id]_container\\\\\\\" class=\\\\\\\"frm_form_field form-field [required_class][error_class]\\\\\\\">\\r\\n    <label class=\\\\\\\"frm_primary_label\\\\\\\">[field_name]\\r\\n        <span class=\\\\\\\"frm_required\\\\\\\">[required_label]< \\\/span>\\r\\n    < \\\/label>\\r\\n    <div class=\\\\\\\"frm_opt_container\\\\\\\">[input]< \\\/div>\\r\\n    [if description]<div class=\\\\\\\"frm_description\\\\\\\">[description]< \\\/div>[\\\/if description]\\r\\n    [if error]<div class=\\\\\\\"frm_error\\\\\\\">[error]< \\\/div>[\\\/if error]\\r\\n< \\\/div>\",\"slide\":0,\"form_select\":\"\",\"show_hide\":\"show\",\"any_all\":\"any\",\"align\":\"block\",\"hide_field\":[],\"hide_field_cond\":[\"==\"],\"hide_opt\":[],\"star\":0,\"ftypes\":[],\"data_type\":\"select\",\"restrict\":0,\"start_year\":2000,\"end_year\":2020,\"read_only\":0,\"admin_only\":\"s2member_level2\",\"locale\":\"\",\"attach\":false,\"minnum\":0,\"maxnum\":9999,\"step\":1,\"clock\":12,\"start_time\":\"00:00\",\"end_time\":\"23:59\",\"unique\":0,\"use_calc\":0,\"calc\":\"\",\"calc_dec\":\"\",\"dyn_default_value\":\"\",\"multiple\":0,\"unique_msg\":\"\",\"autocom\":0,\"format\":\"\",\"repeat\":0,\"add_label\":\"Add\",\"remove_label\":\"Remove\",\"conf_field\":\"\",\"conf_input\":\"\",\"conf_desc\":\"\",\"conf_msg\":\"The entered values do not match\",\"other\":\"0\",\"custom_field\":\"\",\"post_field\":\"\",\"taxonomy\":\"category\",\"exclude_cat\":0}]]><\/div><\/div><\/div><\/span><\/label><\/field_options>\r\n\t\t<\/field>\r\n\t\t<field>\r\n\t\t    <id>211<\/id>\r\n            <field_key>< ![CDATA[j52ux0]]><\/field_key>\r\n            <name>< ![CDATA[User ID]]><\/name>\r\n            <description>< ![CDATA[]]><\/description>\r\n            <type>< ![CDATA[user_id]]><\/type>\r\n            <default_value>< ![CDATA[]]><\/default_value>\r\n            <field_order>3<\/field_order>\r\n            <form_id>13<\/form_id>\r\n            <required><\/required>\r\n            <options>< ![CDATA[]]><\/options>\r\n            <field_options>< ![CDATA[{\"size\":\"\",\"max\":\"\",\"label\":\"\",\"blank\":\"\",\"required_indicator\":\"*\",\"invalid\":\"\",\"separate_value\":0,\"clear_on_focus\":0,\"default_blank\":0,\"classes\":\"\",\"custom_html\":\"\",\"custom_field\":\"\",\"post_field\":\"\",\"taxonomy\":\"category\",\"exclude_cat\":0,\"slide\":0,\"form_select\":\"\",\"show_hide\":\"show\",\"any_all\":\"any\",\"align\":\"block\",\"hide_field\":[],\"hide_field_cond\":[\"==\"],\"hide_opt\":[],\"star\":0,\"ftypes\":[],\"data_type\":\"select\",\"restrict\":0,\"start_year\":2000,\"end_year\":2020,\"read_only\":0,\"admin_only\":\"\",\"locale\":\"\",\"attach\":false,\"minnum\":0,\"maxnum\":9999,\"step\":1,\"clock\":12,\"start_time\":\"00:00\",\"end_time\":\"23:59\",\"unique\":0,\"use_calc\":0,\"calc\":\"\",\"calc_dec\":\"\",\"dyn_default_value\":\"\",\"multiple\":0,\"unique_msg\":\"\",\"autocom\":0,\"format\":\"\",\"repeat\":0,\"add_label\":\"Add\",\"remove_label\":\"Remove\",\"conf_field\":\"\",\"conf_input\":\"\",\"conf_desc\":\"\",\"conf_msg\":\"The entered values do not match\",\"other\":0}]]><\/field_options>\r\n\t\t<\/field>\r\n\t<\/form>\r\n\t<view>\r\n\t\t<title>Anunturi Personalizate<\/title>\r\n\t\t<link \/>\r\n\t\t<post_author>< ![CDATA[emi]]><\/post_author>\r\n\t\t<description><\/description>\r\n\t\t<content>< ![CDATA[<tr><td>[120]<\/td><td>[created-at]<\/td><td>[mark_as_read entry_id='[id]']<\/td>]]><\/content>\r\n\t\t<excerpt>< ![CDATA[]]><\/excerpt>\r\n\t\t<post_id>82<\/post_id>\r\n\t\t<post_date>2015-08-06 20:51:18<\/post_date>\r\n\t\t<post_date_gmt>2015-08-06 17:51:18<\/post_date_gmt>\r\n\t\t<comment_status>closed<\/comment_status>\r\n\t\t<ping_status>closed<\/ping_status>\r\n\t\t<post_name>anunturi-personalizate<\/post_name>\r\n\t\t<status>publish<\/status>\r\n\t\t<post_parent>0<\/post_parent>\r\n\t\t<menu_order>0<\/menu_order>\r\n\t\t<post_type>frm_display<\/post_type>\r\n\t\t<post_password><\/post_password>\r\n\t\t<is_sticky>0<\/is_sticky>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>_edit_lock<\/meta_key>\r\n\t\t\t<meta_value>< ![CDATA[1443870262:1]]><\/meta_value>\r\n\t\t<\/postmeta>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>_edit_last<\/meta_key>\r\n\t\t\t<meta_value>1<\/meta_value>\r\n\t\t<\/postmeta>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>frm_param<\/meta_key>\r\n\t\t\t<meta_value>< ![CDATA[entry]]><\/meta_value>\r\n\t\t<\/postmeta>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>frm_dyncontent<\/meta_key>\r\n\t\t\t<meta_value>< ![CDATA[]]><\/meta_value>\r\n\t\t<\/postmeta>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>frm_insert_loc<\/meta_key>\r\n\t\t\t<meta_value>< ![CDATA[none]]><\/meta_value>\r\n\t\t<\/postmeta>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>frm_type<\/meta_key>\r\n\t\t\t<meta_value>< ![CDATA[id]]><\/meta_value>\r\n\t\t<\/postmeta>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>frm_show_count<\/meta_key>\r\n\t\t\t<meta_value>< ![CDATA[all]]><\/meta_value>\r\n\t\t<\/postmeta>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>frm_form_id<\/meta_key>\r\n\t\t\t<meta_value>13<\/meta_value>\r\n\t\t<\/postmeta>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>frm_post_id<\/meta_key>\r\n\t\t\t<meta_value>< ![CDATA[]]><\/meta_value>\r\n\t\t<\/postmeta>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>frm_options<\/meta_key>\r\n\t\t\t<meta_value>< ![CDATA[{\"date_field_id\":\"created_at\",\"edate_field_id\":\"\",\"repeat_event_field_id\":\"\",\"repeat_edate_field_id\":\"\",\"before_content\":\"<table class=\\\"ppl_table\\\"><thead><tr>\\r\\n<th style=\\\"width:80%;\\\">Mesajul< \\\/th><\/th><th>Data< \\\/th><\/th><th>Marcheaza ca citit< \\\/th>\\r\\n< \\\/tr>< \\\/thead><tbody>\",\"no_rt\":\"1\",\"after_content\":\"< \\\/tbody>< \\\/table><script type=\\\"text\\\/javascript\\\">jQuery(document).ready(function() {jQuery('.ppl_table').DataTable({\\r\\n\\\"language\\\": {\\r\\n            \\\"url\\\": \\\"\\\/\\\/cdn.datatables.net\\\/plug-ins\\\/1.10.9\\\/i18n\\\/Romanian.json\\\"\\r\\n},\\r\\n  \\\"searchCols\\\": [\\r\\n    null,\\r\\n    null,\\r\\n    { \\\"search\\\": \\\"Marcheaza\\\" }\\r\\n  ]\\r\\n} );} );< \\\/script>\",\"limit\":\"\",\"page_size\":\"\",\"order_by\":{\"1\":\"created_at\"},\"order\":{\"1\":\"DESC\"},\"where\":{\"1\":\"124\"},\"where_is\":{\"1\":\"!=\"},\"where_val\":{\"1\":\"\"},\"empty_msg\":\"Nu ave\\u021bi nici un anun\\u021b nou\",\"insert_pos\":\"1\"}]]><\/script><\/tbody><\/th><\/tr><\/thead><\/meta_value>\r\n\t\t<\/postmeta>\r\n\t<\/view>\r\n\t<view>\r\n\t\t<title>Anunturi Personalizate Admin<\/title>\r\n\t\t<link \/>\r\n\t\t<post_author>< ![CDATA[emi]]><\/post_author>\r\n\t\t<description><\/description>\r\n\t\t<content>< ![CDATA[<tr><td>[120]<\/td><td>[124]<\/td><td>[212]<\/td><td>[created-at  format=\"Y-m-d H:i\"]<\/td><td>[editlink location=\"front\" label=\"Editeaza\" page_id=78]<\/td><td>[deletelink label=\"Sterge\" confirm=\"Esti sigur ca vrei sa stergi acest mesaj?...\"]<\/td>]]><\/content>\r\n\t\t<excerpt>< ![CDATA[]]><\/excerpt>\r\n\t\t<post_id>84<\/post_id>\r\n\t\t<post_date>2015-08-06 21:27:42<\/post_date>\r\n\t\t<post_date_gmt>2015-08-06 18:27:42<\/post_date_gmt>\r\n\t\t<comment_status>closed<\/comment_status>\r\n\t\t<ping_status>closed<\/ping_status>\r\n\t\t<post_name>anunturi-personalizate-admin<\/post_name>\r\n\t\t<status>publish<\/status>\r\n\t\t<post_parent>0<\/post_parent>\r\n\t\t<menu_order>0<\/menu_order>\r\n\t\t<post_type>frm_display<\/post_type>\r\n\t\t<post_password><\/post_password>\r\n\t\t<is_sticky>0<\/is_sticky>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>_edit_lock<\/meta_key>\r\n\t\t\t<meta_value>< ![CDATA[1443730443:1]]><\/meta_value>\r\n\t\t<\/postmeta>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>_edit_last<\/meta_key>\r\n\t\t\t<meta_value>1<\/meta_value>\r\n\t\t<\/postmeta>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>frm_param<\/meta_key>\r\n\t\t\t<meta_value>< ![CDATA[entry]]><\/meta_value>\r\n\t\t<\/postmeta>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>frm_dyncontent<\/meta_key>\r\n\t\t\t<meta_value>< ![CDATA[]]><\/meta_value>\r\n\t\t<\/postmeta>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>frm_insert_loc<\/meta_key>\r\n\t\t\t<meta_value>< ![CDATA[none]]><\/meta_value>\r\n\t\t<\/postmeta>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>frm_type<\/meta_key>\r\n\t\t\t<meta_value>< ![CDATA[id]]><\/meta_value>\r\n\t\t<\/postmeta>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>frm_show_count<\/meta_key>\r\n\t\t\t<meta_value>< ![CDATA[all]]><\/meta_value>\r\n\t\t<\/postmeta>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>frm_form_id<\/meta_key>\r\n\t\t\t<meta_value>13<\/meta_value>\r\n\t\t<\/postmeta>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>frm_post_id<\/meta_key>\r\n\t\t\t<meta_value>< ![CDATA[]]><\/meta_value>\r\n\t\t<\/postmeta>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>frm_options<\/meta_key>\r\n\t\t\t<meta_value>< ![CDATA[{\"date_field_id\":\"created_at\",\"edate_field_id\":\"\",\"repeat_event_field_id\":\"\",\"repeat_edate_field_id\":\"\",\"before_content\":\"<table class=\\\"ppl_table \\\"><thead><tr>\\r\\n<th style=\\\"width:60%\\\">Mesajul< \\\/th><\/th><th style=\\\"width:20%;\\\">Destinatari< \\\/th><\/th><th style=\\\"width:20%;\\\">Citit de< \\\/th><\/th><th style=\\\"width:15%\\\">Data< \\\/th><\/th><th>Editare< \\\/th><\/th><th>Stergere< \\\/th>\\r\\n< \\\/tr>< \\\/thead><tbody>\",\"no_rt\":\"1\",\"after_content\":\"< \\\/tbody>< \\\/table><script type=\\\"text\\\/javascript\\\">jQuery(document).ready(function() {jQuery('.ppl_table').DataTable();} );< \\\/script>\",\"limit\":\"\",\"page_size\":\"\",\"empty_msg\":\"No Entries Found\",\"insert_pos\":\"1\"}]]><\/script><\/tbody><\/th><\/tr><\/thead><\/meta_value>\r\n\t\t<\/postmeta>\r\n\t<\/view>\r\n\t<view>\r\n\t\t<title>Email Notification<\/title>\r\n\t\t<link \/>\r\n\t\t<post_author>< ![CDATA[rvencu]]><\/post_author>\r\n\t\t<description><\/description>\r\n\t\t<content>< ![CDATA[{\"email_to\":\"office@paperplus.ro\",\"cc\":\"\",\"bcc\":\"\",\"reply_to\":\"\",\"from\":\"[sitename] <[admin_email]>\",\"email_subject\":\"Un nou anunt a fost publicat pe situl de comenzi\",\"email_message\":\"[default-message]\",\"inc_user_info\":\"1\",\"event\":[\"create\"],\"conditions\":{\"send_stop\":\"send\",\"any_all\":\"any\"}}]]><\/content>\r\n\t\t<excerpt>< ![CDATA[email]]><\/excerpt>\r\n\t\t<post_id>77<\/post_id>\r\n\t\t<post_date>2015-08-05 11:42:57<\/post_date>\r\n\t\t<post_date_gmt>2015-08-05 08:42:57<\/post_date_gmt>\r\n\t\t<comment_status>closed<\/comment_status>\r\n\t\t<ping_status>closed<\/ping_status>\r\n\t\t<post_name>13_email_77<\/post_name>\r\n\t\t<status>publish<\/status>\r\n\t\t<post_parent>0<\/post_parent>\r\n\t\t<menu_order>13<\/menu_order>\r\n\t\t<post_type>frm_form_actions<\/post_type>\r\n\t\t<post_password><\/post_password>\r\n\t\t<is_sticky>0<\/is_sticky>\r\n\t\t<postmeta>\r\n\t\t\t<meta_key>_wp_old_slug<\/meta_key>\r\n\t\t\t<meta_value>< ![CDATA[13_email_]]><\/meta_value>\r\n\t\t<\/postmeta>\r\n\t<\/view>\r\n<\/channel>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I am sharing here my experience of building an announcement system based on Formidable Pro (currently at version 2.14). The notification system is created for membership websites where admins can send personalized notifications to single or multiple users. Components: 1. The form is a simple form with a textarea and 2 checkboxes. Leave the checkboxes [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-1269","post","type-post","status-publish","format-standard","hentry","category-wordpress-2"],"_links":{"self":[{"href":"https:\/\/richardconsulting.ro\/blog\/wp-json\/wp\/v2\/posts\/1269","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/richardconsulting.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/richardconsulting.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/richardconsulting.ro\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/richardconsulting.ro\/blog\/wp-json\/wp\/v2\/comments?post=1269"}],"version-history":[{"count":5,"href":"https:\/\/richardconsulting.ro\/blog\/wp-json\/wp\/v2\/posts\/1269\/revisions"}],"predecessor-version":[{"id":1289,"href":"https:\/\/richardconsulting.ro\/blog\/wp-json\/wp\/v2\/posts\/1269\/revisions\/1289"}],"wp:attachment":[{"href":"https:\/\/richardconsulting.ro\/blog\/wp-json\/wp\/v2\/media?parent=1269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/richardconsulting.ro\/blog\/wp-json\/wp\/v2\/categories?post=1269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/richardconsulting.ro\/blog\/wp-json\/wp\/v2\/tags?post=1269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}