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


PHP search::index方法代码示例

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


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

示例1: save_parsed_text

function save_parsed_text($roi_pid, $nothing, $workflow_id)
{
    global $user;
    $returnjs = "";
    if (Workflow_Users::doesWorkflowHaveUserName($workflow_id, $user->name) && Workflow_Permission::doesWorkflowHavePermission($workflow_id, "canTranscribe")) {
        $query_string = $_SERVER['QUERY_STRING'];
        log_to_db($_SERVER['QUERY_STRING'], 'save_parsed_text QUERY_STRING');
        log_to_db($_REQUEST['specimenMetadata'], 'save_parsed_text specimenMetadata');
        $specimenMetadata = $_REQUEST['specimenMetadata'];
        $file_path = drupal_get_path('module', 'apiary_project') . "/workflow/assets/xml/metadata_template.xml";
        $doc = new DOMDocument();
        $doc->load($file_path);
        $pairs = explode('&', $specimenMetadata);
        foreach ($pairs as $pair) {
            if (!empty($pair)) {
                list($name, $value) = explode("=", $pair, 2);
                if ($name != "q") {
                    $element = $doc->getElementsByTagName($name)->item(0);
                    $element->nodeValue = urldecode($value);
                }
            }
        }
        $roi_obj = new roiHandler($roi_pid);
        log_to_db($doc->saveXML(), 'save_parsed_text doc_saveXML');
        $success = $roi_obj->setDatastream("specimenMetadata", "Label-Information", "text/xml", $doc->saveXML(), FEDORA_DATABASE_USERNAME . ":" . FEDORA_DATABASE_PASSWORD);
        log_to_db($_REQUEST['text'], 'save_parsed_text text');
        $success = $roi_obj->setDatastream("Text", "Parsed", "text/plain", $_POST['text'], FEDORA_DATABASE_USERNAME . ":" . FEDORA_DATABASE_PASSWORD);
        if ($success) {
            $solr_search = new search();
            $solr_search->index($roi_pid);
            $returnjs .= "\$.jGrowl('Parsed text for ROI [{$roi_pid}] saved successfully.');";
        } else {
            $returnjs .= "\$.jGrowl('Parsed text for ROI [{$roi_pid}] failed to save.');";
        }
    } else {
        $returnjs .= "\$.jGrowl('Sorry! You do not have permission for this operation');";
    }
    echo $returnjs;
}
开发者ID:0x27,项目名称:apiary-project,代码行数:39,代码来源:parse.functions.php

示例2: setImageStatus

 static function setImageStatus($image_pid, $status_type, $status)
 {
     global $user;
     $datastream_name = "status";
     $datastream_label = "Image Status";
     $dom = FedoraObject::getManagedXMLDom($image_pid, $datastream_name);
     if ($dom != false) {
         $dom->getElementsByTagName($status_type)->item(0)->nodeValue = $status;
         $dom->getElementsByTagName($status_type . 'UpdatedBy')->item(0)->nodeValue = $user->name;
     } else {
         //Shouldn't be able to get here as a lock is needed before a status can be updated.
         return false;
     }
     //We don't get here if we fail
     $success = FedoraObject::createManagedXMLDom($image_pid, $datastream_name, $datastream_label, $dom);
     if ($success) {
         include_once drupal_get_path('module', 'apiary_project') . '/workflow/include/search.php';
         $search_instance = new search();
         $search_instance->index($image_pid);
         return $dom;
     } else {
         //can't update this datastream!
         return false;
     }
 }
开发者ID:0x27,项目名称:apiary-project,代码行数:25,代码来源:class.AP_Image.php

示例3: trim

                    } else {
                        $tmp = trim(strip_tags($tmps[1]));
                    }
                    if (!in_array($tmp, $url)) {
                        $url[] = $tmp;
                        $show_sgou = 1;
                    }
                } else {
                    $show_sgou = 1;
                }
                if ($show_sgou == 1) {
                    echo '<div id="mainBody" class="mainBody" style="padding: 0;"><div class="results">';
                    echo $sogou['list'][1][$i];
                    echo '<p class="comefrom">来自<img class="comelogo" src="http://wap.sogou.com/images/app_tuiguang/tg_logo.png">搜狗</p>';
                    echo '</div></div>';
                    $show_sgou = 0;
                }
            }
            $i++;
        }
    }
    function writelog($str, $name)
    {
        $open = fopen($name, "a");
        fwrite($open, $str);
        fclose($open);
    }
}
$s = new search();
$s->index();
开发者ID:renjun0106,项目名称:dao,代码行数:30,代码来源:search.php


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