function getTime($format = "") { if (empty($format)) { if (!is_object($GLOBALS["xoopsModule"]) || $GLOBALS["xoopsModule"]->getVar("dirname") != $GLOBALS["artdirname"]) { $module_handler =& xoops_gethandler("module"); $artModule =& $module_handler->getByDirname($GLOBALS["artdirname"]); $config_handler =& xoops_gethandler("config"); $artConfig =& $config_handler->getConfigsByCat(0, $artModule->getVar("mid")); $format = $artConfig["timeformat"]; } else { $format = $GLOBALS["xoopsModuleConfig"]["timeformat"]; } } mod_loadFunctions("time", $GLOBALS["artdirname"]); $time = art_formatTimestamp($this->getVar("sp_time"), $format); return $time; }
/** * get formatted expiring time of the topic * * @param string $format format of time * @return string */ function getExpire($format = "") { mod_loadFunctions("time", $GLOBALS["artdirname"]); $time = art_formatTimestamp($this->getVar("top_expire"), $format); return $time; }
foreach ($articles_array as $id => $artcile) { if ($artcile["uid"] > 0) { $author_array[$artcile["uid"]] = 1; } } if (!empty($author_array)) { mod_loadFunctions("author"); $users = art_getAuthorNameFromId(array_keys($author_array), true, true); } foreach ($articles_array as $id => $article) { $_article = array("id" => $article["art_id"], "cat_id" => empty($article["basic_cat_id"]) ? $article["cat_id"] : $article["basic_cat_id"], "title" => $article["art_title"], "submit" => art_formatTimestamp(@$article["art_time_submit"]), "publish" => art_formatTimestamp(@$article["art_time_publish"]), "register_category" => art_formatTimestamp(@$article["ac_register"]), "time_topic" => art_formatTimestamp(@$article["at_time"]), "summary" => $article["art_summary"], "author" => $users[$article["uid"]]); if (!empty($article["ac_feature"])) { $_article["feature_category"] = art_formatTimestamp($article["ac_feature"]); } if (!empty($article["ac_publish"])) { $_article["publish_category"] = art_formatTimestamp($article["ac_publish"]); } if (!empty($category_obj)) { $_article["category"] = array("id" => $category_obj->getVar("cat_id")); } else { $_article["category"] = array("id" => $article["cat_id"], "title" => $categories_obj[$article["cat_id"]]->getVar("cat_title")); } if (!empty($category_obj) && $category_obj->getVar("cat_id") == @$article["cat_id"] || $isAdmin) { $_article["admin"] = 1; } $articles[] = $_article; unset($_article); } } if ($articles_count > $xoopsModuleConfig["articles_perpage"]) { include XOOPS_ROOT_PATH . "/class/pagenav.php";
$article_data["title"] = $p_title; // image $article_data["image"] = $p_image; // Authors mod_loadFunctions("author"); $author_uid = $article_isNew ? $user_id : $article_obj->getVar("uid"); $authors = art_getAuthorNameFromId($author_uid, false, true); $article_data["author"] = $authors[$author_uid]; if (!empty($_POST["writer_id"])) { $article_obj->setVar("writer_id", $_POST["writer_id"]); $article_data["writer"] = $article_obj->getWriter(); } // source $article_data["source"] = $p_source; // publish time $article_data["time"] = art_formatTimestamp(time()); // counter $article_data["counter"] = 0; // rating data $article_data["rates"] = 0; $article_data["rating"] = 0; // summary $article_data["summary"] = $p_summary; // Keywords $article_data["keywords"] = trim($p_keywords); // text of page $article_data["text"] = array("title" => $p_subtitile, "body" => $p_text); require_once XOOPS_ROOT_PATH . "/class/pagenav.php"; $count_page = $art_id > 0 ? $article_obj->getPagecount(true) : 1; if (!empty($newpage)) { $count_page++;
/** * get formatted publish time of the article * * {@link Config} * * @param string $format format of time * @return string */ function getTime($format = "c") { mod_loadFunctions("time", $GLOBALS["artdirname"]); $time = art_formatTimestamp($this->getVar("art_time_publish"), $format); return $time; }