/** * * 主动发送消息 * * @param string $content 内容 * @param string $openid 发送者用户名 * @param string $type 类型 * @return array 返回的信息 */ public function sendMsg($content, $openid = '', $type = 'text') { /* 基础数据 */ $this->send['touser'] = $openid; $this->send['msgtype'] = $type; /* 添加类型数据 */ $sendtype = 'send' . $type; $this->{$sendtype}($content); /* 发送 */ $sendjson = jsencode($this->send); $restr = $this->send($sendjson); return $restr; }
function displayListColumns($listFields, $record, $options = array()) { global $CURRENT_USER, $tableName, $schema; $showView = @$options['isRelatedRecords'] ? @$options['showView'] : !@$schema['_disableView']; $showModify = @$options['isRelatedRecords'] ? @$options['showModify'] : !@$schema['_disableModify']; $showErase = @$options['isRelatedRecords'] ? @$options['showErase'] : !@$schema['_disableErase']; $hasAuthorViewerAccessOnly = userSectionAccess($tableName) == 7; $hasViewerAccessOnly = userSectionAccess($tableName) == 3; // remove modify/erase for users with view only access -OR- with Author/Viewer access who don't own the record if ($hasViewerAccessOnly) { $showModify = false; $showErase = false; } if ($hasAuthorViewerAccessOnly) { $showModify = $showModify && ($record['createdByUserNum'] && $record['createdByUserNum'] == $CURRENT_USER['num']); $showErase = $showErase && ($record['createdByUserNum'] && $record['createdByUserNum'] == $CURRENT_USER['num']); } // checkboxes - for "Advanced Commands" pulldown if (!@$options['isRelatedRecords']) { print "<td>"; if (@$schema['num']) { print "<input type='checkbox' name='selectedRecords[]' value='{$record['num']}' class='selectRecordCheckbox' />"; } print "</td>\n"; } // category sections - add up/down sorting links and drag field if (@$schema['menuType'] == 'category' && !@$options['isRelatedRecords']) { // $tableNameJsEncoded = jsencode($tableName); $upClick = "return redirectWithPost('?', {menu:'{$tableNameJsEncoded}', _action:'categoryMove', 'direction':'up', 'num':'{$record['num']}', '_CSRFToken': \$('[name=_CSRFToken]').val()});"; $dnClick = "return redirectWithPost('?', {menu:'{$tableNameJsEncoded}', _action:'categoryMove', 'direction':'down', 'num':'{$record['num']}', '_CSRFToken': \$('[name=_CSRFToken]').val()});"; // print "<td class='dragger'>"; print "<img src='lib/images/drag.gif' height='6' width='19' title='" . t('Click and drag to change order.') . "' alt='' />"; print "<a href='#' onclick=\"{$upClick}\"><!-- " . t('UP') . ' --></a>'; print "<a href='#' onclick=\"{$dnClick}\"><!-- " . t('DN') . ' --></a>'; print "</td>"; } // display all other fields foreach ($listFields as $fieldnameWithSuffix) { @(list($fieldname, $suffix) = explode(":", $fieldnameWithSuffix)); // to support fieldname:label if ($fieldnameWithSuffix == 'dragSortOrder') { if (@$options['isRelatedRecords'] && !@$GLOBALS['SETTINGS']['advanced']['allowRelatedRecordsDragSorting']) { continue; } if ($hasViewerAccessOnly) { continue; } if (!userHasFieldAccess($schema[$fieldname])) { continue; } // skip fields that the user has no access to } list($displayValue, $tdAttributes) = _getColumnDisplayValueAndAttributes($fieldname, $record); $displayValue = applyFilters('listRow_displayValue', $displayValue, $tableName, $fieldname, $record); $tdAttributes = applyFilters('listRow_tdAttributes', $tdAttributes, $tableName, $fieldname, $record); print "<td {$tdAttributes}>{$displayValue}</td>\n"; } ### display actions $actionLinks = ''; // view if ($showView) { $viewLink = '?menu=' . htmlencode($tableName) . "&action=view&num=" . @$record['num']; if (@$options['isRelatedRecords']) { $viewLink .= "&returnUrl=" . urlencode('?' . $_SERVER['QUERY_STRING']); } $actionLinks .= "<a href='{$viewLink}'>" . t('view') . "</a>\n"; } // modify if ($showModify) { $modifyLink = '?menu=' . htmlencode($tableName) . "&action=edit&num=" . @$record['num']; if (@$options['isRelatedRecords']) { $modifyLink .= "&returnUrl=" . urlencode('?' . $_SERVER['QUERY_STRING']); } $actionLinks .= "<a href='{$modifyLink}'>" . t('modify') . "</a>\n"; } // erase if ($showErase) { $returnArg = @$options['isRelatedRecords'] ? ',' . htmlencode(json_encode('?' . urlencode($_SERVER['QUERY_STRING']))) : ''; $disableErase = $tableName == 'accounts' && $CURRENT_USER['num'] == $record['num']; $eraseLink = "javascript:confirmEraseRecord('" . htmlencode($tableName) . "','" . @$record['num'] . "'{$returnArg});"; if ($disableErase) { $actionLinks .= "<span class='disabled'>" . t('erase') . "</span>\n"; } else { $actionLinks .= "<a href=\"{$eraseLink}\">" . t('erase') . "</a>\n"; } } // $actionLinks = applyFilters('listRow_actionLinks', $actionLinks, $tableName, $record); // show erase link print "<td class='listActions'>{$actionLinks}</td>"; }
echo $memberinfo["email"]; ?> "></div> <?php if ($num_currencies > 1) { ?> <script> cur_prefix = []; <?php foreach ($currencies as $code => $currency) { ?> cur_prefix['<?php echo $code; ?> '] = '<?php echo jsencode(htmlentities($currency["prefix"])); ?> '; <?php } ?> </script> <div>Currency: <select name=currency onChange="document.getElementById('currency_prefix').innerHTML = cur_prefix[this.value]"> <?php foreach ($currencies as $code => $currency) { ?> <option value="<?php echo $code; ?> "<?php
/** * 微信开放平台接口7:设置授权方的选项信息 * 该API用于设置授权方的公众号的选项信息,如:地理位置上报,语音识别开关,多客服开关。注意,设置各项选项设置信息,需要有授权方的授权,详见权限集说明。 * @param $option_name选项名称,$option_value选项值 * @param string $auth_appid 授权方appid * @param string $component_access_token 组件access_token * $option_value,location_report(0:无上报,1:进入会话时上报,2:每5s上报), * voice_recognize(0:关闭语音识别,1:开启语音识别) * customer_service(0:关闭多客服,1:开启多客服) */ public function setAutherOptionInfo($component_appid = '', $component_access_token = '', $authorizer_appid = '', $option_name = '', $option_value = '') { $url = "https://api.weixin.qq.com/cgi-bin/component/ api_set_authorizer_option?component_access_token=" . $component_access_token; $params = array('component_appid' => $component_appid, 'authorizer_appid' => $authorizer_appid, "option_name" => $option_name, "option_value" => $option_value); $jsoninfo = jsencode($params); $httpinfo = http($url, $jsoninfo, 'POST', $this->header, true); $jsonresult = $this->parseJson($httpinfo); return $jsonresult; }
echo htmlentities($projinfo["name"]); ?> </span> <?php if ($username && $projinfo["lead"] === $username) { ?> <a href="javascript:rename()" style="font-size:x-small">(rename)</a> <script> function rename() { var newname = prompt('Please enter the new project name', '<?php echo jsencode($projinfo["name"]); ?> '); if( newname != null && newname != '<?php echo jsencode($projinfo["name"]); ?> ') { if( confirm("Are you sure you want to rename "+ "the project to '"+newname+"'?")) { document.location = '<?php echo projurl($id, "tab=" . urlencode($_REQUEST["tab"]) . "&newname="); ?> '+encodeURI(newname); } } } </script> <?php if ($projinfo["status"] === 'pending' && !$projinfo["delete_time"]) { list($rc, $subprojects) = ff_getsubprojects($id);
{ TinyMCE_Compressor::renderTag($options); } // alias function for old PHP4 support (used in old wysiwyg_custom.php files) // v2.51 // END MODIFICATIONS // Handle incoming request if it's a script call if (TinyMCE_Compressor::getParam("js")) { // Check for accidentally added whitespace or other output (by end users) - extra linebreaks at the end of library or plugin files // ... can cause ajax calls to fail (whitespace is interpreted as error message and returned in 'blank' popups) or gzip output to // ... become corrupted. Note that server behaviour will vary based on output_buffering another other settings (search "output" in phpinfo) if (headers_sent($headerSentFile, $headersSentLine)) { // check if output was sent anyways (such as if it exceeded output_buffer bytes) $error = "WYSIWYG Error: Unexpected output was sent by the following file:\n"; $error .= htmlencode(@$headerSentFile) . " (on line " . htmlencode(@$headersSentLine) . ").\n"; $error .= "Developers: Check for accidentally added whitespace or other characters.\n"; $error = "alert('" . jsencode($error) . "');\n"; die($error); } // Turn off any existing compression or buffering set by the web server configuration (we do compression manually below) ini_set('zlib.output_compression', 0); // disable compression headers while (@ob_end_clean()) { } // disable any and all output buffers of anything added by init.php, plugins, or libraries, etc (We're not expecting anything here) // Default settings $tinyMCECompressor = new TinyMCE_Compressor(array()); // Handle request, compress and stream to client $tinyMCECompressor->handleRequest(); } /** * This class combines and compresses the TinyMCE core, plugins, themes and
/** * 生成菜单 */ public function setmenu() { $sub = array(); $data = array(); $subs = array(); $app_id = C("WECHAT_APPID"); $redirect_uri = U('home/index'); $site_url = C("SITE_URL"); $subs3[] = array('type' => 'view', 'name' => '绑定', 'url' => $site_url . U('wechat/oauth')); $subs3[] = array('type' => 'click', 'name' => '解除绑定', 'key' => 'unauth'); $subs3[] = array('type' => 'click', 'name' => '推送设置', 'key' => 'ites_set'); $oauth_url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid={$app_id}&redirect_uri={$site_url}{$redirect_uri}&response_type=code&scope=snsapi_base&state=123#wechat_redirect"; $sub1 = array('type' => 'view', 'name' => 'OA', 'url' => $oauth_url); $sub2 = array('type' => 'click', 'name' => '签到', 'key' => 'sign_up'); $sub3 = array('name' => '帮助', 'sub_button' => $subs3); $data['button'][] = $sub1; $data['button'][] = $sub2; $data['button'][] = $sub3; $data = jsencode($data); /* 加载微信SDK */ import("@.ORG.Util.ThinkWechat"); $weixin = new ThinkWechat(); echo $weixin->setMenu($data); }
echo 9 - $currency["decimal_places"]; ?> ); newHTML='<?php echo jsencode($currency["prefix"]); ?> '+total+" per month"; if( total != document.getElementById('a3').value) { document.getElementById('a3').value = total; document.getElementById('subscribe').value = total; } var custom = '<?php echo jsencode($username); ?> ///'+sponsorships+'/<?php echo jsencode($draftid); ?> '; if( custom != document.getElementById('custom').value) { document.getElementById('custom').value = custom; } } if( newHTML != totalObj.innerHTML) { totalObj.innerHTML = newHTML; } return error; } function recalcLoop() {
<div class="bottom"> <a href="" onClick="if(checkReserveSponsorshipForm())document.getElementById('reserve-form').submit();return false" class="normal-button" style="float:right;">Sponsor from Reserve</a> </div> </form> <script> function checkPayPalSponsorshipForm() { var amt = document.getElementById('paypal_amt').value; if( amt == '' || !amt.match( /^[0-9]*(\.<?php echo str_repeat("[0-9]", $prefcurrency["decimal_places"]); ?> )?$/) || ''+Number(amt) == 'NaN') { alert('Please enter the sponsorship amount in '+ '<?php echo jsencode($prefcurrency["name"]); ?> s.'); return false; } if( amt.match( /[0-9]{<?php echo 9 - $prefcurrency["decimal_places"]; ?> }/)) { alert('Due to system limitations, the largest sponsorship '+ 'we accept is <?php echo format_money("999999999{$prefcurrency['code']}"); ?> .'); return false;
Are you sure you want to transfer <?php echo $_REQUEST["amount"]; echo $_REQUEST["currency_code"]; ?> from your fake PayPal account? <?php } } } } foreach ($_REQUEST as $key => $value) { ?> <input type=hidden name="<?php echo htmlentities($key); ?> " value="<?php echo htmlentities($value); ?> "> <?php } ?> <input type=submit name="really_do_it" value="Yes"> <input type=submit value="No" onClick="document.location='<?php echo jsencode($_REQUEST["cancel_return"]); ?> ';return false"> </form> </body> </html>
/** * 生成菜单 */ public function setmenu() { $sub = array(); $data = array(); $subs = array(); $subs1[] = array('type' => 'click', 'name' => '我申请的任务', 'key' => 'apply_task'); $subs1[] = array('type' => 'click', 'name' => '邀请我的任务', 'key' => 'invite_task'); $subs1[] = array('type' => 'click', 'name' => '待评价的任务', 'key' => 'comment_task'); $subs2[] = array('type' => 'click', 'name' => '适合我的任务', 'key' => 'fit_task'); $subs2[] = array('type' => 'view', 'name' => '任务检索', 'url' => 'http://www.马赛克.com/wechat/search/'); $subs3[] = array('type' => 'click', 'name' => '功能介绍', 'key' => 'ites_intro'); $subs3[] = array('type' => 'view', 'name' => '意见反馈', 'url' => 'http://www.马赛克.com/wechat/feedback/'); $subs3[] = array('type' => 'click', 'name' => '工程师联盟认证', 'key' => 'ites_verify'); $subs3[] = array('type' => 'click', 'name' => '信息推送设置', 'key' => 'ites_set'); $sub1 = array('name' => '任务管理', 'sub_button' => $subs1); $sub2 = array('name' => '任务查询', 'sub_button' => $subs2); $sub3 = array('name' => '系统功能', 'sub_button' => $subs3); $data['button'][] = $sub1; $data['button'][] = $sub2; $data['button'][] = $sub3; $data = jsencode($data); /* 加载微信SDK */ import("@.ORG.Util.ThinkWechat"); $weixin = new ThinkWechat(); echo $weixin->setMenu($data); }
function show_body($topicid, $post, $openids = false) { $body = $post["body"]; $diff = ''; if (ereg("^(.*)\n/-/-/-/-/-begin-diff-/-/-/-/-/\n(.*)\$", $body, $args)) { $body = $args[1]; $diff = $args[2]; } $body = linkify(str_replace("\n", "<br />\n", trim(htmlentities($body)))); //check if post has attachments if (sizeof($post['attachments']) > 0) { list($rc, $body) = ff_attachtobody($post['id'], $body); } print $body; if ($diff) { include_once "diff.php"; print "<hr>\n"; print formatDiff($diff); } if (sizeof($post['attachments']) > 0) { print "<br>\n"; print "<b>attachments:</b><br>\n"; list($rc, $err) = ff_listattachments($post['id']); } $subject = $post["subject"]; $subject = ereg_replace("^[rR][eE]:? *", "", $subject); $subject = "Re: {$subject}"; print "<br>\n"; print "<div class=postfooter>"; print "[ <a href=\"javascript:inlinepost('{$topicid}','{$post['id']}','{$topicid}_field{$post['id']}','" . htmlentities(jsencode("Re: " . ereg_replace("^[rR][eE]:? *", "", $post["subject"]))) . "','{$GLOBALS['username']}')\">Reply to This</a> ]"; // If the post status is pending and the lead is viewing, // offer the Accept / Reject options. if ($post['status'] == 'pending') { $projectid = substr($post['topicid'], 6); list($rc, $projinfo) = ff_getprojectinfo($projectid); if ($GLOBALS['username'] == $projinfo['lead'] && $GLOBALS['username'] !== "") { // If a requirements change dispute is deliberating then // the lead can't accept this proposal. list($rc, $disputes) = ff_getprojectdisputes($projectid); if ($rc) { $disputes = array(); } $canaccept = 1; foreach ($disputes as $dispute) { if ($dispute["type"] == 'badchange' && $dispute["status"] == 'deliberating') { $canaccept = 0; break; } } print "[ <a href=\"handlechange.php?project={$projectid}&accept=1&post={$post['id']}\"" . ($canaccept ? "" : " onClick=\"alert('You can\\'t accept requirements changes while a\\nchange dispute is in deliberation. Please try again later.');return false\"") . "> Accept </a> ]"; print "[ <a href=\"handlechange.php?project={$projectid}&accept=0&post={$post['id']}\"> Reject </a> ]"; } } print "</div>"; print "<div id={$topicid}_field{$post['id']}></div>"; print "<div id={$topicid}_attachment{$post['id']} align='right'></div>"; if (sizeof($post["children"])) { print "<div class=postindent>"; show_thread($topicid, $post["children"], 0, $openids); print "</div>\n"; } }
doAction('admin_head'); ?> </head> <?php // make PHP constants available to Javascript as needed ?> <script> // Example: phpConstant('CMS_ASSETS_URL') + "/path/to/file.js"; function phpConstant(cname) { if (cname == 'PREFIX_URL') { return "<?php echo jsencode(PREFIX_URL); ?> "; } else if (cname == 'CMS_ASSETS_URL') { return "<?php echo jsencode(CMS_ASSETS_URL); ?> "; } else { alert("phpConstant: Unknown constant name '" +cname+ "'!"); return ''; } } </script> <body class="simpla"> <div id="body-wrapper"> <!-- Wrapper for the radial gradient background --> <?php include "lib/menus/sidebar.php";
$curpost =& $top; } else { $curpost =& $curpost["children"][$ancestor]; } list($rc, $curpost["children"]) = ff_getposts(false, $curpost["id"], 1); $openids[$ancestor] = 1; } show_body($topicid, $top, $openids); $html = ob_get_contents(); ob_end_clean(); ?> parent.document.getElementById('postbody<?php echo $topid; ?> ').innerHTML='<?php echo jsencode($html); ?> '; parent.document.getElementById('arrow<?php echo $topid; ?> ').src='arrow-down.gif'; parent.unfolding = ''; o = parent.document.getElementById('arrow<?php echo $postid; ?> '); var y=0; while (o.offsetParent) { y+=o.offsetTop; o=o.offsetParent;
'] = '<?php echo jsencode($currency["name"]); ?> '; toobig_regex['<?php echo $code; ?> '] = /[0-9]{<?php echo 9 - $currency["decimal_places"]; ?> }/; max_amt['<?php echo $code; ?> '] = '<?php echo jsencode(format_money("999999999{$code}")); ?> '; <?php } ?> var amt = document.getElementById('retract_sponsor_amt').value; var c = document.getElementById('r_currency').value; if( amt == '' || Number(amt) == 0 || !amt.match( amt_regex[c]) || ''+Number(amt) == 'NaN') { alert('Please enter the retraction amount in '+cur_name[c]+'s.'); return false; } if( Number(amt) > n_sponsorship_amt[c]) { alert('You have requested more funds than are available to retract.\n'+ 'Please enter a smaller amount.');
// workaround for an old bug @mkdir($destdir); @touch($destdir); // So we don't delete it too soon // Choose a tmp filename $tempnam = tempnam($destdir, "attach"); //keep track of the number of files attached $rc = @rename($_FILES['attachment']['tmp_name'], $tempnam); if ($rc === false) { print "<script>\n"; print "alert('There was a problem processing the attachment.');"; print "</script>\n"; } else { //we add the attachment to a queue of attachments in forum.js print "<script>\n"; print "parent.addattachment('" . scrub($_REQUEST["uniq"]) . "','" . jsencode(basename($tempnam)) . "','" . jsencode($_FILES['attachment']['name']) . "'," . intval($_FILES['attachment']['size']) . ");\n"; print "</script>\n"; } } else { print "<script>\n"; print "alert('There was a problem processing the attachment.');"; print "</script>\n"; } } ?> <form method="post" enctype="multipart/form-data" style="margin:0em;padding:0em"> <input type=hidden name="MAX_FILE_SIZE" value ="10000000"> <input type=hidden name=uniq value="<?php echo scrub($_REQUEST["uniq"]); ?> ">