コード例 #1
0
ファイル: benefits.php プロジェクト: byyeong/dc2016
 public function views($_id)
 {
     $r = $this->Program->get_list('', '', 'c.id = ' . $_id);
     $res = $r[0];
     if (!$res) {
         header("Location: /benefits");
     }
     $og["type"] = 'article';
     $og["url"] = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
     $og["title"] = $res["title"] . " on D.CAMP";
     $og["description"] = strip_tags($res["content"]);
     if (strlen(strip_tags($res["content"])) > 150) {
         $og["description"] = mb_substr(strip_tags($res["content"]), 0, 150, 'UTF-8') . '...';
     }
     $og["image"] = 'http://' . $_SERVER['SERVER_NAME'] . $res["img"];
     $this->assigns_layout["og"] = $og;
     $this->assigns["g_start"] = date("YmdHi00", strtotime("-9 hour", strtotime(str_replace(".", "", str_replace(":", "", str_replace(" ", "", $res["a_start"]))))));
     $this->assigns["g_end"] = date("YmdHi00", strtotime("-9 hour", strtotime(str_replace(".", "", str_replace(":", "", str_replace(" ", "", $res["a_end"]))))));
     $this->assigns["res"] = $res;
     $this->assigns["my"] = $this->Program_apply->get_by_user($res["id"], $_SESSION["s"]["id"]);
     $this->sub();
     $this->assigns["hot"] = $this->Program->get_hot(1, 5, 'p.status = 1 and p.open = 1 and ( a_start = "" or a_start IS NULL or a_start <= "' . date('Y.m.d H:i') . '" OR a_end = "" OR a_end IS NULL OR a_end > "' . date('Y.m.d H:i') . '")');
     if (!strpos($_SERVER["HTTP_REFERER"], "dcamp.kr")) {
         $this->assigns_layout["cards"] = bottom_main();
     }
     if ($_SESSION["msg"]) {
         $this->assigns_layout["msg"] = $_SESSION["msg"];
         unset($_SESSION["msg"]);
     }
 }
コード例 #2
0
ファイル: office_hours.php プロジェクト: byyeong/dc2016
 public function views($_id = '')
 {
     // office hours detail
     if ($_id) {
         $res = $this->Office_hours->get($_id);
         $mento = $this->Office_mento->get($res["mento_id"]);
         $bios = $this->Office_mento_bios->get_by_mento($mento["id"]);
         $article = $this->Office_mento_article->get_by_mento($mento["id"]);
         $other = $this->Office_hours->get_open();
         $this->assigns["mento"] = $mento;
         $this->assigns["bios"] = $bios;
         $this->assigns["article"] = $article;
         $this->assigns["res"] = $res;
         $this->assigns["other"] = $other;
         $this->assigns["done"] = $this->Office_hours_apply->get_by_user_oh($_id, $_SESSION["s"]["id"]);
         $this->assigns["g_start"] = date("YmdHi00", strtotime("-9 hour", strtotime(str_replace(".", "", str_replace(":", "", str_replace(" ", "", $res["e_start"]))))));
         $this->assigns["g_end"] = date("YmdHi00", strtotime("-9 hour", strtotime(str_replace(".", "", str_replace(":", "", str_replace(" ", "", $res["e_end"]))))));
         $og["type"] = 'article';
         $og["url"] = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
         $og["title"] = $res["subject"] . " on D.CAMP";
         $og["description"] = mb_substr(strip_tags($res["description"]));
         if (strlen(strip_tags($res["description"])) > 150) {
             $og["description"] = mb_substr(strip_tags($res["description"]), 0, 150, 'UTF-8') . '...';
         }
         $og["image"] = 'http://' . $_SERVER['SERVER_NAME'] . $res["picture"];
         if (!$this->assigns["res"]["picture"]) {
             $og["image"] = 'http://' . $_SERVER['SERVER_NAME'] . $res["mpicture"];
         }
         $this->assigns_layout["og"] = $og;
     }
     if (!strpos($_SERVER["HTTP_REFERER"], "dcamp.kr")) {
         $this->assigns_layout["cards"] = bottom_main();
     }
 }
コード例 #3
0
ファイル: timeline.php プロジェクト: byyeong/dc2016
 public function index($_id)
 {
     $res = $this->Board->get_detail($_id);
     if ($res) {
         // if ($res["p_type"] == 2) {
         //     $s = $this->Startup->get($res["p_id"]);
         //     $res["picture"] = $s["logo"];
         //     $res["name"] = $s["name"];
         // }
         $this->assigns["comm"] = $this->Board->get_comment('', $res["bid"]);
         $this->assigns["res"] = $res;
         if (!strpos($_SERVER["HTTP_REFERER"], "dcamp.kr")) {
             $this->assigns_layout["cards"] = bottom_main();
         }
     } else {
         header("Location: /error_404");
     }
 }
