public function Delete() { $pdo = DataSystem::GetPDO(); $query = "DELETE FROM " . System::GetConfigurationValue("Database.TablePrefix") . "Contents WHERE content_Path = :content_Path AND content_LanguageID = :content_LanguageID"; $statement = $pdo->prepare($query); $result = $statement->execute(array(":content_Path" => $this->Path, ":content_LanguageID" => $this->Language->ID)); return $result !== false; }
public static function GetByName($name) { $pdo = DataSystem::GetPDO(); $query = "SELECT * FROM " . System::GetConfigurationValue("Database.TablePrefix") . "Themes WHERE theme_Name = :theme_Name"; $statement = $pdo->prepare($query); $result = $statement->execute(array(":theme_Name" => $name)); if ($statement->rowCount() > 0) { $values = $statement->fetch(PDO::FETCH_ASSOC); return Theme::GetByAssoc($values); } return null; }
protected function OnInitialize() { parent::OnInitialize(); $url = "~/API/Search.php?format=json&query=%1"; $count = count($this->SearchScopes); if ($count > 0) { $url .= "&include="; for ($i = 0; $i < $count; $i++) { $scope = $this->SearchScopes[$i]; $url .= $scope; if ($i < $count - 1) { $url .= ","; } } } $this->SuggestionURL = System::ExpandRelativePath($url); }
public function OnInitializing(CancelEventArgs $e) { header("Content-Type: text/css"); $path = System::GetApplicationPath() . "/Resources/" . $e->RenderingPage->GetPathVariableValue("BundleName") . "/StyleSheets/*.less"; $filenames = glob($path); $content = ""; foreach ($filenames as $filename) { $content .= "/* " . $filename . " */"; $content .= file_get_contents($filename); $content .= "\r\n"; } try { $less = new LessStyleSheetCompiler(); $less->formatter = new CompressedFormatter(); $v = $less->compile($content); echo "/* compiled with lessphp v0.4.0 - GPLv3/MIT - http://leafo.net/lessphp */\n"; echo "/* for human-readable source of this file, replace .css with .less in the file name */\n"; echo $v; } catch (Exception $e) { echo "/* " . $e->getMessage() . " */\n"; } $e->Cancel = true; }
protected function RenderContent() { ?> <div class="ChatBar<?php switch ($this->Position) { case ChatBarPosition::Top: echo " Top"; break; case ChatBarPosition::Bottom: echo " Bottom"; break; } ?> " id="ChatArea_<?php echo $this->ID; ?> "> <div class="ChatPanels" id="ChatArea_<?php echo $this->ID; ?> _Panels"> <div class="ChatPanel BuddyListPanel" id="ChatArea_<?php echo $this->ID; ?> _BuddyListPanel"> <?php foreach ($this->Buddies as $buddy) { ?> <a href="#" onclick="<?php echo $this->ID; ?> .CreateChat('<?php echo $buddy->UserName; ?> ', '<?php echo $buddy->DisplayName; ?> ', '<?php echo $buddy->ImageURL; ?> '); return false;"><?php echo $buddy->DisplayName; ?> </a> <?php } ?> </div> <?php $i = 0; foreach ($this->Panels as $panel) { ?> <div class="ChatPanel" id="ChatArea_<?php echo $this->ID; ?> _Panel_<?php echo $i; ?> "> <input type="hidden" id="ChatArea_<?php echo $this->ID; ?> _Panel_<?php echo $i; ?> _Receiver" value="<?php echo $panel->UserName; ?> " /> <input type="hidden" id="ChatArea_<?php echo $this->ID; ?> _Panel_<?php echo $i; ?> _Receiver_DisplayName" value="<?php echo $panel->DisplayName; ?> " /> <input type="hidden" id="ChatArea_<?php echo $this->ID; ?> _Panel_Receiver_<?php echo $panel->UserName; ?> _ID" value="<?php echo $i; ?> " /> <div class="ChatPanelTitle"> <a class="Title" href="#" onclick="<?php echo $this->ID; ?> .ActivateChat(<?php echo $i; ?> ); return false;"><?php echo $panel->DisplayName; ?> </a> <?php if ($panel->PopoutURL != null) { ?> <a target="_blank" class="Close" href="<?php echo System::ExpandRelativePath($panel->PopoutURL); ?> "><i class="fa fa-external-link"></i></a> <?php } ?> <a class="Close" href="#" onclick="<?php echo $this->ID; ?> .CloseChat(<?php echo $i; ?> ); return false;"><i class="fa fa-times"></i></a> </div> <div class="ChatPanelHistory" id="ChatArea_<?php echo $this->ID; ?> _Panel_<?php echo $i; ?> _History"> <?php foreach ($panel->Messages as $message) { ?> <div class="ChatPanelHistoryMessage"> <img class="ChatPanelHistoryMessageAvatar" src="<?php echo System::ExpandRelativePath($message->ImageURL); ?> " alt="<?php echo $message->DisplayName; ?> " title="<?php echo $message->DisplayName; ?> " /> <div class="ChatPanelHistoryMessageContent"><?php echo $message->Content; ?> </div> </div> <?php } ?> </div> <div class="ChatPanelStatus" id="ChatArea_<?php echo $this->ID; ?> _Panel_<?php echo $i; ?> _Status"> </div> <textarea class="ChatPanelInput" id="ChatArea_<?php echo $this->ID; ?> _Panel_<?php echo $i; ?> _Input" type="text" placeholder="<?php echo $this->PlaceholderText; ?> " onkeydown="<?php echo $this->ID; ?> .OnKeyDown(<?php echo $i; ?> , event);" onkeyup="<?php echo $this->ID; ?> .OnKeyUp(<?php echo $i; ?> , event);"></textarea> </div> <?php $i++; } ?> </div> <div class="ChatButtons" id="ChatArea_<?php echo $this->ID; ?> _Buttons"> <a href="#" class="ChatBarButton" id="ChatArea_<?php echo $this->ID; ?> _BuddyListButton" onclick="<?php echo $this->ID; ?> .ActivateBuddyList(); return false;"><span class="ChatBarButtonText">Buddy List</span></a> <?php $i = 0; foreach ($this->Panels as $panel) { ?> <a href="#" class="ChatBarButton" id="ChatArea_<?php echo $this->ID; ?> _Buttons_<?php echo $i; ?> _Button" onclick="<?php echo $this->ID; ?> .ActivateChat(<?php echo $i; ?> ); return false;"> <img class="ChatBarButtonAvatar" src="<?php echo System::ExpandRelativePath($panel->ImageURL); ?> " /> <span class="ChatBarButtonText"><?php echo $panel->DisplayName; ?> </span> </a> <?php $i++; } ?> </div> <script type="text/javascript">var <?php echo $this->ID; ?> = new ChatBar("<?php echo $this->ID; ?> ", "<?php echo $this->UserName; ?> ");</script> </div> <?php }
public function Render($comment_base_url = null) { $CurrentUser = User::GetCurrent(); $ParentObjectType = 0; switch (get_class($this)) { case "GroupTopicComment": $ParentObjectType = 1; break; case "JournalEntryComment": $ParentObjectType = 2; break; } ?> <div class="Comment"> <div class="CommentTitle" id="Comment_<?php echo $this->ID; ?> _title"><?php echo $this->Title; ?> </div> <div class="CommentEditor CommentTitle" id="Comment_<?php echo $this->ID; ?> _editor_title"><input id="Comment_<?php echo $this->ID; ?> _editor_title_input" type="text" value="<?php echo $this->Title; ?> " /></div> <div class="CommentContent" id="Comment_<?php echo $this->ID; ?> _content"><?php echo $this->Content; ?> </div> <div class="CommentEditor" id="Comment_<?php echo $this->ID; ?> _editor_content"> <textarea id="Comment_<?php echo $this->ID; ?> _editor_content_input"><?php echo $this->Content; ?> </textarea> </div> <div class="CommentInformation"> <span class="PostedBy"> Posted by <span class="Author"><a href="<?php echo System::ExpandRelativePath("~/community/members/" . $this->Author->ShortName); ?> " target="_blank"><img src="<?php echo System::ExpandRelativePath("~/community/members/" . $this->Author->ShortName . "/images/avatar/thumbnail.png"); ?> " style="height: 32px;" /> <?php mmo_display_user_badges_by_user($this->Author); echo $this->Author->LongName; ?> </a></span> on <span class="Timestamp"><?php echo $this->TimestampCreated; ?> </span> </span> <span class="CommentActions"> <a id="Comment_<?php echo $this->ID; ?> _actions_like" href="#" onclick="CommentManager.SetPopularity(<?php echo $ParentObjectType; ?> , <?php echo $this->ID; ?> , 1); return false;">Like</a> | <a id="Comment_<?php echo $this->ID; ?> _actions_dislike" href="#" onclick="CommentManager.SetPopularity(<?php echo $ParentObjectType; ?> , <?php echo $this->ID; ?> , -1); return false;">Dislike</a> | <a id="Comment_<?php echo $this->ID; ?> _actions_reply" href="#" onclick="CommentManager.Reply(<?php echo $ParentObjectType; ?> , <?php echo $this->ID; ?> ); return false;">Reply</a> <?php if ($this->Author->ID == $CurrentUser->ID) { ?> | <a id="Comment_<?php echo $this->ID; ?> _actions_modify" href="#" onclick="CommentManager.BeginModify(<?php echo $ParentObjectType; ?> , <?php echo $this->ID; ?> ); return false;">Modify</a> | <a id="Comment_<?php echo $this->ID; ?> _actions_delete" href="#" onclick="CommentManager.Delete(<?php echo $ParentObjectType; ?> , <?php echo $this->ID; ?> ); return false;">Delete</a> <?php } ?> </span> </div> </div> <?php }
// // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. // ============================================================================= // Load the Phast content (which also include_once's the system modules and // other Phast-specific stuff) require_once "Phast/System.inc.php"; // Bring in the Phast\System and Phast\IncludeFile classes so we can simply refer // to them (in this file only) as "System" and "IncludeFile", respectively, from // now on use Phast\System; use Phast\IncludeFile; // We need to set the root path of the Web site. It's usually something like // /var/www/yourdomain.com. System::SetApplicationPath(dirname(__FILE__)); // Tell Phast that we are ready to launch the application. This searches the entire // directory hierarchy for Phast files, loading *.phpx files as Phast XML files and // *.phpx.php files as PHP code-behind files. We may decide to use the *.ctlx extension // (and its associated *.ctlx.php) for PHPX controls. System::Launch();
public function GetSlices($max = null) { $pdo = DataSystem::GetPDO(); $query = "SELECT * FROM " . System::GetConfigurationValue("Database.TablePrefix") . "AvatarBaseSlices"; $query .= " WHERE slice_BaseID = :slice_BaseID AND slice_ParentSliceID = :slice_ParentSliceID"; if (is_numeric($max)) { $query .= " LIMIT " . $max; } $statement = $pdo->prepare($query); $result = $pdo->execute(array(":slice_BaseID" => $this->Base->ID, ":slice_ParentSliceID" => $this->ID)); $count = $statement->rowCount(); $retval = array(); for ($i = 0; $i < $count; $i++) { $values = $result->fetch(PDO::FETCH_ASSOC); $retval[] = AvatarBaseSlice::GetByAssoc($values); } return $retval; }
public static function GetByUser($user, $max = null) { global $MySQL; $query = "SELECT * FROM " . System::GetConfigurationValue("Database.TablePrefix") . "member_friend_circles WHERE owner_id = " . $user->ID; if ($max != null && is_numeric($max)) { $query .= " LIMIT " . $max; } $result = $MySQL->query($query); $count = $result->num_rows; $retval = array(); for ($i = 0; $i < $count; $i++) { $values = $result->fetch_assoc(); $retval[] = FriendCircle::GetByAssoc($values); } return $retval; }
public static function Get($max = null) { $pdo = DataSystem::GetPDO(); $query = "SELECT * FROM " . System::GetConfigurationValue("Database.TablePrefix") . "DashboardPostImpressions"; if (is_numeric($max)) { $query .= " LIMIT " . $max; } $retval = array(); $statement = $pdo->prepare($query); $result = $statement->execute(); if ($result === false) { return $retval; } $count = $statement->rowCount(); for ($i = 0; $i < $count; $i++) { $values = $statement->fetch(PDO::FETCH_ASSOC); $retval[] = DashboardPostImpression::GetByAssoc($values); } return $retval; }