Hi everybody,
I've searched the docs for a generic way to format strings and
numbers...
For example I have a brazilian zipcode witch is stored in database as
22252970 and must be formatted as N-NNN, where N is a number.
Also I have a tax id with is also stored as numeric value only,
Hi Richard,
On Jul 5, 2005, at 6:20 PM, Richard Lynch wrote:
On Mon, July 4, 2005 6:48 pm, Bruno B B Magalhães said:
For example I have a brazilian zipcode witch is stored in database as
Is she a Good Witch, or a Bad Witch? :-)
Ups, hehehehe!
22252970 and must be formatted as N-NNN
Well,
I've read the manual, and the ADOdb Date package functions, and I am
not using this because I want to keep my framework simple, flexible,
and fast.
Well, I just want a simple way to translate dates (I know what is the
input format) to unix timestamp, with ability to do this with
Hi Richard,
Well, I took a look at, and I think it is TOO complex to handler a
simple thing..
Well, that's my little contribution:
function str2time($input = '12/31/1969')
{
$year= substr($input, -4);
$input= substr_replace($input, 1976 , -4);
Hi Folks,
Well I think I got it, at least it's working more or less to me now...
I really would appreciate any comments or suggestions.
function str2time($input = '12/31/1969')
{
if(($output = strtotime($input)) !== -1)
{
return $output;
}
Hi Edward,
thanks for replying!
On Jul 7, 2005, at 10:44 PM, Edward Vermillion wrote:
One problem is that there's no accounting for leap years, but I
don't know if that's gonna cause you any problems or not.
Course it have, when we multiply the year offset by 31557376.189582
we are using
Just a quick fix, as now I've tested in a real environment, with a
real application, and now it's working 100%, well, I think so.
/
*
* Stritotime workaround for dates before 1970 and after 2038
Hi you all!
That's my problem: I have a configuration files with the following
structure...
$vars['varname'] = 'varvalue';
And I would like to have a module to change those parameters, but I
don't know how to write a pattern to match it...
Thanks in advance...
Best Regards,
Bruno B B
and write the strings..
Best Regards,
Bruno B B Magalhães
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi guys..
well I have a little problem, I succeeded on retrieving a value by
it's key, but I want a clean and faster method... Let me explain:
I have the following function which I use to set variables in my
framework like (configs, requests, etc)...
Hi guys..
well I have a little problem, I succeeded on retrieving a value by
it's key, but I want a clean and faster method... Let me explain:
I have the following function which I use to set variables in my
framework like (configs, requests, etc)...
Hi Jochem,
well, thanks for the code... it's working perfect, but it seams a
little bit slow as it's using while... doesn't?
Now, abusing of you, how can I unset a variable the same recursive
way? :D Maybe like this?
/
Hi guys,
is there any problems using $GLOBALS superglobal to carry all my global
classes instances?
For example:
$GLOBALS['myclass'] = new myclass();
Regards,
Bruno B B Magalhaes
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi Guys!
I need a help with a licensing system, I want something very simple,
for example a simple var store into the configuration file, and witch
is sent to a server called licenses.hostname.com.br, and this one
returns true or false... I don't wanna use SOAP or XML. Does any body
have a
Hi Richard,
And how do I generate this, and how would I check it?!?!
Thanks,
Bruno B B Magalhaes
On Apr 8, 2005, at 11:48 PM, Richard Lynch wrote:
On Fri, April 8, 2005 1:06 pm, Bruno B B Magalhães said:
I need a help with a licensing system, I want something very simple,
for example a simple var
Well,
I have a framework class witch loads and stores all classes in it.
I can´t post the all code, but some I cam:
Loading a core class like a database class:
---
function loadcore($handler, $class_name = '')
{
Hi guys,
I have a normal categories table:
catId
catParentId
catName
catStatus
But I want when a user enters on:
http://hostname/site/products/catId1/catId7/catId13/../../contentId.html
A listing should apear like that:
Category 1
Category 7
Category 13
Category 2
Category 3
false;
}
}
else
{
return false;
}
}
}
?
Regards,
Bruno B B Magalhães
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
false;
}
}
else
{
return false;
}
}
}
?
Regards,
Bruno B B Magalhães
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
of then:
http://www.zope.org
http://www.fusebox.org
http://www.mojavi.org
http://www.binarycloud.com
http://www.eZpublish.com
http://amb.sourceforge.net
http://www.phpmvc.net
http://phrame.itsd.ttu.edu
http://www.horde.org
Best Regards,
Bruno B B Magalhães
On Oct 23, 2004, at 4:04 PM, Igor wrote:
I need
Well,
we call it pre-testing, the only way, and the better one, is doing it
with the future users of your system!
Regards,
Bruno B B Magalhães
On Oct 23, 2004, at 10:00 PM, blackwater dev wrote:
Hello all,
I know I can use simpletest to test my application at the class level
but I need a tool
($oddsyntax[$i],'spam
class=highlighted'.$oddsyntax[$i].'/spam',$code);
}
return $code;
}
echo highlight_code($code);
Regards,
Bruno B B Magalhães
On Nov 5, 2004, at 6:39 PM, Aaron Gould wrote:
Could any of you privide some leads in regard to highlighting syntax
of an odd language? I have a large
Hi People,
well, I am building a very sophisticated(?) CMS, and I am thinking to
implement a keyword automatically generation function... I thought on
the following structure:
==
$submited_text = 'Lorem ipsum dolor sit amet, consectetuer adipiscing
elit, sed diam nonummy nibh
as:
$keywords = 'dolor,t,eu,te,in';
Got it?
Thanks,
Bruno B B Magalhaes
On Nov 5, 2004, at 7:42 PM, M. Sokolewicz wrote:
Bruno b b magalhães wrote:
Hi People,
well, I am building a very sophisticated(?) CMS, and I am thinking to
implement a keyword automatically generation function... I thought
delenit augue duis dolore te feugait
nulla facilisi. ';
echo generate_keywords($submited_text);
Thanks to Tularis and Sokolewicz .
Regards,
Bruno B B Magalhães
--
PHP General Mailing List (http://www.php.net
Hi,
I am trying to categorize the keywords... for example, if a word shows
at the begin probably its more important, but how many occurrences is
also important...
Does someone knows Googles formula? hehe
This code is working more or less as expected!
Many Thanks,
Bruno
.
Regards,
Bruno B B Magalhães
On Nov 7, 2004, at 8:44 AM, Reinhart Viane wrote:
Hey all,
Hope some of you also work on sundays :)
I have a little javascript which displays a images (with previous /
next
thing)
Now, i populate the javascript array with an php array:
SCRIPT LANGUAGE=JavaScript
!-- Begin
Hi guys,
well, I wrote a class for a big project (a framework), and here it is,
I was wondering if someone have any suggestions regarding flexibility
and security.
Course it uses specific framework classes but it's quite understable..
Hi,
I my system can handle invisible modules, so they can't show in the
menu but stills works... here is the code:
$c = count($modules)-1;
for($i = 0; $i = $c; $i++)
{
if($modules[$i]['moduleVisibility'] == 0)
{
Hi people,
is it possible to have a solution that works like an autoloader... for
example:
$myclass = new class();
but if this class wasn't loaded yet, it loads by itself... egg:
if(class_exists(class))
{
$myclass = new class();
}
else
{
require_once(PATH_DIR.'class.class.php');
Is this good or bad? heheh!
Regards,
Bruno B B Magalhaes
On Nov 16, 2004, at 3:31 PM, raditha dissanayake wrote:
Bruno B B Magalhães wrote:
Hi guys,
well, I wrote a class for a big project (a framework), and here it
is, I was wondering if someone have any suggestions regarding
flexibility
Pablo,
This is a very complex discussion... But generalizing, a LOT, OO is
more appropriated for big systems due to its extensibility and easy
maintenance, while procedural approach works best for small
applications that don't require to much updates and aren't too complex.
Here is a
Continuing the classes questions...
I have a class loader called 'load_core_class($class=''), but if $class
equals to all I would like to load all classes in the core directory,
include then AND start then this way:
$this-$loadedclassname = new $loadedclassname;
Is it possible?
Regards,
Bruno B
Hi guys,
In my framework I have some classes that depends from others (like
authentication depends of database)... So I wrote is method inside the
framework class, and I would like to know if is it an intelligent
solution or not:
class dependent
{
function dependent ($framework)
as
foreach($modules as $module) { } our also a faster one for($i=0;
$i $t; $i++) { } where $t = count($modules)-1;.
Best Regards,
Bruno B B Magalhães
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
believe that others do too. So I think that this is the worst
kind of comment or suggestion someone can receive.
Sorry everybody.
Regards,
Bruno B B Magalhães
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi,
course you can, you should search harder for it, but I will facilitate
for you! :o)
http://www.phpclasses.org/browse/package/1477.html
Best Regards,
Bruno B B Magalhães
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Does anyone has a solid benchmark about comments speed.. I mean, too
many comments will decrease speed of the PHP scripts...
I've tried without success using a class, and also a simple micro-time
operation... Well, cause the file is evaluated before it is executed, I
didn't had success.
Any
Hi again guys,
does anybody have am idea of witch are the required functions to
implement a database query cache? I have a very nice and fast database
layer, witch I use in all my projects (about 19 sites and a lot of
others hot-sites and systems like intranet and extranets). Here is my
idea
I am using mysql with cache results enable, but as every addicted I
want more and more... course I have to benchmark it to see if its
worth...
Regards,
Bruno B B Magalhes
On Dec 8, 2004, at 8:34 PM, John Holmes wrote:
Bruno B B Magalhes wrote:
Hi again guys,
does anybody have am idea of witch
Hi guys,
As part of my framework I have a URI decoder so it explode, remove
unnecessary data (as GET query) amd put it into an array...
Is there any better way of doing this (faster?), just wondering.
if(isset($_SERVER['REQUEST_URI']) === true)
{
'] or ...
It's all in there, though you might have to tear it apart a bit to get
exactly what you want.
Bruno B B Magalhães wrote:
Hi Richard,
well but I want also the file it self to be included in it...
Regards,
Bruno B B Magalhaes
But I need
On Dec 10, 2004, at 8:20 PM, Richard Lynch wrote:
Bruno B B
Hi again everybody,
well, I've asked it before, but I couldn't work on this at all.
As some knows I have a system witch has a category system. The generic
part of the site is handled by a generic module called contents...
generic like products, services, company, etc. Where the content layout
Thanks Richard!
Helped a lot!
Regards,
Bruno B B Magalhaes
On Dec 13, 2004, at 4:16 PM, Richard Lynch wrote:
Bruno B B Magalhães wrote:
Hi again everybody,
well, I've asked it before, but I couldn't work on this at all.
As some knows I have a system witch has a category system. The generic
part
Hi you all,
is that possible using .htaccess to redirect every request to a
specified script?
for example if you have:
http://www.yoursite.com/en/articles/blab.html
where there isn't a en dir., so it would be redirected to
public_html/site
I could use error page, but it won't receive post, get,
Hi guys,
I've installed the zend Optimizer with my Mac OS X, Apache 1.2, PHP5.
And guess what, it became about 40% slower!!!
My framework was running for example in the modules administration
(admin area) at 0.104ms, and now the average is 0.2ms - 0.24ms
Does anybody have any idea of what hell
Hi everybody,
well I was measuring my framework performance on a real production
server... And the average execution time with 20 requests per second
is 0.025 seconds. Course it will change according to the server
hardware, but I am searching for a REALLY fast framework environment
that can
to the hour.
Regards,
Bruno B B Magalhães
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
))
{
$this-local_timezone_offset = $this-default_timezone_offset -
$this-server_timezone_offset;
return time()+3600*$this-local_timezone_offset;
}
else
{
return time();
}
}
=
Nice regards to you all,
Bruno B B Magalhães
way
to fetch paginated results quicker? I had a project list, without
pagination, and when I added the pagination function, it slowed down up
to 0.0125 secs. Before it was running at 0.0600 more or less, and now
it´s running at 0.07 to 0.075...
Best Regards,
Bruno B B Magalhães
--
PHP General
,
Bruno B B Magalhães
On Jan 7, 2005, at 10:09 PM, M. Sokolewicz wrote:
first of all, you're running 4 queries here. 4 queries is a lot!
Especially when you don't need more than 2 ;)
the problem here is that your queries are pretty unknown to this
function. Although it does a nice result
Hi people,
I have a small class that encodes and decodes ubb code, no problem with
this.. But..
My question is, what is the correct use of the translation routines in
a CMS... I meam:
When creating a new article:
New article form --- UBB Encode --- Database
Hi people,
how to determine if the last char of a string is a '/'...
The problem, a webpage can be accessed by www.domain.com/page.php or
www.domain.com/page.php/
Regards,
Bruno B B Magalhães
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Richard,
my solution right know is:
if(substr($url,-1) != '/')
{
$url = $url.'/';
}
Simple and fast... :)
Regards,
Bruno B B Magalhaes
On Jan 12, 2005, at 3:37 PM, Richard Lynch wrote:
Bruno B B Magalhães wrote:
how to determine if the last char of a string is a '/'...
The problem
Hi everybody,
How do you save the date and time in the database? Time stamp or date
and time? GMT timezone or the server timezone, or maybe the configs
timezone? And when displaying apply user timezone to the GMT date?
I think it's easier to save in timestamp format, so it's easy to
convert to
Hi you all,
I am having a very big problem... I have an article module in a system,
when an user creates an article it's parsed (as everything else in the
system) by an input class, after, it is checked for emptily and after
is build an insert query... But the break-lines just disappear... I've
56 matches
Mail list logo