specify in mod template that code should go at end of line?

This forum is now closed as part of retiring phpBB2.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

specify in mod template that code should go at end of line?

Post by asinshesq »

Suppose you're not sure what the end of the line looks like (since it is possible that other mods have changed it from plain unmodded phpbb). Is there a way within the confines of the mod template to indicate after a FIND that you want to add code at the end of the line.

For example, perhaps you could use an in-line after, add without any in-line find? Is the following legitimate?

Code: Select all

#
#-----[ FIND ]------------------------------------------------
# this is a partial search : the full line is longer
blah blah blah

#
#-----[ IN-LINE AFTER, ADD ]-----------------------------------------
#
   blah blah blah
Will easymod know what to do with that?

And as long as I'm asking about easymod and mod templates, let me ask another question: do most people skip lines between mod template commands like this:

Code: Select all

#
#-----[ FIND ]------------------------------------------------
#
blah blah

#
#-----[ AFTER, ADD ]-----------------------------------------
#
blah blah

#
#-----[ FIND ]------------------------------------------------
#
blah blah

#
#-----[ AFTER, ADD ]-----------------------------------------
#
blah blah
Swizec
Former Team Member
Posts: 1701
Joined: Mon Mar 10, 2003 9:42 pm
Location: Slovenia
Contact:

Post by Swizec »

you have to do an IN-LINE FIND before you do an IN-LINE AFTER, ADD

and I usually skip lines after and before MOD commands
asinshesq
Registered User
Posts: 6266
Joined: Sun Feb 22, 2004 9:34 pm
Location: NYC
Name: Alan

Post by asinshesq »

Swizec wrote: you have to do an IN-LINE FIND before you do an IN-LINE AFTER, ADD....

Thanks for the reply. So that means there is no way to specify that the code belongs at the end of the line if you don't already know what the end looks like?
User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Post by Ptirhiik »

- first : no : an INLINE action always occurs after an INLINE, FIND, which always refers to a FIND. BMS, in this situation, I search for ");", or "),", or ";", or whatever could end the line,

- second : IMHO, this shouldn't be accepted at all : empty lines are very important in clarifying the code (and for the code itself when it comes to templates). The "comment" char for mod template is # : let me give you an example :
original :

Code: Select all

$var = anyfunc();
$var += $anyvalue;
Destination :

Code: Select all

$var = anyfunc();

// now we are going to do a complex process
$anyvalue += 1;

$var += $anyvalue;
Well, I don't know how to code this with easyMOD (honnestly, I think it is not possible), but the correct use of the mod template would be :

Code: Select all

#
#---[ FIND ]-----------
#
$var = anyfunc();
#
#---[ AFTER, ADD ]---------
#

// now we are going to do a complex process
$anyvalue += 1;

#
#---[ FIND ]-----
ect.
Post Reply

Return to “[2.0.x] MOD Writers Discussion”