News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

SMF NoPaste

Started by Marook, January 13, 2008, 03:14:44 PM

Previous topic - Next topic

Marook

Link to Mod

This mod adds a NoPaste, also known as a pastebin to your SMF Forum. It's a web application which allows its users to upload snippets of text, usually samples of source code, for public viewing. It is very popular in IRC channels where pasting large amounts of text is considered bad etiquette. A vast number of pastebins exist on the Internet, but no one integrated in a forum.

Features :
(o) uses 4-level permissions (use, view, add, delete)
(o) add new bbc tag [np]
(o) supports queryless urls
(o) UBBC allowed in description
(o) administration interface
(o) snippet browser where an admin can see the details
(o) integrated reCaptcha engine to prevent spam (thx to Motoko-chan for inspiring me about reCaptcha).

Edit : Files updated, fixed some minor bugs. Changed parameter delimiter from ampersand to semicolon.

Update 1.1
(o) user can upload / download snippets
(o) added file upload permission
(o) added view-counter

To get the reCaptcha working, its required to obtain an api-key here.
(The link is also available in acp)

Usage of [np] tag :
Add a snippet to the nopaste and copy the cryptid, for example:
http://yourserver.com/path/to/smf/index.php/id,fae965f19f.html
'fae965f19f' is the cryptid, you can either use the [np]-tag like
any other tags = [np]fae965f19f[/np] or you can use the tag like this
[np=fae965f19f]sometext[/np] in order to display a custom text.

For support visit http://www.marook-online.de !
Live demo : Here
SMF Rulez ;) | Meet me home ! | My Mods

karlbenson

#1
I had a quick checkout of both testing and the code.

Please don't be disheartened by all of these.
As a mod author myself I find it invaluable to receive bug reports and general suggestions.
I therefore like to do the same in return for other peoples mods.

Its a nice little mod.

In install.php
// Create the 'pastes' table
global $bd_prefix, $scripturl;

I'm not sure if you need to refer the globals, since you not using them inside a function.
However I think $bd is meant to be $db anyway.


In the urls, SMF uses a semi-colon instead of an ampersand.  Not a bug per-se. But I'm sure users might like to keep them all the same.
http://localhost/index.php?action=nopaste&sa=show&id=75f894b342
vs
http://www.simplemachines.org/community/index.php?action=markasread;sa=topic;t=1381227;topic=216562.0


In Sources/NoPaste.php
@ lines 337/338
I'm getting errors with undefined indexes for $modSettings['queryless_urls']
I'm not sure whether its because i'm testing it on my local machine.
But if others report it try using (!empty($modSettings['queryless_urls']))


When you create a paste and view it
you get TWO links in the treeview
My Community > NoPaste > NoPaste[/quote]
Both point to the same NoPaste link.
I'm guessing the second NoPaste Link was supposed to link back to the Individual paste link,

karlbenson


Marook

Thx karlbenson for testing it. I did it again and again and did not find anymore bugs, good to have another mod developer testing it too ;)

Fixes :

  • In install.php $bd_prefix is now $db_prefix ;)
  • I changed the parameter delimiter from ampersand to semicolon.
  • Added (!empty( to lines 337/338
  • Fixed the linktree to represent the acutal viewed code
SMF Rulez ;) | Meet me home ! | My Mods

darkcode

there are some bugs in that mod, namely that the syntax highlighting of "mIRC" doesn't work, GeSHi had the same problem but I fixed it and submitted the same to GeSHi guys, it would be nice if you could make it work with GeSHi because many people use that and its constantly developed and fixed. Another thing which I would like to see is short URLs, maybe with .htaccess. All and all it's a good feature. I hope the above mentioned things are seen in the nest version, Cheers :)

Marook

Thx for feedback... the sntax-highlighting isnt mine ;( I will try to fix it. The shortest url is http://www.yourforum.com/index.php?id=someid.html, it will be automaticly enabled if queryless_urls is enabled in admincp...
SMF Rulez ;) | Meet me home ! | My Mods

darkcode

Yes I know, I had problems with that syntax highlighter too, and then people suggested me GeSHi, the advantages of GeSHi are many, like it is updated regularly, support for much more languages etc etc. I have submitted a working "mIRC" highlight for GeSHi too, I don't think it's released under the stable version, but I can pass you the same if you want me to :) Looking forward for your next version. Cheers :)

ℓσяєиz


Barış Dokumacı


MY THEMES

The greates enemy will hide in the last place you would ever lock..

Marook

SMF Rulez ;) | Meet me home ! | My Mods

dark_diablo_01

I have a problem, everytime the script tries to install it doesn't execute the needed SQL Queries only to end up with a table not being found, and test fails on index.template.php
Visit http://www.just-hack.com/ [nofollow]

Just-Hack.com is a hacking community for all hackers to come and trade ideas and news about the underground.  Radio, Code Bin, Tutorials, Exploits, Tools, Security, News, Hacking, Reverse Engineering.

Marook

try open the file install.php from the package. on line 12 the query begins, copy & paste this query into your phpmyadmin and replace {db_prefix} with your tableprefix. Taht should work because its only one new table...
SMF Rulez ;) | Meet me home ! | My Mods

bin4ry

Hey marook,

can't install ur nopaste mod since it won't pass the test. It always tell me that it fails on

index.template.php

My webserver is a unix machine (gentoo) i changed files to lowercase without succes. Ignoring the test's warning won't help.

Can't install the mod in both versions.

Using smf 1.1.4

See u @ egocrew

dark_diablo_01

Mod works great still, but I still have a slight problem, I tried posting on your site, but I guess it's just so inactive, no one ever gets a reply to anything, anyways, the highlighting stopped working, anyway to fix this man?
Visit http://www.just-hack.com/ [nofollow]

Just-Hack.com is a hacking community for all hackers to come and trade ideas and news about the underground.  Radio, Code Bin, Tutorials, Exploits, Tools, Security, News, Hacking, Reverse Engineering.

chilly

Hi,

tried to install this mod with SMF2 RC 3

Check fails on many different files:
./index.php
./Themes/default/index.template.php
./Sources/Subs.php
./Sources/ManagePermissions.php

Can someone tell me what to do?

Language Coordinator

Advertisement: