Archive for the ‘Pastebin’ Category

You paste it, you manage it. Why not?

Another weird thing that happens when you switch the storage systems you use on the script is that, for some reason, you lose the ability to flag pastes as yours (through the usage of the remember me checkbox) and as such are unable to delete pastes that you made. I admit, I completely overlooked this built in feature – somehow – and decided to add my own flagging mechanism.

I decided to not use cookies and instead to associate your IP to your pastes so that you may delete ANY you make, provided your IP is the same as when you made that . Still, for those people who are cursed by damned dynamic IPs, this implementation obviously does not work and I’ll probably make my other features work with the cookies sets (if you check the remember be checkbox) or implement another way of flagging pastes as yours.

Comments 0

Predictable to completely random.

.com’s script has two storage methods: and flat-file based storage.

Though I prefer for ease of use and easier interaction with code, I did not like the “public” way the script  handled pastes (the ID was associated with a primary key in the database which was how IDs were assigned too – a clever way to not have to worry about IDs getting re-used) as anyone could just guess URLs to find pastes: http://pb./1, http://pb./2 etc. I really preferred the way .com currently handles it – which is also the way the flat-file storage method handles it.

Since Malloc’s was meant to be more tuned to the needs of developers, it needed to be less public than the stock script was. As such, I modified pb. to use a more ID assignment system and I think it works out just fine.

Comments 0

Ripping, tearing to shreds.

So now that I have installed and working on http://pb.. I’ve been looking at the code and decided I don’t really like the way things currently are.

So, for starters I have made a few changes:

  • I don’t really agree with how “public” currently is, so I’ve removed the Recent posts section on the side.
  • There used to be a feedback form on the side too. I’ve removed that since anyone who’d want to give me feedback knows where to find me.
  • We all know how annoying spammers are and for that reason I have added a CAPTCHA to using and its wonderful API.
  • Having looked at the code… I’m considering just making my own instead of modifying .com’s source.

I know, I know. You’re all probably saying: “but it is a , all people need it for is to things in” which is true and from that perspective the .com script does it justice but I’m still not satisfied.

Comments 0

Good news.

I’ve fixed the statements we were told to use in the file.

For anyone who encounters this problem, here’s the solution.

The problem:

The statements in the file that come with ’s source aren’t following the correct syntax and as such, we encounter this error when we try to run the provided statements.
[]#1064 – You have an error in your syntax; check the manual that corresponds to your MySQL server version
for the right syntax to use near ‘KEY `expires`’ at line 16[/]
The solution:

Not sure how it previously eluded me…but the fix was quite obvious.
[]CREATE TABLE `` (
`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_id` ( `parent_pid` ) ,
KEY `expires` ( `expires` )
);

create table recent
(
domain varchar(255),
pid int not null,
seq_no int not null,

primary key(domain,seq_no)
);[/]

Comments 3

Not good news.

Well, I lied. I haven’t installed/ a yet but I have tried and…failed.

I keep running into this error when trying to create the appropriate tables in my database.
[]#1064 – You have an error in your syntax; check the manual that corresponds to your MySQL server version
for the right syntax to use near ‘KEY `expires`’ at line 16[/]
So for now, I am sticking with the flat-file DB . Well at least we have something to work with for the time being.

Comments 0

So now we have a pastebin.

So I’ve been a busy busy person and installed a for . But one must be wondering why on earth I would have a WHOLE category dedicated to, what may seem to some, a short discussion of (s) and to that I answer thus:

Although there are…, what? 3 different scripts out there now? Maybe 4? I’m not really satisfied with what features they offer out of the box and so I’ll probably be working on or hacking at the script(s) to get them just how I like them.

Stay tuned for more… ;)

Comments 0

 
 
 

RSS: Posts / Comments