本文整理汇总了PHP中lms_steam::get_readers方法的典型用法代码示例。如果您正苦于以下问题:PHP lms_steam::get_readers方法的具体用法?PHP lms_steam::get_readers怎么用?PHP lms_steam::get_readers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lms_steam
的用法示例。
在下文中一共展示了lms_steam::get_readers方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: gettext
}
if (!is_array($inventory) || count($inventory) == 0) {
$content->setCurrentBlock("BLOCK_EMPTY_INVENTORY");
$content->setVariable("LABEL_NO_DOCUMENTS_FOUND", gettext("There are no documents available yet.") . "<br /><br />");
$content->parse("BLOCK_EMPTY_INVENTORY");
} else {
// Prefetch needed data
$attributes = array(OBJ_CREATION_TIME, DOC_LAST_MODIFIED, DOC_USER_MODIFIED, OBJ_DESC, DOC_EXTERN_URL, OBJ_ICON, OBJ_NAME);
$data_tnr = array();
$only_containers = TRUE;
foreach ($inventory as $item) {
$data_tnr[$item->get_id()] = array();
$data_tnr[$item->get_id()]["attributes"] = $item->get_attributes($attributes, TRUE);
if ($item instanceof steam_document) {
$data_tnr[$item->get_id()]["contentsize"] = $item->get_content_size(TRUE);
$data_tnr[$item->get_id()]["readers"] = lms_steam::get_readers($item, TRUE);
}
$data_tnr[$item->get_id()]["can_read"] = $item->check_access_read($user, TRUE);
$data_tnr[$item->get_id()]["annotations"] = $item->get_annotations(FALSE, TRUE);
$data_tnr[$item->get_id()]["creator"] = $item->get_creator(TRUE);
if (!$item instanceof steam_container) {
$only_containers = FALSE;
}
}
$data_result = $GLOBALS["STEAM"]->buffer_flush();
$author_tnr = array();
foreach ($inventory as $item) {
$author_tnr[$item->get_id()] = array();
if (!is_object($data_result[$data_tnr[$item->get_id()]["attributes"]][DOC_USER_MODIFIED])) {
$author_tnr[$item->get_id()]["authorname"] = $data_result[$data_tnr[$item->get_id()]["creator"]]->get_name(TRUE);
} else {
示例2: array
continue;
}
if ((CLASS_DOCUMENT & $doc->get_type()) == CLASS_DOCUMENT) {
$data_tnr[$doc->get_id()] = array();
$last_modified = $doc->get_attribute(DOC_LAST_MODIFIED);
if ($last_modified == 0) {
$last_modified = $doc->get_attribute(OBJ_CREATION_TIME);
}
if ($last_modified != 0) {
$autor = $doc->get_attribute(DOC_USER_MODIFIED);
if (!is_object($autor)) {
$autor = $creator_result[$creator_tnr[$doc->get_id()]];
}
$data_tnr[$doc->get_id()]["authorname"] = $autor->get_name(TRUE);
}
$data_tnr[$doc->get_id()]["readers"] = lms_steam::get_readers($doc, TRUE);
$data_tnr[$doc->get_id()]["annotations"] = $doc->get_annotations(FALSE, TRUE);
}
}
$data_result = $GLOBALS["STEAM"]->buffer_flush();
foreach ($docs as $doc) {
// Ignore hidden files starting with '.'
if (substr($doc->get_name(), 0, 1) == '.') {
continue;
}
if ((CLASS_DOCUMENT & $doc->get_type()) == CLASS_DOCUMENT) {
$content->setCurrentBlock("BLOCK_ITEM");
$content->setVariable("LINK_ITEM", PATH_URL . "doc/" . $doc->get_id() . "/");
$content->setVariable("LINK_DOWNLOAD", PATH_URL . "get_document.php?id=" . $doc->get_id());
$content->setVariable("LABEL_DOWNLOAD", gettext("download"));
$size = $doc instanceof steam_document ? $doc->get_attribute("DOC_SIZE") : 0;
示例3: strftime
//zuletzt bearbeitet f�ngt an
$last_modified = $attributes[DOC_LAST_MODIFIED];
if ($last_modified == 0) {
$last_modified = $attributes[OBJ_CREATION_TIME];
}
if ($last_modified != 0) {
$author = $attributes[DOC_USER_MODIFIED];
if (!is_object($author)) {
$author = $item->get_creator();
}
$authorname = $author->get_name();
$authorstring = "<a href=\"" . PATH_URL . "user/" . $authorname . "/\">" . $authorname . "</a>";
$modifiedstring = $authorstring . ",<br />" . "<small>" . strftime("%x", $last_modified) . strftime(", %R", $last_modified) . "</small>";
$content->setVariable("MODIFIED_ITEM", $modifiedstring);
}
$content->setVariable("VALUE_VIEWS", str_replace("%NO_VIEWS", count(lms_steam::get_readers($item)), gettext("%NO_VIEWS views")));
$content->setVariable("VALUE_COMMENTS", str_replace("%NO_COMMENTS", count($item->get_annotations()), gettext("%NO_COMMENTS comments")));
$content->setVariable("HOMEWORK_COMMENTS", PATH_URL . "doc/" . $item->get_id() . "/");
//TODO Hier muss der Link zur Bewertung hin
$content->setVariable("NAME_ITEM", h($item->get_name()));
$item_desc = $attributes[OBJ_DESC];
if (is_string($item_desc) && strlen($item_desc) > 0) {
$content->setCurrentBlock("BLOCK_DESCRIPTION");
$content->setVariable("OBJ_DESC", h($item_desc));
$content->parse("BLOCK_DESCRIPTION");
$content->setVariable("ITEM_STYLE", "style=\"margin-top: 3px;\"");
} else {
$content->setVariable("ITEM_STYLE", "style=\"margin-top: 8px;\"");
}
$content->setVariable("BOXES", "boxes_" . $i);
$content->parse("BLOCK_ITEM");
示例4: h
// $content->setVariable("VALUE_PREVIEW", gettext("No preview available"));
$content->parse("BLOCK_PRVIEW");
}
$content->setVariable("VALUE_OBJ_MIMETYPE", h($document->get_attribute("DOC_MIME_TYPE")));
$changer = $document->get_attribute(DOC_USER_MODIFIED);
if (is_object($changer)) {
$content->setCurrentBlock("BLOCK_CHANGER");
$content->setVariable("LABEL_LAST_CHANGED", gettext("Last changed by"));
$content->setVariable("VALUE_LAST_CHANGE", strftime("%x - %X", $document->get_attribute(DOC_LAST_MODIFIED)));
$changer_data = $changer->get_attributes(array(USER_FIRSTNAME, USER_FULLNAME, OBJ_ICON));
$content->setVariable("CHANGER_ICON", PATH_URL . "get_document.php?id=" . $changer_data[OBJ_ICON]->get_id() . "?type=usericon&width=30&height=40");
$content->setVariable("LINK_CHANGER", PATH_URL . "user/" . h($changer->get_name()) . "/");
$content->setVariable("VALUE_CHANGER_NAME", h($changer_data[USER_FIRSTNAME]) . " " . h($changer_data[USER_FULLNAME]));
$content->parse("BLOCK_CHANGER");
}
$readers = lms_steam::get_readers($document);
$content->setVariable("VALUE_VIEWED", str_replace("%x", count($readers), gettext("%x times")));
$content->setVariable("VALUE_SIZE", get_formatted_filesize($document->get_content_size()));
} else {
if ($document instanceof steam_container) {
// CONTAINER
$content->setCurrentBlock("BLOCK_CONTAINER");
$content->setVariable("LABEL_OBJECTCOUNT", gettext("Contents"));
$content->setVariable("VALUE_OBJECTCOUNT", str_replace("%COUNT", $document->count_inventory(), gettext("%COUNT Objects")));
$content->parse("BLOCK_CONTAINER");
} else {
// DOCEXTERN
$content->setCurrentBlock("BLOCK_DOCEXTERN");
$content->setVariable("LABEL_URL", gettext("URL"));
$content->setVariable("VALUE_URL", $document->get_attribute(DOC_EXTERN_URL));
$content->parse("BLOCK_DOCEXTERN");