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


PHP event::getPosterArray方法代码示例

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


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

示例1: outputEventListSingle

 public static function outputEventListSingle($thisevent, $class = "event-box", $subclass = "", $showCoordinators = FALSE, $compactOutput = FALSE, $showBlurb = TRUE, $plaintextUrl = FALSE)
 {
     if (empty($thisevent)) {
         return "";
     }
     $stdout = "";
     $agendapageisopen = isset($thisevent["agendapageisopen"]) && $thisevent["agendapageisopen"] ? TRUE : FALSE;
     // -----------------------------------
     // -- Front Pages
     // -----------------------------------
     if ($GLOBALS["documentClass"]->isIndexPage()) {
         return (!empty($image) ? "              <p>" . $image . "</p>\r\n" : "") . "              <h4>" . (empty($thisevent["subpath"]) ? $thisevent["title"] : "<a href='events/" . $thisevent["subpath"] . "/index.php' rel='nofollow'>" . $thisevent["title"] . "</a>") . "</h4>\r\n" . "              <p><strong>" . functions::shortMonthNames($thisevent["period"]) . "</strong></p>\r\n" . ($showBlurb && !empty($thisevent["blurb"]) ? "              <p>" . $thisevent["blurb"] . "</p>\r\n" : "");
     }
     // end if is indexpage
     // -----------------------------------
     // -- Initiate pieces
     // -----------------------------------
     $output_eventname = "            <h4>" . (empty($thisevent["subpath"]) || !$agendapageisopen ? $thisevent["title"] : "<a href='events/" . $thisevent["subpath"] . "/index.php' rel='nofollow'>" . $thisevent["title"] . "</a>") . "</h4>\r\n";
     $image = !empty($thisevent["image"]) && is_file(INCLEVEL . $thisevent["image"]) ? "<img src='" . $thisevent["image"] . "' alt=''>" : "<img src='" . PATH_EVENTLOGOS . "/blank_103x103.png' alt=''>";
     $output_image = (!$compactOutput || $plaintextUrl) && !empty($image) ? "              <p class='img'>" . (empty($thisevent["subpath"]) ? $image : "<a href='events/" . $thisevent["subpath"] . "/index.php' rel='nofollow'>" . $image . "</a>") . "</p>\r\n" : "";
     if (!$compactOutput && $agendapageisopen) {
         $output_eventurl = "                <p>" . "<a href='events/" . $thisevent["subpath"] . "/' rel='nofollow'>" . "<span style='font-weight:normal'>www.nordita.org/</span>" . $thisevent["subpath"] . "</a>" . "</p>\r\n";
     } else {
         $output_eventurl = "                <p class='eventurl'><em>URL</em>: " . "www.nordita.org/<strong>" . $thisevent["subpath"] . "</strong></p>\r\n";
     }
     $output_eventtype = !empty($thisevent["eventtype"]) ? "                <p class='eventtype'>" . ucfirst($thisevent["eventtype"]) . "</p>\r\n" : "";
     $output_dates = "                <p class='dates'>" . $thisevent["period"] . "</p>\r\n";
     $output_blurb = "              <p class='blurb'>" . ($showBlurb && !empty($thisevent["blurb"]) ? $thisevent["blurb"] : "&nbsp;") . "</p>\r\n";
     $output_venue = !empty($thisevent["venue"]) ? "                <p class='eventvenue'><em>Venue:</em> " . ucfirst($thisevent["venue"]) . "</p>\r\n" : "";
     $output_coordinators = "";
     if ($showCoordinators && isset($thisevent["chairs"]) && is_array($thisevent["chairs"])) {
         $output_coordinators .= $thisevent["eventtype"] == "course" ? "                <p class='coordinators'><em>Teachers:</em> " : "                <p class='coordinators'><em>Coordinators:</em> ";
         $coord = array();
         foreach ($thisevent["chairs"] as $ch) {
             $coord[strtolower($ch["av_lastname"] . $ch["av_firstname"] . rand(0, 100))] = $ch["av_firstname"] . " " . $ch["av_lastname"];
         }
         ksort($coord);
         $output_coordinators .= implode(", ", $coord) . "</p>\r\n";
     }
     $output_timetable = !$compactOutput && $thisevent["id"] != "4393" && isset($thisevent["timetableexists"]) && !empty($thisevent["timetableexists"]) ? "                <p class='timetable'>" . "<a href='timetables/index.php?confid=" . $thisevent["id"] . "' rel='nofollow'>" . "Timetable</a></p>\r\n" : "";
     $posterArray = event::getPosterArray();
     $output_poster = !$compactOutput && isset($posterArray[$thisevent["subpath"]]) && isset($posterArray[$thisevent["subpath"]]["file"]) ? "                <p class='timetable'>" . "<a href='docs/posters/" . $posterArray[$thisevent["subpath"]]["file"] . "' rel='nofollow'>" . "Poster</a></p>\r\n" : "";
     $output_videos = !$compactOutput && isset($thisevent["videos"]) && !empty($thisevent["videos"]) ? "                <p class='timetable'>" . "<a href='" . $thisevent["videos"] . "' rel='nofollow'>" . "Videos from talks</a></p>\r\n" : "";
     //TODO: restore after checking!
     //TODO: perhaps simplify with glob() ?
     $output_photos = "";
     $pth = "events/" . $thisevent["subpath"] . "/photos_participants";
     if (!$compactOutput && is_file(INCLEVEL . $pth . "/index.php") && is_dir(INCLEVEL . $pth . "/images")) {
         $dir = scandir(INCLEVEL . $pth . "/images");
         reset($dir);
         $pc = FALSE;
         while ((list($k, $v) = each($dir)) && !$pc) {
             $pc = preg_match("/^[\\w{].*\\.[pngjpeg]{3,4}/i", $v) ? TRUE : FALSE;
         }
         if ($pc) {
             $output_photos .= "                <p class='photos'><a href='" . $pth . "/index.php' rel='nofollow'>" . "Photos of the participants</a></p>\r\n";
         }
     }
     // -----------------------------------
     // -- Output whole list
     // -----------------------------------
     if ($compactOutput) {
         if ($plaintextUrl) {
             $stdout .= "<table>\r\n" . "  <tr>\r\n" . "    <td style='padding-right:1em'>\r\n" . $output_image . "    </td>\r\n" . "    <td>\r\n";
         }
         $stdout .= $output_eventname . "            <div class='event-compact'>\r\n" . $output_eventtype . $output_dates . $output_venue . $output_eventurl . $output_coordinators . "            </div>\r\n";
         if ($plaintextUrl) {
             $stdout .= "    </td>\r\n" . "  </tr>\r\n" . "</table>\r\n";
         }
         $stdout .= "\r\n";
     } else {
         $stdout .= "          <div" . (!empty($class) ? " class='" . $class . "'" : "") . ">\r\n" . $output_eventname . "            <div" . (!empty($subclass) ? " class='" . $subclass . "'" : "") . ">\r\n" . $output_image . "              <div class='baseinfo'>\r\n" . $output_eventtype . $output_dates . $output_venue . $output_coordinators . $output_timetable . $output_eventurl . $output_poster . $output_photos . $output_videos . "              </div>\r\n" . $output_blurb . "            </div>\r\n" . "          </div>\r\n" . "\r\n";
     }
     return $stdout;
 }
开发者ID:,项目名称:,代码行数:75,代码来源:


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