This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select * from wp_posts | |
| where post_status = 'publish' | |
| and post_type = 'post' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Add PDF/Doc icons to Documents. */ | |
| String.prototype.endsWith = function (suffix) { | |
| return this.indexOf(suffix, this.length - suffix.length) !== -1; | |
| }; | |
| $('.sub_content_area .sub_right a').each(function () { | |
| if ($(this).attr("href")) { | |
| var href = $(this).attr("href"); | |
| if (href.endsWith("xlsx") || href.endsWith("xls")) { | |
| $(this).append(' <img width="88" height="28" class="excel-icon" src="/sites/all/themes/hdfsresponsive/css/images/download_excel.png" />'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function hdfs_summarise($paragraph, $limit) { | |
| $textfield = strtok($paragraph, " "); | |
| while ($textfield) { | |
| $text .= " $textfield"; | |
| $words++; | |
| if (($words >= $limit) && ((substr($textfield, -1) == "!") || (substr($textfield, -1) == "."))) { | |
| break; | |
| } | |
| $textfield = strtok(" "); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery.extend(jQuery.fn.dataTableExt.oSort, { | |
| "currency-pre" : function(a) { | |
| a = (a === "-") ? 0 : a.replace(/[^\d\-\.]/g, ""); | |
| return parseFloat(a); | |
| }, | |
| "currency-asc" : function(a, b) { | |
| return a - b; | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function aasort(&$array, $key){ | |
| $sorter = array(); | |
| $ret = array(); | |
| reset($array); | |
| foreach($array as $ii =>$va){ | |
| $sorter[$ii]=$va[$key]; | |
| } | |
| asort($sorter); | |
| foreach($sorter as $ii=>$va){ | |
| $ret[$ii]=$array[$ii]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| foreach ($mdarray as $key => $row) { | |
| $dates[$key] = $row[0]; | |
| // of course, replace 0 with whatever is the date field's index | |
| } | |
| array_multisort($dates, SORT_DESC, $mdarray); |