Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Continued to build out the page component.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelchisari authored and The Appleseed Project committed Oct 17, 2010
1 parent c3ce206 commit 272b697
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 18 deletions.
2 changes: 1 addition & 1 deletion _release/update-0.7.8.sql
Original file line number Diff line number Diff line change
@@ -1 +1 @@
create table `lost_ProfilePage` ( `Post_PK` int(11) not null auto_increment, `Owner_FK` int(11) default null, `Action` char(32) default null, `ActionOwner` char(128) default null, `ActionLink` char(255) default null, `Description` text default null, `Comment` text default null, `Thumb` char default null, `Stamp` datetime default null, `Current` tinyint(1) default null, primary key (`Post_PK`) ) engine=myisam default charset=utf8;
create table `#__PagePosts` ( `Post_PK` int(11) not null auto_increment, `User_FK` int(11) default null, `Action` char(32) default null, `ActionOwner` char(128) default null, `ActionLink` char(255) default null, `Description` text default null, `Comment` text default null, `Thumb` char default null, `Stamp` datetime default null, `Current` tinyint(1) default null, primary key (`Post_PK`) ) engine=myisam default charset=utf8;
39 changes: 37 additions & 2 deletions components/page/controllers/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function __construct ( ) {
public function Display ( $pView = null, $pData = array ( ) ) {

$this->View = $this->GetView ( $pView );
$this->Model = $this->GetModel ();

$this->_Focus = $this->Talk ( 'User', 'Focus' );
$this->_Current = $this->Talk ( 'User', 'Current' );
Expand All @@ -49,18 +50,52 @@ public function Display ( $pView = null, $pData = array ( ) ) {

private function _Prep ( ) {

$this->Model->RetrievePagePosts ( $this->_Focus->Id );
$this->View->Find ( "[name=Context]", 0 )->value = $this->Get ( "Context" );

$privacyData = array ( 'start' => $start, 'step' => $step, 'total' => $total, 'link' => $link );
$privacyControls = $this->View->Find ('.privacy', 0);
$privacyControls->innertext = $this->GetSys ( "Components" )->Buffer ( "privacy", $pageData );

$li = $this->View->Find ( '.list .item', 0);

$row = $this->View->Copy ( '.list' )->Find ( '.item', 0 );

$rowOriginal = $row->outertext;

$li->innertext = '';

while ( $this->Model->Fetch() ) {
$row = new cHTML ();
$row->Load ( $rowOriginal );

$row->Find ( '.stamp', 0 )->innertext = $this->GetSys ( "Date" )->Format ( $this->Model->Get ( "Stamp" ) );
$row->Find ( '.content', 0 )->innertext = $this->Model->Get ( "Comment" );
$row->Find ( '.owner-link', 0 )->rel = $this->Model->Get ( "ActionOwner" );
$row->Find ( '.owner-link', 0 )->innertext = $this->Model->Get ( "ActionOwner" );

list ( $username, $domain ) = explode ( '@', $this->Model->Get ( "ActionOwner" ) );
$data = array ( 'username' => $username, 'domain' => $domain, 'width' => 64, 'height' => 64 );
$row->Find ( '.owner-icon', 0 )->src = $this->GetSys ( 'Event' )->Trigger ( 'On', 'User', 'Icon', $data );

$li->innertext .= $row->outertext;
unset ( $row );
}

$this->View->Reload();

return ( true );
}

public function Share ( $pView = null, $pData = array ( ) ) {

$Comments = $this->GetSys ( "Request" )->Get ( "Comment" );
$Privacy = $this->GetSys ( "Request" )->Get ( "Privacy" );
echo "<pre>";
print_r ( $_REQUEST );
print_r ( $Privacy );

return ( true );
}

}

}
13 changes: 10 additions & 3 deletions components/page/models/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* @package Appleseed.Components
* @subpackage Page
*/
class cPagePageModel extends cModel {
class cPageModel extends cModel {

protected $_Tablename = "PagePosts";

Expand All @@ -33,14 +33,14 @@ public function __construct ( $pTables = null ) {

public function RetrieveCurrent ( $pUserId ) {

$criteria = array ( "Owner_FK" => $pUserId, "Current" => 1 );
$criteria = array ( "User_FK" => $pUserId, "Current" => 1 );
$this->Retrieve ( $criteria );

return ( true );
}

public function ClearCurrent ( $pUserId ) {
$criteria = array ( "Owner_FK" => $pUserId, "Current" => 1 );
$criteria = array ( "User_FK" => $pUserId, "Current" => 1 );
$this->Retrieve ( $criteria );

if ( $this->Get ( " Total" ) == 0 ) return ( true );
Expand All @@ -53,4 +53,11 @@ public function ClearCurrent ( $pUserId ) {
return ( true );
}

public function RetrievePagePosts ( $pUserId ) {

$criteria = array ( "User_FK" => $pUserId );
$this->Retrieve ( $criteria );

return ( true );
}
}
14 changes: 4 additions & 10 deletions components/page/views/page.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,18 @@
<form method="post" class="post">
<input type="hidden" name="Task" value="Share">
<input type="hidden" name="Context" value="">
<textarea placeholder="What Is On Your Mind" class="comments" name="Comments"></textarea>
<textarea placeholder="What Is On Your Mind" class="comments" name="Comment"></textarea>
<button class="submit">Submit Post</button>
<div class="privacy">
<h2 class="privacy-message">Who can see this?</h2>
<ul>
<li class="everybody"><input name="Privacy['everybody']" type="checkbox"><label for="privacy[]">Everybody Has Access</label></li>
<li class="friends"><input name="Privacy['friends']" type="checkbox"><label for="privacy[]">Friends Only</label></li>
<li class="circle"><input name="Privacy['baltimore']" type="checkbox"><label for="privacy[]">Baltimore</label></li>
</ul>
</div>
<section class="privacy">
</section>
</form>
<p class="page-message"></p>
<ul class="list">
<li class="item">
<a class="owner-icon-link" href="http://lost.appleseed/profile/abed/"><img class="owner-icon" src="http://community.appleseed/?_social=true&_task=user.icon&_request=abed&_width=64&_height=64"></a>
<p class="comment"><a class="owner-link" rel="abed@community.appleseed">abed@community.appleseed</a><span class="content">This is a comment that is very long, probably longer than will end up being allowed. This is a comment that is very long, probably longer than will end up being allowed. This is a comment that is very long, probably longer than will end up being allowed. This is a comment that is very long, probably longer than will end up being allowed.</span></p>
<p class="comment"><a class="owner-link" rel="abed@community.appleseed">abed@community.appleseed</a><span class="content"></span></p>
<abbr class="stamp">4 minutes ago</abbr>
<span class="actions">
<a class='add-comment'>Add Comment</a>
Expand Down
4 changes: 2 additions & 2 deletions themes/default/style/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@
#profile-page .post .comments { width:590px; height:20px; padding:5px; }
#profile-page .post .submit { float:right; }

#profile-page .list .item { float:left; font-size:110%; list-style-type:none; border-bottom:1px solid #c0d895; padding-bottom:5px; margin-bottom:5px; }
#profile-page .list .item { float:left; clear:both; font-size:110%; list-style-type:none; border-bottom:1px solid #c0d895; padding-bottom:5px; margin-bottom:5px; }
#profile-page .list a { float:left; background:none; padding:0; display:inline; }
#profile-page .list .item .owner-icon-link { float:left; display:inline; }
#profile-page .list .item .owner-icon { width:64px; height:64px; }
Expand All @@ -348,7 +348,7 @@
#profile-page .actions a { float:left; padding-right:5px; }
#profile-page .actions a:before { content:"\B7 \ "; }

#profile-page .privacy { clear:both; float:left; }
#profile-page .privacy { clear:both; float:left; padding:0; padding-top:2px; margin:0; }
#profile-page .privacy h2 { clear:both; float:left; margin-right:10px; color:#bf4630; }
#profile-page .privacy ul { list-style-type:none; clear:none; float:left; }
#profile-page .privacy ul li { clear:none; float:left; margin-right:10px; }
Expand Down

0 comments on commit 272b697

Please sign in to comment.