This file contains 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
<?php | |
# hex2rgba | |
# converts hex value from ColorPicker TV to rgba value | |
# NOTE that the ColorPicker TV must use the default output option | |
# based on function from http://mekshq.com/how-to-convert-hexadecimal-color-code-to-rgb-or-rgba-using-php/ | |
if (!function_exists('hex2rgba')) { | |
function hex2rgba($color, $opacity = false) { | |
$default = 'rgb(0,0,0)'; | |
This file contains 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
<?php | |
/** | |
* PageNotFoundLogReport | |
* Copyright 2011-2013 Bob Ray | |
* | |
* PageNotFoundLogReport is free software; you can redistribute it and/or modify it | |
* under the terms of the GNU General Public License as published by the Free | |
* Software Foundation; either version 2 of the License, or (at your option) any | |
* later version. | |
* |
This file contains 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
<?php | |
/** | |
* saveCustomCss | |
* @author @sepiariver | |
* Copyright 2013 - 2015 by YJ Tso <yj@modx.com> <info@sepiariver.com> | |
* | |
* saveCustomCss and cssSweet is free software; | |
* you can redistribute it and/or modify it under the terms of the GNU General | |
* Public License as published by the Free Software Foundation; | |
* either version 2 of the License, or (at your option) any later version. |
This file contains 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
// Dashboard widget to show number of Manager messages | |
$id = $modx->user->get('id'); | |
$output = 'No messages.'; | |
$total = $modx->getCount('modUserMessage',array( | |
'recipient' => $id, | |
)); | |
if($total) { | |
$output = 'You have ' . $total . ' messages'; | |
$unread = $modx->getCount('modUserMessage',array( | |
'recipient' => $id, |
This file contains 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
<?php | |
// Dashboard widget to report on the number of errors in the Error Log | |
$logfile = MODX_CORE_PATH . 'cache/logs/error.log'; | |
if(!$f = fopen($logfile, 'rb')) return 'Could not open log file.'; | |
$lines = 0; | |
while (!feof($f)) { | |
$lines += substr_count(fread($f, 8192), "(ERROR "); | |
} |
This file contains 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
<?php | |
// SiteSummary snippet for Dashboard widget | |
// W. Shawn Wilkerson | |
$o = '<table class="classy" style="width:100%;"><thead><tr style="background:#DDE3EA;color:#000;">'; | |
$o .= '<th style="width:50%;padding:8px 0;text-align:center;">Resources</th>'; | |
$o .= '<th style="width:50%;padding:8px 0;text-align:center;">Elements</th>'; | |
$o .= '</tr></thead><tbody><tr><td style="padding:0 1em;">'; | |
$o .= 'Published Resources: ' . $modx->getCount('modResource', array('published' => '1')); | |
$o .= '<br>Unpublished Resources: ' . $modx->getCount('modResource', array('published' => '0')); |