Exemplo n.º 1
0
 public function maxLenght($max_lenght)
 {
     if (!is_null($max_lenght)) {
         if ($max_lenght < min_results()) {
             $max_lenght = show_text();
         }
     }
     return $max_lenght;
 }
Exemplo n.º 2
0
 public function limit_text($limit, $max)
 {
     if ('on' == $limit) {
         if (empty($max) || $max < min_results()) {
             $max = show_text();
             //default lenght
         }
     } else {
         $max = null;
     }
     return $max;
 }
Exemplo n.º 3
0
function show_graph()
{
    require_once "../inc/db.inc";
    db_init();
    $xaxis = $_GET['xaxis'];
    $yaxis = $_GET['yaxis'];
    $granularity = $_GET['granularity'];
    $active = $_GET['active'];
    $inactive = $_GET['inactive'];
    $show_text = $_GET['show_text'];
    if (!$active && !$inactive) {
        echo "You must select at least one of (active, inactive)";
        exit;
    }
    $fields = 'host.id, user.create_time';
    if ($xaxis == 'active' || !$active || !$inactive) {
        $query = "select {$fields}, max(rpc_time) as max_rpc_time from host, user where host.userid=user.id group by userid";
    } else {
        $query = 'select $fields from user';
    }
    $result = mysql_query($query);
    $yarr = array();
    $now = time();
    $maxind = 0;
    $active_thresh = time() - 30 * 86400;
    while ($user = mysql_fetch_object($result)) {
        $val = $now - $user->max_rpc_time;
        if (!$active) {
            if ($user->max_rpc_time > $active_thresh) {
                continue;
            }
        }
        if (!$inactive) {
            if ($user->max_rpc_time < $active_thresh) {
                continue;
            }
        }
        $life = $user->max_rpc_time - $user->create_time;
        $ind = $life / $granularity;
        $ind = (int) $ind;
        $yarr[$ind]++;
        if ($ind > $maxind) {
            $maxind = $ind;
        }
    }
    $xarr = array();
    for ($i = 0; $i <= $maxind; $i++) {
        $xarr[$i] = $i;
        if (is_null($yarr[$i])) {
            $yarr[$i] = 0;
        }
    }
    if ($show_text) {
        show_text($xarr, $yarr);
    } else {
        draw_graph($xarr, $yarr);
    }
}
Exemplo n.º 4
0
if (!validate_path($path)) {
    die(msg('error', $DLG['invalid_dir'] . " <b>({$dir}{$file})</b>"));
}
$info = swampy_pathinfo($path);
switch ($info['extension']) {
    case "jpeg":
    case "jpg":
    case "gif":
    case "png":
    case "bmp":
        die(show_image($dir . $file));
        break;
    case "txt":
    case "php":
    case "js":
        die(show_text($path));
        break;
    case "html":
    case "htm":
        die(show_html($dir . $file));
        break;
    default:
        die(msg('alert', $DLG['not_supported_format']));
        break;
}
function show_image($src)
{
    return "<img src='/{$src}'/>";
}
function show_text($path)
{
Exemplo n.º 5
0
/**
 * @brief display unit resources
 * @global type $tool_content
 * @global type $langUnknownResType
 * @global type $is_editor
 * @param type $info
 * @return type
 */
function show_resource($info)
{
    global $tool_content, $langUnknownResType, $is_editor;
    if ($info->visible == 0 and !$is_editor) {
        return;
    }
    switch ($info->type) {
        case 'doc':
            $tool_content .= show_doc($info->title, $info->comments, $info->id, $info->res_id);
            break;
        case 'text':
            $tool_content .= show_text($info->comments, $info->id, $info->visible);
            break;
        case 'description':
            $tool_content .= show_description($info->title, $info->comments, $info->id, $info->res_id, $info->visible);
            break;
        case 'lp':
            $tool_content .= show_lp($info->title, $info->comments, $info->id, $info->res_id);
            break;
        case 'video':
        case 'videolink':
            $tool_content .= show_video($info->type, $info->title, $info->comments, $info->id, $info->res_id, $info->visible);
            break;
        case 'videolinkcategory':
            $tool_content .= show_videocat($info->type, $info->title, $info->comments, $info->id, $info->res_id, $info->visible);
            break;
        case 'exercise':
            $tool_content .= show_exercise($info->title, $info->comments, $info->id, $info->res_id, $info->visible);
            break;
        case 'work':
            $tool_content .= show_work($info->title, $info->comments, $info->id, $info->res_id, $info->visible);
            break;
        case 'topic':
        case 'forum':
            $tool_content .= show_forum($info->type, $info->title, $info->comments, $info->id, $info->res_id, $info->visible);
            break;
        case 'wiki':
            $tool_content .= show_wiki($info->title, $info->comments, $info->id, $info->res_id, $info->visible);
            break;
        case 'poll':
            $tool_content .= show_poll($info->title, $info->comments, $info->id, $info->res_id, $info->visible);
            break;
        case 'link':
            $tool_content .= show_link($info->title, $info->comments, $info->id, $info->res_id, $info->visible);
            break;
        case 'linkcategory':
            $tool_content .= show_linkcat($info->title, $info->comments, $info->id, $info->res_id, $info->visible);
            break;
        case 'ebook':
            $tool_content .= show_ebook($info->title, $info->comments, $info->id, $info->res_id, $info->visible);
            break;
        case 'section':
            $tool_content .= show_ebook_section($info->title, $info->comments, $info->id, $info->res_id, $info->visible);
            break;
        case 'subsection':
            $tool_content .= show_ebook_subsection($info->title, $info->comments, $info->id, $info->res_id, $info->visible);
            break;
        default:
            $tool_content .= $langUnknownResType;
    }
}
Exemplo n.º 6
0
    echo OUT_PATH;
    ?>
edit/<?php 
    echo $to;
    ?>
" title="修改本文章"><img src="<?php 
    echo get_stuff('silk/page_edit.png');
    ?>
" alt="編輯"></a></span>
<?php 
}
?>
				<div id="post-text">
