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


PHP template::add_data方法代码示例

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


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

示例1: template

<?php

include_once './template.php';
include_once './sqllink.php';
include_once 'secure.php';
$boardid = $_GET['boardid'];
\SECURE\sql_secure($boardid);
$webcontent = new template();
$webcontent->set_title("极端讨论区");
$webcontent->set_subtitle('Welcome to a place of pure boredness.');
$webcontent->helloword();
$webcontent->add_rely("default.css");
$webcontent->add_rely("userinfo.js");
$webcontent->add_rely("animation.js");
$sqline = $db->query("select * from all_board_info where link='{$boardid}'")->fetch();
$webcontent->add_data('<div class="datadiv"><div leftnavi><span top-dec></span><div navi-top-bar>' . $sqline['name'] . ' - 主题列表</div></div><div class="data">');
$webcontent->add_data('本版标签 ');
foreach (split(",", $sqline['labels']) as $value) {
    $webcontent->add_data('<a class="label" link="label" name=' . $value . '>' . $value . '</a>');
}
$webcontent->add_data('<br>');
if (isset($_SESSION['userid'])) {
    $webcontent->add_data('<a link="write" name=' . $boardid . ' cate=0>' . 发表文章 . '</a> ');
    $webcontent->add_data('| <a link="write" name=' . $boardid . ' cate=1>' . 发表议题 . '</a> ');
}
if ($_SESSION['rank'] >= 8) {
    $webcontent->add_data('| <a id="setboard">管理板块</a> ');
}
$sqline = $db->query("select count(*) from board_admin where board='{$boardid}'")->fetch();
$total = intval($sqline[0]);
$offset = isset($_GET['page']) ? intval($_GET['page']) * 10 : 0;
开发者ID:tqwuliao,项目名称:CALCUS,代码行数:31,代码来源:board.php

示例2: template

            $data[] = $value['content'] . '<p id=' . $value['id'] . ' iteminfo>' . $value['time'] . '</p>';
        }
    }
    echo json_encode($data);
    return;
}
if ($_POST['func'] == 'delete') {
    $db->exec("delete from inform where id={$_POST['id']}");
    return;
}
$webcontent = new template();
$webcontent->set_title("极端讨论区");
$webcontent->set_subtitle('Welcome to a place of pure boredness.');
$webcontent->helloword();
$webcontent->add_rely("default.css");
$webcontent->add_rely("animation.js");
$webcontent->add_rely("notice.js");
$sqline = $db->query("select * from inform where user_id={$_SESSION['userid']}")->fetchAll();
$webcontent->add_data('<p id="articleid" style="display:none">' . $articleid . "</p>");
$webcontent->add_data('<div class="datadiv"><div leftnavi><span top-dec></span><div navi-top-bar>最新通知</div></div><div class="data">');
$webcontent->add_data('<br><br>');
if (count($sqline) == 0) {
    $webcontent->add_data('无最新消息');
} else {
    foreach ($sqline as $value) {
        $value['content'] = preg_replace("/\n/", "<br>", $value['content']);
        $webcontent->add_data('<div class="dataitem">' . $value['content'] . '<p iteminfo>' . $value['time'] . ' <a class="deleteinfo" name=' . $value['id'] . '>我知道啦</a></p></div>');
    }
}
$webcontent->add_data('</div></div>');
include_once './blade.php';
开发者ID:tqwuliao,项目名称:CALCUS,代码行数:31,代码来源:notice.php

示例3: template

<?php

include_once './template.php';
include_once './sqllink.php';
include_once './secure.php';
$label = $_GET['label'];
$webcontent = new template();
$webcontent->set_title("极端讨论区");
$webcontent->set_subtitle('Welcome to a place of pure boredness.');
$webcontent->helloword();
$webcontent->add_rely("default.css");
$webcontent->add_rely("animation.js");
$webcontent->add_rely("userinfo.js");
$webcontent->add_data('<div class="datadiv"><div leftnavi><span top-dec></span><div navi-top-bar>' . $label . '的搜索结果</div></div><div class="data">');
$webcontent->add_data('<br><br>');
$sqline = $db->query("select count(*) from board_admin where labels like '%{$label}%'")->fetch();
$total = intval($sqline[0]);
$offset = isset($_GET['page']) ? intval($_GET['page']) * 7 : 0;
$sqline = $db->query("select * from board_admin where labels like '%{$label}%' order by date DESC limit {$offset},7");
foreach ($sqline->fetchAll() as $row) {
    $result = $db->query("select username from user where id={$row['author_id']}")->fetch();
    \SECURE\kill_html($row['title']);
    \SECURE\kill_html($row['labels']);
    \SECURE\kill_html($row['content']);
    \SECURE\_short($row['content']);
    $webcontent->add_data('<div class="dataitem articleinfo" ' . ($row['checks'] > 100 ? 'hot' : '') . '><a  item link="article" id=' . $row['id'] . '>' . $row['title'] . '</a><p>' . $row['content'] . '</p>');
    $webcontent->add_data('<p iteminfo><a user link="user" id=' . $row['author_id'] . '>' . $result['username'] . '</a> 发表于 ' . $row['date'] . " 被赞{$row['favor']}次 回复{$row['comment']} 查看{$row['checks']}</p></div>");
}
if ($total > 7) {
    $_GET['page'] = intval($_GET['page']);
    for ($i = 0; $i < $total / 7 && $i < 7; $i++) {
开发者ID:tqwuliao,项目名称:CALCUS,代码行数:31,代码来源:label.php

示例4: template

    echo "./article.php?articleid={$sqline}";
    return;
}
$articleid = $_GET['articleid'];
// 0 文章,作者重要; 1 提问或议题,作者不重要
$boardid = $_GET['boardid'];
$webcontent = new template();
$articleid = $articleid === "1" ? "议题" : "文章";
$webcontent->set_title("极端讨论区");
$webcontent->set_subtitle('Welcome to a place of pure boredness.');
$webcontent->helloword();
$webcontent->add_rely("default.css");
$webcontent->add_rely("animation.js");
$webcontent->add_rely("interact.js");
$webcontent->add_rely("write.js");
$webcontent->add_data('<div class="datadiv"><div leftnavi><span top-dec green></span><div navi-top-bar>发表' . $articleid . '</div></div><div class="data">');
$webcontent->add_data("<div class='dataitem'><form><div class='form-group'><h3>标题</h3><label for='title'>请在此输入标题。</label><input id='con_title' class='form-control' placeholder='标题'>\n\t</div>");
$webcontent->add_data("<div class='form-group'><h3>正文</h3><label for='title'>正文内容不得少于10个字符。</label><textarea class='form-control' id='con_body'></textarea>\n\t</div>");
$webcontent->add_data("<div class='form-group'><h3>标签</h3><label for='title'>设置标签以方便寻找。</label><br>");
$sqline = $db->query("select labels from all_board_info where link='{$boardid}'")->fetch();
foreach (split(",", $sqline['labels']) as $value) {
    $webcontent->add_data("<span class='write_label'>{$value}</span>");
}
$webcontent->add_data("<input disabled class='form-control' id='labels' placeholder='通过选择已有标签来更改'></div>");
if ($articleid == "议题") {
    $another = $db->query("select money from user where id={$_SESSION['userid']}")->fetch();
    $webcontent->add_data("<div class='form-group'><h3>议题酬金</h3><label for='title'>\n\t\t在发表议题的情况下,你可以设置酬金,参与者将根据贡献获得酬金。酬金范围0-50,您只需要支付50%,超过50的部分全部由您自负。</label>\n\t\t<p iteminfo>您的可用财产 {$another['money']}</p><input class='form-control' placeholder='酬金大小' id='money' value='0'>\n\t</div>");
}
$webcontent->add_data('<input type="text" style="display:none" id="cate" value="' . ($articleid == "文章" ? 0 : 1) . '"">');
$webcontent->add_data('<input type="text" style="display:none" id="boardid" value="' . $boardid . '"">');
$webcontent->add_data('<a id="submit" class="btn btn-default" onclick="submit()" role="button">发表</a> <a class="btn btn-default" onclick="back()" role="button">返回</a></form></div>');
开发者ID:tqwuliao,项目名称:CALCUS,代码行数:31,代码来源:write.php

示例5: template

<?php

include_once './template.php';
include_once './sqllink.php';
$webcontent = new template();
$webcontent->set_title('极端讨论区');
$webcontent->set_subtitle('Welcome to a place of pure boredness.');
$webcontent->add_rely("animation.js");
$db->exec("set names utf8");
if ($db->errorCode() != '00000') {
    return;
}
$sqline = $db->query("select * from all_board_info")->fetchAll();
if (isset($_SESSION["userid"])) {
    $webcontent->add_data('<div class="datadiv"><div leftnavi><span top-dec></span><div navi-top-bar>我的定制</div></div><div class="data">');
    $my = $db->query("select board_config from user where id={$_SESSION['userid']}")->fetch();
    foreach (split(",", $my['board_config']) as $value) {
        if (strlen($value) != 0) {
            $more = $db->query("select * from all_board_info where name='{$value}'")->fetch();
            $count = $db->query("select title,id,DATE_FORMAT(date,'%H:%I:%s') as time from board_admin where board='{$more['link']}' and DATE_FORMAT(date,'%Y-%m-%d')=DATE_FORMAT(now(),'%Y-%m-%d')")->fetchAll();
            $webcontent->add_data('<a link="board" id=' . $more['link'] . ' page=0><div class="bconfig"><p>来自 <heavy>' . $more['name'] . '</heavy> 的推送</p><span>' . count($count) . '</span><div>');
            foreach ($count as $key) {
                $webcontent->add_data($key['title'] . ' 发表于' . $key['time'] . '<br>');
            }
            $webcontent->add_data('</div></div></a>');
        }
    }
    $webcontent->add_data('</div></div>');
}
$webcontent->add_data('<div class="datadiv"><div leftnavi><span top-dec green></span><div navi-top-bar>板块列表</div></div><div class="data">');
foreach ($sqline as $value) {
开发者ID:tqwuliao,项目名称:CALCUS,代码行数:31,代码来源:index.php

示例6: template

<?php

include_once './template.php';
include_once './sqllink.php';
if ($_POST['func'] == 'get') {
    $sqline = $db->query("select * from end_info where article_id={$_POST['id']}")->fetchAll();
    if (count($sqline) == 0) {
        echo 0;
        return;
    } else {
        echo $sqline[0]['data'];
        return;
    }
}
$articleid = $_GET['articleid'];
$webcontent = new template();
$webcontent->set_title("极端讨论区");
$webcontent->set_subtitle('Welcome to a place of pure boredness.');
$webcontent->helloword();
$webcontent->add_rely("default.css");
$webcontent->add_rely("animation.js");
$webcontent->add_rely("endinfo.js");
$sqline = $db->query("select * from board_admin where id={$articleid}")->fetch();
$webcontent->add_data('<p id="articleid" style="display:none">' . $articleid . "</p>");
$webcontent->add_data('<div class="datadiv"><div leftnavi><span top-dec></span><div navi-top-bar>' . $sqline['title'] . '的结题情况</div></div><div class="data">');
$webcontent->add_data('<br><br>');
$webcontent->add_data('</div></div>');
include_once './blade.php';
开发者ID:tqwuliao,项目名称:CALCUS,代码行数:28,代码来源:endinfo.php

示例7: template

    } else {
        echo $sqline[0]['data'];
        return;
    }
}
$articleid = $_GET['articleid'];
$webcontent = new template();
$webcontent->set_title("极端讨论区");
$webcontent->set_subtitle('Welcome to a place of pure boredness.');
$webcontent->helloword();
$webcontent->add_rely("default.css");
$webcontent->add_rely("animation.js");
$webcontent->add_rely("interact.js");
$webcontent->add_rely("favor.js");
$sqline = $db->query("select * from relation where object={$_SESSION['userid']}")->fetchAll();
$webcontent->add_data('<div class="datadiv"><div leftnavi><span top-dec></span><div navi-top-bar>关注列表</div></div><div class="data">');
$webcontent->add_data('<h4>你关注的人</h4>');
foreach ($sqline as $value) {
    $userinfo = $db->query("select * from user where id={$value['subject']}")->fetch();
    $webcontent->add_data('<div style="display:inline-block"><img infoheadpic src="http://www.gravatar.com/avatar/' . md5($userinfo['email']) . '?s=128"><a link="user" id=' . $userinfo['id'] . '><h5>' . $userinfo['username'] . '</h5></a></div>');
}
$webcontent->add_data('<br><br><h4>你关注的回复</h4>');
$sqline = $db->query("select * from comment_favor_data where user_id={$_SESSION['userid']}")->fetchAll();
foreach ($sqline as $value) {
    $userinfo = $db->query("select * from board_admin_c where id={$value['comment_id']}")->fetch();
    \SECURE\kill_html($userinfo['title']);
    \SECURE\kill_html($userinfo['content']);
    \SECURE\_format($userinfo['content']);
    $webcontent->add_data('<div class="dataitem"><h3><a link="article" id=' . $userinfo['article_index'] . '>' . $userinfo['title'] . '</a></h3>' . $userinfo['content'] . '关注于' . $value['time'] . ' <a cid="' . $value['comment_id'] . '" class="cancelf">取消关注</a></div>');
}
$webcontent->add_data('<br><br>');
开发者ID:tqwuliao,项目名称:CALCUS,代码行数:31,代码来源:favor.php

