php-general Digest 22 Aug 2006 12:27:23 -0000 Issue 4307
Topics (messages 240975 through 240987):
Re: Shopping cart
240975 by: Larry Garfield
Re: Recommendations for PHP debuggers?
240976 by: Larry Garfield
240977 by: Lester Caine
240978 by: Colin Guthrie
Emphasizing first letter of string?
240979 by: Micky Hulse
240980 by: Arpad Ray
240981 by: David Tulloh
240982 by: Stut
240983 by: Micky Hulse
240984 by: Micky Hulse
Re: [solved] Emphasizing first letter of string?
240985 by: Micky Hulse
Overriding core functions
240986 by: Peter Lauri
240987 by: Jochem Maas
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 ---
There may be other canned solutions that are not as bad as OSCommerce. It's
the only one I've worked with other than Drupal. I've worked with Drupal
extensively, but haven't used its ecommerce modules extensively.
But yes, I highly recommend OSCommerce as an example of how not to write a PHP
application, of any kind.
On Monday 21 August 2006 15:18, Gerry D wrote:
> So if I understand you gentlemen correctly, these pre-builds serve as
> examples how NOT to do it?
>
> Gerry
>
> On 8/20/06, Larry Garfield <[EMAIL PROTECTED]> wrote:
> > On Sunday 20 August 2006 20:17, Gerry D wrote:
> > > On 8/19/06, Larry Garfield <[EMAIL PROTECTED]> wrote:
> > > > OSCommerce is crap. Don't bother.
> > >
> > > Why do you say that, Larry? I may want to get into an app like that
> > > because I think one of my clients is ready for it. What are the cons,
> > > and what are my options? What are Drupal's limitations?
> >
> > I tried using it for a client last summer, because it was available free
> > on the client's web host. It is extremely rigid. If you want a program
> > that works the way they want and looks kinda like Buy.com with a
> > table-based layout in 3 columns with certain visual effects, it's fine.
> > If you want to change or customize anything, good luck. Nearly
> > everything is hard coded with HTML and presentation PHP and business
> > logic PHP all mixed in together. With a table based layout.
> >
> > Ugh.
> >
> > As for using pre-build vs. rolling your own, the main reason I favor
> > ready-made is the bank hookups. Anytime financial stuff is involved, I'd
> > rather use something someone else already debugged than roll my own.
--
Larry Garfield AIM: LOLG42
[EMAIL PROTECTED] ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson
--- End Message ---
--- Begin Message ---
On Monday 21 August 2006 09:52, Colin Guthrie wrote:
> Larry Garfield wrote:
> > I'm watching this thread closely myself, as I'd love something to use at
> > home (on Linux) that doesn't cost what Zend does. :-) Currently I use
> > PHPeclipse, but it is frankly not that good (the code assistance feature
> > is rudimentary at best), and I've not setup the debugger yet. That, and
> > Eclipse itself is just a dog slow memory hog.
>
> Did you look at this? I posted it earlier and although I've not hooked
> up the debugger, AFAIK it's free (but provided by Zend), so it should
> suit you nicely (except that you'll still need that extra gig of ram to
> run eclipse ;))
>
> http://www.zend.com/phpide/
I just tried to install the modular version for my existing Eclipse install.
It insists it won't install without feaure org.eclipse.emf (2.2.0). Since it
provides no indication of how to get such feature, I haven't been able to
give it a serious look. :-)
--
Larry Garfield AIM: LOLG42
[EMAIL PROTECTED] ICQ: 6817012
"If nature has made any one thing less susceptible than all others of
exclusive property, it is the action of the thinking power called an idea,
which an individual may exclusively possess as long as he keeps it to
himself; but the moment it is divulged, it forces itself into the possession
of every one, and the receiver cannot dispossess himself of it." -- Thomas
Jefferson
--- End Message ---
--- Begin Message ---
Larry Garfield wrote:
I'm watching this thread closely myself, as I'd love something to use at home
(on Linux) that doesn't cost what Zend does. :-) Currently I use PHPeclipse,
but it is frankly not that good (the code assistance feature is rudimentary
at best), and I've not setup the debugger yet. That, and Eclipse itself is
just a dog slow memory hog.
It would have been nice if PHPEclipse had been given the support it
needed to become the 'preferred' PHP addon for Eclipse rather than being
kneecapped by Zend who only want to promote their commercial interests.
PHPEclipse does it's job well, and is much more feature rich than
PDP-IDE. Had a little more support been given then we would have a
totally free IDE and would not be waiting for features that still need
to be written in PHP-IDE :(
I switched to PHPEclipse some time ago, and it does all that I need. I
had a debugger working at one time, but now all the 'debugging' is done
via inline functions rather than having to knobbly operation with an
external tool. I've not had to 'single step' a module for some time ;)
--
Lester Caine - G8HFL
-----------------------------
L.S.Caine Electronic Services - http://home.lsces.co.uk
Model Engineers Digital Workshop -
http://home.lsces.co.uk/ModelEngineersDigitalWorkshop/
Treasurer - Firebird Foundation Inc. - http://www.firebirdsql.org/index.php
--- End Message ---
--- Begin Message ---
Larry Garfield wrote:
http://www.zend.com/phpide/
I just tried to install the modular version for my existing Eclipse install.
It insists it won't install without feaure org.eclipse.emf (2.2.0). Since it
provides no indication of how to get such feature, I haven't been able to
give it a serious look. :-)
Yeah it took me a while to find all the dependancies myself hense why I
said the tarball was easier for takign it for a whirl, but seeing as my
own stubornness meant I found all the necessary updates I figured I'd
post them ;)
I'm sure you'll be able to work it out from here, or incorporate the xml
below into your own
~/.eclipse/org.eclipse.platform_3.2.0-mdk/configuration/org.eclipse.update/bookmarks.xml
file. ;)
<?xml version="1.0" encoding="UTF-8"?>
<bookmarks>
<site name="PHP IDE" url="http://downloads.zend.com/phpide"
web="false" selected="false" local="false"/>
<site name="EMF Update Manager Site"
url="http://download.eclipse.org/tools/emf/updates/" web="false"
selected="false" local="false"/>
<site name="GEF"
url="http://download.eclipse.org/tools/gef/updates/" web="false"
selected="false" local="false"/>
<site name="Visual Editor (JEM)"
url="http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/tools/ve/updates/1.0"
web="false" selected="false" local="f
alse"/>
<site name="Webtools"
url="http://download.eclipse.org/webtools/updates/" web="false"
selected="false" local="false"/>
<site name="Polarion (Subversive)"
url="http://www.polarion.org/projects/subversive/download/update-site/"
web="false" selected="true" local="false"/>
</bookmarks>
--- End Message ---
--- Begin Message ---
Hi,
It is getting late, and I do not think I am thinking clearly...
What would be the best way to wrap <em></em> tag around the first letter
of a string?
I know it has to be a combination of str_replace() and substr(), but due
to my level of sleepiness I am having a lot of trouble working this one
out...
Basically, if a config variable == true I want my script to loop through
an array of strings and emphasize the first letter of each string.
Make sense? Sorry, I am pretty sleepy... Hmmm, I am betting I will
discover the answer as soon as I send this email. :D
Anyway, any help would be great!
Cheers,
Micky
--- End Message ---
--- Begin Message ---
<?php
foreach ($strings as $key => $string) {
$strings[$key] = '<em>' . $string[0] . '</em>' . substr($string, 1);
}
?>
Micky Hulse wrote:
Hi,
It is getting late, and I do not think I am thinking clearly...
What would be the best way to wrap <em></em> tag around the first
letter of a string?
I know it has to be a combination of str_replace() and substr(), but
due to my level of sleepiness I am having a lot of trouble working
this one out...
Basically, if a config variable == true I want my script to loop
through an array of strings and emphasize the first letter of each
string.
Make sense? Sorry, I am pretty sleepy... Hmmm, I am betting I will
discover the answer as soon as I send this email. :D
Anyway, any help would be great!
Cheers,
Micky
--- End Message ---
--- Begin Message ---
Micky Hulse wrote:
> Hi,
>
> It is getting late, and I do not think I am thinking clearly...
>
> What would be the best way to wrap <em></em> tag around the first letter
> of a string?
>
> I know it has to be a combination of str_replace() and substr(), but due
> to my level of sleepiness I am having a lot of trouble working this one
> out...
>
> Basically, if a config variable == true I want my script to loop through
> an array of strings and emphasize the first letter of each string.
>
> Make sense? Sorry, I am pretty sleepy... Hmmm, I am betting I will
> discover the answer as soon as I send this email. :D
>
> Anyway, any help would be great!
It sounds like you really need some sleep.
$string = "hello world";
echo "<em>".$string{0}."</em>".substr($string, 1);
David
--- End Message ---
--- Begin Message ---
David Tulloh wrote:
echo "<em>".$string{0}."</em>".substr($string, 1);
I could be mistaken, but I seem to remember reading somewhere that using
that syntax to access characters in a string has been removed from PHP6.
I suggest you use $string[0] instead.
-Stut
--- End Message ---
--- Begin Message ---
Yeah, I do need sleep...
Thanks guys for the posts... exactly what I was looking for.
Oh, and I did come-up with something similar right after posting:
if($configs['access_key'] === true) {
$pages[$i][0] = substr_replace($pages[$i][0],
'<em>'.$pages[$i][0]{0}.'</em>', 0, 1);
}
Thanks again to both of you for the help. :D
:: presses send ::
:: pushes power button ::
:: closes eyes ::
zzZZzzZZzz
--- End Message ---
--- Begin Message ---
Stut wrote:
I could be mistaken, but I seem to remember reading somewhere that using
that syntax to access characters in a string has been removed from PHP6.
I suggest you use $string[0] instead.
(Yes, I am sleep-typing!)
Hi Stut,
Ah, thanks for bringing that up...
Changing this:
$pages[$i][0]{0}
To this:
$pages[$i][0][0]
Testing now. Thanks. :)
Cheers,
Micky
--- End Message ---
--- Begin Message ---
Thanks to you folks, this works even better:
if($configs['access_key'] === true) {
foreach($pages as $key => $string) {
$pages[$key][0] = '<em>'.$string[0][0].'</em>'.substr($string[0], 1);
}
}
Many thanks, :)
... Now I can sleep. :D
Cheers,
Micky
--- End Message ---
--- Begin Message ---
Hi,
I want to add some functionality when calling the mysql_query():
function mysql_query($Query) {
//do stuff before
mysql_query($Query);
//do things after
}
This would just be for one project where I want to record all Queries and
the result of them, creating an own logging function.
I did a lot of Google, but no article that I found that take care of this
subject.
/Peter
--- End Message ---
--- Begin Message ---
Peter Lauri wrote:
> Hi,
>
>
>
> I want to add some functionality when calling the mysql_query():
>
>
>
function my_query($Query) {
//do stuff before
mysql_query($Query);
//do things after
}
// or something like:
class PeteDB {
var $conn;
function PeteDB($db, $usr, $pwd, $etc) {
$this->conn = mysql_connect($db, $usr, $pwd, $etc);
if (!is_resource($this->conn)) die('db is useless'); // trigger_error()
}
function query($qry/*, $args*/) {
// do stuff
$r = mysql_query($qry, $this->conn);
// do more stuff
return $r;
}
}
/*
tada!
hint: always use some kind of wrapper for things like db related functions
(because it allows for stuff like this and, for instance, makes it alot easier
to
switch dbs - because you only have to change code in one place, not counting
any db-specific
sql floating around your app)
*/
>
>
>
> This would just be for one project where I want to record all Queries and
> the result of them, creating an own logging function.
>
>
>
> I did a lot of Google, but no article that I found that take care of this
> subject.
>
>
>
> /Peter
>
>
>
>
>
>
>
>
--- End Message ---