Pastebin – Turbo Boost Success!
Just been checking the stats on pastebin.com and clearly the recent changes have worked well! Usage has trebled since last week and it’s still very responsive.
It’s nice to see that people still want to use it, so I’m going to ride this wave of enthusiasm and improve it further over the coming weeks.
Your feedback, as ever, is welcome!

1Dan Coats
wrote on 17 July 2007 at 21:40
I am getting Warning: Invalid argument supplied for foreach() in pastebin/pastebin.class.php on line 284
and Warning: Invalid argument supplied for foreach() in layout.php on line 82 with this new version..
any clues?
2lordelph
wrote on 19 July 2007 at 19:21
@Dan – I emailed you but haven’t heard back!
3Nicolas
wrote on 29 July 2007 at 4:34
Items set to delete on 1 day still show on the list, although clicking them doesn’t show the contents of the paste. (This is on a private pastebin within the official pastebin.com site, not on another site using your code)
4Stephen Ostrow
wrote on 30 July 2007 at 22:08
Thanks the new pastebin speed and layout. Works great and will become my new exclusive pastebin, probably like a lot of people. One thing I noticed is that you forgot to make the “Remember Me” a label for the check box.
5Jeroen van Zijp
wrote on 18 August 2007 at 21:17
Hello LordElph,
I really appreciate your time and effort you put in this project. I am using your pastebin software on my own server @ http://pastebin.breq.ath.cx/ since 0.50 was just released. I was busy with installing the new version (0.60) but when I came to entering the MySQL queries which are mentioned in the file INSTALL, I got this error:
CREATE TABLE `pastebin` (
`pid` int( 11 ) NOT NULL AUTO_INCREMENT ,
`poster` varchar( 16 ) default NULL ,
`posted` datetime default NULL ,
`code` text,
`parent_pid` int( 11 ) default ‘0′,
`format` varchar( 16 ) default NULL ,
`codefmt` mediumtext,
`codecss` text,
`domain` varchar( 255 ) default ”,
`expires` DATETIME,
`expiry_flag` ENUM( ‘d’, ‘m’, ‘f’ ) NOT NULL DEFAULT ‘m’,
PRIMARY KEY ( `pid` ) ,
KEY `domain` ( `domain` ) ,
KEY `parent_pid` ,
KEY `expires`
)
MySQL said: Documentation
#1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘
KEY `expires`
)’ at line 16
I can’t really see what’s wrong with the query… (I fixed the query for the table `recent` though.
Can you help and tell me what the problem is, so I can go on?
Many thanks in advance,
Jeroen van Zijp
6dotslash
wrote on 10 October 2007 at 23:13
Hey Joroen,
After doing some digging I found a working solution for this. I found it via a french blog after google translating…God Bless google… The setion here:
PRIMARY KEY (`pid`),
KEY `domain` (`domain`),
KEY `parent_pid`,
KEY `expires`
);
I had to add ()’s around the parent_pid and expires key like so:
PRIMARY KEY ( `pid` ) ,
KEY `domain` ( `domain` ) ,
KEY ( `parent_pid` ) ,
KEY ( `expires` )
);
I’m not much of a DBA so I can’t answer why, but the syntax took after enclosing the keys. I hope this helps!
dotslash
Socrates: “I drank what?”
7Jeroen van Zijp
wrote on 13 October 2007 at 21:11
Hey man! Thanks for the workaround and for noticing me on my forum.
I now have an own domainname so you can check on that later.
Fortunately I fixed the SQL query myself, with no experience with SQL in any way.
Ensure to check back my site later!
The pastebin itself is to be found at http://pastebin.macbreq.nl/
God bless and speak you later.
8pushedx
wrote on 21 May 2008 at 10:23
Thanks for posting that tip dotslash. I ran into the same problem and used your solution to fix the query. Maybe lordelph can update the download
Anyways, thanks lordelph for the pastebin. No amount of words can express how great it really is
9tal
wrote on 14 October 2008 at 10:48
sloved:
CREATE TABLE `pastebin` (
`pid` int( 11 ) NOT NULL AUTO_INCREMENT ,
`poster` varchar( 16 ) default NULL ,
`posted` datetime default NULL ,
`code` text,
`parent_pid` int( 11 ) default ‘0′,
`format` varchar( 16 ) default NULL ,
`codefmt` mediumtext,
`codecss` text,
`domain` varchar( 255 ) default ”,
`expires` DATETIME,
`expiry_flag` ENUM( ‘d’, ‘m’, ‘f’’) NOT NULL DEFAULT ‘m’,
PRIMARY KEY ( `pid` ) ,
KEY `domain` ( `domain` ) ,
KEY ( `parent_pid` ) ,
KEY ( `expires` )
);
10Bob
wrote on 18 October 2008 at 10:12
great to see that but I am trying to set that up in my .htaccess file and I am having one hell of a time, just can’t seem to get it to work.. anyone able to post an example of their working .htaccess?
11Nicholas Alipaz
wrote on 10 November 2008 at 0:46
I think maybe wordpress is garbling up some quotations on this page, so I posted the corrected MySQL query in (quite appropriately) the pastebin:
http://pastebin.com/f5c8e168a
I hope someone else gets some use.
12Nicholas Alipaz
wrote on 10 November 2008 at 4:56
Bob, I have:
http://pastebin.com/f7588d080
Note that I have changed the links to the help page in layout.php to be help.html
Also, be aware that my pastebin is in the /pastebin/ directory of my site, so change the .htaccess to reflect your path if need be.
13Nicholas Alipaz
wrote on 10 November 2008 at 5:00
oh yeah, I also renamed my pastebin.php file to index.php
so be careful with that too.
14Nicholas Alipaz
wrote on 10 November 2008 at 15:15
Ok, this is probably my last post. But I will sum up all changes I needed to do to get the installation done/bug free (from what I can tell).
1. Alter the MySQL query to:
http://pastebin.com/f129ec21c
2. Change the .htaccess addition to:
Installation in the root of the site:
http://pastebin.com/f583f07c5
15Nicholas Alipaz
wrote on 10 November 2008 at 15:16
3. Change line #306 of layout.php as follows:
http://pastebin.com/f19a87b14
*This was needed because a post that had no children was showing “modifications of a post by view diff”. As you can see the username was missing, this is because the post was NOT a modification of another post.*
4. A custom change I made so that the help page was seo friendly:
In layout.php, change every instance of the help link:
http://pastebin.com/f61e426d3
Then in your .htaccess add:
http://pastebin.com/f4c497673