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


PHP General::reverse_sanitize方法代码示例

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


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

示例1: foreach

             }
             ##Update the custom fields
             $sql = "SELECT * FROM `tbl_entries2customfields` WHERE `entry_id` = '" . $e['id'] . "'";
             $customfields = $DB->fetch($sql);
             if (!$error && is_array($customfields) && !empty($customfields)) {
                 foreach ($customfields as $c) {
                     $fields = array();
                     $format = $DB->fetchVar("format", 0, "SELECT `format` FROM `tbl_customfields` WHERE `id` = '" . $c['field_id'] . "' LIMIT 1");
                     if ($format == '1' && $e['formatter'] && !@is_object($formatter)) {
                         $error = true;
                         $Admin->log->pushToLog("Failed (Could not create formatter '" . $e['formatter'] . "')", SYM_LOG_NOTICE, true, true, true);
                     } else {
                         if (!@is_object($formatter)) {
                             $fields['value'] = $formatter->run(General::reverse_sanitize($c['value_raw']));
                         } else {
                             $fields['value'] = General::reverse_sanitize($c['value_raw']);
                         }
                     }
                     ##Update the entry
                     if (!$DB->update($fields, "tbl_entries2customfields", "WHERE `field_id` = '" . $c['field_id'] . "' AND `entry_id` = '" . $e['id'] . "' LIMIT 1")) {
                         $Admin->log->pushToLog("Failed (Problem updating custom fields)", SYM_LOG_NOTICE, true, true, true);
                         $error = true;
                     }
                 }
             }
         }
         if (!$error) {
             $Admin->log->pushToLog("Done.", SYM_LOG_NOTICE, true, true, true);
         }
     }
 }
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_publish_migrate.php

示例2: prepareExportValue

 /**
  * Give the field some data and ask it to return a value using one of many
  * possible modes.
  *
  * @param mixed $data
  * @param integer $mode
  * @param integer $entry_id
  * @return array|null
  */
 public function prepareExportValue($data, $mode, $entry_id = null)
 {
     $modes = (object) $this->getExportModes();
     if (isset($data['relation_id']) === false) {
         return null;
     }
     if (is_array($data['relation_id']) === false) {
         $data['relation_id'] = array($data['relation_id']);
     }
     if ($mode === $modes->getPostdata) {
         // Return postdata:
         return $data;
     } else {
         if ($mode === $modes->listEntry) {
             // Return the entry IDs:
             return $data['relation_id'];
         } else {
             if ($mode === $modes->listEntryObject) {
                 // Return entry objects:
                 $items = array();
                 $entries = EntryManager::fetch($data['relation_id']);
                 foreach ($entries as $entry) {
                     if (is_array($entry) === false || empty($entry)) {
                         continue;
                     }
                     $items[] = current($entry);
                 }
                 return $items;
             }
         }
     }
     // All other modes require full data:
     $data = $this->findRelatedValues($data['relation_id']);
     $items = array();
     foreach ($data as $item) {
         $item = (object) $item;
         if ($mode === $modes->listValue) {
             $items[] = General::reverse_sanitize($item->value);
         } elseif ($mode === $modes->listEntryToValue) {
             $items[$item->id] = General::reverse_sanitize($item->value);
         }
     }
     return $items;
 }
开发者ID:mazedigital,项目名称:association_field,代码行数:53,代码来源:field.association.php

示例3: foreach

                            <td colspan="3" class="inactive">
								None found.
                            </td>
                        </tr>
<?php 
} else {
    $bEven = false;
    $date = $Admin->getDateObj();
    foreach ($comments as $comment) {
        foreach ($comment as $index => $value) {
            $comment[$index] = htmlspecialchars(stripslashes($value));
        }
        $url = $Admin->getCurrentPageURL() . 'edit/&amp;id=' . $comment['id'];
        extract($comment, EXTR_PREFIX_ALL, "comment");
        $comment_creation_timestamp_gmt = $DB->fetchVar("creation_timestamp_gmt", 0, "SELECT UNIX_TIMESTAMP(creation_date_gmt) as `creation_timestamp_gmt` FROM `tbl_metadata` WHERE `relation_id` = '{$comment_id}' AND `class` = 'comment' LIMIT 1");
        $comment_body = strip_tags(General::reverse_sanitize(General::reverse_sanitize($comment_body)));
        $comment_body_short = General::limitWords($comment_body, 75);
        if (strlen($comment_body_short) < strlen($comment_body)) {
            $comment_body_short .= "...";
        }
        $class = "";
        if (isset($_REQUEST['_f']) && $_REQUEST['id'] == $comment['id']) {
            $class = "active ";
        }
        if ($bEven) {
            $class .= "even";
        }
        $class = trim($class);
        ?>

				<tr<?php 
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_publish_comments.php


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