Re: [PHP] html area

2006-02-28 Thread Grant Young
Tiny_MCE is another fairly simple editor - although I've experienced 
some quirks that can be quite annoying/tricky.

http://tinymce.moxiecode.com/

Regards, Grant

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



Re: [PHP] About date & time...

2006-02-28 Thread Grant Young

Hi Gustav.



I'm a swede, and I we use hours 0 - 24.

8 pm = 20 for us.
9 pm = 21 for us
10 pm = 22...

and so on...

But with date()-function there is 10 pm that shows (and I want 22 to 
show instead)


I'm using PHP 4.0.3...

Do I have to use getdate() then? (getdate()-function showed 22...)


The docs for date() (http://www.php.net/date) show that there are a 
number of different options for the first parameter.  If you check out 
the table on that page, you'll find:


>> H | 24-hour format of an hour with leading zeros | 00 through 23

With this in mind, the following will work (if I understand your 
question correctly):


$t = date('H\:\ i\:\ s');

HTH, Grant

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



Re: [PHP] Where can I find nice Web icons for custom admin interface?

2006-03-02 Thread Grant Young

Hi Nicolas.

I've collected some pointers over the past few months to royalty free 
icons and designers at:

http://del.icio.us/braquin/icons

HTH.

Regards, Grant

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



Re: [PHP] DB calls vs Session solution

2006-03-13 Thread Grant Young

Hi Jochem.


the nice thing about programming with my 'data framework' is that its
very generic, flexible and interspective (generating abitrarily complex
sql/html/? from objects) ... which comes with a great cost.

so I have code that is really very very heavy but if you consider
the (complete|discount|standard|bundeled) price calculation routines
for the site I was speaking of, are 1000's of lines in themselves you
might agree that a more structured apporach to the code bear fruits
in maintainability/extensability (which has been my finding overall).
bottom line is [they] have to buy a bigger box. :-)

actually my real problem lies in not being [cap]able of using the
Smarty cache (I can't figure out how it works/how to use it)


I'm thinking that output (HTML) caching might be an option for you - you 
seem to be hinting at that with the Smarty reference above.  Probably 
depends mostly on how many variables you have to deal with.  And I would 
still look into using MySQL level caching as well if the query execution 
time is more than a second or two.


I'm in the process of optimising a CMS at the moment which fits your 
description of "very generic, flexible and interspective (generating 
abitrarily complex sql/html/? from objects) ... which comes with a great 
cost."  The biggest bottleneck in my app was not complex SQL, but PHP 
picking up all the include files (classes etc.), but that's beside the 
point.


In my project I implemented an output cache (caching just the HTML) 
based on the full URI for text/html content-type GET requests - taking 
into consideration the query string parameters.  Admittedly it's a very 
aggressive cache, and I may have to change it to allow for flexibility 
based on user ID or other parameters, but it does improve performance 
significantly.  I query the cache before loading my framework, which is 
where most of the performance benefit comes from in my particular app.


Another benefit to this approach is that it would be fairly easy to code 
the caching system "around" your existing framework i.e. if no cache 
hit, handle the request using your framework, then store to the cache 
via the output buffer.


As far as I know you would be able to use APC for this type caching (I 
haven't used APC but have read up on it a little recently).  It might 
even be possible to GZIP the output before caching to reduce memory 
requirements, at a small performance cost when dynamically generating 
the content.  The approach could also be used for HTML fragments (i.e. 
just the changing area - the results listing HTML etc.)


FWIW, Smarty probably doesn't do quite what you want (I use Smarty in 
the CMS, but afaict you need to know the template name + a unique ID to 
use the cache - if the template name can be hard coded, no dramas, but 
if it's dynamically loaded, it becomes trickier - including the Smarty 
class also incurs a performance overhead).


Not sure if any of that's useful?

BTW, if anyone sees any serious issues with this approach, let me know.  
I don't intend to roll out the solution to a live system for a while, so 
I still have plenty of time to revisit.


Regards, Grant

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



Re: [PHP] Get class name in static method

2006-03-20 Thread Grant Young

Not sure about PHP5, but for PHP4 I found this hack solution at:
http://passivedigressive.com/archives/2005-02/php-static-class-name-solution/

There are probably all sorts of issues with this approach, but it solved 
the problem at the time...


HTH.  Grant

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



Re: [PHP] Best authentication method for user

2006-04-03 Thread Grant Young

Hi Alain.

On the authentication front, you can use HTTP basic authentication for 
this kind of thing too - and it means you're not having to re-invent the 
wheel in a lot of ways.  The Auth_HTTP PEAR module makes this pretty 
simple to implement:

http://pear.php.net/package/Auth_HTTP/

You can integrate you're own authentication mechanisms (i.e. DB stored 
passwords, LDAP authentication, whatever you like really) quite easily.


Permissions systems are harder to implement.  The PEAR LiveUser package 
is attempting to make this a bit easier too:

http://pear.php.net/package/LiveUser/

HTH. Grant

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