本文整理汇总了PHP中functions::obscurify_email方法的典型用法代码示例。如果您正苦于以下问题:PHP functions::obscurify_email方法的具体用法?PHP functions::obscurify_email怎么用?PHP functions::obscurify_email使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类functions
的用法示例。
在下文中一共展示了functions::obscurify_email方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getArrivingVisitors
function getArrivingVisitors($period = "week", $delta = 0)
{
$delta = $delta ? 0 : 7;
$saturday1 = date("Y-m-d", time() - 3600 + ($delta - 1 - date("w", time() - 3600)) * 86400);
$sunday = date("Y-m-d", time() - 3600 + ($delta - date("w", time() - 3600)) * 86400);
$saturday2 = date("Y-m-d", time() - 3600 + ($delta + 6 - date("w", time() - 3600)) * 86400);
$where = "";
switch ($period) {
// %w = day of the week, Sun=0
case "month":
$where = "FROM_UNIXTIME(V.v_start,'%Y-%m-%d') BETWEEN " . "DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -DATE_FORMAT(NOW(),'%w')+1 DAY),'%Y-%m-%d') " . "AND " . "DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -DATE_FORMAT(NOW(),'%w')+31 DAY),'%Y-%m-%d') ";
break;
// %w = day of the week, Sun=0
// %w = day of the week, Sun=0
case "week":
$where = "FROM_UNIXTIME(V.v_start,'%Y-%m-%d') BETWEEN " . "DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -DATE_FORMAT(NOW(),'%w')+1 DAY),'%Y-%m-%d') " . "AND " . "DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -DATE_FORMAT(NOW(),'%w')+7 DAY),'%Y-%m-%d') ";
break;
// %w = day of the week, Sun=0
// %w = day of the week, Sun=0
case "extweek":
$where = "FROM_UNIXTIME(V.v_start,'%Y-%m-%d') BETWEEN '" . $saturday1 . "' AND '" . $saturday2 . "'";
break;
// If today=Monday, also list arrivals from weekend
// If today=Monday, also list arrivals from weekend
case "today":
$where = date("l") == "Monday" ? "FROM_UNIXTIME(V.v_start,'%Y-%m-%d') BETWEEN " . "DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -2 DAY),'%Y-%m-%d') " . "AND " . "DATE_FORMAT(NOW(),'%Y-%m-%d') " : "FROM_UNIXTIME(V.v_start,'%Y-%m-%d') BETWEEN " . "DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -1 DAY),'%Y-%m-%d') " . "AND " . "DATE_FORMAT(NOW(),'%Y-%m-%d') ";
//"FROM_UNIXTIME(V.v_start,'%Y-%m-%d')=CURDATE() ";
break;
}
// end switch
// ------------------------------------------------------
// Query database
// ------------------------------------------------------
$sql = "\n SELECT\n IF(E.e_code>0,E.e_name,'Visitors') AS 'event',\n CONCAT(A.av_firstname,' ',A.av_lastname) AS 'personname',\n CONCAT(IFNULL(NULLIF(CONCAT(A.av_salutation,' '),' '),''),A.av_firstname,' ',A.av_lastname) AS 'personnametitle',\n CONCAT(A.av_institute,IFNULL(NULLIF(CONCAT(', ',A.av_citizenship),', '),'')) AS 'affiliation',\n V.v_start,\n E.e_code AS 'eventid',\n FROM_UNIXTIME(V.v_start,'%Y-%m-%d') AS 'startdate',\n FROM_UNIXTIME(V.v_end,'%Y-%m-%d') AS 'enddate',\n A.av_email\n FROM\n abs_visits AS V\n LEFT JOIN zzz_avatars AS A ON A.av_id=V.v_avid\n LEFT JOIN abs_events AS E ON E.e_code=SUBSTRING(V.v_code,1,4)\n WHERE " . $where . " AND (V.v_status <> 'STATUS_NO') " . " ORDER BY\n E.e_code ASC,\n V.v_start,\n A.av_lastname,\n A.av_firstname";
$res = $this->query($sql, IS_TESTSERVER);
// includes a call to connect
// ------------------------------------------------------
// Assemble $visit[] from resultset
// ------------------------------------------------------
$visit = array();
if ($this->num_rows($res)) {
while ($cell = $this->next_record_assoc($res)) {
// keep only visitors if their event is not classified as "nodisplay":
$subpath = event::getEventByAgendaid($cell["eventid"], "subpath");
if (is_null($GLOBALS["documentClass"]->getEventConfig($subpath, "nodisplay")) || !$GLOBALS["documentClass"]->getEventConfig($subpath, "nodisplay")) {
$affiliation = !empty($cell["affiliation"]) ? $cell["affiliation"] : (!empty($cell["r_home"]) ? $cell["r_home"] : "");
$a = strtolower($affiliation);
if (strpos($a, "kth") === false && strpos($a, "royal institute of technology") === false && strpos($a, "stockholm u") === false && $a != "nordita" && strpos($a, "fysikum") === false && strpos($a, "okc") === false && strpos($a, "oskar klein center for cosmoparticle physics") === false && strpos($a, "dept. of astronomy") === false) {
$visit[strtotime($cell["startdate"])][$cell["event"]][] = array("name" => str_replace(" ", " ", $cell["personname"]), "affiliation" => $affiliation, "dates" => functions::readableDateInterval($cell["startdate"], $cell["enddate"]), "email" => functions::obscurify_email($cell["av_email"]));
}
}
// end if
}
// end while
}
ksort($visit);
return $visit;
}
示例2: OutputRoomsList
static function OutputRoomsList($twocolumns = false, $id = "", $class = "", $fromAlbaNova = true, $fromKthCampus = false)
{
$stdout = $roomsmap = "";
// ----------------------
if (!class_exists("fromdb_rooms", FALSE)) {
require_once PATH_CLASSES . "/fromdb/rooms.php";
}
$dbRooms = new fromdb_rooms(FALSE);
// ----------------------
$bookableRooms = $dbRooms->getRoomsByType($fromAlbaNova, $fromKthCampus);
if (!count($bookableRooms)) {
return BLURB_SORRY_NO_ROOMS;
}
// ----------------------
foreach ($bookableRooms as $campus => $items) {
switch ($campus) {
case "a":
// AlbaNova campus
$roomsmap = "<div id='map' class='col-content-center'>\r\n" . " <p class='bottommargin'>This is a list of <strong>bookable rooms in AlbaNova</strong>: auditoria, seminar rooms, lecture rooms and a selection of group rooms (note that the group rooms of the astronomy department on floor 6 in the AlbaNova main building are not in the list). <span class='only_online'>The map is clickable. There is a separate <strong><a href='" . preg_replace("|/[^/]*/index.php|", "/kth/index.php", $_SERVER["PHP_SELF"]) . "'>map of lecture rooms on the KTH Campus</a></strong>.</span></p>\r\n" . " <p class='only_online'><img src='img/_wiki/bookable_rooms.png' alt='' usemap='#roomsmap'></p>\r\n" . " <p class='only_print'><img src='img/_wiki/bookable_rooms_print.png' alt=''></p>\r\n" . " <map name='roomsmap' id='roomsmap'>\r\n" . " <area shape='poly' coords='533,140,539,117,554,117,567,94,597,106,583,138' href='" . $_SERVER["PHP_SELF"] . "#fr4' alt='Auditorium FR4 Oskar Klein' title='Auditorium FR4 Oskar Klein'>\r\n" . " <area shape='poly' coords='586,254,596,231,627,245,602,289' href='" . $_SERVER["PHP_SELF"] . "#fd5' alt='Auditorium FD5 The Svedberg' title='Auditorium FD5 The Svedberg'>\r\n" . " <area shape='poly' coords='188,254,199,207,224,211,211,258' href='" . $_SERVER["PHP_SELF"] . "#fa31' alt='Seminar Room FA31 Héctor Rubinstein' title='Seminar Room FA31 Héctor Rubinstein'>\r\n" . " <area shape='ploy' coords='211,259,227,211,249,218,235,265' href='" . $_SERVER["PHP_SELF"] . "#fa32' alt='Seminar Room FA32' title='Seminar Room FA32'>\r\n" . " <area shape='poly' coords='628,240,655,197,669,205,640,247' href='" . $_SERVER["PHP_SELF"] . "#fb51' alt='Lecture room FB51' title='Lecture room FB51'>\r\n" . " <area shape='poly' coords='640,248,670,205,686,214,656,258' href='" . $_SERVER["PHP_SELF"] . "#fb52' alt='Lecture room FB52' title='Lecture room FB52'>\r\n" . " <area shape='poly' coords='656,259,686,217,703,225,671,269' href='" . $_SERVER["PHP_SELF"] . "#fb53' alt='Lecture room FB53' title='Lecture room FB53'>\r\n" . " <area shape='poly' coords='671,270,703,230,716,239,681,277' href='" . $_SERVER["PHP_SELF"] . "#fb54' alt='Lecture room FB54' title='Lecture room FB54'>\r\n" . " <area shape='poly' coords='681,278,716,239,728,250,697,289' href='" . $_SERVER["PHP_SELF"] . "#fb55' alt='Lecture room FB55' title='Lecture room FB55'>\r\n" . " <area shape='poly' coords='627,84,624,39,671,47,640,92' href='" . $_SERVER["PHP_SELF"] . "#fb41' alt='Lecture room FB41' title='Lecture room FB41'>\r\n" . " <area shape='poly' coords='639,95,671,46,687,590,657,105' href='" . $_SERVER["PHP_SELF"] . "#fb42' alt='Lecture room FB42' title='Lecture room FB42'>\r\n" . " <area shape='poly' coords='595,137,620,91,642,104,615,145' href='" . $_SERVER["PHP_SELF"] . "#fd41' alt='Lecture room FD41' title='Lecture room FD41'>\r\n" . " <area shape='rect' coords='207,144,240,174' href='" . $_SERVER["PHP_SELF"] . "#fp41' alt='Lecture room FP41' title='Lecture room FP41'>\r\n" . " <area shape='rect' coords='60,7,92,35' href='" . $_SERVER["PHP_SELF"] . "#rb15' alt='Lecture room RB15' title='Lecture room RB15'>\r\n" . " <area shape='rect' coords='266,46,320,63' href='" . $_SERVER["PHP_SELF"] . "#132027' alt='Group Room 132:027 Nordita East Lunch Room' title='Group Room 132:027 Nordita Main Lunch Room'>\r\n" . " <area shape='rect' coords='236,64,315,86' href='" . $_SERVER["PHP_SELF"] . "#132028' alt='Group Room 132:028 Nordita East Seminar Room' title='Group Room 132:028 Nordita Main Seminar Room'>\r\n" . " <area shape='rect' coords='186,45,239,63' href='" . $_SERVER["PHP_SELF"] . "#122022' alt='Group Room 122:022 Nordita West Lunch Room' title='Group Room 122:022 Nordita West Lunch Room'>\r\n" . " <area shape='rect' coords='184,64,235,84' href='" . $_SERVER["PHP_SELF"] . "#122026' alt='Group Room 122:026 Nordita West Seminar Room' title='Group Room 122:026 Nordita West Seminar Room'>\r\n" . " <area shape='rect' coords='400,184,425,250' href='" . $_SERVER["PHP_SELF"] . "#a51003' alt='Group Room A5:1003' title='Group Room A5:1003'>\r\n" . " <area shape='rect' coords='488,187,506,254' href='" . $_SERVER["PHP_SELF"] . "#a51041' alt='Group Room A5:1041' title='Group Room A5:1041'>\r\n" . " <area shape='poly' coords='549,191,535,255,547,259,568,192' href='" . $_SERVER["PHP_SELF"] . "#a51069' alt='Group Room A5:0169' title='Group Room A5:0169'>\r\n" . " <area shape='rect' coords='400,29,432,93' href='" . $_SERVER["PHP_SELF"] . "#a41003' alt='Group Room A4:1003' title='Group Room A4:1003'>\r\n" . " <area shape='rect' coords='488,33,506,98' href='" . $_SERVER["PHP_SELF"] . "#a41041' alt='Group Room A4:1041' title='Group Room A4:1041'>\r\n" . " <area shape='rect' coords='46,227,73,290' href='" . $_SERVER["PHP_SELF"] . "#a31003' alt='Group Room A3:1003' title='Group Room A3:1003'>\r\n" . " </map>\r\n" . "</div>\r\n";
break;
case "k":
// KTH campus
$roomsmap = "<p></p>\r\n";
break;
}
// end switch
// ----------------------
$stdout .= $roomsmap;
if ($twocolumns) {
$stdout .= "<div class='col-content-left'>\r\n";
}
foreach ($items as $typeid => $item) {
$type = "";
switch ($typeid) {
case "a":
$type = "Auditorium";
$types = "Auditoria";
break;
case "s":
$type = "Seminar Room";
$types = "Seminar Rooms";
$stdout .= "<hr class='sep'>\r\n";
break;
case "l":
$type = "Lecture Room";
$types = "Lecture Rooms";
if ($twocolumns && $fromKthCampus) {
$stdout .= "<hr class='sep only_print'>\r\n</div> <div class='col-content-right'>\r\n";
} else {
$stdout .= "<hr class='sep'>\r\n";
}
break;
case "g":
$type = "Group Room";
$types = "Group Rooms";
$stdout .= "";
if ($twocolumns && $fromAlbaNova) {
$stdout .= "<hr class='sep only_print'>\r\n</div> <div class='col-content-right'>\r\n";
} else {
$stdout .= "<hr class='sep'>\r\n";
}
break;
}
if (!empty($type)) {
$stdout .= "<h3>" . $types . "</h3>\r\n\r\n";
}
foreach ($item as $it) {
//$identifier = !empty($it["an_id"]) ? $it["an_id"] : $it["roomnumber"];
$identifier = $it["id"];
//$roomcode = empty($it["an_id"]) ? "<em>N/A</em>" : $it["an_id"];
$stdout .= " <p id='" . strtolower(str_replace(":", "", $identifier)) . "' class='roomname'>" . $type . " " . $identifier . (!empty($it["name"]) ? " "" . $it["name"] . """ : "") . "</p>\r\n";
$file = "img/_wiki/rooms_" . strtolower(str_replace(":", "", $identifier)) . ".png";
if (file_exists(INCLEVEL . $file)) {
$stdout .= " <p><img src='" . $file . "' alt='' style='margin:0.5em 0 -1em 1.5em'></p>\r\n";
}
$stdout .= " <dl>\r\n" . " <dd><em>Capacity</em>: <strong>" . (!empty($it["capacity"]) ? $it["capacity"] . " persons" : "[unknown]") . "</strong></dd>\r\n" . " <dd><em>Room number</em>: " . $it["roomnumber"] . "</dd>\r\n" . (empty($roomcode) || empty($it["an_id"]) ? "" : " <dd><em>Room code for bookings</em>: " . $roomcode . "</dd>\r\n") . "";
switch ($it["booktype_id"]) {
case 1:
// -- Book through Albanova reception (Albanova campus)
$stdout .= " <dd><em>Book</em>: send e-mail to <strong>" . functions::obscurify_email("reception@albanova.se") . "</strong></dd>\r\n" . " <dd><em>Check availability</em>: " . "<strong><a href='http://www.kth.se/schema/?" . "showweekend=false" . "&outputview=table" . "&location=" . strtolower($identifier) . "&start=" . date("Y-m-d") . "" . "&end=" . date("Y-m-d") . "'>www.kth.se/schema</a></strong></dd>\r\n";
break;
case 2:
// -- Book through rooms.albanova.se
$stdout .= " <dd><em>Book and Check availability</em>: " . "<strong><a href='http://rooms.albanova.se/view_week.php?" . "area=" . $it["rbs_area"] . "&selectroom=" . $it["rbs_id"] . "'>" . "rooms.albanova.se</a></strong></dd>\r\n";
break;
case 3:
// -- Book on paper on door
$stdout .= " <dd><em>Book</em>: on a paper on the door of the room</dd>\r\n";
break;
case 4:
// -- Book through KTH booking system (KTH Campus)
/* OLD INTERFACE; keep for reference
// minSeats=50&maxSeats=55
$stdout .=
" <dd><em>Book</em>: via the <strong>AlbaNova reception</strong> " .
"(extension 8444)</dd>\r\n" .
" <dd><em>Check availability</em>: " .
"<strong><a href='http://lokal2.timeedit.se/kth/roombookings.jsp?" .
"element=week" .
"&roomId=" . $it["kth_id"] .
//.........这里部分代码省略.........
示例3: drawSubscriptionsList
private static function drawSubscriptionsList($table = "subscriber", $dbData = array(), $numberOfSubscribers = 0, $enableEditing = true)
{
if (!in_array($table, array("subscriber", "invitee", "mailman"))) {
return "";
}
$stdout = "";
$news_url = isInPath("/" . PATH_NEWSEDITTEST . "/") ? PATH_NEWSTEST : PATH_NEWS;
switch ($table) {
case "subscriber":
$stdout .= "<p style='font-size:1.2em'>A <strong>subscriber</strong> is someone who has " . "agreed to get newsletter announcement mails, either by " . "<a href='" . $news_url . "/about/subscribe/index.php'><strong>subscribing online</strong></a> " . "or by <strong>clicking on a subscription link in an</strong> " . "<a href='" . SUBSITE . "/subscriptions/invite_send/index.php'><strong>invitation letter</strong></a> " . "sent by Nordita.</p>\r\n" . "<p style='font-size:1.2em'>A subscriber can choose to " . "<a href='" . $news_url . "/about/unsubscribe/index.php'><strong>unsubscribe online</strong></a>, " . "or <strong>click an unsubscription link at the bottom of a newsletter announcement mail</strong>. " . "Below you can also <strong>manually remove a subscriber</strong> from the mailing list " . "<span class='nowrap'>(click on <img src='img/_icons/i-drop.png' alt='delete' " . "style='vertical-align:middle'> icon)</span>. You can undo manual unsubscriptions, but if a person " . "has chosen to unsubscribe, you are not allowed to override that decision.</span></p>\r\n" . PADDED_HR;
if (empty($dbData)) {
return $stdout .= functions::boxMessage("error", "There are currently <strong>no subscriptions</strong>.");
}
$stdout .= "<h3 class='bottommargin'>List of current " . "<strong> " . $numberOfSubscribers . "</strong> " . "active subscribers:</h3>\r\n" . "\r\n";
break;
case "invitee":
$stdout .= "<p style='font-size:1.2em'>Newsletter announcements should only be sent to people who " . "have agreed to receive them. In practice this means <strong>the announcement will only be " . "sent to subscribers</strong>.</p>" . "<p style='font-size:1.2em'><strong>You can send a one-time invitation mail</strong> to people on an " . "<em>invitation list</em>, which you put together below. In the invitaion mail are instructions " . "on how to <a href='" . $news_url . "/about/subscribe/index.php'><strong>subscribe</strong></a> " . "to the announcement mails. Only if the invitees choose to subscribe will they receive future " . "newsletter announcements.</p>\r\n" . PADDED_HR . "<div style='margin-bottom:2em'>\r\n" . " <form method='post' action='" . $_SERVER["PHP_SELF"] . "' style='display:inline;margin-right:3em'>\r\n" . " <input type='submit' value='Add New People to the Invitation List'>\r\n" . " <input type='hidden' name='add' value='1'>\r\n" . " </form>\r\n" . " <form method='post' action='" . $_SERVER["PHP_SELF"] . "' style='display:inline'>\r\n" . " <input type='submit' value='Add/Update Current Nordita Staff, Board and Committees'>\r\n" . " <input type='hidden' name='staff' value='1'>\r\n" . " </form>\r\n" . "</div>\r\n" . PADDED_HR;
if (empty($dbData)) {
return $stdout . functions::boxMessage("error", "There are currently <strong>no people</strong> on the invitation list.");
}
$stdout .= "<h3 class='bottommargin'>List of the " . "<strong> " . $numberOfSubscribers . "</strong> " . "people in the list that have not yet been invited:</h3>\r\n" . "\r\n";
break;
case "mailman":
if (!NEWS_DEBUG) {
$stdout .= "<div style='margin-bottom:2em'>\r\n" . " <form method='post' action='" . $_SERVER["PHP_SELF"] . "' style='display:inline;margin-right:3em'>\r\n" . " <input type='submit' value='Add New People to the Mailing List'>\r\n" . " <input type='hidden' name='add' value='1'>\r\n" . " </form>\r\n" . "</div>\r\n" . PADDED_HR;
}
$stdout .= "<h3 class='bottommargin'>List of current " . "<strong> " . $numberOfSubscribers . "</strong> " . "active list members:</h3>\r\n" . "\r\n";
break;
}
// end switch
// Rearrange $dbData as array $data
// Assemble $_SESSION["plaintext"]
$_SESSION["plaintext"] = "";
foreach ($dbData as $item) {
$data[$item["email"][0]][] = $item;
if (isset($item["status_id"]) && $item["status_id"] == NEWS_ACTIVE) {
$_SESSION["plaintext"] .= $item["email"] . "\n";
}
}
$stdout .= "<div id='jtabs' class='notabs'>\r\n" . " <ul>\r\n";
$i = 0;
foreach ($data as $initial => $items) {
$allinitials[$initial] = $i++;
$stdout .= " <li><a href='" . $_SERVER["PHP_SELF"] . "#jtabs-" . $initial . "'>" . strtoupper($initial) . "</a></li>\r\n";
}
$stdout .= " </ul>\r\n";
if (in_array($table, array("subscriber", "mailman"))) {
foreach ($data as $initial => $items) {
$stdout .= " <div id='jtabs-" . $initial . "'>\r\n" . " <form id='edit' method='post' action='" . $_SERVER["PHP_SELF"] . "' style='margin-bottom:2em'>\r\n" . " <table style='width:100%'>\r\n" . " <tr>\r\n" . " <th></th>\r\n" . " <th class='b_zebra0' style='width:30%'>E-Mail</th>\r\n" . " <th class='b_zebra0' style='width:20%'>Name/Comment</th>\r\n" . " <th class='b_zebra0'>Date Joined</th>\r\n" . " <th class='b_zebra0'>Source</th>\r\n" . " <th class='b_zebra0'>Status</th>\r\n";
if ($enableEditing) {
$stdout .= " <th style='width:1em'></th>\r\n" . " <th></th>\r\n" . " <th></th>\r\n";
}
$stdout .= " </tr>\r\n";
$i = $k = 1;
foreach ($items as $item) {
$u = $item["status_id"] != NEWS_ACTIVE ? " deleted italic" : "";
$stdout .= " <tr>\r\n" . " <td>" . $k . "</td>\r\n" . " <td class='b_zebra" . $i . $u . "'>" . functions::obscurify_email($item["email"]) . "</td>\r\n" . " <td class='b_zebra" . $i . $u . "'>" . $item["comment"] . "</td>\r\n" . " <td class='b_zebra" . $i . $u . "'>" . $item["date_created"] . "</td>\r\n" . " <td class='b_zebra" . $i . $u . "'>" . $item["source"] . "</td>\r\n" . " <td class='b_zebra" . $i . "'>" . $item["status"] . "</td>\r\n";
//" <td class='b_zebra".$i.$u."'>" . $item["source"]["subscribersource"] . "</td>\r\n" .
//" <td class='b_zebra".$i."'>" . $item["status"]["subscriberstatus"] . "</td>\r\n";
if ($enableEditing) {
$stdout .= " <td></td>\r\n" . " <td><button class='plain' type='submit' name='edit' " . "value='" . $item["email"] . "' title='Edit this record'>" . "<img src='img/_icons/i-edit-black.png' alt='Edit' title='Edit this record'>" . "</button></td>\r\n" . ($item["status_id"] == NEWS_ACTIVE || $table == "mailman" ? " <td><button class='plain' type='submit' name='delete' " . "value='" . $item["email"] . "' title='Remove this record'>" . "<img src='img/_icons/i-drop.png' alt='Delete' title='Remove this record'>" . "</button></td>\r\n" : "");
}
$stdout .= " </tr>\r\n";
$i = 3 - $i;
$k++;
}
$stdout .= " </table>\r\n" . " </form>\r\n" . " <form method='post' action='" . $_SERVER["PHP_SELF"] . "' " . "style='margin-top:-1em'>\r\n" . " [<input type='submit' value='Reload this page' " . "class='fakelink' style='font-size:1em'>]\r\n" . " <input type='hidden' name='initial' value='" . $item["email"][0] . "'>\r\n" . " <input type='hidden' name='reload' value='1'>\r\n" . " </form>\r\n" . " </div>\r\n";
}
} elseif (in_array($table, array("invitee"))) {
foreach ($data as $initial => $items) {
$stdout .= " <div id='jtabs-" . $initial . "'>\r\n" . " <form id='edit' method='post' action='" . $_SERVER["PHP_SELF"] . "' style='margin-bottom:2em'>\r\n" . " <table style='width:100%'>\r\n" . " <tr>\r\n" . " <th class='b_zebra0 nowrap' style='width:25%'>E-Mail</th>\r\n" . " <th class='b_zebra0' style='width:20%'>Name</th>\r\n" . " <th class='b_zebra0' style='width:20%'>Comment</th>\r\n" . " <th class='b_zebra0'>Source</th>\r\n" . " <th class='b_zebra0'>Date Added</th>\r\n" . " <th class='b_zebra0 nowrap' style='width:20%'>Invitation Sent</th>\r\n";
if ($enableEditing) {
$stdout .= " <th style='width:1em'></th>\r\n" . " <th></th>\r\n" . " <th></th>\r\n";
}
$stdout .= " </tr>\r\n";
$i = 1;
foreach ($items as $item) {
if ($item["sent"]) {
$u = " deleted italic";
$status = $item["date_invited"];
} elseif ($item["status_id"] != NEWS_ACTIVE) {
$u = " deleted italic";
$status = "Not yet";
} else {
$u = "";
$status = "Not yet";
}
$stdout .= " <tr>\r\n" . " <td class='b_zebra" . $i . $u . " nowrap'>" . functions::obscurify_email($item["email"]) . "</td>\r\n" . " <td class='b_zebra" . $i . $u . "'>" . $item["firstname"] . " " . $item["lastname"] . "</td>\r\n" . " <td class='b_zebra" . $i . $u . "'>" . $item["comment"] . "</td>\r\n" . " <td class='b_zebra" . $i . $u . "'>" . $item["source"] . "</td>\r\n" . " <td class='b_zebra" . $i . $u . "'>" . $item["date_created"] . "</td>\r\n" . " <td class='b_zebra" . $i . $u . "'>" . $status . "</td>\r\n";
if ($enableEditing) {
$stdout .= " <td></td>\r\n" . " <td><button class='plain' type='submit' name='edit' " . "value='" . $item["email"] . "' title='Edit this record'>" . "<img src='img/_icons/i-edit-black.png' alt='Edit' title='Edit this record'>" . "</button></td>\r\n" . (empty($u) ? " <td><button class='plain' type='submit' name='delete' " . "value='" . $item["email"] . "' title='Remove this record'>" . "<img src='img/_icons/i-drop.png' alt='Delete' title='Remove this record'>" . "</button></td>\r\n" : "");
}
$stdout .= " </tr>\r\n";
$i = 3 - $i;
}
$stdout .= " </table>\r\n" . " </form>\r\n" . " <form method='post' action='" . $_SERVER["PHP_SELF"] . "' " . "style='margin-top:-1em'>\r\n" . " [<input type='submit' value='Reload this page' " . "class='fakelink' style='font-size:1em'>]\r\n" . " <input type='hidden' name='reload' value='1'>\r\n" . " <input type='hidden' name='initial' value='" . $item["email"][0] . "'>\r\n" . " </form>\r\n" . " </div>\r\n";
}
}
$stdout .= "</div>\r\n" . "<form method='post' action='" . SUBSITE . "/subscriptions/plaintext/index.php'>\r\n" . " [<input type='submit' value='Plaintext list of all active e-mail addresses' " . "class='fakelink' style='font-size:1em'>]\r\n" . "</form>\r\n" . "\r\n";
// Add jQuery script
functions::gpc_declare_input("initial", "", false);
//.........这里部分代码省略.........
示例4: outputPeopleLayoutBox
private static function outputPeopleLayoutBox($userarray = array())
{
if (empty($userarray)) {
return BLURB_SORRY_PEOPLE_SEARCH . "<!-- outputPeopleLayoutBox -->\r\n";
}
$stdout = "";
// ---------------------------------------------------------------------------
// SET WHICH COLUMNS TO DISPLAY
// ---------------------------------------------------------------------------
$fields = array("nw_fullname_reverse");
$defaultSortby = "nw_fullname_reverse_sortable";
// ---------------------------------------------------------------------------
// REARRANGE DATA INTO CONVENIENT OUTPUT ARRAYS
// Input: $userarray[username][fieldname] = array(record)
// Output: $peopleEntries[][][]
// ---------------------------------------------------------------------------
if (!class_exists("search", FALSE)) {
require_once PATH_CLASSES . "/lib/search.php";
}
if (!isset($GLOBALS["QUERY"])) {
search::analyzeQuery();
}
$userarray = self::adaptForOutput($userarray, "", "", $fields);
$userarrayMod = $userarray;
foreach ($userarray as $usr => $entry) {
// -- Trim CV field around matches
if (isset($entry["nw_cv"]["plain"]) && !empty($entry["nw_cv"]["plain"]) && isset($GLOBALS["QUERY"]["_andor"])) {
$userarrayMod[$usr]["nw_cv"]["plain"] = "... " . search::chopMatchText($GLOBALS["QUERY"]["_andor"], $entry["nw_cv"]["plain"]);
//$userarrayMod[$usr]["nw_cv"]["plain"] = search::trimMatchText($entry["nw_cv"]["plain"]);
}
// -- Mark hits as bold
foreach ($entry as $key => $val) {
if ($key == "nw_email_plain" && !empty($val)) {
list($u, $d) = explode("@", $val);
$userarrayMod[$usr][$key] = search::auxOutputFormat(htmlspecialchars_decode(strip_tags($u)), $GLOBALS["QUERY"]["_andor"]) . "@" . $d;
} elseif ($key == "nw_cv" && isset($val["plain"])) {
$userarrayMod[$usr][$key]["plain"] = search::auxOutputFormat(htmlspecialchars_decode(strip_tags($val["plain"])), $GLOBALS["QUERY"]["_andor"]);
} elseif (!in_array($key, array("nw_image_small", "nw_user"))) {
$userarrayMod[$usr][$key] = search::auxOutputFormat(htmlspecialchars_decode(strip_tags($val)), $GLOBALS["QUERY"]["_andor"]);
}
}
// -- Obscurify e-mail addresses
$a = explode("@", $userarrayMod[$usr]["nw_email_plain"]);
if (count($a) == 2) {
$userarrayMod[$usr]["nw_email_plain"] = $a[0] . functions::obscurify_email("@" . $a[1]);
}
}
// ---------------------------------------------------------------------------
// OUTPUT TO SCREEN
// ---------------------------------------------------------------------------
$stdout .= " <div id='people-list'>\r\n" . "\r\n" . (!empty($doctitle) ? " <h2>" . $doctitle . "</h2>\r\n" : "") . "\r\n" . " <table class='box'>\r\n";
foreach ($userarrayMod as $usr => $entry) {
$stdout .= " <tr>\r\n" . " <td class='img' style='width:60px!important'>\r\n" . " <a href='people/staff/index.php?" . "u=" . $entry["nw_user"] . "'>" . "<img src='" . $entry["nw_image_small"] . "' alt='' class='darkshadow'></a>\r\n" . " </td>\r\n" . " <td>\r\n" . " <p class='fullname'><a href='people/staff/index.php?" . "u=" . $entry["nw_user"] . "'>" . str_replace(" ", " ", $entry["nw_fullname"]) . "</a></p>\r\n" . (!empty($entry["nw_leaveofabsence"]) ? " <p>» <em>" . $entry["nw_leaveofabsence"] . "</em></p>\r\n" : "") . " <p>" . $entry["nw_employeeTitle"] . "</p>\r\n" . " <p>" . $entry["nw_groupShort"] . "</p>\r\n" . (!empty($entry["nw_email"]) ? " <p><em>E-mail</em>: " . $entry["nw_email_plain"] . "</p>\r\n" : "") . (!empty($entry["nw_office"]) ? " <p><em>Room</em>: " . $entry["nw_office"] . "</p>\r\n" : "") . (!empty($entry["nw_phone_linked"]) ? " <p><em>Phone</em>: " . $entry["nw_phone_linked"] . "</p>\r\n" : "") . (!empty($entry["nw_city"]) ? " <p><em>Nordita branch</em>: " . $entry["nw_city"] . "</p>\r\n" : " ") . (isset($entry["nw_cv"]["plain"]) && !empty($entry["nw_cv"]["plain"]) && strpos($entry["nw_cv"]["plain"], "<strong>") !== false ? " <dl><dt><em>CV and Research Interests</em>:</dt><dd>" . $entry["nw_cv"]["plain"] . "</dd></dl>\r\n" : " ") . " </td>\r\n" . " </tr>\r\n";
}
// end foreach
$stdout .= " </table>\r\n" . "\r\n" . " </div> <!-- people-list -->\r\n";
// -------------------------------------------------
return $stdout;
}
示例5: postParsingCleanup
function postParsingCleanup($decodedpage)
{
// Repeat comment removal to affect also included templates
$decodedpage = preg_replace("/<!--.+-->/imsU", "", $decodedpage);
while (preg_match("/([a-z,A-Z,0-9,\\.]*)\\@([a-z,A-Z,0-9,\\.]*)/iU", $decodedpage, $mailstring)) {
$oldmail = $mailstring[0];
$newmail = functions::obscurify_email($mailstring[1] . "@" . $mailstring[2]);
$decodedpage = str_replace($oldmail, $newmail, $decodedpage);
}
// end while
// Bugfix for direct logins using http://user%3apassword%40host, eg. for retreiving scans from the Xerox
$decodedpage = preg_replace("~%3[aA]~", ":", $decodedpage);
$decodedpage = preg_replace("~%40~", "@", $decodedpage);
$decodedpage = preg_replace("~(<p>)?<nowiki>~", "", $decodedpage);
$decodedpage = preg_replace("~</nowiki>(</p>)?~", "", $decodedpage);
$decodedpage = preg_replace("~<p><div style=([^>]*)><img([^>]*) alt=([^>]*)></div>~iU", "<p><img\\2 alt='' class='floatleft'>", $decodedpage);
// TODO: The following three rules might have unwanted side-effects:
$decodedpage = preg_replace("~<p><div style=([^>]*)><img([^>]*) alt=([^>]*)>~iU", "<p><img\\2 alt='' class='floatleft'>", $decodedpage);
$decodedpage = preg_replace("~</p></div>([\r\n])+~", "</p>\\1", $decodedpage);
$decodedpage = preg_replace("~</p>([\r\n])+<br([^>]*)>~U", "\\1<br\\2>", $decodedpage);
$decodedpage = preg_replace("~width=\"([0-9]+)[px]*\"></div><br>~iU", "width=\"\\1\"><br>", $decodedpage);
$decodedpage = preg_replace("~class='floatleft'></p><p class='imagecaption'>([^<]*)</p></div>~iU", "class='floatleft'> ", $decodedpage);
$decodedpage = preg_replace("~class='floatleft'></p><p class='imagecaption'>([^<]*)</p></div>~iU", "class='floatleft'> ", $decodedpage);
$decodedpage = preg_replace("~<p>\\+~mU", '', $decodedpage);
// dirty trick for listings of newsletters
$decodedpage = preg_replace("~<div><img (.*)></div>~U", '<img \\1>', $decodedpage);
$decodedpage = preg_replace("~ alt=[\"'][^>]*\\..*[\"']~U", "", $decodedpage);
$decodedpage = preg_replace("~ class=[\"'][\"']~", "", $decodedpage);
$decodedpage = preg_replace("~<td></p>~", "<td>", $decodedpage);
$decodedpage = preg_replace("~<p></td>~", "</td>", $decodedpage);
$decodedpage = preg_replace("~<p><h3>~", "<h3>", $decodedpage);
$decodedpage = preg_replace("~</ul></p>~", "</ul>", $decodedpage);
$decodedpage = preg_replace("~</h2></p>~", "</h2>", $decodedpage);
$decodedpage = preg_replace("~</p></p>~", "</p>", $decodedpage);
$decodedpage = preg_replace("~<p><p ~", "<p ", $decodedpage);
$decodedpage = preg_replace("~<p><p>~", "<p>", $decodedpage);
$decodedpage = preg_replace("~<p><table~", "<table", $decodedpage);
$decodedpage = preg_replace("~<p><h2~", "<h2", $decodedpage);
$decodedpage = preg_replace("~</table></p>~", "</table>", $decodedpage);
$decodedpage = preg_replace("~[\\ ]{2,}~", " ", $decodedpage);
$decodedpage = preg_replace("~> <~", "><", $decodedpage);
$decodedpage = preg_replace("~[\r\n]+~", "\r\n", $decodedpage);
$decodedpage = preg_replace("~<p>( )*</p>~U", "", $decodedpage);
$decodedpage = preg_replace("~</p>\\s*<p>\\s*</div>\\s*</p>~", "</div>", $decodedpage);
$decodedpage = preg_replace("~</div></p>~", "</p>", $decodedpage);
// not particularly safe
$decodedpage = preg_replace("~width=(['\"])([0-9]*)px(['\"])~U", "width=\\1\\2\\3", $decodedpage);
$decodedpage = preg_replace("~<p> ~", "<p class='free'>", $decodedpage);
// not particularly safe
$decodedpage = preg_replace("~<p class='free'><div>~", "<p class='free'>", $decodedpage);
// not particularly safe
$decodedpage = preg_replace("~<p><div>~", "<p>", $decodedpage);
// not particularly safe
$decodedpage = preg_replace("~<p><div class='([^']*)'></p>~imsU", "<div class='\\1'>", $decodedpage);
$decodedpage = preg_replace("~<p><div class=~imsU", "<div class=", $decodedpage);
$decodedpage = preg_replace("~([a-z]\")\"><~", "\\1><", $decodedpage);
// images
$decodedpage = str_replace("h", "h", $decodedpage);
$decodedpage = str_replace("</sup><strong>", "</sup> <strong>", $decodedpage);
$decodedpage = str_replace("<p></div>", "</div>", $decodedpage);
$decodedpage = preg_replace("~ id=\"toc\\d*\"~", "", $decodedpage);
// wiki jump points
$decodedpage = preg_replace("~=\"([^\"]*)\"~", "='\\1'", $decodedpage);
// wiki href and src
$decodedpage = preg_replace("~ href=['\"]#([^'\"]*)['\"]~", " href='" . $_SERVER["PHP_SELF"] . "#\\1'", $decodedpage);
// wiki local jump link
$decodedpage = str_replace("\"", """, $decodedpage);
// ATER wiki href and src
return $decodedpage;
}
示例6: adaptRawUserArray
//.........这里部分代码省略.........
$udata["nw_building"] = "dk";
// "NBI (Copenhagen)"
} elseif (preg_match("/^13/i", $udata["nw_office"], $res)) {
$udata["nw_building"] = "13";
// "Nordita East Building"
} elseif (preg_match("/^12/i", $udata["nw_office"], $res)) {
$udata["nw_building"] = "12";
// "Nordita West Building"
} elseif (preg_match("/^11/i", $udata["nw_office"], $res)) {
$udata["nw_building"] = "11";
// "Nordita South Building"
} elseif (preg_match("/^A5/i", $udata["nw_office"], $res)) {
$udata["nw_building"] = "an";
// "AlbaNova Main Building"
} else {
$udata["nw_building"] = "";
}
// -----------------------------------
// -- Create field nw_email
// -- Create field nw_email_plain
// (call after nw_notyetarrived)
// -----------------------------------
// These fields exist but are not set for all users:
// In ea: "av_email"
// In maildb: "m_email" or "maildrop", see also "forward"
// First check if people::$specialmail contains special instructions
$smail = functions::callMethod('people', 'lib/people', 'getSpecialMail', $udata["nw_user"]);
$udata["nw_email_plain"] = "";
if ($smail !== false) {
$udata["nw_email_plain"] = $smail;
} elseif (empty($udata["nw_notyetarrived"])) {
$udata["nw_email_plain"] = $udata["nw_user"] . "@" . MAIL_DOMAIN;
}
$udata["nw_email"] = functions::obscurify_email($udata["nw_email_plain"]);
// -----------------------------------
// -- Rename field nw_gid
// -- Create field nw_group
// -- Create field nw_groupShort
// -----------------------------------
// in ea: "e_gid"
// In maildb: "groupid"
$udata["nw_group"] = $udata["nw_groupShort"] = $udata["nw_gid"] = "";
if (!empty($udata["e_gid"])) {
$gridtmp = explode(",", $udata["e_gid"]);
unset($grid);
unset($gid);
foreach ($gridtmp as $k => $v) {
$v = trim($v);
if ($v == "grund") {
$v = "adm";
}
if ($v == "admin") {
$v = "adm";
}
$gid[] = $v;
if (isset($this->researchGroups[$v])) {
$grid[] = $this->researchGroups[$v];
}
}
$udata["nw_group"] = isset($grid) && is_array($grid) ? implode("; ", $grid) : "";
$udata["nw_groupShort"] = str_replace("Statistical ", "Stat. ", str_replace("Condensed ", "Cond. ", $udata["nw_group"]));
$udata["nw_gid"] = is_array($gid) ? implode(",", $gid) : "";
$udata["nw_gid"] = preg_replace("/^,/", "", preg_replace("/,\$/", "", str_replace(",,", ",", str_replace("kof", "", str_replace("BIO", "CM", str_replace("MA", "SA", str_replace("NP", "SA", str_replace("HP", "SA", $udata["nw_gid"]))))))));
}
// -----------------------------------
// -- Rename field nw_employmentStart