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


PHP xajaxResponse::addAppend方法代码示例

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


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

示例1: quote

function quote($pid)
{
    global $db, $pun_user;
    $objResponse = new xajaxResponse();
    $ret = "";
    $result = $db->query('SELECT poster, message FROM ' . $db->prefix . 'posts WHERE id=' . $pid) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
    $cur_post = $db->fetch_assoc($result);
    //  $quotemsg = utf8_encode("[quote=" . $cur_post['poster'] . "]" . $cur_post['message'] . "[/quote]\n");
    $quotemsg = "[quote=" . $cur_post['poster'] . "]" . $cur_post['message'] . "[/quote]\n";
    $objResponse->addAppend("req_message", "value", $quotemsg);
    $objResponse->addAssign("req_message", "style.height", "300px");
    return $objResponse->getXML();
}
开发者ID:neofutur,项目名称:MyBestBB,代码行数:13,代码来源:quote.server.php

示例2: BanMemberOfGroup

function BanMemberOfGroup($grpurl, $queue, $reason, $last)
{
    set_time_limit(0);
    $objResponse = new xajaxResponse();
    if ($GLOBALS['config']['config.enablegroupbanning'] == 0) {
        return $objResponse;
    }
    global $userbank, $username;
    if (!$userbank->HasAccess(ADMIN_OWNER | ADMIN_ADD_BAN)) {
        $objResponse->redirect("index.php?p=login&m=no_access", 0);
        $log = new CSystemLog("w", "Hacking Attempt", $username . " tried to ban group '" . $grpurl . "', but doesnt have access.");
        return $objResponse;
    }
    $bans = $GLOBALS['db']->GetAll("SELECT CAST(MID(authid, 9, 1) AS UNSIGNED) + CAST('76561197960265728' AS UNSIGNED) + CAST(MID(authid, 11, 10) * 2 AS UNSIGNED) AS community_id FROM " . DB_PREFIX . "_bans WHERE RemoveType IS NULL;");
    foreach ($bans as $ban) {
        $already[] = $ban["community_id"];
    }
    $doc = new DOMDocument();
    // This could be changed to use the memberlistxml
    // https://partner.steamgames.com/documentation/community_data
    // http://steamcommunity.com/groups/<GroupName>/memberslistxml/?xml=1
    // but we'd need to open every single profile of every member to get the name..
    $raw = file_get_contents("http://steamcommunity.com/groups/" . $grpurl . "/members");
    // get the members page
    @$doc->loadHTML($raw);
    // load it into a handy object so we can maintain it
    // the memberlist is paginated, so we need to check the number of pages
    $pagetag = $doc->getElementsByTagName('div');
    foreach ($pagetag as $pageclass) {
        if ($pageclass->getAttribute('class') == "pageLinks") {
            //search for the pageLinks div
            $pageclasselmt = $pageclass;
            break;
        }
    }
    $pagelinks = $pageclasselmt->getElementsByTagName('a');
    // get all page links
    $pagenumbers = array();
    $pagenumbers[] = 1;
    // add at least one page for the loop. if the group doesn't have 50 members -> no paginating
    foreach ($pagelinks as $pagelink) {
        $pagenumber = str_replace("?p=", "", $pagelink->childNodes->item(0)->nodeValue);
        // remove the get variable stuff so we only have the pagenumber
        if (strpos($pagenumber, ">") === false) {
            // don't want the "next" button ;)
            $pagenumbers[] = $pagenumber;
        }
    }
    $members = array();
    $total = 0;
    $bannedbefore = 0;
    $error = 0;
    for ($i = 1; $i <= max($pagenumbers); $i++) {
        // loop through all the pages
        if ($i != 1) {
            // if we are on page 1 we don't need to reget the content as we did above already.
            $raw = file_get_contents("http://steamcommunity.com/groups/" . $grpurl . "/members?p=" . $i);
            // open the memberpage
            @$doc->loadHTML($raw);
        }
        $tags = $doc->getElementsByTagName('a');
        foreach ($tags as $tag) {
            // search for the member profile links
            if ((strstr($tag->getAttribute('href'), "http://steamcommunity.com/id/") || strstr($tag->getAttribute('href'), "http://steamcommunity.com/profiles/")) && $tag->hasChildNodes() && $tag->childNodes->length == 1 && $tag->childNodes->item(0)->nodeValue != "") {
                $total++;
                $url = parse_url($tag->getAttribute('href'), PHP_URL_PATH);
                $url = explode("/", $url);
                if (in_array($url[2], $already)) {
                    $bannedbefore++;
                    continue;
                }
                if (strstr($tag->getAttribute('href'), "http://steamcommunity.com/id/")) {
                    // we don't have the friendid as this player is using a custom id :S need to get the friendid
                    if ($tfriend = GetFriendIDFromCommunityID($url[2])) {
                        if (in_array($tfriend, $already)) {
                            $bannedbefore++;
                            continue;
                        }
                        $cust = $url[2];
                        $steamid = FriendIDToSteamID($tfriend);
                        $urltag = $tfriend;
                    } else {
                        $error++;
                        continue;
                    }
                } else {
                    // just a normal friendid profile =)
                    $cust = NULL;
                    $steamid = FriendIDToSteamID($url[2]);
                    $urltag = $url[2];
                }
                $pre = $GLOBALS['db']->Prepare("INSERT INTO " . DB_PREFIX . "_bans(created,type,ip,authid,name,ends,length,reason,aid,adminIp ) VALUES\r\n\t\t\t\t\t\t\t\t\t(UNIX_TIMESTAMP(),?,?,?,?,UNIX_TIMESTAMP(),?,?,?,?)");
                $GLOBALS['db']->Execute($pre, array(0, "", $steamid, utf8_decode($tag->childNodes->item(0)->nodeValue), 0, "Steam Community Group Ban (" . $grpurl . ") " . $reason, $userbank->GetAid(), $_SERVER['REMOTE_ADDR']));
            }
        }
    }
    if ($queue == "yes") {
        $objResponse->addAppend("steamGroupStatus", "innerHTML", "<p>Banned " . ($total - $bannedbefore - $error) . "/" . $total . " players of group '" . $grpurl . "'. | " . $bannedbefore . " were banned already. | " . $error . " failed.</p>");
        if ($grpurl == $last) {
            $objResponse->addScript("ShowBox('Groups banned successfully', 'The selected Groups were banned successfully. For detailed info check below.', 'green', '', true);");
//.........这里部分代码省略.........
开发者ID:CodingDK,项目名称:SourceBans-Fork,代码行数:101,代码来源:sb-callback.php

示例3:

	function get_bhp_from_kunjungan($arr) {
		$objResponse = new xajaxResponse;
		$kon = new Konek;
		//get hak
		$data_hak = $_SESSION[igd][hak];

		for($j=0;$j<sizeof($arr);$j++) {
			$n = md5(microtime());
			$opt = "<select name=\"input_bhp_hak[]\" id=\"input_bhp_hak_".$n."\" class=\"inputan\" onkeypress=\"focusNext( 'input_bhp_biaya_".$n."', event, 'input_bhp_bayar_".$n."', this)\">";
			for($i=0;$i<sizeof($data_hak);$i++) {
				if($data_hak[$i][id] == $arr[$j][hak_id]) $opt .= "<option value=\"".$data_hak[$i][id]."\" selected=\"\">".$data_hak[$i][nama]."</option>";
				else $opt .= "<option value=\"".$data_hak[$i][id]."\">".$data_hak[$i][nama]."</option>";
			}
			$opt .= "</select>";
			
			//get sifat
			$data_sifat = $_SESSION[igd][sifat];
			$opt_sifat = "<select name=\"input_bhp_sifat[]\" id=\"input_bhp_sifat_".$n."\" class=\"inputan\" onchange=\"kaliKan2('input_bhp_bayar_".$n."', this.value, document.getElementById('input_bhp_biaya_".$n."').value, document.getElementById('input_bhp_jml_".$n."').value);\" onkeypress=\"focusNext( 'input_bhp_jml_".$n."', event, 'input_bhp_biaya_".$n."', this)\">";
			for($i=0;$i<sizeof($data_sifat);$i++) {
				if($data_sifat[$i][nilai] == $arr[$j][sifat]) $opt_sifat .= "<option value=\"".$data_sifat[$i][nilai]."\" selected=\"\">".$data_sifat[$i][nama]."</option>";
				else $opt_sifat .= "<option value=\"".$data_sifat[$i][nilai]."\">".$data_sifat[$i][nama]."</option>";
			}
			$opt_sifat .= "</select>";

			$ret .= "<tr id=\"input_bhp_tr_".$n."\">";
			$ret .= "<td>".$arr[$j][nama]."</td>";
			$ret .= "<td style=\"text-align:center;\">".$opt."</td>";
			$ret .= "<td style=\"text-align:right;\">";
			$ret .= "<input type=\"text\" name=\"input_bhp_biaya[]\" id=\"input_bhp_biaya_".$n."\" value=\"".$arr[$j][biaya]."\" class=\"inputan_angka\" size=\"10\" onkeyup=\"kaliKan('input_bhp_bayar_".$n."', this.value, document.getElementById('input_bhp_jml_".$n."').value);\" onkeypress=\"focusNext( 'input_bhp_sifat_".$n."', event, 'input_bhp_hak_".$n."', this)\" />";
			$ret .= "</td>";
			//SIFAT
			$ret .= "<td style=\"text-align:center;\">".$opt_sifat."</td>";
			$ret .= "<td style=\"text-align:center;\">";
			$ret .= "<input type=\"text\" name=\"input_bhp_jml[]\" id=\"input_bhp_jml_".$n."\" value=\"".$arr[$j][jumlah]."\" class=\"inputan_angka\" size=\"3\" onkeyup=\"kaliKan('input_bhp_bayar_".$n."', this.value, document.getElementById('input_bhp_biaya_".$n."').value);\" onkeypress=\"focusNext( 'input_bhp_bayar_".$n."', event, 'input_bhp_sifat_".$n."', this)\" />";
			$ret .= "</td>";
			$ret .= "<td style=\"text-align:right;\">";
			$ret .= "<input type=\"text\" name=\"input_bhp_bayar[]\" id=\"input_bhp_bayar_".$n."\" value=\"".$arr[$j][bayar]."\" class=\"inputan_angka\" size=\"10\" onkeypress=\"focusNext( 'input_bhp_hak_".$n."', event, 'input_bhp_jml_".$n."', this)\" />";
			$ret .= "</td>";
			$ret .= "<td><a href=\"javascript:void(0)\" title=\"Hapus BHP\" onclick=\"hapus_kunjungan_bayar('".$arr[$j][kunjungan_bayar_id]."','input_bhp_tr_".$n."')\" class=\"tombol_hapus\"><img src=\"".IMAGES_URL."remove.png\" alt=\"Hapus BHP\" border=\"0\" /></a>";
			$ret .= "<input type=\"hidden\" name=\"input_kunjungan_bhp_id[]\" id=\"input_kunjungan_bhp_id_".$n."\" value=\"".$arr[$j][kunjungan_bayar_id]."\" />";
			$ret .= "<input type=\"hidden\" name=\"input_bhp[]\" id=\"input_bhp_".$n."\" value=\"".$arr[$j][bhp_id]."\" />";
			$ret .= "<input type=\"hidden\" name=\"input_bhp_nama[]\" value=\"".$nama."\" />";
			$ret .= "</td>";
			$ret .= "<tr>";
		}
		$objResponse->addAppend("tbody_input_bhp", "innerHTML", $ret);
		return $objResponse;
	}
开发者ID:reekoheek,项目名称:srmis,代码行数:48,代码来源:kunjungan.modal.php

示例4: array

	function add_button_imunisasi($n, $val = array()) {
		if(!empty($val)) {
			$jml = sizeof($val);
			for($i=0;$i<$jml;$i++) {
				$ret .= "<li><a href=\"javascript:void(0)\" title=\"Edit Imunisasi\" onclick=\"buka_imunisasi('input_imunisasi_".$i."', '0')\"><img src=\"".IMAGES_URL."add.gif\" alt=\"\" border=\"0\" /></a>&nbsp;&nbsp;<a href=\"javascript:void(0)\" title=\"Hapus Imunisasi\" onclick=\"clear_imunisasi('input_imunisasi_".$i."')\"><img src=\"".IMAGES_URL."remove.png\" alt=\"\" border=\"0\" /></a>&nbsp;&nbsp;&nbsp;<span id=\"input_imunisasi_".$i."_nama\">".$val[$i][imunisasi_nama]."</span><input type=\"hidden\" name=\"input_kunjungan_imunisasi_id[]\" id=\"input_kunjungan_imunisasi_id_".$i."\" value=\"".$val[$i][kunjungan_imunisasi_id]."\" /><input type=\"hidden\" name=\"input_imunisasi[]\" id=\"input_imunisasi_".$i."\" value=\"".$val[$i][imunisasi_id]."\" /></li>";
			}
		} else {
			$jml = $n;
		}
		$ret .= "<li><a href=\"javascript:void(0)\" title=\"Add Imunisasi\" onclick=\"buka_imunisasi('input_imunisasi_".$jml."', '1')\"><img src=\"".IMAGES_URL."add.gif\" alt=\"\" border=\"0\" /></a>&nbsp;&nbsp;<a href=\"javascript:void(0)\" title=\"Hapus Imunisasi\" onclick=\"clear_imunisasi('input_imunisasi_".$jml."')\"><img src=\"".IMAGES_URL."remove.png\" alt=\"\" border=\"0\" /></a>&nbsp;&nbsp;&nbsp;<span id=\"input_imunisasi_".$jml."_nama\"></span><input type=\"hidden\" name=\"input_kunjungan_imunisasi_id[]\" id=\"input_kunjungan_imunisasi_id_".$jml."\" value=\"\" /><input type=\"hidden\" name=\"input_imunisasi[]\" id=\"input_imunisasi_".$jml."\" value=\"\" /></li>";
		
		$objResponse = new xajaxResponse;
		$objResponse->addAssign('jml_imunisasi', "value", ($jml+1));
		$objResponse->addAppend('tabel_input_imunisasi', "innerHTML", $ret);
		return $objResponse;
	}
开发者ID:reekoheek,项目名称:srmis,代码行数:16,代码来源:kunjungan.modal.php

示例5: refreshContent

function refreshContent($lastID, $userID, $num)
{
    global $_SESSION, $auth, $isModerator;
    if (!$num) {
        $num = 20;
    }
    $userID = $auth->user;
    $objResponse = new xajaxResponse();
    refreshUser($userID);
    $res = mysql_query("\n\t\t\tselect chat_messages.ID,ut_users.Login, chat_messages.Message, chat_messages.MessageTime, chat_messages.PrivateUserID,chat_messages.UserID\n\t\t\t\tfrom chat_messages,ut_users \n\t\t\t\twhere ut_users.UserID = chat_messages.UserID and chat_messages.ID>'{$lastID}' and (chat_messages.PrivateUserID='{$userID}' or chat_messages.UserID='{$userID}' or chat_messages.PrivateUserID=0) and chat_messages.UserID<>'{$userID}' order by chat_messages.ID desc limit {$num}");
    $newLastID = $lastID;
    $str = "";
    while ($data = mysql_fetch_array($res)) {
        if ($newLastID == $lastID) {
            $newLastID = $data[0];
        }
        $date = split(' ', $data[3]);
        $login = iconv('windows-1251', 'utf-8', $data[1]);
        $message = $data[2];
        if (!$data[4] || $data[4] && ($data[4] == $userID || $data[5] == $userID)) {
            $str = date("H:i", $data[3]) . " <a href='javascript:addUserToMessage(\"{$login}\", 0)' class=nickName" . ($data[4] ? "Private" : "") . ">" . $login . "</a>: <span class=chatMessage" . ($data[4] ? "Private" : "") . ">" . $message . "</span><br />" . $str;
            //if($isModerator) $str = "<a href='javascript:DeleteMessage(".$data[0].")' class=nickName>[X]</a> ".$str;
        }
    }
    if ($str) {
        $res2 = mysql_query("\n\t\t\tselect chat_messages.ID,ut_users.Login, chat_messages.Message, chat_messages.MessageTime, chat_messages.PrivateUserID,chat_messages.UserID\n\t\t\t\tfrom chat_messages,ut_users \n\t\t\t\twhere ut_users.UserID = chat_messages.UserID  and (chat_messages.PrivateUserID='{$userID}' or chat_messages.UserID='{$userID}' or chat_messages.PrivateUserID=0) order by chat_messages.ID desc limit {$num}");
        $str2 = "";
        while ($data = mysql_fetch_array($res2)) {
            if ($newLastID == $lastID) {
                $newLastID = $data[0];
            }
            $date = split(' ', $data[3]);
            $login = iconv('windows-1251', 'utf-8', $data[1]);
            $message = $data[2];
            if (!$data[4] || $data[4] && ($data[4] == $userID || $data[5] == $userID)) {
                $str2 = date("H:i", $data[3]) . " <a href='javascript:addUserToMessage(\"{$login}\", 0)' class=nickName" . ($data[4] ? "Private" : "") . ">" . $login . "</a>: <span class=chatMessage" . ($data[4] ? "Private" : "") . ">" . $message . "</span><br />" . $str2;
                //if($isModerator) $str2 = "<a href='javascript:DeleteMessage(".$data[0].")' class=nickName>[X]</a> ".$str2;
            }
        }
        if ($str2) {
            $_SESSION['chatcontent'] = $str2;
        }
    }
    //if($auth->user==455) $objResponse->addAlert("-- $isModerator");
    if ($newLastID) {
        $objResponse->addAssign("lastChatMessageID", "innerHTML", $newLastID);
    }
    if ($lastID) {
        $objResponse->addAppend("chatContent", "innerHTML", stripslashes($str));
    } else {
        $objResponse->addAssign("chatContent", "innerHTML", stripslashes($str2));
    }
    $userList = "";
    $res = mysql_query("select u.Login,u.UserID,c.LastRefresh,u.Rang,if(c.isModerator=1,1,0) isModerator ,s.BanTime ,\nu.GuildID,u.GuildStatusID from ut_users u,chat_users c left outer join chat_settings s on s.UserID=c.UserID where c.UserID=u.UserID");
    while ($data = mysql_fetch_array($res)) {
        $data1 = strtotime($data[2]);
        $data2 = time();
        $seconds = $data2 - $data1;
        if ($seconds > 600) {
            mysql_query("delete from chat_users where UserId={$data['1']}");
            continue;
        }
        $data[Login] = iconv('windows-1251', 'utf-8', htmlspecialchars($data[Login]));
        $nameUser = $data[Login];
        $login = $nameUser;
        //$login=username($data,0);
        if ($data[GuildID] && $data[GuildStatusID] == 1) {
            $login = guildlogo($data[GuildID], 0) . " " . $login;
        }
        if ($data[isModerator]) {
            $login = "<b>" . $login . "</b>";
        }
        $userList .= ($data[3] > 0 ? "<img src='http://www.butsa.ru/images/vip/{$data['3']}.gif' />&nbsp;" : "") . "<a href='javascript:addUserToMessage(\"{$nameUser}\", 0)'>{$login}</a> \n\t\t<a href='/users/{$data['1']}' >\n\t\t\t<img style='border:none;' src='/images/icons/profile.gif' align=absmiddle title='Info' alt='Info'></a>\n\t\t<a href='javascript:addUserToMessage(\"{$nameUser}\",1)' >\n\t\t\t<img style='border:none;' src='/images/icons/mail.gif' align=absmiddle  title='Private' alt='Private'></a>";
        if ($isModerator) {
            if (mktime() > $data[BanTime]) {
                $userList .= " <a href='javascript:BanUser(\"" . $data[UserID] . "\",\"{$nameUser}\",ban_time.value)' >[ban]</a><br>";
            } else {
                $userList .= " " . date("d.m.Y H:i", $data[BanTime]) . " - " . "<a href='javascript:UnBanUser(\"" . $data[UserID] . "\",\"{$nameUser}\")' >[unban]</a><br>";
            }
        } else {
            $userList .= "<br>";
        }
    }
    if ($userList) {
        $_SESSION['chatusers'] = $userList;
    }
    $objResponse->addAssign("chatUsersList", "innerHTML", $userList);
    $objResponse->addScript("scrollDown()");
    $objResponse->addScript("chatRefreshInterval = window.setInterval(\"refreshContent()\",3000);");
    $chatData = select("select count(*) from chat_users");
    $chatersCount = $chatData ? $chatData[0] : 0;
    $objResponse->addAssign("chatersCount", "innerHTML", $chatersCount);
    if (!$lastID) {
        $objResponse->addScript("chatContent.scrollTop=1000000;");
    }
    return $objResponse;
}
开发者ID:dapfru,项目名称:gladiators,代码行数:97,代码来源:chat.php

示例6: confirma_campo

function confirma_campo($valor_1, $valor_2, $campo, $campo_confirmacion)
{
    $respuesta = new xajaxResponse('utf-8');
    $pos = strpos($campo, "email");
    if ($pos == "") {
        //// si no es un email
    } else {
        //// si es un email se revisa
        $email = validar_email("{$valor_1}");
        if ($email === 0) {
            $respuesta->addAssign("{$campo}", "value", "");
            $respuesta->addAssign("{$campo}" . "_grupo", "className", " input-group has-error ");
            $respuesta->addAssign("{$campo_confirmacion}" . "_grupo", "className", " input-group has-error ");
            $respuesta->addAlert("El email no es valido ");
            $respuesta->addScript("document.getElementById('{$campo}').focus(); ");
            return $respuesta;
        } else {
        }
    }
    if ($valor_1 != $valor_2) {
        $resultado = "Los valores NO son iguales";
        $respuesta->addAlert("{$resultado}");
        ///	$respuesta->addAssign("$campo","style.color","red");
        $respuesta->addAssign("{$campo}", "value", "{$pos}");
        $respuesta->addAssign("{$campo_confirmacion}", "value", "");
        $respuesta->addAppend("{$campo}" . "_grupo", "className", " has-error ");
        $respuesta->addAppend("{$campo_confirmacion}" . "_grupo", "className", " has-error ");
        $respuesta->addScript("document.getElementById('{$campo}').focus(); ");
        //        document.getElementById('mobileno').focus();
    } else {
        $respuesta->addAssign("{$campo_confirmacion}", "style.color", "green");
        $respuesta->addAssign("{$campo}" . "_grupo", "className", " input-group has-success ");
        $respuesta->addAssign("{$campo_confirmacion}" . "_grupo", "className", " input-group has-success ");
    }
    return $respuesta;
}
开发者ID:kleper,项目名称:NuestraRED,代码行数:36,代码来源:funciones.php


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