Ejemplo n.º 1
0
function read_dir($dir, &$myFiles, &$myDirs, $fix_utf8, $exclude_directories, $sort_files_by_date)
{
    $size = 0;
    if (!file_exists($dir)) {
        return;
    }
    $dirhandle = opendir($dir);
    while (false !== ($file = readdir($dirhandle))) {
        if ($file != "." && $file != ".." && !in_array($file, $exclude_directories)) {
            $filepath = $dir . '/' . $file;
            if (is_dir($filepath)) {
                if ($fix_utf8 == "") {
                    array_push($myDirs, "" . urlencode(utf8_encode($file)) . "");
                } else {
                    array_push($myDirs, "" . urlencode(iconv($fix_utf8, "UTF-8", $file)) . "");
                }
            } else {
                if (check_view_extension($file)) {
                    set_error_handler("on_error_no_output");
                    $current_size = @filesize($dir . '/' . $file);
                    $file = $file . "**" . $current_size;
                    $size += $current_size;
                    if ($sort_files_by_date) {
                        $file = filemtime($filepath) . $file;
                    }
                    set_error_handler("on_error");
                    array_push($myFiles, urlencode(fix_encoding($file, $fix_utf8)));
                }
            }
        }
    }
    closedir($dirhandle);
    return $size;
}
Ejemplo n.º 2
0
}
include 'top.inc.php';
include_once 'magpie/rss_fetch.inc';
?>
<h2>Welcome</h2>
<p>Support Incident Tracker (or SiT!) is a <a href="http://www.gnu.org/philosophy/free-sw.html" target="_blank">Free Software</a>/Open Source (<a href="http://www.gnu.org/licenses/gpl-2.0.html" target="_blank" rel="license">GPL</a>) web based application which uses <a href="http://www.php.net/" target="_blank">PHP</a> and <a href="http://www.mysql.com/" target="_blank">MySQL</a> for tracking technical support calls/emails (also commonly known as a 'Help Desk' or 'Support Ticket System'). Manage contacts, sites, technical support contracts and support incidents in one place. Send emails directly from SiT!, attach files and record every communication in the incident log. SiT is aware of Service Level Agreements and incidents are flagged if they stray outside of them.</p>
<img class='pretty' src='http://sitracker.org/screenshots.jpg' width='300' height='196' alt='SiT Screenshot' />

