problem with creating a mod....

Started by Leipe Po, May 18, 2006, 05:02:30 AM

Previous topic - Next topic

Leipe Po

hey everyone... me again  :D

i am creating a mod, but ther is some minor problem,
one of the first i'm thinking of is te following:

When somebody is gonna install the mod, it addes something to the following code:

(code snippet from index.template)

if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
$current_action = $context['current_action'];



now, when making the package, would i just FIND the code and REPLACE it with the new code(then if  any other mod's modefied that code thay are broken), or should i FIND that code and use ADD BEFORE or a ADD AFTER 'search',
statement.

the rest will be taken care of later, this is the one that most puzzeled me...

if anyone would be able to help, i would apreciate it!!!  :)

cheers



There is only one thing more importend to me then coding:
My Girlfriend

Microsoft - "You've got questions.  We've got dancing paperclips."

Dannii

Well what changes to do you want to make?
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Leipe Po

well its for the bookmark mod i'm creating for smf,

i want to add 'bookmarks' to that array, now if i replace that whole code, it can messup other mods installed that use that code... but i dont know i i can use add after, or add bofore instead of replace...
There is only one thing more importend to me then coding:
My Girlfriend

Microsoft - "You've got questions.  We've got dancing paperclips."

Dannii

Well you could do add after if you were careful with your linebreaks, but it's probably easiest to use replace.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Leipe Po

ok thanks for your advice, ill will first to to use add after before using replace, dont want my mod disableing other mods
There is only one thing more importend to me then coding:
My Girlfriend

Microsoft - "You've got questions.  We've got dancing paperclips."

Dannii

It won't make a difference to other mods which you use.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

Advertisement: