当前位置: 首页>>代码示例>>PHP>>正文


PHP table::output方法代码示例

本文整理汇总了PHP中table::output方法的典型用法代码示例。如果您正苦于以下问题:PHP table::output方法的具体用法?PHP table::output怎么用?PHP table::output使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在table的用法示例。


在下文中一共展示了table::output方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

            }
            echo '.)</p>';
        }
        if ($_GET['deep_search']) {
            $sql = DB::Prepare('SELECT replies.id, replies.parent_id, replies.time, replies.body, topics.headline, topics.time FROM {P}Replies as replies INNER JOIN {P}Topics as topics ON replies.parent_id = topics.id WHERE replies.body LIKE ? ORDER BY id DESC LIMIT 50');
            $res = DB::Execute($sql, array($search_query));
            if ($res->RecordCount() > 0) {
                $search_replies->bind_result;
                $replies = new table();
                $columns = array('Reply snippet', 'Topic', 'Age ▼');
                $replies->define_columns($columns, 'Topic');
                $replies->add_td_class('Topic', 'topic_headline');
                $replies->add_td_class('Reply snippet', 'reply_body_snippet');
                while ($row = $res->FetchRow()) {
                    list($reply_id, $parent_id, $reply_time, $reply_body, $topic_headline, $topic_time) = $row;
                    $values = array('<a href="/topic/' . $parent_id . '#reply_' . $reply_id . '">' . str_ireplace($_GET['q'], '<em class="marked">' . htmlspecialchars($_GET['q']) . '</em>', snippet($reply_body)) . '</a>', '<a href="/topic/' . $parent_id . '">' . htmlspecialchars($topic_headline) . '</a> <span class="help unimportant" title="' . format_date($topic_time) . '">(' . calculate_age($topic_time) . ' old)</span>', '<span class="help" title="' . format_date($reply_time) . '">' . calculate_age($reply_time) . '</span>');
                    $replies->row($values);
                }
                $num_replies_fetched = $replies->num_rows_fetched;
                echo $replies->output('', true);
                if ($num_replies_fetched == 50) {
                    echo '<p class="unimportant">(Tons of results found; stopping here.)</p>';
                }
            } else {
                echo '<p>(No matching replies.)</p>';
            }
        }
    }
}
print_errors();
require 'includes/footer.php';
开发者ID:N3X15,项目名称:ATBBS-Plus,代码行数:31,代码来源:search.php

示例2: htmlspecialchars

    if ($uid == $_SESSION['UID']) {
        $uid = 'You!';
    } else {
        if (isPowerUser()) {
            $uid = '<a href="/profile/' . $uid . '">' . $uid . '</a>';
        } else {
            $uid = '?';
        }
    }
    $bump = calculate_age($age, $_SERVER['REQUEST_TIME']);
    $headline = htmlspecialchars($headline);
    $action = $actions[$action];
    // Unknown or unrecorded actions are bypassed
    if ($action == null) {
        continue;
    }
    // Repeated actions are listed as (See above)
    if ($action == $old_action) {
        $temp = '<span class="unimportant">(See above)</span>';
    } else {
        $old_action = $action;
        $temp = $action;
    }
    $values = array($action, $uid, '<span class="help" title="' . format_date($age) . '">' . calculate_age($age) . '</span>');
    $table->row($values);
}
echo $table->output();
if ($count > 100) {
    echo '<p class="unimportant">(There are <b>a lot</b> of people active right now. Not all are shown here.)</p>';
}
require 'includes/footer.php';
开发者ID:N3X15,项目名称:ATBBS-Plus,代码行数:31,代码来源:folks.php

示例3: makeTable

	public function makeTable ($fields = false)
	{
		if (! $fields)
		{
			$fields[] = 'id';
			foreach ($this->definitions as $k => $v)
			{
				if ($v['ontable'])
				{
					$fields[] = $k;
				}
				if ($v['linkfield'])
				{
					$linkfield = $k;
				}
			}
		}
		$fields2['id'] = "ID";
		foreach ($fields as $v)
		{
			$fields2[$v] = $this->definitions[$v]['title'];
		}
		$fields2['delete'] = "";
		$table = new table($fields2, array (
			'class' => 'span-16'
		));
		$fieldsList = metaclass::getItems($this->table, $fields, $this->keyField);
		foreach ($fieldsList as $k => $v)
		{
			$v['delete'] = text::get('form/delete');
			$table->addRow($v, 
					array (
						$linkfield => array (
							'type' => 'link' , 
							'href' => $this->urlbase . '?id=' . $v['id']
						) , 
						'delete' => array (
							'type' => 'link' , 
							'href' => 'javascript:deleteitem(\'' . $v['id'] . '\',\'' . janitor::cleanData(
									$v['title']) . '\',\'' . $this->urlbase . '\')'
						)
					));
		}
		return $table->output();
	}
开发者ID:radiosilence,项目名称:quickbox,代码行数:45,代码来源:scaffold.class.php


注:本文中的table::output方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。