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


PHP aidencode函数代码示例

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


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

示例1: get_uploadcontent

function get_uploadcontent($attach, $type = 'portal', $dotype = '')
{
    $return = '';
    $dotype = $dotype ? 'checked' : '';
    if ($attach['isimage']) {
        $pic = pic_get($attach['attachment'], $type, $attach['thumb'], $attach['remote'], 0);
        $small_pic = $attach['thumb'] ? getimgthumbname($pic) : '';
        $check = $attach['pic'] == $type . '/' . $attach['attachment'] ? 'checked' : $dotype;
        $aid = $check ? $attach['aid'] : '';
        $return .= '<a href="javascript:;" class="opattach"><span class="opattach_ctrl">';
        $return .= '<span onclick="insertImage(\'' . $pic . '\');" class="cur1">' . lang('portalcp', 'insert_large_image') . '</span>';
        $return .= '<span class="pipe">|</span>';
        if ($small_pic) {
            $return .= '<span onclick="insertImage(\'' . $small_pic . '\', \'' . $pic . '\');" class="cur1">' . lang('portalcp', 'small_image') . '</span>';
        }
        $return .= '</span><img src="' . ($small_pic ? $small_pic : $pic) . '" onclick="insertImage(\'' . $pic . '\');" class="cur1"></a>';
        $return .= '<label for="setconver' . $attach['attachid'] . '" class="cur1 xi2"><input type="radio" name="setconver" id="setconver' . $attach['attachid'] . '" class="pr" value="1" onclick="setConver(\'' . addslashes(serialize(array('pic' => $type . '/' . $attach['attachment'], 'thumb' => $attach['thumb'], 'remote' => $attach['remote']))) . '\') ' . $check . '>' . lang('portalcp', 'set_to_conver') . '</label>';
        $return .= '<span class="pipe">|</span>';
        if ($type == 'portal') {
            $return .= '<span class="cur1 xi2" onclick="deleteAttach(\'' . $attach['attachid'] . '\', \'portal.php?mod=attachment&id=' . $attach['attachid'] . '&aid=' . $aid . '&op=delete\');">' . lang('portalcp', 'delete') . '</span>';
        }
    } else {
        $attach_url = $type == 'forum' ? 'forum.php?mod=attachment&aid=' . aidencode($attach['attachid'], 1) : 'portal.php?mod=attachment&id=' . $attach['attachid'];
        $return .= '<table id="attach_list_' . $attach['attachid'] . '" width="100%" class="xi2">';
        $return .= '<td width="50" class="bbs"><a href="' . $attach_url . '" target="_blank">' . $attach['filename'] . '</a></td>';
        $return .= '<td align="right" class="bbs">';
        $return .= '<a href="javascript:void(0);" onclick="insertFile(\'' . $attach['filename'] . '\', \'' . $attach_url . '\');return false;">' . lang('portalcp', 'insert_file') . '</a><br>';
        if ($type == 'portal') {
            $return .= '<a href="javascript:void(0);" onclick="deleteAttach(\'' . $attach['attachid'] . '\', \'portal.php?mod=attachment&id=' . $attach['attachid'] . '&op=delete\');return false;">' . lang('portalcp', 'delete') . '</a>';
        }
        $return .= '</td>';
        $return .= '</table>';
    }
    return $return;
}
开发者ID:softhui,项目名称:discuz,代码行数:35,代码来源:function_portalcp.php

示例2: while

        while ($attachment = $db->fetch_array($query)) {
            if (!$attachment['remote']) {
                $matched = file_exists($attachdir . '/' . $attachment['attachment']) ? '' : lang('attach_lost');
                $attachment['url'] = $attachurl;
            } else {
                @set_time_limit(0);
                if (@fclose(@fopen($ftp['attachurl'] . '/' . $attachment['attachment'], 'r'))) {
                    $matched = '';
                } else {
                    $matched = lang('attach_lost');
                }
                $attachment['url'] = $ftp['attachurl'];
            }
            $attachsize = sizecount($attachment['filesize']);
            if (!$nomatched || $nomatched && $matched) {
                $attachments .= showtablerow('', array('class="td25"', 'title="' . $attachment['description'] . '" class="td21"'), array("<input class=\"checkbox\" type=\"checkbox\" name=\"delete[]\" value=\"{$attachment['aid']}\" />", $attachment['remote'] ? "<span class=\"diffcolor3\">{$attachment['filename']}" : $attachment['filename'], "<a href=\"{$attachment['url']}/{$attachment['attachment']}\" class=\"smalltxt\" target=\"_blank\">" . cutstr($attachment['attachment'], 30) . "</a>", $attachment['author'], "<a href=\"viewthread.php?tid={$attachment['tid']}\" target=\"_blank\">" . cutstr($attachment['subject'], 20) . "</a>", $attachsize, $attachment['downloads'], $matched ? "<em class=\"error\">{$matched}<em>" : "<a href=\"attachment.php?aid=" . aidencode($attachment['aid']) . "&noupdate=yes\" target=\"_blank\" class=\"act nomargin\">{$lang['download']}</a>"), TRUE);
            }
        }
        $attachmentcount = $db->result_first("SELECT count(*) FROM {$tablepre}attachments a LEFT JOIN {$tablepre}attachmentfields af ON a.aid=af.aid, {$tablepre}posts p, {$tablepre}threads t, {$tablepre}forums f\r\n\t\t\tWHERE t.tid=a.tid AND f.fid=p.fid AND t.displayorder>='0' AND p.invisible='0' AND {$sql}");
        $multipage = multi($attachmentcount, $ppp, $page, "{$BASESCRIPT}?action=attachments");
        $multipage = preg_replace("/href=\"{$BASESCRIPT}\\?action=attachments&amp;page=(\\d+)\"/", "href=\"javascript:page(\\1)\"", $multipage);
        $multipage = str_replace("window.location={$BASESCRIPT}.'?action=attachments&amp;page='+this.value", "page(this.value)", $multipage);
        echo <<<EOT
