News:

Wondering if this will always be free?  See why free is better.

Main Menu

Can I get help or information on creating a Mod

Started by Captain_Morrigan, April 26, 2006, 04:29:53 PM

Previous topic - Next topic

Captain_Morrigan

These are the things I need my first mod to do:

It's going to diplay in the Display.template.php under the Avatar as a link to a popup window.
The popup window will display a table of the users awards.
In the Profile there will be a link to this same popup.
The same user can have multiple awards (like Member of the Month, Best Avatar etc...)
In the Admin center you have a way to upload the image for the ward and put the information in, this can be done by showing the member list and searching for members.
You can add awards in the members profile.
You can add the same award to multiple members.

My main needs for help:
What files do I edit or need to make to pull the information? (By this I mean the Database query not the files for the display or the profile)
Will I need to add a new table?
What Admin files do I need to edit to add the link so I can access it through the admin panel?
What coding can I use to show the memberlist to be able to add and the find members thing?
I know I'll need to write a code to submit it to the database so where would I put it? (ie, Sources or Sources/awards ...)

Any other assistance would be awesome.

Yes I know about the Mod that shows an award similar to this but that is per user and you can only have one award and you can't put images. I also find it limited because if it is a Member of the month thing then I have to have to remove that on a monthly basis and that person no longer gets recognized.

Thanks in advance for help.

Captain_Morrigan

#1
I did forget one more thing:
Which file do I add the action to so when I refer to the popup it will be http://url.com/index.php?action=award so it pops the award.template.php into the window instead of the entire forum?

Edit:
I went to this topic:
http://www.simplemachines.org/community/index.php?topic=7703.0
And it has the help I need but I can't download the text files can someone either PM me the Text files (not as an attachment) or email them to me I'd appreciate it. This will help me in my process of doing things, thank you.

Captain_Morrigan

#2
Ok I have the files now but when I try to do what it's asking I'm not getting what I need.

Everytime I add the coding to show a template it gives me an error.

I type in:

$settings['catch_action'] = array('sub_template' => 'action_wrap');
}

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

if (@$_REQUEST['action'] == 'award')
template_awards();
}


I get this error:
Fatal error: Call to undefined function template_awards() in /home/morrigan/public_html/test/Sources/Load.php(1607) : eval()'d code on line 68

I get similar errors for trying the catch thing as well. I'm also looking for it not to load the header so you can just view the awards. Any help would be fabulous.

EDIT: I fixed it, I found my problem for this post only.

Captain_Morrigan

I still can't figure out to unwrapper the awards screen, if I use a template or a subtemplate it still shows the header and footer, should I put a redirect to the exact template page?

jerm

#4
im not really sure where you are at with this mod.. heres a link for you:
http://www.simplemachines.org/community/index.php?topic=23864.0
look in the tips and tricks area.. it will help

and are you coding all this in the Load.php file?

Captain_Morrigan

#5
I'll look at it but I haven't messed with Sources files yet, I don't want to mess them up.

I've added the popup link and that's about it.

That file only moderately helps me, not very much unfortunately. >_<

jerm

just backup everything
i suggest not deleting code, but commenting it out so that you can easily revert back to the old code
the first mod is hard, but once you get the hang of it, it comes easier :)

Captain_Morrigan

Yeah, I'm a spaz about broken code I always copy the working code and paste it back in when I get an error and look for the error before trying again. It's good it's a test forum that I installed though, just for that purpose. I hope I do things Right, I know what I want at least.

Captain_Morrigan

Well I'm going to break for the night but do post your help if you guys can. I so far have done:
The popup
The screen shows the correct information (no wrapper on it)

What I'm working on:
The query information to pull the awards for that person down.

What I will work on next
The Admin area
The Profile area
The upload of images to the server.

Advertisement: