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


PHP scrubData函数代码示例

本文整理汇总了PHP中scrubData函数的典型用法代码示例。如果您正苦于以下问题:PHP scrubData函数的具体用法?PHP scrubData怎么用?PHP scrubData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: sanitizeParams

 function sanitizeParams(array $lobjParams)
 {
     $lobjFinalParams = array();
     foreach ($lobjParams as $lstrKey => $lstrValue) {
         switch (strtolower($lstrKey)) {
             case 'department':
                 $lobjSplit = explode(',', $lstrValue);
                 foreach ($lobjSplit as &$lstrUnScrubbed) {
                     $lstrUnScrubbed = scrubData($lstrUnScrubbed, 'integer');
                 }
                 $lobjFinalParams['department'] = $lobjSplit;
                 break;
             case 'email':
                 $lobjSplit = explode(',', $lstrValue);
                 foreach ($lobjSplit as &$lstrUnScrubbed) {
                     $lstrUnScrubbed = scrubData($lstrUnScrubbed);
                 }
                 $lobjFinalParams['email'] = $lobjSplit;
                 break;
             case 'max':
                 $lstrValue = scrubData($lstrValue, 'integer');
                 $lobjFinalParams['max'] = $lstrValue;
                 break;
         }
     }
     return $lobjFinalParams;
 }
开发者ID:kenirwin,项目名称:SubjectsPlus,代码行数:27,代码来源:StaffWebService.php

示例2: sanitizeParams

 /**
  * TalkbackWebService::sanitizeParams() - goes through passed array parameter
  * and sanitizes elements that are valid url parameters
  *
  * @param array $lobjParams
  * @return array
  */
 function sanitizeParams(array $lobjParams)
 {
     $lobjFinalParams = array();
     foreach ($lobjParams as $lstrKey => $lstrValue) {
         switch (strtolower($lstrKey)) {
             case 'tag':
                 $lobjSplit = explode(',', $lstrValue);
                 foreach ($lobjSplit as &$lstrUnScrubbed) {
                     $lstrUnScrubbed = scrubData($lstrUnScrubbed);
                 }
                 $lobjFinalParams['tag'] = $lobjSplit;
                 break;
             case 'startdate':
                 $lstrValue = $lstrValue . ' 00:00:00';
                 $lobjFinalParams['startdate'] = $lstrValue;
                 break;
             case 'enddate':
                 $lstrValue = $lstrValue . ' 23:59:59';
                 $lobjFinalParams['enddate'] = $lstrValue;
                 break;
             case 'max':
                 $lstrValue = scrubData($lstrValue, 'integer');
                 $lobjFinalParams['max'] = $lstrValue;
                 break;
         }
     }
     return $lobjFinalParams;
 }
开发者ID:kenirwin,项目名称:SubjectsPlus,代码行数:35,代码来源:TalkbackWebService.php

示例3: saveTabOrder

 public function saveTabOrder($data)
 {
     if (isset($data)) {
         $db = $this->db;
         parse_str($data['data'], $str);
         $tabs = $str['item'];
         foreach ($tabs as $key => $value) {
             $q = "UPDATE tab SET tab_index =" . $db->quote(scrubData($key)) . " WHERE tab_id = " . $value;
             $db->exec($q);
         }
     }
 }
开发者ID:johnwinsor,项目名称:SubjectsPlus,代码行数:12,代码来源:TabData.php

