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);
 }
Ejemplo n.º 2
0
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);
}
 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));
 }
 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"));
 }
 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));
 }
 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));
 }
 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;
 }
 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");
     }
 }
 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");
 }
 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();
 }
 /**
  * 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;
 }
 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"));
 }
 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));
 }
 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");
 }
Ejemplo n.º 15
0
 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;
 }
 /**
  * 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;
     }
 }
 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();
 }
Ejemplo n.º 18
0
 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"));
 }
Ejemplo n.º 19
0
    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;
        }
    }
 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");
     new ViewExtension("tinymce/buttons", "videos/tinymce_button");
     new Hook("cron:minute", "VideoConvertHook");
     new Admintab("video_settings", 1000, array());
     new Setting("allow_video_uploads", "dropdown", array("no" => "No", "yes" => "Yes"), "video_settings");
     new Setting("ffmpeg_ffmprobe_executable_path", "text", array(), "video_settings", shell_exec("which ffmpeg"));
     new Metatag("Video", "title", getSiteName() . " | Videos");
     new MenuItem(array("name" => "videos", "href" => "videos", "label" => "Videos", "menu" => "header_left", "list_class" => "visible-xs hidden-sm visible-md visible-lg"));
     new MenuItem(array("name" => "videos2", "href" => "videos", "label" => "Videos", "menu" => "tools", "page" => "videos"));
 }
Ejemplo n.º 21
0
 static function draw($scope = "internal")
 {
     $cssArray = Cache::get("css_array", "page");
     switch ($scope) {
         case "internal":
             return "<link href='" . getSiteURL() . "views/page_elements/css.php?page=" . currentPage() . "' rel='stylesheet' media='all'>";
             break;
         case "external":
             $return = NULL;
             if (is_array($cssArray)) {
                 foreach ($cssArray as $css) {
                     if (strpos($css['css'], "http") !== false) {
                         $return .= "<link href='" . $css['css'] . "' rel='stylesheet' media='all'>";
                     }
                 }
             }
             return $return;
             break;
     }
     return NULL;
 }
 public function __construct()
 {
     new CSS("photo", getSitePath() . "core_plugins/photos/assets/css/photos.css");
     new StorageType("Photo", "description", "text");
     new StorageType("Photoalbum", "description", "text");
     new StorageType("Photoalbum", "icon_filename", "text");
     new FooterJS("photo", getSiteURL() . "core_plugins/photos/assets/js/photo.js", 5000, true);
     new ViewExtension("header:after", "page_elements/photo_selector");
     new ViewExtension("profile/middle", "photos/profile");
     new ViewExtension('pages/home_stats', "pages/photo_stats");
     new ViewExtension("page_elements/site_js", "photos/photo_footer");
     new ViewExtension("tinymce/buttons", "photos/tinymce_button");
     if (isEnabledPlugin("groups")) {
         new ViewExtension("groups/right", "photos/group_photos");
     } else {
         removeViewExtension("groups/right", "photos/group_photos");
     }
     new Metatag("Photo", "title", getSiteName() . " | Photos");
     new MenuItem(array("name" => "photos", "href" => "photos", "label" => "Photos", "menu" => "header_left", "list_class" => "visible-xs hidden-sm visible-md visible-lg"));
     new MenuItem(array("name" => "photos2", "href" => "photos", "label" => "Photos", "menu" => "tools", "page" => "photos"));
 }
 /**
  * Creates html for activity page
  */
 public function __construct()
 {
     switch (pageArray(1)) {
         default:
         case "all":
             $this->params = array("type" => "Activity", "order_by" => "time_created", "order_reverse" => true, "offset" => getInput("offset", 0));
             break;
         case "mine":
             $this->params = array("type" => "Activity", "order_by" => "time_created", "order_reverse" => true, "offset" => getInput("offset", 0), "metadata_name" => "owner_guid", "metadata_value" => getLoggedInUserGuid());
             break;
         case "friends":
             $this->params = array("type" => "Activity", "order_by" => "time_created", "order_reverse" => true, "offset" => getInput("offset", 0), "metadata_name" => "owner_guid", "metadata_value" => "('" . FriendsPlugin::getFriendGuidCSString(getLoggedInUser()) . "')", "operand" => "IN");
             break;
     }
     $this->params['count'] = true;
     $this->count = getEntities($this->params);
     unset($this->params['count']);
     $this->params['limit'] = 10;
     $entities = listEntities($this->params);
     $pagination = display("page_elements/pagination", array("count" => $this->count, "offset" => getInput("offset"), "limit" => $this->limit, "url" => "activity"));
     $this->tabs = display("page_elements/tabs", array("tabs" => array("All" => getSiteURL() . "activity", "Mine" => getSiteURL() . "activity/mine", "Friends" => getSiteURL() . "activity/friends")));
     $this->html = drawPage(array("header" => "Activity", "body" => $this->tabs . $entities . $pagination));
 }
    public function __construct()
    {
        $page = pageArray();
        switch ($page[1]) {
            case "upload":
                $form = drawForm(array("name" => "file/upload", "method" => "post", "action" => "fileUpload", "enctype" => "multipart/form-data"));
                new Vars("container_guid", pageArray());
                $this->html = drawPage(array("header" => "Upload File", "body" => $form));
                break;
            default:
                if (is_numeric($page[1])) {
                    $guid = $page[1];
                    $file = getEntity($page[1]);
                    $image_url = Image::getImageURL($guid);
                    $image_title = $file->name;
                    $left_content = "<a href='{$image_url}' data-lightbox='image-{$guid}' data-title='{$image_title}'><img src='{$image_url}' class='img-responsive' alt=''/></a>";
                    $right_content = html_entity_decode($file->description);
                    $comments = display("output/block_comments", array("guid" => $guid, "show_form" => true));
                    $download_button = "<a href='" . getSiteURL() . "views/output/file_download.php?guid={$guid}' class='btn btn-success btn-block' style='margin-top:18px;'>Download</a>";
                    $body = <<<HTML
        <div class='col-sm-4'>
            {$left_content}
            {$download_button}
        </div>
        <div class='col-sm-8'>
            <div class='well'>
                {$right_content}
            </div>
            {$comments}
        </div>
HTML;
                    $this->html = drawPage(array("header" => $file->title, "body" => $body));
                }
                return false;
                break;
        }
    }
