Permalink
Browse files

Initial commit, copied mostly from tinycontacts. Can log in and sign …

…up via Twitter and lists the graphs for a user.
  • Loading branch information...
0 parents commit 44c82687f1cc04186ca48c55d36c46c5069d7605 @aaronpk committed Apr 8, 2011
@@ -0,0 +1,5 @@
+Options -MultiViews
+
+RewriteEngine on
+RewriteRule ^([a-z]+)$ $1.php [QSA,L]
+RewriteRule ^([a-z]+)/([0-9]+)/.+ $1.php?id=$2 [QSA,L]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,42 @@
+body {
+ margin: 0;
+ padding: 0;
+ font-family: "Lucida Grande", Helvetica, Verdana, sans-serif;
+ font-size: 12pt;
+}
+
+textarea, input {
+ font-family: "Lucida Grande", Helvetica, Verdana, sans-serif;
+}
+
+body, textarea, input {
+ text-shadow:1px 1px 0 rgb(250,250,250);
+ -webkit-appearance: none;
+ background-color:rgb(230,230,230);
+ color:rgb(40,40,40);
+}
+
+a img {
+ border: 0;
+}
+
+a {
+ color: #156598;
+}
+
+a:hover {
+ color: #2d84bb;
+}
+
+textarea, input {
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+}
+
+.btn {
+ font-size: 10pt;
+ border: 1px #bbb solid;
+ background: #ccc;
+ cursor: pointer;
+}
+
@@ -0,0 +1,83 @@
+<?php
+include('inc.php');
+
+require_once('Model/Feedback.php');
+
+
+if(post('text')) {
+
+ $data = array(
+ 'createdBy' => $user->id,
+ 'createdAt' => date('Y-m-d H:i:s'),
+ 'text' => post('text')
+ );
+ if(array_key_exists('location', $_COOKIE)) {
+ list($lat, $lng) = explode(',', $_COOKIE['location']);
+ $data['createdAtLat'] = $lat;
+ $data['createdAtLng'] = $lng;
+ }
+
+ Model_Feedback::insert($data);
+
+ echo json_encode(array('result'=>'ok'));
+ die();
+}
+
+
+include('templates/header.php');
+
+?>
+
+<div style="font-size: 22pt; margin-bottom: 10px;"><img src="/assets/tiny-contacts.png" width="282" height="20" /></div>
+
+
+<div class="entity">
+
+ <div class="newNote" style="margin-top: 10px; <?=(get('thanks') ? 'display: none;' : '')?>">
+ <div>We appreciate your feedback!</div>
+ <textarea id="newNoteText"></textarea>
+ <input type="button" id="newNoteBtn" value="Add Note" class="btn" />
+ </div>
+ <div style="clear: both;"></div>
+
+ <div class="thanks" style="<?=(get('thanks') ? '' : 'display: none;')?> text-align: center;">
+ <div style="margin-top: 20px; font-size: 15pt; text-align: center;">Thanks for your feedback!</div>
+ <div style="margin-top: 20px;"><a href="http://twitter.com/TinyContacts">Follow Us on Twitter</a></div>
+ <div style="margin-top: 20px;">Back to <a href="/list">Your Contacts</a></div>
+ </div>
+
+ <div style="margin-top: 30px; font-weight: bold;">Recent Feedback</div>
+<?php
+ $feedback = new Model_Feedback();
+ $feedback->loadAll();
+ foreach($feedback as $f) {
+ $author = new Model_Entity($f->createdBy);
+ echo '<div class="note">';
+ $date = new DateTime($f->createdAt);
+ $date->setTimeZone($timezone);
+ echo '<div class="date">' . $date->format('n/j g:ia') . '</div>';
+ echo '<div class="author">' . $author->name . '</div>';
+ echo formatText(strip_tags($f->text));
+ echo '</div>';
+ }
+
+?>
+
+</div>
+
+<script type="text/javascript">
+$(function(){
+ $("#newNoteBtn").click(function(){
+ $.post("/feedback", {
+ text: $("#newNoteText").val()
+ }, function(data){
+ window.location = "/feedback?thanks=1";
+ }, "json");
+ });
+});
+</script>
+
+<?php
+
+include('templates/footer.php');
+
@@ -0,0 +1,15 @@
+<?php
+include('inc.php');
+
+include('templates/header.php');
+
+$graph = new Model_Graph(get('id'));
+
+if($graph->user_id != $user->id) {
+ echo 'error';
+} else {
+
+ echo '<h2>' . $graph->name . '</h2>';
+}
+
+include('templates/footer.php');
Oops, something went wrong.

0 comments on commit 44c8268

Please sign in to comment.