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


PHP mkshare函数代码示例

本文整理汇总了PHP中mkshare函数的典型用法代码示例。如果您正苦于以下问题:PHP mkshare函数的具体用法?PHP mkshare怎么用?PHP mkshare使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: intval

 }
 $sql .= $hot1 ? " AND s.hot >= '{$hot1}'" : '';
 $sql .= $hot2 ? " AND s.hot <= '{$hot2}'" : '';
 if ($_G['adminid'] == 2 && $endtime - $starttime > 86400 * 16 || $_G['adminid'] == 3 && $endtime - $starttime > 86400 * 8) {
     $error = 'share_mod_range_illegal';
 }
 if (!$error) {
     if ($detail) {
         $_G['gp_perpage'] = intval($_G['gp_perpage']) < 1 ? 20 : intval($_G['gp_perpage']);
         $perpage = $_G['gp_pp'] ? $_G['gp_pp'] : $_G['gp_perpage'];
         $query = DB::query("SELECT * FROM " . DB::table('home_share') . " s WHERE 1 {$sql} ORDER BY s.dateline DESC LIMIT " . ($page - 1) * $perpage . ",{$perpage}");
         $shares = '';
         require_once libfile('function/share');
         while ($share = DB::fetch($query)) {
             $share['dateline'] = dgmdate($share['dateline']);
             $share = mkshare($share);
             $shares .= showtablerow('', '', array("<input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"{$share['sid']}\" />", "<a href=\"home.php?mod=space&uid={$share['uid']}\" target=\"_blank\">" . $share['username'] . "</a>", $share['title_template'], $share['body_template'], $share['type'], $share['dateline']), TRUE);
         }
         $sharecount = DB::result_first("SELECT count(*) FROM " . DB::table('home_share') . " s WHERE 1 {$sql}");
         $multi = multi($sharecount, $perpage, $page, ADMINSCRIPT . "?action=share");
         $multi = preg_replace("/href=\"" . ADMINSCRIPT . "\\?action=share&amp;page=(\\d+)\"/", "href=\"javascript:page(\\1)\"", $multi);
         $multi = str_replace("window.location='" . ADMINSCRIPT . "?action=share&amp;page='+this.value", "page(this.value)", $multi);
     } else {
         $sharecount = 0;
         $query = DB::query("SELECT s.sid FROM " . DB::table('home_share') . " s WHERE 1 {$sql}");
         while ($share = DB::fetch($query)) {
             $sids .= ',' . $share['sid'];
             $sharecount++;
         }
         $multi = '';
     }
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:admincp_share.php

示例2: INDEX

        $f_index = 'USE INDEX(dateline)';
        $actives = array('we' => ' class="active"');
    }
    //类型
    if ($_GET['type']) {
        $sub_actives = array('type_' . $_GET['type'] => ' class="active"');
        $wheresql .= " AND type='{$_GET['type']}'";
    } else {
        $sub_actives = array('type_all' => ' class="active"');
    }
    $list = array();
    $sid = empty($_GET['sid']) ? 0 : intval($_GET['sid']);
    $sharesql = $sid ? "sid='{$sid}' AND" : '';
    $count = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM " . tname('share') . " WHERE {$sharesql} {$wheresql}"), 0);
    //update statistics
    if (empty($sharesql) && $wheresql == "uid='{$space['uid']}'" && $space['sharenum'] != $count) {
        updatetable('space', array('sharenum' => $count), array('uid' => $space['uid']));
    }
    if ($count) {
        $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('share') . " {$f_index}\r\n\t\t\tWHERE {$sharesql} {$wheresql}\r\n\t\t\tORDER BY dateline DESC\r\n\t\t\tLIMIT {$start},{$perpage}");
        while ($value = $_SGLOBAL['db']->fetch_array($query)) {
            realname_set($value['uid'], $value['username']);
            $value = mkshare($value);
            $list[] = $value;
        }
    }
    // pagination
    $multi = multi($count, $perpage, $page, $theurl . "&type={$_GET['type']}");
    realname_get();
    include_once template("space_share_list");
}
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:space_share.php

示例3: getblockhtml


//.........这里部分代码省略.........
                $classname = $_G['ols'][$value['fuid']] ? 'gol' : '';
                $html .= '<li><a href="home.php?mod=space&uid=' . $value['fuid'] . '" target="_blank"><em class="' . $classname . '"></em>' . avatar($value['fuid'], 'small') . '</a><p><a href="home.php?mod=space&uid=' . $value[fuid] . '" target="_blank">' . $value['fusername'] . '</a></p></li>';
            }
            $html = '<ul class="ml mls cl">' . $html . '</ul>';
            break;
        case 'visitor':
            $do = 'friend';
            $view = 'visitor';
            $query = DB::query("SELECT * FROM " . DB::table('home_visitor') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}");
            $list = $fuids = array();
            while ($value = DB::fetch($query)) {
                $list[] = $value;
                $fuids[] = $value['vuid'];
            }
            getonlinemember($fuids);
            foreach ($list as $value) {
                $html .= "<li>";
                if ($value['vusername'] == '') {
                    $html .= lang('space', 'visitor_anonymity');
                } else {
                    $html .= lang('space', 'visitor_list', array('uid' => $value['vuid'], 'username' => $value['vusername'], 'class' => $_G['ols'][$value['vuid']] ? 'gol' : '', 'avatar' => avatar($value['vuid'], 'small')));
                }
                $html .= "<span class=\"xg2\">" . dgmdate($value['dateline'], 'u', '9999', 'Y-m-d') . "</span>";
                $html .= "</li>";
            }
            $html = '<ul class="ml mls cl">' . $html . '</ul>';
            break;
        case 'share':
            $do = $blockname;
            if (!IS_ROBOT && ckprivacy('share', 'view')) {
                require_once libfile('function/share');
                $query = DB::query("SELECT * FROM " . DB::table('home_share') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}");
                while ($value = DB::fetch($query)) {
                    $value = mkshare($value);
                    $html .= '<li><em><a href="home.php?mod=space&uid=' . $value['uid'] . '&do=share&id=' . $value['sid'] . '">' . $value['title_template'] . '</a>(' . dgmdate($value['dateline'], 'u') . ')</em><div class="ec cl">';
                    if ($value['image']) {
                        $html .= '<a href="' . $value['image_link'] . '" target="_blank"><img src="' . $value['image'] . '" class="tn" alt="" /></a>';
                    }
                    $html .= '<div class="d">' . $value['body_template'] . '</div>';
                    if ($value['type'] == 'video') {
                        if (!empty($value['body_data']['imgurl'])) {
                            $html .= '<table class="mtm" title="' . lang('space', 'click_play') . '" onclick="javascript:showFlash(\'' . $value['body_data']['host'] . '\', \'' . $value['body_data']['flashvar'] . '\', this, \'' . $value['sid'] . '\');"><tr><td class="vdtn hm" style="background: url(' . $value['body_data']['imgurl'] . ') no-repeat"><img src="' . STATICURL . '/image/common/vds.png" alt="' . lang('space', 'click_play') . '" /></td></tr></table>';
                        } else {
                            $html .= "<img src=\"" . STATICURL . "/image/common/vd.gif\" alt=\"" . lang('space', 'click_play') . "\" onclick=\"javascript:showFlash('{$value['body_data']['host']}', '{$value['body_data']['flashvar']}', this, '{$value['sid']}');\" class=\"tn\" />";
                        }
                    } elseif ($value['type'] == 'music') {
                        $html .= "<img src=\"" . STATICURL . "/image/common/music.gif\" alt=\"" . lang('space', 'click_play') . "\" onclick=\"javascript:showFlash('music', '{$value['body_data']['musicvar']}', this, '{$value['sid']}');\" class=\"tn\" />";
                    } elseif ($value['type'] == 'flash') {
                        $html .= "<img src=\"" . STATICURL . "/image/common/flash.gif\" alt=\"" . lang('space', 'click_view') . "\" onclick=\"javascript:showFlash('flash', '{$value['body_data']['flashaddr']}', this, '{$value['sid']}');\" class=\"tn\" />";
                    }
                    if ($value['body_general']) {
                        $html .= '<div class="quote' . ($value['image'] ? 'z' : '') . "\"><blockquote>{$value['body_general']}</blockquote></div>";
                    }
                    $html .= '</div></li>';
                }
                $html = '<ul class="el">' . $html . '</ul>';
            }
            break;
        case 'wall':
            $do = $blockname;
            $walllist = array();
            if (ckprivacy('wall', 'view')) {
                $query = DB::query("SELECT * FROM " . DB::table('home_comment') . " WHERE id='{$uid}' AND idtype='uid' ORDER BY dateline DESC LIMIT 0,{$shownum}");
                while ($value = DB::fetch($query)) {
                    $value['message'] = strlen($value['message']) > 500 ? getstr($value['message'], 500, 0, 0, 0, -1) . ' ...' : $value['message'];
                    if ($value['status'] == 0 || $value['authorid'] == $_G['uid']) {
开发者ID:v998,项目名称:discuzx-en,代码行数:67,代码来源:function_space.php

示例4: libfile

        if ($type == 'link' || !DB::result_first("SELECT COUNT(*) FROM " . DB::table('home_share') . " WHERE uid='{$_G['uid']}' AND itemid='{$id}' AND type='{$type}'")) {
            include_once libfile('function/stat');
            updatestat('share');
        }
        if ($note_uid && $note_uid != $_G['uid']) {
            notification_add($note_uid, 'sharenotice', $note_message, $note_values);
        }
        $needle = $id ? $type . $id : '';
        updatecreditbyaction('createshare', $_G['uid'], array('sharings' => 1), $needle);
        $referer = "home.php?mod=space&uid={$_G['uid']}&do=share&view={$_GET['view']}&from={$_GET['from']}";
        $magvalues['sid'] = $sid;
        if (!$redirecturl) {
            $redirecturl = dreferer();
        }
        if (!$showmessagecontent) {
            $showmessagecontent = 'do_success';
        }
        showmessage($showmessagecontent, $redirecturl, $magvalues, $_G['inajax'] && $_GET['view'] != 'me' ? array('showdialog' => 1, 'showmsg' => true, 'closetime' => true) : array());
    }
    $arr['body_data'] = serialize($arr['body_data']);
    require_once libfile('function/share');
    $arr = mkshare($arr);
    $arr['dateline'] = $_G['timestamp'];
}
if ($type != 'link') {
    if (DB::result_first("SELECT COUNT(*) FROM " . DB::table('home_share') . " WHERE uid='{$_G['uid']}' AND itemid='{$id}' AND type='{$type}'")) {
        showmessage('spacecp_share_repeat');
    }
}
$share_count = DB::result_first("SELECT COUNT(*) FROM " . DB::table('home_share') . " WHERE itemid='{$id}' AND type='{$type}'");
include template('home/spacecp_share');
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:31,代码来源:spacecp_share.php

示例5: getblockhtml


//.........这里部分代码省略.........
            }
            $html = !$html ? '<p class="emp">' . lang('space', 'block_friend_no_content') . ($space['self'] ? lang('space', 'block_friend_no_content_publish', $space) : '') . '</p>' : '<ul class="ml mls cl">' . $html . '</ul>';
            break;
        case 'visitor':
            if ($space['self']) {
                $do = 'friend';
                $view = 'visitor';
            }
            $list = $fuids = array();
            foreach (C::t('home_visitor')->fetch_all_by_uid($uid, $shownum) as $value) {
                $list[] = $value;
                $fuids[] = $value['vuid'];
            }
            getonlinemember($fuids);
            foreach ($list as $value) {
                $html .= "<li>";
                if ($value['vusername'] == '') {
                    $html .= lang('space', 'visitor_anonymity');
                } else {
                    $html .= lang('space', 'visitor_list', array('uid' => $value['vuid'], 'username' => $value['vusername'], 'class' => $_G['ols'][$value['vuid']] ? 'gol' : '', 'avatar' => avatar($value['vuid'], 'small')));
                }
                $html .= "<span class=\"xg2\">" . dgmdate($value['dateline'], 'u', '9999', 'Y-m-d') . "</span>";
                $html .= "</li>";
            }
            $html = !$html ? '<p class="emp">' . lang('space', 'block_visitor_no_content') . ($space['self'] ? lang('space', 'block_visitor_no_content_publish', $space) : '') . '</p>' : '<ul class="ml mls cl">' . $html . '</ul>';
            break;
        case 'share':
            $do = $blockname;
            $view = 'me';
            $from = 'space';
            if (!IS_ROBOT && ckprivacy('share', 'view')) {
                require_once libfile('function/share');
                foreach (C::t('home_share')->fetch_all_by_uid($uid, 0, $shownum) as $value) {
                    $value = mkshare($value);
                    $html .= '<li><em><a href="home.php?mod=space&uid=' . $value['uid'] . '&do=share&id=' . $value['sid'] . '">' . $value['title_template'] . '</a>(' . dgmdate($value['dateline'], 'u') . ')</em><div class="ec cl">';
                    if ($value['image']) {
                        $html .= '<a href="' . $value['image_link'] . '" target="_blank"><img src="' . $value['image'] . '" class="tn" alt="" /></a>';
                    }
                    $html .= '<div class="d">' . $value['body_template'] . '</div>';
                    if ($value['type'] == 'video') {
                        if (!empty($value['body_data']['imgurl'])) {
                            $html .= '<table class="mtm" title="' . lang('space', 'click_play') . '" onclick="javascript:showFlash(\'' . $value['body_data']['host'] . '\', \'' . $value['body_data']['flashvar'] . '\', this, \'' . $value['sid'] . '\');"><tr><td class="vdtn hm" style="background: url(' . $value['body_data']['imgurl'] . ') no-repeat"><img src="' . STATICURL . '/image/common/vds.png" alt="' . lang('space', 'click_play') . '" /></td></tr></table>';
                        } else {
                            $html .= "<img src=\"" . STATICURL . "/image/common/vd.gif\" alt=\"" . lang('space', 'click_play') . "\" onclick=\"javascript:showFlash('{$value['body_data']['host']}', '{$value['body_data']['flashvar']}', this, '{$value['sid']}');\" class=\"tn\" />";
                        }
                    } elseif ($value['type'] == 'music') {
                        $html .= "<img src=\"" . STATICURL . "/image/common/music.gif\" alt=\"" . lang('space', 'click_play') . "\" onclick=\"javascript:showFlash('music', '{$value['body_data']['musicvar']}', this, '{$value['sid']}');\" class=\"tn\" />";
                    } elseif ($value['type'] == 'flash') {
                        $html .= "<img src=\"" . STATICURL . "/image/common/flash.gif\" alt=\"" . lang('space', 'click_view') . "\" onclick=\"javascript:showFlash('flash', '{$value['body_data']['flashaddr']}', this, '{$value['sid']}');\" class=\"tn\" />";
                    }
                    if ($value['body_general']) {
                        $html .= '<div class="quote' . ($value['image'] ? 'z' : '') . "\"><blockquote>{$value['body_general']}</blockquote></div>";
                    }
                    $html .= '</div></li>';
                }
                $html = !$html ? '<p class="emp">' . lang('space', 'block_share_no_content') . '</p>' : '<ul class="el">' . $html . '</ul>';
            }
            break;
        case 'wall':
            $do = $blockname;
            $walllist = array();
            if (ckprivacy('wall', 'view')) {
                $query = C::t('home_comment')->fetch_all_by_id_idtype($uid, 'uid', 0, $shownum, '', 'DESC');
                foreach ($query as $value) {
                    $value['message'] = strlen($value['message']) > 500 ? getstr($value['message'], 500, 0, 0, 0, -1) . ' ...' : $value['message'];
                    if ($value['status'] == 0 || $value['authorid'] == $_G['uid']) {
开发者ID:dalinhuang,项目名称:healthshop,代码行数:67,代码来源:function_space.php

示例6: getblockhtml


//.........这里部分代码省略.........
            $fuids = array_keys($friendlist);
            getonlinemember($fuids);
            foreach ($friendlist as $key => $value) {
                $classname = $_G['ols'][$value['fuid']] ? 'gol' : '';
                $html .= '<li><a href="home.php?mod=space&uid=' . $value['fuid'] . '" target="_blank"><em class="' . $classname . '"></em>' . avatar($value['fuid'], 'small') . '</a><p><a href="home.php?mod=space&uid=' . $value[fuid] . '" target="_blank">' . $value['fusername'] . '</a></p></li>';
            }
            $html = '<div class="content"><ul class="ml mls cl">' . $html . '</ul></div>';
            break;
        case 'visitor':
            $query = DB::query("SELECT * FROM " . DB::table('home_visitor') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}");
            $list = $fuids = array();
            while ($value = DB::fetch($query)) {
                $list[] = $value;
                $fuids[] = $value['vuid'];
            }
            getonlinemember($fuids);
            foreach ($list as $value) {
                $html .= "<li>";
                if ($value['vusername'] == '') {
                    $html .= lang('space', 'visitor_anonymity');
                } else {
                    $html .= lang('space', 'visitor_list', array('uid' => $value['vuid'], 'username' => $value['vusername'], 'class' => $_G['ols'][$value['vuid']] ? 'gol' : '', 'avatar' => avatar($value['vuid'], 'small')));
                }
                $html .= "<span class=\"xg2\">" . dgmdate($value['dateline'], 'u') . "</span>";
                $html .= "</li>";
            }
            $html = '<div class="content"><ul class="ml mls cl">' . $html . '</ul></div>';
            break;
        case 'share':
            if (ckprivacy('share', 'view')) {
                require_once libfile('function/share');
                $query = DB::query("SELECT * FROM " . DB::table('home_share') . " WHERE uid='{$uid}' ORDER BY dateline DESC LIMIT 0,{$shownum}");
                while ($value = DB::fetch($query)) {
                    $value = mkshare($value);
                    $html .= '<li><em>' . $value['title_template'] . '(' . dgmdate($value['dateline'], 'u') . ')</em><div class="ec cl">';
                    if ($value['image']) {
                        $html .= '<a href="' . $value['image_link'] . '" target="_blank"><img src="' . $value['image'] . '" class="tn" alt="" /></a>';
                    }
                    $html .= '<div class="d">' . $value['body_template'] . '</div>';
                    if ($value['type'] == 'video') {
                        if (!empty($value['body_data']['imgurl'])) {
                            $html .= '<table class="mtm" title="' . lang('space', 'click_play') . '" onclick="javascript:showFlash(\'' . $value['body_data']['host'] . '\', \'' . $value['body_data']['flashvar'] . '\', this, \'' . $value['sid'] . '\');"><tr><td class="vdtn hm" style="background: url(' . $value['body_data']['imgurl'] . ') no-repeat"><img src="' . IMGDIR . '/vds.png" alt="' . lang('space', 'click_play') . '" /></td></tr></table>';
                        } else {
                            $html .= "<img src=\"" . IMGDIR . "/vd.gif\" alt=\"" . lang('space', 'click_play') . "\" onclick=\"javascript:showFlash('{$value['body_data']['host']}', '{$value['body_data']['flashvar']}', this, '{$value['sid']}');\" class=\"tn\" />";
                        }
                    } elseif ($value['type'] == 'music') {
                        $html .= "<img src=\"" . IMGDIR . "/music.gif\" alt=\"" . lang('space', 'click_play') . "\" onclick=\"javascript:showFlash('music', '{$value['body_data']['musicvar']}', this, '{$value['sid']}');\" class=\"tn\" />";
                    } elseif ($value['type'] == 'flash') {
                        $html .= "<img src=\"" . IMGDIR . "/flash.gif\" alt=\"" . lang('space', 'click_view') . "\" onclick=\"javascript:showFlash('flash', '{$value['body_data']['flashaddr']}', this, '{$value['sid']}');\" class=\"tn\" />";
                    }
                    if ($value['body_general']) {
                        $html .= '<div class="quote' . ($value['image'] ? 'z' : '') . "\"><blockquote>{$value['body_general']}</blockquote></div>";
                    }
                    $html .= '</div></li>';
                }
                $html = '<div class="content"><ul class="el">' . $html . '</ul></div>';
            }
            break;
        case 'wall':
            $walllist = array();
            if (ckprivacy('wall', 'view')) {
                $query = DB::query("SELECT * FROM " . DB::table('home_comment') . " WHERE id='{$uid}' AND idtype='uid' ORDER BY dateline DESC LIMIT 0,{$shownum}");
                while ($value = DB::fetch($query)) {
                    $value['message'] = strlen($value['message']) > 500 ? getstr($value['message'], 500, 0, 0, 0, 0, -1) . ' ...' : $value['message'];
                    $walllist[] = $value;
                }
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:67,代码来源:function_space.php


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