Welcome, Guest. Please Login or Register.
May 10, 2025, 12:14:37 PM
Home Help Search Log in Register
News: SMF is the next generation in forum software, almost completely re-written from the ground up, make sure you don't fall for cheap imitations that suffer from feature bloat!

YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  More questions on writing a mod! « previous next »
Pages: [1] Reply Ignore Print
Author Topic: More questions on writing a mod!  (Read 433 times)
Michele
Beta Tester
YaBB God
*****
Posts: 584


I can't wait for YaBB SE 2!

Mad+Moya WWW
More questions on writing a mod!
« on: January 20, 2003, 12:27:23 AM »
Reply with quote

I've just written a FAQ mod for YaBB SE, but I'm having trouble deciding how to modify certain files in it.

First, I need to add a few lines to index.php in the $actionArray = array section. Do I just add them at the end, before if (isset($actionArray[$action])), or do I try to insert them alphabetically (which would be a PITA if other mods had already added to it).

And what about the language files? How do I handle that? Would I just use the english.lng file, since I don't know how to translate it to others? And do I use the $txt[123] format, which seems tricky if other mods do that, or (I expect), I do my own $txt[faq1] type of text. And then do I just tack on my menu gif in the $img section too?

And with the template_header in subs.php, if I want to add my mod to the yymenu, what do I look for? It seems like others might add their stuff too, so where is it safe to add mine?

And where would I add the FAQ Admin functions to the Admin Center? It really wouldn't work in the Installed Mods, since I need several pages for adding, editing and deleting categories and Q&As. I'd like to just add a link to adminfaq.php to the main section, probably in the Forum Controls area.

I've actually written the working code into two separate php files (one for visitors, one for admin), so I wouldn't mess with the YaBB SE files too much. But I still need to affect a lot of them with all these little extras.

So... are there any standards on where I put my info in those above files without screwing up other mods or YaBB SE itself?

Thanks, Mad Moya
Logged

formerly Mad Moya
PfaBB - http://pfabb.lunabyte.com
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:More questions on writing a mod!
« Reply #1 on: January 20, 2003, 12:40:08 AM »
Reply with quote

Alright... I'm gonna brake each paragraph up to make it easier.

#1.
It doesn't really matter if it's alphabetic or not... I would:
<search>
      'editpoll2' => array("$sourcedir/Poll.php", 'EditPoll2'),
</search>

<add after>
      'faq' => array("$sourcedir/FAQ.php", 'FAQ'),
</add after>

#2.
Use english.lng... if someone translates it, you can add other .lng files too..
A really easy way to do it is to search for the $locale = 'en_US'; line and add after it.
Use $txt['faq00'] so on... that's the standard way.
For menu, add it in (I assume you added it in Subs.php) to both the text and image sections.

#3.
Look for $yymenu and add to it.

#4.
I would just add it in, like you said... that should work fine.

Just try to make sure you don't change too much that is important.... for example, don't change the $locale = 'en_US'; to $locale = ('en_US'); - that will brake some mods.

Hope I was helpful,
-[Unknown]
« Last Edit: January 20, 2003, 12:40:36 AM by [Unknown] » Logged
Michele
Beta Tester
YaBB God
*****
Posts: 584


I can't wait for YaBB SE 2!

Mad+Moya WWW
Re:More questions on writing a mod!
« Reply #2 on: January 20, 2003, 12:58:32 AM »
Reply with quote

For #1, I actually have to add 10 options in there... I tried consolidating them more, but just couldn't figure out how. :) But if someone adds 'editrpg' after 'editpoll2' or something, my 'faq' stuff still wouldn't be alphabetical...

For #3, I know where yymenu is, but the question is, where in that section would I add my little bit of it? Would I add it above if ($settings[7] == 'Administrator') ? If I tried to add it directly to the first $yymenu=string, the 'string' might have been changed by other mods already.

Thanks! MM
Logged

formerly Mad Moya
PfaBB - http://pfabb.lunabyte.com
[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:More questions on writing a mod!
« Reply #3 on: January 20, 2003, 01:08:30 AM »
Reply with quote

Just add:
$yymenu .= 'blah blah blah';
Somewhere.... where ever you want it in the menu (inbetween whichever lines...)

And, like I said, it doesn't matter whether or not it's alphabetical...

-[Unknown]
Logged
Michele
Beta Tester
YaBB God
*****
Posts: 584


I can't wait for YaBB SE 2!

Mad+Moya WWW
Re:More questions on writing a mod!
« Reply #4 on: January 20, 2003, 01:11:43 AM »
Reply with quote

Dang, forgot about the .= function! LOL

Thanks, MM
Logged

formerly Mad Moya
PfaBB - http://pfabb.lunabyte.com
Michele
Beta Tester
YaBB God
*****
Posts: 584


I can't wait for YaBB SE 2!

Mad+Moya WWW
Re:More questions on writing a mod!
« Reply #5 on: January 20, 2003, 09:47:35 PM »
Reply with quote

Ok, a few more questions...

I need to add two tables with fields into the database. I have a standard .sql file with the two queries. How/where do I get them inserted into the db?

Do I use the Create YaBBPak function in v1.5.x? Does it work properly now?

Basically I need to change 3 files (index.php, english.lng, and subs.php), add 2 files to the Sources directory, add one gif to the YaBBImages directory, plus create two tables in the database. The <before> <after> stuff doesn't seem to hard, but I'm otherwise lost on the rest... sigh.

Thanks, MM
Logged

formerly Mad Moya
PfaBB - http://pfabb.lunabyte.com
David
Destroyer Dave
Global Moderator
YaBB God
*****
Posts: 5761


I'm not a llama!

WWW
Re:More questions on writing a mod!
« Reply #6 on: January 20, 2003, 10:41:02 PM »
Reply with quote

See the first post here for dbmod.
http://www.yabbse.org/community/index.php?board=134;action=display;threadid=4653
Logged

[Unknown]
Global Moderator
YaBB God
*****
Posts: 7830


ICQ - 179721867unknownbrackets@hotmail.com WWW
Re:More questions on writing a mod!
« Reply #7 on: January 20, 2003, 11:22:50 PM »
Reply with quote

Man, I really do need to clean up my YaBBpak maker and release it.... it makes the process much easier.

-[Unknown]
Logged
Michele
Beta Tester
YaBB God
*****
Posts: 584


I can't wait for YaBB SE 2!

Mad+Moya WWW
Re:More questions on writing a mod!
« Reply #8 on: January 20, 2003, 11:33:52 PM »
Reply with quote

Please do Unknown! And I'll even send you all my mod files and changes so you can test it with that... then I won't have to figure out how to do it all. :)

Thanks, MM
Logged

formerly Mad Moya
PfaBB - http://pfabb.lunabyte.com
Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Mod Ideas and Creation  |  More questions on writing a mod! « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.023 seconds with 21 queries.