[PHP] Announcement: Smarty template engine 2.6.4 released

2004-09-07 Thread Monte Ohrt
Hi,
This is a bug fix and minor feature release.
Have fun,
-Monte
Homepage: 
http://*smarty*.php.net/ http://smarty.php.net/

ChangeLog: 
http://*smarty*.php.net/misc/NEWS http://smarty.php.net/misc/NEWS

Download: 
http://*smarty*.php.net/download.php http://smarty.php.net/download.php

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Announcement: Smarty template engine 2.6.0 released

2003-11-19 Thread Monte Ohrt
Hello!

2.6.0 has been released. There are numerous enhancements and
fixes, take a look at the release notes for the details.

Have fun!
-Monte

Homepage: 
http://smarty.php.net/

Release Notes: 
http://smarty.php.net/release_notes.php

ChangeLog: 
http://smarty.php.net/misc/NEWS

Download: 
http://smarty.php.net/download.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Announcement: Smarty 2.6.0 RC1 released

2003-08-14 Thread Monte Ohrt
Smarty 2.6.0 Release Candidate 1. Notable new features are
cachable/non-cachable function attributes, default resource type
configuration, simple math and many internal optimizations. See the
ChangeLog (NEWS file) for full details.

http://smarty.php.net/misc/NEWS
http://smarty.php.net/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP CLI question

2003-06-06 Thread Monte Ohrt
Hi,

A couple of questions:

1) Is there a way to make the CLI version of PHP ignore certain settings
in the php.ini file? For instance, I don't want the ioncube accelerator
invoked when using PHP from the command line. My current work around is
to use two separate init files, php.ini and php-cli.ini ... and this
brings me to my second question:

2) Is there a way to specify a different name for the php.ini file,
apart from hacking php_ini.c ? It seems I can only change the _path_ to
the file, but not the filename itself.

TIA
Monte



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP CLI question

2003-06-06 Thread Monte Ohrt
Hi Cal,

I may be missing something, but I don't see how this page answers either
of my questions. ini_set() is for setting configuration options.

Monte

On Thu, 2003-06-05 at 09:23, Cal Evans wrote:
 http://www.php.net/manual/en/function.ini-set.php
 
 * Cal Evans
 * http://www.christianperformer.com
 * Stay plugged into your audience
 * The measure of a programmer is not the number of lines of code he writes
 but the number of lines he does not have to write.
 *
 
 - Original Message -
 From: Monte Ohrt [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, June 05, 2003 9:22 AM
 Subject: [PHP] PHP CLI question
 
 
  Hi,
 
  A couple of questions:
 
  1) Is there a way to make the CLI version of PHP ignore certain settings
  in the php.ini file? For instance, I don't want the ioncube accelerator
  invoked when using PHP from the command line. My current work around is
  to use two separate init files, php.ini and php-cli.ini ... and this
  brings me to my second question:
 
  2) Is there a way to specify a different name for the php.ini file,
  apart from hacking php_ini.c ? It seems I can only change the _path_ to
  the file, but not the filename itself.
 
  TIA
  Monte
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP CLI question

2003-06-06 Thread Monte Ohrt
Hi Adam,

I know it can be altered with a command-line switch, but it is the
default that I want to change. I don't want to have to remember to set
the -c flag everytime, or go back and change all my existing scripts.

Monte

On Thu, 2003-06-05 at 09:53, Adam Voigt wrote:
 From a ./php -h:
 
  -c path|file Look for php.ini file in this directory
 
 The | means OR, so logic would dictate you can point
 directly to the file with the -c option.
 
 
 On Thu, 2003-06-05 at 10:35, Monte Ohrt wrote:
  Hi Cal,
  
  I may be missing something, but I don't see how this page answers either
  of my questions. ini_set() is for setting configuration options.
  
  Monte
  
  On Thu, 2003-06-05 at 09:23, Cal Evans wrote:
   http://www.php.net/manual/en/function.ini-set.php
   
   * Cal Evans
   * http://www.christianperformer.com
   * Stay plugged into your audience
   * The measure of a programmer is not the number of lines of code he writes
   but the number of lines he does not have to write.
   *
   
   - Original Message -
   From: Monte Ohrt [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Cc: [EMAIL PROTECTED]
   Sent: Thursday, June 05, 2003 9:22 AM
   Subject: [PHP] PHP CLI question
   
   
Hi,
   
A couple of questions:
   
1) Is there a way to make the CLI version of PHP ignore certain settings
in the php.ini file? For instance, I don't want the ioncube accelerator
invoked when using PHP from the command line. My current work around is
to use two separate init files, php.ini and php-cli.ini ... and this
brings me to my second question:
   
2) Is there a way to specify a different name for the php.ini file,
apart from hacking php_ini.c ? It seems I can only change the _path_ to
the file, but not the filename itself.
   
TIA
Monte
   
   
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   
   
-- 
Monte Ohrt [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP CLI question

2003-06-06 Thread Monte Ohrt
ok, so there are plenty of ways to work around it ;-) I guess my
original question should be answered as such? No, you cannot specify a
different configuration file name other than php.ini, you must either
hack the C code or supply a workaround at runtime.

Monte

On Thu, 2003-06-05 at 15:07, Mark wrote:
 Wrap it in a shell script or batch file. 
 
 Something like:
 
 REM ---Start cli.bat---
 ./cli/php.exe -c cli-php.ini location %1 %2 %3 %4 %5 %6 %7 %8 %9
 @exit
 REM ---End cli.bat---
 
 
 --- Monte Ohrt [EMAIL PROTECTED] wrote:
  Hi Adam,
  
  I know it can be altered with a command-line switch, but it is the
  default that I want to change. I don't want to have to remember to
  set
  the -c flag everytime, or go back and change all my existing
  scripts.
  
  Monte
  
  On Thu, 2003-06-05 at 09:53, Adam Voigt wrote:
   From a ./php -h:
   
