{"id":543,"date":"2018-10-07T01:59:46","date_gmt":"2018-10-07T01:59:46","guid":{"rendered":"http:\/\/flexdproducts.com\/?page_id=543"},"modified":"2018-10-07T02:01:52","modified_gmt":"2018-10-07T02:01:52","slug":"masterpointstext","status":"publish","type":"page","link":"https:\/\/flexdproducts.com\/index.php\/masterpointstext\/","title":{"rendered":"masterpointstext"},"content":{"rendered":"<p>[insert_php]<br \/>\n\/\/ open the text file<br \/>\n\/\/ set style for black text<br \/>\necho(&#8216;<\/p>\n<div style=\"float: left; width: 100%; color: #000000\";>&#8216;);<br \/>\n$f = fopen(&#8220;http:\/\/www.southorangecountybridge.center\/Results\/MONTHMP.TXT&#8221;,&#8221;r&#8221;);<br \/>\n$loopcnt = -1;<br \/>\n$mpnames = array();<br \/>\n$mppoints = array();<br \/>\n\/\/ while loop to get text line by line<br \/>\nwhile ($line = fgets($f)) {<br \/>\n  $loopcnt ++;<br \/>\n  if ($loopcnt>0) {<br \/>\n     $line = trim($line);<br \/>\n     $pos = strpos($line, &#8221;  &#8220;);<br \/>\n     \/\/ remove extraneous spaces<br \/>\n     \/\/ !== means not equal<br \/>\n     \/\/ strpos returns position or false if not found<br \/>\n     while ($pos !== false) {<br \/>\n       $pos = strpos($line, &#8221;  &#8220;);<br \/>\n       $line = str_replace(&#8221;  &#8220;, &#8221; &#8220;, $line);<br \/>\n     }<br \/>\n     \/\/ string split<br \/>\n     $p = explode (&#8221; &#8220;, $line);<br \/>\n     $pcount = count($p);<br \/>\n     if ($pcount > 2) {<br \/>\n        \/\/$line = str_replace(&#8221; &#8220;, &#8220;,&#8221;, $line);<br \/>\n        \/\/echo($line.&#8217;<br \/>&#8216;);<br \/>\n        \/\/echo($p[1].&#8217;: &#8216;);<br \/>\n        \/\/ $na = names<br \/>\n        $na = &#8220;&#8221;;<br \/>\n         for ($x = 2; $x < $pcount; $x++) {\n            $na .= $p[$x].' ';\n         }\n          \/\/echo($na.'<br \/>&#8216;);<br \/>\n          $indx = $loopcnt &#8211; 1;<br \/>\n          $mpnames[$indx] = $na.&#8217;,&#8217;.$p[1];<br \/>\n          $mppoints[$indx] = $p[1].&#8221;,&#8221;.$na;<br \/>\n     }<br \/>\n  } else {<br \/>\n     \/\/processes first line<br \/>\n     $pos1 = strpos($line, &#8220;Page&#8221;);<br \/>\n     if ($pos1 !== false) {<br \/>\n        $line = substr($line, 0, $pos1);<br \/>\n     }<br \/>\n     $line = substr($line, 0 , 12).&#8217; &#8212; &#8216;.substr($line, 12);<br \/>\n     $line = trim($line);<br \/>\n     echo ($line);<\/p>\n<p>  }<br \/>\n}<br \/>\n\/\/ close the file<br \/>\nfclose($f);<\/p>\n<p>\/\/ start with column 2 first for formatting anomoly<br \/>\necho(&#8216;<\/p>\n<div style=\"float: right; width: 50%; color: #000000;\">&#8216;);<br \/>\necho(&#8216;<br \/>&#8216;);<br \/>\necho(&#8216;<H2>Sorted by Name<\/H2>&#8216;);<br \/>\necho(&#8216;<\/p>\n<ul style= \"list-style: none;\">&#8216;);<br \/>\nsort($mpnames);<br \/>\n$mpcount = count($mpnames);<br \/>\nfor ($y=1; $y < $mpcount; $y++) {\n   $mpnames[$y] = str_replace(\",\",\" --- \", $mpnames[$y]);\n   echo('\n\n<li>&#8216;.$mpnames[$y].&#8217;<\/li>\n<p>&#8216;);<br \/>\n}<br \/>\necho(&#8216;<\/ul>\n<p>&#8216;);<br \/>\necho(&#8216;<\/p><\/div>\n<p>&#8216;);<\/p>\n<p>echo(&#8216;<\/p>\n<div style=\"float: left; width: 50%; color: #000000\";>&#8216;);<br \/>\necho(&#8216;<H2>Sorted by Masterpoints<\/H2>&#8216;);<br \/>\necho(&#8216;<\/p>\n<ul style= \"list-style: none;\">&#8216;);<br \/>\n$mpcount = count($mppoints);<br \/>\nfor ($y=0; $y < $mpcount; $y++) {\n   $mppoints[$y] = str_replace(\",\",\" --- \", $mppoints[$y]);\n   echo('\n\n<li>&#8216;.$mppoints[$y].&#8217;<\/li>\n<p>&#8216;);<br \/>\n}<br \/>\necho(&#8216;<\/ul>\n<p>&#8216;);<br \/>\necho(&#8216;<\/p><\/div>\n<p>&#8216;);<br \/>\n[\/insert_php]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[insert_php] \/\/ open the text file \/\/ set style for black text echo(&#8216; &#8216;); $f = fopen(&#8220;http:\/\/www.southorangecountybridge.center\/Results\/MONTHMP.TXT&#8221;,&#8221;r&#8221;); $loopcnt = -1; $mpnames = array(); $mppoints = array(); \/\/ while loop to get text line by line while ($line = fgets($f)) { $loopcnt ++; if ($loopcnt>0) { $line = trim($line); $pos = strpos($line, &#8221; &#8220;); \/\/ remove <a href=\"https:\/\/flexdproducts.com\/index.php\/masterpointstext\/\" rel=\"nofollow\"><span class=\"sr-only\">Read more about masterpointstext<\/span>[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"pagelayer_contact_templates":[],"_pagelayer_content":"","footnotes":""},"class_list":["post-543","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/flexdproducts.com\/index.php\/wp-json\/wp\/v2\/pages\/543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/flexdproducts.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/flexdproducts.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/flexdproducts.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/flexdproducts.com\/index.php\/wp-json\/wp\/v2\/comments?post=543"}],"version-history":[{"count":2,"href":"https:\/\/flexdproducts.com\/index.php\/wp-json\/wp\/v2\/pages\/543\/revisions"}],"predecessor-version":[{"id":545,"href":"https:\/\/flexdproducts.com\/index.php\/wp-json\/wp\/v2\/pages\/543\/revisions\/545"}],"wp:attachment":[{"href":"https:\/\/flexdproducts.com\/index.php\/wp-json\/wp\/v2\/media?parent=543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}