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


PHP functions::readableDate方法代码示例

本文整理汇总了PHP中functions::readableDate方法的典型用法代码示例。如果您正苦于以下问题:PHP functions::readableDate方法的具体用法?PHP functions::readableDate怎么用?PHP functions::readableDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在functions的用法示例。


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

示例1: OutputOpenPositions

 static function OutputOpenPositions($wid = "openpositions", $divclass = "", $listclass = "", $splash = TRUE, $showall = FALSE, $noerrormessage = FALSE)
 {
     $stdout = "";
     if (empty($openpositions)) {
         $wid = "openpositions";
     }
     //    if (!$showall && !$splash) $listclass = trim($listclass . " current");
     // -------------------------------
     // -- obtain data
     // -------------------------------
     // REPLACE WHEN READY:
     $positions = functions::callMethod('fromdb_jam', 'fromdb/jam', 'getPositions');
     //    $positions = functions::callMethod('fromdb_nwpositions','fromdb/nwpositions','getCampaignsPositions');
     if (empty($positions)) {
         return "";
     }
     if (!$splash) {
         krsort($positions);
     }
     foreach ($positions as $date => $applic) {
         if (!$showall && $date < date("Y-m-d")) {
             unset($positions[$date]);
         }
     }
     if (empty($positions)) {
         return $noerrormessage ? "" : "            <h2 class='red bottommargin'>There are currently no open positions at Nordita</h2>\r\n" . "            <p style='margin-bottom:2em'><strong>&#187;</strong> " . "Check the <a href='people/positions/archive/index.php'><strong>positions archive</strong></a> for earlier campaigns.</p>\r\n" . "            <p style='margin-bottom:0'>Most position campaigns at Nordita are administred " . "through our <strong>Job Application Manager</strong> at</p>\r\n" . "            <p style='margin:0 0 3em 2em;font-size:1.5em'>" . "<a href='http://jam.nordita.org'><strong>jam.nordita.org</strong></a></p>\r\n" . "\r\n";
     }
     // -------------------------------
     // -- output data
     // -------------------------------
     $stdout .= "            <div id='" . $wid . "'" . (!empty($divclass) ? " class='" . $divclass . "'" : "") . ($splash ? "" : " style='margin-bottom:3em'") . ">\r\n";
     if ($splash) {
         $stdout .= "              <h3><span>Open Positions</span></h3>\r\n" . "              <div>\r\n";
         // for accordion effect
     } else {
         $stdout .= "\r\n";
     }
     $list = "";
     foreach ($positions as $date => $applic) {
         $splashclass = $splash ? functions::callMethod("widget", "lib/widget", "WlimitDate2Class", $date) : "";
         $thelistclass = trim($listclass . " " . $splashclass);
         foreach ($applic as $app) {
             if (!$showall && !$splash) {
                 $list .= "              <div class='current'>\r\n";
             }
             if (!isset($app["method"])) {
                 $app["method"] = "";
             }
             $thetitle = $app["title"];
             if ($splash) {
                 if ($app["method"] == "jam") {
                     $thetitle = "<a href='http://jam.nordita.org/'>" . $thetitle . "</a>";
                 } elseif ($app["method"] == "programs") {
                     $thetitle = "<a href='http://www.nordita.org/propose/'>" . $thetitle . "</a>";
                 } elseif (!empty($app["url"])) {
                     $thetitle = "<a href='" . $app["url"] . "' rel='nofollow'>" . $thetitle . "</a>";
                 } elseif (in_array($app["method"], array("kth", "su"))) {
                     $thetitle = $thetitle;
                     //TODO
                 }
             }
             $list .= "                <dl" . (!empty($thelistclass) ? " class='" . $thelistclass . "'" : "") . ">\r\n";
             if ($splash) {
                 $list .= "                  <dt class='title'>" . $thetitle . (!empty($app["announcement"]) ? " <span class='pdf'>" . "[<a href='docs/" . $app["announcement"] . "' rel='nofollow'>Announcement</a>]</span>" : "") . "</dt>\r\n";
             } else {
                 $list .= "                  <dt class='title'>" . $thetitle . "</dt>\r\n";
                 if (!$showall) {
                     if (isset($app["description"]) && !empty($app["description"])) {
                         $list .= "                </dl>\r\n" . "              <blockquote>" . $app["description"] . "\r\n" . "              </blockquote>\r\n";
                     }
                     $list .= "              </div>\r\n" . "                <dl>\r\n";
                 }
                 $list .= (empty($app["image"]) ? "" : "                  <dd><img src='" . $app["image"] . "' alt=''></dd>\r\n") . (empty($app["announcement"]) ? "" : "                  <dd><span class='pdf'><a href='docs/" . $app["announcement"] . "' rel='nofollow'>Announcement</a></span> (PDF File)</dd>\r\n") . (empty($app["url"]) ? "" : "                  <dd><span class='pdf'><a href='" . $app["url"] . "' rel='nofollow'>Information</a></span></dd>\r\n");
                 //TODO: same code in position::OutputOpenPositions() and news::drawCampaign()
                 if (isset($app["method"]) && !$showall) {
                     switch ($app["method"]) {
                         case "jam":
                             $list .= "                  <dd>Apply online: <span class='apply'><a href='http://jam.nordita.org/' rel='nofollow'>" . "jam.nordita.org</a></span></dd>\r\n";
                             break;
                         case "kth":
                             $list .= "                  <dd>Applications should be entered in the <span class='apply'>" . "<a href='https://kth.mynetworkglobal.com/en/what:login/jobID:46590/where:4/' rel='nofollow'>" . "KTH Recruitment System</a></span></dd>\r\n";
                             break;
                         case "su":
                             $list .= "                  <dd>Applications should be entered in the <strong>Stockholm University " . "Recruitment System</strong>. Press the button &quot;Ansök&quot; or &quot;Apply&quot; at the end of the " . (empty($app["url"]) ? "position information page " : "<span class='apply'><a href='" . $app["url"] . "' rel='nofollow'>position information page</a></span> ") . "to log in to the recruitment system.</dd>\r\n";
                             break;
                         case "vr":
                             $list .= "                  <dd>Applications should be sent to the <span class='apply'>" . "<a href='http://vrdirect.vr.se/'>" . "VR Online Application System</a></span></dd>\r\n";
                             break;
                     }
                 }
             }
             $list .= "                  <dd class='deadline'>Deadline: <span class='date" . ($date >= date("Y-m-d") ? " green" : "") . "'>" . functions::readableDate($date) . "</span></dd>\r\n" . (isset($app["extra"]) ? "                  <dd class='deadline'>" . $app["extra"] . "</dd>\r\n" : "");
             if (!$splash && isset($app["hired"]) && !empty($app["hired"])) {
                 $list .= "                    <dd><em class='red'><strong>Closed</strong></em> - Hired " . (count($app["hired"]) == 1 ? "was" : "were") . ":</dd>\r\n" . "                    <dd><dl>\r\n";
                 foreach ($app["hired"] as $name => $hired) {
                     if (preg_match("#^(.*),\\s+(.*)\$#", $name, $res)) {
                         $name = $res[2] . " " . $res[1];
                     }
                     $list .= "                      <dd><em>" . $name . "</em> " . (empty($hired["home"]) ? "" : " - " . $hired["home"]) . (empty($hired["field"]) ? "" : " (" . $hired["field"] . ")") . "</dd>\r\n";
                 }
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:

示例2: drawCampaign

 public static function drawCampaign($issue_id)
 {
     $stdout = "";
     $stdout .= "<h2 class='bottommargin'>OPEN POSITIONS AT NORDITA</h2>\r\n" . "<p style='margin-bottom:2em' class='only_online'>&rarr; See Current Open Postitions: <a href='people/positions/index.php' rel='nofollow'><strong>www.nordita.org/positions</strong></a></p>\r\n";
     // -----------------------------------------------------------
     // -- Obtain campaign data
     // -----------------------------------------------------------
     $campaigns = news::getCampaign($issue_id);
     if (!is_array($campaigns)) {
         return $stdout . $campaigns;
     }
     // -----------------------------------------------------------
     // -- Output campaign data
     // -----------------------------------------------------------
     foreach ($campaigns as $date => $arr) {
         foreach ($arr as $row) {
             $stdout .= "<div class='campaign'>\r\n" . "  <h3>" . preg_replace("/\\w*20\\d\\d/", "", $row["title"]) . "</h3>\r\n" . "  <dl>\r\n" . (empty($row["announcement"]) ? "" : "    <dd><span class='pdf'><a href='docs/" . $row["announcement"] . "' rel='nofollow'>Announcement</a></span> (PDF File)</dd>\r\n") . (empty($row["url"]) ? "" : "    <dd><span class='pdf'><a href='" . $row["url"] . "' rel='nofollow'>Information</a></span></dd>\r\n");
             //TODO: same code in position::OutputOpenPositions() and news::drawCampaign()
             if (isset($row["method"])) {
                 switch ($row["method"]) {
                     case "jam":
                         $stdout .= "    <dd>Apply online: <span class='apply'><a href='http://jam.nordita.org/' rel='nofollow'>" . "jam.nordita.org</a></span></dd>\r\n";
                         break;
                         //case "kth": $stdout .=
                         //  "    <dd>Applications should be sent to the <span class='apply'>" .
                         //  "<a href='http://www.kth.se/en/om/kontakt/registrator-1.15615' rel='nofollow'>" .
                         //  "KTH Registrar's Office</a></span></dd>\r\n"; break;
                     //case "kth": $stdout .=
                     //  "    <dd>Applications should be sent to the <span class='apply'>" .
                     //  "<a href='http://www.kth.se/en/om/kontakt/registrator-1.15615' rel='nofollow'>" .
                     //  "KTH Registrar's Office</a></span></dd>\r\n"; break;
                     case "kth":
                         $stdout .= "    <dd>Applications should be entered in the <span class='apply'>" . "<a href='https://kth.mynetworkglobal.com/en/what:login/jobID:46590/where:4/' rel='nofollow'>" . "KTH Recruitment System</a></span></dd>\r\n";
                         break;
                     case "su":
                         $list .= "                  <dd>Applications should be entered in the <strong>Stockholm University " . "Recruitment System</strong>. Press the button &quot;Ansök&quot; or &quot;Apply&quot; at the end of the " . (empty($app["url"]) ? "position information page " : "<span class='apply'><a href='" . $app["url"] . "' rel='nofollow'>position information page</a></span> ") . "to log in to the recruitment system.</dd>\r\n";
                         break;
                         //case "su": $stdout .=
                         //  "    <dd>Applications should be sent to the <span class='apply'>" .
                         //  "<a href='' rel='nofollow'>" .
                         //  "Stockholm University Registrar's Office</a></span></dd>\r\n"; break;
                     //case "su": $stdout .=
                     //  "    <dd>Applications should be sent to the <span class='apply'>" .
                     //  "<a href='' rel='nofollow'>" .
                     //  "Stockholm University Registrar's Office</a></span></dd>\r\n"; break;
                     case "vr":
                         $stdout .= "    <dd>Applications should be sent to the <span class='apply'>" . "<a href='http://vrdirect.vr.se/'>" . "VR Online Application System</a></span></dd>\r\n";
                         break;
                     case "":
                         break;
                     case "":
                         break;
                     case "":
                         break;
                     case "":
                         break;
                 }
             }
             $stdout .= "   <dd>Application deadline: <span class='deadline'>" . functions::readableDate($date) . "</span></dd>\r\n" . "  </dl>\r\n" . $row["text"] . "  <div class='clear social-footer' style=''>\r\n" . news::drawIconsSocialMedia() . "  </div>\r\n" . "</div>\r\n";
         }
     }
     // -----------------------------------------------------------
     return $stdout;
 }
开发者ID:,项目名称:,代码行数:64,代码来源:

示例3: outputRegistrationOpen

 static function outputRegistrationOpen($wid = "announce-registration", $divclass = "", $listclass = "box announce", $splash = true)
 {
     // -- Obtain data array
     $eventArray = functions::callMethod('fromdb_nwevents', 'fromdb/nwevents', 'getEventsRegistrationOpen');
     // -- Output data
     $stdout = "            <div id='" . $wid . "'" . (!empty($divclass) ? " class='" . $divclass . "'" : "") . ">\r\n";
     if ($splash) {
         $stdout .= "              <h3><span>Apply Now!</span></h3>\r\n" . "              <div>\r\n";
         // for accordion effect
     }
     $list = "";
     foreach ($eventArray as $date => $events) {
         if ($date >= date("Y-m-d")) {
             $splashclass = $splash ? functions::callMethod("widget", "lib/widget", "WlimitDate2Class", $date) : "";
             $thelistclass = trim($listclass . " " . $splashclass);
             foreach ($events as $ev) {
                 $ev["url"] = preg_replace("#^" . URL_PREFIX . "/#", "", $ev["url"]);
                 $list .= "                <dl" . (!empty($thelistclass) ? " class='" . $thelistclass . "'" : "") . ">\r\n" . "                  <dt class='title'>" . "<a href='" . $ev["url"] . "' rel='nofollow'>" . $ev["title"] . "</a></dt>\r\n" . "                  <dd class='deadline'>Deadline: <span class='date'>" . functions::readableDate($date) . "</span></dd>\r\n" . (isset($ev["extra"]) ? "                  <dd class='deadline'>" . $ev["extra"] . "</dd>\r\n" : "") . "                </dl>\r\n";
             }
             // end foreach
         }
         // end if
     }
     // end foreach
     $stdout .= $list . ($splash ? "              </div>\r\n" : "") . "            </div> <!-- " . $wid . " -->\r\n" . "\r\n";
     return empty($list) ? "" : $stdout;
 }
开发者ID:,项目名称:,代码行数:27,代码来源:

示例4: getAlumniArrayData

 public static function getAlumniArrayData()
 {
     $userarray = array();
     // --------------------
     // DETERMINE SOURCE OF PEOPLE DATA
     // --> $GLOBALS["peopleClass"]
     // --------------------
     self::loadClass("ea");
     // ---------------------------------------------------------------------------
     // SELECT APPROPRIATE SQL QUERY
     // If $searchVariant='user', only the record for user $u is selected.
     // --> $sql
     // ---------------------------------------------------------------------------
     $sql = $GLOBALS["peopleClass"]->getSqlForEmployment();
     // --------------------
     // OBTAIN DATA FROM DATABASE
     // --> $userarray
     // --------------------
     $countryCodeArray = functions::countryCodeArray();
     $result = $GLOBALS["peopleClass"]->query($sql);
     if ($GLOBALS["peopleClass"]->num_rows($result) > 0) {
         while ($rec = $GLOBALS["peopleClass"]->next_record_assoc($result)) {
             if (!empty($rec["lm_option"])) {
                 $options = @unserialize(stripslashes($rec["lm_option"]));
                 if ($options) {
                     $rec = @array_merge($rec, $options);
                 }
             }
             if (!empty($rec["av_id"])) {
                 $udata = array();
                 // -----------------------------------
                 $udata["nw_firstname"] = isset($rec["av_firstname"]) ? $rec["av_firstname"] : "";
                 $udata["nw_lastname"] = isset($rec["av_lastname"]) ? $rec["av_lastname"] : "";
                 $udata["nw_fullname"] = str_replace(" ", "&nbsp;", str_replace("-", "&#8209;", $udata["nw_firstname"])) . "&nbsp;" . str_replace(" ", "&nbsp;", str_replace("-", "&#8209;", $udata["nw_lastname"]));
                 $udata["nw_fullname_reverse"] = str_replace(" ", "&nbsp;", preg_replace("/" . (!empty($rec["av_von"]) ? $rec["av_von"] . "\\s*" : "") . "/i", "", str_replace("-", "&#8209;", $udata["nw_lastname"]))) . ",&nbsp;" . str_replace(" ", "&nbsp;", str_replace("-", "&#8209;", $udata["nw_firstname"])) . (!empty($rec["av_von"]) ? "&nbsp;" . $rec["av_von"] : "");
                 $udata["nw_fullname_reverse_sortable"] = strtolower(functions::strip_accents($udata["nw_fullname_reverse"]));
                 $udata["nw_user"] = functions::dotName($udata["nw_fullname"]);
                 if (self::getSpecialDotname($udata["nw_user"])) {
                     $udata["nw_user"] = self::getSpecialDotname($udata["nw_user"]);
                 }
                 $udata["nw_current_institute"] = $rec["av_institute"];
                 $udata["nw_current_email"] = functions::obscurify_email($rec["av_email"]);
                 $udata["nw_deceased"] = !empty($rec["av_ddate"]) ? 1 : 0;
                 // -----------------------------------
                 // COLLECT DATA FROM OTHER SOURCES, IF NEEDED
                 // -----------------------------------
                 include PATH_DATA . "/adhoc_people_data.php";
                 // -----------------------------------
                 // SPECIAL EMPLOYMENT-RELATED FIELDS
                 // -----------------------------------
                 $em = array();
                 $em["nw_employment_status"] = $rec["um_status"];
                 $em["nw_employment_title"] = $rec["lm_value"];
                 $em["nw_employment_fromdate"] = $rec["lm_key"];
                 $em["nw_employment_todate"] = $rec["lm_status"];
                 if ($rec["lm_status"] <= date("Y-m-d")) {
                     $em["nw_employment_date"] = functions::readableDateInterval($rec["lm_key"], $rec["lm_status"]);
                     $em["nw_employment_current"] = 0;
                 } else {
                     $em["nw_employment_date"] = functions::readableDate($rec["lm_key"]) . " &#8212;&nbsp;";
                     $em["nw_employment_current"] = 1;
                 }
                 $em["nw_employment_inst"] = isset($options["e_inst"]) ? $options["e_inst"] : "";
                 if (isset($options["e_org"])) {
                     switch ($options["e_org"]) {
                         case MYPEAR_ORGID_NORDITA:
                             $em["nw_employment_inst"] = "Nordita";
                             $em["nw_employment_country"] = $em["nw_employment_fromdate"] >= date("2007-01-01") || in_array($rec["user"], array("yb", "brandenb", "jifalt", "uw", "divecchi")) ? "SE" : "DK";
                             break;
                         case MYPEAR_ORGID_FYSIKUM:
                             $em["nw_employment_inst"] = "Stockholm University";
                             $em["nw_employment_country"] = "SE";
                             break;
                         case MYPEAR_ORGID_ALBANOVA:
                             $em["nw_employment_inst"] = "AlbaNova";
                             $em["nw_employment_country"] = "SE";
                             break;
                         case MYPEAR_ORGID_KTH:
                             $em["nw_employment_inst"] = "KTH Royal Institute of Technology";
                             $em["nw_employment_country"] = "SE";
                             break;
                         case MYPEAR_ORGID_OKC:
                             $em["nw_employment_inst"] = "Oskar Klein Center";
                             $em["nw_employment_country"] = "SE";
                             break;
                     }
                 }
                 if (empty($em["nw_employment_country"])) {
                     $em["nw_employment_country"] = isset($options["e_cc"]) ? $options["e_cc"] : "";
                 }
                 if (isset($options["e_cc"]) && ($k = array_search($options["e_cc"], $countryCodeArray))) {
                     $em["nw_employment_country"] = $k;
                 }
                 $em["nw_employment_isnordic"] = functions::fromCountryCodeTo("continentcode", $em["nw_employment_country"], 1, 0, 0) == "NO" ? 1 : 0;
                 if (!empty($em["nw_employment_title"])) {
                     $em["nw_employment_type"] = self::getEmploymentTypeFromTitle($em["nw_employment_title"]);
                 } elseif (!empty($options["e_rate"])) {
                     $em["nw_employment_type"] = $options["e_rate"];
                 } elseif (!empty($udata["nw_employeeType"])) {
                     $em["nw_employment_type"] = $udata["nw_employeeType"];
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:


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