Welcome Guest, Not a member yet? Register   Sign In
Template Parser Class Improvement
#13

[eluser]adamp1[/eluser]
What that line does is as follows.

It looks for all variable pair tags which have not been used and deletes all the content between them. For example:
Code:
{code}
  Line: {line}
{/code}
If the above was not parsed then it would remove everything between the {code}..{/code}. This is needed since otherwise if the user implements recurring content like above but dosn't set any data for it then only the variable tags will be removed and not inner text. For example:

Say we have the same code as above, but we remove the line you mention and make the following str_replace accept the '/' char as well. Then the following would occur.
Code:
Line:

As you can see all tags would be removed but that 'Line:' should also not be there since it was part of the {code} tags.

Im taking it that the reason nothing is outputted in your solution is that your conditional method does not remove the {if} tags around the content and is relying on mine to do this. But mine assumes that any tags left at this point are not wanted and removes all.

The only way to solve this is either make your conditional method remove the {if} tags before passing output back OR make my replace statement far more complex. Personally I would go with the first. It then separates the two different options so people arn't forced to have both.


Messages In This Thread
Template Parser Class Improvement - by El Forum - 01-14-2008, 01:24 PM
Template Parser Class Improvement - by El Forum - 01-14-2008, 01:29 PM
Template Parser Class Improvement - by El Forum - 01-14-2008, 02:15 PM
Template Parser Class Improvement - by El Forum - 01-14-2008, 04:47 PM
Template Parser Class Improvement - by El Forum - 01-14-2008, 05:08 PM
Template Parser Class Improvement - by El Forum - 01-15-2008, 05:16 AM
Template Parser Class Improvement - by El Forum - 01-18-2008, 06:14 AM
Template Parser Class Improvement - by El Forum - 01-18-2008, 07:59 AM
Template Parser Class Improvement - by El Forum - 01-19-2008, 03:12 AM
Template Parser Class Improvement - by El Forum - 01-20-2008, 03:59 PM
Template Parser Class Improvement - by El Forum - 01-20-2008, 04:30 PM
Template Parser Class Improvement - by El Forum - 01-20-2008, 05:07 PM
Template Parser Class Improvement - by El Forum - 01-20-2008, 05:22 PM
Template Parser Class Improvement - by El Forum - 01-20-2008, 05:32 PM
Template Parser Class Improvement - by El Forum - 01-20-2008, 05:55 PM
Template Parser Class Improvement - by El Forum - 01-20-2008, 07:04 PM
Template Parser Class Improvement - by El Forum - 01-21-2008, 03:48 AM
Template Parser Class Improvement - by El Forum - 01-21-2008, 09:37 AM
Template Parser Class Improvement - by El Forum - 02-18-2008, 10:58 PM
Template Parser Class Improvement - by El Forum - 02-18-2008, 11:08 PM
Template Parser Class Improvement - by El Forum - 02-19-2008, 12:05 AM
Template Parser Class Improvement - by El Forum - 02-19-2008, 12:23 AM
Template Parser Class Improvement - by El Forum - 03-14-2008, 08:26 AM
Template Parser Class Improvement - by El Forum - 03-14-2008, 09:50 AM
Template Parser Class Improvement - by El Forum - 03-14-2008, 09:51 AM
Template Parser Class Improvement - by El Forum - 03-14-2008, 06:01 PM
Template Parser Class Improvement - by El Forum - 05-05-2008, 05:45 AM
Template Parser Class Improvement - by El Forum - 05-05-2008, 05:59 AM
Template Parser Class Improvement - by El Forum - 05-05-2008, 06:02 AM
Template Parser Class Improvement - by El Forum - 05-05-2008, 06:36 AM
Template Parser Class Improvement - by El Forum - 05-05-2008, 06:53 AM
Template Parser Class Improvement - by El Forum - 05-05-2008, 06:55 AM
Template Parser Class Improvement - by El Forum - 05-06-2008, 04:01 AM
Template Parser Class Improvement - by El Forum - 05-06-2008, 04:14 AM
Template Parser Class Improvement - by El Forum - 05-06-2008, 04:25 AM
Template Parser Class Improvement - by El Forum - 05-06-2008, 05:15 AM
Template Parser Class Improvement - by El Forum - 05-06-2008, 09:58 AM
Template Parser Class Improvement - by El Forum - 05-06-2008, 10:10 AM
Template Parser Class Improvement - by El Forum - 05-06-2008, 11:34 AM
Template Parser Class Improvement - by El Forum - 05-07-2008, 10:55 AM
Template Parser Class Improvement - by El Forum - 05-07-2008, 11:08 AM
Template Parser Class Improvement - by El Forum - 05-07-2008, 11:26 AM
Template Parser Class Improvement - by El Forum - 05-25-2008, 09:24 AM
Template Parser Class Improvement - by El Forum - 05-25-2008, 09:32 AM
Template Parser Class Improvement - by El Forum - 05-25-2008, 01:11 PM
Template Parser Class Improvement - by El Forum - 05-29-2008, 02:19 PM
Template Parser Class Improvement - by El Forum - 06-22-2008, 12:00 AM
Template Parser Class Improvement - by El Forum - 08-15-2008, 10:44 PM
Template Parser Class Improvement - by El Forum - 08-16-2008, 07:26 AM
Template Parser Class Improvement - by El Forum - 08-16-2008, 07:39 AM
Template Parser Class Improvement - by El Forum - 11-10-2009, 02:29 PM
Template Parser Class Improvement - by El Forum - 05-01-2010, 01:23 PM
Template Parser Class Improvement - by El Forum - 05-03-2010, 06:57 PM
Template Parser Class Improvement - by El Forum - 06-02-2010, 02:18 PM
Template Parser Class Improvement - by El Forum - 10-26-2010, 12:12 PM
Template Parser Class Improvement - by El Forum - 10-27-2010, 12:02 AM
Template Parser Class Improvement - by El Forum - 10-27-2010, 08:49 AM
Template Parser Class Improvement - by El Forum - 01-14-2011, 02:00 PM
Template Parser Class Improvement - by El Forum - 03-09-2011, 02:25 AM
Template Parser Class Improvement - by El Forum - 03-25-2011, 12:52 AM
Template Parser Class Improvement - by El Forum - 04-03-2011, 10:06 AM
Template Parser Class Improvement - by El Forum - 04-06-2011, 01:43 AM
Template Parser Class Improvement - by El Forum - 04-06-2011, 06:18 AM
Template Parser Class Improvement - by El Forum - 04-06-2011, 09:08 AM
Template Parser Class Improvement - by El Forum - 04-06-2011, 09:42 AM
Template Parser Class Improvement - by El Forum - 04-06-2011, 10:25 AM
Template Parser Class Improvement - by El Forum - 04-06-2011, 10:41 AM
Template Parser Class Improvement - by El Forum - 04-09-2011, 03:00 AM
Template Parser Class Improvement - by El Forum - 04-09-2011, 07:23 AM
Template Parser Class Improvement - by El Forum - 07-22-2011, 05:45 AM
Template Parser Class Improvement - by El Forum - 02-23-2012, 06:08 AM
Template Parser Class Improvement - by El Forum - 02-23-2012, 04:48 PM
Template Parser Class Improvement - by El Forum - 02-28-2012, 04:00 AM
Template Parser Class Improvement - by El Forum - 03-20-2012, 03:03 AM
Template Parser Class Improvement - by El Forum - 04-05-2012, 08:40 AM
Template Parser Class Improvement - by El Forum - 09-12-2012, 02:13 PM
Template Parser Class Improvement - by El Forum - 10-22-2012, 04:56 PM
Template Parser Class Improvement - by El Forum - 10-22-2012, 06:03 PM
Template Parser Class Improvement - by El Forum - 12-03-2012, 05:44 AM
Template Parser Class Improvement - by El Forum - 06-27-2014, 12:04 AM
Template Parser Class Improvement - by El Forum - 06-29-2014, 09:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB