Add <if condition> </if> to my PHP template class

Fertiggestellt Veröffentlicht Aug 28, 2005 Bezahlt bei Lieferung
Fertiggestellt Bezahlt bei Lieferung

I have a template class that is used to load HTML files and parse them via template class using PHP.

Within the html templates, I want to be able to define logic (using <if condition=""> </if> in my html code to be parsed by my template system.

Example usage:

<if condition="$userid > 0">

Welcome back user!

<else />

Welcome guest

</if>

Another example:

<if condition="$userid > 0">

Welcome User!

</if>

At the moment, we have if conditions working, but it's very inconsistant. There is a preg_replace() function being used and it works, but most of the time it crashes apache and doesn't even produce a warning or error notice (just shows a blank page as if apache crashes). The old developer mentioned that preg_replace() can handle 64K of code and I think this is the problem.

Task involves either:

1. Rewrite the existing function we have now so apache does not crash

2. Use an alternative method of this function perhaps without the usage of preg_replace() (maybe strpos() and find all '<if condition="">' blocks and parse them using your own method

The argument supplied to the if condition template statement would be a global variable. Ie: $userid is a global

<if condition="$userid > 0">

Welcome User!

</if>

You will need to apply this format <if condition=""></if>

and

<if condition=""><else /></if>

We are looking to get this going ASAP.

## Deliverables

1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.

2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):

a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.

b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.

3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).

## Platform

Linux or Windows

Ingenieurwesen MySQL PHP Softwarearchitektur Testen von Software

Projekt-ID: #3870727

Über das Projekt

5 Vorschläge Remote Projekt Aktiv Aug 30, 2005

Vergeben an:

slawekp

See private message.

$23.8 USD in 3 Tagen
(39 Bewertungen)
5.0

5 Freelancer bieten im Durchschnitt $31 für diesen Job

vw1389508vw

See private message.

$29.75 USD in 3 Tagen
(13 Bewertungen)
2.6
slavazanko

See private message.

$25.5 USD in 3 Tagen
(4 Bewertungen)
2.1
xenontheblue

See private message.

$34 USD in 3 Tagen
(0 Bewertungen)
0.0
imnetvw

See private message.

$42.5 USD in 3 Tagen
(0 Bewertungen)
0.0