Just a few thoughts on the [saveplugin] template though.
1. Plugins don't NEED to be in the plugin directory, they can be loaded from anywhere you select them from the plugins dialog.
2. The default plugin directory can change, which is what GetInfo(60) is for.
3. Writing userdata to the program files directory has been Bad Form for a very long time, and I'll continue to nag about it so that it changes and "the developer stops having bull#$%& problems with Vista" (and Windows 7). :D
I'd remove step 3, and insert a step between the present steps 5. and 6. to "Navigate to where you saved the [whatever].xml file."
If you wanted to parallel how web browsers, and Office applications handle plugins, The Application Data directory is the place for plugins and the globalpreferences.sqlitedb. Although I rather like that MC looks for the db in the startup directory.
Worlds, Scripts, and Logs should be under My Documents.
I posted the CSIDLs in another thread the last time I nagged about this :)
I'd suggest having the installer create a MyDocuments\MushClient directory, with the worlds and logs directory made under that. The shortcut could point to that dir as the startup.
Another thought would be to add an "Install from Clipboard" button to the "Plugins..." dialog that is analogous to the Paste button in the alias, timers, and Triggers dialogs. You've already done the logic to check the clipboard contents for valid xml. Adding a check for <plugin> tags should be minimal.
Nit picky point... Lua's official terminology is that the string library has "Patterns", as it's not a full RegExp implementation (lacking "or" i.e. "|", look aheads/behinds and atoms)
Let Me Google That For You is a rather snarky response anyway.
The [search] tags are going to cause problems eventually, since threads that are answered with the template start showing up in the search results, since all those keywords are in the template. The signal to noise ratio will drop heavily.
The other thing is a matter of perception and community... The problem with searches is that you have to know what you're searching for. A newer user may not have the terminology down to search effectively. There's also the human aspect too, someone asking for help on something and getting someone-else's answer, how ever pertinent, feels like a blow off. Won't replies with just [search] in them come across as "don't waste my time"?
Which, hey, Mushclient has been made freely available and open source, so any expectations about your time is rude; but appreciation doesn't work when it's demanded...
I dunno... perhaps I'm reading too much 'metadata' and subtext into things... Must be because of working with the help file's index for the past week... ;)
You have a point about how posts which merely request information on (say) a stat roller will show up in a search for stat rollers. Not quite sure how you can distinguish, in a search, between wanting to know something, and providing the answer. Maybe, do what Google does, and rank the results based on the number of views (I know Google doesn't do that exactly). That might work.
I know what you mean about not "blowing people off" with a stock response, but sometimes it is hard to keep calm when someone posts a question in a section where they are clearly asked for the MUSHclient version number, a copy of what they did, and a copy of the error message, and they come up with this:
Quote:
I tried to get xxx to work today and got an error message. Why is that?
No version, no detailed description about what they did, no copy of the error message. I try to be civil, but I'm afraid that really terse postings like that are likely to get a [version] response from now on.
On the topic of search and the [ search] template, I was thinking the search could ignore matched terms within double-brackets, but that would only be easy if the search system used regex...
Now that the forum tags are detected for you (whether or not you check the button), maybe the button should indicate "do *not* use forum codes"? I guess that would be complicated for editing old posts vs. making new posts, where you said the detection logic is different.
First time I read this post they were just plain text. Now with the boxes/colours etc it looks much more professional (and pretty!).
Constructive criticism time :) I noticed in another post someone already used one of these templates. That's great, I think they're very useful, however, the larger ones with a lot of text tend to make the post a little clunky looking. If they were maybe wider instead of fixed width it might look better and not cause the entire reply to look so long? Just my thought on the matter.
First time I read this post they were just plain text.
The look improves when the stylesheet reloads. If anyone else is not getting nice boxes, refresh the page in your browser, which forces style.css file to be reloaded from the forum server.
Quote:
... the larger ones with a lot of text tend to make the post a little clunky looking.
I know the one you mean. I fixed up the [codetag] tag because I think that will be used a lot, and it is quite wordy. I made a forum page to explain in detail what it was getting at, and changed the tag to point to it.
Also I made the boxes slightly wider. Without any width at all they tend to look a bit big.
Would you consider changing the width: 450px; to margin-right: 4em; ?
When looking at the page in a maximized browser window, there's so much dead space to the right of the tag, making you scroll more to get to the actual content.
For example look at the [regexp] template. There's a lot of text that can wrap with the browser.
Regular expressions
Regular expressions (as used in triggers and aliases) are documented on the Regular expression tips forum page.
Also see how Lua string matching patterns work, as documented on the Lua string.find page.
Can I suggest a new tag for a direct link to a forum post.
This came up because my latest plugin uses another plugin that a user may not have and I wanted to put a link to that plugin's forum post.
One thing I like in some forum software is that you can quote a message with attribution. The forum code looks like this:
[quote=David]Hello there[/quote]
The rendered text is something like:
Quote: David said:
Hello there
I think it would be kind of nice to have something similar here, and the templates would make the quoted text stand out very nicely from the poster's text -- sometimes it gets hard to tell who wrote what (even with the indent). Also, having a name in there makes it easier to quote several people in the same post, as you can attribute each paragraph correctly.
Adding a 'Quote' button on each post would also be nice; I frequently find myself wanting to quote someone, but having to go back and copy it manually.
Twisol said: Adding a 'Quote' button on each post would also be nice
So far I have steered away from scripting on the web pages. I usually find I only want to quote part of a message anyway.
Scripting? I was thinking more like just a button that would open the same reply entry box, but with the selected post quoted already inside. Wouldn't that just involve sending a post ID to the server along with the button press, and having the server send back the same page, but with the text field having a default of the quoted post?
EDIT: Also, if you can't tell, nested quote tags break horribly. >_>
It isn't that easy to get them right. They never worked before, anyway. One problem I have is that people may open the quote and not close it. Now if you do nested quotes with something fancy like tables, then the whole rest of the page can be thrown out.
At present quoting looks like this:
<p class="quote">
<b>Quote:</b><br>
... your quote here ...
</p>
That basically indents and colours the text, putting a box around it. The individual linebreaks are done with <br> (not </p>) so they don't close the "quote" paragraph.
If someone can show me some html/css that successfully indents quotes, and is also resistant to the missing [/quote] tag, I will be pleased to use it.
Nick Gammon said: If someone can show me some html/css that successfully indents quotes
Use <div> instead of <p>. I tested using only the `.quote` CSS class and a simple nested set of tags. The <p> tags failed to indent, but the <div> tags worked perfectly. (I changed the class from `p.quote` to `.quote`, obviously)
Nick Gammon said: and is also resistant to the missing [/quote] tag
One of many solutions I can think of is counting the number of start tags versus end tags; if there's a mismatch, do something (strip the extra ends if there's too many, or add extra ends to the end of a post if there's too few). This would have to be implemented server-side, but I very much doubt that arbitrary HTML/CSS can fix itself if there's a lack of an end-tag. (Some exceptions apply in quirks mode - I know that <p> was often used without an end tag - but it's not arbitrary)
EDIT: Also, it just so happens that a Quote button would help us quoters, because otherwise we have to copy their post as we see it. And if it contains \[quote\] or some variation thereof, then even though their post is fine, we'd be copying the un-fixed version. I ran into that problem with the second quote in this post.
EDIT 2: Multiple indents at the 5em level is a lot of indenting. 2em looks pretty good to me. This is more of a taste suggestion than a feature suggestion, though.
The > is the child selector. It reads "Any element with class quote that is a child of any element with class quote"
It is listed first so that the more general .quote rule doesn't have precedence over it.
And Twisol's right, The P tag doesn't handle nesting. The problem shouldn't be the user forgetting the [/quote] tag since the php page is handling the parsing of that, not the browser's html/css engine.
Will, all I had to do was change the tags to div's and remove the specific 'p' element selector from the class. I don't know what kind of CSS voodoo you have there, some kind of recursive beast? :D
Yea, I have the .quote > .quote so I can change the margins on the inner nested elements... having 5em margins inside a frame with 5em margins leaves too much dead space. :)
RE: your Edit 2 above: That's the voodoo recursive beast. ;)
Adding a 'Quote' button on each post would also be nice; I frequently find myself wanting to quote someone, but having to go back and copy it manually.
OK - I think I got the quote button working. It was quite fiddly, I didn't want to keep all the forum tags in the quoted message, for one thing that looked messy, and for another you had the problem with nested tags.
So, a quoted message basically has the forum tags stripped from it - it may not work perfectly, if you find something obviously wrong I'll try to correct it.
(quote=Twisol)
Adding a 'Quote' button on each post would also be nice; I frequently find myself wanting to quote someone, but having to go back and copy it manually.
OK - I think I got the quote button working. It was quite fiddly, I didn't want to keep all the forum tags in the quoted message, for one thing that looked messy, and for another you had the problem with nested tags.
So, a quoted message basically has the forum tags stripped from it - it may not work perfectly, if you find something obviously wrong I'll try to correct it.
[quote=E.A.Poe]
(quote=TheRaven)
Nevermore.
I remember now why it is hard to get quotes (or anything) going as a nested thing, using regular expressions. Basically regexp matches can be greedy or non-greedy, but neither one matches correctly on a message with both nested and non-nested quotes in it.
The greedy one goes too far, and the non-greedy one doesn't handle the nesting.
Now you could recursively descend into it (and then you have the problems of handling badly-formed messages) but this is something that has to happen on every post, on every page. (There are up to 15 posts a page).
I was worried about the overhead of doing that all the time.
The current system just blindly replaces form codes with html, eg. [b] becomes <b>.
Twisol said:
One of many solutions I can think of is counting the number of start tags versus end tags
You could make .code a css class that has white-space: pre; and font-family: monospace; then change the php so it doesn't write <pre><code> tags, but a <div class="code"> tag...
A div will not nest inside of a <P> tag, so it will behave like the rest of the forum even when not nested.
I slept on it. What if you counted (again), but each start was +1 and each end was -1? That means that if at any point you're under 0, or if at the end you're NOT zero, something's wrong.
Is a recursive descent really that expensive? I imagine that it's probably not much worse than a regular expression match. It's just a linear string scan, really. I think that malformed posts might be the trickier thing to deal with.
I slept on it. What if you counted (again), but each start was +1 and each end was -1? That means that if at any point you're under 0, or if at the end you're NOT zero, something's wrong.
David Haley said:
Is a recursive descent really that expensive? I imagine that it's probably not much worse than a regular expression match. It's just a linear string scan, really. I think that malformed posts might be the trickier thing to deal with.
It all works fairly well with the simplified method, so I won't bother doing either of those, thanks for the suggestions however. :-)
Just to throw in my gratz too, Nick, I also really like the recent template & quote & code changes, and so does my wife, Dragona. The template changes look great and seem like a really good idea in general. The most recent quote & code tag changes look really good and were probably overdue, especially the ability to attribute quotes directly. In short, good job! :)