コード例 #4
0
ファイル: contents.php プロジェクト: byyeong/dc2016
 public function views($_id)
 {
     $res = $this->Content->get($_id);
     if ($res["state"] == 1 && $res["hidden"] == 0) {
         $this->Content->pageview($_id);
         $res["com"] = $this->Startup_member->get_by_user($res["user_id"]);
         $this->assigns["res"] = $res;
         $cat_list = $this->Content_category->list_('', '', 'hidden = 0');
         for ($i = 0; $i < sizeof($cat_list); $i++) {
             $cat_list[$i]["cnt"] = $this->Content->cnt("c.state = 1 and c.hidden = 0 and category_id = " . $cat_list[$i]["id"]);
         }
         $this->assigns["cat_list"] = $cat_list;
         $this->assigns["curr_cont"] = $this->Content->list_(1, 5, 'c.state = 1 and c.hidden = 0');
         $this->assigns["hot_cont"] = $this->Content->list_(1, 5, 'c.en = 0 and c.state = 1 and c.hidden = 0', 'v_cnt DESC');
         $og["type"] = 'article';
         $og["url"] = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
         $og["title"] = $res["subject"] . " on D.CAMP";
         $og["description"] = strip_tags($res["contents"]);
         if (strlen(strip_tags($res["contents"])) > 150) {
             $og["description"] = mb_substr(strip_tags($res["contents"]), 0, 150, 'UTF-8') . '...';
         }
         if ($res["cpic"]) {
             $og["image"] = 'http://' . $_SERVER['SERVER_NAME'] . $res["cpic"];
         }
         if (!$res["cpic"]) {
             $og["image"] = check_url($res["img"], '');
         }
         $this->assigns_layout["og"] = $og;
         $this->assigns["acnt"] = $this->Content->cnt("c.state = 1 and c.hidden = 0");
         if (!strpos($_SERVER["HTTP_REFERER"], "dcamp.kr")) {
             $this->assigns_layout["cards"] = bottom_main();
         }
     } else {
         header("Location: /error_404");
     }
 }
コード例 #5
0
ファイル: recruit.php プロジェクト: byyeong/dc2016
 public function views($_id)
 {
     $res = $this->Recruit->get($_id);
     if ($res && $res["state"] == 1) {
         $this->Recruit->pageview($_id);
         $res["local"] = $this->Recruit_opt->get_detail($_id, 1);
         $res["career"] = $this->Recruit_opt->get_detail($_id, 2);
         $res["term"] = $this->Recruit_opt->get_detail($_id, 4);
         $res["part"] = $this->Recruit_opt->get_detail($_id, 7);
         // $res["dev"] = $this->Recruit_opt->get_detail($_id, 3);
         // $res["lang"] = $this->Recruit_opt->get_detail($_id, 5);
         // $res["job"] = $this->Recruit_opt->get_detail($_id, 6);
         $this->assigns["res"] = $res;
         $st_res = $this->Recruit->list_s_(1, 5, 'r.en < 2 and r.state = 1 ' . 'and (' . '(r.start <= "' . date("Y.m.d") . '" and r.end >= "' . date("Y.m.d") . '") ' . 'or (r.start <= "' . date("Y.m.d") . '" and r.end = "") ' . 'or (r.start = "" and r.end = "")' . ')', 'v_cnt DESC');
         for ($sr = 0; $sr < sizeof($st_res); $sr++) {
             $st_res[$sr]["part"] = $this->Recruit_opt->get_detail($st_res[$sr]["rid"], 7);
         }
         $this->assigns["st_res"] = $st_res;
         $og["type"] = 'article';
         $og["url"] = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
         $og["title"] = $res["title"] . " on D.CAMP";
         $og["description"] = strip_tags($res["contents"]);
         if (strlen(strip_tags($res["contents"])) > 148) {
             $og["description"] = mb_substr(strip_tags($res["contents"]), 0, 148, 'UTF-8') . '...';
         }
         $content_parsed = parse_html($res["contents"]);
         foreach ($content_parsed as $c) {
             if (strtolower(substr($c, 0, 4)) == "<img") {
                 $t = tag_barase($c);
                 if ($t["src"]) {
                     $img = $t["src"];
                     break;
                 }
             }
         }
         if ($img) {
             $og["image"] = $img;
         } else {
             $og["image"] = 'http://' . $_SERVER['SERVER_NAME'] . $res["slogo"];
         }
         $this->assigns_layout["og"] = $og;
         if (!strpos($_SERVER["HTTP_REFERER"], "dcamp.kr")) {
             $this->assigns_layout["cards"] = bottom_main();
         }
     } else {
         header("Location: /");
     }
 }
コード例 #6
0
ファイル: event.php プロジェクト: byyeong/dc2016
 public function apply($_id)
 {
     $this->Event->pageview($_id);
     $this->assigns["s"] = $_SESSION["s"];
     $already = $this->Event_reserve->check($_id, $_SESSION["s"]["id"]);
     $res = $this->Event->get_detail($_id);
     if (!$res["end"]) {
         $res["end"] = "23:59";
     }
     $this->assigns["res"] = $res;
     $this->assigns["res_s"] = $this->Event->list_(1, 5, 'e.id != ' . $_id . ' and e.state = 1 and e.open = 1 and e.apply_end > "' . date("Y.m.d H:i") . '"');
     $this->assigns["res_c"] = $this->Competitions->get_list(1, 5, 'c.status = 1 and c.open = 1 and c.date_s <= "' . date('Y.m.d') . '" and c.date_e >= "' . date('Y.m.d') . '"');
     $this->assigns["part"] = $this->Event_reserve->list_(1, 1000, "er.state = 1 and event_id = " . $_id);
     $this->assigns["part2"] = $this->Event_reserve->list_(1, 1000, "er.state = 0 and event_id = " . $_id);
     if ($already) {
         $this->assigns["already"] = $already;
     }
     $og["type"] = 'article';
     $og["url"] = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
     $og["title"] = $this->assigns["res"]["title"] . " on D.CAMP";
     $og["description"] = $this->assigns["res"]["summary"];
     if (strlen(strip_tags($this->assigns["res"]["summary"])) > 150) {
         $og["description"] = mb_substr(strip_tags($this->assigns["res"]["summary"]), 0, 150, 'UTF-8') . '...';
     }
     $og["image"] = 'http://' . $_SERVER['SERVER_NAME'] . $this->assigns["res"]["picture"];
     if (!$this->assigns["res"]["picture"]) {
         $og["image"] = 'http://' . $_SERVER['SERVER_NAME'] . $this->assigns["res"]["mpicture"];
     }
     $this->assigns_layout["og"] = $og;
     // echo date("YmdHi00",strtotime ("-9 hour", strtotime(str_replace(".", "", $res["date"]).str_replace(":", "", $res["start"]))));
     $this->assigns["g_start"] = date("YmdHi00", strtotime("-9 hour", strtotime(str_replace(".", "", $res["date"]) . str_replace(":", "", $res["start"]))));
     $this->assigns["g_end"] = date("YmdHi00", strtotime("-9 hour", strtotime(str_replace(".", "", $res["date_e"]) . str_replace(":", "", $res["end"]))));
     // lounge box
     $today_ev_users = $this->Event_reserve->list_(1, 100, "e.space_id > 0 and er.state = 1 and date = '" . date("Y.m.d") . "'");
     $today_dcamp_users = $this->Entrance->list_('', '', '', 'date_out IS NULL and date_in LIKE "' . date("Y-m-d") . '%" GROUP BY m.id ');
     $comments = $this->Board->list_(Board_model::EVENT_TYPE, 0, 1, 5);
     for ($i = 0; $i < sizeof($comments); $i++) {
         if ($comments[$i]["p_id"] > 0) {
             $e = $this->Event->get($comments[$i]["p_id"]);
             $comments[$i]["p_name"] = $e["title"];
         }
         $com = $this->Board->get_comment($_type = 3, $comments[$i]["id"]);
         $comments[$i]["com"] = sizeof($com);
         $comments[$i]["like"] = $this->Board->get_like_cnt($comments[$i]["id"]);
     }
     $this->assigns["lounge"] = $comments;
     $this->assigns["u_cnt"] = sizeof($today_ev_users) + sizeof($today_dcamp_users);
     // lounge box
     if (!strpos($_SERVER["HTTP_REFERER"], "dcamp.kr")) {
         $this->assigns_layout["cards"] = bottom_main();
     }
     if ($_SESSION["msg"]) {
         $this->assigns_layout["msg"] = $_SESSION["msg"];
         unset($_SESSION["msg"]);
     }
 }
コード例 #7
0
ファイル: challenge.php プロジェクト: byyeong/dc2016
 public function views($_id)
 {
     if (!$_id) {
         header("Location: /error_404");
     }
     $this->Competitions->pageview($_id);
     $res = $this->Competitions->get($_id);
     if (!$res) {
         $res = $this->Competitions->get_by_url($_id);
         $_id = $res["id"];
     }
     if (!$res) {
         header("Location: /error_404");
     }
     $this->Competitions->pageview($_id);
     $res["a_file"] = $this->Competitions->get_a_file($_id);
     $res["group"] = $this->Competitions->get_group($_id);
     $my = $this->Competitions_apply->get_by_user($_id, $_SESSION["s"]["id"]);
     if ($res["ex_confirm"]) {
         $ex = $this->Competitions_examiner->get_by_user($_SESSION["s"]["id"], "ce.competition_id = " . $_id . " and ce.status = 1");
     }
     $op = $this->Competitions_examiner->operator_check($_id, $_SESSION["s"]["id"]);
     $this->assigns["res"] = $res;
     $this->assigns["my"] = $my;
     $this->assigns["ex"] = $ex;
     $this->assigns["op"] = $op;
     $this->sub();
     $this->assigns["ev"] = $this->Event->list_(1, 5, 'e.id != ' . $_id . ' and e.state = 1 and e.open = 1 and e.apply_end > "' . date("Y.m.d H:i") . '"');
     $og["type"] = 'article';
     $og["url"] = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
     $og["title"] = $res["subject"] . " on D.CAMP";
     $og["description"] = strip_tags($res["contents"]);
     if (strlen(strip_tags($res["contents"])) > 150) {
         $og["description"] = mb_substr(strip_tags($res["contents"]), 0, 150, 'UTF-8') . '...';
     }
     $og["image"] = 'http://' . $_SERVER['SERVER_NAME'] . $res["img"];
     if (!$res["img"]) {
         $og["image"] = 'http://' . $_SERVER['SERVER_NAME'] . $this->assigns["res"]["mpicture"];
     }
     $this->assigns_layout["og"] = $og;
     $this->assigns["g_start"] = date("YmdHi00", strtotime("-9 hour", strtotime(str_replace(".", "", $res["date_s"]) . str_replace(":", "", $res["time_s"]))));
     $this->assigns["g_end"] = date("YmdHi00", strtotime("-9 hour", strtotime(str_replace(".", "", $res["date_e"]) . str_replace(":", "", $res["time_e"]))));
     // lounge box
     $today_ev_users = $this->Event_reserve->list_(1, 100, "e.space_id > 0 and er.state = 1 and date = '" . date("Y.m.d") . "'");
     $today_dcamp_users = $this->Entrance->list_('', '', '', 'date_out IS NULL and date_in LIKE "' . date("Y-m-d") . '%" GROUP BY m.id ');
     $comments = $this->Board->list_(Board_model::EVENT_TYPE, 0, 1, 5);
     for ($i = 0; $i < sizeof($comments); $i++) {
         if ($comments[$i]["p_id"] > 0) {
             $e = $this->Event->get($comments[$i]["p_id"]);
             $comments[$i]["p_name"] = $e["title"];
         }
         $com = $this->Board->get_comment($_type = 3, $comments[$i]["id"]);
         $comments[$i]["com"] = sizeof($com);
         $comments[$i]["like"] = $this->Board->get_like_cnt($comments[$i]["id"]);
     }
     $this->assigns["lounge"] = $comments;
     $this->assigns["u_cnt"] = sizeof($today_ev_users) + sizeof($today_dcamp_users);
     // lounge box
     if (!strpos($_SERVER["HTTP_REFERER"], "dcamp.kr")) {
         $this->assigns_layout["cards"] = bottom_main();
     }
     if ($_SESSION["msg"]) {
         $this->assigns_layout["msg"] = $_SESSION["msg"];
         unset($_SESSION["msg"]);
     }
 }
コード例 #8
0
ファイル: showcase.php プロジェクト: byyeong/dc2016
 public function views($_id)
 {
     if (!$_id) {
         header("Location: /showcase");
     }
     $cat = $this->Code->get_by_key("bz_market");
     for ($c = 0; $c < sizeof($cat); $c++) {
         $cat[$c]["cnt"] = $this->Startup_service->get_by_cat_cnt($cat[$c]["id"]);
     }
     $tot = $this->Startup_service->cnt("user_id_bz IS NOT NULL and status_bz = 1");
     $res = $this->Startup_service->get($_id);
     $dates = $this->Startup_service->get_last_date($_id);
     $res["date"] = $dates["date"];
     $res["type"] = $dates["type"];
     $res["diff"] = dateDiff(date("Y.m.d"), $res["date"], '.');
     $res["dates"] = $this->Startup_service->get_dates($_id, 1);
     $res["cats"] = $this->Startup_service->get_category($_id);
     $res["s"] = $this->Startup->get($res["startup_id"]);
     $res["art"] = $this->Startup_service->get_article($_id);
     $og["type"] = 'article';
     $og["url"] = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
     $og["title"] = $res["name"] . " on D.CAMP";
     $og["description"] = $res["des_ele"];
     $og["image"] = 'http://' . $_SERVER['SERVER_NAME'] . $res["img1"];
     $this->assigns_layout["og"] = $og;
     $this->assigns["cat"] = $cat;
     $this->assigns["tot"] = $tot;
     $this->assigns["res"] = $res;
     $this->assigns["today"] = date("Y.m.d");
     if (!strpos($_SERVER["HTTP_REFERER"], "dcamp.kr")) {
         $this->assigns_layout["cards"] = bottom_main();
     }
 }