本文整理汇总了PHP中toArray函数的典型用法代码示例。如果您正苦于以下问题:PHP toArray函数的具体用法?PHP toArray怎么用?PHP toArray使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了toArray函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: toArray
function toArray($xml)
{
if (is_string($xml)) {
$xml = new SimpleXMLElement($xml);
}
$children = $xml->children();
if (!$children) {
return (string) $xml;
}
$arr = array();
foreach ($children as $key => $node) {
$node = toArray($node);
// support for 'anon' non-associative arrays
if ($key == 'anon') {
$key = count($arr);
}
// if the node is already set, put it into an array
if (isset($arr[$key])) {
if (!is_array($arr[$key]) || $arr[$key][0] == null) {
$arr[$key] = array($arr[$key]);
}
$arr[$key][] = $node;
} else {
$arr[$key] = $node;
}
}
return $arr;
}
开发者ID:alexsharma68,项目名称:helios-ats-importer,代码行数:28,代码来源:helios-ajax.php
示例2: SaveCategory
/**
* Saves a category to the database
* Or updates an existing category
*
* @url POST /
* @url PUT /$id
*/
public function SaveCategory($id = null, $data)
{
// Only process valid data
if ($this->ValidateCategory($data)) {
// Format for update/insert query
$dbData = array('name' => $data->Name);
// Update existing user?
if ($id) {
$this->Db()->where('id', $id);
if ($this->Db()->update('Categories', $dbData)) {
$category = new CategoryModel($id, $data->Name);
} else {
throw new RestException(500, 'Update mislukt: ' . $this->Db()->getLastError());
}
// Add new user
} else {
$id = $this->Db()->insert('Categories', $dbData);
if ($id) {
$category = new CategoryModel($id, $data->Name);
} else {
throw new RestException(500, 'Toevoegen mislukt: ' . $this->Db()->getLastError());
}
}
return $category > toArray();
}
}
开发者ID:nielswitte,项目名称:PitchHitRun,代码行数:33,代码来源:CategoriesController.php
示例3: parseWebVTT
function parseWebVTT($captionUrl = NULL, $descUrl = NULL)
{
if ($captionUrl) {
$captionFile = @file_get_contents($captionUrl);
if ($captionFile) {
$captionArray = toArray('captions', $captionFile);
} else {
echo '1';
// unable to read caption file;
}
if ($descUrl) {
$descFile = @file_get_contents($descUrl);
if ($descFile) {
$descArray = toArray('desc', $descFile);
} else {
// do nothing
// description file is not required
}
}
if (sizeof($captionArray) > 0) {
writeOutput($captionArray, $descArray);
} else {
// do nothing
// an error has occurred (and hopefully an error code was displayed)
}
} else {
echo '0';
// insuficcient parameters were passed by URL
}
}
开发者ID:ideasatrandom,项目名称:ableplayer,代码行数:30,代码来源:ableplayer-transcript-maker.php
示例4: testFindAllUsersByDepartmentAndRoles
public function testFindAllUsersByDepartmentAndRoles()
{
$this->users = $this->em->getRepository('AppBundle:User')->findAllUsersByDepartmentAndRoles(1, $this->em->getRepository('AppBundle:Role')->findOneByRole('ROLE_USER'));
foreach ($this->users as $this->user) {
$this->assertEquals(1, $this->user->getFieldOfStudy()->getDepartment()->getId());
$this->assertContains(toArray('ROLE_USER'), $this->user->getRoles());
}
}
开发者ID:vegardbb,项目名称:webpage,代码行数:8,代码来源:UserRepositoryFunctionalTest.php
示例5: importUsers
function importUsers($users, $questions)
{
$rows = array();
foreach ($users as $user)
{
$username = arrayExtract($user, "username");
if(!$username) continue;
$username = str_replace(" ", "", $username);
if(!$username) continue;
//1 insert into user
$userRow = array();
$userRow["table"] = "user";
$userRow["username"] = $username;
$userRow["password"] = md5($username);
$rows[] = $userRow;
//2 insert into user_answer 1 row per user column
foreach ($user as $column => $userValues)
{
if(!isset($questions[$column]) || !$userValues) continue;
$q = $questions[$column];
//TODO: if question type == multiple, $userValue is array: insert several rows
$userValues = toArray($userValues, ";");
foreach ($userValues as $key => $userValue)
{
$row = array();
$row["table"] = "user_answer";
$row["username"] = $username;
// $row["field"] = $column;
// $row["value"] = $userValue;
$row["question_id"] = $q["id"];
$answer = findAnswer($q, $userValue);
if($answer)
{
$row["answer_id"] = $answer["id"];
// $row["answer"] = $answer;
if(@$answer["value"])
$row["answer_value"] = $answer["value"];
else if(@$answer["data_type"] == "number")
$row["answer_value"] = $userValue;
else if(@$answer["data_type"] == "text")
$row["answer_text"] = $userValue;
}
else if(@$q["data_type"] == "number")
$row["answer_value"] = $userValue;
else if(@$q["data_type"] == "text")
$row["answer_text"] = $userValue;
if(@$row["answer_id"] || @$row["answer_text"] || @$row["answer_value"])
$rows[] = $row;
}
}
}
return $rows;
}
开发者ID:araynaud,项目名称:FoodPortrait,代码行数:58,代码来源:import_functions.php
示例6: submit
function submit($option)
{
global $stack, $mainframe;
// get values from gui of script
$website = JRequest::getVar('http_host', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
if (substr($website, -1) != "/") {
$website = $website . "/";
}
$page_root = JRequest::getVar('document_root', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$sitemap_file = $page_root . JRequest::getVar('sitemap_url', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$sitemap_url = $website . JRequest::getVar('sitemap_url', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$sitemap_form = JRequest::getVar('sitemap_url', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$priority = JRequest::getVar('priority', '1.0', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$forbidden_types = toArray(JRequest::getVar('forbidden_types', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML));
$exclude_names = toArray(JRequest::getVar('exclude_names', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML));
$freq = JRequest::getVar('freq', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$modifyrobots = JRequest::getVar('robots', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$method = JRequest::getVar('method', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$level = JRequest::getVar('levels', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$maxcon = JRequest::getVar('maxcon', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$timeout = JRequest::getVar('timeout', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$whitelist = JRequest::getVar('whitelist', 'none', 'POST', 'STRING', JREQUEST_ALLOWHTML);
$priority >= 1 ? $priority = "1.0" : null;
$xmlconfig = genConfig($priority, $forbidden_types, $exclude_names, $freq, $method, $level, $maxcon, $sitemap_form, $page_root, $timeout);
if (substr($page_root, -1) != "/") {
$page_root = $page_root . "/";
}
$robots = @JFile::read($page_root . 'robots.txt');
preg_match_all("/Disallow:(.*?)\n/", $robots, $pos);
if ($exclude_names[0] == "") {
unset($exclude_names[0]);
}
foreach ($pos[1] as $disallow) {
$disallow = trim($disallow);
if (strpos($disallow, $website) === false) {
$disallow = $website . $disallow;
}
$exclude_names[] = $disallow;
}
$forbidden_strings = array("print=1", "format=pdf", "option=com_mailto", "component/mailto", "/mailto/", "mailto:", "login", "register", "reset", "remind");
foreach ($exclude_names as $name) {
$name != "" ? $forbidden_strings[] = $name : null;
}
$stack = array();
$s = microtime(true);
if ($whitelist == "yes") {
AntiFloodControl($website);
}
$file = genSitemap($priority, getlinks($website, $forbidden_types, $level, $forbidden_strings, $method, $maxcon, $timeout), $freq, $website);
writeXML($file, $sitemap_file, $option, $sitemap_url);
writeXML($xmlconfig, $page_root . "/administrator/components/com_jcrawler/config.xml", $option, $sitemap_url);
$mainframe->enqueueMessage("total time: " . round(microtime(true) - $s, 4) . " seconds");
if ($modifyrobots == 1) {
modifyrobots($sitemap_url, $page_root);
}
HTML_jcrawler::showNotifyForm($option, $sitemap_url);
}
开发者ID:albertobraschi,项目名称:Hab,代码行数:57,代码来源:admin.jcrawler.php
示例7: check_fee
public function check_fee()
{
$sms = new transport();
$params = array("OperID" => $this->sms['user_name'], "OperPass" => $this->sms['password']);
$url = "http://221.179.180.158:9000/QxtSms/surplus";
$result = $sms->request($url, $params);
$result = toArray($result['body'], "resRoot");
$str = "企信通短信平台,剩余:" . $result['rcode'][0] . "条";
return $str;
}
开发者ID:xcdxcd,项目名称:zhongchou,代码行数:10,代码来源:QXT_sms.php
示例8: index
public function index(array $params)
{
// the page of planets we are looking at
$page = array_val($params, 'page', 1);
// get a list of the planets (for this page)
list($pagination, $planet_models) = get_paginated_models('planet', $page);
$pagination['base_url'] = '/planet/';
$planet_data = toArray($planet_models);
$tpl_vars = array('pagination' => $pagination, 'planets' => $planet_data);
v('page/planet/planet_list', $tpl_vars);
}
开发者ID:Tapac,项目名称:hotscot,代码行数:11,代码来源:planet.php
示例9: toArray
function toArray($xml)
{
$array = json_decode(json_encode($xml), TRUE);
foreach (array_slice($array, 0) as $key => $value) {
if (empty($value)) {
$array[$key] = NULL;
} elseif (is_array($value)) {
$array[$key] = toArray($value);
}
}
return $array;
}
开发者ID:natanshalva,项目名称:php-project,代码行数:12,代码来源:readxml.php
示例10: objectToArray
function objectToArray($object)
{
if (is_array($object)) {
foreach ($object as $k => $v) {
if (is_object($v)) {
$object[$k] = toArray($v);
}
}
} else {
$object = toArray($object);
}
return $object;
}
开发者ID:Soul0806,项目名称:MyWeb,代码行数:13,代码来源:app_helper.php
示例11: inhabitant_dialog
public function inhabitant_dialog(array $params)
{
$tpl_vars = array();
$planets = get_models('planet');
$tpl_vars['planets'] = toArray($planets);
// are we editing an existing inhabitant
if ($inhabitantID = array_val($params, 'inhabitantID')) {
$inhabitant = m('inhabitant', $inhabitantID);
$tpl_vars['inhabitantID'] = $inhabitant->getID();
$tpl_vars['name'] = $inhabitant->get_name();
$tpl_vars['inhabitant_planet'] = $inhabitant->get_planet()->toArray();
}
v('partial/inhabitant/inhabitant_form', $tpl_vars);
}
开发者ID:Tapac,项目名称:hotscot,代码行数:14,代码来源:inhabitant.php
示例12: toArray
function toArray($obj)
{
if (is_object($obj)) {
$obj = (array) $obj;
}
if (is_array($obj)) {
$new = array();
foreach ($obj as $key => $val) {
$new[$key] = toArray($val);
}
} else {
$new = $obj;
}
return $new;
}
开发者ID:andrinda,项目名称:php-backend-generator,代码行数:15,代码来源:fungsi.php
示例13: insertQuestion
function insertQuestion($varname, $vardesc, $vartype, $club_id, $database, $whereString)
{
//basic error checking
include_once includePath() . "/apply_gen.php";
$typeArray = toArray($vartype);
if (!isset($typeArray['type'])) {
return "type map does not contain required 'type' attribute";
}
if ($typeArray['type'] == "select" && $vardesc == '') {
return "description (required for select) left blank";
}
//add spaces to type array
$vartype = str_replace(";", "; ", $vartype);
$vartype = str_replace("|", "| ", $vartype);
if ($database != "supplements" && $database != "baseapp" && $database != "custom") {
return "internal error: invalid database {$database}";
}
$varname = escape($varname);
$vardesc = escape($vardesc);
$vartype = escape($vartype);
$club_id = escape($club_id);
//increment from highest orderId
$result = mysql_query("SELECT MAX(orderId) FROM {$database} WHERE {$whereString}");
if ($row = mysql_fetch_array($result)) {
if (is_null($row[0])) {
$orderId = 1;
} else {
$orderId = escape($row[0] + 1);
}
if ($database != "supplements") {
mysql_query("INSERT INTO {$database} (orderId, varname, vardesc, vartype, category) VALUES ('{$orderId}', '{$varname}', '{$vardesc}', '{$vartype}', '" . $_SESSION['category'] . "')");
} else {
mysql_query("INSERT INTO supplements (orderId, varname, vardesc, vartype, club_id) VALUES ('{$orderId}', '{$varname}', '{$vardesc}', '{$vartype}', '{$club_id}')");
}
return true;
} else {
return "internal error";
//this shouldn't occur, since MAX would return null if no rows are found
}
}
开发者ID:uakfdotb,项目名称:oneapp,代码行数:40,代码来源:apply_admin.php
示例14: latexAppendQuestion
function latexAppendQuestion($name, $desc, $type, $answer)
{
$typeArray = getTypeArray($type);
$question_string = "";
if ($typeArray['type'] == "text") {
if ($name != "") {
$question_string .= '\\textbf{' . latexSpecialChars($name) . '}';
//add main in bold
}
if ($desc != "") {
if ($name != "") {
$question_string .= '\\newline';
}
$question_string .= '\\emph{' . latexSpecialChars($desc) . '}';
//add description in italics
}
$question_string .= '\\newline\\newline';
return $question_string;
} else {
if ($typeArray['type'] == "latex") {
$question_string .= $desc;
return $question_string;
} else {
if ($typeArray['type'] == "code") {
$question_string .= '\\text{' . get_html_to_latex(page_convert($desc)) . '}';
return $question_string;
} else {
if ($typeArray['type'] == "repeat") {
$num = $typeArray['num'];
$subtype_array = explode("|", $typeArray['subtype']);
$desc_array = explode("|", $desc);
$name_array = explode("|", $name);
if ($answer != '') {
$answer_array = toArray($answer, "|", "=");
} else {
$answer_array = array_fill(0, count($name_array) * $num, '');
}
//find minimum length, which will be the number to repeat for
$min_length = min(count($subtype_array), count($desc_array), count($name_array));
for ($i = 0; $i < $min_length * $num; $i++) {
$index = $i % $min_length;
$n = intval($i / $min_length);
$thisName = getRepeatThisValue($name_array, $index, $n);
$thisDesc = getRepeatThisValue($desc_array, $index, $n);
$thisType = str_replace(",", ";", getRepeatThisValue($subtype_array, $index, $n));
$question_string .= latexAppendQuestion($thisName, $thisDesc, $thisType, $answer_array[$i]);
}
} else {
if ($name != "") {
$question_string .= '\\textbf{' . latexSpecialChars($name) . '}';
//add question in bold
}
//add description (in bold) for essays and short answer
if (($typeArray['type'] == "essay" || $typeArray['type'] == "short") && $desc != "") {
if ($name != "") {
$question_string .= '\\newline';
}
$question_string .= '\\emph{' . latexSpecialChars($desc) . '}';
//add description in italics
}
//add a separator depending on main type of the question
if ($typeArray['type'] == "essay") {
$question_string .= "\n\n";
}
if ($typeArray['type'] == "select" && $typeArray['method'] != "dropdown") {
//in this case, we add tick marks and check the correct ones
$choices = explode(";", $desc);
//get answer as array in case we're using multiple selection
$config = $GLOBALS['config'];
$answerArray = explode($config['form_array_delimiter'], $answer);
//this is used to indent the answer choices
$question_string .= "\n\\begin{quote}\n";
//output each choice with check box before it on a separate line in the quote
for ($i = 0; $i < count($choices); $i++) {
$choice = $choices[$i];
if ($i != 0) {
$question_string .= "\\\\\n ";
}
if (in_array($choice, $answerArray)) {
$question_string .= '\\xbox';
} else {
$question_string .= '\\tickbox';
}
$question_string .= " \\hspace{4pt} " . latexSpecialChars($choice);
}
$question_string .= "\\end{quote}";
} else {
//append the response
if ($typeArray['type'] == "essay") {
if ($answer != "") {
$question_string .= '\\begin{quote} ' . latexSpecialChars($answer) . '\\end{quote}';
} else {
$question_string .= '\\vspace{5ex}';
}
} else {
if ($answer != "") {
$question_string .= '\\begin{quote} ' . latexSpecialChars($answer) . ' \\end{quote}';
} else {
$question_string .= '\\vspace{1ex}';
}
//.........这里部分代码省略.........
开发者ID:uakfdotb,项目名称:oneapp,代码行数:101,代码来源:latex.php
示例15: do_send_goods
public function do_send_goods($payment_notice_id, $delivery_notice_sn)
{
require_once APP_ROOT_PATH . "system/utils/XmlBase.php";
$payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
$order_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "deal_order where id = " . $payment_notice['order_id']);
$payment = $GLOBALS['db']->getRow("select id,config from " . DB_PREFIX . "payment where class_name='AlipayBank'");
$payment['config'] = unserialize($payment['config']);
$gateway = "https://www.alipay.com/cooperate/gateway.do";
$parameter = array('service' => 'send_goods_confirm_by_platform', 'partner' => $payment['config']['alipay_partner'], '_input_charset' => 'utf-8', 'invoice_no' => $delivery_notice_sn, 'transport_type' => 'EXPRESS', 'logistics_name' => 'NONE', 'trade_no' => $payment_notice['outer_notice_sn']);
ksort($parameter);
reset($parameter);
$sign = '';
$param = '';
foreach ($parameter as $key => $val) {
$sign .= "{$key}={$val}&";
$param .= "{$key}=" . urlencode($val) . "&";
}
$param = substr($param, 0, -1);
$sign = substr($sign, 0, -1) . $payment['config']['alipay_key'];
$sign_md5 = md5($sign);
$gateway = $gateway . "?" . $param . "&sign=" . $sign_md5 . "&sign_type=MD5";
$result = file_get_contents($gateway);
$result = toArray($result, "alipay");
if ($result['is_success'][0] == 'T') {
return "支付宝发货成功";
} else {
if ($result['error'] == 'ILLEGAL_ARGUMENT') {
return $result['error'] . ' 参数不正确';
} elseif ($result['error'] == 'TRADE_NOT_EXIST') {
return $result['error'] . ' 交易单号有误';
} elseif ($result['error'] == 'GENERIC_FAILURE') {
return $result['error'] . ' 执行命令错误';
} else {
return $result['error'];
}
}
}
开发者ID:norain2050,项目名称:fanwei_xindai_3.2,代码行数:37,代码来源:AlipayBank_payment.php
示例16: toArray
* corresponding variable is defined; e.g., $account->field_example has a
* variable $field_example defined. When needing to access a field's raw
* values, developers/themers are strongly encouraged to use these
* variables. Otherwise they will have to explicitly specify the desired
* field language, e.g. $account->field_example['en'], thus overriding any
* language negotiation rule that was previously applied.
*
* @see user-profile-category.tpl.php
* Where the html is handled for the group.
* @see user-profile-item.tpl.php
* Where the html is handled for each item in the group.
* @see template_preprocess_user_profile()
*
* @ingroup themeable
*/
$perfil = toArray($user_profile);
$fotoPerfil = $perfil['field_imagen_perfil']['#object']['field_imagen_perfil']['und'][0]['uri'];
?>
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-8 col-xs-12">
<figure class="img-perfil img-circle center-block">
<img src="<?php
print file_create_url($fotoPerfil);
?>
开发者ID:brm-tangarifec,项目名称:casabienestar,代码行数:31,代码来源:user-profile.tpl.php
示例17: toArray
* - $page['highlighted']: Items for the highlighted content region.
* - $page['banner']: Items for the banner content region.
* - $page['content']: The main content of the current page.
* - $page['sidebar_first']: Items for the first sidebar.
* - $page['sidebar_second']: Items for the second sidebar.
* - $page['header']: Items for the header region.
* - $page['footer']: Items for the footer region.
*
* @see template_preprocess()
* @see template_preprocess_page()
* @see template_process()
* @see html.tpl.php
*
* @ingroup themeable
*/
$linksPerfil = toArray($tabs);
echo '<pre>';
print_r(array_keys($tabs['#primary'][1]));
//*print_r($tabs);
echo '</pre>';
?>
<header>
<div class="container-fluid login">
<!--Wrapper login-->
<div class="row">
<div class="col-lg-4 col-md-4 col-sm-8 col-xs-12 col-lg-offset-4 col-md-offset-4 col-sm-offset-4">
<?php
if ($logged_in) {
?>
开发者ID:brm-tangarifec,项目名称:casabienestar,代码行数:30,代码来源:page--recetas.tpl.php
示例18: bfa_get_options
function bfa_get_options()
{
global $options, $bfa_ata;
if (get_option('bfa_ata4') === FALSE) {
// 268 Old ATA 3.X options:
$bfa_ata3 = array("start_here", "import_settings", "use_bfa_seo", "homepage_meta_description", "homepage_meta_keywords", "add_blogtitle", "title_separator_code", "archive_noindex", "cat_noindex", "tag_noindex", "h1_on_single_pages", "nofollow", "body_style", "link_color", "link_hover_color", "link_default_decoration", "link_hover_decoration", "link_weight", "layout_width", "layout_min_width", "layout_max_width", "layout_style", "layout_style_leftright_padding", "favicon_file", "configure_header", "logoarea_style", "logo", "logo_style", "blog_title_show", "blog_title_style", "blog_title_weight", "blog_title_color", "blog_title_color_hover", "blog_tagline_show", "blog_tagline_style", "show_search_box", "searchbox_style", "searchbox_text", "horbar1", "horbar2", "header_image_info", "header_image_javascript", "header_image_javascript_preload", "header_image_clickable", "headerimage_height", "headerimage_alignment", "header_opacity_left", "header_opacity_left_width", "header_opacity_left_color", "header_opacity_right", "header_opacity_right_width", "header_opacity_right_color", "overlay_blog_title", "overlay_blog_tagline", "overlay_box_style", "rss_settings_info", "rss_box_width", "show_posts_icon", "post_feed_link", "post_feed_link_title", "show_comments_icon", "comment_feed_link", "comment_feed_link_title", "show_email_icon", "email_subscribe_link", "email_subscribe_link_title", "feedburner_email_id", "feedburner_old_new", "animate_page_menu_bar", "home_page_menu_bar", "exclude_page_menu_bar", "levels_page_menu_bar", "sorting_page_menu_bar", "titles_page_menu_bar", "page_menu_1st_level_not_linked", "anchor_border_page_menu_bar", "page_menu_bar_background_color", "page_menu_bar_background_color_hover", "page_menu_bar_background_color_parent", "page_menu_font", "page_menu_bar_link_color", "page_menu_bar_link_color_hover", "page_menu_transform", "page_menu_arrows", "page_menu_submenu_width", "animate_cat_menu_bar", "home_cat_menu_bar", "exclude_cat_menu_bar", "levels_cat_menu_bar", "sorting_cat_menu_bar", "order_cat_menu_bar", "titles_cat_menu_bar", "add_descr_cat_menu_links", "default_cat_descr_text", "anchor_border_cat_menu_bar", "cat_menu_bar_background_color", "cat_menu_bar_background_color_hover", "cat_menu_bar_background_color_parent", "cat_menu_font", "cat_menu_bar_link_color", "cat_menu_bar_link_color_hover", "cat_menu_transform", "cat_menu_arrows", "cat_menu_submenu_width", "center_column_style", "content_above_loop", "content_inside_loop", "content_below_loop", "content_not_found", "next_prev_orientation", "home_multi_next_prev", "home_single_next_prev", "multi_next_prev_newer", "multi_next_prev_older", "single_next_prev_newer", "single_next_prev_older", "comments_next_prev_newer", "comments_next_prev_older", "location_comments_next_prev", "next_prev_style_comments_above", "next_prev_style_comments_below", "next_prev_comments_pagination", "location_multi_next_prev", "location_single_next_prev", "next_prev_style_top", "next_prev_style_middle", "next_prev_style_bottom", "leftcol_on", "left_col_pages_exclude", "left_col_cats_exclude", "leftcol2_on", "left_col2_pages_exclude", "left_col2_cats_exclude", "rightcol_on", "right_col_pages_exclude", "right_col_cats_exclude", "rightcol2_on", "ight_col2_pages_exclude", "right_col2_pages_exclude", "right_col2_cats_exclude", "left_sidebar_width", "left_sidebar2_width", "right_sidebar_width", "right_sidebar2_width", "left_sidebar_style", "left_sidebar2_style", "right_sidebar_style", "right_sidebar2_style", "widget_container", "widget_title_box", "widget_title", "widget_content", "widget_lists", "widget_lists2", "widget_lists3", "category_widget_display_type", "select_font_size", "widget_areas_reset", "widget_areas_info", "post_kicker_home", "post_kicker_multi", "post_kicker_single", "post_kicker_page", "post_byline_home", "post_byline_multi", "post_byline_single", "post_byline_page", "post_footer_home", "post_footer_multi", "post_footer_single", "post_footer_page", "post_container_style", "post_container_sticky_style", "post_kicker_style", "post_kicker_style_links", "post_kicker_style_links_hover", "post_headline_style", "post_headline_style_text", "post_headline_style_links", "post_headline_style_links_hover", "post_byline_style", "post_byline_style_links", "post_byline_style_links_hover", "post_bodycopy_style", "post_footer_style", "post_footer_style_links", "post_footer_style_links_hover", "excerpt_length", "dont_strip_excerpts", "custom_read_more", "excerpts_home", "full_posts_homepage", "excerpts_category", "excerpts_archive", "excerpts_tag", "excerpts_search", "excerpts_author", "post_thumbnail_width", "post_thumbnail_height", "post_thumbnail_crop", "post_thumbnail_css", "more_tag", "author_highlight", "author_highlight_color", "author_highlight_border_color", "comment_background_color", "comment_alt_background_color", "comment_border", "comment_author_size", "comment_reply_link_text", "comment_edit_link_text", "comment_moderation_text", "comments_are_closed_text", "comments_on_pages", "separate_trackback", "avatar_size", "avatar_style", "show_xhtml_tags", "comment_form_style", "submit_button_style", "comment_display_order", "footer_style", "footer_style_links", "footer_style_links_hover", "footer_style_content", "sticky_layout_footer", "footer_show_queries", "table", "table_caption", "table_th", "table_td", "table_tfoot_td", "table_zebra_stripes", "table_zebra_td", "table_hover_rows", "table_hover_td", "form_input_field_style", "form_input_field_background", "highlight_forms", "highlight_forms_style", "button_style", "button_style_hover", "blockquote_style", "blockquote_style_2nd_level", "post_image_style", "post_image_caption_style", "image_caption_text", "html_inserts_header", "html_inserts_body_tag", "html_inserts_body_top", "html_inserts_body_bottom", "html_inserts_css", "archives_page_id", "archives_date_show", "archives_date_title", "archives_date_type", "archives_date_limit", "archives_date_count", "archives_category_show", "archives_category_title", "archives_category_count", "archives_category_depth", "archives_category_orderby", "archives_category_order", "archives_category_feed", "css_external", "javascript_external", "pngfix_selectors", "css_compress", "allow_debug");
// If no old settings exit, use the new 'default' style
$old_setting_exists = 'no';
foreach ($bfa_ata3 as $old_option) {
if (get_option('bfa_ata_' . $old_option) !== FALSE) {
$old_setting_exists = 'yes';
}
}
// Separate option bfa_widget_areas
if (get_option('bfa_widget_areas') !== FALSE) {
$all_old_widget_areas = get_option('bfa_widget_areas');
foreach ($all_old_widget_areas as $old_widget_area) {
if (isset($old_widget_area)) {
$old_setting_exists = 'yes';
}
}
}
// toArray: turn object into array for PHP < 5.1 - included JSON.php does not return array with ,TRUE
if ($old_setting_exists == 'yes') {
$bfa_ata_default = toArray(json_decode(file_get_contents(TEMPLATEPATH . '/styles/ata-classic.txt'), TRUE));
} else {
$bfa_ata_default = toArray(json_decode(file_get_contents(TEMPLATEPATH . '/styles/ata-classic.txt'), TRUE));
}
foreach ($options as $value) {
if ($value['type'] != 'info') {
if (get_option('bfa_ata_' . $value['id']) === FALSE) {
$bfa_ata4[$value['id']] = $bfa_ata_default[$value['id']];
} else {
$bfa_ata4[$value['id']] = get_option('bfa_ata_' . $value['id']);
}
}
}
/*
foreach ($options as $value) {
if ($value['type'] != 'info') {
if ( $value['escape'] == "yes" ) {
if( get_option( 'bfa_ata_' . $value['id'] ) === FALSE )
$bfa_ata[ $value['id'] ] = stripslashes(bfa_escape($_REQUEST[ $value['id'] ] ));
else
unset ($bfa_ata[ $value['id'] ]);
} elseif ($value['stripslashes'] == "no") {
if( get_option( 'bfa_ata_' . $value['id'] ) === FALSE )
$bfa_ata[ $value['id'] ] = $_REQUEST[ $value['id'] ] ;
else
unset ($bfa_ata[ $value['id'] ]);
} else {
if( get_option( 'bfa_ata_' . $value['id'] ) === FALSE )
$bfa_ata[ $value['id'] ] = stripslashes($_REQUEST[ $value['id'] ] );
else
unset ($bfa_ata[ $value['id'] ]);
}
}
}
*/
// Separate option bfa_widget_areas
$bfa_ata4['bfa_widget_areas'] = get_option('bfa_widget_areas');
update_option('bfa_ata4', $bfa_ata4);
}
$bfa_ata = get_option('bfa_ata4');
if (is_page()) {
global $wp_query;
$current_page_id = $wp_query->get_queried_object_id();
}
//figure out sidebars and "colspan=XX", based on theme options and type or ID of page that we are currently on:
$cols = 1;
$left_col = '';
$left_col2 = '';
$right_col = '';
$right_col2 = '';
if (is_page() and function_exists('is_front_page') ? !is_front_page() : '' and !is_home()) {
if ($bfa_ata['left_col_pages_exclude'] != "") {
$pages_exlude_left = explode(",", str_replace(" ", "", $bfa_ata['left_col_pages_exclude']));
if (isset($bfa_ata['leftcol_on']['page']) and !in_array($current_page_id, $pages_exlude_left)) {
$cols++;
$left_col = "on";
}
} else {
if (isset($bfa_ata['leftcol_on']['page'])) {
$cols++;
$left_col = "on";
}
}
if ($bfa_ata['left_col2_pages_exclude'] != "") {
$pages_exlude_left2 = explode(",", str_replace(" ", "", $bfa_ata['left_col2_pages_exclude']));
if (isset($bfa_ata['leftcol2_on']['page']) and !in_array($current_page_id, $pages_exlude_left2)) {
$cols++;
$left_col2 = "on";
}
} else {
if (isset($bfa_ata['leftcol2_on']['page'])) {
$cols++;
$left_col2 = "on";
}
}
if ($bfa_ata['right_col_pages_exclude'] != "") {
//.........这里部分代码省略.........
开发者ID:aagivecamp,项目名称:FlintRiver,代码行数:101,代码来源:bfa_get_options.php
示例19: SourceCredentials
<form method="post" action="getClassDescriptions.php">
Source Name:
<input type="text" size="25" name="sName"/><br/>
Password:
<input type="password" size="25" name="password"/><br/>
SiteID:
<input type="text" size="5" name="siteID" value="-99"/><br/>
<input type="submit" value="submit" name="submit"/>
</form>
<?php
} else {
$sourcename = $_POST["sName"];
$password = $_POST["password"];
$siteID = $_POST["siteID"];
// initialize default credentials
$creds = new Sourc
|
请发表评论