示例4: sanitizeParams

 /**
  * DatabaseWebService::sanitizeParams() -  - goes through passed array parameter
  * and sanitizes elements that are valid url parameters
  *
  * @param array $lobjParams
  * @return array
  */
 function sanitizeParams(array $lobjParams)
 {
     $lobjFinalParams = array();
     foreach ($lobjParams as $lstrKey => $lstrValue) {
         switch (strtolower($lstrKey)) {
             case 'letter':
                 $lobjSplit = explode(',', $lstrValue);
                 foreach ($lobjSplit as &$lstrUnScrubbed) {
                     $lstrUnScrubbed = scrubData($lstrUnScrubbed);
                 }
                 $lobjFinalParams['letter'] = $lobjSplit;
                 break;
             case 'search':
                 $lobjSplit = explode(',', $lstrValue);
                 foreach ($lobjSplit as &$lstrUnScrubbed) {
                     $lstrUnScrubbed = scrubData($lstrUnScrubbed);
                 }
                 $lobjFinalParams['search'] = $lobjSplit;
                 break;
             case 'subject_id':
                 $lobjSplit = explode(',', $lstrValue);
                 foreach ($lobjSplit as &$lstrUnScrubbed) {
                     $lstrUnScrubbed = scrubData($lstrUnScrubbed, 'integer');
                 }
                 $lobjFinalParams['subject_id'] = $lobjSplit;
                 break;
             case 'type':
                 $lobjSplit = explode(',', $lstrValue);
                 foreach ($lobjSplit as &$lstrUnScrubbed) {
                     $lstrUnScrubbed = scrubData($lstrUnScrubbed);
                 }
                 $lobjFinalParams['type'] = $lobjSplit;
                 break;
             case 'max':
                 $lstrValue = scrubData($lstrValue, 'integer');
                 $lobjFinalParams['max'] = $lstrValue;
                 break;
         }
     }
     return $lobjFinalParams;
 }
开发者ID:kenirwin,项目名称:SubjectsPlus,代码行数:48,代码来源:DatabaseWebService.php

示例5: formatOutput

 /**
  * sp_WebService::formatOutput() - saves formatted output into property based
  * on format requested in url parameters
  *
  * @return void
  */
 public function formatOutput()
 {
     $lstrFormat = '';
     if (isset($this->mobjUrlParams['output'])) {
         $lstrFormat = $this->mobjUrlParams['output'];
     }
     $this->mstrFormat = scrubData(strtolower($lstrFormat));
     switch ($this->mstrFormat) {
         case "xml":
             $this->mstrOutput = "<{$this->mstrService}>";
             $this->mstrOutput .= $this->getXMLFormat($this->mobjData);
             $this->mstrOutput .= "</{$this->mstrService}>";
             break;
         case "json":
             $this->mstrOutput = $this->getJSONFormat();
             break;
         default:
             $this->mstrOutput = $this->getJSONFormat();
             break;
     }
 }
开发者ID:kenirwin,项目名称:SubjectsPlus,代码行数:27,代码来源:WebService.php

示例6: catch

