array('metadataPrefix'=>'oai_dc', 'schema'=>'http://www.openarchives.org/OAI/2.0/oai_dc.xsd', 'metadataNamespace'=>'http://www.openarchives.org/OAI/2.0/oai_dc/', 'myhandler'=>'record_dc.php', 'record_prefix'=>'dc', 'record_namespace' => 'http://purl.org/dc/elements/1.1/' ) //, //array('metadataPrefix'=>'olac', // 'schema'=>'http://www.language-archives.org/OLAC/olac-2.0.xsd', // 'metadataNamespace'=>'http://www.openarchives.org/OLAC/0.2/', // 'handler'=>'record_olac.php' //) ); // // DATABASE SETUP // // the charset you store your metadata in your database // currently only utf-8 and iso8859-1 are supported $charset = variable_get('charset', 'utf-8'); // if entities such as < > ' " in your metadata has already been escaped // then set this to true (e.g. you store < as < in your DB) $xmlescaped = false; // We store multiple entries for one element in a single row // in the database. SQL['split'] ist the delimiter for these entries. // If you do not do this, do not define $SQL['split'] $SQL['split'] = ';'; $SQL['break'] = ''; // the name of the table where your store your metadata $SQL['table'] = 'oai_records'; // the name of the column where you store your sequence // (or autoincrement values). $SQL['id_column'] = 'node.nid'; // the name of the column where you store the unique identifiers // pointing to your item. // this is your internal identifier for the item $SQL['identifier'] = 'url'; // If you want to expand the internal identifier in some way // use this (but not for OAI stuff, see next line) $idPrefix = 'node/'; // this is your external (OAI) identifier for the item // this will be expanded to // oai:$repositoryIdentifier:$idPrefix$SQL['identifier'] // should not be changed $oaiprefix = "oai".$delimiter.$repositoryIdentifier.$delimiter.$idPrefix; $shortprefix = 'oai'.$delimiter.$repositoryIdentifier.$delimiter; // adjust anIdentifier with sample contents an identifier $sampleIdentifier = $oaiprefix.'anIdentifier'; // the name of the column where you store your datestamps $SQL['datestamp'] = 'datestamp'; // the name of the column where you store information whether // a record has been deleted. Leave it as it is if you do not use // this feature. $SQL['deleted'] = 'status'; // to be able to quickly retrieve the sets to which one item belongs, // the setnames are stored for each item // the name of the column where you store sets $SQL['set'] = 'sets'; $SQL['type'] = 'type'; // Here are a couple of queries which might need to be adjusted to // your needs. Normally, if you have correctly named the columns above, // this does not need to be done. // this function should generate a query which will return // all records // the useless condition id_column = id_column is just there to ease // further extensions to the query, please leave it as it is. function selectallQuery ($id = '') { global $SQL; $query = 'SELECT nid as '.$SQL['identifier'].', datestamp as '.$SQL['datestamp'].', '.$SQL['type'].', '.$SQL['deleted'].' FROM {ioai_node} AS node WHERE '; if ($id == '') { $query .= $SQL['id_column'].' = '.$SQL['id_column']; } else { $query .= $SQL['id_column']." ='$id'"; } return $query; } // this function will return identifier and datestamp for all records function idQuery ($id = '') { global $SQL; global $oaiprefix; global $args; global $shortprefix; if ($SQL['set'] != '') { $query = 'select nid as '.$SQL['identifier'].', datestamp as '.$SQL['datestamp'].', '.$SQL['type'].', '.$SQL['deleted'].', '.$SQL['set'].' FROM {ioai_node} as node WHERE '; } if ($id == '') { $query .= $SQL['id_column'].' = '.$SQL['id_column']; } else { $suffix = explode('/', str_replace($shortprefix, '', $id)); $type = $suffix[0]; $id = $suffix[1]; //print $id; $query .= $SQL['id_column']." = $id AND type = '$type'"; } return $query; } // filter for until function untilQuery($until) { global $SQL; $until = str_replace(array('T', 'Z'), array(' ', ''), $until); $until = strtotime($until); return ' and node.'.$SQL['datestamp'].' <= '.$until; } // filter for from function fromQuery($from) { global $SQL; $from = str_replace(array('T', 'Z'), array(' ', ''), $from); $from = strtotime($from); return ' and node.'.$SQL['datestamp'].' >= '.$from; } // filter for sets function setQuery($set) { global $SQL; return ' and '.$SQL['set']." LIKE '%$set%'"; } // There is no need to change anything below. // Current Date $datetime = gmstrftime('%Y-%m-%dT%T'); $responseDate = $datetime.'Z'; // do not change $XMLHEADER = ''; $xmlheader = $XMLHEADER . ''.$responseDate.""; // the xml schema namespace, do not change this $XMLSCHEMA = 'http://www.w3.org/2001/XMLSchema-instance'; ?> '.xmlstr($text, 'iso8859-1', false).""; return $error; } function xmlstr($string, $charset = 'iso8859-1', $xmlescaped = 'false') { $xmlstr = stripslashes(trim($string)); // just remove invalid characters $pattern ="/[\x-\x8\xb-\xc\xe-\x1f]/"; $xmlstr = preg_replace($pattern, '', $xmlstr); // escape only if string is not escaped if (!$xmlescaped) { $xmlstr = htmlspecialchars($xmlstr, ENT_QUOTES); } if ($charset != "utf-8") { $xmlstr = utf8_encode($xmlstr); } return $xmlstr; } // will split a string into elements and return XML // supposed to print values from database function xmlrecord($sqlrecords, $element, $attr = '', $indent = 0, $safe = TRUE) { $indent = 0; global $SQL; global $xmlescaped; global $charset; $str = ''; if ($attr != '') { $attr = ' '.$attr; } if (!is_array($sqlrecords)) { $sqlrecords = array($sqlrecords); } foreach ($sqlrecords as $sqlrecord) { if (!empty($sqlrecord)) { if (isset($SQL['split']) && !$safe) { $temparr = explode($SQL['split'], $sqlrecord); foreach ($temparr as $val) { $str .= str_pad('', $indent).'<'.$element.$attr.'>'.xmlstr($val, $charset, $xmlescaped).'"; } $str .= $str; } else { $str.= str_pad('', $indent).'<'.$element.$attr.'>'.xmlstr($sqlrecord, $charset, $xmlescaped).'"; } } } return $str; } function xmlelement($element, $attr = '', &$indent, $open = true) { $indent = 0; global $SQL; if ($attr != '') { $attr = ' '.$attr; } if ($open) { $indent += 2; return str_pad('', $indent).'<'.$element.$attr.'>'; } else { $indent -= 2; return str_pad('', $indent).''; } } // takes either an array or a string and outputs them as XML entities function xmlformat($record, $element, $attr = '', $indent = 0) { $indent = 0; global $charset; global $xmlescaped; if ($attr != '') { $attr = ' '.$attr; } $str = ''; if (is_array($record)) { foreach ($record as $val) { $str .= str_pad('', $indent).'<'.$element.$attr.'>'.xmlstr($val, $charset, $xmlescaped).'"; } return $str; } elseif ($record != '') { return str_pad('', $indent).'<'.$element.$attr.'>'.xmlstr($record, $charset, $xmlescaped).'"; } else { return ''; } } function date2UTCdatestamp($date) { global $granularity; if ($date == '') return ''; switch ($granularity) { case 'YYYY-MM-DDThh:mm:ssZ': // we assume common date ("YYYY-MM-DD") // or datetime format ("YYYY-MM-DD hh:mm:ss") // or datetime format with timezone YYYY-MM-DD hh:mm:ss+02 // or datetime format with GMT timezone YYYY-MM-DD hh:mm:ssZ // or datetime format with timezone YYYY-MM-DDThh:mm:ssZ // or datetime format with microseconds and // with timezone YYYY-MM-DD hh:mm:ss.xxx+02 // with all variations as above // in the database // if (strstr($date, ' ') || strstr($date, 'T')) { $checkstr = '/([0-9]{4})(-)([0-9]{1,2})(-)([0-9]{1,2})([T ])([0-9]{2})(:)([0-9]{2})(:)([0-9]{2})(\.?)(\d*)([Z+-]{0,1})([0-9]{0,2})$/'; $val = preg_match($checkstr, $date, $matches); if (!$val) { // show that we have an error return "0000-00-00T00:00:00Z"; } // date is datetime format /* * $matches for "2005-05-26 09:30:51.123+02" * [0] => 2005-05-26 09:30:51+02 * [1] => 2005 * [2] => - * [3] => 05 * [4] => - * [5] => 26 * [6] => * [7] => 09 * [8] => : * [9] => 30 * [10] => : * [11] => 51 * [12] => . * [13] => 123 * [14] => + * [15] => 02 */ if ($matches[14] == '+' || $matches[14] == '-') { // timezone is given // format ("YYYY-MM-DD hh:mm:ss+01") $tz = $matches[15]; if ($tz != '') { //$timestamp = mktime($h, $min, $sec, $m, $d, $y); $timestamp = mktime($matches[7], $matches[9], $matches[11], $matches[3], $matches[5], $matches[1]); // add, subtract timezone offset to get GMT // 3600 sec = 1 h if ($matches[14] == '-') { // we are before GMT, thus we need to add $timestamp += (int) $tz * 3600; } else { // we are after GMT, thus we need to subtract $timestamp -= (int) $tz * 3600; } return strftime("%Y-%m-%dT%H:%M:%SZ", $timestamp); } } elseif ($matches[14] == 'Z') { return str_replace(' ', 'T', $date); } return str_replace(' ', 'T', $date).'Z'; } else { // date is date format // granularity 'YYYY-MM-DD' should be used... return $date.'T00:00:00Z'; } break; case 'YYYY-MM-DD': if (strstr($date, ' ')) { // date is datetime format list($date, $time) = explode(" ", $date); return $date; } else { return $date; } break; default: die("Unknown granularity!"); } } function checkDateFormat($date) { global $granularity; global $message; if ($granularity == 'YYYY-MM-DDThh:mm:ssZ') { $checkstr = '([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})T([0-9]{2}):([0-9]{2}):([0-9]{2})Z$'; } else { $checkstr = '([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}$)'; } if (ereg($checkstr, $date, $regs)) { if (checkdate($regs[2], $regs[3], $regs[1])) { return 1; } else { $message = "Invalid Date: $date is not a valid date."; return 0; } } else { $message = "Invalid Date Format: $date does not comply to the date format $granularity."; return 0; } } function formatDatestamp($datestamp) { return strftime('%Y-%m-%dT%H:%M:%SZ', $datestamp); } function oai_close() { global $compress; echo ""; if ($compress) { ob_end_flush(); } } function oai_exit() { global $CONTENT_TYPE; global $xmlheader; global $request; global $errors; header($CONTENT_TYPE); echo $xmlheader; echo $request; echo $errors; oai_close(); exit(); } function php_is_at_least($version) { list($c_r, $c_mj, $c_mn) = explode('.', phpversion()); list($v_r, $v_mj, $v_mn) = explode('.', $version); if ($c_r >= $v_r && $c_mj >= $v_mj && $c_mn >= $v_mn) return TRUE; else return FALSE; } function is_valid_uri($url) { return((bool)preg_match("'^[^:]+:(?://)?(?:[a-z_0-9-]+[\.]{1})*(?:[a-z_0-9-]+\.)[a-z]{2,3}.*$'i", $url)); } function metadataHeader($prefix) { global $METADATAFORMATS; global $XMLSCHEMA; $myformat = $METADATAFORMATS[$prefix]; $str = '<'.$prefix; if ($myformat['record_prefix']) { $str .= ':'.$myformat['record_prefix']; } $str .= ' xmlns:'.$prefix.'="'.$myformat['metadataNamespace'].'"'; if ($myformat['record_prefix'] && $myformat['record_namespace']) { $str .= ' xmlns:'.$myformat['record_prefix'].'="'.$myformat['record_namespace'].'"'; } $str .= ' xmlns:xsi="'.$XMLSCHEMA.'"'.' xsi:schemaLocation="'.$myformat['metadataNamespace'].$myformat['schema'].'">'; return $str; } ?> ใช้ผงขัดหน้าสมุนไพร สำหรับลดสิว พอเช็ดหน้า ผ้าเช็ดหน้าเลอะสีของสมุนไพร มีวิธีซักไหมคะ เพราะซักไม่ออกค่ะ | สมุนไพรอภัยภูเบศร