Advertisement:

Indicate Section of Code That is a Mod

Aloittaja heavyccasey, joulukuu 02, 2007, 07:09:48 IP

« edellinen - seuraava »

heavyccasey

I suggest that when SMF installs mods, SMF automatically adds a comment before and after an added snippet of code. For example:

Original Code:
$blah = 'foobar? What does that mean?';

Add After:
$second = 'Hi, this is just random';

Final Result:
$blah = 'foobar? What does that mean?';
// Start of the ABC Mod
$second = 'Hi, this is just random';
// End of the ABC Mod


The only problem I see is that the mod could be editing HTML code, in which "//" is not a comment.

Rudolf

This should be the job of the mod creator.
I always put my additions between such comments, like this:

Koodi (PHP) [Valitse]

one line addition // ABC Mod -



Koodi (PHP) [Valitse]

// ABC Mod - START
multiple line addition
// ABC Mod - END


Koodi (HTML) [Valitse]

<!-- // ABC Mod - START -->
some html code
<!-- // ABC Mod - END -->


Koodi (CSS) [Valitse]

/* // ABC Mod - START */
some css code
/* // ABC Mod - END */


So mostly you just have to search for // ABC mod to find where are the changes.

You can't always make this automatic.
I will update all my mods in the next few weeks. Thanks for your patience.

SVG-Collapse (you need an SVG compliant browser)

Thantos

I agree that the mod author should add any needed comments.  Since the package manager can edit anything in the file it would be impossible to do this.  The code could be in a query, in PHP, part of the HTML output, in a JS file, etc.

Advertisement: