Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a private flag so you can choose if your paste shows up in rece…

…nt or not
  • Loading branch information...
commit e2e085e50017c79d9ee2816b1aa338fe29494340 1 parent 28661c1
@harderthanfire authored
Showing with 9 additions and 6 deletions.
  1. +1 −0  index.php
  2. +2 −1  paste.php
  3. +1 −1  recent.php
  4. +5 −4 snippets.sql
View
1  index.php
@@ -52,6 +52,7 @@
</select>
<input type="text" name="nname" id="nname" size="45" <?php if(!empty($remembered_name)) {echo 'value="' . htmlentities($remembered_name) . '"';} else{echo 'value="Anonymous Coward"';} ?>/>
<input type="text" name="sname" id="sname"<?php if( !empty( $alter ) ) { echo ' value="Alteration of ' . htmlentities( $orig["sname"] ) . '"'; } else {echo 'value="Untitled"';} ?> size="45" />
+ <input type="checkbox" name="private" description="Private Paste?">
<input name="website" type="hidden" id="website" />
<input name="email" type="text" id="email" style="display:none" value=""/>
<input type="submit" id="submitbox" name="paste" value="Paste Code" />
View
3  paste.php
@@ -11,6 +11,7 @@
$lang = $_POST["lang"]; //language to highlight it as
$alter = $_POST["alter"]; // is it an alteration
$shemail = $_POST["shemail"]; // email of user
+ $private = $_POST["private"];
if(isset($_POST['website']) && !$_POST['website'] == '')
{
@@ -37,7 +38,7 @@
$paste[ "language" ] = $lang;
$paste[ "deleteafter" ] = (int)$_POST["keepfor"];
$paste[ "shemail" ] = $shemail;
-
+ $paste[ "private"] = $private;
if( !empty( $alter ) )
{
$paste[ "alter" ] = (int)$alter;
View
2  recent.php
@@ -5,7 +5,7 @@
include "includes/common.php";
include "includes/page/header.php";
- $snippets_list = $db->QueryArray( "SELECT id, sname, nname, language, time FROM snippets ORDER BY id DESC LIMIT 15", $db );
+ $snippets_list = $db->QueryArray( "SELECT id, sname, nname, language, time FROM snippets WHERE private='0' ORDER BY id DESC LIMIT 15", $db );
?>
View
9 snippets.sql
@@ -1,11 +1,11 @@
-- phpMyAdmin SQL Dump
--- version 3.3.2deb1
+-- version 3.3.10
-- http://www.phpmyadmin.net
--
-- Host: localhost
--- Generation Time: Nov 16, 2010 at 09:16 PM
+-- Generation Time: Mar 12, 2012 at 02:05 PM
-- Server version: 5.1.41
--- PHP Version: 5.3.2-1ubuntu4.5
+-- PHP Version: 5.3.2-1ubuntu4.14
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
@@ -35,5 +35,6 @@ CREATE TABLE IF NOT EXISTS `snippets` (
`alter` int(8) NOT NULL DEFAULT '-1',
`deleteafter` int(12) NOT NULL,
`shemail` varchar(125) NOT NULL,
+ `private` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2520 ;
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2789 ;
Please sign in to comment.
Something went wrong with that request. Please try again.