示例8: template

        return;
    } else {
        echo 1;
        return;
    }
}
$webcontent = new template();
$webcontent->set_title("极端讨论区");
$webcontent->set_subtitle('Welcome to a place of pure boredness.');
$webcontent->helloword();
$webcontent->add_rely("default.css");
$webcontent->add_rely("animation.js");
$webcontent->add_rely("interact.js");
$webcontent->add_rely("title.js");
$sqline = $db->query("select * from title_info")->fetchAll();
$webcontent->add_data('<p id="articleid" style="display:none">' . $articleid . "</p>");
$webcontent->add_data('<div class="datadiv"><div leftnavi><span top-dec></span><div navi-top-bar>称号列表</div></div><div class="data">');
$webcontent->add_data('<br>');
foreach ($sqline as $value) {
    $req = "";
    foreach (split(",", $value['requisition']) as $key) {
        $req .= preg_replace_callback("/([a-z]+)(\\d+):(\\d+)/", function ($matches) use($db) {
            switch ($matches[1]) {
                case 'all':
                    $board = '在 全部板块 ';
                    break;
                case 'listen':
                    $board = '你关注的人的数目 ';
                    break;
                case 'favor':
                    $board = '关注你的人 ';
开发者ID:tqwuliao,项目名称:CALCUS,代码行数:31,代码来源:title.php

示例9: intval

$article_cate = intval($sqline['cate']);
// 0 文章,作者重要; 1 提问或议题,作者不重要
$webcontent = new template();
$webcontent->set_title("极端讨论区");
$webcontent->set_subtitle('Welcome to a place of pure boredness.');
$webcontent->helloword();
$webcontent->add_rely("default.css");
$webcontent->add_rely("animation.js");
$webcontent->add_rely("interact.js");
$webcontent->add_rely("sh/shCore.js");
$webcontent->add_rely("sh/shAutoloader.js");
$webcontent->add_rely("sh/shBrushJScript.js");
$webcontent->add_rely("article.js");
$webcontent->add_rely("userinfo.js");
$webcontent->add_rely("sh/shCoreDefault.css");
$webcontent->add_data('<div class="datadiv"><div leftnavi><span top-dec></span><div navi-top-bar>' . $sqline['title'] . '</div></div><div class="data">');
foreach (split(",", $sqline['labels']) as $value) {
    $webcontent->add_data('<a class="label" link="label" name=' . $value . '>' . $value . '</a>');
}
$webcontent->add_data("<br>");
$webcontent->add_data(' 返回 <a type="getback" link="' . $sqline['board'] . '">' . $result['name'] . '</a> ');
if ($_SESSION['rank'] >= 8) {
    $webcontent->add_data('| <a id="deletea">删除内容</a> ');
}
if (intval($_SESSION['userid']) == intval($sqline['author_id']) || $_SESSION['rank'] >= 8) {
    $webcontent->add_data('| <a id="changea">编辑内容</a> ');
}
$result = $db->query("select * from user where id={$sqline['author_id']}")->fetch();
if ($article_cate == 1 || $article_cate == 2) {
    if ($article_cate == 2) {
        $endinfo = $db->query("select * from end_info where article_id={$articleid}")->fetch();
开发者ID:tqwuliao,项目名称:CALCUS,代码行数:31,代码来源:article.php

示例10: count

    return;
}
$sqline = $db->query("select * from user where id={$userid}")->fetch();
$listen = $db->query("select count(*) from relation where subject={$userid}")->fetch();
$talk1 = $db->query("select count(*) from board_admin where author_id={$userid}")->fetch();
$talk2 = $db->query("select count(*) from board_admin_c where author_id={$userid}")->fetch();
$favor = "";
if (isset($_SESSION['userid'])) {
    $relation = $db->query("select count(*) from relation where subject={$userid} and object={$_SESSION['userid']}")->fetch();
    if (intval($relation[0]) == 1) {
        $favor = "已关注<a id='cancell'>(取消关注)</a>";
    } else {
        $favor = "<a id='addl'>关注他</a>";
    }
}
$webcontent->add_data('<div class="datadiv"><div leftnavi><span top-dec></span><div navi-top-bar>个人资料</div></div><div class="data">');
$webcontent->add_data('<div class="author"><div class="left"><img infoheadpic src="http://www.gravatar.com/avatar/' . md5($sqline['email']) . '?s=128"></div><h3>' . $sqline['username'] . '</h3> ' . $favor . ' uid=<span id="userid">' . $userid . '</span><br><p iteminfo>' . ($sqline['rank'] == '9' ? '管理员' : $sqline['rank']) . '<br>' . $sqline['sign'] . '</p>发言 ' . (intval($talk1[0]) + intval($talk2[0])) . '次 被赞 ' . $sqline['favor'] . '次 ' . $listen[0] . '人关注<p>' . $sqline['titles'] . '</p></div>');
$webcontent->add_data('</div></div>');
$webcontent->add_data('<div class="datadiv"><div leftnavi><span top-dec green></span><div navi-top-bar>最新动态</div></div><div class="data">');
$webcontent->add_data('</div></div>');
$webcontent->add_data('<div class="datadiv"><div leftnavi><span top-dec gry></span><div navi-top-bar>他的发言</div></div><div class="data" id="talkdata">');
$count = $db->query("select count(*) from board_admin where author_id={$userid}")->fetch();
$count = intval($count[0]);
$sqline = $db->query("select * from board_admin where author_id={$userid} order by date DESC limit 7")->fetchAll();
foreach ($sqline as $value) {
    \SECURE\kill_html($value['title']);
    \SECURE\kill_html($value['labels']);
    \SECURE\kill_html($value['content']);
    \SECURE\_short($value['content']);
    $webcontent->add_data('<div class="dataitem articleinfo"><a item link="article" id=' . $value['id'] . '>' . $value['title'] . '</a><p>' . $value['content'] . '</p><p iteminfo>发表于 ' . $value['date'] . " 被赞{$value['favor']}次 回复{$value['comment']} 查看{$value['checks']}</p></div>");
}
开发者ID:tqwuliao,项目名称:CALCUS,代码行数:31,代码来源:user.php

示例11: values

include_once './sqllink.php';
if (!isset($_SESSION['userid'])) {
    return;
}
$sqline = $db->query("select username,rank from user where id={$_SESSION['userid']}")->fetch();
if (intval($sqline['rank']) < 8) {
    echo $sqline['rank'];
    return;
}
switch ($_POST['func']) {
    case 'deleteArticle':
        $db->exec("delete from board_admin where id={$_POST['param']['id']}");
        $db->exec("insert into admin_logs values({$_SESSION['userid']},now(),'deleteArticle,{$_POST['param']['reason']}')");
        return;
        break;
    default:
        # code...
        break;
}
$webcontent = new template();
$webcontent->set_title("管理站点");
$webcontent->set_subtitle('Welcome to a place of pure boredness.');
$webcontent->add_rely("default.css");
$webcontent->add_rely("animation.js");
$webcontent->add_rely("interact.js");
$webcontent->add_rely("admin.js");
$webcontent->add_data("<h3>管理员{$sqline['username']},您好!</h3><br>");
$webcontent->add_data("<a class='change' web='./boardconfig.php'>板块管理</a> | <a class='change' web='./userconfig.php'>用户管理</a> | <a class='change' web='./titleconfig.php'>称号管理</a> | <a class='change' web='./logs.php'>管理日记</a><br>");
$webcontent->add_data("需要后台使用手册?没有这种东西!蛤!双击需要改的那一格就可以啦。<br><br>");
$webcontent->add_data("<div id='config-container'><h3>管理版面第一版。没有什么实用的功能嗯。</h3></div>");
include_once './blade.php';
开发者ID:tqwuliao,项目名称:CALCUS,代码行数:31,代码来源:admin.php


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