Пример #1
0
if (isset($comment_area) && !empty($comment_area)) {
    $comment = new Comment();
    $comment->text = $comment_area;
    $comment->user = $username;
    $rr->addComment($href, $comment);
}
$content = $rr->get($href);
$title = $content->title;
$parent_title = $content->parent_path;
$extracted_title = substr($title, strlen($parent_title) + 1);
$author = $content->author_username;
$created_time = date('M d Y h:i:s A', (int) $content->created_time);
$last_updated_user = $content->last_updated_username;
$last_updated_time = date('M d Y h:i:s A', (int) strtotime($content->updated));
$subtitle = $content->subtitle;
$avg_ratings = $rr->getAverageRating($href);
if ($username !== NULL && !empty($username)) {
    $user_ratings = $rr->getUserRating($href, $username);
} else {
    $user_ratings = 0;
}
$tags_array = $rr->getTags($href);
$tags = "";
foreach ($tags_array as $tag) {
    $tag_html = "<a href=\"tag_search.php?tag={$tag}\">{$tag}</a>";
    $tags .= $tag_html . " ";
}
$properties = $content->properties;
$src = $properties["src"];
$demo = $properties["demo"];
$download = $properties["download"];
Пример #2
0
    foreach ($entries as $title => $href) {
        $extracted_href = substr($href, strlen(REGISTRY_ATOM_INTERFACE) - 1);
        $content = $rr->get($extracted_href);
        if (strstr($extracted_href, $parent_title) === FALSE) {
            continue;
        }
        $extracted_title = substr($title, strlen($parent_title) + 1);
        if (strlen($extracted_title) == 0) {
            continue;
        }
        $resources[$i] = array();
        $resources[$i]["title"] = $extracted_title;
        $resources[$i]["path"] = $title;
        $resources[$i]["author"] = $content->author_username;
        $resources[$i]["subtitle"] = $content->subtitle;
        $ratings = $rr->getAverageRating($extracted_href);
        $resources[$i]["ratings"] = $ratings;
        $tags_array = $rr->getTags($extracted_href);
        $tags = "";
        foreach ($tags_array as $tagx) {
            $tag_html = "<a href=\"tag_search.php?tag={$tagx}\">{$tagx}</a>";
            $tags .= $tag_html . " ";
        }
        $resources[$i]["tags"] = $tags;
        $i++;
    }
}
$properties = $contents->properties;
if (is_array($properties)) {
    $demo = $properties["demo"];
}