php-general Digest 6 Nov 2005 20:00:31 -0000 Issue 3779
Topics (messages 225202 through 225209):
phpmyadmin problems with quoting exported text
225202 by: Chris W
Re: Template style question
225203 by: Petr Smith
225204 by: Torgny Bjers
225208 by: Robert Cummings
Re: Register Globals (more)
225205 by: Jochem Maas
225206 by: Jochem Maas
filemtime doesn't always copy correctly
225207 by: David T. Kotchen
italic, bold and underline with GD ?
225209 by: David
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
I just tried to use the output of the export function on phpmyadmin and
got a million errors. After looking at the file I found that certain
columns that are strings were not quoted at all. I can't find any
reason why some are and some are not quoted. Anyone have any idea why
this is happening?
--
Chris W
KE5GIX
Gift Giving Made Easy
Get the gifts you want &
give the gifts they want
One stop wish list for any gift,
from anywhere, for any occasion!
http://thewishzone.com
--- End Message ---
--- Begin Message ---
Smarty sucks. Mixing presentation and logic is never good idea. I know
Smarty is very popular, but big popularity doesn't always mean quality.
Back to original question: If you decided to reinvent the wheel, please
don't reinvent square wheel without tire.
Mixing presentation and logic is bad. You should have no sqls, loops,
ifs or any other logic things in templates. Templates should be editable
by any stupid guy, anyone who knows just css/html. No sql, no php, no
other language.
Back to original idea to parse table. Do not copy bad ideas from other
templating engines. Again - reinvent a better wheel or use some from
1000s of existing libraries. Download some existing libraries, think
about good and bad things, make it better, make it different! Otherwise
we will end with 1000+1 stupid, same, useless templating libraries.
Petr
James Benson wrote:
Give smarty a try rather than re-inventing the wheel
http://smarty.php.net
--- End Message ---
--- Begin Message ---
Petr Smith wrote:
> Smarty sucks. Mixing presentation and logic is never good idea. I know
> Smarty is very popular, but big popularity doesn't always mean quality.
>
> Back to original question: If you decided to reinvent the wheel,
> please don't reinvent square wheel without tire.
>
> Mixing presentation and logic is bad. You should have no sqls, loops,
> ifs or any other logic things in templates. Templates should be
> editable by any stupid guy, anyone who knows just css/html. No sql, no
> php, no other language.
>
> Back to original idea to parse table. Do not copy bad ideas from other
> templating engines. Again - reinvent a better wheel or use some from
> 1000s of existing libraries. Download some existing libraries, think
> about good and bad things, make it better, make it different!
> Otherwise we will end with 1000+1 stupid, same, useless templating
> libraries.
You don't need to mix presentation and logic with Smarty. If you create
your custom tags with Smarty and use these instead of having the inline
"Smarty PHP" code, you'll have separated them just fine. Then if the end
user wants to use PHP inline, fine, either let them, or don't. Either
way, Smarty is about the fastest and most versatile engine in the PEAR
library, as far as I know. I'd rather use that, than build something
custom from scratch. And, in combination with Tidy and Cache_Lite,
you'll get a very fast and precise rendering engine...
Just my $0.02.
Regards,
Torgny
--- End Message ---
--- Begin Message ---
On Sun, 2005-11-06 at 05:11, Petr Smith wrote:
> Smarty sucks. Mixing presentation and logic is never good idea. I know
> Smarty is very popular, but big popularity doesn't always mean quality.
>
> Back to original question: If you decided to reinvent the wheel, please
> don't reinvent square wheel without tire.
>
> Mixing presentation and logic is bad. You should have no sqls, loops,
> ifs or any other logic things in templates. Templates should be editable
> by any stupid guy, anyone who knows just css/html. No sql, no php, no
> other language.
While I'm not a particularly great fan of Smarty myself (preferring pull
versus push systems), I don't think that support for conditionals and
loops within a templating system is a bad thing provided that such loops
and conditionals are restricted to use for presentation logic only.
To create a template system that only resembles HTML/CSS I think would
put an extraneous burden on the developer since they are the one that
would have to define/manage the unrolling of iterative data in such a
way as to make it invisible to the template designer.
Additionally, there's no way it could be entirely like CSS/HTML since at
some point you need to place markers for the content to be expanded, and
no matter how you slice the problem, those markers aren't going to be
HTML. They might be HTMLish (a la XML) but they won't be HTML.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
John Taylor-Johnston wrote:
Patience please :)
See my html below. Basically, if type=checkbox is checked, I'm trying to
build $to string in mail().
parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING
or T_VARIABLE or T_NUM_STRING line 4
How do I rebuild this peice of code to be register_globals=off friendly?
Just when I thought I was getting good. This keeps up, I'm changing back
the php.ini myself.
John
stop using eval()! (you know the film SAW? well it's people
who use too much eval() that end up chained to the raditator)
also find out what the difference is betwewen using single
and double quotes.
also learn how/why to use isset(), and initializing your variables
before using them...
now look at this, I'm pretty sure ti will do what you want:
<?
$to = '';
for ($i = 1; $i <= $_POST["NMax"]; $i++) {
$CheckVariable = isset($_POST["Check$i"]) ? $_POST["Check$i"]: false;
$nameVariable = isset($_POST["name$i"]) ? $_POST["name$i"] : '';
$emailVariable = isset($_POST["email$i"]) ? $_POST["email$i"]: '';
if ($CheckVariable) {
$to .= "\"$nameVariable\" <".$emailVariable.">,";
}
}
echo $to;
--- End Message ---
--- Begin Message ---
John Taylor-Johnston wrote:
Patience please :)
See my html below. Basically, if type=checkbox is checked, I'm trying to
build $to string in mail().
parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING
or T_VARIABLE or T_NUM_STRING line 4
How do I rebuild this peice of code to be register_globals=off friendly?
Just when I thought I was getting good. This keeps up, I'm changing back
the php.ini myself.
John
stop using eval()! (you know the film SAW? well it's people
who use too much eval() that end up chained to the raditator)
also find out what the difference is betwewen using single
and double quotes.
also learn how/why to use isset(), and initializing your variables
before using them...
now look at this, I'm pretty sure ti will do what you want:
<?
$to = '';
for ($i = 1; $i <= $_POST["NMax"]; $i++) {
$CheckVariable = isset($_POST["Check$i"]) ? $_POST["Check$i"]: false;
$nameVariable = isset($_POST["name$i"]) ? $_POST["name$i"] : '';
$emailVariable = isset($_POST["email$i"]) ? $_POST["email$i"]: '';
if ($CheckVariable) {
$to .= "\"$nameVariable\" <".$emailVariable.">,";
}
}
echo $to;
--- End Message ---
--- Begin Message ---
I am backing up a file (the path & filename of which are stored in $original;
the path & filename of the copy are stored in $bkup). I would also like to
copy the file modification time of $original, so, after copying the file
itself, I use:
touch($bkup, filemtime($original));
However, after I use the above "touch" function, filemtime($original) and
filemtime($bkup) are often slightly different. For example, I might have:
echo filemtime($original); // gives 1126191599
echo filemtime($bkup); // gives 1126191600
Why the small difference?
(I'd like these two file modification times to be exactly the same because I
want to compare file modification times when I do incremental backups, and
copy a file only if the file modification times are different.)
By the way, if it helps, I am using Windows XP.
Thanks!
--- End Message ---
--- Begin Message ---
Can we use some function with GD to make text italic, bold and/or underline?
http://php.net/imagettftext
I see we can change size and font, but not style
it's not possible in PHP?
Thanks in advance
David
--- End Message ---