Ejemplo n.º 25
0
    $view_type = "list";
}
$size = Vars::get("size");
if (!$size) {
    $size = MEDIUM;
}
$created = "Uploaded: by " . $name . " " . display("output/friendly_time", array("timestamp" => $file->time_created));
$icon = Image::getImageURL($file->guid, $size);
$body_before = display("file/body_before", array("guid" => $guid));
$body_after = display("file/body_after", array("guid" => $guid));
$media_left_before = display("file:list:media:left:before", array("guid" => $guid));
$media_left_after = display("file:list:media:left:after", array("guid" => $guid));
$media_right_before = display("file:list:media:right:before", array("guid" => $guid));
$media_right_after = display("file:list:media:right:after", array("guid" => $guid));
if (getLoggedInUserGuid() == $file->owner_guid) {
    $buttons = "<a href='" . addTokenToURL(getSiteURL() . 'action/deleteFile/' . $guid) . "' class='btn btn-danger confirm'><i class='fa fa-times'></i></a>";
}
$filename = $file->filename;
switch ($view_type) {
    case "list":
    default:
        $core_output = <<<HTML
<div class="well well-sm">
    <div class="media">
        <input type="hidden" class="guid" value="{$guid}"/>
        <div class="media-left">
            {$media_left_before}
            <a href="{$url}" title="{$file->title}" data-toggle="tooltip" >
                <img class="media-object img-rounded" data-title="{$file->title}" title="{$file->title}" src="{$icon}" style='width:64px;' alt="{$file->title}">
            </a>
            {$media_left_after}
 public function __construct()
 {
     new MenuItem(array("name" => "members", "label" => "Members", "page" => "members", "menu" => "directory", "weight" => 70));
     new CSS("members", getSitePath() . "core_plugins/members/assets/css/style.css", 500);
     new FooterJS("members", getSiteURL() . "core_plugins/members/assets/js/members.js", 500, true);
 }
Ejemplo n.º 27
0
/**
 * Creates Standard URL for Pages
 *
 * Default function to create the correct url structure for each front-end pages
 * 
 * @since 3.4
 * @uses $PRETTYURLS
 * @uses $PERMALINK
 * @uses tsl
 *
 * @param string $slug
 * @param string $parent
 * @param string $absolute force absolute siteurl
 * @return string
 */
function generate_url($slug, $absolute = false)
{
    global $PRETTYURLS;
    global $PERMALINK;
    // force slug to string in case a simpleXml object was passed ( from a page obj for example)
    $slug = (string) $slug;
    $delim = getDef('GSTOKENDELIM');
    if (empty($slug)) {
        return;
    }
    // empty slug
    $path = tsl(getSiteURL($absolute));
    $url = $path;
    // var to build url into
    if ($slug != getDef('GSINDEXSLUG')) {
        if ($PRETTYURLS == '1') {
            $url .= generate_permalink($slug);
        } else {
            if (!empty($PERMALINK)) {
                $url .= generate_permalink($slug, $PERMALINK);
            } else {
                $url .= 'index.php?id=' . $slug;
            }
        }
    }
    $url = exec_filter('generate_url', $url);
    // @filter generate_url (str) for generating urls after processing, for use with custom tokens etc
    return $url;
}
Ejemplo n.º 28
0
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$page = pageArray(0);
$title = Metatag::getMetatagText("title", $page);
$description = Metatag::getMetatagText("description", $page);
echo "<meta charset = 'utf-8'>";
echo "<meta http-equiv = 'X-UA-Compatible' content = 'IE=edge'>";
echo "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>";
echo "<title>{$title}</title>";
echo "<meta name='description' content='{$description}'>";
echo <<<HTML
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimal-ui" />
<meta name="apple-mobile-web-app-status-bar-style" content="yes" />

HTML;
echo CSS::draw("external");
echo CSS::draw("internal");
$url = getSiteURL();
echo <<<HTML
<script src="{$url}assets/vendor/jquery/dist/jquery.min.js"></script>
HTML;
echo HeaderJS::draw();
echo "<!--[if lt IE 9]>";
echo "<script src = 'https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js'></script>";
echo "<script src='https://oss.maxcdn.com/respond/1.4.2/respond.min.js'></script>";
echo "<![endif]-->";
Ejemplo n.º 29
0
 * SocialApparatus CONFIDENTIAL
 * __________________
 * 
 *  [2002] - [2017] SocialApparatus (http://SocialApparatus.co) 
 *  All Rights Reserved.
 * 
 * NOTICE:  All information contained herein is, and remains the property of SocialApparatus 
 * and its suppliers, if any.  The intellectual  and technical concepts contained herein 
 * are proprietary to SocialApparatus and its suppliers and may be covered by U.S. and Foreign 
 * Patents, patents in process, and are protected by trade secret or copyright law. 
 * 
 * Dissemination of this information or reproduction of this material is strictly forbidden 
 * unless prior written permission is obtained from SocialApparatus.
 * 
 * Contact Shane Barron admin@socia.us for more information.
 */
namespace SocialApparatus;

denyDirect();
$guid = pageArray(2);
$category = getEntity($guid);
echo $category->view();
$topics = listEntities(array("type" => "Forumtopic", "metadata_name" => "container_guid", "metadata_value" => $category->guid, "view_type" => "", "offset" => getInput("offset", 0), "limit" => 5));
$count = getEntities(array("type" => "Forumtopic", "metadata_name" => "container_guid", "metadata_value" => $category->guid, "count" => true));
$pagination = display("page_elements/pagination", array('count' => $count, 'offset' => getInput("offset", 0), 'limit' => 5, 'url' => getSiteURL() . "forum/category/{$guid}"));
echo <<<HTML
<h3>Topics</h3>
{$topics}
{$pagination}
HTML
;
if (loggedIn()) {
    $user = getLoggedInUser();
    $session = $user->session;
}
?>
<script type="text/javascript">
    var site = {
        session: function () {
            return "<?php 
echo $session;
?>
";
        },
        url: function () {
            return "<?php 
echo getSiteURL();
?>
";
        },
        path: function () {
            return "<?php 
echo addslashes(SITEPATH);
?>
";
        },
        pageArray: function () {
            return <?php 
echo json_encode(pageArray());
?>
;
        },