All posts by Admin

PIVOT_VIEW_DISPLAY

[[PIVOT_VIEW_DISPLAY:url]] Same as VIEW_DISPLAY but with links to the source data view.  If you dont want the links then use VIEW_DISPLAY instead. Outputs the current view using the view template stored in view.tpl at each node level for formatting the rows. Each cell displays a link to a data view showing the specific items included… Read More »

STRING_REPLACE

[[STRING_REPLACE:destination|needle|replacement|haystack]]   destination(string) Name of variable where output will be stored. needle(string) What you are replacing for. May be a PHP variable (formatted with the leading dollar sign$) containing the needle. replacement(string) What you are replacing with. May be a PHP formatted variable containing the replacement. haystack(string) Name of variable where the needle can be… Read More »

PIVOT_TABLE

[[PIVOT_TABLE: source|destination|who|what|quantity]] This example of a pivot table shows you who did how much of what in an order items csv export. Note that the csv parser must be loaded before using. source(string) name of string variable containing the source data comma seperated values(CSV) data. destination(string) name of string variable where the output will be… Read More »

CSV_DESERIALIZE

CSV Spreadsheet and Datafeed Loader. [[CSV_DESERIALIZE:filename|delimiter]]  A datafeed is any character delimited text file with 3 or more fields per line. Other delimiters may also be used. The first row must always contain the column header field names for it to be a proper datafeed. Note that the csv parser must be loaded before using…. Read More »

Displaying CSV spread sheet data on a landing page.

A fires list data view working example is running at the following address: http://www.generalpurposes.com/nodes/MorelFireLists2016/ Open or create a new node and paste the code below into the landing page editor by clicking the pencils where you want the view to display. Paste and save. [[QUERY_STRING:search]]     [[LOAD_DATAFEED:FireList.csv|,]] [[COLUMN_DMS2GPS:Latitude]] [[COLUMN_DMS2GPS:Longitude]] [[COLUMN_DATE2UNIX:Date]] [[VIEW_DATAFEED]] [[INITIALIZE:perpage|100]] [[INITIALIZE:sort_order|”{DESCENDING}”]] [[QUERY_STRING:sort_order]] [[INITIALIZE:sort_column|Total]]… Read More »

COLUMN_DATE2UNIX

[[COLUMN_DATE2UNIX:columnname]] Converts all the values in the $columnname view column array from string to unix timestamp (the number of seconds since January 1 1970 00:00:00 UTC) so that it may be properly sorted and reformatted in the report.  Input is required to be in an english date format. [[COLUMN_DATE2UNIX:ReportDate]]  

STYLE

