[RESOLVED - ACCEPTED] Removal of 20,000 character limit in some cases

Wasn’t it only staff that could double post, and for everyone else it would just get merged with their previous post?

I think the solution here is a (client) plugin that takes the pastebin link, and embeds it in code tags (if the content length is reasonable in size). Database doesn’t take the hit from large posts, mscp servers don’t take any extra load from constantly requesting pastebin api, and everyone is happy again.

Could additionally have mscp servers auto post entries in code tags to pastebin.

Warning: Bad synchronous code

[code]// ==UserScript==
// @name MSCP Pastebin Expand
// @match http*://.moparisthebest.com/smf/
// @version 0.1
// ==/UserScript==

var TEMPLATE = ‘

Code: [Select]
{$BODY}’;

var cache = {};
var elements = document.getElementsByClassName(‘post’);
for(var i = 0; i < elements.length; i++) {
var anchors = elements[i].getElementsByTagName(‘a’);
for(var j = 0; j < anchors.length; j++) {
var src = anchors[j].getAttribute(‘href’);
if(src.indexOf(‘pastebin.com’) !== -1) {
embedPaste(anchors[j], src.substring(src.lastIndexOf(’/’) + 1));
}
}
}

function embedPaste(node, pasteId) {
if(!cache.hasOwnProperty(pasteId)) {
cache[pasteId] = TEMPLATE.replace(’{$BODY}’, get(‘http://pastebin.com/raw.php?i=’ + pasteId));
}

var block = document.createElement('div');
block.setAttribute('data-id', 'paste_' + pasteId);
block.innerHTML = cache[pasteId];

node.parentNode.replaceChild(block, node);

}

function get(url) {
var req = new XMLHttpRequest();
req.open(‘GET’, ‘//cors-anywhere.herokuapp.com/’ + url, false);
req.send();

var response = req.response;
response = response.replace(/(\r\n|\n|\r)/gm, '<br />');
response = response.replace(/\t/gm, '<span style="white-space: pre;">    </span>');

return response;

}[/code]
This will give you raw unstyled code blocks. Although using Gists would be a much better option than pastebin. It is much easier to embed, supports multiple files (I’m looking at you https://www.moparisthebest.com/smf/index.php/topic,671332.0.html), and syntax highlighting.

[quote=“Davidi2, post:15, topic:552427”][quote author=Bowser jr link=topic=671346.msg4489616#msg4489616 date=1436738911]
There is no reason you could raise it everywhere, and just mute/ban those who use it to spam.
[/quote]Raising it probably wouldnt be a big problem, but why? Then you get people who complain because they cant post their whole client.java, or whatever. If you cant fit it in 20k characters then a fair bit of time you cant fit it in 40k either… so how do you determine what to raise it to? People need to learn to just use pastebin. And tutorials that require more than one post are few and far between.[/quote]

The question you should probably be asking is, if raising it probably wouldn’t be a big problem, then why not?

I would like to hear what mitb/tom’s explanation for this is. If the reasoning is something along the lines of spam or ‘database stress’ I really think bumping it up to atleast 40k wouldn’t cause any problems. I’ve never seen anyone spamming 20k character posts lol.

What number would you want, instead?

Your number, hunny. :wink:

I’d set it to 20001 characters

Maybe we’re looking at it the wrong way. Maybe what we need is an SMF pastebin plugin. Post the code to pastebin, then just have like a [pastebin id=abcdef123456] tag. On page load, fetch it from the site

Because what we need is to add more custom code to the forum.

And we’ve hit that point that we get to in every community suggestion…
Now we’re going to sit here and discuss adding new extensions and etc even though the suggestion was to just change a number from 20,000 to (As an example) 40,000.

[quote=“sk8rdude461, post:29, topic:552427”]And we’ve hit that point that we get to in every community suggestion…
Now we’re going to sit here and discuss adding new extensions and etc even though the suggestion was to just change a number from 20,000 to (As an example) 40,000.[/quote]

The only reason I suggested making a plugin, or using an existing one was to address some concerns that were brought up. If there’s a worry about storage space, then off loading the bulk of the data to another server, whose sole intention is for storing text data, could be an alternative. It wouldn’t be a client-side plugin because anyone who doesn’t have it wouldn’t be able to view the content.

[quote=“Zymus, post:30, topic:552427”][quote author=sk8rdude461 link=topic=671346.msg4492914#msg4492914 date=1439315158]
And we’ve hit that point that we get to in every community suggestion…
Now we’re going to sit here and discuss adding new extensions and etc even though the suggestion was to just change a number from 20,000 to (As an example) 40,000.

[/quote]

The only reason I suggested making a plugin, or using an existing one was to address some concerns that were brought up. If there’s a worry about storage space, then off loading the bulk of the data to another server, whose sole intention is for storing text data, could be an alternative. It wouldn’t be a client-side plugin because anyone who doesn’t have it wouldn’t be able to view the content.[/quote]
I understand, but I’m just saying it seems that all the solutions to anything suggested is “add an extension” or "write a tool"
And then one of the following happens:
It’s already created, but never implemented
No one wants to write it, or the ones that do don’t have the talent
Nothing happens.

Potential fix:

  • Make all BB code tags not count towards the limit (iirc they do)
  • A plugin that embeds common pastes (paste.ee, pastie.org, pastebin.com, gist.github.com, etc) into the post view without actually adding it to the post

[quote=“Bowser jr, post:28, topic:552427”][quote author=Zymus link=topic=671346.msg4492821#msg4492821 date=1439256363]
Maybe we’re looking at it the wrong way. Maybe what we need is an SMF pastebin plugin. Post the code to pastebin, then just have like a [pastebin id=abcdef123456] tag. On page load, fetch it from the site
[/quote]
Because what we need is to add more custom code to the forum.[/quote]
It doesn’t need to be handled on the server. You can offer a Greasemonkey script for users to install if they don’t like opening each link in a new tab (see my prototype above), or that code can be moved into the view too. Gist already has a great looking embed, and is versioned, I don’t see why we aren’t moving towards that anyways.

The goal is to keep the load off the MSCP servers, so we need to keep it client sided as much as possible.

[quote=“HcoJustin, post:34, topic:552427”][quote author=Bowser jr link=topic=671346.msg4492901#msg4492901 date=1439310485]

Because what we need is to add more custom code to the forum.
[/quote]
It doesn’t need to be handled on the server. You can offer a Greasemonkey script for users to install if they don’t like opening each link in a new tab (see my prototype above), or that code can be moved into the view too. Gist already has a great looking embed, and is versioned, I don’t see why we aren’t moving towards that anyways.

The goal is to keep the load off the MSCP servers, so we need to keep it client sided as much as possible.[/quote]

I would disagree. I think we need to keep it as user friendly as possible. Requiring users to not only install a browser plugin, but also download a custom script not only makes it a pain for the user, but then you have to deal with things like browser compatibility, and how will silab criticize everything we do from behind the great firewall of China?

Silab, does China block Pastebin or Github?

The path of least resistance here is just having an admin up the char limit. I see nothing wrong with that. The problem is, I don’t really see anyone actually caring about this suggestion because no one has answered my question yet.

I care about it slightly as I deal with people that post long strings of code.
However, I can’t think of a suitable number.
A delta’s Client.java can have 1 million characters however, I don’t think we should make the limit 1 million characters…

I’d say in the region of 40-45k.

[quote=“sk8rdude461, post:38, topic:552427”][quote author=Taharok link=topic=671346.msg4492995#msg4492995 date=1439353598]
I path of least resistance here is just having an admin up the char limit. I see nothing wrong with that. The problem is, I don’t really see anyone actually caring about this suggestion because no one has answered my question yet.
[/quote]
I care about it slightly as I deal with people that post long strings of code.
However, I can’t think of a suitable number.
A delta’s Client.java can have 1 million characters however, I don’t think we should make the limit 1 million characters…

I’d say in the region of 40-45k.[/quote]

What happens when users want it increased again? Do we bump it again? I’m all for getting a specific number, but my question is, at what point do we start to seriously consider alternatives? Honestly, I don’t see very many user complaints about this; usually when I see something in server help, the user posts it on pastebin anyways. If the primary use case for this is for the Tutorials Section, then perhaps we could lift the limit in those places. But then another question I have is, perhaps tutorials as a whole can be done differently.

[quote=“Zymus, post:39, topic:552427”][quote author=sk8rdude461 link=topic=671346.msg4492999#msg4492999 date=1439354388]

I care about it slightly as I deal with people that post long strings of code.
However, I can’t think of a suitable number.
A delta’s Client.java can have 1 million characters however, I don’t think we should make the limit 1 million characters…

I’d say in the region of 40-45k.
[/quote]

What happens when users want it increased again? Do we bump it again? I’m all for getting a specific number, but my question is, at what point do we start to seriously consider alternatives? Honestly, I don’t see very many user complaints about this; usually when I see something in server help, the user posts it on pastebin anyways. If the primary use case for this is for the Tutorials Section, then perhaps we could lift the limit in those places. But then another question I have is, perhaps tutorials as a whole can be done differently.[/quote]

Taharok, 20k is a fine limit. It has been around for a long time and until recently no one has ever cared enough to need it changed.

As suggested why not raise it in tutorials, the development sections, and the advertising section. Those are the only areas I can see it needing to be raise to say 35k.

As for in the help sections, as said before and in the above post. Pastebin should be used for full classes. No point what so ever for a person to need to post the entire class in the topic.

EDIT: As for the double posting, just do what we have done in the past. Get someone you trust or even a mod to post the moment you create your thread, post again, other posts, you post, other posts. After which the other person deletes their posts and you now have 4-7 reserve posts for use.