-c path|file Look for php.ini file in this directory
   
   The | means OR, so logic would dictate you can point
   directly to the file with the -c option.
   
   
   On Thu, 2003-06-05 at 10:35, Monte Ohrt wrote:
Hi Cal,

I may be missing something, but I don't see how this page
  answers either
of my questions. ini_set() is for setting configuration
  options.

Monte

On Thu, 2003-06-05 at 09:23, Cal Evans wrote:
 http://www.php.net/manual/en/function.ini-set.php
 
 * Cal Evans
 * http://www.christianperformer.com
 * Stay plugged into your audience
 * The measure of a programmer is not the number of lines of
  code he writes
 but the number of lines he does not have to write.
 *
 
 - Original Message -
 From: Monte Ohrt [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Sent: Thursday, June 05, 2003 9:22 AM
 Subject: [PHP] PHP CLI question
 
 
  Hi,
 
  A couple of questions:
 
  1) Is there a way to make the CLI version of PHP ignore
  certain settings
  in the php.ini file? For instance, I don't want the ioncube
  accelerator
  invoked when using PHP from the command line. My current
  work around is
  to use two separate init files, php.ini and php-cli.ini ...
  and this
  brings me to my second question:
 
  2) Is there a way to specify a different name for the
  php.ini file,
  apart from hacking php_ini.c ? It seems I can only change
  the _path_ to
  the file, but not the filename itself.
 
  TIA
  Monte
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
  -- 
  Monte Ohrt [EMAIL PROTECTED]
  
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 
 =
 Mark Weinstock
 [EMAIL PROTECTED]
 ***
 You can't demand something as a right unless you are willing to fight to death to 
 defend everyone else's right to the same thing.
 ***
 
 __
 Do you Yahoo!?
 Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
 http://calendar.yahoo.com
-- 
Monte Ohrt [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Announcement: Smarty template engine 2.4.2 released

2003-02-12 Thread Monte Ohrt
Hello!

Smarty 2.4.2 now supports the ability to access objects within the
templates, a long awaited feature. Two methods are available, one which
closely follows Smartys existing syntax conventions, and another that
follows more traditional object syntax for those familiar with PHP.

The regex parsing was rewritten to be more strict, secure and
maintainable. Config files are now compiled instead of parsed. Assigned
variables are no longer extracted to PHP namespace saving extract()
calls. There is now support for applying modifiers to static values and
functions. You can now access constants with $smarty.const.VAR. If you
use the security features of Smarty be sure to upgrade, the previous
not-so-strict parser opened the possibility of executing PHP in the
templates. Other misc things are in the change log.

Have fun!
-Monte

Homepage: 
http://smarty.php.net/

Release Notes: 
http://smarty.php.net/misc/RELEASE_NOTES

ChangeLog: 
http://smarty.php.net/misc/NEWS

Download: 
http://smarty.php.net/download.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHPSESSID appended to URL on initial page load

2002-08-27 Thread Monte Ohrt

Hi, I have a few questions with php sessions, below is an example script:

test_sess.php
-

?php

session_cache_limiter();
session_start();

?
A HREF=/local/path.phplocal path/A



When I initially load the file (session cookie gets set), the HREF link 
gets the PHPSESSID appended to it. If I reload the page (cookie already 
set) the appendage goes away.

According to the PHP manual, the PHPSESSID gets appended to the URL only 
in the case the session cookie is not accepted by the browser.

I would guess that on the first page load the server has no way of 
knowing if the browser accepted the cookie. So maybe this is 
intentional? I'm trying to figure out how to avoid PHPSESSID in the URLs 
entirely unless the browser does not accept cookies. I suppose I could 
disable URL rewriting altogether and rely soley on cookies. How do I 
disable PHP session URL rewriting? I don't see a setting in php.ini for it.

PHP 4.2.2, Solaris Sparc


TIA
Monte

php.ini
---



[Session]
; Handler used to store/retrieve data.
session.save_handler = files

; Argument passed to save_handler.  In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP's session functions.
session.save_path = /export/tmp
; Whether to use cookies.
session.use_cookies = 1


; Name of the session (used as cookie name).
session.name = PHPSESSID

; Initialize session on request startup.
session.auto_start = 0

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0

; The path for which the cookie is valid.
session.cookie_path = /

; The domain for which the cookie is valid.
session.cookie_domain =

; Handler used to serialize data.  php is the standard serializer of PHP.
session.serialize_handler = php

; Percentual probability that the 'garbage collection' process is started
; on every session initialization.
session.gc_probability = 1

; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440

; Check HTTP Referer to invalidate externally stored URLs containing ids.
session.referer_check =

; How many bytes to read from the file.
;session.entropy_length = 0
session.entropy_length = 32

; Specified here to create the session id.
;session.entropy_file =
session.entropy_file = /dev/urandom

; Set to {nocache,private,public} to determine HTTP caching aspects.
session.cache_limiter = nocache

; Document expires after n minutes.
session.cache_expire = 180

; use transient sid support if enabled by compiling with --enable-trans-sid.
session.use_trans_sid = 1

url_rewriter.tags = a=href,area=href,frame=src,input=src,form=fakeentry


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] fgets question

2002-08-14 Thread Monte Ohrt

Hi, I have a question about fgets(), it seems to pick up an extra line 
at the end of a text file.

example, I open a new file named test with the vi editor and make it 8 
lines long like so (showing newlines as \n):

1\n
2\n
3\n
4\n
5\n
6\n
7\n
8\n

I create this PHP program and run it:

?php
$fd = fopen (test,r);
while (!feof ($fd)) {
 $buffer = fgets($fd, 4096);
 echo buffer is $buffer;
}
fclose ($fd);
?

Here is the output (showing newlines as \n):