$intro = "<p>A collection of videos produced by the University of Miami Libraries.</p>";
$display = "<br />";
try {
} catch (Exception $e) {
    echo $e;
}
// Get Tags
// create the option
$vtag_items = "\n  <ul>\n  <li><a href=\"video.php?tag=all\">All</a></li>";
foreach ($all_vtags as $value) {
    $vtag_items .= "<li><a href=\"video.php?tag={$value}\">" . ucfirst($value) . "</a></li>";
}
$vtag_items .= "</ul>";
// Clean up user submission
if (isset($_GET["video_id"])) {
    $extra_sql = "and video_id = '" . scrubData($_GET["video_id"], "integer") . "'";
}
if (isset($_GET["tag"])) {
    if (in_array($_GET["tag"], $all_vtags)) {
        $pretty_tag = ucfirst($_GET["tag"]);
        $extra_sql = "and vtags like '%" . $_GET["tag"] . "%'";
    }
}
$q = "select distinct video_id, title, description, source, foreign_id, duration, date\n        FROM video\n        WHERE display = '1'\n        {$extra_sql}\n        ORDER BY date";
// print $q;
// check row count for 0 returns
$db = new Querier();
$r = $db->query($q);
$num_rows = count($r);
if ($num_rows != 0) {
    foreach ($r as $myrow) {
开发者ID:kenirwin,项目名称:SubjectsPlus,代码行数:31,代码来源:video.php

示例7: writeTable

 function writeTable($qualifier, $subject_id = '')
 {
     global $IconPath;
     global $proxyURL;
     // sanitize submission
     $selected = scrubData($qualifier);
     $subject_id = scrubData($subject_id);
     // determine submission type
     $selected = getTableOptions($selected, $subject_id);
     if (isset($subject_id) && $subject_id != "") {
         $q = "select distinct left(title,1) as initial, title, description, location, access_restrictions, title.title_id as this_record,\neres_display, display_note, pre, citation_guide, ctags\n        FROM title, restrictions, location, location_title, source, rank\n        {$selected}\n        AND title.title_id = location_title.title_id\n        AND location.location_id = location_title.location_id\n        AND restrictions_id = access_restrictions\n       \n        AND rank.title_id = title.title_id AND source.source_id = rank.source_id\n        ORDER BY title ";
     } else {
         $q = "select distinct left(title,1) as initial, title, description, location, access_restrictions, title.title_id as this_record,\neres_display, display_note, pre, citation_guide, ctags\n\t\tFROM title, restrictions, location, location_title, source\n\t\t{$selected}\n\t\tAND title.title_id = location_title.title_id\n\t\tAND location.location_id = location_title.location_id\n\t\tAND restrictions_id = access_restrictions\n\n\t\tORDER BY title";
     }
     //print $q;
     $db = new Querier();
     $r = $db->query($q);
     // check row count for 0 returns
     $num_rows = count($r);
     if ($num_rows == 0) {
         return "<div class=\"no_results\">" . _("Sorry, there are no results at this time.") . "</div>";
     }
     // prepare 	header
     $items = "<table width=\"98%\" class=\"item_listing\">";
     $row_count = 0;
     $colour1 = "oddrow";
     $colour2 = "evenrow";
     foreach ($r as $myrow) {
         $row_colour = $row_count % 2 ? $colour1 : $colour2;
         $patterns = "/'|\"/";
         $replacements = "";
         $item_title = $myrow["title"];
         $safe_title = trim(preg_replace($patterns, $replacements, $item_title));
         $blurb = $myrow["description"];
         $bib_id = $myrow["5"];
         /// CHECK RESTRICTIONS ///
         if ($myrow['4'] == 2 or $myrow['4'] == 3) {
             $url = $proxyURL . $myrow[3];
             $rest_icons = "restricted";
         } else {
             $url = $myrow[3];
             $rest_icons = "";
             // if you want the unlocked icon to show, enter "unrestricted" here
         }
         $current_ctags = explode("|", $myrow["ctags"]);
         // add our $rest_icons info to this array at the beginning
         array_unshift($current_ctags, $rest_icons);
         $icons = showIcons($current_ctags);
         //Check if there is a display note
         if ($myrow["display_note"] == NULL) {
             $display_note_text = "";
         } else {
             $display_note_text = "<strong>" . _("Note:") . " </strong>{$myrow['display_note']}";
         }
         $bonus = "{$blurb}";
         if ($blurb != "") {
             $information = "<img src=\"{$IconPath}/information.png\" border=\"0\" alt=\"" . _("more information") . "\" title=\"" . _("more information") . "\"  id=\"bib-{$bib_id}\" />";
         } else {
             $information = "";
         }
         $items .= "\n\t<tr class=\"zebra {$row_colour}\" valign=\"top\">\n\t\t\n\t\t<td><a href=\"{$url}\" target=\"_blank\"><strong>{$item_title}</strong></a> {$icons}<br/>{$bonus}   {$display_note_text}\n                   \n\t</tr>";
         $row_count++;
     }
     $items .= "</table>";
     return $items;
 }
开发者ID:johnwinsor,项目名称:SubjectsPlus,代码行数:66,代码来源:AllHandler.php

示例8: modifyCollections

 function modifyCollections()
 {
     $db = new Querier();
     for ($i = 0; $i < $this->_collection_count; $i++) {
         $qUpColl = "INSERT INTO faq_faqpage (faq_id, faqpage_id) VALUES (\n                " . scrubData($this->_faq_id, "integer") . ",\n                " . scrubData($this->_collection[$i], "integer") . ")";
         $rUpColl = $db->query($qUpColl);
         $this->_debug .= "<p>3. (update faq_faqpage loop) : {$qUpColl}</p>";
         if ($rUpColl === FALSE) {
             echo blunDer("We have a problem with the faq_faqpage query: {$qUpColl}");
         }
     }
 }
开发者ID:kenirwin,项目名称:SubjectsPlus,代码行数:12,代码来源:FAQ.php

示例9: catch

 *   @author adarby
 *   @date march 2011
 */
use SubjectsPlus\Control\Querier;
$subcat = "video";
$page_title = "Video Admin";
include "../includes/header.php";
try {
} catch (Exception $e) {
    echo $e;
}
if (isset($_GET["limit"])) {
    if ($_GET["limit"] == "all") {
        $limit = "";
    } else {
        $limit = "LIMIT 0," . scrubData($_GET["limit"], "int");
    }
} else {
    $limit = "";
}
$querierVid = new Querier();
$qVid = "SELECT video_id, title, description, source, foreign_id, duration, date, display, vtags\n\tFROM video\n\tORDER BY video_id DESC\n\t{$limit}";
$vidArray = $querierVid->query($qVid);
$row_count1 = 0;
$row_count2 = 0;
$colour1 = "evenrow";
$colour2 = "oddrow";
$vid_list = "";
if ($vidArray) {
    foreach ($vidArray as $value) {
        $row_colour1 = $row_count1 % 2 ? $colour1 : $colour2;
开发者ID:johnwinsor,项目名称:SubjectsPlus,代码行数:31,代码来源:index.php

示例10: substr

if ($action == "generate") {
    if ($installationTypeNew == "offline") {
        $updateCheckerNew = "false";
    }
    if (substr($rootNew, -1) == "/") {
        $rootNew = substr($rootNew, 0, -1);
    }
    if (substr($ftpRootNew, -1) == "/") {
        $ftpRootNew = substr($ftpRootNew, 0, -1);
    }
    if (substr($pathMantisNew, -1) != "/") {
        $pathMantisNew = $pathMantisNew . "/";
    }
    // DAB - scrub the data
    require_once dirname(realpath(__FILE__)) . '/../general/data_funcs.inc.php';
    $scrubData = scrubData($_POST);
    extract($scrubData);
    // -- END Paranoia
    $content = <<<STAMP
<?php
#Application name: PhpCollab
#Status page: 2
#Path by root: ../includes/settings.php

# installation type
\$installationType = "{$installationTypeNew}"; //select "offline" or "online"

# select database application
\$databaseType = "{$databaseTypeNew}"; //select "sqlserver", "postgresql" or "mysql"

# database parameters
开发者ID:ColBT,项目名称:php_tut,代码行数:31,代码来源:updatesettings.php

示例11: array_combine

    }
}
if (isset($_POST["update_disciplines"])) {
    //////////////////////////////////
    // Get the discipline dept data + sort order
    //////////////////////////////////
    //////////////////////
    // Create new array of results
    /////////////////////
    $a = $_POST["discipline_id"];
    $b = $_POST["discipline"];
    $result = array_combine($a, $b);
    // Loop through array, update departments table
    $row_count = 1;
    foreach ($result as $key => $value) {
        $qUpDept = "UPDATE discipline SET\n\t\tdiscipline = " . $db->quote(scrubData($value)) . ", \n\t\tsort = " . $row_count . " \n\t\tWHERE discipline_id = " . scrubData($key, "integer");
        $rUpDept = $db->exec($qUpDept);
        $row_count++;
    }
    $feedback = _("Thy Will Be Done.  discipline list updated.");
}
///////////////
// disciplines
///////////////
$querierDept = new Querier();
$qdiscipline = "select discipline_id, discipline, sort from discipline order by sort, discipline";
$disciplineArray = $querierDept->query($qdiscipline);
foreach ($disciplineArray as $value) {
    $ourlist .= "<li id=\"item-{$value['0']}\" class=\"sortable_item disc-sortable\"><a id=\"delete-{$value['0']}\"><img src=\"{$IconPath}/delete.png\" class=\"pointer\" /></a> &nbsp; <input type=\"text\" size=\"40\" name=\"discipline[]\" value=\"{$value['1']}\" /> <input type=\"hidden\" name=\"discipline_id[]\" value=\"{$value['0']}\" /></li>";
}
$discipline_box = "\n<form id=\"disciplines\" action=\"\" method=\"post\">\n<button class=\"button\" id=\"save_guide\"  class=\"button pure-button pure-button-primary\" style=\"display: block;\" name=\"update_disciplines\" >" . _("SAVE CHANGES") . "</button>\n\n<p>" . _("NOTE:  Disciplines were added to facilitate Serials Solution ingest of data.  This original set was provided by SerSol in Nov 2012. \n    If you are a SerSol customer, you might not want to change these.  Sort may or may not be implemented in your version of SP.") . "</p>\n<p>" . _("Enter discipline type label.") . "</p>\n<br />\n\n<ul id=\"sortable-\" class=\"sortable_list\">\n{$ourlist}\n</ul>\n</form>\n";
开发者ID:kenirwin,项目名称:SubjectsPlus,代码行数:31,代码来源:disciplines.php

示例12: _

         } else {
             print _("Thy Will Be Done.  Source list updated.");
         }
     }
     return;
     // return early so we don't show the stuff that follows
     break;
 case "delete_discipline":
     // Make sure no one is associated with this discipline
     $qChecker = "SELECT * FROM subject, subject_discipline WHERE subject.subject_id = subject_discipline.subject_id\n    AND subject_discipline.discipline_id = " . scrubData($_POST["delete_id"], "integer");
     $rChecker = $db->query($qChecker);
     //print $qChecker;
     if (count($rChecker) != 0) {
         print _("Your request cannot be completed:  There are one or more records linked to this source");
     } else {
         $qDeleteD = "DELETE FROM discipline WHERE discipline_id = " . scrubData($_POST["delete_id"], "integer");
         $rDeleteD = $db->exec($qDeleteD);
         if (!$rDeleteD) {
             echo blunDer("We have a problem with the delete source query: {$qDeleteD}");
         } else {
             print _("Thy Will Be Done.  Discipline list updated.");
         }
     }
     return;
     // return early so we don't show the stuff that follows
     break;
 case "address_lookup":
     //print urlencode($_REQUEST["address"]);
     $endpoint = "http://maps.googleapis.com/maps/api/geocode/json?address=" . urlencode($_REQUEST["address"]) . "&sensor=false";
     $address = curl_get($endpoint);
     //print $address;
开发者ID:kenirwin,项目名称:SubjectsPlus,代码行数:31,代码来源:admin_bits.php

示例13: scrubData

}*/
// do we have more than one tab?
if (count($all_tabs) > 1) {
    $multi_tab = TRUE;
} else {
    $multi_tab = FALSE;
}
// Add tracking image
$tracking_image = "<img style=\"display: none;\" src=\"" . $PublicPath . "track.php?subject=" . scrubData($_GET['subject']) . "&page_title=" . $page_title . "\" />";
print $tracking_image;
print $social_and_search;
?>

