Changeset 20339
- Timestamp:
- 10/01/08 08:02:29 (3 months ago)
- Location:
- events/phpframework/plain_php/trunk
- Files:
-
- 2 added
- 13 modified
-
core/RssRenderer.php (modified) (1 diff)
-
default.php (added)
-
index.php (modified) (1 diff)
-
init.php (modified) (1 diff)
-
resource/acount_create.php (modified) (1 diff)
-
resource/css/style.css (modified) (3 diffs)
-
resource/followings.php (modified) (1 diff)
-
resource/img/share/reply_icon.gif (modified) (previous)
-
resource/js/jquery.js (added)
-
resource/public_timeline.php (modified) (1 diff)
-
resource/settings.php (modified) (1 diff)
-
resource/statuses.php (modified) (2 diffs)
-
resource/timeline.php (modified) (3 diffs)
-
resource/user.php (modified) (5 diffs)
-
resource/user_followings.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
events/phpframework/plain_php/trunk/core/RssRenderer.php
r20336 r20339 5 5 function render(RssResponse $r) 6 6 { 7 header('Content-type: text/xml; charset=UTF-8');7 header('Content-type: application/rss+xml; charset=UTF-8'); 8 8 9 9 list($title, $link, $desc) = $r->getChannel(); -
events/phpframework/plain_php/trunk/index.php
r20044 r20339 2 2 include_once dirname(__FILE__) . '/init.php'; 3 3 4 $c = new ApplicationContext(dirname(__FILE__), 'http://localhost/phwittr', 5 dirname(__FILE__) . '/resource', 'http://localhost/phwittr/resource', 6 'localhost', 7 '/phwittr'); 8 ObjectBuilder::setApplicationContext($c); 4 9 5 $response = ref(new PhwittrFront)->process(new Request('UTF-8'), $c, new RendererBuilder($c)); 10 6 /* TODO 例外handlerをつける */ -
events/phpframework/plain_php/trunk/init.php
r20044 r20339 8 8 set_include_path(get_include_path() . PATH_SEPARATOR . $p); 9 9 10 include_once dirname(__FILE__) . '/default.php'; 10 11 include_once dirname(__FILE__) . '/core/function.php'; 12 include_once dirname(__FILE__) . '/model/mail/mail.php'; 11 13 12 14 15 $c = new ApplicationContext(dirname(__FILE__), 'http://localhost/phwittr', 16 dirname(__FILE__) . '/resource', 'http://localhost/phwittr/resource', 17 'localhost', 18 '/phwittr'); 19 ObjectBuilder::setApplicationContext($c); 20 21 mb_language('japanese'); 22 mb_internal_encoding(Pool::getInstance()->fetchConfig()->encoding); -
events/phpframework/plain_php/trunk/resource/acount_create.php
r20038 r20339 36 36 37 37 <h2>登録完了しました</h2> 38 <p><?php echo $email ?>にメールを送信し たのでそこに書かれているURLにアクセスしてください。</p>38 <p><?php echo $email ?>にメールを送信しました。</p> 39 39 40 40 <!-- / #main --></div> -
events/phpframework/plain_php/trunk/resource/css/style.css
r20038 r20339 198 198 margin-left: 4px; 199 199 border: 1px solid #cccccc; 200 font-size: 80%; 200 201 } 201 202 … … 308 309 } 309 310 310 #people.button {311 a.button { 311 312 color: #666; 312 313 background-color: #eeeeee; … … 315 316 font-size: 70%; 316 317 } 317 #people.button:hover {318 a.button:hover { 318 319 text-decoration: none; 319 320 } -
events/phpframework/plain_php/trunk/resource/followings.php
r20038 r20339 44 44 <td><a href="<?php echo $c->baseUrl . '/' . $user['user_name']; ?>"><?php echo $user['user_name'] ?></a><br/> 45 45 46 <a class="button" href="<?php echo "{$c->baseUrl}/friendships/de lete/{$user['user_id']}/{$session->token}" ?>">remove</a>46 <a class="button" href="<?php echo "{$c->baseUrl}/friendships/destroy/{$user['user_id']}/{$session->token}" ?>">remove</a> 47 47 48 48 </td> -
events/phpframework/plain_php/trunk/resource/public_timeline.php
r20038 r20339 9 9 <base href="<?php echo $c->templateBaseUrl ?>/" /> 10 10 <link rel="shortcut icon" href="./img/share/favicon.ico" /> 11 <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $c->baseUrl ?>/public_timeline/rss" /> 11 12 12 13 <!-- *** stylesheet *** --> -
events/phpframework/plain_php/trunk/resource/settings.php
r20038 r20339 57 57 <?php if ($user['private_flag']) echo 'checked="checked" ' ?>/> 58 58 <label for="private_flag">つぶやきを非公開にする</label> 59 <?php if ( $user['private_flag']): ?>60 < a href="/public_timeline"><br/>公開中</a>59 <?php if (!$user['private_flag']): ?> 60 <br/><a href="/public_timeline">公開中</a> 61 61 <?php endif ?></td> 62 62 </tr><tr> -
events/phpframework/plain_php/trunk/resource/statuses.php
r20038 r20339 14 14 15 15 <!-- *** javascript *** --> 16 16 <script src="./js/jquery.js" type="text/javascript"></script> 17 <script type="text/javascript"> 18 $(document).ready(function () { 19 $(".delete_link").click(function (){ 20 return confirm("Sure you want to delete this update? There is NO undo!"); 21 }); 22 }); 23 </script> 17 24 </head> 18 25 … … 38 45 <?php if ($is_logined): ?> 39 46 <?php if($session->user_id === $status['user_id']): ?> 40 <a href="<?php echo "{$c->baseUrl}/status/delete/{$status['id']}/{$session->token}" ?>"><img src="./img/share/trash_icon.gif" /></a>47 <a class="delete_link" href="<?php echo "{$c->baseUrl}/status/delete/{$status['id']}/{$session->token}" ?>"><img src="./img/share/trash_icon.gif" /></a> 41 48 <?php else: ?> 42 49 <a href="<?php echo "{$c->baseUrl}/home?status=@{$status['user_name']}" ?>"><img src="./img/share/reply_icon.gif" /></a> -
events/phpframework/plain_php/trunk/resource/timeline.php
r20038 r20339 9 9 <base href="<?php echo $c->templateBaseUrl ?>/" /> 10 10 <link rel="shortcut icon" href="./img/share/favicon.ico" /> 11 11 <?php if ($current_action === 'public_timeline'): ?> 12 <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $c->baseUrl ?>/public_timeline/rss" /> 13 <?php endif ?> 12 14 <!-- *** stylesheet *** --> 13 15 <link href="./css/import.css" rel="stylesheet" type="text/css" media="all" /> 14 16 15 17 <!-- *** javascript *** --> 16 18 <script src="./js/jquery.js" type="text/javascript"></script> 19 <script type="text/javascript"> 20 $(document).ready(function() { 21 var textcount = $("#js_textcount"); 22 var comment = $("#comment"); 23 var baseurl = "<?php echo $c->baseUrl ?>"; 24 var resourceurl = "<?php echo $c->templateBaseUrl ?>"; 25 var url = baseurl + "/status/update/ajax"; 26 var token = $("#token")[0].value; 27 var reload = function() { 28 textcount.text(140 - comment[0].value.length); 29 }; 30 var bind_delete_action = function () { 31 $(".delete_link").click(function (){ 32 return confirm("Sure you want to delete this update? There is NO undo!"); 33 }); 34 }; 35 reload(); 36 comment.bind("keyup", reload); 37 $("#post_form").submit(function() { 38 if (comment[0].value.length <= 0 || 140 - comment[0].value.length < 0) { 39 return false; 40 } 41 $.post(url, {token: token, comment: comment[0].value}, function(data) { 42 if (data.success) { 43 comment[0].value = ""; 44 reload(); 45 var st = data.status; 46 var cont = ""; 47 cont += "<tr><td><a href=\"" + baseurl + "/" + st.user_name + "\">"; 48 cont += "<img src=\"./img/" + (st.image ? "user/" + st.user_name : "friend") + "_icon.png\" /></a></td>"; 49 cont += "<td class=\"status_body\"><a href=\"" + baseurl + "/" + st.user_name + "\">" + st.user_name + "</a> " + st.comment; 50 cont += " <span class=\"meta\"><a class=\"published\" href=\"" + baseurl + "/statuses/" + st.id + "\">" + st.created_at + "</a></span>" + "</td>"; 51 cont += "<td><a class=\"delete_link\" href=\"" + baseurl + "/status/delete/" + st.id + "/" + token + "\">"; 52 cont += "<img src=\"img/share/trash_icon.gif\" alt=\"Delete\" /></a></td></tr>"; 53 cont = $(cont); 54 cont.hide(); 55 $("#timeline table.autopagerize_page_element").prepend(cont); 56 cont.fadeIn("normal"); 57 58 bind_delete_action(); 59 } 60 }, "json"); 61 return false; 62 }); 63 bind_delete_action(); 64 }); 65 </script> 17 66 </head> 18 67 … … 39 88 <?php endforeach ?> 40 89 41 <form action="<?php echo $c->baseUrl; ?>/status/update" method="post" >90 <form action="<?php echo $c->baseUrl; ?>/status/update" method="post" id="post_form"> 42 91 <div id="post"> 43 92 <h2>What are you doing?</h2> 44 93 <span class="textCount" id="js_textcount">140</span> 45 94 <textarea id="comment" name="comment"><?php if ($status) echo h($status) . ' ' ?></textarea> 46 <input type="hidden" name="token" value="<?php echo $session->token ?>" />95 <input type="hidden" id="token" name="token" value="<?php echo $session->token ?>" /> 47 96 <p id="button_space"> 48 97 <input type="submit" id="twit_button" value=" update " /> … … 76 125 <td> 77 126 <?php if($status['user_name'] === $user_name): ?> 78 <a href="<?php echo $c->baseUrl ?>/status/delete/<?php echo $status['id'] . '/' . $session->token ?>">79 <img src="img/share/trash_icon.gif" alt="Delete" class="icon16"/></a>127 <a class="delete_link" href="<?php echo $c->baseUrl ?>/status/delete/<?php echo $status['id'] . '/' . $session->token ?>"> 128 <img src="img/share/trash_icon.gif" alt="Delete" /></a> 80 129 <?php else: ?> 81 130 <a href="<?php echo "{$c->baseUrl}/home?status=@{$status['user_name']}" ?>"><img src="./img/share/reply_icon.gif" /></a> -
events/phpframework/plain_php/trunk/resource/user.php
r20038 r20339 9 9 <base href="<?php echo $c->templateBaseUrl ?>/" /> 10 10 <link rel="shortcut icon" href="./img/share/favicon.ico" /> 11 <link rel="alternate" type="application/rss+xml" title="RSS" href="<?php echo $c->baseUrl ?>/<?php echo $user['user_name'] ?>/rss" /> 11 12 13 12 14 <!-- *** stylesheet *** --> 13 15 <link href="./css/import.css" rel="stylesheet" type="text/css" media="all" /> 14 16 15 17 <!-- *** javascript *** --> 16 18 <script src="./js/jquery.js" type="text/javascript"></script> 19 <script type="text/javascript"> 20 $(document).ready(function () { 21 $(".delete_link").click(function (){ 22 return confirm("Sure you want to delete this update? There is NO undo!"); 23 }); 24 }); 25 </script> 17 26 </head> 18 27 … … 37 46 38 47 48 <?php if (!$user['private_flag'] || $is_logined && $is_following): ?> 49 50 <?php if ($is_logined): ?> 51 52 <?php if (!$is_self && $is_following): ?> 53 <a class="button" href="<?php echo "{$c->baseUrl}/friendships/destroy/{$user['id']}/{$session->token}" ?>">remove</a> 54 <?php elseif (!$is_self && !$is_following): ?> 55 <a class="button" href="<?php echo "{$c->baseUrl}/friendships/create/{$user['id']}/{$session->token}" ?>">follow</a> 56 <?php endif ?> 57 58 <?php if ($is_requesting_self): ?> 59 <a class="button" href="<?php echo "{$c->baseUrl}/friend_requests/accept/{$user['id']}/{$session->token}" ?>">accept</a> 60 <a class="button" href="<?php echo "{$c->baseUrl}/friend_requests/deny/{$user['id']}/{$session->token}" ?>">deny</a> 61 <?php endif ?> 62 63 <?php endif ?> 64 39 65 <div id="timeline" class="autopagerize_page_element"> 40 66 <table> … … 50 76 <td> 51 77 <?php if($session && $status['user_name'] === $session->user_name): ?> 52 <a href="<?php echo $c->baseUrl ?>/status/delete/<?php echo $status['id'] . '/' . $session->token ?>">78 <a class="delete_link" href="<?php echo $c->baseUrl ?>/status/delete/<?php echo $status['id'] . '/' . $session->token ?>"> 53 79 <img src="img/share/trash_icon.gif" alt="Delete" class="icon16" /></a> 54 80 <?php elseif ($session): ?> … … 60 86 </table> 61 87 </div> 88 89 90 91 <?php else: ?> 92 <h3>このユーザーはプライベートです。</h3> 93 <?php if (!$is_self): ?> 94 95 96 <?php if ($is_requesting): ?> 97 フォローできるようにリクエスト中です。 98 <?php elseif (!$is_following): ?> 99 <a class="button" href="<?php echo "{$c->baseUrl}/friendships/create/{$user['id']}/{$session->token}" ?>"> 100 <?php if ($user['private_flag']) echo 'send request'; else echo 'remove' ?></a> 101 102 <?php endif ?> 103 104 <?php if ($is_requesting_self): ?> 105 <a class="button" href="<?php echo "{$c->baseUrl}/friend_requests/accept/{$user['id']}/{$session->token}" ?>">accept</a> 106 <a class="button" href="<?php echo "{$c->baseUrl}/friend_requests/deny/{$user['id']}/{$session->token}" ?>">deny</a> 107 <?php endif ?> 108 109 <?php endif ?> 110 111 <?php endif ?> 62 112 63 113 <?php if ($page > 0 || $page_limit * ($page + 1) < $status_count): ?> … … 82 132 </p> 83 133 84 <?php if ($latest_status ): ?>134 <?php if ($latest_status && (!$user['private_flag'] || $is_logined && $is_following)): ?> 85 135 <h3>最近のつぶやき</h3> 86 136 <p><?php echo $latest_status['comment']; ?></p> -
events/phpframework/plain_php/trunk/resource/user_followings.php
r20038 r20339 44 44 <td><a href="<?php echo $c->baseUrl . '/' . $user['user_name']; ?>"><?php echo $user['user_name'] ?></a><br/> 45 45 46 <?php if ($user_name === $session->user_name): ?> 46 47 <a class="button" href="<?php echo "{$c->baseUrl}/friendships/delete/{$user['user_id']}/{$session->token}" ?>">remove</a> 47 48 <?php endif ?> 48 49 </td> 49 50 </tr>
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)