buffer is 1\n
buffer is 2\n
buffer is 3\n
buffer is 4\n
buffer is 5\n
buffer is 6\n
buffer is 7\n
buffer is 8\n
buffer is


My question, why is there an extra line? Or in other words, how do I get 
this to loop exactly 8 times if there are only 8 lines?

TIA
Monte


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] fgets question

2002-08-14 Thread Monte Ohrt

That was my first thought but that wasn't it. To be sure, I urlencoded 
the file and looked at it:

1%0A2%0A3%0A4%0A5%0A6%0A7%0A8%0A

No extra newlines that I could see.

FYI, if you run the program from the command line, you have to pipe the 
output to a pager or you will not see the last (extra) line since there 
is no newline character.

I'm using PHP 4.2.2 on Solaris sparc.

Monte

Kevin Stone wrote:
 The only explaination is that 'vi' is putting an extra line in there that
 you're not seeing.
 -Kevin
 
 - Original Message -
 From: Monte Ohrt [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Wednesday, August 14, 2002 11:05 AM
 Subject: [PHP] fgets question
 
 
 
Hi, I have a question about fgets(), it seems to pick up an extra line
at the end of a text file.

example, I open a new file named test with the vi editor and make it 8
lines long like so (showing newlines as \n):

1\n
2\n
3\n
4\n
5\n
6\n
7\n
8\n

I create this PHP program and run it:

?php
$fd = fopen (test,r);
while (!feof ($fd)) {
 $buffer = fgets($fd, 4096);
 echo buffer is $buffer;
}
fclose ($fd);
?

Here is the output (showing newlines as \n):

buffer is 1\n
buffer is 2\n
buffer is 3\n
buffer is 4\n
buffer is 5\n
buffer is 6\n
buffer is 7\n
buffer is 8\n
buffer is


My question, why is there an extra line? Or in other words, how do I get
this to loop exactly 8 times if there are only 8 lines?

TIA
Monte


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] fgets question

2002-08-14 Thread Monte Ohrt

I don't have the option of editing the text files to work right. I want 
to be able to read an arbitrary text file line by line and process each 
one. So I suppose I could do this (?)

?php
$fd = fopen (test,r);
while (!feof ($fd)) {
  $buffer = fgets($fd, 4096);
  if($buffer == '') {
// no \n, must be EOF
break;
  }
  echo buffer is $buffer;
}
fclose ($fd);
?

DL Neil wrote:
 Hi Monte,
 
 
Hi, I have a question about fgets(), it seems to pick up an extra line
at the end of a text file.
 
 ...
 
8\n
 
 ...
 
Here is the output (showing newlines as \n):
buffer is 1\n
buffer is 2\n
buffer is 3\n
buffer is 4\n
buffer is 5\n
buffer is 6\n
buffer is 7\n
buffer is 8\n
buffer is
My question, why is there an extra line? Or in other words, how do I get
this to loop exactly 8 times if there are only 8 lines?
 
 
 
 The answer is that there isn't an 'extra' line, there are as many as you
 put/PHP reads!
 The question to ask is: how does a stream file end?
 Answer: with an EOF character (not an LF).
 
 Lines in a (*nix) stream file are separated by LF or \n character, therefore
 there is a ninth 'line' (of absolutely nothing) between the last LF and the
 EOF. Take out that last \n and things should work the way you want.
 
 Regards,
 =dn
 
 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Announcement: Smarty template engine 2.2.0 released

2002-07-11 Thread Monte Ohrt

Most notable changes are support for multiple plugin directories, 
grouping cache and compile files, removed overlib library from 
distribution, many optimizations, enhancements and bug fixes. Enjoy!

Homepage:
http://smarty.php.net/

Release Notes:
http://smarty.php.net/misc/RELEASE_NOTES

ChangeLog:
http://smarty.php.net/misc/NEWS

Download:
http://smarty.php.net/download.php


-Monte


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Announcement: Smarty template engine 2.1.1 released

2002-05-07 Thread Monte Ohrt

This is a minor bug fix release.

http://www.phpinsider.com/php/code/Smarty/

Version 2.1.1
-

 - added cycle function (Monte)
 - fixed bug with resource testing, and include_path (Monte)
 - fixed a bug with register_outputfilter function (Monte)


Monte


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Announcement: Smarty template engine 2.1.0 released

2002-04-30 Thread Monte Ohrt

Homepage:
http://www.phpinsider.com/php/code/Smarty/

Most notable new features are block functions which act on
blocks of text {func}{/func}, and output filters which
act on the output of the templates.

Version 2.1.0
-

 - introduced output filters. (Andrei)
 - changed the way filters are loaded, added load_filter()
   API function and $autoload_filters variable. (Andrei)
 - added caching logic for expire times per cache file
   (Norbert Rocher, Monte)
 - fixed html_select_date when field separator is /
   (Roberto Berto, Monte)
 - added -MM-DD format support to html_select_date
   (Jan Rosier, Monte)
 - fixed cache_lifetime logic bug, also made -1 = never
   expire (Monte)
 - fixed directory separator issue for Windows. (Andrei)
 - added ability to use simple variables as array indices or
   object properties. (Andrei)
 - added ability to unregister pre/postfilters plugins at
   runtime. (Andrei)
 - added 'htmlall' attribute to escape modifier. (Monte)
 - added template_exists() API function. (Andrei)
 - fixed a problem with using dynamic values for 'file'
   attribute of {include_php} tag. (Andrei)
 - added $smarty.template variable. (Andrei)
 - fixed several plugins that would not work if the plugin
   directory was not the default one. (Andrei)
 - implemented support for block functions. (Andrei)
 - made it possible to assign variables in pre/postfilter
   plugins. (Andrei)



-- 
Monte Ohrt [EMAIL PROTECTED]
Director of Technology, ispi Inc.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Announcement: Smarty template engine 2.0.1 available