<script type="text/JavaScript">
\tfunction page(number) {
\t\t\$('attachmentforum').page.value=number;
\t\t\$('attachmentforum').searchsubmit.click();
\t}
</script>
EOT;
        showtagheader('div', 'admin', $searchsubmit);
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:attach.inc.php

示例3: substr

    } else {
        exit;
    }
}
if ($_G['setting']['attachexpire']) {
    $k = $_G['gp_k'];
    $t = $_G['gp_t'];
    $authk = !$requestmode ? substr(md5($aid . md5($_G['config']['security']['authkey']) . $t . $_G['gp_uid']), 0, 8) : md5($aid . md5($_G['config']['security']['authkey']) . $t);
    if (empty($k) || empty($t) || $k != $authk || TIMESTAMP - $t > $_G['setting']['attachexpire'] * 3600) {
        $aid = intval($aid);
        if ($attach = DB::fetch_first("SELECT pid, tid, isimage FROM " . DB::table('forum_attachment_' . $tableid) . " WHERE aid='{$aid}'")) {
            if ($attach['isimage']) {
                dheader('location: ' . $_G['siteurl'] . 'static/image/common/none.gif');
            } else {
                if (!$requestmode) {
                    showmessage('attachment_expired', '', array('aid' => aidencode($aid, 0, $attach['tid']), 'pid' => $attach['pid'], 'tid' => $attach['tid']));
                } else {
                    exit;
                }
            }
        } else {
            if (!$requestmode) {
                showmessage('attachment_nonexistence');
            } else {
                exit;
            }
        }
    }
}
$readmod = getglobal('config/download/readmod');
$readmod = $readmod > 0 && $readmod < 5 ? $readmod : 2;
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:31,代码来源:forum_attachment.php

示例4: connectParseAttachTag

 public function connectParseAttachTag($attachId, $attachNames)
 {
     include_once libfile('function/discuzcode');
     if (array_key_exists($attachId, $attachNames)) {
         return '<span class="attach"><a href="' . $_G['siteurl'] . '/attachment.php?aid=' . aidencode($attachId) . '">' . $attachNames[$attachId] . '</a></span>';
     }
     return '';
 }
开发者ID:wait121000,项目名称:discuz3.0forsae,代码行数:8,代码来源:Connect.php

示例5: parseattachurl

function parseattachurl($aid, $ext, $ignoretid = 0)
{
    global $_G;
    $_G['forum_skipaidlist'][] = $aid;
    return $_G['siteurl'] . 'forum.php?mod=attachment&aid=' . aidencode($aid, $ext, $ignoretid ? '' : $_G['tid']) . ($ext ? '&request=yes&_f=.' . $ext : '');
}
开发者ID:tang86,项目名称:discuz-utf8,代码行数:6,代码来源:function_discuzcode.php

