Upgraded for HTML5 and CSS3. Added support for user accounts, hidden/private posts, ability to comment on posts, admin privileges, deleting pastes/comments, and syntax highlighting with Google Code Prettify
[b]to upgrade:
ALTER TABLE users ADD COLUMN admin TINYINT(1) NOT NULL DEFAULT 0 AFTER email;
UPDATE users SET admin = 1 WHERE username = 'YOUR_USERNAME_HERE' LIMIT 1
where YOUR_USERNAME_HERE is the username you want to give admin privileges to[/b]
[list=1]installation:
[]Download and unzip script to your server
[]edit configuration section of scripts/main.php
[*]run SQL_FILE.sql in the database you want and your done
[/list]
@sunslayer Nice work, although I notice it added backslashes on your demo there.
added the ability to delete your own comments and pastes, as well as added an admin functionality to delete other's. and replaced the geshi syntax highlighter with Google's Code Prettify that will automatically detect the language.
to upgrade open your mysql editor in the database for this file and type
ALTER TABLE users ADD COLUMN admin TINYINT(1) NOT NULL DEFAULT 0 AFTER email;
UPDATE users SET admin = 1 WHERE username = 'YOUR_USERNAME_HERE' LIMIT 1
to give yourself admin privileges
@DarkOneMatter sorry i keep forgetting to silence notices :/ just put
error_reporting(E_ALL ^ E_NOTICE);
back in main.php
first:
Notice: Undefined index: user_id in C:xampphtdocspastebincoreuser.class.php on line 6
and under wiew:
otice: Undefined index: user_id in C:xampphtdocspastebincoreuser.class.php on line 6
Notice: Use of undefined constant PASTE_NOT_VALID - assumed 'PASTE_NOT_VALID' in C:xampphtdocspastebincorepaste.class.php on line 2
Notice: Use of undefined constant PASTE_NOT_EXIST - assumed 'PASTE_NOT_EXIST' in C:xampphtdocspastebincorepaste.class.php on line 3
Notice: Use of undefined constant PASTE_GESHI_NOT_EXIST - assumed 'PASTE_GESHI_NOT_EXIST' in C:xampphtdocspastebincorepaste.class.php on line 4
Notice: Use of undefined constant PASTE_PASS_INCORRECT - assumed 'PASTE_PASS_INCORRECT' in C:xampphtdocspastebincorepaste.class.php on line 5
Notice: Undefined index: id in C:xampphtdocspastebincorepaste.class.php on line 13
Notice: Undefined index: pass in C:xampphtdocspastebincorepaste.class.php on line 14
and under register;
Notice: Undefined variable: success in C:xampphtdocspastebinregister.php on line 49
Create an Account
Notice: Undefined variable: error in C:xampphtdocspastebinregister.php on line 5
no way, to much fail :(
@DarkOneMatter it was actually the link that was incorrect, the filename should be myaccount.php although it doesn't really matter what you name it as long as your consistent
from:
/pastebin/view.php
to:
http://project-x.re/pastebin/account.php
where account.php was myaccount.php before :)
@sunslayer You might want to look at CodeMirror as an alternative to Geshi. We were using Geshi for a while, but we just started using CodeMirror which is quite nice. There's also Prettify which actually detects the language.
@DarkOneMatter try logging in that should remove the error, i forgot to suppress errors before i uploaded the script. adding
error_reporting(E_ALL ^ E_NOTICE);
to the beginning of main.php should fix that.
edit: thanks for the suggestions i've been contemplating adding a control panel so it might make it in the next update
could it be possible to add RSS feeds to the page?
and maybe an admin panel where you can put a header on the page, see how many pastes are in DB, slightly different stats.
and perhaps a small state box at the front where many users, pastes, stuff? :)
I really love your Pastebin, it consumes a lot! :).
Hope you will continue to work on it :)