2002-03-20 Thread Monte Ohrt

This is a point release, a few bug fixes  clean up.

http://www.phpinsider.com/php/code/Smarty/

There have been some nice plugins contributed to the plugin repository
too!

http://www.phpinsider.com/php/code/Smarty/contribs/plugins/


Version 2.0.1
-
- rename plugin .make_timestamp.php to shared.make_timestamp.php
(Monte)
- changed crc32() generated values, replace '-' with 'N' (Monte)
- added support for +/- N syntax in html_select_date year values
(Monte)
- fixed behavior of inserts with script attribute. (Andrei)
- fixed bug with $smarty.cookies and $smarty.server. (Andrei)
- wordwrap and indent are missing from 2.0 release, now fixed.
(Monte)
- removed show_info_header and show_info_include variables. (Monte)


--
Monte Ohrt [EMAIL PROTECTED]
Director of Technology, ispi Inc.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Announcement: Smarty template engine 2.0 available

2002-03-01 Thread Monte Ohrt

Smarty 2.0 is out!

The most notable new things:

*) Smarty has been rewritten with an underlying plugin architecture,
   so adding functions, modifiers, compiler functions, prefilters,
   postfilters, resources, and insert functions is as easy as dropping
   a file into the plugin directory.

*) Performance, performance, performance! The benchmark page shows the
   huge steps Smarty has made in performance, as well as comparisons to
   other well known template engines.

*) Completely reorganized documentation, available in HTML and PDF.

*) Smarty no longer depends on PEAR.

http://www.phpinsider.com/php/code/Smarty/
http://www.phpinsider.com/php/code/Smarty/docs/
http://www.phpinsider.com/php/code/Smarty/benchmarks/
http://www.phpinsider.com/php/code/Smarty/downloads/

Version 2.0.0
-
- added eval function plugin for evaluating variables as
  templates. (Monte)
- removed $tpl_file_ext class variable, no longer used. (Monte)
- added hex and hexentity escape types to escape modifier.
  (Monte)
- removed dependency on PEAR. (Andrei)
- update popup_init to accept src attribute. (Monte, Duncan Forrest)
- implemented several optimizations, speeding up Smarty
  significantly in most cases. (Andrei,Monte)
- implemented plugin architecture. (Andrei)
- added wordwrap and indent modifiers. (Monte)
- added support for 'If-Modified-Since' headers for cached content.
  (Monte)
- removed insert_tag_check class variable, no longer needed. (Monte)
- optimized cache fetches by scanning for insert tags only if they
  exist. (Monte)
- fixed bugs in overlib. (Monte, Duncan Forrest)
- fixed a problem with compile_id usage. (Andrei)
- fixed problem with using assigned vars with {include_php ...}
  filepath. (Monte)

--
Monte Ohrt [EMAIL PROTECTED]
Director of Technology, ispi Inc.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Announcement: Smarty template engine 1.5.2 available

2001-12-18 Thread Monte Ohrt

http://www.phpinsider.com/php/code/Smarty/

Version 1.5.2
-
- added Smarty object as fifth argument for template resource
functions
  (Monte)
- fixed a bug with incorrectly combined cache and compile id in
  clear_cache(). (Andrei)
- fixed bug in smarty_make_timestamp introduced in PHP 4.1.0.
(Monte)
- fixed bug with cached insert debug timing. (Monte)
- added 'script' attribute to {insert..} which specifies the script
that
  the insert function can be found in. (Andrei)
- added default template function handler. (Monte)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] a piece of PHP history

2001-12-12 Thread Monte Ohrt

Google now has 20 years worth of newsgroup archives. Here is a link to
what is probably the first PHP post by Rasmus.

http://groups.google.com/groups?q=%22Personal+Home+Page%22+author:Rasmus+author:Lerdorfhl=enscoring=das_drrb=bas_mind=17as_minm=5as_miny=1981as_maxd=12as_maxm=12as_maxy=1995rnum=2selm=3r7pgp%24aa1%40ionews.io.org


--
Monte Ohrt [EMAIL PROTECTED]
http://www.ispi.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] hotscripts.com poll

2001-12-12 Thread Monte Ohrt

FYI, there is a poll on the frontpage of hotscripts.com to vote for your
favorite scripting language, and PHP is in a commanding lead.

interesting stats:

http://www.hotscripts.com/polls/results.hsp

Monte

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Announcement: Smarty template engine 1.5.1 available

2001-12-10 Thread Monte Ohrt

This is a critical bug fix release. If you use caching, you'll need to
upgrade from 1.5.0.

http://www.phpinsider.com/php/code/Smarty/

Version 1.5.1
-
- removed error message from the generic _read_file() method, the
caller
  should take care of that. (Andrei)
- fixed a bug with incorrectly combined cache and compile id.
(Andrei)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Announcement: Smarty template engine 1.5.0 available

2001-12-06 Thread Monte Ohrt

Several feature enhancements were made to this version, most notably the
{foreach ...} command which is an alternative to {section ...} with an
easier syntax for looping through a single array of values. Several
functions were enhanced so that the output can be automatically assigned
to a template variable instead of displayed (assign attribute). Cache
files can now be controlled with a custom function as an alternative to
the built-in file based method. Many code cleanups and bug fixed went
into this release as well.

Monte

http://www.phpinsider.com/php/code/Smarty/

ChangeLog since 1.4.6:
--

- added include_php built-in function, documented. (Monte)
- added trusted_dir functionality, documented. (Monte)
- consolidated secure_dir tests to one function. (Monte)
- prepended _smarty_ to variable names in fetch() class function to
avoid
  namespace conflicts. (Monte)
- introduced $compile_id class variable that can be used to set
persistent
  compile identifier across multiple display calls, documented. (Andrei)