<!-- Start of Post -->
<?php 
echo show_text($row["post_content"]);
?>
<!-- End of Post -->
				</div>
<?php 
if (isset($mod_time) && isset($mod_who)) {
    ?>
				<span id="post-view-modified">本文章在 <?php 
    echo $mod_time;
    ?>
 由 <strong><?php 
    echo $mod_who;
    ?>
</strong> 做了最後一次修改</span>
<?php 
}
Exemplo n.º 7
0
" title ="<?php 
echo $author_nicename;
?>
">
					<div id="post-view-author" class="post-view-meta"><span>AUTHOR: </span><strong><?php 
echo $author_nicename;
?>
</strong></div>
					<div id="post-view-title" class="post-view-meta"><span>TITLE: </span><strong><?php 
echo $title;
?>
</strong></div>
					<div id="post-view-time" class="post-view-meta" title="From: <?php 
echo $ip;
?>
"><span>TIME: </span><?php 
echo $row["post_date"];
?>
</div>
					<div id="post-view-actions" class="post-view-meta"><span>CATE: </span>未分類</div>
				</div>
				<div id="post-delete-body">
					<div id="post-delete-text">
<?php 
echo indent_text(show_text($row["post_content"]), 6);
?>
					</div>
				</div>
			</div>
<?php 
include load_template('footer');
Exemplo n.º 8
0
  <input type="hidden" name="hiddenField" id="hiddenField" />

<div id="left"><a href="../index2.php"><img src="../images/common/menu1.jpg" width="218" height="61" border="0" /></a><a href="index.html"><img src="../images/common/menu2.jpg" width="218" height="61" border="0" /></a><a href="../exam/index.html"><img src="../images/common/menu3.jpg" width="218" height="62" border="0" /></a><a href="../knowledge/index.php"><img src="../images/common/menu5.jpg" width="218" height="65" border="0" /></a></div>
<!-- InstanceBeginEditable name="EditRegion" -->
<div id="right_lesson">

<div class="header_font2" id="header2">
<?php 
show_lesson_header();
?>
</div>
<div id="content_area">

<div id="content_text">
<?php 
show_text();
?>
</div>

<div id="content_link">

<table width="725" border="0">
  <tr>
    <td width="272" align="right">
    <?php 
echo "<a href='detail.php?lesson=" . $_GET['lesson'] . "'><img src='../images/lesson/btn_video.jpg' width='80' height='25' border='0' /></a>";
?>
    </td>
    <td width="34" align="right">
    <?php 
show_back_button();
Exemplo n.º 9
0
        echo get_stuff('silk/comment_delete.png');
        ?>
" alt="刪除"></a>
<?php 
    }
    ?>
						</span>
						<span class="comment-item-author"><?php 
    echo $list['comment_author'];
    ?>
</span>
					</div>
					<div class="comment-item-content">
<!-- Start of Comment -->
<?php 
    echo show_text($list['comment_content']);
    ?>
<!-- End of Comment -->
					</div>
				</li>
<?php 
}
?>
			</ul>
<?php 
if ($total_items > $items_page) {
    $items_pages = page_list($current_page, $total_pages, 4, OUT_PATH . $ID . '?', 'comment_page', 'comment-list');
    if ($current_page == 0) {
        $show_pages = '<a href="' . OUT_PATH . $ID . '#comment-list" title="分頁顯示回覆">分頁收合</a>';
    } else {
        $show_pages = '<a href="' . OUT_PATH . $ID . '?comment_page=0#comment-list" title="顯示全部回覆">展開回覆</a>';
Exemplo n.º 10
0
?>
" alt="<?php 
echo $author_nicename;
?>
">
						<div class="comment-item-meta">
							<span class="comment-item-ip"><img src="<?php 
echo get_stuff('silk/information.png');
?>
" title="<?php 
echo $modify . 'From ' . $ip;
?>
" alt="info"></span>
							<span class="comment-item-date"><?php 
echo date('Y/m/d H:i', $time);
?>
</span>
							<span class="comment-item-author"><?php 
echo $author;
?>
</span>
						</div>
						<div id="comment-delete-text">
<?php 
echo indent_text(show_text($content), 7);
?>
						</div>
					</div>
				</div>
<?php 
include load_template('footer');
Exemplo n.º 11
0
Arquivo: lib.php Projeto: kidwm/kidbox
function feed()
{
    $many = 20;
    $board = '';
    //wait for more fix
    $result = inget('`id`, `post_title`, `post_author`, `post_author_nicename`, `post_content`, `post_date`, `post_board`', 'posts', $board . 'ORDER BY `post_date` DESC LIMIT 0, ' . $many);
    $board = board_info();
    $who = member_who();
    $prefix = isSSL() ? 'https:' : 'http:';
    $row = mysql_fetch_all($result);
    if ($row) {
        foreach ($row as $id => $list) {
            $row[$id]['post_board'] = $board[$list['post_board']]['name'];
            $row[$id]['post_board_nicename'] = $board[$list['post_board']]['nicename'];
            if ($list['post_author']) {
                $row[$id]['post_author'] = $who[$list['post_author']]['nicename'];
            } else {
                $row[$id]['post_author'] = $list['post_author_nicename'];
            }
            $row[$id]['post_content'] = html_transfer(show_text($list['post_content']));
        }
    }
    header('Content-type: application/xml; charset=utf-8');
    echo '<?xml version="1.0" encoding="utf-8"?>' . "\n";
    include load_template('feed');
}