php AjaxHead类(方法)实例源码

下面列出了php AjaxHead 类(方法)源码代码实例,从而了解它的用法。

作者:CMS-CHIN    项目:duoshuo-plugins-dedecm   
function syncLog()
 {
     AjaxHead();
     header('Content-Type: application/json; charset=UTF-8');
     $duoshuoPlugin = Duoshuo_Dedecms::getInstance();
     $response = $duoshuoPlugin->syncLog();
     echo json_encode($response);
     exit;
 }

作者:BGCX26    项目:zyyhong-svn-to-gi   
<?php
@ob_start();
@set_time_limit(3600);
require_once(dirname(__FILE__)."/config.php");
CheckPurview('sys_description');
$tjnum = 0;
if($action=='getfields')
{
	AjaxHead();
	$dsql = new DedeSql(false);
	if(!$dsql->linkID){
		echo "<font color='red'>连接数据源的数据库失败!</font><br>";
		echo $qbutton;
		exit();
	}
	$channel = $dsql->getone("select addtable from #@__channeltype where ID=$channel");
	$channel = str_replace('#@__',$cfg_dbprefix,$channel['addtable']);
	$dsql->GetTableFields($channel);
	echo "<div style='border:1px solid #ababab;background-color:#FEFFF0;margin-top:6px;padding:3px;line-height:160%'>";
	echo "表(".$channel.")含有的字段:<br>";
	while($row = $dsql->GetFieldObject()){
		echo "<a href=\"javascript:pf('{$row->name}')\"><u>".$row->name."</u></a>\r\n";
	}
	echo "<input type='hidden' name='addtable' value='$channel' />";
	echo "</div>";
	$dsql->Close();
	exit();
}elseif($action == 'fetch')
{
	
	header("Content-Type: text/html; charset={$cfg_ver_lang}");

作者:healthgu    项目:PH   
function ac_rate()
 {
     $type = request('type', '');
     $rate = request('rate', '');
     $askaid = request('askaid', '');
     $askaid = is_numeric($askaid) ? $askaid : 0;
     $type = strip_tags($type);
     $rate = strip_tags($rate);
     if ($type == 'bad') {
         $rate = 'badrate';
     } else {
         $rate = 'goodrate';
     }
     $cookiename = 'rated' . $askaid;
     if (!isset($_COOKIE[$cookiename])) {
         $_COOKIE[$cookiename] = 0;
     }
     if (!$_COOKIE[$cookiename] == $askaid) {
         $this->answer->update_answer("{$rate}={$rate}+1", "id='{$askaid}'");
         makecookie($cookiename, $askaid, 3600);
     }
     $row = $this->answer->get_one("id='{$askaid}'", "goodrate, badrate");
     $goodrate = $row['goodrate'];
     $badrate = $row['badrate'];
     if ($goodrate + $badrate > 0) {
         $goodrateper = ceil($goodrate * 100 / ($badrate + $goodrate));
         $badrateper = 100 - $goodrateper;
     } else {
         $goodrateper = $badrateper = 0;
     }
     $total = $goodrate + $badrate;
     $aid = $askaid;
     AjaxHead();
     $poststr = "<dl>\r\n\t\t\t\t\t<dt><strong>您觉得最佳答案好不好? </strong></dt>\r\n\t\t\t\t\t<dd> <a href=\"#\"  onclick=\"rate('mark',{$askaid},'good')\"><img src=\"static/images/mark_g.gif\" width=\"14\" height=\"16\" />好</a> <span>{$goodrateper}% ({$goodrate})</span> </dd>\r\n                    <dd> <a href=\"#\"  onclick=\"rate('mark',{$askaid},'bad')\"><img src=\"static/images/mark_b.gif\" width=\"14\" height=\"16\" />不好</a> <span>{$badrateper}% ({$badrate})</span></dd>\r\n                    <dt>(目前有 {$total} 个人评价)</dt>\r\n\t\t\t\t   </dl>";
     echo $poststr;
 }

作者:soonfin    项目:lerea   
/**
  * caijixia for dedecms
  * @version        $Id: cjx.class.php 112 2013-05-28 01:22:57Z qinjinpeng $
  * @copyright Copyright (c) 2011,caijixia for dedecms,caijixia.com.
  * @license   This is NOT a freeware, use is subject to license terms
  *
  * @param     NULL
  * @return    NULL
 */
 function ac_gettask()
 {
     AjaxHead();
     $typeid = $this->gv('typeid');
     $rs = cjxdb('kwkeyword')->where("typeid={$typeid}")->Fields('`type`,`keyword`')->select();
     $keyword = $rss = $dx = $dxs = '';
     require_once DEDEINC . "/dedetag.class.php";
     $dtp = new DedeTagParse();
     foreach ($rs as $r) {
         if ($r['type'] == 0) {
             $keyword .= empty($keyword) ? $r['keyword'] : "\r\n" . $r['keyword'];
         } else {
             if ($r['type'] == 1) {
                 $rss .= empty($rss) ? $r['keyword'] : "\r\n" . $r['keyword'];
             } else {
                 if ($r['type'] == 2) {
                     $dx .= empty($dx) ? $r['keyword'] : "``" . $r['keyword'];
                     $dtp->LoadString($r['keyword']);
                     $dxt = $dtp->GetTagByName('list') ? $dtp->GetTagByName('list')->GetInnerText() : '';
                     $dxs .= "<span><a href='javascript:void(0);' style='float:right' onclick='delpage(this);'>删除</a><a href='javascript:void(0);' style='float:right' onclick='editpage(this);'>编辑&nbsp;</a>" . $dxt . "</span>";
                 } else {
                 }
             }
         }
     }
     $note = cjxdb('co_note')->Fields('nid,notename')->where('channelid=1')->select();
     foreach ($note as $k => $v) {
         $ck = cjxdb('kwkeyword')->where("`keyword`={$v['nid']} AND `type`=3")->find();
         if ($ck) {
             if ($ck['typeid'] == $typeid) {
                 $note[$k]['btype'] = true;
             } else {
                 $note[$k]['btype'] = $ck['typeid'];
             }
         }
         $note[$k]['channelname'] = '普通文章';
     }
     $this->assign('typeid', $typeid);
     $this->assign('keyword', $keyword);
     $this->assign('rss', $rss);
     $this->assign('dx', $dx);
     $this->assign('dxs', $dxs);
     $this->assign('notelist', $note);
     $this->display();
 }


问题


面经


文章

微信
公众号

扫码关注公众号