- fixed bug with concatenated null cache and compile identifiers.
(Andrei)
- added $smarty.section.* syntax for accessing section properties,
  documented. (Andrei)
- added custom cache handling function ability, documented. (Monte)
- added assign attribute to include, include_php, insert, fetch, math,
and
  counter functions, documented. (Monte)
- fixed bug with fetch testing for local file when http address. (Monte)
- fixed bug with counter and skipval setting. (Monte)
- made {config_load ...} merge globals from each config file only once
per
  scope, thus avoiding several problems. (Andrei)
- added {foreach ...} tag that can be used to iterate through
  non-sequential and associative arrays, documented. (Andrei)
- speeded up section property access a bit. (Andrei)
- removed $smarty variable from storage used by normal template
variables,
  to prevent any problems. (Andrei)
- fixed a bug that could cause parse error with quotes inside literal
  blocks. (Andrei, Alexander Belonosov)
- added 'field_array' attribute to html_select_time function,
documented.
  (Andrei, Michael Caplan)
- documented {section} max attribute. (Monte)
- fixed notice message in Smarty_Compiler.class.php. (Monte)
- fixed bug with clear_cache introduced in 1.4.6, third parameter should
  default to null. (Monte)
- updated Config_File class to support '\' path separator in OS/2.
(Monte,
  Francesco Cipriani)
- removed secure_ext setting (not used). (Monte)
- made cache reading process more efficient. (Monte)
- fixed bug, is_cached() now supports new 1.4.6 caching behavior.
(Monte)
- update FAQ with mailing list Reply-To header FAQ. (Monte)
- supress error messages for fopen(), fix cache to regenerate if cache
  file is not available (i.e. cluster race condition). (Monte)
- added index key example to QUICKSTART guide. (Monte)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Announcement: Smarty template engine 1.4.6 released

2001-11-01 Thread Monte Ohrt

Homepage:
http://www.phpinsider.com/php/code/Smarty/

Version 1.4.6
-
- fixed bug with {assign ...} when passing an empty value. (Monte)
- add more warning message fixes. (Monte, Tara Johnson)
- documentation updates. (Monte)
- update fetch function to give proper warning when fetching a
  non-readable or non-existant file. (Monte)
- fixed problem with newline at the end of included templates (Monte,
  Andrei)
- added feature to regenerate cache if compile_check is enabled and an
  involved template or config file gets modified. (Monte)
- added DEBUG execution times to included files: REQUIRES updated
  debug.tpl file! (Monte)
- added support for hidden config variables that cannot be read by
  templates. (Andrei)
- added execution time to DEBUG console, total and inserts. (Monte)
- fixed bug where DEBUG console would not appear with cached content.
  (Monte)
- added support for postfilter functions that are applied to compiled
  template right after compilation. (Andrei)
- fixed the name of clear_compile_tpl() API function to
  clear_compiled_tpl. (Andrei)
- added fix for removing comments so that the line numbers are reported
  correctly in case of errors. (patch from Anders Janson)
- made html_options output xhtml compatible code. (Monte, Arnaud
  Limbourg)



--
Monte Ohrt [EMAIL PROTECTED]
http://www.ispi.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Announcement: Smarty template engine 1.4.5 available

2001-09-21 Thread Monte Ohrt

Mostly bug fixes and minor improvements. Added compile id for separate
compiled versions of the same script. The directory format and filename
convention for the files in templates_c has changed, so you may want to
remove all of the existing ones before you upgrade.

Monte

http://www.phpinsider.com/php/code/Smarty/

Version 1.4.5
-
- update FAQ with index of questions at the top
- update overlib to 3.50, adjust addon code so that the overlib.js
  file isn't modified, and not using the mini one. (Monte)
- added many more options to html_select_date. (Alexander Skwar,
Andrei)
- added support for generating different compiled templates from the
same
  source template. (Hans-Peter Oeri, Andrei)
- modified Smarty to pass itself to insert functions as the second
  parameter. (Andrei)
- modified Smarty to pass itself to prefilter functions as the
second
  parameter. (Andrei)
- fixed syntax error when including a non-existant template with
security
  enabled. (Monte)
- fixed comments handling to allow commenting out template blocks.
(Andrei)
- implemented named capture buffers, with results accessible via
  $smarty.capture.name. (Andrei)
- added ability to index arrays directly by numbers. (Andrei)
- fixed bug with SMARTY_DIR not prepended to Config_File in

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Announcement: Smarty template engine 1.4.4 available

2001-07-16 Thread Monte Ohrt

http://www.phpinsider.com/php/code/Smarty/

Version 1.4.4
-
- fixed problem with including insecure templates with security
enabled
  (Monte)
- numerous documentation updates. (Monte) 
- added ENT_QUOTES to escapement of html. (Monte, Sam Beckwith)
- implemented access to request variables via auto-assigned $smarty
  template variable.  (Andrei)
- fixed a bug with parsing function arguments inside {if} tags if a
comma
  was present. (Andrei)
- updated debug console with config file vars. (Monte)
- added SMARTY_DIR constant as an alternative to relying on
include_path
  (Monte)
- added popup_init and popup functions, (requires overlib.js)
(Monte)
- updated debug console with config file vars. (Monte)
- added debugging url control. (Monte)
- added 'quotes' type to escape modifier. (Monte, Mike Krus)
- added 'total' and 'iteration' section properties. (Andrei)
- added 'start', 'max', and 'step' section attributes/properties.
(Andrei)
- fixed a bug with security checking of functions inside {if} tags.
  (Andrei)
- fixed a bug in Config_File that would incorrectly booleanize
values that
  weren't really booleans. (Andrei)




--
Monte Ohrt [EMAIL PROTECTED]
http://www.ispi.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Announcement: Smarty 1.4.3 now available

2001-06-20 Thread Monte Ohrt

Smarty now has a built in debugging console, and security features for
third party template editing, and many numerous fixes and enhancements.
Let me know if there are any problems.