<div id="tabs" class="hide-tabs-fouc">
	<div id="main-content" data-subject="<?php 
echo scrubData($_GET['subject']);
?>
" data-url="<?php 
echo getSubjectsURL();
?>
" data-subject-id="<?php 
echo $this_id;
?>
">

		<div id="tab-container">
            <?php 
$printer_tabs = '<div class="printer_tabs"><div class="pure-button pure-button-topsearch print-img-tabs"><img src="../assets/images/printer.png" alt="Print" title="Print"></div></div>';
$printer_no_tabs = '<div class="printer_no_tabs"><div class="pure-button pure-button-topsearch print-img-no-tabs"><img src="../assets/images/printer.png" alt="Print" title="Print"></div></div>';
// Only show tabs if there is more than one tab
if ($multi_tab == TRUE) {
开发者ID:johnwinsor,项目名称:SubjectsPlus,代码行数:31,代码来源:guide.php

示例14: Querier

 case "ingest":
     $db = new Querier();
     // check if we already have a record like this
     $our_id = scrubData($_REQUEST["foreign_id"]);
     $qcheck = "SELECT video_id FROM video WHERE foreign_id = '" . $our_id . "'";
     //print $qcheck;
     $rcheck = $db->query($qcheck);
     if (count($rcheck) == 0) {
         $qinsert = "INSERT INTO video (title, description, source, foreign_id, duration, date, display)\n        values(\"" . $_POST["title"] . "\", \"" . $_POST["description"] . "\", \"" . $_POST["source"] . "\", \"" . $_POST["foreign_id"] . "\", \"" . $_POST["duration"] . "\", \"" . $_POST["upload_date"] . "\",\n          1                \n        )";
         //   print_r ($qinsert);
         $rinsert = $db->exec($qinsert);
         $video_id = $db->last_id();
     } else {
         // Do an update
         $db = new Querier();
         $qupdate = "UPDATE video \n          SET title = " . $db->quote(scrubData($_POST['title'])) . ",\n          description = " . $db->quote(scrubData($_POST['description'], 'richtext')) . ",\n          source = " . $db->quote(scrubData($_POST['source'])) . " ,\n          foreign_id = " . $db->quote(scrubData($_POST['foreign_id'])) . ",\n          duration = " . $db->quote(scrubData($_POST['duration'])) . " ,\n          date = " . $db->quote(scrubData($_POST['upload_date'])) . " ,\n          WHERE foreign_id = " . $our_id;
         //print_r ($qupdate);
         $rupdate = $db->exec($qupdate);
         $video_id = $rupdate[0];
     }
     // insert/update image
     // get small thumbnail
     $image = curl_get($_POST["thumbnail_small"]);
     //$image = file_get_contents($_POST["thumbnail_small"]);
     $new_image = "../../assets/images/video_thumbs/" . $video_id . "_small.jpg";
     file_put_contents($new_image, $image);
     // get medium thumbnail (actually the youtube one is pretty large)
     $image = curl_get($_POST["thumbnail_medium"]);
     //$image = file_get_contents($_POST["thumbnail_medium"]);
     $new_image = "../../assets/images/video_thumbs/" . $video_id . "_medium.jpg";
     file_put_contents($new_image, $image);
开发者ID:kenirwin,项目名称:SubjectsPlus,代码行数:31,代码来源:video_bits.php

示例15: writeTable

 function writeTable($qualifier, $subject_id = '', $description_search = 0)
 {
     global $IconPath;
     global $proxyURL;
     $db = new Querier();
     // sanitize submission
     $subject_id = scrubData($subject_id);
     // Prepare conditions
     $condition1 = "";
     $condition2 = "";
     $condition3 = "";
     switch ($qualifier) {
         case "Num":
             $condition1 = "WHERE left(title, 1)  REGEXP '[[:digit:]]+'";
             $condition2 = "WHERE left(alternate_title, 1)  REGEXP '[[:digit:]]+'";
             break;
         case "All":
             $condition1 = "WHERE title != ''";
             $condition2 = "WHERE alternate_title != ''";
             break;
         case "bysub":
             if (isset($subject_id)) {
                 //get title ids in pluslets' resource token connected to subject
                 $lobjGuide = new Guide($subject_id);
                 $lobjTitleIds = $lobjGuide->getRelatedTitles();
                 $condition1 = "WHERE (subject_id = {$subject_id}";
                 $condition1 .= count($lobjTitleIds) > 0 ? "\nOR t.title_id IN (" . implode(',', $lobjTitleIds) . ")" : "";
                 $condition1 .= ")";
                 $condition2 = "WHERE subject_id = {$subject_id}";
             } else {
                 $condition1 = "WHERE title LIKE " . $db->quote("%" . $qualifier . "%");
                 $condition2 = "WHERE alternate_title LIKE " . $db->quote("%" . $qualifier . "%");
             }
             break;
         case "bytype":
             if (isset($_GET["type"])) {
                 $condition1 = "WHERE ctags LIKE " . $db->quote(scrubData($_GET["type"]));
                 $condition2 = "WHERE ctags LIKE " . $db->quote(scrubData($_GET["type"]));
                 $condition3 = "and alternate_title NOT NULL";
             }
             break;
         case "search":
             $condition1 = "WHERE title LIKE " . $db->quote("%" . $qualifier . "%");
             // If you uncomment the next line, it will search description field
             $condition1 = "WHERE (title LIKE " . $db->quote("%" . $qualifier . "%") . " OR description LIKE " . $db->quote("%" . $qualifier . "%");
             $condition2 = "WHERE alternate_title LIKE " . $db->quote("%" + $qualifier + "%");
             break;
         default:
             // This is the simple output by letter and also the search
             if (strlen($qualifier) == 1) {
                 // Is like the first letter
                 $condition1 = "WHERE title LIKE " . $db->quote($qualifier . "%");
             } else {
                 $condition1 = "WHERE title LIKE " . $db->quote("%" . $qualifier . "%");
             }
             if ($description_search == 1) {
                 // If you uncomment the next line, it will search description field
                 $condition1 = "WHERE (title LIKE " . $db->quote("%" . $qualifier . "%") . " OR description LIKE " . $db->quote("%" . $qualifier . "%") . ")";
             }
             $condition2 = "WHERE alternate_title LIKE " . $db->quote("%" + $qualifier + "%");
     }
     $q1 = "SELECT distinct left(t.title,1) as initial, t.title as newtitle, t.description, location, access_restrictions, t.title_id as this_record,eres_display, display_note, pre, citation_guide, ctags, helpguide\n            FROM title as t\n            INNER JOIN location_title as lt\n            ON t.title_id = lt.title_id\n            INNER JOIN location as l\n            ON lt.location_id = l.location_id\n            INNER JOIN restrictions as r\n            ON l.access_restrictions = r.restrictions_id\n            INNER JOIN rank as rk\n            ON rk.title_id = t.title_id\n            INNER JOIN source as s\n            ON rk.source_id = s.source_id\n            {$condition1}\n            AND eres_display = 'Y'\n            ORDER BY newtitle";
     $q2 = "SELECT distinct left(t.alternate_title,1) as initial, t.alternate_title as newtitle, t.description, location, access_restrictions, t.title_id as this_record,eres_display, display_note, pre, citation_guide, ctags, helpguide\n            FROM title as t\n            INNER JOIN location_title as lt\n            ON t.title_id = lt.title_id\n            INNER JOIN location as l\n            ON lt.location_id = l.location_id\n            INNER JOIN restrictions as r\n            ON l.access_restrictions = r.restrictions_id\n            INNER JOIN rank as rk\n            ON rk.title_id = t.title_id\n            INNER JOIN source as s\n            ON rk.source_id = s.source_id\n            {$condition2}\n\t\t        AND eres_display = 'Y'\n            {$condition3}\n\n\t\t        ORDER BY newtitle";
     $r = $db->query($q1);
     $num_rows = count($r);
     if ($num_rows == 0) {
         return "<div class=\"no_results\">" . _("Sorry, there are no results at this time.") . "</div>";
     }
     // prepare 	header
     $items = "<table width=\"98%\" class=\"item_listing\">";
     $row_count = 0;
     $colour1 = "oddrow";
     $colour2 = "evenrow";
     foreach ($r as $myrow) {
         $row_colour = $row_count % 2 ? $colour1 : $colour2;
         $patterns = "/'|\"/";
         $replacements = "";
         $item_title = $myrow[1];
         if ($myrow["pre"] != "") {
             $item_title = $myrow["pre"] . " " . $item_title;
         }
         $safe_title = trim(preg_replace($patterns, $replacements, $item_title));
         $blurb = $myrow["description"];
         $bib_id = $myrow[5];
         /// CHECK RESTRICTIONS ///
         if ($myrow['4'] == 2 or $myrow['4'] == 3) {
             $url = $proxyURL . $myrow[3];
             $rest_icons = "restricted";
         } elseif ($myrow['4'] == 4) {
             $url = $myrow[3];
             $rest_icons = "restricted";
         } else {
             $url = $myrow[3];
             $rest_icons = "";
             // if you want the unlocked icon to show, enter "unrestricted" here
         }
         $current_ctags = explode("|", $myrow["ctags"]);
         // add our $rest_icons info to this array at the beginning
         array_unshift($current_ctags, $rest_icons);
         $icons = showIcons($current_ctags);
//.........这里部分代码省略.........
开发者ID:kenirwin,项目名称:SubjectsPlus,代码行数:101,代码来源:DbHandler.php


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