<?php 
echo "<h2><span style='float:right;margin-top:6px;'><a href='{$newsfeedurl}' title='News feed (RSS)'>";
echo "<img src='feed-icon-12x12.png' width='12' height='12' alt='' /></a></span>News</h2>";
$newsrss = @fetch_rss($newsfeedurl);
if (is_object($newsrss)) {
    $html = '';
    $itemcount = 1;
    foreach ($newsrss->items as $item) {
        $item['description'] = str_replace('[...]', "[...] <a href='{$item['link']}' class='more'>Read more&hellip;</a>", $item['description']);
        $html .= "\n<h3 class='headline'>" . fix_encoding($item['title']) . "</h3>\n";
        $html .= "<p class='underheadline'>Published {$item['pubdate']} by {$item['dc']['creator']}.  (<a href='{$item['link']}' rel='bookmark'>Permalink</a>)</p>";
        $html .= "<p class='newsstory'>" . fix_encoding($item['description']) . "</p>\n";
        $itemcount++;
        if ($itemcount > $newsitems) {
            break;
        }
    }
    echo utf8_encode($html);
    echo "<p><a href='http://sitracker.wordpress.com/category/news/'>&lt; Older news</a></p>";
} else {
    echo "<p>Temporarily unavailable, check the <a href='http://sitracker.wordpress.com'>blog</a> in the meantime.</p>";
}
include 'bottom.inc.php';
Ejemplo n.º 3
0
     $page['commit_id'] = validate_hash($_REQUEST['hb']);
 } else {
     $page['commit_id'] = 'HEAD';
 }
 $page['subtitle'] = "Blob " . substr($page['hash'], 0, 6);
 $page['path'] = '';
 if (isset($_REQUEST['f'])) {
     $page['path'] = $_REQUEST['f'];
     // TODO validate?
 }
 // For the header's pagenav
 $info = git_get_commit_info($page['project'], $page['commit_id']);
 $page['commit_id'] = $info['h'];
 $page['tree_id'] = $info['tree'];
 $page['pathinfo'] = git_get_path_info($page['project'], $page['commit_id'], $page['path']);
 $page['data'] = fix_encoding(join("\n", run_git($page['project'], "cat-file blob {$page['hash']}")));
 $page['lastlog'] = git_get_commit_info($page['project'], 'HEAD', $page['path']);
 // GeSHi support
 if ($conf['geshi'] && strpos($page['path'], '.')) {
     $old_mask = error_reporting(E_ALL ^ E_NOTICE);
     require_once $conf['geshi_path'];
     $parts = explode('.', $page['path']);
     $ext = array_pop($parts);
     $geshi = new Geshi($page['data']);
     $lang = $geshi->get_language_name_from_extension($ext);
     if (strlen($lang) > 0) {
         $geshi->set_language($lang);
         if (is_int($conf['geshi_line_numbers'])) {
             if ($conf['geshi_line_numbers'] == 0) {
                 $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
             } else {
 private function replacer(&$matches)
 {
     global $dirfonts, $dirimg;
     // used by mathpublisher
     $args = $matches[2];
     $size = 14;
     // default size
     if (preg_match("/size\\s*=\\s*(\\d+)/", $args, $arg_match)) {
         $size = $arg_match[1];
     }
     $text = $matches[3];
     # make sure the string is url encoded. Some Joomla editors pass in the raw code points
     $text = fix_encoding(html_entity_decode($text));
     # decode all html entities in string first.
     $text = htmlentities($text, ENT_COMPAT, 'UTF-8');
     # encode again in UTF-8
     # now look for entities we want to process in a special way
     # euro not in ISO 8859-1 so use epsilon in formula
     $text = str_replace('&euro;', '{epsilon}', $text);
     $text = str_replace('&#8364;', '{epsilon}', $text);
     # use special tage for other code points that would otherwise become Greek characters
     $text = str_replace('&pound;', '{pound}', $text);
     $text = str_replace('&#163;', '{pound}', $text);
     $text = str_replace('&copy;', '{copy}', $text);
     $text = str_replace('&#169;', '{copy}', $text);
     $text = str_replace('&reg;', '{reg}', $text);
     $text = str_replace('&#174;', '{reg}', $text);
     $text = str_replace('&cent;', '{cent}', $text);
     $text = str_replace('&#162;', '{cent}', $text);
     $text = str_replace('&deg;', '{deg}', $text);
     $text = str_replace('&#176;', '{deg}', $text);
     # now decode html entities again ready for converting to image
     $text = fix_encoding(html_entity_decode($text));
     # decode all html entities before converting to an image. e.g. &lt; => <
     # change quotes to {prime} so they don't cause problems and look OK in the formula
     $text = str_replace("'", '{prime}', $text);
     $text = str_replace('"', '{prime}{prime}', $text);
     $joomla_url_root = $this->params->def('joomla_url_root', '');
     # clean up slashes and spaces around the path
     if (preg_match('/^[\\/\\s]*(.*?)[\\/\\s]*$/', $joomla_url_root, $arg_match)) {
         $joomla_url_root = $arg_match[1];
         # add one leading slash UNLESS empty (joomla is in root)
         if ($joomla_url_root != '') {
             $joomla_url_root = '/' . $joomla_url_root;
         }
     }
     $color = $this->params->def('color', '#000000');
     $bg_color = $this->params->def('bg_color', '#ffffff');
     # override colours if they are on the mathpublisher tag
     if (preg_match("/^(?:.*[^_])?color\\s*=\\s*([^,\\s]+)/", $args, $arg_match)) {
         $color = $arg_match[1];
     }
     if (preg_match("/bg_color\\s*=\\s*([^,\\s]+)/", $args, $arg_match)) {
         $bg_color = $arg_match[1];
     }
     $vf = get_plugin_version_folder();
     if ($vf != '') {
         $vf = '/' . $vf;
     }
     if ($this->config_ok) {
         $text = mathimage($text, $size, "{$joomla_url_root}/plugins/content{$vf}/mathpublisher/img/", $color, $bg_color);
     } else {
         $text = "{$text}<br />MathPublisher config error!<br />Chek your MathPublisher path configuration.<br />Expecting:<br />" . "mathpublisher.php (lowercase) in '" . $this->mp_inc_file . "'<br />" . "fonts in '" . $dirfonts . "'<br />" . "images in '" . $dirimg . "'<br />" . "image url '{$joomla_url_root}/plugins/content{$vf}/mathpublisher/img/*.png<br />";
     }
     return $text;
 }
Ejemplo n.º 5
0
function read_dir($dir, &$myFiles, &$myDirs, $fix_utf8, $exclude_directories, $sort_files_by_date, $sort_directores_by_date)
{
    global $hide_hidden_files, $show_server_date_instead_size;
    $size = 0;
    if (!file_exists($dir)) {
        return;
    }
    $dirhandle = opendir($dir);
    while (false !== ($file = readdir($dirhandle))) {
        if ($file != "." && $file != ".." && !in_array($file, $exclude_directories) && !($hide_hidden_files && strpos($file, '.') === 0)) {
            $filepath = $dir . '/' . $file;
            if (is_dir($filepath)) {
                $dirname = fix_encoding($file, $fix_utf8);
                if ($sort_directores_by_date) {
                    $dirname = filemtime($filepath) . $dirname;
                }
                array_push($myDirs, urlencode($dirname));
            } else {
                if (check_view_extension($file)) {
                    set_error_handler("on_error_no_output");
                    $current_size = sprintf("%u", @filesize($dir . '/' . $file));
                    $size += $current_size;
                    if ($show_server_date_instead_size == 'true' || $sort_files_by_date) {
                        $fdate = filemtime($filepath);
                    }
                    if ($show_server_date_instead_size == 'true') {
                        $current_size = $fdate;
                    }
                    // size or date is added.
                    $file = $file . "**" . $current_size;
                    if ($sort_files_by_date) {
                        $file = $fdate . $file;
                    }
                    set_error_handler("on_error");
                    array_push($myFiles, urlencode(fix_encoding($file, $fix_utf8)));
                }
            }
        }
    }
    closedir($dirhandle);
    return $size;
}