IN-LINE FIND, ADD multiline

Want to share what MODs you've gotten to work with EM? Happy about all the time your're saving? Want to say "thanks"? Here's the place.
Forum rules
DO NOT give out any FTP passwords to anyone! There is no reason to do so! If you need help badly enough, create a temporary FTP account that is restricted to only the files that you need help with and give the information for that. Giving out FTP information can be very dangerous!
Locked
Xore
Registered User
Posts: 80
Joined: Mon Jul 21, 2003 11:44 pm
Location: The desert
Contact:

IN-LINE FIND, ADD multiline

Post by Xore »

Hopefully this isn't off topic, and not already brought up.

Is EM ok with doing an IN-LINE FIND, then a mutlitline IN-LINE (AFTER/BEFORE), ADD?

ie,

Code: Select all

######################################
# This is just a test, please don't use it on your forum  ;-)
######################################
#
#--[IN-LINE FIND]--
#
blah
#
#--[ IN-LINE AFTER, ADD ]---
#
blah1 somestuff
<!-- BEGIN somestuff -->
morestuff
<!-- END somestuff -->
blah someotherstuffalso
#
#-- [EOM]--
#
if so, then i can replace my ugliest template FIND/REPLACE with some IN-LINE functionality...
User avatar
A_Jelly_Doughnut
Registered User
Posts: 1780
Joined: Wed Jun 04, 2003 4:23 pm

Re: IN-LINE FIND, ADD multiline

Post by A_Jelly_Doughnut »

Nuttzy mentioned this in one of the threads in the Author Support Forum. Basically, no, because that isn't in line.
A_Jelly_Doughnut
User avatar
GPHemsley
Registered User
Posts: 1617
Joined: Fri Apr 18, 2003 4:01 am
Location: Long Beach, NY
Contact:

Re: IN-LINE FIND, ADD multiline

Post by GPHemsley »

A_Jelly_Doughnut wrote:Basically, no, because that isn't in line.
Even though it should be. :P
User avatar
A_Jelly_Doughnut
Registered User
Posts: 1780
Joined: Wed Jun 04, 2003 4:23 pm

Re: IN-LINE FIND, ADD multiline

Post by A_Jelly_Doughnut »

I'll explain a bit more. phpbb.com's support forum is slow ATM. :P

So basicaly that would be just vanilla FIND and AFTER, ADD. The idea or IN-LINE is to find something on a line, and within that line, add something new. This is useful for SQL queries and HTML attributes. Most code does not require this kind of placement, though. Thus, adding multiple lines with an inline add is illogicall.
A_Jelly_Doughnut
User avatar
GPHemsley
Registered User
Posts: 1617
Joined: Fri Apr 18, 2003 4:01 am
Location: Long Beach, NY
Contact:

Re: IN-LINE FIND, ADD multiline

Post by GPHemsley »

A_Jelly_Doughnut wrote:Thus, adding multiple lines with an inline add is illogicall.
Not really. What if you have to add multiple lines in the middle of a line? Xore's example is perfect. The way phpBB templates are written, there are things like </td> on the same line as the text that it contains. If you need to add multiple lines before the </td>, it's pretty much impossible without doing a replace.
Nuttzy99
Registered User
Posts: 927
Joined: Fri Aug 03, 2001 7:09 am
Contact:

Re: IN-LINE FIND, ADD multiline

Post by Nuttzy99 »

Can't comment for long, but this is a definite NO-NO. This will become VERY apparent even with just the first things I post up tonight.

FYI, one of the things added to the list was inserting a line break into a line ;)

-Nuttzy :cool:
SpellingCow.com - Free spell check service for your forums or any web form!
My Other Site
Xore
Registered User
Posts: 80
Joined: Mon Jul 21, 2003 11:44 pm
Location: The desert
Contact:

Re: IN-LINE FIND, ADD multiline

Post by Xore »

ok, i guess the balance is, which is worse? my suggestion, or doing a FIND, REPLACE on the entire line

it's been said several times that my FIND, REPLACE in a certain instance is rather... brutal... this was just an alternative possibility... it would be nice if the <!-- BEGIN --> and <!-- END --> tags could be on a line with other things...

i've even looked seriously into editing template.php to be able to add an assign_block_var_from_handle just to avoid this.

(btw, i'm wounded by the fact that the block_vars functionality is so grieviously crippled by not being able to make multiple calls to it surpressing new iterations, as well as the aforementioned lack of assigning from handle... ) .. i haven't had the opportunity to check does anyone know (offhand) if this functionality will be included in phpbb22 ?
Xore
Registered User
Posts: 80
Joined: Mon Jul 21, 2003 11:44 pm
Location: The desert
Contact:

Re: IN-LINE FIND, ADD multiline

Post by Xore »

Well, i went out and coded it.

:roll:

http://www.phpbb.com/phpBB/viewtopic.php?t=132888" target="_blank

opinions anyone?
Nuttzy99
Registered User
Posts: 927
Joined: Fri Aug 03, 2001 7:09 am
Contact:

Re: IN-LINE FIND, ADD multiline

Post by Nuttzy99 »

All I can say is that I do plan to address this issue and I hope to do this soon. However I would like to address it on my own time table b/c the issue does intersect with a few others. Right now I'm liking the idea of just inserting a line break using an IN-LINE command and then using a straight AFTER, ADD to do whatever else you need. I don't like the idea of breaking convention that IN-LINE is for single line manipulation.

But I'm open to alterante thinking b/c I've had to deal too many times with people that aren't. I should have this issues addressed within the week. I'm hoping to have all EMC done this week, but these things have a habit of taking 10 times longer than you expect :P

-Nuttzy :cool:
SpellingCow.com - Free spell check service for your forums or any web form!
My Other Site
LLKwerv
Registered User
Posts: 81
Joined: Mon May 26, 2003 5:27 pm
Location: Wherever I am.
Contact:

Re: IN-LINE FIND, ADD multiline

Post by LLKwerv »

How about this:

Code: Select all

#
#---------[ FIND ]------------------------
#
yes no maybe

#
#----------[ IN-LINE FIND ]--------------
#
no

#
#----------[ IN-LINE AFTER, ADD ]-----
#

123\n456\n789
Note the \n.
Will this work?
hello
Locked