Monte




http://www.phpinsider.com/php/code/Smarty/

Version 1.4.3
-
- added regex_replace modifier, documented. (Monte)
- added debugging console feature and custom function
assign_debug_info, documented. (Monte)
- added 'scope' attribute for {config_load}, 'global' is now
deprecated but
  is still supported. (Andrei)
- reduced template symbol table pollution by moving config array
into the class itself. (Andrei)
- fixed a bug with passing quoted arguments to modifiers inside {if}
statements. (Andrei, Sam Beckwith)
- added security features for third party template editing,
documented (Monte)
- added assign custom function, documented. (Monte)
- fixed bug with template header using version instead of _version.
(Monte)
- fixed a problem with putting $ followed by numbers inside {strip}
and {/strip} tags. (Andrei)
- fixed Config_File class to allow empty config paths (defaults to
current directory). (Andrei)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] [annoucement] Smarty template engine 1.4.1 available

2001-05-16 Thread Monte Ohrt

A minor bug fix release.

http://www.phpinsider.com/php/code/Smarty/

Version 1.4.1
-
- fix LOCK_EX logic for all windows platforms (Monte)
- fixed indexing by section properties with the new syntax. (Andrei)
- updated Smarty to use absolute paths when requiring/including
Smarty
  components. (Andrei, John Lim)




Monte

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Announcement: Smarty template engine 1.4.0 available

2001-05-07 Thread Monte Ohrt

There are many changes to this release, including runtime compilation of
templates and the support for arbitrary template resources, such as
multiple template directories or databases. Be sure to read the
RELEASE_NOTES, especially if you are upgrading from a prior release.

Monte

http://www.phpinsider.com/php/code/Smarty/


Version 1.4.0
---
- added {capture}{/capture} function, documented (Monte)
- added {counter} function, documented (Monte) 

Version 1.4.0b2
---
- fixed issue in Config_File.class with referencing blank sections
(Andrei)
- fixed problem with passing variables to included files (Andrei)
- fixed resource path recognition for windows (Monte)

Version 1.4.0b1
---
- added componentized templates tip into documentation (Monte)
- added {php}{/php} tags for embedding php code into templates
(Monte)
- changed default value of $show_info_header to false (Monte)
- implemented '-' syntax for accessing properties of objects passed
to the
  template. (Andrei)
- allowed custom functions to receive Smarty object as the second
  parameter; this can be used to dynamically change template
variables, for
  example. (Andrei)
- added custom compiler functions support,
register_compiler_function() and
  unregister_compiler_function() API functions. (Andrei, Ivo
Jansch).
- updated GLOBAL_ASSIGN to take SCRIPT_NAME from HTTP_SERVER_VARS
  instead of global variable. You can also assign several variables
  in one shot with an array. (Monte, Roman Neuhauser)
- added template prefilters, register_prefilter() and
  unregister_prefilter() API functions. (Monte)
- added RELEASE_NOTES file to distribution. (Monte)
- moved CREDITS out of manual into its own file. (Monte)
- added register_resource() and unregister_resource() API functions.
(Monte)
- changed the syntax of indexing template variables, thus supporting
  structures of arbitrary complexity; supplied fix_vars.php script
to fix
  old syntax. (Andrei)
- added $insert_tag_check to speed up cached pages if {insert ...}
is not
  used. (Monte)
- added $compiler_class variable to allow specifying a different
compiler
  class. (Andrei)
- changed Smarty to compile templates at runtime, allowing for
arbitrary
  template resources. (Monte)
- added fix for LOCK_EX under Windows and changed a couple of file
  permissions for security. (Monte, Fernando Nunes)
- allow arbitrary date strings to date_format, html_select_date and
  html_select_time (Monte)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] shared memory questions

2001-03-14 Thread Monte Ohrt

Hi,

I have a situation where I'd like to store some data in shared memory as
opposed to repetitive database requests. Basically, I'd read in a
(small) database table and serialize the results into shared mem. I've
read through the semaphore and shared memory documentation, but some
things are left unclear.

1) which is better to use, the shm_* sem_*, or the shmop functions? It
looks like shmop may be easier to use and more efficient.

2) How do I test if a shared memory segment exists, and create one if it
doesn't? Here's a bit of psuedo code I'd like to emulate:

if ( shared mem exists ) {
open shared mem
read data from shared mem
close shared mem
unserialize data
}
else {
do sql query
serialize data
open new shared mem (size of serialized data?)
write data
close shared mem
}


3) What size should the opened shared mem size be? shm_* mentions that
the values are serialized implicitly. Does shmop do this, or does this
need to be serialized first in the PHP code?

4) How do I know what to use for the system id for the memory segment?
What is a "safe" value to use? Is there a valid range? Are there some
ranges I should stay away from?

5) Is there a way to tell the age of a shared memory segment, or must I
do this within the data that is stored?

6) Are there any good examples of usage out there? The one that comes
with shmop doesn't show a way to test if the shared memory segment
exists before trying to create a new one (and how do I open an existing
shared mem segment, not necessarily knowing its size?)


I'm using Sparc Solaris 2.8, if that makes a difference.

Thanks!

--
Monte Ohrt [EMAIL PROTECTED]
http://www.ispi.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Sending pretty email

2001-03-10 Thread Monte Ohrt

Send e-mail headers:

Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit


Then in the body, put your HTML.

Todd Cary wrote:
 
 I often receive email from commercial sites (e.g. ZDnet) that looks like
 a Web page.  How can I do that with Sendmail in PHP?
 
 Todd
 
 --
 Todd Cary
 Ariste Software
 [EMAIL PROTECTED]
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Monte Ohrt [EMAIL PROTECTED]
http://www.ispi.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Announcement: Smarty template engine 1.3.1 released (1.3.1pl1)

