本文整理汇总了PHP中getSiteURL函数的典型用法代码示例。如果您正苦于以下问题:PHP getSiteURL函数的具体用法?PHP getSiteURL怎么用?PHP getSiteURL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getSiteURL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct()
{
$guid = getInput("guid");
$reply = getInput("reply");
if (!$reply) {
new SystemMessage("Message body cannot be left empty.");
forward();
}
$message = getEntity($guid);
$to = getLoggedInUserGuid() == $message->to ? $message->from : $message->to;
$from = getLoggedInUserGuid();
$to_user = getEntity($to);
$from_user = getEntity($from);
$message_element = new Messageelement();
$message_element->message = $reply;
$message_element->to = $to;
$message_element->from = $from;
$message_element->container_guid = $guid;
$message_element->save();
$link = getSiteURL() . "messages";
notifyUser("message", $to, getLoggedInUserGuid(), $to);
sendEmail(array("to" => array("name" => $to_user->full_name, "email" => $to_user->email), "from" => array("name" => getSiteName(), "email" => getSiteEmail()), "subject" => "You have a new message from " . getLoggedInUser()->full_name, "body" => "You have received a new message from " . getLoggedInUser()->full_name . "<br/><a href='{$link}'>Click here to view it.</a>", "html" => true));
new SystemMessage("Your message has been sent.");
forward("messages/" . $message->guid);
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:25,代码来源:MessageReplyActionHandler.php
示例2: sendEmail
function sendEmail($name, $Email, $subject, $message, $recipient)
{
$siteURL = getSiteURL();
// Email layout
$formatedMessage = '<html>
<head>
<title>
' . $subject . '
</title>
</head>
<body>
<div class="email">
<p>
Ce message vous à été envoyé depuis
<a href="' . $siteURL . '">
' . $siteURL . '
</a>
par ' . $name . '.
</p>
<p>' . $message . '</p>
</div>
</body>
</html>';
// Headers definition
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
$headers .= 'To: ' . $recipient . "\r\n";
$headers .= 'From: ' . $name . '<' . $Email . '>' . "\r\n";
$headers .= 'Subject: ' . $subject . "\r\n";
// Send and return state
return mail($recipient, $subject, $formatedMessage, $headers);
}
开发者ID:Helladan,项目名称:helladan_website,代码行数:32,代码来源:functions.php
示例3: __construct
public function __construct()
{
$body = display("pages/search_friends");
$guid = getInput("guid");
$button = "<a class='btn btn-success' href='" . getSiteURL() . "profile/{$guid}'>Return</a>";
$this->html = drawPage(array("header" => "Search Results", "body" => $body, "button" => $button));
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:7,代码来源:SearchFriendsPageHandler.php
示例4: __construct
public function __construct()
{
new StorageType("Comment", "body", "text");
new CSS("comments", getSitePath() . "core_plugins/comments/assets/css/comments.css");
new FooterJS("comments", getSiteURL() . "core_plugins/comments/assets/js/comments.js", 5000, true);
new ViewExtension('pages/home_stats', "pages/comment_stats");
new Usersetting(array("name" => "notify_when_comment", "field_type" => "dropdown", "options" => array("email" => "Email", "site" => "Site", "both" => "Both", "none" => "None"), "tab" => "notifications", "default_value" => "both"));
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:8,代码来源:CommentsPlugin.php
示例5: __construct
public function __construct()
{
$title = $body = $button = NULL;
switch (pageArray(1)) {
case "all":
default:
if (loggedIn()) {
$admin_groups = Setting::get("admin_groups");
if (!$admin_groups) {
$admin_groups = "users";
}
if ($admin_groups == "admin" && adminLoggedIn() || $admin_groups == "user") {
$button = "<a href='" . getSiteURL() . "groups/create' class='btn btn-success'>Create a Group</a>";
}
}
$title = "Groups";
$body = display("pages/groups");
break;
case "create":
$admin_groups = Setting::get("admin_groups");
if (!$admin_groups) {
$admin_groups = "user";
}
if ($admin_groups == "admin" && adminLoggedIn() || $admin_groups == "user") {
$title = "Create a Group";
$body = drawForm(array("name" => "create_group", "action" => "createGroup", "method" => "post", "files" => true));
}
break;
case "view":
$guid = pageArray(2);
$group = getEntity($guid);
$edit_url = getSiteURL() . "groups/edit/{$guid}";
$delete_url = addTokenToURL(getSiteURL() . "action/deleteGroup/{$guid}");
if ($group->ownerIsLoggedIn()) {
$button = "<a href='{$edit_url}' class='btn btn-warning'>Edit Group</a>";
$button .= "<a href='{$delete_url}' class='btn btn-danger confirm'>Delete Group</a>";
}
if (GroupsPlugin::loggedInUserCanJoin($group)) {
$join_group_url = addTokenToURL(getSiteURL() . "action/JoinGroup/" . $group->guid);
$button .= "<a href='{$join_group_url}' class='btn btn-success confirm'>Join Group</a>";
}
if ($group->loggedInUserIsMember() && $group->owner_guid != getLoggedInUserGuid()) {
$leave_group_url = addTokenToURL(getSiteURL() . "action/LeaveGroup/" . $group->guid);
$button .= "<a href='{$leave_group_url}' class='btn btn-danger confirm'>Leave Group</a>";
}
$title = $group->title;
$body = display("pages/group");
break;
case "edit":
$guid = pageArray(2);
$group = getEntity($guid);
$title = "Edit " . $group->title;
$body = drawForm(array("name" => "edit_group", "action" => "editGroup", "method" => "post", "files" => true));
break;
}
$this->html = drawPage(array("header" => $title, "body" => $body, "button" => $button));
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:57,代码来源:GroupsPageHandler.php
示例6: __construct
public function __construct()
{
$title = $body = $buttons = $breadcrumbs = NULL;
switch (pageArray(1)) {
default:
$body = display("pages/forum");
$title = "Forum Categories";
if (adminLoggedIn()) {
$add_category_url = getSiteURL() . "forum/add_category";
$buttons = "<a href='{$add_category_url}' class='btn btn-danger'>Add a Category</a>";
}
$breadcrumbs = array(array("link" => getSiteURL() . "forum", "label" => "Categories"));
break;
case 'add_category':
adminGateKeeper();
$body = drawForm(array("name" => "add_category", "method" => "post", "action" => "addCategory"));
$title = "Add a Forum Category";
break;
case 'category':
$guid = pageArray(2);
if ($guid) {
$category = getEntity($guid);
$body = display("forum/category");
if (loggedIn()) {
$add_topic_url = getSiteURL() . "forum/add_topic/{$guid}";
$buttons = "<a href='{$add_topic_url}' class='btn btn-success'>Add Topic</a>";
}
}
$breadcrumbs = array(array("link" => getSiteURL() . "forum", "label" => "Categories"), array("link" => getSiteURL() . "forum/category/" . $category->guid, "label" => $category->title));
break;
case "add_topic":
gateKeeper();
$category_guid = pageArray(2);
$category = getEntity($category_guid);
$body = drawForm(array("name" => "add_topic", "method" => "post", "action" => "addTopic"));
$title = "Add a topic to {$category->title}";
break;
case "topic":
$topic = getEntity(pageArray(2));
$category = getEntity($topic->container_guid);
$breadcrumbs = array(array("link" => getSiteURL() . "forum", "label" => "Categories"), array("link" => getSiteURL() . "forum/category/" . $category->guid, "label" => $category->title), array("link" => getSiteURL() . "forum/topic/" . $topic->guid, "label" => $topic->title));
$body = display("forum/topic");
break;
case "editCategory":
adminGateKeeper();
$title = "Edit Forum Category";
$body = drawForm(array("name" => "edit_category", "method" => "post", "action" => "editCategory'"));
break;
case "editTopic":
adminGateKeeper();
$title = "Edit Forum Topic";
$body = drawForm(array("name" => "edit_topic", "method" => "post", "action" => "editTopic"));
break;
}
$this->html = drawPage(array("header" => $title, "body" => $body, "button" => $buttons, "breadcrumbs" => $breadcrumbs));
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:56,代码来源:ForumPageHandler.php
示例7: __construct
public function __construct()
{
$limit = getInput("limit", 10);
$offset = getInput("offset", 0);
$count = getEntities(array("type" => "File", "count" => true, "metadata_name_value_pairs" => array(array("name" => "owner_guid", "value" => getLoggedInUserGuid()), array("name" => "title", "value" => "NULL", "operand" => "!="))));
$files = listEntities(array("type" => "File", "limit" => $limit, "offset" => $offset, "metadata_name_value_pairs" => array(array("name" => "owner_guid", "value" => getLoggedInUserGuid()), array("name" => "title", "value" => "NULL", "operand" => "!="))));
$pagination = display("page_elements/pagination", array("count" => $count, "offset" => $offset, "limit" => $limit, "url" => getSiteURL() . "files"));
$page = drawPage(array("header" => "Files", "body" => $files, "footer" => $pagination, "button" => "<a href='" . getSiteURL() . "file/upload' class='btn btn-success'>Upload a File</a>"));
$this->html = $page;
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:10,代码来源:FilesPageHandler.php
示例8: __construct
public function __construct()
{
new CSS("files", getSitePath() . "core_plugins/files/assets/css/files.css", 600);
new FooterJS("files", getSiteURL() . "core_plugins/files/assets/js/files.js", 600, true);
if (loggedIn()) {
new StorageType("File", "path", "text");
new StorageType("File", "description", "text");
new StorageType("File", "filename", "text");
new StorageType("File", "file_location", "text");
}
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:11,代码来源:FilesPlugin.php
示例9: __construct
public function __construct()
{
new ViewExtension("profile/right", "profile_status", "before");
new ViewExtension("profile_owner_block_body", "profile/status");
new ViewExtension("tinymce/buttons", "profileStatus/button");
new FooterJS("profile_status", getSiteURL() . "core_plugins/profileStatus/assets/js/profile_status.php", 20000, true);
new StorageType("Profilestatus", "description", "text");
new StorageType("User", "profile_status", "text");
new CSS("profile_status", getSitePath() . "core_plugins/profileStatus/assets/css/style.css", 10000);
new StorageType("Profilestatus", "profile_status", "text");
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:11,代码来源:ProfileStatusPlugin.php
示例10: __construct
public function __construct($data = NULL)
{
gateKeeper();
$logged_in_user = getLoggedInUser();
if (!$data) {
// Get the comment body
$comment_body = getInput("comment");
// Get container url
$container_guid = getInput("guid");
} else {
$comment_body = $data['comment_body'];
$container_guid = $data['container_guid'];
}
$container = getEntity($container_guid);
$container_owner_guid = $container->owner_guid;
if ($container_owner_guid) {
$container_owner = getEntity($container_owner_guid);
}
$url = $container->getURL();
if (!$url) {
$url = getSiteURL();
}
// Create the comment
CommentsPlugin::createComment($container_guid, $comment_body);
if ($container_owner_guid) {
if ($container_owner_guid != getLoggedInUserGuid()) {
$params = array("to" => array($container_owner->full_name, $container_owner->email), "from" => array(getSiteName(), getSiteEmail()), "subject" => "You have a new comment.", "body" => "You have a new comment. Click <a href='{$url}'>Here</a> to view it.", "html" => true);
switch ($logged_in_user->getSetting("notify_when_comment")) {
case "email":
sendEmail($params);
break;
case "none":
break;
case "site":
notifyUser("comment", $container_guid, getLoggedInUserGuid(), $container_owner_guid);
break;
case "both":
sendEmail($params);
notifyUser("comment", $container_guid, getLoggedInUserGuid(), $container_owner_guid);
break;
}
}
}
runHook("add:comment:after");
if (getLoggedInUserGuid() != $container_owner_guid && $container_owner_guid) {
new Activity(getLoggedInUserGuid(), "activity:comment", array(getLoggedInUser()->getURL(), getLoggedInUser()->full_name, $container_owner->getURL(), $container_owner->full_name, $container->getURL(), translate($container->type), truncate($comment_body)));
} elseif (!$container_owner_guid) {
new Activity(getLoggedInUserGuid(), "activity:comment:own", array(getLoggedInUser()->getURL(), getLoggedInUser()->full_name, $container->getURL(), $container->title, translate($container->type), truncate($comment_body)));
}
// Return to container page.
forward();
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:52,代码来源:AddCommentActionHandler.php
示例11: __construct
/**
* Creates notification page html
*/
public function __construct()
{
$user_guid = getLoggedInUserGuid();
$access = getIgnoreAccess();
setIgnoreAccess();
$notifications = listEntities(array("type" => "Notification", "metadata_name" => "owner_guid", "metadata_value" => $user_guid));
setIgnoreAccess($access);
$buttons = getSiteURL() . "action/deleteAllNotifications/{$user_guid}";
$buttons = addTokenToURL($buttons);
$buttons = "<a href='{$buttons}' class='btn btn-danger'>Dismiss All</a>";
$page = drawPage(array("header" => "Notifications", "body" => $notifications, "button" => $buttons));
$this->html = $page;
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:16,代码来源:NotificationsPageHandler.php
示例12: __construct
function __construct()
{
if (loggedIn()) {
$count = self::countUnread();
new MenuItem(array("name" => "messages", "page" => "messages", "label" => "Messages <span class='badge'>{$count}</span> ", "menu" => "my_account", "weight" => 100));
}
new CSS("messages", getSitePath() . "core_plugins/messages/assets/css/style.css", 400000);
new FooterJS("messages", getSiteURL() . "core_plugins/messages/assets/js/messages.js", 5000, true);
new StorageType("MessageElement", "subject", "text");
new StorageType("MessageElement", "message", "text");
new StorageType("Message", "subject", "text");
new Usersetting(array("name" => "notify_when_message", "field_type" => "dropdown", "options" => array("email" => "Email", "site" => "Site", "both" => "Both", "none" => "None"), "tab" => "notifications", "default_value" => "both"));
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:13,代码来源:MessagesPlugin.php
示例13: __construct
public function __construct()
{
$title = $buttons = $body = NULL;
if (BlogsPlugin::userCanCreateBlog()) {
$body = display("page_elements/blogs_tabs");
$buttons = "<a href='" . getSiteURL() . "blogs/add' class='btn btn-success'>Add a Blog</a>";
}
switch (pageArray(1)) {
case "all_blogs":
default:
$title = "Blogs";
$body .= display("pages/all_blogs");
break;
case "friends_blogs":
$title = translate("friends_blogs");
$body .= display("pages/friends_blogs");
break;
case "my_blogs":
$title = "My Blogs";
$body .= display("pages/my_blogs");
break;
case "add":
if (BlogsPlugin::userCanCreateBlog()) {
$title = "Add a Blog";
$body = drawForm(array("name" => "add_blog", "method" => "post", "action" => "addBlog"));
}
break;
case "view":
$guid = pageArray(2);
$blog = getEntity($guid);
if ($blog) {
$title = $blog->title;
}
$owner = getEntity($blog->owner_guid);
$title .= " <small>by {$owner->full_name}</small>";
$body = display("pages/blog");
if (getLoggedInUserGuid() == $blog->owner_guid) {
$edit_url = getSiteURL() . "blogs/edit/{$guid}";
$delete_url = addTokenToURL(getSiteURL() . "action/deleteBlog/{$guid}");
$buttons = "<a href='{$edit_url}' class='btn btn-warning'>Edit</a>";
$buttons .= "<a href='{$delete_url}' class='btn btn-danger confirm'>Delete</a>";
}
break;
case "edit":
$buttons = NULL;
$title = "Edit your blog";
$body = drawForm(array("name" => "edit_blog", "method" => "post", "action" => "addBlog"));
break;
}
$this->html = drawPage(array("header" => $title, "body" => $body, "button" => $buttons));
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:51,代码来源:BlogsPageHandler.php
示例14: __construct
public function __construct()
{
if (loggedIn()) {
new MenuItem(array("name" => "profile", "label" => "My Profile", "page" => "profile/" . getLoggedInUserGuid(), "menu" => "my_account", "weight" => 0));
if (currentPage() == "profile" && pageArray(1) == getLoggedInUserGuid()) {
new MenuItem(array("name" => "edit_profile", "label" => "Edit Profile", "menu" => "profile", "page" => "editProfile", "list_class" => "active", "link_class" => "list-group-item list-group-item-danger"));
} elseif (currentPage() == "home" && loggedIn()) {
new MenuItem(array("name" => "view_my_profile", "label" => "View My Profile", "menu" => "profile", "page" => "profile/" . getLoggedInUserGuid(), "weight" => 10));
new MenuItem(array("name" => "edit_profile", "label" => "Edit My Profile", "menu" => "profile", "page" => "editProfile", "link_class" => "list-group-item", "weight" => 20));
if (isEnabledPlugin("members")) {
new MenuItem(array("name" => "members", "label" => "Browse Members", "menu" => "profile", "page" => "members", "weight" => 30));
}
if (isEnabledPlugin("inviteFriends")) {
new MenuItem(array("name" => "invite_friends", "label" => translate("invite_your_friends"), "menu" => "profile", "page" => "members", "weight" => 40));
}
}
if (currentPage() == "profile" && adminLoggedIn()) {
if (adminLoggedIn()) {
$guid = pageArray(1);
$user = getEntity($guid);
if (is_a($user, "SocialApparatus\\User")) {
if (!isAdmin($user)) {
new MenuItem(array("name" => "delete", "label" => "Delete User", "page" => "action/deleteUser/{$guid}", "menu" => "profile", "weight" => 100000, "list_class" => "active", "link_class" => "list-group-item list-group-item-danger confirm"));
new MenuItem(array("name" => "login_as", "label" => "Login As", "page" => "action/loginas/{$guid}", "menu" => "profile", "weight" => 90000, "list_class" => "active", "link_class" => "list-group-item list-group-item-danger confirm"));
if ($user->banned == "true") {
new MenuItem(array("name" => "unban", "label" => "Unban", "page" => "action/unbanUser/{$guid}", "menu" => "profile", "weight" => 80000, "list_class" => "active", "link_class" => "list-group-item list-group-item-danger confirm"));
} else {
new MenuItem(array("name" => "ban", "label" => "Ban", "page" => "action/banUser/{$guid}", "menu" => "profile", "weight" => 80000, "list_class" => "active", "link_class" => "list-group-item list-group-item-danger confirm"));
}
}
}
}
}
}
if (currentPage() == "profile") {
new CSS("profile", getSitePath() . "core_plugins/profile/assets/css/profile.css");
new FooterJS('profile', getSiteURL() . 'core_plugins/profile/assets/js/profile.js', 900, true);
}
if (currentPage() == "admin") {
new ViewExtension("admin/tabs", "admin_tabs/profile_fields");
}
new ProfileField("first_name", "First Name", "text", false, false, "form-control", "default", 10);
new ProfileField("last_name", "Last Name", "text", false, false, "form-control", "default", 20);
new ProfileField("gender", "Gender", "dropdown", array("Male" => "Male", "Female" => "Female"));
new ProfileField("birthday", "Birthday", "date");
new ProfileField("about", "About Me", "textarea");
new ProfileField("hobbies", "Hobbies", "tags");
new StorageType("User", "about", "text");
new ViewExtension("profile/right", "profile/activity");
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:50,代码来源:ProfilePlugin.php
示例15: getMenuItems
static function getMenuItems()
{
$return = NULL;
$pages = getEntities(array("type" => "Custompage", "order_by" => "weight"));
if ($pages) {
foreach ($pages as $page) {
if ($page->label) {
$return .= "<li>";
$return .= "<a href='" . getSiteURL() . "pages/" . $page->name . "'>" . display("output/editor", array("value" => $page->label)) . "</a>";
$return .= "</li>";
}
}
}
return $return;
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:15,代码来源:Custompage.php
示例16: __construct
/**
* Creates html for insert file page
*
* @param type $data
*/
public function __construct($data)
{
$guid = $data['guid'];
$file = getEntity($guid);
$mime = $file->mime_type;
switch ($mime) {
case "image/jpeg":
case "image/png":
case "image/gif":
$this->html = "<img alt='{$file->title}' src='" . Image::getImageURL($guid) . "'/>";
break;
default:
$image_url = getSiteURL() . "plugins/files/assets/img/file_avatar.png";
$this->html = "<div style='width:75px;'><a href='" . getSiteURL() . $file->getURL() . "'><img src='{$image_url}' title='{$file->title}' class='img-responsive' style='width:75px;' data-title='{$file->title}' alt='{$file->title}'/></a><p class='small text-center'><center>{$file->title}</center></p></div>";
break;
}
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:22,代码来源:InsertFilePageHandler.php
示例17: __construct
function __construct()
{
gateKeeper();
$to = getInput("to");
$from = getLoggedInUserGuid();
$subject = getInput("subject");
$message_body = getInput("message");
if (!$message_body) {
new SystemMessage("Message body cannot be left blank.");
forward();
}
// Make sure recipient is a user
$to_user = getEntity($to);
classGateKeeper($to_user, "User");
// Make sure logged in user and to user are friends
if (!FriendsPlugin::friends(getLoggedInUserGuid(), $to)) {
forward();
}
// Create a new message
$message = new Message();
$message->to = $to;
$message->from = $from;
$message->subject = $subject;
$message->save();
$message_element = new Messageelement();
$message_element->to = $to;
$message_element->from = $from;
$message_element->subject = $subject;
$message_element->message = $message_body;
$message_element->container_guid = $message->guid;
$message_element->save();
$link = getSiteURL() . "messages";
$notify = $to_user->notify_when_message;
if (!$notify) {
$notify = "both";
}
if ($notify == "both" || $notify == "site") {
notifyUser("message", $to, $from, $to);
}
if ($notify == "both" || ($notify = "email")) {
sendEmail(array("to" => array("name" => $to_user->full_name, "email" => $to_user->email), "from" => array("name" => getSiteName(), "email" => getSiteEmail()), "subject" => "You have a new message from " . getLoggedInUser()->full_name, "body" => "You have received a new message from " . getLoggedInUser()->full_name . "<br/><a href='{$link}'>Click here to view it.</a>", "html" => true));
}
new SystemMessage("Your message has been sent.");
forward();
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:45,代码来源:SendMessageActionHandler.php
示例18: __construct
function __construct()
{
if (loggedIn()) {
if (currentPage() == "profile") {
if (isEnabledPlugin("Friends")) {
$user_one = pageArray(1);
$user_two = getLoggedInUserGuid();
if (FriendsPlugin::friends($user_one, $user_two)) {
new MenuItem(array("name" => "chat", "menu" => "profile", "label" => "Chat", "page" => "action/CreateChat/" . $user_one, "link_class" => "list-group-item list-group-item-success"));
}
}
}
}
new ViewExtension("page_elements/foot", "chat/chat_boxes");
new CSS("chat", getSitePath() . "core_plugins/chat/assets/css/chat.css", 400);
new FooterJS("chat", getSiteURL() . "core_plugins/chat/assets/js/chat.js", 400, true);
new Usersetting(array("name" => "notify_offline_chat", "field_type" => "dropdown", "options" => array("yes" => "Yes", "no" => "No"), "default_value" => "yes", "tab" => "notifications"));
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:18,代码来源:ChatPlugin.php
示例19: icon
public function icon($thumbnail = 560, $class = NULL, $img_tag = true, $style = NULL, $processed = true)
{
switch ($this->video_type) {
default:
$return = NULL;
if ($thumbnail <= EXTRALARGE) {
$id = $this->getYoutubeID();
if (strpos($class, "img-responsive") === false) {
$return = "<span style='width:{$thumbnail}px' class='{$class}'>";
}
$return .= "<img src='http://img.youtube.com/vi/{$id}/0.jpg' style='max-width:{$thumbnail}px;' class='img-responsive {$class}' alt=''/>";
if (strpos($class, "img-responsive") === false) {
$return .= "</span>";
}
return $return;
}
return $this->embedHTML($thumbnail, $class);
break;
case "upload":
$guid = $this->video_guid;
if ($thumbnail <= EXTRALARGE) {
$source = getSiteURL() . "core_plugins/videos/views/output/video_image_viewer.php?guid={$guid}";
return "<img src='{$source}' alt='' class='img-responsive {$class}' style='max-width:{$thumbnail}px'/>";
} else {
if ($this->processed == "true") {
$mp4 = getSiteURL() . "core_plugins/videos/views/output/video_viewer.php?guid={$guid}&path=mp4";
$webm = getSiteURL() . "core_plugins/videos/views/output/video_viewer.php?guid={$guid}&path=webm";
$ogg = getSiteURL() . "core_plugins/videos/views/output/video_viewer.php?guid={$guid}&path=ovg";
$poster = getSiteURL() . "core_plugins/videos/views/output/video_image_viewer.php?guid={$guid}";
return <<<HTML
<video poster="{$poster}" controls="controls" preload="none" width="{$thumbnail}px">
<source type="video/mp4" src="{$mp4}" />
<source type="video/webm" src="{$webm}" />
<source type="video/ogg" src="{$ogg}" />
</video>
HTML;
} else {
$source = getSiteURL() . "assets/img/avatars/processing_video.jpg";
return "<img src='{$source}' alt='' class='img-responsive {$class}' style='max-width:{$thumbnail}px'/>";
}
}
break;
}
}
开发者ID:socialapparatus,项目名称:socialapparatus,代码行数:44,代码来源:Video.php
示例20: __construct
public function __construct()
{
new CSS("videos", getSitePath() . "core_plugins/videos/vendor/mediaelement/build/mediaelementplayer.css");
new FooterJS("video", getSiteURL() . "core_plugins/videos/assets/js/video.js", 5001, true);
new FooterJS("video_player", getSiteURL() . "core_plugins/videos/vendor/mediaelement/build/mediaelement-and-player.min.js", 5000);
new StorageType("Video", "description", "text");
new StorageType("Video", "url", "text");
new StorageType("Videoalbum", "description", "text");
new StorageType("Videoalbum", "icon_filename", "text");
new ViewExtension("header:after", "page_elements/video_selector");
new ViewExtension("page_elements/site_js", "videos/video_footer");
new ViewExtension("profile/right", "videos/profile"
|
请发表评论