Ejemplo n.º 1
0
     default:
         $search["which"] = "(f_public=1 OR f_uid=" . $_SESSION["wcs_user_id"] . ")";
         break;
 }
 $file_key = get_list_of_file_keywords();
 //Auslesen der File Schlüsselwörter
 //Aufbau des eigentlichen Suchstrings
 $sql = "SELECT * FROM " . DB_PREPEND . "phpwcms_file WHERE f_aktiv=1 AND f_trash=0 AND f_kid=1 AND ";
 $sql .= $search["which"] . ";";
 //ob public oder private order keine Angabe
 if ($result = mysql_query($sql, $db) or die("error while running search")) {
     while ($row = mysql_fetch_array($result)) {
         $search["string"] = $row["f_name"] . " " . $row["f_shortinfo"] . " " . $row["f_longinfo"];
         $search["string"] = str_replace("\r\n", " ", $search["string"]);
         $search["string"] = str_replace("\n", " ", $search["string"]);
         $search["string"] .= add_keywords_to_search($file_key, $row["f_keywords"]);
         //fügt freie Keywords zum Suchstring hinzu
         foreach ($search["key"] as $value) {
             if (preg_match("/" . preg_quote($value, "/") . "/i", $search["string"])) {
                 if ($search["andor"]) {
                     if (!isset($search["result"][$row["f_id"]])) {
                         //AND clause
                         $search["result"][$row["f_id"]] = 1;
                     } else {
                         $search["result"][$row["f_id"]]++;
                     }
                 } else {
                     $search["result"][$row["f_id"]] = 1;
                     //OR clause
                 }
             }
Ejemplo n.º 2
0
.gif" alt="" width="12" height="13" /><img src="img/button/public_12x13_<?php 
            echo $row["f_public"];
            ?>
.gif" alt="" width="12" height="13" /></td>
      </tr>
    </table></td>
    <td bgcolor="#F5F8F9"><img src="img/leer.gif" alt="" width="1" height="1" /></td>
  </tr>
  <tr><td colspan="4" bgcolor="#F5F8F9"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
  <tr><td colspan="4" bgcolor="#CDDEE4"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
  <tr><td colspan="4"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
  <tr>
    <td><img src="img/leer.gif" alt="" width="1" height="5" /></td>
    <td><img src="img/leer.gif" alt="" width="1" height="5" /></td>
    <td class="v10"><?php 
            echo $BL['KEYWORDS'] . ": " . html_specialchars($row["f_shortinfo"] . add_keywords_to_search($file_key, $row["f_keywords"]));
            ?>
</td>
    <td><img src="img/leer.gif" alt="" width="1" height="5" /></td>
  </tr>
  <tr><td colspan="4"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
<?php 
            if ($thumb_image != false) {
                ?>
  <tr><td colspan="4" bgcolor="#CDDEE4"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
  <tr><td colspan="4" bgcolor="#F5F8F9"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
  <tr>
    <td bgcolor="#F5F8F9"><img src="img/leer.gif" alt="" width="1" height="1" /></td>
    <td colspan="2" align="center" bgcolor="#F5F8F9"><?php 
                echo '<img src="' . PHPWCMS_IMAGES . $thumb_image[0] . '" border="0" ' . $thumb_image[3] . '>';
                ?>