2001-03-08 Thread Monte Ohrt

1.3.1pl1 fixed a bug with a missing function _syntax_error.

Monte Ohrt wrote:
 
 Homepage:
 http://www.phpinsider.com/php/code/Smarty/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Announcement: Smarty template engine 1.3.1 released

2001-03-07 Thread Monte Ohrt


Homepage:
http://www.phpinsider.com/php/code/Smarty/

ChangeLog for 1.3.1:
- document first, last, index_prev, index_next (Monte)
- added 'first' and 'last' section properties. (Andrei)
- split out compiling code to separate class for faster template
execution
  time (Monte)
- fixed a couple of minor PHP warnings (Monte)
- added and documented unregister_modifier() and
unregister_function() API
  calls. (Monte)
- added and documented 'fetch' and 'math' functions. (Monte)
- added ability to index looped variables by section properties,
e.g.
  $foo.index_prev/bar. (Andrei)
- added index_prev and index_next section properties. (Andrei)
- fixed issue with php executing in literal blocks. (Monte)




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] exclusive file locking under windows

2001-03-01 Thread Monte Ohrt

Is exclusive locking not supported under windows? It doesn't seem to be
working:

flock($fd, LOCK_EX);



--
Monte Ohrt [EMAIL PROTECTED]
http://www.ispi.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] imagettfbbox and imagettftext

2001-02-23 Thread Monte Ohrt

I've gone through the manual and user notes on these functions, and they
tend to be highly illogical ;-) The numbers don't coincide, the x/y
values are negative when it seems they ought to be positive, etc. If
someone has already figured this out, would you post a code snippet that
will create an image the size of the ttf bounding box and draw the
string of text exactly centered on the image... this should work no
matter what string of text is used, what font is used, what font size is
used and if letters hang below the baseline or not.

Thanks
Monte

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] splitting a class across separate files?

2001-02-08 Thread Monte Ohrt

I have a class with many functions. About 80% of these functions are
rarely used, so I'd like to split them out to a separate file and
include them only if a certain condition applies. This way the PHP
compiling is kept to a minimum. How do I make the included functions
members of the current class?

Example:


myclass.php
---

?php

class MyClass {

function func1() {
if($foo) {
include_once("myclass2.php");
$this-func2(); // this doesn't work, it won't find func2!
}
}

}

?

myclass2.php


?php

   // I need these functions to be
   // members of MyClass... how?
function func2() {
// do something
}

}

?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Announcement: Smarty template engine 1.2.1 released

2001-01-29 Thread Monte Ohrt

Changes:
- added ability to specify template and compile directory locations
independently.
- misc documentation updates  additions

http://www.phpinsider.com/php/code/Smarty/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] mktime() not allowing dates before 1970

2001-01-25 Thread Monte Ohrt

use Date_Calc.

http://www.phpinsider.com/php/code/Date_Calc/

Diego Fulgueira wrote:
 
 I know the UNIX epoch is 1/1/1970 and that mktime() returns the number of
 seconds between that date and the date specified by its parameters. If this
 date is before 1/1/1970, it always returns -1, not a large negative number,
 which would be more reasonable, i think.
 The question is: How can I know the number of seconds ellapsed between any
 date in the past and today?
 
 Thanks in advance.
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Monte Ohrt [EMAIL PROTECTED]
http://www.ispi.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Form data is not remembered

2001-01-24 Thread Monte Ohrt

If the form page is not being cached, it would probably get reloaded
when they clicked back, thus losing the data.

I'd suggest redrawing the form with the fields populated and with the
appropriate error messages. Then you don't need to mess with caches or
sessions for that matter, and the user doesn't need to take an extra
step to get back to the form.

Alain Fontaine wrote:
 
 Hi,
 
 I have a page with a couple of form fields that are being POSTed to a
 processing PHP script. The page that contains these form fields is itself a
 PHP page that uses sessions and so on.
 
 I have to make "server-side data validation" on the fields because of their
 complexity. When the user hits submit and comes to the result page, if there
 was any error I ask the user to go back to the form and correct the
 mistakes, using either his browser BACK button or by clicking on a link that
 does a javascript:history.back().
 
 The problem is, when the user gets back to the form page, all of the values
 he had typed in are gone, and he has to start all over again. Does anyone
 have an idea why this is so, and how to circumvent it without saving the
 user data into a session variable and then setting it back again once the
 user hits the form page again ? I have seen many pages where your previous
 data would stay in the form after you make a "Back" operation, but here, it
 disappears.
 
 Thanks for any ideas, and have a very nice day.
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Monte Ohrt [EMAIL PROTECTED]
http://www.ispi.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Announcement: Smarty template engine 1.0b released

2001-01-22 Thread Monte Ohrt

minor bug fix and several documentation changes/additions.

http://www.phpinsider.com/php/code/Smarty/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Any good way ?

2001-01-19 Thread Monte Ohrt

You want to drop empty where clauses? This will work, although your
syntax will be wrong if $em is empty ( you will get an SQL syntax error
with the extra AND on the end ). You need a dummy clause after the where
clause to make things match up right, something that always returns true
like 1=1.

$query = "select * from TABLE where 1=1 ";

if (empty($f))
$query .= " AND FIRST_NAME like '%$f%' ";
if (empty($l))
$query .= " AND LAST_NAME like '%$l%' ";
if (empty($em))
$query .= " AND ((HOME_EMAIL1 like '%$em%') OR (HOME_EMAIL2 like
'%$em%') OR
(WORK_EMAIL1 like '%$em%') OR (WORK_EMAIL2 like '%$em%')) ";

// put anything else here
$query .= " group by COLNAME, order by COLNAME ";

You might also want to look into fulltext searches to utilize an index
in the database (is this MySQL?) instead of table scans.

