{"id":1339,"date":"2018-01-19T19:22:43","date_gmt":"2018-01-19T19:22:43","guid":{"rendered":"http:\/\/goofy-trucks.flywheelsites.com\/php-enabled-stylesheets-page-3\/"},"modified":"2018-01-19T19:24:43","modified_gmt":"2018-01-19T19:24:43","slug":"php-enabled-stylesheets-page-3","status":"publish","type":"post","link":"https:\/\/phpbuilder.com\/php-enabled-stylesheets-page-3\/","title":{"rendered":"PHP enabled stylesheets Page 3"},"content":{"rendered":"<div class=\"phpbuilder-content\">\n<div class=\"phpbuilder-meta\">\n<div class=\"\">By Bertrand Potier<\/div>\n<div class=\"\">on November 24, 2002<\/div>\n<\/p><\/div>\n<div id=\"overflow-content\">\n<h2>The Visual Configuration File<\/h2>\n<div class=\"articlePara\">This file is meant for the end user. Although being still a text\/php file,<br \/>\nits layout as well as the way variables are named is taking that into account:<br \/>\nbeing as user-friendly as possible is the key. For that reason, I made the<br \/>\nchoice to not use variables but multi-dimensional associative arrays that are<br \/>\ngiving the opportunity to name the different element in a very comprehensive<br \/>\nway. <\/div>\n<div class=\"articlePara\">This array is named <code class=\"example\">$VISUALS<\/code> in capital letters to follow a<br \/>\nnaming convention I&#8217;m using for all &#8220;global&#8221; arrays. The array is first indexed<br \/>\non an integer value to allow multiple configuration sets to be defined. This is<br \/>\nthe way the <a href=\"http:\/\/edreamers.org\/\" target=\"_blank\">eDreamers<\/a> tools<br \/>\nare made &#8220;skin-able&#8221;, you can jump from one set to another by just changing the<br \/>\nid which can be provided by an URL (HTTP Get request) for example. <\/div>\n<div class=\"articlePara\">The parameters that you want to make available via this visual configuration<br \/>\nfile are up to you. It fully depends on your stylesheet and what is the freedom<br \/>\nthat you want to give or not give to your end user. In the scope of this<br \/>\narticle, we will consider the following very simple example:<\/div>\n<div class=\"articlePhpEx\">\n<font face=\"courier\"><code><span style=\"color: #000000\"><\/p>\n<p><span style=\"color: #0000BB\">&lt;?php<br \/>\n<br \/>\u00a0<\/span><span style=\"color: #FF8000\">\/\/\u00a0Retrieving\u00a0POST\u00a0and\u00a0GET\u00a0variables<br \/>\n<br \/>\u00a0<\/span><span style=\"color: #007700\">if\u00a0(<\/span><span style=\"color: #0000BB\">substr<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">phpversion<\/span><span style=\"color: #007700\">(),<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">,<\/span><span style=\"color: #0000BB\">3<\/span><span style=\"color: #007700\">)\u00a0!=\u00a0<\/span><span style=\"color: #DD0000\">'4.1'<\/span><span style=\"color: #007700\">)\u00a0{\u00a0<br \/>\n<br \/>\u00a0\u00a0<\/span><span style=\"color: #0000BB\">$_REQUEST\u00a0<\/span><span style=\"color: #007700\">=\u00a0<\/span><span style=\"color: #0000BB\">array_merge<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$HTTP_POST_VARS<\/span><span style=\"color: #007700\">,\u00a0<\/span><span style=\"color: #0000BB\">$HTTP_GET_VARS<\/span><span style=\"color: #007700\">);\u00a0<br \/>\n<br \/>\u00a0}<br \/>\n<br \/>\u00a0<\/span><span style=\"color: #FF8000\">\/\/\u00a0Define\u00a0which\u00a0skin\u00a0you'd\u00a0like\u00a0to\u00a0use.<br \/>\n<br \/>\u00a0<\/span><span style=\"color: #007700\">if\u00a0(isset(<\/span><span style=\"color: #0000BB\">$_REQUEST<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'SkinID'<\/span><span style=\"color: #007700\">]))\u00a0{\u00a0<br \/>\n<br \/>\u00a0\u00a0<\/span><span style=\"color: #0000BB\">$SkinID\u00a0<\/span><span style=\"color: #007700\">=\u00a0<\/span><span style=\"color: #0000BB\">$_REQUEST<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'SkinID'<\/span><span style=\"color: #007700\">];\u00a0<br \/>\n<br \/>\u00a0}\u00a0else\u00a0if\u00a0(!isset(<\/span><span style=\"color: #0000BB\">$SkinID<\/span><span style=\"color: #007700\">)\u00a0)\u00a0{\u00a0<br \/>\n<br \/>\u00a0\u00a0<\/span><span style=\"color: #0000BB\">$SkinID\u00a0\u00a0<\/span><span style=\"color: #007700\">=\u00a0<\/span><span style=\"color: #DD0000\">'0'<\/span><span style=\"color: #007700\">;\u00a0<br \/>\n<br \/>\u00a0}<br \/>\n<br \/>\u00a0<br \/>\n<br \/>\u00a0<\/span><span style=\"color: #FF8000\">\/\/\u00a0Default\u00a0Skin<br \/>\n<br \/>\u00a0<\/span><span style=\"color: #0000BB\">$VISUALS<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">][<\/span><span style=\"color: #DD0000\">'page'<\/span><span style=\"color: #007700\">][<\/span><span style=\"color: #DD0000\">'font'<\/span><span style=\"color: #007700\">]\u00a0=\u00a0<\/span><span style=\"color: #DD0000\">'Verdana,\u00a0Tahoma'<\/span><span style=\"color: #007700\">;<br \/>\n<br \/>\u00a0<\/span><span style=\"color: #0000BB\">$VISUALS<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">][<\/span><span style=\"color: #DD0000\">'page'<\/span><span style=\"color: #007700\">][<\/span><span style=\"color: #DD0000\">'fontsize'<\/span><span style=\"color: #007700\">]\u00a0=\u00a0<\/span><span style=\"color: #DD0000\">'10'<\/span><span style=\"color: #007700\">;<br \/>\n<br \/>\u00a0<\/span><span style=\"color: #0000BB\">$VISUALS<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">][<\/span><span style=\"color: #DD0000\">'page'<\/span><span style=\"color: #007700\">][<\/span><span style=\"color: #DD0000\">'fontunit'<\/span><span style=\"color: #007700\">]\u00a0=\u00a0<\/span><span style=\"color: #DD0000\">'px'<\/span><span style=\"color: #007700\">;<br \/>\n<br \/>\u00a0<\/span><span style=\"color: #0000BB\">$VISUALS<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">][<\/span><span style=\"color: #DD0000\">'page'<\/span><span style=\"color: #007700\">][<\/span><span style=\"color: #DD0000\">'background'<\/span><span style=\"color: #007700\">][<\/span><span style=\"color: #DD0000\">'color'<\/span><span style=\"color: #007700\">]\u00a0=\u00a0<\/span><span style=\"color: #DD0000\">'#838383'<\/span><span style=\"color: #007700\">;<br \/>\n<br \/><\/span><span style=\"color: #0000BB\">?&gt;<br \/>\n<br \/><\/span><br \/>\n<\/span><br \/>\n<\/code><\/font><\/div>\n<\/div>\n<p><\/p>\n<div style=\"float: left; padding:15px; color:#17AAF3\">\n<div style=\"float:left; padding:2px;\"><a class=\"paginationPageLink\" href=\"potier200211224658.html?page=2\">\u00ab Previous Page<\/a><\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier20021122.html\">1<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier200211224658.html?page=2\">2<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"background-color:#B6E5FC; font-size:16px; margin-top:1px; padding:1px 4px 1px 4px; color:#000; font-style:bold; float:left;\">3<\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier20021122fdb0.html?page=4\">4<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier20021122af4d.html?page=5\">5<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier20021122c575.html?page=6\">6<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier20021122235c.html?page=7\">7<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier20021122fdfa.html?page=8\">8<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier200211220b08.html?page=9\">9<\/a> <\/div>\n<div style=\"float:left; font-size:16px; color:#FF7A22; padding:2px 2px 2px 2px; \">| <\/div>\n<div style=\"float:left; padding:2px 4px 2px 4px;\"><a class=\"pageNumber\" href=\"potier200211221448.html?page=10\">10<\/a> <\/div>\n<div style=\"float:left; padding:2px;\"><a class=\"paginationPageLink\" href=\"potier20021122fdb0.html?page=4\">Next Page \u00bb<\/a><\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>From Perl scripts to PHP, a lot of technologies are today available to move HTML to the dynamic age but why not, going even further and do the<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1339","post","type-post","status-publish","format-standard","hentry","category-tutorials"],"_links":{"self":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/comments?post=1339"}],"version-history":[{"count":1,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1339\/revisions"}],"predecessor-version":[{"id":3225,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/posts\/1339\/revisions\/3225"}],"wp:attachment":[{"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/media?parent=1339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/categories?post=1339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/phpbuilder.com\/wp-json\/wp\/v2\/tags?post=1339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}