Example #1
0
        }
        if ($action == 'show') {
            $digg = $DreamCMS->db->get_var("SELECT digg FROM `#DC@__article` WHERE id='{$id}' LIMIT 1");
            echo "document.write('{$digg}');\r\n";
        }
        break;
    case 'hits':
        $DreamCMS->db->query("UPDATE `#DC@__article` SET hits=hits+1 WHERE `id` ='{$id}' LIMIT 1");
        if ($_GET['view'] == 'yes') {
            $hits = $DreamCMS->db->get_var("SELECT hits FROM `#DC@__article` WHERE id='{$id}'");
            echo "document.write('{$hits}');\r\n";
        }
        break;
    case 'comment':
        if (in_array($action, array('up', 'against'))) {
            UA($action, (int) $_GET['cid']);
        }
        if ($action == 'show') {
            if ($DreamCMS->config['iscomment']) {
                $comments = $DreamCMS->db->get_var("SELECT comments FROM `#DC@__article` WHERE id='{$id}'  LIMIT 1");
                echo "document.write('{$comments}');\r\n";
            }
        }
        break;
}
function UA($act, $cid)
{
    global $DreamCMS, $cookietime;
    $ajax = intval($_GET['ajax']);
    $ct = time() - get_cookie($cid . '_up') > $cookietime && time() - get_cookie($cid . '_against') > $cookietime ? true : false;
    if ($ct) {
Example #2
0
<html>
    <header>
        <meta http-equiv=Content-Type content="text/html;charset=utf-8">
    </header>
    <body>
        <form action="<?php 
echo UA("Index/upload_do");
?>
" method="post" enctype="multipart/form-data" >
            <input type="hidden" name="action">
            <table>
                <tr>
                    <td>上传图片</td><td><input type="file" name="file" /></td>
                </tr>
                <tr>
                    <td></td><td><input type="submit" name="submit" value="Submit" /></td>
                </tr>
            </table>
        </form>      
    </body>
</html>
Example #3
0
<?php

renderView("Tag", "head", $_viewData);
?>

<p>m3 start</p>

<div>
<?php 
print_r($_viewData);
echo "\n";
echo appF1();
echo "\n";
?>
</div>
<div><a href="<?php 
echo UA("Index/index");
?>
"> index </a></div>
<script type="text/javascript" src="<?php 
echo U("Public/app.js");
?>
"></script>
<p>m3 end</p>