TV Karthick Kumar wrote:
 
 Hi all
 
 I have written the following code, but I dont' think it's a good way to
 write like this. Is there some other way to do good programming for this ?!
 
 
 **
if ($f)
{
 $SQL .= " (FIRST_NAME like '%$f%') AND ";
}
if ($l)
{
 $SQL .= " (LAST_NAME like '%$l%') AND ";
}
if ($em)
{
 $SQL .= " (HOME_EMAIL1 like '%$em%') OR (HOME_EMAIL2 like '%$em%') OR
 (WORK_EMAIL1 like '%$em%') OR (WORK_EMAIL2 like '%$em%') ";
}
 
 **
 
 Any help is appreciated very much.
 
 Thanks in adv.
 
 ~ Karthick
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Monte Ohrt [EMAIL PROTECTED]
http://www.ispi.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Announcement: Smarty - the PHP compiling template engine

2001-01-18 Thread Monte Ohrt

Release 1.0. Please welcome Smarty to the PHP template engine arena :-)

Inventors:
Monte Ohrt
Andrei Zmievski

http://www.phpinsider.com/php/code/Smarty/

DESCRIPTION:

What is Smarty?

Smarty is a template engine for PHP. One of the unique aspects about
Smarty that sets it apart from other templating solutions is that it
compiles the templates into native php scripts upon the first
execution. After that, it just executes the compiled PHP scripts.
Therefore, there is no costly template file parsing for each
request.

Some of Smarty's features:

* it is extremely fast
* it is relatively simple since the PHP parser does the dirty work.
* no template parsing overhead, only compiles once.
* it is smart about recompiling only the template
  files that have changed.
* you can make custom functions and custom variable modifiers, so
  the template language is extremely extensible.
* configurable template delimiter tag syntax, so you can use
  {}, {{}}, !--{}--, or whatever you like.
* template if/elseif/else/endif constructs are passed to the PHP
parser,
  so the if syntax can be as simple or as complex as you like.
* unlimited nesting of sections,ifs, etc. allowed
* it is possible to imbed PHP code right in your template files,
  although not recommended and doubtfully needed since the engine
  is so customizable.


Have fun, and good luck!

--
Monte Ohrt [EMAIL PROTECTED]
http://www.ispi.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Perl regular expression bug

2001-01-17 Thread Monte Ohrt

It's a bug. Try the latest CVS, it has been fixed.

Shaun Thomas wrote:
 
 This only applies to PHP 4.0.4
 
 Back with PHP 4.0.2, I could do this:
 
 ?PHP
 $string = "[[";
 $string = preg_replace("/(\W)/", "1", $string);
 ?
 
 $string would then contain "\[\[".
 
 Now, if I use that same code, $string contains "\\1\\1\\1\\1".
 
 I tried to compensate for this using PHP's new ability to allow
 perl syntax in the replace section.
 
 ?PHP
 $string = "[[";
 $string = preg_replace("/(\W)/", "\\$1", $string);
 ?
 
 That leaves $string with "\$1\$1\$1\$1".  Which tells me it thought
 I was backreferencing the $.  So, to combat said assumption, I tried
 three, four, even five slashes in front of $1, and nothing worked.
 All I got were variations of "\$1\$1\$1\$1".
 
 I have to assume this is a bug, since this worked back in 4.0.2 which
 I stopped using due to segfaults under certain circumstances.
 
 Ideas?
 
 --
 +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
 | Shaun M. ThomasINN Database Programmer  |
 | Phone: (309) 743-0812  Fax  : (309) 743-0830|
 | Email: [EMAIL PROTECTED]AIM  : trifthen  |
 | Web  : hamster.lee.net  |
 | |
 | "Most of our lives are about proving something, either to   |
 | "ourselves or to someone else." |
 |   -- Anonymous  |
 +-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Monte Ohrt [EMAIL PROTECTED]
http://www.ispi.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] regexps

2001-01-16 Thread Monte Ohrt

Most of the preg_ functions support arrays of values as input
parameters. It's all in the documentation.

"Elliot L. Tobin" wrote:
 
 Is there a way to call one regexp on multiple variables, in one statement?
 In Perl, I'd do:
 
 s/this/that for ($var1, $var2, $var3);
 
 tia.. and please reply directly.
 
 [EMAIL PROTECTED]
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Monte Ohrt [EMAIL PROTECTED]
http://www.ispi.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] APC - new cache on the block

2001-01-11 Thread Monte Ohrt

After the release of Afterburner cache from beware, there is now a new
one to check out...
APC - Alternative PHP Cache

http://apc.communityconnect.com/

This one can work as a drop-in module, a bit handier than recompiling
just to try it.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] MySQL SELECT performance suggestions

2001-01-10 Thread Monte Ohrt

You don't need to select all the data to get the number of rows. Try
this:

select count(*) as total from products where $product_query;

Then use total instead of num_rows.
Be sure the elements in your where clause are properly indexed.

[EMAIL PROTECTED] wrote:
 
 Could someone suggest some options here for performance improvement?
 
 I have a table with about 300,000 entries/records by 7 columns/fields.  All of
 the information varies from entry, but only one field can be declared as UNIQUE.
 
 I have PHP perform SELECT queries on the table, and I need to display the
 results in a format of: "viewing $top to ($top+$depth) of $numrows found"
 
 I haven't found a way to determine $numrows without performing a second SELECT
 in this format:
 
 $numrows = mysql_num_rows (db_query("SELECT * FROM products WHERE
 $product_query"));
 if ( $numrows  $depth ) { $depth = $numrows; }
 $qid = db_query("SELECT * FROM products WHERE $product_query LIMIT $top,
 $depth");
 
 So, this takes about twice as long as it would without figuring the $numrows.
 Does anyone have any suggestions as far as what can be done to speed this up?
 Assume that the table in question is optimized with indexing and UNIQUE values.
 
 Thanks.
 
 Lee Howard
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]