Example #1
0
 static function getSignature()
 {
     //people::loadClass();
     $stdout = "";
     // ------------------------------
     // Obtain user data
     // ------------------------------
     functions::gpc_declare_input("usr", false);
     functions::gpc_declare_input("beenthere", false, true);
     $userdata = functions::callMethod('people', 'lib/people', 'doorlabelData');
     // yes, get doorlabel data
     if (empty($userdata)) {
         return BLURB_SORRY_PEOPLE_SEARCH;
     }
     // ------------------------------
     // Adapt user data
     // ------------------------------
     $entry = array();
     if (isset($GLOBALS["usr"]) && $GLOBALS["usr"]) {
         $entry = $userdata[$GLOBALS["usr"]];
         if ($entry["nw_user"] == "sigste") {
             $entry["nw_fullname"] = str_replace("igurdur", "igurĂ°ur", $entry["nw_fullname"]);
         }
         if (!class_exists("fromdb_cv", FALSE)) {
             require_once PATH_CLASSES . "/fromdb/cv.php";
         }
         $dbCv = new fromdb_cv();
         $cvitems = $dbCv->getCvs();
         $entry["nw_cv"] = isset($cvitems[$entry["nw_user"]]) ? $cvitems[$entry["nw_user"]] : "";
     }
     // ------------------------------
     // Output user data or input form
     // ------------------------------
     if (count($entry)) {
         $sig = self::constructSignatures($entry, "en");
         //$userdata = functions::callMethod('people','lib/people','doorlabelData'); // yes, get doorlabel data
         //$stdout .= self::outputSignature($userdata[$GLOBALS["usr"]]);
         //$showform = 0;
         /* FOR SIGNATURE FILES
               header("Content-Type: application/octet-stream");
               print utf8_decode(self::outputSignature($entry));
               die();
         */
         $stdout .= "<div class='col-content-left'>\r\n" . "  <ul class='tightlist'>\r\n" . "    <li class='bottommargin'>Select a <a href='" . $_SERVER["PHP_SELF"] . "?usr="******"usr"] . "#text'><strong>text signature</strong></a></li>\r\n" . "    <li class='bottommargin'>Select a <a href='" . $_SERVER["PHP_SELF"] . "?usr="******"usr"] . "#graphic'><strong>graphic (HTML formatted) signature</strong></a></li>\r\n" . "  <li class='bottommargin'>" . "<a href='" . $_SERVER["PHP_SELF"] . "#maildb_doorlabel'><strong>Back to E-Mail Signature Page</strong></a></li>\r\n" . "  </ul>\r\n" . "</div> <div class='col-content-right'>\r\n" . functions::OutputWikiPage('0', '2458') . "</div><div style='clear:both'><br></div>\r\n" . "\r\n";
         foreach ($sig as $type => $si) {
             $stdout .= PAGE_BREAK . "<hr id='" . $type . "' style='margin-top:2em'>\r\n";
             foreach ($si as $id => $s) {
                 $stdout .= "<h4>" . ucfirst($type) . " Signature Example #" . $id . "</h4>\r\n" . self::outputSignature($s, $type) . "\r\n" . "\r\n";
             }
         }
     } else {
         // leave vertical space for error messages
         unset($GLOBALS["usr"]);
         $stdout .= self::outputSignatureForm($userdata);
     }
     return $stdout;
 }
Example #2
0
 private static function getPeopleSearchCv($qArray = array())
 {
     $cvMatches = $cvitems = array();
     if (empty($qArray)) {
         if (isset($GLOBALS["QUERY"]) && !empty($GLOBALS["QUERY"])) {
             $qArray = $GLOBALS["QUERY"];
         } else {
             return array();
         }
     }
     // --------------------
     // Obtain data
     // --------------------
     if (!class_exists("fromdb_cv", FALSE)) {
         require_once PATH_CLASSES . "/fromdb/cv.php";
     }
     $dbCvs = new fromdb_cv();
     $cvitems = $dbCvs->getCvs();
     if (empty($cvitems)) {
         return array();
     }
     // --------------------
     // Clean data based on AND, OR, and NOT requirements in the query.
     // --------------------
     foreach ($cvitems as $user => $cvi) {
         $udata = isset($cvi["text"]) ? strtolower(strip_tags($cvi["text"])) : "";
         $keep = true;
         foreach ($qArray["not"] as $qA) {
             if (preg_match("/" . $qA . "/", $udata)) {
                 $keep = false;
             }
         }
         if ($keep) {
             $keep = count($qArray["_and"]) ? true : false;
             foreach ($qArray["_and"] as $qA) {
                 if (!preg_match("/" . $qA . "/", $udata)) {
                     $keep = false;
                 }
             }
             foreach ($qArray["_or"] as $qA) {
                 if (preg_match("/" . $qA . "/", $udata)) {
                     $keep = true;
                 }
             }
         }
         if ($keep) {
             $cvMatches[] = $user;
         }
     }
     // --------------------
     return $cvMatches;
 }