Page 1 of 1

SMF code - Is it just me or they are nuts over there?

Posted: Sun Oct 01, 2006 1:58 am
by Oren
Here is some of the SMF code:

Code: Select all

function template_menu()
{
	global $context, $settings, $options, $scripturl, $txt;

	// Show the [home] and [help] buttons.
	echo '
		<a href="', $scripturl, '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/home.gif" alt="' . $txt[103] . '" style="margin: 2px 0;" border="0" />' : $txt[103]), '</a>', $context['menu_separator'], '
		<a href="', $scripturl, '?action=help" target="_blank">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/help.gif" alt="' . $txt[119] . '" style="margin: 2px 0;" border="0" />' : $txt[119]), '</a>', $context['menu_separator'];

.
.
.

}
Now here is my question:

Is there a reasonable reason as to why each time they print a link, they check $settings['use_image_buttons'] instead of checking it only once and then print the data accordingly?

I don't know, maybe there is some good reason that the ones who are more familiar with SMF aware of. Otherwise, I would have to say that the SMF programmers are nuts :?

Edit: I hope this is the right forum :P

Posted: Sun Oct 01, 2006 2:55 am
by Christopher
The code looks pretty old school. The certainly could use one if(). It is probably jsut cruft. Globals ... yuck.

Posted: Sun Oct 01, 2006 3:10 am
by Oren
arborint wrote:The code looks pretty old school. The certainly could use one if(). It is probably jsut cruft. Globals ... yuck.
Yeah, exactly what I thought, but I had to make sure and double check before I decide not to go with SMF just because of few lines.
The problem is, what forum should I go with? I check all the big ones and again and again I get frustrated from their crappy code :roll:

Posted: Sun Oct 01, 2006 6:25 am
by Weirdan
FUDForum is rumored to be very solid codebase. Haven't seen it personally, though.

Posted: Sun Oct 01, 2006 6:27 am
by Oren
Weirdan wrote:FUDForum is rumored to be very solid codebase. Haven't seen it personally, though.
Thanks, I'll check it out.

Posted: Mon Oct 02, 2006 7:55 am
by Jenk
Form my brief look at the Vanilla code base, it too looks quite solid, even if it is lacking comments.

Posted: Mon Oct 02, 2006 9:10 am
by Ambush Commander
I've been using Vanilla, and note that Vanilla is also lacking features. Although... much of it can be alleviated by plugins. I've had trouble, however, trying to understand their architecture (but it's probably just me).

Posted: Mon Oct 02, 2006 11:13 am
by Oren
Thanks for your replies guys. I tried FUDForum and Vanilla... I think I will be using Vanilla, but now I'm not sure after reading Ambush Commander's post.
Any other comments about Vanilla?

Posted: Mon Oct 02, 2006 11:20 am
by Ambush Commander
A few more comments then. Vanilla doesn't have formatting built-in: i.e. no BBCode or nothing. It's real easy to add it in, but it does say something about the developer's mindset: absolute simplicity. The layout is very spiffy and degrades reasonably without CSS (although it could have been better). By default, people have to "apply for membership", which probably does help against spambots but also can be quite a turn-off to new members, here's quote:
This membership application form does not grant immediate access to the site. All membership applications are reviewed by an administrator before acceptance. You are not guaranteed access to the application by filling out this form.
You can make registration automatic with a quick setting change, but I still need to change that extremely unfriendly message.

Finally, there's an interesting de-emphasis of categories in favor of "all topics." The default view will lead you to an all discussions page, and you have to actually click "Categories" to browse the categories.

That's about all I have to say.

Posted: Fri Oct 06, 2006 1:06 am
by RobertGonzalez
UseBB looks like a decent forum (for use, I haven't seen the code base). I know there have been several threads about forum software and a lot of people have offered several suggestions on forum software within those threads.