示例6: getdata

 function getdata($style, $parameter)
 {
     global $_G;
     $parameter = $this->cookparameter($parameter);
     loadcache('forums');
     $fids = isset($parameter['fids']) && !in_array(0, (array) $parameter['fids']) ? $parameter['fids'] : array_keys($_G['cache']['forums']);
     $tids = !empty($parameter['tids']) ? explode(',', $parameter['tids']) : array();
     $startrow = isset($parameter['startrow']) ? intval($parameter['startrow']) : 0;
     $items = isset($parameter['items']) ? intval($parameter['items']) : 10;
     $digest = isset($parameter['digest']) ? $parameter['digest'] : 0;
     $special = isset($parameter['special']) ? $parameter['special'] : array();
     $rewardstatus = isset($parameter['rewardstatus']) ? intval($parameter['rewardstatus']) : 0;
     $titlelength = !empty($parameter['titlelength']) ? intval($parameter['titlelength']) : 40;
     $summarylength = !empty($parameter['summarylength']) ? intval($parameter['summarylength']) : 80;
     $orderby = isset($parameter['orderby']) ? in_array($parameter['orderby'], array('dateline', 'downloads', 'hourdownloads', 'todaydownloads', 'weekdownloads', 'monthdownloads')) ? $parameter['orderby'] : 'dateline' : 'dateline';
     $threadmethod = !empty($parameter['threadmethod']) ? 1 : 0;
     $isimage = isset($parameter['isimage']) ? intval($parameter['isimage']) : '';
     if ($fids) {
         $thefids = array();
         foreach ($fids as $fid) {
             if ($_G['cache']['forums'][$fid]['type'] == 'group') {
                 $thefids[] = $fid;
             }
         }
         if ($thefids) {
             foreach ($_G['cache']['forums'] as $value) {
                 if ($value['fup'] && in_array($value['fup'], $thefids)) {
                     $fids[] = intval($value['fid']);
                 }
             }
         }
         $fids = array_unique($fids);
     }
     $bannedids = !empty($parameter['bannedids']) ? explode(',', $parameter['bannedids']) : array();
     $datalist = $list = array();
     $sql = ($fids ? ' AND t.fid IN (' . dimplode($fids) . ')' : '') . ($tids ? ' AND t.tid IN (' . dimplode($tids) . ')' : '') . ($digest ? ' AND t.digest IN (' . dimplode($digest) . ')' : '') . ($special ? ' AND t.special IN (' . dimplode($special) . ')' : '') . (in_array(3, $special) && $rewardstatus ? $rewardstatus == 1 ? ' AND t.price < 0' : ' AND t.price > 0' : '') . " AND t.isgroup='0'";
     $orderbysql = $historytime = '';
     switch ($orderby) {
         case 'dateline':
             $orderbysql = "ORDER BY `attach`.`dateline` DESC";
             break;
         case 'downloads':
             $orderbysql = "ORDER BY `attach`.`downloads` DESC";
             break;
         case 'hourdownloads':
             $historytime = TIMESTAMP - 3600;
             $orderbysql = "ORDER BY `attach`.`downloads` DESC";
             break;
         case 'todaydownloads':
             $historytime = mktime(0, 0, 0, date('m', TIMESTAMP), date('d', TIMESTAMP), date('Y', TIMESTAMP));
             $orderbysql = "ORDER BY `attach`.`downloads` DESC";
             break;
         case 'weekdownloads':
             $week = gmdate('w', TIMESTAMP) - 1;
             $week = $week != -1 ? $week : 6;
             $historytime = mktime(0, 0, 0, date('m', TIMESTAMP), date('d', TIMESTAMP) - $week, date('Y', TIMESTAMP));
             $orderbysql = "ORDER BY `attach`.`downloads` DESC";
             break;
         case 'monthdownloads':
             $historytime = mktime(0, 0, 0, date('m', TIMESTAMP), 1, date('Y', TIMESTAMP));
             $orderbysql = "ORDER BY `attach`.`downloads` DESC";
             break;
     }
     $historytime = !$historytime ? TIMESTAMP - 8640000 : $historytime;
     $htsql = "`attach`.`dateline`>='{$historytime}'";
     $sqlfield = $sqljoin = '';
     if ($style['getsummary']) {
         $sqlfield = ',af.description';
         $sqljoin = "LEFT JOIN `" . DB::table('forum_attachmentfield') . "` af ON attach.aid=af.aid";
     }
     if ($isimage) {
         $sql .= $isimage == 1 ? "AND `attach`.`isimage` IN ('1', '-1')" : "AND `attach`.`isimage`='0'";
     }
     $sqlgroupby = '';
     if ($threadmethod) {
         if ($isimage == 1) {
             $sql .= ' AND t.attachment=2';
         } elseif ($isimage == 2) {
             $sql .= ' AND t.attachment=1';
         } else {
             $sql .= ' AND t.attachment>0';
         }
         $sqlgroupby = ' GROUP BY t.tid';
     }
     $sqlban = !empty($bannedids) ? ' AND attach.aid NOT IN (' . dimplode($bannedids) . ')' : '';
     $query = DB::query("SELECT attach.*,t.tid,t.author,t.authorid,t.subject {$sqlfield}\n\t\t\tFROM `" . DB::table('forum_attachment') . "` attach\n\t\t\t{$sqljoin}\n\t\t\tINNER JOIN `" . DB::table('forum_thread') . "` t\n\t\t\tON `t`.`tid`=`attach`.`tid` AND `displayorder`>='0'\n\t\t\tWHERE {$htsql} AND `attach`.`readperm`='0' AND `attach`.`price`='0'\n\t\t\t{$sql}\n\t\t\t{$sqlban}\n\t\t\t{$sqlgroupby}\n\t\t\t{$orderbysql}\n\t\t\tLIMIT {$startrow},{$items};");
     include_once libfile('block/thread', 'class');
     $bt = new block_thread();
     while ($data = DB::fetch($query)) {
         $list[] = array('id' => $data['aid'], 'idtype' => 'aid', 'title' => cutstr(str_replace('\\\'', '&#39;', $data['filename']), $titlelength), 'url' => 'forum.php?mod=attachment&aid=' . aidencode($data['aid']), 'pic' => $data['isimage'] == 1 || $data['isimage'] == -1 ? 'forum/' . $data['attachment'] : '', 'picflag' => $data['remote'] ? '2' : '1', 'summary' => !empty($data['description']) ? cutstr(str_replace('\\\'', '&#39;', $data['description']), $summarylength) : '', 'fields' => array('author' => $data['author'], 'authorid' => $data['authorid'], 'filesize' => sizecount($data['filesize']), 'dateline' => $data['dateline'], 'downloads' => $data['downloads'], 'hourdownloads' => $data['downloads'], 'todaydownloads' => $data['downloads'], 'weekdownloads' => $data['downloads'], 'monthdownloads' => $data['downloads'], 'threadurl' => 'forum.php?mod=viewthread&tid=' . $data['tid'], 'threadsubject' => cutstr(str_replace('\\\'', '&#39;', $data['subject']), $titlelength), 'threadsummary' => $bt->getthread($data['tid'], $summarylength)));
     }
     return array('html' => '', 'data' => $list);
 }
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:93,代码来源:block_attachment.php

示例7: packaids

function packaids($attach)
{
    global $_G;
    return aidencode($attach['aid'], 0, $_G['tid']);
}
开发者ID:softhui,项目名称:discuz,代码行数:5,代码来源:function_attachment.php

示例8: showmessage

        if ($status == 1) {
            showmessage('credits_balance_insufficient', '', array('title' => $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['title'], 'minbalance' => $attach['price']));
        }
        foreach ($aids as $aid) {
            $updateauthor = 1;
            if ($_G['setting']['maxincperthread'] > 0) {
                $extcredit = 'extcredits' . $_G['setting']['creditstransextra'][1];
                if (DB::result_first("SELECT SUM({$extcredit}) FROM " . DB::table('common_credit_log') . " WHERE relatedid='{$aid}' AND uid='{$attach['uid']}' AND operation='SAC'") > $_G['setting']['maxincperthread']) {
                    $updateauthor = 0;
                }
            }
            if ($updateauthor) {
                updatemembercount($attach['uid'], array($_G['setting']['creditstransextra'][1] => $prices[$aid][1]), 1, 'SAC', $aid);
            }
            updatemembercount($_G['uid'], array($_G['setting']['creditstransextra'][1] => -$prices[$aid][0]), 1, 'BAC', $aid);
            $aidencode = aidencode($aid);
        }
        if (count($aids) > 1) {
            showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid=' . $attach['tid'] . '&pid=' . $attach['pid']);
        } else {
            $_G['forum_attach_filename'] = $attach['filename'];
            showmessage('attachment_buy', "forum.php?mod=attachment&aid={$aidencode}", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));
        }
    }
} elseif ($_G['gp_action'] == 'viewattachpayments') {
    $aid = intval($_G['gp_aid']);
    $extcreditname = 'extcredits' . $_G['setting']['creditstransextra'][1];
    $loglist = array();
    $query = DB::query("SELECT l.*, m.username FROM " . DB::table('common_credit_log') . " l\r\n\t\tLEFT JOIN " . DB::table('common_member') . " m USING (uid)\r\n\t\tWHERE l.relatedid='{$aid}' AND l.operation='BAC' ORDER BY l.dateline");
    while ($log = DB::fetch($query)) {
        $log['dateline'] = dgmdate($log['dateline'], 'u');
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:forum_misc.php

示例9: parseattachurl

function parseattachurl($aid, $ext) {
	$GLOBALS['skipaidlist'][] = $aid;
	return $GLOBALS['boardurl'].'attachment.php?aid='.aidencode($aid).($ext ? '&request=yes&_f=.'.$ext : '');
}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:4,代码来源:discuzcode.func.php

示例10: showmessage

        if ($status == 1) {
            showmessage('credits_balance_insufficient', '', array('title' => $_G['setting']['extcredits'][$_G['setting']['creditstransextra'][1]]['title'], 'minbalance' => $attach['price']));
        }
        foreach ($aids as $aid) {
            $updateauthor = 1;
            if ($_G['setting']['maxincperthread'] > 0) {
                $extcredit = 'extcredits' . $_G['setting']['creditstransextra'][1];
                if (DB::result_first("SELECT SUM({$extcredit}) FROM " . DB::table('common_credit_log') . " WHERE relatedid='{$aid}' AND uid='{$attach['uid']}' AND operation='SAC'") > $_G['setting']['maxincperthread']) {
                    $updateauthor = 0;
                }
            }
            if ($updateauthor) {
                updatemembercount($attach['uid'], array($_G['setting']['creditstransextra'][1] => $prices[$aid][1]), 1, 'SAC', $aid);
            }
            updatemembercount($_G['uid'], array($_G['setting']['creditstransextra'][1] => -$prices[$aid][0]), 1, 'BAC', $aid);
            $aidencode = aidencode($aid, 0, $_G['gp_tid']);
        }
        if (count($aids) > 1) {
            showmessage('attachment_buyall', 'forum.php?mod=redirect&goto=findpost&ptid=' . $attach['tid'] . '&pid=' . $attach['pid']);
        } else {
            $_G['forum_attach_filename'] = $attach['filename'];
            showmessage('attachment_buy', "forum.php?mod=attachment&aid={$aidencode}", array('filename' => $_G['forum_attach_filename']), array('redirectmsg' => 1));
        }
    }
} elseif ($_G['gp_action'] == 'viewattachpayments') {
    $aid = intval($_G['gp_aid']);
    $extcreditname = 'extcredits' . $_G['setting']['creditstransextra'][1];
    $loglist = array();
    $query = DB::query("SELECT l.*, m.username FROM " . DB::table('common_credit_log') . " l\r\n\t\tLEFT JOIN " . DB::table('common_member') . " m USING (uid)\r\n\t\tWHERE l.relatedid='{$aid}' AND l.operation='BAC' ORDER BY l.dateline");
    while ($log = DB::fetch($query)) {
        $log['dateline'] = dgmdate($log['dateline'], 'u');
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:forum_misc.php

示例11: foreach

        foreach ($_G['setting']['extcredits'] as $id => $credit) {
            if ($log['extcredits' . $id]) {
                $log['update'] .= $credit['title'] . $log['extcredits' . $id] . $credit['unit'] . '&nbsp;';
            }
        }
        $related = '';
        if ($log['operation'] == 'TRC') {
            $related = '<a href="home.php?mod=task&do=view&id=' . $log['relatedid'] . '" target="_blank">' . cplang('logs_task_id') . ':' . $log['relatedid'] . ' ' . cplang('logs_click2view') . '</a>';
        } elseif (in_array($log['operation'], array('RTC', 'RAC', 'STC', 'BTC', 'ACC'))) {
            $related = '<a href="forum.php?mod=viewthread&tid=' . $log['relatedid'] . '" target="_blank">' . cplang('logs_thread_id') . ':' . $log['relatedid'] . ' ' . cplang('logs_click2view') . '</a>';
        } elseif ($log['operation'] == 'MRC') {
            $related = cplang('logs_magic_id') . ':' . $log['relatedid'];
        } elseif (in_array($log['operation'], array('TFR', 'RCV', 'CEC', 'ECU', 'AFD'))) {
            $related = '<a href="home.php?mod=space&uid=' . $log['relatedid'] . '&do=profile" target="_blank">' . cplang('uid') . ':' . $log['relatedid'] . ' ' . cplang('logs_click2view') . '</a>';
        } elseif (in_array($log['operation'], array('BAC', 'SAC'))) {
            $aid = aidencode($log['relatedid']);
            $related = '<a href="forum.php?mod=attachment&aid=' . $aid . '&nothumb=yes" target="_blank">' . cplang('logs_attach_id') . ':' . $log['relatedid'] . ' ' . cplang('logs_click2view') . '</a>';
        } elseif ($log['operation'] == 'PRC') {
            $related = cplang('logs_post_id') . ':' . $log['relatedid'];
        } elseif ($log['operation'] == 'UGP') {
            $related = $_G['cache']['group'][$log['relatedid']]['grouptitle'];
        } elseif ($log['operation'] == 'RPC') {
            $related = cplang('logs_report_id') . ':' . $log['relatedid'];
        }
        showtablerow('', array('class="bold"'), array("<a href=\"home.php?mod=space&uid={$log['uid']}\" target=\"_blank\">{$log['username']}", $log['dateline'], cplang('logs_credit_update_' . $log['operation']), $log['update'], $related));
    }
    showsubmit('', '', '', '', $multipage);
} elseif ($operation == 'mods') {
    $modactioncode = lang('forum/modaction');
    showtablerow('class="header"', array('class="td23"', 'class="td23"', 'class="td23"', 'class="td23"', 'class="td24"', 'class="td24"', 'class="td23"'), array(cplang('operator'), cplang('usergroup'), cplang('ip'), cplang('time'), cplang('forum'), cplang('thread'), cplang('action'), cplang('reason')));
    foreach ($logs as $logrow) {
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:admincp_logs.php

示例12: elseif

			foreach($_DTYPE as $optionid => $option) {
				$optionlist[$option['identifier']]['title'] = $_DTYPE[$optionid]['title'];
				$optionlist[$option['identifier']]['unit'] = $_DTYPE[$optionid]['unit'];
				if($_DTYPE[$optionid]['type'] == 'checkbox') {
					$optionlist[$option['identifier']]['value'] = '';
					foreach(explode("\t", $optiondata[$optionid]) as $choiceid) {
						$optionlist[$option['identifier']]['value'] .= $_DTYPE[$optionid]['choices'][$choiceid].'&nbsp;';
					}
				} elseif(in_array($_DTYPE[$optionid]['type'], array('radio', 'select'))) {
					$optionlist[$option['identifier']]['value'] = $_DTYPE[$optionid]['choices'][$optiondata[$optionid]];
				} elseif($_DTYPE[$optionid]['type'] == 'image') {
					$maxwidth = $_DTYPE[$optionid]['maxwidth'] ? 'width="'.$_DTYPE[$optionid]['maxwidth'].'"' : '';
					$maxheight = $_DTYPE[$optionid]['maxheight'] ? 'height="'.$_DTYPE[$optionid]['maxheight'].'"' : '';
					if(preg_match("/^\[aid=(\d+)\]$/", $optiondata[$optionid], $r)) {
						$skipaids[] = $r[1];
						$optiondata[$optionid] = 'attachment.php?aid='.aidencode($r[1]);
					}
					$optionlist[$option['identifier']]['value'] = $optiondata[$optionid] ? "<a href=\"$optiondata[$optionid]\" target=\"_blank\"><img src=\"$optiondata[$optionid]\" onload=\"thumbImg(this)\" $maxwidth $maxheight border=\"0\"></a>" : '';
				} elseif($_DTYPE[$optionid]['type'] == 'url') {
					$optionlist[$option['identifier']]['value'] = $optiondata[$optionid] ? "<a href=\"$optiondata[$optionid]\" target=\"_blank\">$optiondata[$optionid]</a>" : '';
				} elseif($_DTYPE[$optionid]['type'] == 'textarea') {
					$optionlist[$option['identifier']]['value'] = $optiondata[$optionid] ? nl2br($optiondata[$optionid]) : '';
				} else {
					$optionlist[$option['identifier']]['value'] = $optiondata[$optionid];
				}
			}

			if($_DTYPETEMPLATE) {
				foreach($_DTYPE as $option) {
					$searchtitle[] = '/{('.$option['identifier'].')}/e';
					$searchvalue[] = '/\[('.$option['identifier'].')value\]/e';
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:31,代码来源:viewthread.php

示例13: getdata

 function getdata($style, $parameter)
 {
     global $_G;
     $parameter = $this->cookparameter($parameter);
     loadcache('grouptype');
     $typeids = array();
     if (!empty($parameter['gtids'])) {
         if ($parameter['gtids'][0] == '0') {
             unset($parameter['gtids'][0]);
         }
         $typeids = $parameter['gtids'];
     }
     $startrow = isset($parameter['startrow']) ? intval($parameter['startrow']) : 0;
     $items = isset($parameter['items']) ? intval($parameter['items']) : 10;
     $titlelength = !empty($parameter['titlelength']) ? intval($parameter['titlelength']) : 40;
     $summarylength = !empty($parameter['summarylength']) ? intval($parameter['summarylength']) : 80;
     $digest = isset($parameter['digest']) ? $parameter['digest'] : 0;
     $special = isset($parameter['special']) ? $parameter['special'] : array();
     $rewardstatus = isset($parameter['rewardstatus']) ? intval($parameter['rewardstatus']) : 0;
     $orderby = isset($parameter['orderby']) ? in_array($parameter['orderby'], array('dateline', 'downloads')) ? $parameter['orderby'] : 'dateline' : 'dateline';
     $dateline = isset($parameter['dateline']) ? intval($parameter['dateline']) : '8640000';
     $threadmethod = !empty($parameter['threadmethod']) ? 1 : 0;
     $isimage = isset($parameter['isimage']) ? intval($parameter['isimage']) : '';
     $gviewperm = isset($parameter['gviewperm']) ? intval($parameter['gviewperm']) : -1;
     $bannedids = !empty($parameter['bannedids']) ? explode(',', $parameter['bannedids']) : array();
     $gviewwhere = $gviewperm == -1 ? '' : " AND ff.gviewperm='{$gviewperm}'";
     $groups = array();
     if (empty($fids) && $typeids) {
         $query = DB::query('SELECT f.fid, f.name, ff.description FROM ' . DB::table('forum_forum') . " f LEFT JOIN " . DB::table('forum_forumfield') . " ff ON f.fid = ff.fid WHERE f.fup IN (" . dimplode($typeids) . ") AND threads > 0{$gviewwhere}");
         while ($value = DB::fetch($query)) {
             $groups[$value['fid']] = $value;
             $fids[] = intval($value['fid']);
         }
         if (empty($fids)) {
             return array('html' => '', 'data' => '');
         }
     }
     $datalist = $list = array();
     $sql = ($fids ? ' AND t.fid IN (' . dimplode($fids) . ')' : '') . ($tids ? ' AND t.tid IN (' . dimplode($tids) . ')' : '') . ($digest ? ' AND t.digest IN (' . dimplode($digest) . ')' : '') . ($special ? ' AND t.special IN (' . dimplode($special) . ')' : '') . (in_array(3, $special) && $rewardstatus ? $rewardstatus == 1 ? ' AND t.price < 0' : ' AND t.price > 0' : '');
     if (empty($fids)) {
         $sql .= " AND t.isgroup='1'";
         if ($gviewwhere) {
             $sql .= $gviewwhere;
         }
     }
     $orderbysql = $historytime = '';
     switch ($orderby) {
         case 'dateline':
             $orderbysql = "ORDER BY `attach`.`dateline` DESC";
             break;
         case 'downloads':
             $orderbysql = "ORDER BY `attach`.`downloads` DESC";
             break;
     }
     $htsql = '';
     $dateline = !empty($dateline) ? intval($dateline) : 8640000;
     $historytime = TIMESTAMP - $dateline;
     $htsql = "`attach`.`dateline`>='{$historytime}'";
     $sqlfield = $sqljoin = '';
     if ($style['getsummary']) {
         $sqlfield = ',af.description';
         $sqljoin = "LEFT JOIN `" . DB::table('forum_attachmentfield') . "` af ON attach.aid=af.aid";
     }
     if ($isimage) {
         $sql .= $isimage == 1 ? "AND `attach`.`isimage` IN ('1', '-1')" : "AND `attach`.`isimage`='0'";
     }
     $sqlgroupby = '';
     if ($threadmethod) {
         if ($isimage == 1) {
             $sql .= ' AND t.attachment=2';
         } elseif ($isimage == 2) {
             $sql .= ' AND t.attachment=1';
         } else {
             $sql .= ' AND t.attachment>0';
         }
         $sqlgroupby = ' GROUP BY t.tid';
     }
     $sqlban = !empty($bannedids) ? ' AND attach.tid NOT IN (' . dimplode($bannedids) . ')' : '';
     if (empty($fids)) {
         $sqlfield = ', f.name groupname';
         $sqljoin .= ' LEFT JOIN ' . DB::table('forum_forum') . ' f ON t.fid=f.fid LEFT JOIN ' . DB::table('forum_forumfield') . ' ff ON f.fid = ff.fid';
     }
     $query = DB::query("SELECT attach.*,t.tid,t.author,t.authorid,t.subject {$sqlfield}\r\n\t\t\tFROM `" . DB::table('forum_attachment') . "` attach\r\n\t\t\tINNER JOIN `" . DB::table('forum_thread') . "` t\r\n\t\t\tON `t`.`tid`=`attach`.`tid` AND `displayorder`>='0'\r\n\t\t\t{$sqljoin}\r\n\t\t\tWHERE {$htsql} AND `attach`.`readperm`='0' AND `attach`.`price`='0'\r\n\t\t\t{$sql}\r\n\t\t\t{$sqlban}\r\n\t\t\t{$sqlgroupby}\r\n\t\t\t{$orderbysql}\r\n\t\t\tLIMIT {$startrow},{$items};");
     require_once libfile('block_thread', 'class/block/forum');
     $bt = new block_thread();
     while ($data = DB::fetch($query)) {
         $list[] = array('id' => $data['aid'], 'idtype' => 'aid', 'title' => cutstr(str_replace('\\\'', '&#39;', $data['filename']), $titlelength, ''), 'url' => 'forum.php?mod=attachment&aid=' . aidencode($data['aid']), 'pic' => $data['isimage'] == 1 || $data['isimage'] == -1 ? 'forum/' . $data['attachment'] : '', 'picflag' => $data['remote'] ? '2' : '1', 'summary' => $data['description'] ? cutstr(str_replace('\\\'', '&#39;', $data['description']), $summarylength, '') : '', 'fields' => array('fulltitle' => str_replace('\\\'', '&#39;', addslashes($data['subject'])), 'author' => $data['author'], 'authorid' => $data['authorid'], 'filesize' => sizecount($data['filesize']), 'dateline' => $data['dateline'], 'downloads' => $data['downloads'], 'hourdownloads' => $data['downloads'], 'todaydownloads' => $data['downloads'], 'weekdownloads' => $data['downloads'], 'monthdownloads' => $data['downloads'], 'threadurl' => 'forum.php?mod=viewthread&tid=' . $data['tid'], 'threadsubject' => cutstr(str_replace('\\\'', '&#39;', $data['subject']), $titlelength, ''), 'threadsummary' => $bt->getthread($data['tid'], $summarylength)));
     }
     return array('html' => '', 'data' => $list);
 }
开发者ID:v998,项目名称:discuzx-en,代码行数:90,代码来源:block_groupattachment.php

示例14: attachinpost

function attachinpost($attach) {
global $attachrefcheck, $extcredits, $creditstrans, $creditstransextra, $ftp, $thumbstatus, $attachimgpost;
$attach['refcheck'] = (!$attach['remote'] && $attachrefcheck) || ($attach['remote'] && ($ftp['hideurl'] || ($attach['isimage'] && $attachimgpost && strtolower(substr($ftp['attachurl'], 0, 3)) == 'ftp')));
$aidencode = aidencode($attach['aid']);
 ?><?
$__IMGDIR = IMGDIR;$return = <<<EOF


EOF;
 if(!isset($attach['unpayed'])) { if($attach['attachimg']) { if(!IS_ROBOT) { 
$return .= <<<EOF

<span style="position: absolute; display: none" id="attach_{$attach['aid']}" onmouseover="showMenu({'ctrlid':this.id,'pos':'13'})"><img src="{$__IMGDIR}/attachimg.gif" border="0"></span>

EOF;
 if($thumbstatus && $attach['thumb']) { 
$return .= <<<EOF

<a href="javascript:;"><img onclick="zoom(this, '
EOF;
 if($attach['refcheck']) { 
$return .= <<<EOF
attachment.php?aid={$aidencode}&amp;noupdate=yes&amp;nothumb=yes
EOF;
 } else { 
$return .= <<<EOF
{$attach['url']}/{$attach['attachment']}
EOF;
 } 
$return .= <<<EOF
')" src="
EOF;
 if($attach['refcheck']) { 
$return .= <<<EOF
attachment.php?aid={$aidencode}
EOF;
 } else { 
$return .= <<<EOF
{$attach['url']}/{$attach['attachment']}.thumb.jpg
EOF;
 } 
$return .= <<<EOF
" border="0" id="aimg_{$attach['aid']}" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" /></a>

EOF;
 } else { $GLOBALS['aimgs'][$attach['pid']][] = $attach['aid']; $widthcode = attachwidth($attach['width']); 
$return .= <<<EOF
<img src="images/common/none.gif" file="
EOF;
 if($attach['refcheck']) { 
$return .= <<<EOF
attachment.php?aid={$aidencode}&amp;noupdate=yes
EOF;
 } else { 
$return .= <<<EOF
{$attach['url']}/{$attach['attachment']}
EOF;
 } 
$return .= <<<EOF
" {$widthcode} id="aimg_{$attach['aid']}" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" alt="{$attach['filename']}" />

EOF;
 } 
$return .= <<<EOF

<div class="t_attach" id="aimg_{$attach['aid']}_menu" style="position: absolute; display: none">				
<a href="attachment.php?aid={$aidencode}&amp;nothumb=yes" title="{$attach['filename']}" target="_blank"><strong>下载</strong></a> ({$attach['attachsize']})<br />

EOF;
 if($attach['description']) { 
$return .= <<<EOF
{$attach['description']}<br />
EOF;
 } } else { 
$return .= <<<EOF

<dl class="t_attachlist attachimg">

EOF;
 if(!$attach['price'] || $attach['payed']) { if($attach['description']) { 
$return .= <<<EOF
<p>{$attach['description']}</p>
EOF;
 } 
$return .= <<<EOF

<img src="
EOF;
 if($attach['refcheck']) { 
$return .= <<<EOF
attachment.php?aid={$aidencode}&amp;noupdate=yes
EOF;
 } else { 
$return .= <<<EOF
{$attach['url']}/{$attach['attachment']}
EOF;
 } 
$return .= <<<EOF
" alt="{$attach['filename']}" />

//.........这里部分代码省略.........
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:101,代码来源:1_1_discuzcode.tpl.php

示例15: threadsortshow

function threadsortshow($sortid, $tid)
{
    global $_G;
    loadcache(array('threadsort_option_' . $sortid, 'threadsort_template_' . $sortid));
    $sortoptionarray = $_G['cache']['threadsort_option_' . $sortid];
    $templatearray = $_G['cache']['threadsort_template_' . $sortid];
    $threadsortshow = $optiondata = $searchtitle = $searchvalue = $searchunit = $memberinfofield = $_G['forum_option'] = array();
    $sql = "SELECT p.pid,p.fid,p.authorid FROM " . DB::table('forum_post') . " p WHERE p.tid =" . $tid . " and p.position=1 LIMIT 0, 1";
    $query = DB::query($sql);
    $vanfon_tid = 0;
    $vanfon_fid = 0;
    $vanfon_uid = 0;
    while ($result = DB::fetch($query)) {
        $vanfon_tid = $result['pid'];
        $vanfon_fid = $result['fid'];
        $vanfon_uid = $result['authorid'];
    }
    $vanfon_verify = '';
    $verifyuids = array();
    $verifyuids[$vanfon_uid] = $vanfon_uid;
    foreach (C::t('common_member_verify')->fetch_all($verifyuids) as $value) {
        foreach ($_G['setting']['verify'] as $vid => $vsetting) {
            if ($vsetting['available'] && $vsetting['showicon'] && $value['verify' . $vid] == 1) {
                $srcurl = '';
                if (!empty($vsetting['icon'])) {
                    $srcurl = $vsetting['icon'];
                }
                $vanfon_verify .= "<a href=\"home.php?mod=spacecp&ac=profile&op=verify&vid={$vid}\" target=\"_blank\">" . (!empty($srcurl) ? '<img src="' . $srcurl . '" class="vm" alt="' . $vsetting['title'] . '" title="' . $vsetting['title'] . '" />' : $vsetting['title']) . '</a>';
            } else {
                /*$srcurl = '';
                		$srcurl =   $vsetting['unverifyicon'];
                			$vanfon_verify .= "<a href=\"home.php?mod=spacecp&ac=profile&op=verify&vid=$vid\" target=\"_blank\">".(!empty($srcurl) ? '<img src="'.$srcurl.'" class="vm" alt="'.$vsetting['title'].'" title="'.$vsetting['title'].'" />' : $vsetting['title']).'</a>';*/
            }
        }
    }
    $sql = "SELECT m.groupid,g.icon FROM " . DB::table('common_member') . " m ," . DB::table('common_usergroup') . " g WHERE m.uid =" . $vanfon_uid . " and m.groupid=g.groupid LIMIT 0, 1";
    $query = DB::query($sql);
    $vanfon_usergroup = 0;
    while ($result = DB::fetch($query)) {
        $vanfon_usergroup = $result['icon'];
    }
    if ($sortoptionarray) {
        foreach (C::t('forum_typeoptionvar')->fetch_all_by_tid_optionid($tid) as $option) {
            $optiondata[$option['optionid']]['value'] = $option['value'];
            $optiondata[$option['optionid']]['expiration'] = $option['expiration'] && $option['expiration'] <= TIMESTAMP ? 1 : 0;
            $sortdataexpiration = $option['expiration'];
        }
        foreach ($sortoptionarray as $optionid => $option) {
            $_G['forum_option'][$option['identifier']]['title'] = $option['title'];
            $_G['forum_option'][$option['identifier']]['unit'] = $option['unit'];
            $_G['forum_option'][$option['identifier']]['type'] = $option['type'];
            if ($option['expiration'] && !$optiondata[$optionid]['expiration'] || empty($option['expiration'])) {
                if (!protectguard($option['protect'])) {
                    if ($option['type'] == 'checkbox') {
                        $_G['forum_option'][$option['identifier']]['value'] = '';
                        foreach (explode("\t", $optiondata[$optionid]['value']) as $choiceid) {
                            $_G['forum_option'][$option['identifier']]['value'] .= $option['choices'][$choiceid] . '&nbsp;';
                        }
                    } elseif ($option['type'] == 'radio') {
                        $_G['forum_option'][$option['identifier']]['value'] = $option['choices'][$optiondata[$optionid]['value']];
                    } elseif ($option['type'] == 'select') {
                        $tmpchoiceid = $tmpidentifiervalue = array();
                        foreach (explode('.', $optiondata[$optionid]['value']) as $choiceid) {
                            $tmpchoiceid[] = $choiceid;
                            $tmpidentifiervalue[] = $option['choices'][implode('.', $tmpchoiceid)];
                        }
                        $_G['forum_option'][$option['identifier']]['value'] = implode(' &raquo; ', $tmpidentifiervalue);
                        unset($tmpchoiceid, $tmpidentifiervalue);
                    } elseif ($option['type'] == 'image') {
                        $imgoptiondata = dunserialize($optiondata[$optionid]['value']);
                        $threadsortshow['sortaids'][] = $imgoptiondata['aid'];
                        if (empty($templatearray['viewthread'])) {
                            $maxwidth = $option['maxwidth'] ? 'width="' . $option['maxwidth'] . '"' : '';
                            $maxheight = $option['maxheight'] ? 'height="' . $option['maxheight'] . '"' : '';
                            if (!defined('IN_MOBILE')) {
                                $_G['forum_option'][$option['identifier']]['value'] = $imgoptiondata['url'] ? "<img src=\"" . $imgoptiondata['url'] . "\" onload=\"thumbImg(this)\" {$maxwidth} {$maxheight} border=\"0\">" : '';
                            } else {
                                $_G['forum_option'][$option['identifier']]['value'] = $imgoptiondata['url'] ? "<a href=\"" . $imgoptiondata['url'] . "\" target=\"_blank\">" . lang('forum/misc', 'click_view') . "</a>" : '';
                            }
                        } else {
                            $_G['forum_option'][$option['identifier']]['value'] = $imgoptiondata['url'] ? $imgoptiondata['url'] : './static/image/common/nophoto.gif';
                        }
                    } elseif ($option['type'] == 'face') {
                        $faceoptiondata = dunserialize($optiondata[$optionid]['value']);
                        $_G['forum_option'][$option['identifier']]['value'] = "forum.php?mod=attachment&aid=" . aidencode($faceoptiondata['aid']);
                        $attach = C::t('forum_attachment')->fetch($faceoptiondata['aid']);
                        $_G['forum_option'][$option['identifier']]['downloads'] = $attach['downloads'];
                        $threadsortshow['sortaids'][] = $faceoptiondata['aid'];
                    } elseif ($option['type'] == 'url') {
                        $_G['forum_option'][$option['identifier']]['value'] = $optiondata[$optionid]['value'] ? "<a href=\"" . $optiondata[$optionid]['value'] . "\" target=\"_blank\">" . $optiondata[$optionid]['value'] . "</a>" : '';
                    } elseif ($option['type'] == 'number') {
                        $_G['forum_option'][$option['identifier']]['value'] = $optiondata[$optionid]['value'];
                    } else {
                        if ($option['protect']['status'] && $optiondata[$optionid]['value']) {
                            $optiondata[$optionid]['value'] = $option['protect']['mode'] == 1 ? '<image src="' . stringtopic($optiondata[$optionid]['value']) . '">' : (!defined('IN_MOBILE') ? '<span id="sortmessage_' . $option['identifier'] . '"><a href="###" onclick="ajaxget(\'forum.php?mod=misc&action=protectsort&tid=' . $tid . '&optionid=' . $optionid . '\', \'sortmessage_' . $option['identifier'] . '\');return false;">' . lang('forum/misc', 'click_view') . '</a></span>' : $optiondata[$optionid]['value']);
                            $_G['forum_option'][$option['identifier']]['value'] = $optiondata[$optionid]['value'] ? $optiondata[$optionid]['value'] : $option['defaultvalue'];
                        } elseif ($option['type'] == 'textarea') {
                            $_G['forum_option'][$option['identifier']]['value'] = $optiondata[$optionid]['value'] ? nl2br($optiondata[$optionid]['value']) : '';
                        } else {
                            $_G['forum_option'][$option['identifier']]['value'] = $optiondata[$optionid]['value'] ? $optiondata[$optionid]['value'] : $option['defaultvalue'];
//.........这里部分代码省略.........
开发者ID:deepziyu,项目名称:JX3PVE,代码行数:101,代码来源:function_threadsort_bakfavicon.php


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