{"id":98,"date":"2011-02-17T13:02:37","date_gmt":"2011-02-17T18:02:37","guid":{"rendered":"http:\/\/cfdbplugin.com\/?page_id=98"},"modified":"2016-12-15T21:55:15","modified_gmt":"2016-12-16T02:55:15","slug":"cfdb-value","status":"publish","type":"page","link":"https:\/\/cfdbplugin.com\/?page_id=98","title":{"rendered":"[cfdb-value]"},"content":{"rendered":"<p><span style=\"font-weight:bold; background-color:#FFFF99;\">This documentation applies to version 2.6 and later<\/span><\/p>\n<h1><strong>Summary of Shortcode Options<\/strong><\/h1>\n<table width=\"100%\" border=\"1\" cellspacing=\"1\" cellpadding=\"1\" align=\"left\">\n<tbody>\n<tr>\n<td valign=\"middle\" width=\"10%\"><strong>Option<\/strong><\/td>\n<td width=\"40\"><strong>Example<br \/>\n<\/strong><\/td>\n<td width=\"40%\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=89#form\"><strong>form<\/strong><\/a><\/td>\n<td width=\"40\"><code>[cfdb-value <strong>form=\"myform\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">Required. Designates the form to display. All rows and columns are displayed by default<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=89#role\"><strong>role<\/strong><\/a><\/td>\n<td width=\"40\"><code>[cfdb-datatable form=\"myform\" <strong>role=\"Author\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">Make short code only display output for user&#8217;s with minimum-required role. Choices are<\/p>\n<ul>\n<li>Administrator<\/li>\n<li>Editor<\/li>\n<li>Author<\/li>\n<li>Contributor<\/li>\n<li>Subscriber<\/li>\n<li>Anyone<\/li>\n<\/ul>\n<p><strong>WARNING<\/strong>: this setting is overridden by plugin setting in WP Admin page Contact -> Database Options -> Can See Submission when using shortcodes<br \/>\n(since 2.4.1)\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=89#show\"><strong>show<\/strong><\/a><\/td>\n<td width=\"40\"><code>[cfdb-value form=\"myform\" <strong>show=\"col1,col2\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">Limits columns to be shown to be those designated (comma-delimited list)<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=89#hide\"><strong>hide<\/strong><\/a><\/td>\n<td width=\"40\"><code>[cfdb-value form=\"myform\" <span style=\"font-weight: bold;\">hide<\/span><strong>=\"col1,col2\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">Does not show listed columns (comma-delimited list)<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=89#limit\"><strong>limit<\/strong><\/a><\/td>\n<td align=\"left\" valign=\"middle\" width=\"40%\"><code>[cfdb-value form=\"myform\"\u00a0<strong>limit=\"10\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">One number: limit=&#8221;10&#8243; means show first 10 rows. Is the same as limit=&#8221;0,10&#8243;<br \/>\nTwo Numbers: limit=&#8221;100,10&#8243; means show 10 rows starting at row #100)<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=89#random\"><strong>random<\/strong><\/a><\/td>\n<td align=\"left\" valign=\"middle\" width=\"40%\"><code>[cfdb-table form=\"myform\"\u00a0<strong>random=\"2\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">Display 2 random rows from those that the short code finds. (Since 2.4)<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=89#orderby\"><strong>orderby<\/strong><\/a><\/td>\n<td align=\"left\" valign=\"middle\" width=\"40%\"><code>[cfdb-value form=\"myform\"\u00a0<strong>orderby=\"last-name,first-name\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">Sort rows by designated columns. Use &#8220;column-name desc&#8221; to sort in descending (reverse) order<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=89#search\"><strong>search<\/strong><\/a><\/td>\n<td width=\"40\"><code>[cfdb-value form=\"myform\"\u00a0<span style=\"font-weight: bold;\">search<\/span><strong>=\"Simpson\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">Select rows to display that have any cell with the search text in it (case insensitive). Intended to mimic behavior of the &#8220;Search&#8221; field in the DataTable<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"http:\/\/cfdbplugin.com\/?page_id=89#filter\"><strong>filter<\/strong><\/a><\/td>\n<td width=\"40\"><code>[cfdb-value form=\"myform\" <span style=\"font-weight: bold;\">filter<\/span><strong>=\"col1=Simpson\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">Select which rows to display based on filter expression. More powerful than &#8220;search&#8221;, it can filter on multiple columns with boolean and regular expressions. If both &#8220;search&#8221; and &#8220;filter&#8221; are specified, &#8220;search&#8221; is ignored.<\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\" valign=\"middle\" width=\"10%\"><em>Options specific to this shortcode<\/em><\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"#function\"><strong>function<\/strong><\/a><\/td>\n<td width=\"40\"><code>[cfdb-value form=\"myform\"\u00a0<span style=\"font-weight: bold;\">function<\/span><strong>=\"count\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">Can be:\u00a0<strong>count<\/strong>, <strong>min<\/strong>, <strong>max<\/strong>, <strong>sum<\/strong>, <strong>mean<\/strong>,<strong> percent<\/strong>.<\/p>\n<ul>\n<li><strong>count<\/strong><\/li>\n<li><strong>min<\/strong><\/li>\n<li><strong>max<\/strong><\/li>\n<li><strong>sum<\/strong><\/li>\n<li><strong>mean<\/strong><\/li>\n<li><strong>percent<\/strong> (as of 2.0.1)<\/li>\n<\/ul>\n<p>Use in conjunction with <strong>filter <\/strong>and <strong>show <\/strong>to select the rows and columns containing the data to input into the function.<\/p>\n<p>WARNING: you generally want to pick ONLY ONE row in &#8220;show&#8221;. If you do not, all returned values will be used.<\/td>\n<\/tr>\n<tr>\n<td valign=\"middle\" width=\"10%\"><a href=\"#delimiter\"><strong>delimiter<\/strong><\/a><\/td>\n<td width=\"40\"><code>[cfdb-value form=\"myform\"\u00a0<span style=\"font-weight: bold;\">delimiter<\/span><strong>=\"|\"<\/strong>]<\/code><\/td>\n<td width=\"40%\">When multiple values are returned by the shortcode, by default they are printed with a &#8216;, &#8216; delimiting them. Use this option to change that delimiter.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p style=\"margin: 0px 0px 22px; padding: 0px; clear: left; font-size: 13px;\">Don&#8217;t want a table or JSON? Just want to put a value in the page? Use the <code style=\"font-style: normal; font-weight: normal; font-family: Consolas,Monaco,'Courier New',Courier,monospace; color: #000000; background-color: #ededff;\">[cfdb-value]<\/code>shortcode<\/p>\n<p style=\"margin: 0px 0px 22px; padding: 0px; clear: left; font-size: 13px;\">Example:<\/p>\n<p style=\"margin: 0px 0px 22px; padding: 0px; clear: left; font-size: 13px;\"><code>[cfdb-value form=\"your-form\" show=\"field1\" filter=\"Submitted Login=$user_login\"] <\/code><\/p>\n<p style=\"margin: 0px 0px 22px; padding: 0px; clear: left; font-size: 13px;\">would display the <strong>field1 <\/strong>form value for the currently viewing user (who would have needed to be logged in when he submitted&#8230;see documentation on <a href=\"http:\/\/cfdbplugin.com\/?page_id=116\">$user_login variable substitution<\/a>).<\/p>\n<p style=\"margin: 0px 0px 22px; padding: 0px; clear: left; font-size: 13px;\">The intention is to specify one column\/field in<code style=\"font-style: normal; font-weight: normal; font-family: Consolas,Monaco,'Courier New',Courier,monospace; color: #000000; background-color: #ededff;\">show<\/code>and specify a<code style=\"font-style: normal; font-weight: normal; font-family: Consolas,Monaco,'Courier New',Courier,monospace; color: #000000; background-color: #ededff;\">filter<\/code>that would select on submission. (see how this works for<code style=\"font-style: normal; font-weight: normal; font-family: Consolas,Monaco,'Courier New',Courier,monospace; color: #000000; background-color: #ededff;\">[cfdb-table]<\/code>) But if you specify more columns or have more submissions (rows) resulting in the filter, then this shortcode will print out a comma-delimited list of values. You can also use<code style=\"font-style: normal; font-weight: normal; font-family: Consolas,Monaco,'Courier New',Courier,monospace; color: #000000; background-color: #ededff;\">hide<\/code>.<\/p>\n<p><a name=\"function\"><\/a> <strong>Functions<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><strong>count<\/strong><\/p>\n<p>Count rows:\u00a0\u00a0<code>[cfdb-value function=\"count\" form=\"myform\"]<\/code><\/p>\n<p>Count entries in column &#8220;col1&#8221;: \u00a0<code>[cfdb-value function=\"count\" form=\"myform\" show=\"col1\"]<\/code><\/p>\n<p><strong>min<\/strong><\/p>\n<p>Minimum entry in column &#8220;col1&#8221;:\u00a0<code>[cfdb-value function=\"min\" form=\"myform\" show=\"col1\"]<\/code><\/p>\n<p>&nbsp;<\/p>\n<p><strong>max<\/strong><\/p>\n<p>Maximum entry in column &#8220;col1&#8221;:\u00a0<code>[cfdb-value function=\"max\" form=\"myform\" show=\"col1\"]<\/code><\/p>\n<div><strong>sum<\/strong><\/div>\n<p>&nbsp;<\/p>\n<p>Sum of entries in column &#8220;col1&#8221;: \u00a0<code>[cfdb-value function=\"sum\" form=\"myform\" show=\"col1\"]<\/code><\/p>\n<p><strong>mean<\/strong><\/p>\n<p>Mean\u00a0of entries in column &#8220;col1&#8221;: \u00a0<code>[cfdb-value function=\"mean\" form=\"myform\" show=\"col1\"]<\/code><\/p>\n<p>&nbsp;<\/p>\n<p><a name=\"delimiter\"><\/a> <strong>delimiter<\/strong><\/p>\n<p>Available as of version 1.8.4. Specify a delimiter to be put between multiple values. Note: if you are using a function then it will always return one value, so there will never be a delimiter. So &#8216;function&#8217; and &#8216;delimiter&#8217; are mutually exclusive.<\/p>\n<p>Example:\u00a0<code>[cfdb-value form=\"myform\" show=\"col1\" delimiter=\"|\"]<\/code><\/p>\n<p>In this case, if there is more than one entry in the DB for this form, all the &#8220;col1&#8221; values will printed delimited with a &#8220;|&#8221;, e.g. &#8220;submission1-col1|submission2-col1|submission3-col1&#8221;<\/p>\n<p>NOTE: if you want more complex formatting of the output, use the <code>[<a href=\"http:\/\/cfdbplugin.com\/?page_id=284\">cfdb-html<\/a>] <\/code> shortcode instead.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>percent<\/strong><\/p>\n<p>Returns a percentage value of the \u00a0(number of\u00a0\u00a0form entries matching your show and filter criteria) \/ (total number of form submissions for the form).<\/p>\n<p>Limitation: this is always a percent of the total number of entries in the database. However, you can <a href=\"http:\/\/cfdbplugin.com\/?p=590\">create a short code to compute a percentage on a subset of a form&#8217;s submissions<\/a>.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary of Shortcode Options Option Example Description form Required. Designates the form to display. All rows and columns are displayed by default role Make short code only display output for user&#8217;s with minimum-required role. Choices are Administrator Editor Author Contributor Subscriber Anyone WARNING: this setting is overridden by plugin setting in WP Admin page Contact [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1577,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"page-without-sidebar.php","meta":{"footnotes":""},"class_list":["post-98","page","type-page","status-publish","hentry"],"jetpack_shortlink":"https:\/\/wp.me\/P1mptf-1A","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages\/98","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=98"}],"version-history":[{"count":28,"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages\/98\/revisions"}],"predecessor-version":[{"id":1066,"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages\/98\/revisions\/1066"}],"up":[{"embeddable":true,"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=\/wp\/v2\/pages\/1577"}],"wp:attachment":[{"href":"https:\/\/cfdbplugin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=98"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}