Re: Unknown's thoughts on Wedge
« Reply #75, on July 12th, 2011, 05:20 PM »Last edited on July 12th, 2011, 05:26 PM by Clara Listensprechen
When I holler for help on SMF Community or when I discuss a situation with an SMF authority (that is, who is more familiar with SMF code than I am as well as a mod designer), the advice I get is to look for such-and-such code line and to change that line to such-and-such. Hearing about hooks here is the first time I've heard of hooks--and for all the times I've caused my board to crash just because of unintended consequences involved with changing a line of code, I know I'm going to look into hooks as an alternative as that does seem to be the better idea. Could have used that information when forcing the Shoutbox to make a sound when a Shout was made, too, dang it; could have put one in to use/used one, perhaps.  Oh, the agony of those times...!

Yeah, this is important information from where I'm sitting.

==============================

Oh---I might as well mention that one of the reasons that I've not upgraded to 2.0 Gold on Hypercrites Flipside is because a lot of mods I'm fond of work with the RC version I am using. A dream Wedge would be that stuff like Arcade and Gallery etc won't have to be rewritten to accommodate some core change each time there's a revision. That's been a huge headache for me with SMF and the main reason I won't upgrade a well-used board.
I shall continue to be an impossible person as long as those who are now possible remain possible

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Unknown's thoughts on Wedge
« Reply #76, on July 12th, 2011, 05:23 PM »
SMF has had hooks for years, but they were massively crippled prior to SMF 2.0 RC4, as in each hook could literally only do one thing. That was fixed in 2.0 RC4 so hooks could do plenty of things, but there are other limitations that I'm not going to get into at this time.

Part of the problem is that not a lot of people are trying to use the hooks, because a file edit is often easier, but more of the problem is that there aren't enough hooks, meaning that file edits are the only solution, rather than a necessary evil-of-sorts.

Take SimpleDesk 2.0, I spent ages trying to figure out if I could hookify lots of it but in the end I realised that unless I went through an awful lot of pain (and some of the pain I did go through anyway because it wasn't *too* much), you can't do it anyway.

For example, let's say I want to add something to the end of the unread/unreadreplies page, as SD does. Since there's not a hook, the only viable way I could do it was to put a new function in that wraps around the existing unread function, and drops a new template layer in with my new content - with the unread stuff none the wiser. But that's very convoluted and if I didn't already have some new-action processing going on anyway, I wouldn't take that level of effort into it, it's just too much hassle.

If something has a hook that does what you need, great. Trouble is there's a real shortage of hooks - all the login/account creation/activation stuff has hooks, as does new topic, plus some for *really* common areas like permissions, bbc and menus, but other than that you're pretty much on your own - which means file edits are the only alternative.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Nao

  • Dadman with a boy
  • Posts: 16,061
Re: Unknown's thoughts on Wedge
« Reply #77, on July 12th, 2011, 05:31 PM »
Quote from Clara Listensprechen on July 12th, 2011, 05:20 PM
A dream Wedge would be that stuff like Arcade and Gallery etc won't have to be rewritten to accommodate some core change each time there's a revision.
When it comes to the gallery, I see you're using SMF, so you'll definitely to have to upgrade to Aeva Media 1.4 if you want to then be able to import it into your Wedge forum (although TE might wanna support SMG as well, but frankly I wouldn't do it if I were him. There's already a perfectly well written upgrade script in AeMe.)
Plus, I believe there are security issues in SMG that were fixed in AeMe ;)
As for Arcade, it's a big mod AFAIK and I doubt it'll be ported over. At least not easily. Perhaps I could give it a try, but it would have to be BSD'ed first.

Re: Unknown's thoughts on Wedge
« Reply #78, on July 12th, 2011, 05:36 PM »
I see. Well, with the Shoutbox situation I was envisioning editing a file to put hook capability in at the right place and have the thing do what I wanted it to separately, as opposed to coding the function directly into the Shoutbox file, which is what we ended up doing.
Posted: July 12th, 2011, 05:31 PM
Quote from Nao/Gilles on July 12th, 2011, 05:31 PM
Quote from Clara Listensprechen on July 12th, 2011, 05:20 PM
A dream Wedge would be that stuff like Arcade and Gallery etc won't have to be rewritten to accommodate some core change each time there's a revision.
When it comes to the gallery, I see you're using SMF, so you'll definitely to have to upgrade to Aeva Media 1.4 if you want to then be able to import it into your Wedge forum (although TE might wanna support SMG as well, but frankly I wouldn't do it if I were him. There's already a perfectly well written upgrade script in AeMe.)
Plus, I believe there are security issues in SMG that were fixed in AeMe ;)
As for Arcade, it's a big mod AFAIK and I doubt it'll be ported over. At least not easily. Perhaps I could give it a try, but it would have to be BSD'ed first.
When I test-drive Wedge, it's going to be a clean install on a subdomain (eg hxxp:www.hypercrites.org/Test) and I intend to do fresh installs of Gallery and Arcade rather than import. What I mean, though, is that in future versions of Wedge, the Gallery and Arcade (and whatever else I might add) would be able to operate without upgrade or code edits as virtual stand-alones regardless of what I might upgrade the main board to.

This dream might not be realistic from where you're sitting, but it certainly be ideal.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Unknown's thoughts on Wedge
« Reply #79, on July 12th, 2011, 05:38 PM »
Yeah, you could do that. The only problem is, the hook won't do anything.

Remember I said about SMF's limitations? One of the more interesting limitations is that the hooks can only run functions that currently exist. Which means if you have an external file with your hook function in it, you can't use it - unless you load it first. Except there's only three places (IIRC) that a hook will actually be able to load a file for you: once every single page, once inside the admin panel and once inside the profile area.

For the hassle you might as well just edit in the hook point and have it call a function in your existing file - the result is basically the same, and without the overhead of having to ensure it's in the DB.
Quote
I intend to do fresh installs of Gallery and Arcade rather than import.
Good luck trying to install Gallery. Specifically, if it's SMF Gallery Lite/Pro, you are never (EVER) going to see that on Wedge, I guarantee it. (Not only because he won't port it, because of our past dealing with him, I don't really see him being allowed on here much.)

As for AeMe, that's already integrated and going to be *further* integrated.

The other thing is, it's possible we might change the hook functionality in the core - which would necessitate an upgrade of add-ons anyway.

Re: Unknown's thoughts on Wedge
« Reply #80, on July 12th, 2011, 06:41 PM »
Interesting. As it happens, I'm currently using Aeva...and you're right, as I hadn't given the DB a thought and I should have.  Something else I gotta learn, perhaps the hard way like I've been learning everything else about SMF ;) Not having to mess with the DB concerns would be handy indeed.

Thank you very much for this valuable information.