[[STYLE]] Creates html <style> container for your CSS styling commands. [[END_STYLE]] same as html </style>. Example: [[STYLE]] .TerraDctl_view_table{border:5px #444 solid;padding:0px;margin:0px;} .TerraDctl_view_skin{border:2px #000 solid;padding:5px;margin:5px;background-color:#28517f;} .pagination_links{border:1px #444 solid;margin:2px;padding-top:0px;padding:3px;text-decoration:none;background-color:#ccf;font-family:verdana;font-size:1.4em;} .pagination_page_number{border:1px #000 solid;margin-right:6px;margin-left:2px;padding-top:0px;padding:3px;color:#ccf;background-color:#444;font-family:verdana;font-size:1.4em;} .odd{background-color:ccf;} .even{background-color:#c9ce6b;} [[END_STYLE]]  

TABLE

[[TABLE:id|class|style]] [[TABLE:table1|view_table|background-color:#fff;]] This shortcode is the equivalent to the html table tag but is much easier to read and involves slightly less typing.: <table id=”table1″ class=”view_table” style=”background-color:#fff”> Use [[END_TABLE]]  or </table> to close table container.

VIEW_PAGINATE

[[VIEW_PAGINATE:page|perpage]] Paginates view before displaying. page (string, integer or php$ variable) Page of view being displayed. perpage (string, integer or php$ variable) Number of entries or records to be displayed on each page. Example: For displaying page 3 with 10 entries per page. (records 31-40) [[VIEW_PAGINATE:3|10]]

VIEW_SEARCH

[[VIEW_SEARCH:regexvar]] regexvar(variable name) Name of the variable containing a regular expression string which must be true before row is selected into view.   Example regular expressions: Washington|Oregon Washington{OR}Oregon Washington{AND}Oregon (Washington)(Oregon) ((Washington|Oregon)(red|blue)) The first and second expressions select every row with any variable content matching Washington or Oregon. The third and fourth expressions select every row with… Read More »

VIEW_SELECT

[[VIEW_SELECT:criteria]] criteria(boolean) a logical expression which must be true before row is selected into view.   Example boolean expressions: ($_name==’Washington’)OR($_name==’Oregon’) ($_id > 1)AND($_id < 3) Filters current view by boolean selection criteria.  Add a dollar sign and underscore $_ before the variable/field names when writing boolean expressions using field variables.. [[LOAD_DATAFEED:csv_datafeed.txt|,]] [[VIEW_DATAFEED]] [[cr]][[cr]]Output Before Selection:[[cr]][[cr]] [[VIEW_DISPLAY]]… Read More »

VIEW_DISPLAY

[[VIEW_DISPLAY]] Outputs the current view using the view template stored in view.tpl at each node level for formatting the rows. Example: the data file csv_datafeed.txt contains: name,id,color,size Washington,1,blue,big Oregon,2,”green”,small California,3,red,huge The file, view.tpl contains: Name: %name%<br />Id: %id%<br />Color: %color%<br />Size: %size%<br /><br /> The Code: [[LOAD_DATAFEED:csv_datafeed.txt|,]] [[VIEW_DATAFEED]] [[cr]][[cr]]Before Sorting by color:[[cr]][[cr]] [[VIEW_DISPLAY]] [[VIEW_SORT:color]] [[cr]][[cr]]After… Read More »

VIEW_DATAFEED

[[VIEW_DATAFEED]] Populates the current datafeed variables and their values to an associative view matrix ($TerraDctl_view) where it’s rows may be more easily sorted, paginated and displayed. The view matrix is created with element labels corresponding to the datafeed’s column names within each row. Use after LOAD_DATAFEED . Test the $TerraDctl_view matrix with a php variable… Read More »

VIEW_SORT

[[VIEW_SORT:columnname]] Sorts the current view ascending by selected column name. The view ($TerraDctl_view)  variable contains an associative array of fields for each row which is populated upon each datafeed view refresh.  To refresh the view array, save the datafeed first or use the VIEW_DATAFEED shortcode before, otherwise view may not display. columnname (string value or… Read More »

SAVE_DATAFEED

[[SAVE_DATAFEED:filename]] Saves the last loaded datafeed’s current state as a delimited datafeed file  named filename using the same delimiter. Delimiter may be modified by initializing the variable delimiter. Datafeed fields and values must first be either already loaded from source or otherwise initialized into variable memory. [[INITIALIZE:delimiter|\t]] {tab delimited} [[SAVE_DATAFEED:datafeed_saved.txt]] Saves the current state of… Read More »

LOAD_DATAFEED

Simple Datafeed Loader. [[LOAD_DATAFEED:filename|delimiter]](deprecated) Use [[CSV_DESERIALIZE]] instead. A datafeed is any charactar delimited text file with 3 or more fields per line. Other delimiters may also be used. The first row must always contain the column header field names for it to be a proper datafeed. If you need to deserialize more complex comma seperated… Read More »

SAVE_DATASET

[[SAVE_DATASET:setname|delimiter]] Data set must already be created or loaded into variable storage memory. See: [[LOAD_DATASET]] setname (string) may either be php$ variable or string value. delimiter(string) is the separator between the pair’s key name and it’s assigned value.   Use the below code to automatically save  to the specified dataset any associated variables’ current or… Read More »

LOAD_DATASET

[[LOAD_DATASET:setname|delimiter]] A dataset is any text file with only one key/value pair per line. setname (string) may either be php$ variable or string value. delimiter(string) is the separator between the pair’s key name and it’s assigned value. Example: the data file inventory.txt contains: color,blue size,large name,huckleberry instock,22 units,lbs Use the below code to automatically load… Read More »

View API

VIEW API currently under development. You may use JSADSERVER API for embedding views in web pages using javascript. {nodepath}/api/view/&?selection={regex}&format={default or javascript} All General Purposes™ Nodes™ have an internet address.  For example, the address for this sample node is: http://www.yoursite.com/gpnodes/recipes/chinese/ Your addresses should be different. It does not matter.  All node urls have the view api… Read More »

JS

[[JS:source]] Includes JavaScript content and functions to node from any available external source which may be either local file or remote absolute URL. This feature alone will save you a lot of typing if you are accustomed to coding with html script tags for all your external inclusions. Examples: [[JS:menu.js]] [[JS:http://yoursite.com/promotions/campaign3/ad4/api/jsadserver]] [[INITIALIZE:domain|www.yoursite.com]] [[INITIALIZE:path|promotions/campaign3/ad4]] [[INITIALIZE:script|api/jsadserver]] [[INITIALIZE:source|http://$domain/$path/$script/]]… Read More »

WAIT

[[WAIT:seconds]] seconds Specifies time interval for the server to wait before continuing the script execution from this point. Useful for throttling script execution of resource intensive scripts and to prevent timeouts when anticipating slow turn over due to limits on resource.   Example: Please wait a minute. [[WAIT:60]] Thank you for waiting a minute.