There are so many pastebins on the Internet these days. Why does the world need another one? I don’t know, but I wanted one for myself because of my friends and I when we were in Computer Science. Others found the pastebin so I then made password protected pastes. I like how the Pastebin is now. The only problems I have with it are that in FireFox when you copy and paste from it it also includes some weird numbers, so you have to copy and paste from the code box which isn’t that bad. Also I was trying to implement a printer friendly feature but I’m too sick of working on it so I gave up after I realized that with it people were able to circumvent password protection, I know there’s a way to fix that but I’m just too tired.
It was originally written by Paul Dixon, released under the GPL. Naturally, this is also under the GPL. I was planning on fixing up the code to make it look nicer because the original author made weird use of whitespace but screw it I’m too tired. You can see it in action here.
Features
- Password Protected Pastes
- reCAPTCHA anti-spam security
- Archive Page
- FamFamFam Icons
- Updated with the latest version of GeSHi from SVN. Support for many more languages.
Changelog
1.5
- Fixed bug where people could download password protected pastes
- Cleaned all URLs with mod_rewrite for SEO
Sites Using this Pastebin
- mscripts.net: A site dedicated to mIRC scripts
Download pastebin.tgz 1.5 - Last Updated: 6-29-08
Hi there,
First I would like to say, awesome work! and good job.
2nd. I downloaded the pastebin.tar.gz file and it seesms to be missing the mysql database file.
am I wrong?
-Yoni
Yes it is, thanks for reminding me, I can’t believe I forgot it!
Since you already downloaded the archive, I suggest you just check this out, it’s the same thing and should work. I’ll put it in the archive and re-upload it in a second.
Thanks for the comment!
By the way I suggest you redownload. If you’ve already installed then just overwrite the files. It was my fault, I was linking to the older version. I now linked to the newer version and it also now includes the SQL file and some installation instructions.
I could not get mirc highlighting to work, it gives an error :/
Thanks for the heads up, I’ll look into it, though it looks more like a GeSHI problem. If all else fails, I’m going to update the version the pastebin has, hopefully that fixes it.
Yes, the same thing happens at the GeSHI Site. I emailed the author the bug information, hopefully he can fix it soon.
In case you don’t know, GeSHI is what does the syntax highlighting in this pastebin, as well as in many other pastebins and scripts.
yes, I checked in the geshi site too just after I posted here and I saw the same problem, I hope you can fix it because I am very impressed with your version of pastebin and since I intend to use it for a website which primarily deals with mirc scripts that part is crucial. Looking forward to a new version which fixes the issue. Cheers
ok, worked on a work around, it works with TCL syntax, BUT.. when I load it in my site, nothing shows up :/
Alright, thanks for the heads up, again. I already emailed the developer, and I will fix it as soon as he fixes GeSHI. I suggest you subscribe to this post through email if you haven’t already done so (It says it in the Comment form) so that you can be notified of replies or comments.
Blaenk Denum wrote:
Sorry, can you elaborate? Do you mean you can’t get the pastebin to work on your site, or it does work but when you post the code using the TCL syntax highlighting? Like what happens with when you try mIRC, except without the error?
no, when i just loaded the script, the first time i got the pastebin page (although in a basic form, the css didn’t catch), if i pasted there with any syntax, it was going back to http://www.example.com/pastebin.php although the pastebin is in http://www.example.com/pb/ .. soon after that it shows a blank page and nothing else.
This is what i did to load it up:
1) extract the files in my hdd
2) make the /config/domain.conf.php
3) upload it in my site
I keep checking this page every hour for your reply hehe.
Alright, thanks for the information, let me just eat lunch real quick then I’ll help you out.
alright
Did you edit line 103 in the configuration file.
You should try changing that to /pb/pastebin.php. Let me know how it goes.
thats when it showed blank pages heh, i guess i will have to do it in a sub domain to make it work right ?
Okay, so you did what I said about changing it to /pb/pastebin.php and that’s how it shows the blank pages? Have you tried changing it back to just /pastebin.php ?
no doesn;t work in any case. i wanna make it work in a sub directory named “pb” :/ i just want it in a directory like “pb” n then i want it to work like http://www.example.com/pb
What is your $CONF['pastebin'] value set to?
Try setting it to http://yoursite.com/pb.
Also make sure you have an .htaccess file in the pb folder with the following in it:
If you don’t have Apache, then change the $CONF['url_format'] value back to:
Also, all the files and folders, i.e. pastebin.php, layout.php, .htaccess, etc., are in the pb folder right?
Did what you said. I did all this:
1] download the package from this page
2] change the values in config/default.conf.php
3] upload the whole folder to my site
This is what I have atm –> http://www.mscripts.net/pp
Ok I did it till here from what you said, the css isn’t working yet, and when i post something it doesn’t give me the url. I attached the link in the previous post, please let me know what else can be done, thanks in advance
No problem, I’ll help you till you get this working. I thought you said the directory was pb, not pp. So, you’ll have to edit the $CONF[’pastebin’] value and change it to http://www.mscripts.net/pp ,
Also, from my understanding, in the pp folder you should have the files like pastebin.php, layout.php, pastebin.css, and the other files and folders. This is what you have right?
Oh and by the way, you did the MySQL stuff right? You know, set up the database table and all, more info in the install.sql file, if you need help doing it let me know. This could be the reason nothing is working, though I’d figure the CSS should still work.
Also, I’m sure you want shorter URLs for your pastebin (pp/123 instead of pp/pastebin.php?show=123), so you did the .htaccess file like I told you right?
By the way, I’m going to install pastebin in a sub-directory on my existing pastebin’s site, that way I’ll know for sure how to do it. Sorry about all the confusion, it’s just that it’s really ambiguous.
I think your .htaccess should be something like:
I’ll let you know how it went once I’m done!
Scratch the MySQL thing I said, that was stupid. If you hadn’t done it yet then the previous pastes wouldn’t appear on the left, xD Sorry!
OH! I think I see the problem! You have the make a paste part in the pb folder, and everything else in the pp folder, right? What are you trying to achieve? Have the people access the pastes at something like pp/123 and then do the work at pb/pastebin.php and stuff? If you wanted to do that you could’ve told me haha I think it’d be simpler to fix now. Or are you just confused and have some stuff in one folder and some in the other? So yeah just let me know how you want it, all in one folder (Like, access the posts in pb/123 and also access the pastebin at pb/, or have it separate). This will clear things up!
Judging from your previous post, I think you want this pastebin inside the pb folder, however, you have a different pastebin script in the pb folder already. So you will have to remove the contents of it and back it up or something, then put the things within the pp folder inside of the pb folder. You’ll also have to reconfigure the pastebin, so that the URL is /pb not /pp.
no no, i did want it in the /pb folder but since i could not get it working, i am using the /pp folder, mysql was copied from the install file you gave, these are the two things not working:
1] css script
2] giving the new url when posting, it shows on recent posts but i can’t access it even then.
ps: i did everything you told me to by changing “pb” to “pp”, once i get it running, i will change it back to “pb”. have to have a pastebin till then heh
so in effect, i will be using the “pp” folder till i get it working, and once it is working, i will edit the “pp” to “pb” in the end, the other pastebin is a temporary pastebin for people to post pastes
and yeah it would be nice if you could get it working in a sub-directory and see what is the exact problem
By the way, what’s the name of your configuration file? It shouldn’t be default.conf.php, rename it to mscripts.net.conf.php. If you haven’t done that yet, then I’m pretty sure that was your problem. Let me know alright?
it is mscripts.net.conf.php and domain base elements are 3. and yes, try to post one paste in the site i gave and see whats happening.
Don’t worry I’m working on this. The problem seems to be with .htaccess, may I see what yours includes? In the root directory that is (mscripts.net/.htaccess), if you even have one. For some reason the pastebin can’t find the files even though they are in the same directory, and if you look at the source, for some reason the home page’s source is included within the link and style tags in the pastebin page.
I figured out the problem, it’s not a quick fix though, so I’m going to fix it then re-upload it so you can try it alright? Just give me a moment to do this fix first, hopefully I finish today.
there is a .htaccess in the root directory for wiki’s short urls and nothing else, and in the “pp” directory there is the .htaccess which came with the pastebin
sure tyt, i waited for a week heh so one more day won’t harm
Do you mind posting your email address (Don’t hide it, it’ll automatically be hidden) so that I can email you if for any reason my site goes down (I haven’t paid the bills :S )
Alright I figured it out. First, download the pastebin again, it has been updated. Then what you are going to do is move the contents of the pb folder (Not pp) to another one for now, because I’m sure it will work now and it’s better to get it working for sure than to get it working then move it after. Then upload the contents of the pastebin to it, so that you have /pb/pastebin.php for example. Then rename the configuration file accordingly, like you already did, and begin to edit it.
The $CONF['pastebin'] variable should be set to ‘/pb’
The $CONF['url_format'] variable should be set to ‘/pb/%d’
The $CONF['this_script'] variable should be set to ‘/pb/pastebin.php’
Finally, in the .htaccess from the parent directory (The one in your root directory, which contains the wiki mod_rewrites and what not) you should have:
That should do it. Remember of course to do the other stuff, like fill in the MySQL settings. You don’t have to re-do the database stuff though, just fill in the same information for that.
Let me know how it goes!
And about the mIRC highlighting, it’s a known bug. I’ve already emailed the developer and subscribed to their mailing list, and messaged the mailing list, but there still are no responses. I’m monitoring the bug though, so whenever the developer fixes it, I will update the pastebin. It will be easy to upgrade don’t worry, it just involves overwriting the geshi folder.
ok did what you said, check it out at http://www.mscripts.net/pb still the same
one thing i didn’t understand, in the install.sql we are making a databse named pastebin, but when i paste something it says “access denied to user to database ‘paste’” also the css isn’t kicking in, in fact same as ever, did exactly the way you instructed :/
Yeah, you did something wrong. If you would’ve done it right, the path to the CSS file would be /pb/pastebin.css, but it’s still just /pastebin.css. Do you mind looking over the variables one more time in the configuration file and making sure they’re what I told you?
Also, about the database, no. The install.sql file simply makes a table, you have to choose a database first. As far as I know, you had it working already, but I guess you decided to re-do it, which wasn’t necessary. I have a feeling that you didn’t download the new version, since I was having the same problem. I would download the new pastebin but my browser’s cache was interfering and it would continue to download the old version (I could tell because the README in the old version is around 300 bytes, and in the new version it’s about 900 bytes). I suggest you clear your cache and retry what I said in my above post. Sorry for all the confusion man, but it’s working now trust me on this haha.
WORKS! it was the cache problem *goes back to newbie school* lol. Ok for the mirc syntax thing, i got a temporary fix, take tcl.php in geshi and rename it mirc.php and change the array from “TCL” to “mIRC Scripting”. that worked for me. one more thing i wanted to ask you about, can i change the css a bit ? (I will give you a copy so that you can use it on the new versions if you like it). Cheers mate
See!
You’re definitely, more than welcome to change the CSS, you don’t even have to give me the changes, it’s perfectly fine. Do you mind if I list you as one of the users of this pastebin on this page though? Have fun with your new pastebin!
Also, glad you found a workaround for mIRC highlighting. Whenever the GeSHi developers fix it, I will update the pastebin, so like I mentioned before it’s a good idea to subscribe to this post by email. If the highlighting gets fixed, you won’t have to re-install the pastebin or anything, it’s just a matter of overwriting the geshi folder with the new one.
I will be honoured, no giving you the css (if you like it, i suck in graphics lol) is a small gesture for your hard work
and yes i am looking forward to see the geshi update too.
ok, some more updates:
1] recaptcha when set to “false”, triggers an error while pasting.
2] Favicon.ico/shortcut icon doesn’t work in sub directory mode.
3] Wishlist: clean looking, new chic look for the pastebin
maybe somewhat like http://web.archive.org/web/20070702062421/http://pb.hdesk.org/
1. I thought I fixed that with the new version I uploaded. In fact, I just tried it right now, set it to ‘false’ and it works. What type of error, you mean an ‘incorrect recaptcha’ error? I fixed this, don’t know why you’re encountering the same thing. Just as a check though, in pastebin/pastebin.class.php, around line 140, do you see this:
If you do, then that’s the fix right there, don’t know why you’re having problems. You did set it to false in the mscripts.net.conf.php file right? If you did it in the default configuration file, then it’s being overwritten by the mscripts.net.conf.php file anyways. You have to change it to ‘false’ in the mscripts.net.conf.php file. Remember, it’s the $CONF['useRecaptcha'], and you have to set it like this:
No quotes around the false, since it’s a boolean, not a string.
2. What do you mean, you want the one that’s included with the pastebin? Try this. Open up layout.php and in line 41, right after the:
line, add this:
That should fix it.
3. I’ll maybe play around with the styling some day, but in the time being I have no intentions of doing so. I’m not necessarily a great designer. You can mess around with the source though, and remove anything you don’t need. I recommend the FireBug firefox extension if you don’t already have it, which will let you mess around with the CSS of the page in real-time, which you can then apply to the actual stylesheet.
Thanks Blaenk for the support and speedy fixing of problems. Good news!! NO bugs in the pastebin now, yay! The mIRC syntax highlighter which was not working was set right by the geshi guys but still a small bug creeped in, but it was fixed. Keep on the good work Blaenk. Cheers
Hrmm, another Geshi bug, it replaces > < & with >; <; &;
Blaenk, leave a msg here when they mail you or you fix it, thanks in advance
Sure thing.