GitHub PullRequestReviewCommentEvent at 2014-06-11 04:02:31
Repository: miniblog
Actor: gholtsla
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/holtscomm/miniblog/pulls/comments/13633023","id":13633023,"diff_hunk":"@@ -0,0 +1,59 @@\n+<?php\n+define('IN_BLOG', true);\n+define('IN_ADMIN', true);\n+// define('PATH', '');\n+\n+include('../../includes/config.php');\n+include('../../includes/functions.php');\n+\n+$database = mb_connect($sqlconfig);\n+unset($sqlconfig);\n+\n+if(isset($_REQUEST['postid']))\n+{\n+    $post_id = $_REQUEST['postid'];\n+}\n+else if(!isset($_REQUEST['postid']))\n+{\n+    $post_id = null;\n+}\n+else\n+{\n+    die(\"postid is required for this endpoint\");\n+}\n+\n+header('Content-Type: application/json');\n+// Set featured post\n+if($post_id)\n+{\n+    // Set every other post's featured flag to false\n+    $sql = \"UPDATE `miniblog` SET `featured` = 0 WHERE `post_id` != $post_id\";\n+    $result1 = mb_query($sql, $database);\n+\n+    // Then set the desired post to be the featured one!\n+    $sql = \"UPDATE `miniblog` SET `featured` = 1 WHERE `post_id` = $post_id\";\n+    $result2 = mb_query($sql, $database);\n+\n+    if($result1 && $result2)\n+    {\n+        $return = array(\n+            \"featured\" => $post_id\n+        );\n+        echo json_encode($return);\n+    }\n+}\n+// Get featured post\n+else if($post_id == null)","path":"adm/post/feature.php","position":46,"original_position":46,"commit_id":"1d2e66934678f7b84c141648df9e5c4c0a80e4cc","original_commit_id":"1d2e66934678f7b84c141648df9e5c4c0a80e4cc","user":{"login":"gholtsla","id":463132,"avatar_url":"https://avatars.githubusercontent.com/u/463132?","gravatar_id":"75613f4db0d790b63b7098cb1b11b2c6","url":"https://api.github.com/users/gholtsla","html_url":"https://github.com/gholtsla","followers_url":"https://api.github.com/users/gholtsla/followers","following_url":"https://api.github.com/users/gholtsla/following{/other_user}","gists_url":"https://api.github.com/users/gholtsla/gists{/gist_id}","starred_url":"https://api.github.com/users/gholtsla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gholtsla/subscriptions","organizations_url":"https://api.github.com/users/gholtsla/orgs","repos_url":"https://api.github.com/users/gholtsla/repos","events_url":"https://api.github.com/users/gholtsla/events{/privacy}","received_events_url":"https://api.github.com/users/gholtsla/received_events","type":"User","site_admin":false},"body":"Or get the currently featured post.","created_at":"2014-06-11T04:02:31Z","updated_at":"2014-06-11T04:02:31Z","html_url":"https://github.com/holtscomm/miniblog/pull/39#discussion_r13633023","pull_request_url":"https://api.github.com/repos/holtscomm/miniblog/pulls/39","_links":{"self":{"href":"https://api.github.com/repos/holtscomm/miniblog/pulls/comments/13633023"},"html":{"href":"https://github.com/holtscomm/miniblog/pull/39#discussion_r13633023"},"pull_request":{"href":"https://api.github.com/repos/holtscomm/miniblog/pulls/39"}}},"pull_request":{"url":"https://api.github.com/repos/holtscomm/miniblog/pulls/39","id":16978561,"html_url":"https://github.com/holtscomm/miniblog/pull/39","diff_url":"https://github.com/holtscomm/miniblog/pull/39.diff","patch_url":"https://github.com/holtscomm/miniblog/pull/39.patch","issue_url":"https://api.github.com/repos/holtscomm/miniblog/issues/39","number":39,"state":"open","title":"Fixes #17: Feature a post","user":{"login":"gholtsla","id":463132,"avatar_url":"https://avatars.githubusercontent.com/u/463132?","gravatar_id":"75613f4db0d790b63b7098cb1b11b2c6","url":"https://api.github.com/users/gholtsla","html_url":"https://github.com/gholtsla","followers_url":"https://api.github.com/users/gholtsla/followers","following_url":"https://api.github.com/users/gholtsla/following{/other_user}","gists_url":"https://api.github.com/users/gholtsla/gists{/gist_id}","starred_url":"https://api.github.com/users/gholtsla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gholtsla/subscriptions","organizations_url":"https://api.github.com/users/gholtsla/orgs","repos_url":"https://api.github.com/users/gholtsla/repos","events_url":"https://api.github.com/users/gholtsla/events{/privacy}","received_events_url":"https://api.github.com/users/gholtsla/received_events","type":"User","site_admin":false},"body":"From #17:\r\n\r\nOne should be able to make a post a \"featured post\". There should only be one of these. The selection for the featured post shall be on the list of posts page.\r\n\r\nIf there is a featured post selected, it will be included in a new variable to be rendered, separate from the $miniblog_posts variable. An implementing developer will be able to echo the $featured_post into some place as desired, and it will follow the defined post template.\r\n\r\n@gholtslander @jrans-va\r\n\r\nI have included sample usage in the `index.php` file as well, showing that it will only appear if there is a featured post, and if they are not viewing a single post. In some cases, some people may want their featured post shown all the time, regardless of where they're looking (Dad, I think this would be appropriate in the case of the turfit site).","created_at":"2014-06-11T04:01:34Z","updated_at":"2014-06-11T04:02:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d460b2372311bb5d9a6f8c8ea07d72212d7773b9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/holtscomm/miniblog/pulls/39/commits","review_comments_url":"https://api.github.com/repos/holtscomm/miniblog/pulls/39/comments","review_comment_url":"https://api.github.com/repos/holtscomm/miniblog/pulls/comments/{number}","comments_url":"https://api.github.com/repos/holtscomm/miniblog/issues/39/comments","statuses_url":"https://api.github.com/repos/holtscomm/miniblog/statuses/1d2e66934678f7b84c141648df9e5c4c0a80e4cc","head":{"label":"holtscomm:17-featured-post","ref":"17-featured-post","sha":"1d2e66934678f7b84c141648df9e5c4c0a80e4cc","user":{"login":"holtscomm","id":7292910,"avatar_url":"https://avatars.githubusercontent.com/u/7292910?","gravatar_id":null,"url":"https://api.github.com/users/holtscomm","html_url":"https://github.com/holtscomm","followers_url":"https://api.github.com/users/holtscomm/followers","following_url":"https://api.github.com/users/holtscomm/following{/other_user}","gists_url":"https://api.github.com/users/holtscomm/gists{/gist_id}","starred_url":"https://api.github.com/users/holtscomm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holtscomm/subscriptions","organizations_url":"https://api.github.com/users/holtscomm/orgs","repos_url":"https://api.github.com/users/holtscomm/repos","events_url":"https://api.github.com/users/holtscomm/events{/privacy}","received_events_url":"https://api.github.com/users/holtscomm/received_events","type":"Organization","site_admin":false},"repo":{"id":18827029,"name":"miniblog","full_name":"holtscomm/miniblog","owner":{"login":"holtscomm","id":7292910,"avatar_url":"https://avatars.githubusercontent.com/u/7292910?","gravatar_id":null,"url":"https://api.github.com/users/holtscomm","html_url":"https://github.com/holtscomm","followers_url":"https://api.github.com/users/holtscomm/followers","following_url":"https://api.github.com/users/holtscomm/following{/other_user}","gists_url":"https://api.github.com/users/holtscomm/gists{/gist_id}","starred_url":"https://api.github.com/users/holtscomm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holtscomm/subscriptions","organizations_url":"https://api.github.com/users/holtscomm/orgs","repos_url":"https://api.github.com/users/holtscomm/repos","events_url":"https://api.github.com/users/holtscomm/events{/privacy}","received_events_url":"https://api.github.com/users/holtscomm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/holtscomm/miniblog","description":"Blog system that is easy to drop in to an existing set of styles","fork":false,"url":"https://api.github.com/repos/holtscomm/miniblog","forks_url":"https://api.github.com/repos/holtscomm/miniblog/forks","keys_url":"https://api.github.com/repos/holtscomm/miniblog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/holtscomm/miniblog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/holtscomm/miniblog/teams","hooks_url":"https://api.github.com/repos/holtscomm/miniblog/hooks","issue_events_url":"https://api.github.com/repos/holtscomm/miniblog/issues/events{/number}","events_url":"https://api.github.com/repos/holtscomm/miniblog/events","assignees_url":"https://api.github.com/repos/holtscomm/miniblog/assignees{/user}","branches_url":"https://api.github.com/repos/holtscomm/miniblog/branches{/branch}","tags_url":"https://api.github.com/repos/holtscomm/miniblog/tags","blobs_url":"https://api.github.com/repos/holtscomm/miniblog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/holtscomm/miniblog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/holtscomm/miniblog/git/refs{/sha}","trees_url":"https://api.github.com/repos/holtscomm/miniblog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/holtscomm/miniblog/statuses/{sha}","languages_url":"https://api.github.com/repos/holtscomm/miniblog/languages","stargazers_url":"https://api.github.com/repos/holtscomm/miniblog/stargazers","contributors_url":"https://api.github.com/repos/holtscomm/miniblog/contributors","subscribers_url":"https://api.github.com/repos/holtscomm/miniblog/subscribers","subscription_url":"https://api.github.com/repos/holtscomm/miniblog/subscription","commits_url":"https://api.github.com/repos/holtscomm/miniblog/commits{/sha}","git_commits_url":"https://api.github.com/repos/holtscomm/miniblog/git/commits{/sha}","comments_url":"https://api.github.com/repos/holtscomm/miniblog/comments{/number}","issue_comment_url":"https://api.github.com/repos/holtscomm/miniblog/issues/comments/{number}","contents_url":"https://api.github.com/repos/holtscomm/miniblog/contents/{+path}","compare_url":"https://api.github.com/repos/holtscomm/miniblog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/holtscomm/miniblog/merges","archive_url":"https://api.github.com/repos/holtscomm/miniblog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/holtscomm/miniblog/downloads","issues_url":"https://api.github.com/repos/holtscomm/miniblog/issues{/number}","pulls_url":"https://api.github.com/repos/holtscomm/miniblog/pulls{/number}","milestones_url":"https://api.github.com/repos/holtscomm/miniblog/milestones{/number}","notifications_url":"https://api.github.com/repos/holtscomm/miniblog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/holtscomm/miniblog/labels{/name}","releases_url":"https://api.github.com/repos/holtscomm/miniblog/releases{/id}","created_at":"2014-04-16T04:34:21Z","updated_at":"2014-06-11T04:01:34Z","pushed_at":"2014-06-11T03:59:23Z","git_url":"git://github.com/holtscomm/miniblog.git","ssh_url":"git@github.com:holtscomm/miniblog.git","clone_url":"https://github.com/holtscomm/miniblog.git","svn_url":"https://github.com/holtscomm/miniblog","homepage":null,"size":864,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":13,"forks":0,"open_issues":13,"watchers":0,"default_branch":"master"}},"base":{"label":"holtscomm:master","ref":"master","sha":"5e6779ee8069ddd773d382a564ff58b46d9c0dc3","user":{"login":"holtscomm","id":7292910,"avatar_url":"https://avatars.githubusercontent.com/u/7292910?","gravatar_id":null,"url":"https://api.github.com/users/holtscomm","html_url":"https://github.com/holtscomm","followers_url":"https://api.github.com/users/holtscomm/followers","following_url":"https://api.github.com/users/holtscomm/following{/other_user}","gists_url":"https://api.github.com/users/holtscomm/gists{/gist_id}","starred_url":"https://api.github.com/users/holtscomm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holtscomm/subscriptions","organizations_url":"https://api.github.com/users/holtscomm/orgs","repos_url":"https://api.github.com/users/holtscomm/repos","events_url":"https://api.github.com/users/holtscomm/events{/privacy}","received_events_url":"https://api.github.com/users/holtscomm/received_events","type":"Organization","site_admin":false},"repo":{"id":18827029,"name":"miniblog","full_name":"holtscomm/miniblog","owner":{"login":"holtscomm","id":7292910,"avatar_url":"https://avatars.githubusercontent.com/u/7292910?","gravatar_id":null,"url":"https://api.github.com/users/holtscomm","html_url":"https://github.com/holtscomm","followers_url":"https://api.github.com/users/holtscomm/followers","following_url":"https://api.github.com/users/holtscomm/following{/other_user}","gists_url":"https://api.github.com/users/holtscomm/gists{/gist_id}","starred_url":"https://api.github.com/users/holtscomm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holtscomm/subscriptions","organizations_url":"https://api.github.com/users/holtscomm/orgs","repos_url":"https://api.github.com/users/holtscomm/repos","events_url":"https://api.github.com/users/holtscomm/events{/privacy}","received_events_url":"https://api.github.com/users/holtscomm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/holtscomm/miniblog","description":"Blog system that is easy to drop in to an existing set of styles","fork":false,"url":"https://api.github.com/repos/holtscomm/miniblog","forks_url":"https://api.github.com/repos/holtscomm/miniblog/forks","keys_url":"https://api.github.com/repos/holtscomm/miniblog/keys{/key_id}","collaborators_url":"https://api.github.com/repos/holtscomm/miniblog/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/holtscomm/miniblog/teams","hooks_url":"https://api.github.com/repos/holtscomm/miniblog/hooks","issue_events_url":"https://api.github.com/repos/holtscomm/miniblog/issues/events{/number}","events_url":"https://api.github.com/repos/holtscomm/miniblog/events","assignees_url":"https://api.github.com/repos/holtscomm/miniblog/assignees{/user}","branches_url":"https://api.github.com/repos/holtscomm/miniblog/branches{/branch}","tags_url":"https://api.github.com/repos/holtscomm/miniblog/tags","blobs_url":"https://api.github.com/repos/holtscomm/miniblog/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/holtscomm/miniblog/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/holtscomm/miniblog/git/refs{/sha}","trees_url":"https://api.github.com/repos/holtscomm/miniblog/git/trees{/sha}","statuses_url":"https://api.github.com/repos/holtscomm/miniblog/statuses/{sha}","languages_url":"https://api.github.com/repos/holtscomm/miniblog/languages","stargazers_url":"https://api.github.com/repos/holtscomm/miniblog/stargazers","contributors_url":"https://api.github.com/repos/holtscomm/miniblog/contributors","subscribers_url":"https://api.github.com/repos/holtscomm/miniblog/subscribers","subscription_url":"https://api.github.com/repos/holtscomm/miniblog/subscription","commits_url":"https://api.github.com/repos/holtscomm/miniblog/commits{/sha}","git_commits_url":"https://api.github.com/repos/holtscomm/miniblog/git/commits{/sha}","comments_url":"https://api.github.com/repos/holtscomm/miniblog/comments{/number}","issue_comment_url":"https://api.github.com/repos/holtscomm/miniblog/issues/comments/{number}","contents_url":"https://api.github.com/repos/holtscomm/miniblog/contents/{+path}","compare_url":"https://api.github.com/repos/holtscomm/miniblog/compare/{base}...{head}","merges_url":"https://api.github.com/repos/holtscomm/miniblog/merges","archive_url":"https://api.github.com/repos/holtscomm/miniblog/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/holtscomm/miniblog/downloads","issues_url":"https://api.github.com/repos/holtscomm/miniblog/issues{/number}","pulls_url":"https://api.github.com/repos/holtscomm/miniblog/pulls{/number}","milestones_url":"https://api.github.com/repos/holtscomm/miniblog/milestones{/number}","notifications_url":"https://api.github.com/repos/holtscomm/miniblog/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/holtscomm/miniblog/labels{/name}","releases_url":"https://api.github.com/repos/holtscomm/miniblog/releases{/id}","created_at":"2014-04-16T04:34:21Z","updated_at":"2014-06-11T04:01:34Z","pushed_at":"2014-06-11T03:59:23Z","git_url":"git://github.com/holtscomm/miniblog.git","ssh_url":"git@github.com:holtscomm/miniblog.git","clone_url":"https://github.com/holtscomm/miniblog.git","svn_url":"https://github.com/holtscomm/miniblog","homepage":null,"size":864,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":13,"forks":0,"open_issues":13,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/holtscomm/miniblog/pulls/39"},"html":{"href":"https://github.com/holtscomm/miniblog/pull/39"},"issue":{"href":"https://api.github.com/repos/holtscomm/miniblog/issues/39"},"comments":{"href":"https://api.github.com/repos/holtscomm/miniblog/issues/39/comments"},"review_comments":{"href":"https://api.github.com/repos/holtscomm/miniblog/pulls/39/comments"},"review_comment":{"href":"https://api.github.com/repos/holtscomm/miniblog/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/holtscomm/miniblog/pulls/39/commits"},"statuses":{"href":"https://api.github.com/repos/holtscomm/miniblog/statuses/1d2e66934678f7b84c141648df9e5c4c0a80e4cc"}}}}