php-general Digest 2 May 2010 21:39:45 -0000 Issue 6724
Topics (messages 304841 through 304850):
Joomla FrameWork ::
304841 by: Nick Balestra
304842 by: Nick Balestra
304843 by: viraj
304844 by: Nick Balestra
304849 by: Andre Polykanine
Re: Any One See where this is going wrong?
304845 by: Gary
Re: Object or such for building a directory tree?
304846 by: tedd
Re: Two color rows in table inside while iteration [X-PHP]
304847 by: tedd
Re: wondering how to catch notice errors properly
304848 by: Hans Ã
hlin
Re: Two color rows in table inside while iteration
304850 by: Nathan Rixham
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-gene...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
I am trying to understand how the joomla framework works, i see an heavy usage
of " :: " in its code, here an example:
function edit ()
{
JRequest::setVar('view, 'single');
$this ->display();
}
from my really basic php understanding in the function edit i call a function
setVar() and i pass the paramter 'view' and 'single' in it then the output
($this) is passed to the display() function.
My question is what does :: means? an more precisely referring to the example:
JRequest::setVar('view, 'single'); how do you read it and how do you manage
it?
Cheers, Nick
--- End Message ---
--- Begin Message ---
I think si related to class and methods,
JRequest Class have a method called setVar, right? if this is correct sorry for
posting the question, i just haven't started yet classes and methods...;-)
On May 2, 2010, at 4:41 PM, Nick Balestra wrote:
> I am trying to understand how the joomla framework works, i see an heavy
> usage of " :: " in its code, here an example:
>
> function edit ()
> {
> JRequest::setVar('view, 'single');
> $this ->display();
> }
>
>
> from my really basic php understanding in the function edit i call a function
> setVar() and i pass the paramter 'view' and 'single' in it then the output
> ($this) is passed to the display() function.
>
> My question is what does :: means? an more precisely referring to the
> example: JRequest::setVar('view, 'single'); how do you read it and how do
> you manage it?
>
> Cheers, Nick
--- End Message ---
--- Begin Message ---
hi nick,
:: is what we call 'scope resolution operator', $this is your 'current scope'.
i guess you better read
http://www.php.net/manual/en/language.oop5.php.. all sections :))
~viraj
On Sun, May 2, 2010 at 8:11 PM, Nick Balestra <n...@beyounic.com> wrote:
> I am trying to understand how the joomla framework works, i see an heavy
> usage of " :: " in its code, here an example:
>
> function edit ()
> {
> JRequest::setVar('view, 'single');
> $this ->display();
> }
>
>
> from my really basic php understanding in the function edit i call a function
> setVar() and i pass the paramter 'view' and 'single' in it then the output
> ($this) is passed to the display() function.
>
> My question is what does :: means? an more precisely referring to the
> example: JRequest::setVar('view, 'single'); how do you read it and how do
> you manage it?
>
> Cheers, Nick
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Thank a lot for pointing me to this, as you wrote u are right, haven't started
yet with oo so of course i wasn't able to understand what was this all about.
thanks again
Nick
On May 2, 2010, at 4:52 PM, viraj wrote:
> hi nick,
> :: is what we call 'scope resolution operator', $this is your 'current scope'.
>
> i guess you better read
> http://www.php.net/manual/en/language.oop5.php.. all sections :))
>
>
> ~viraj
>
>
>
> On Sun, May 2, 2010 at 8:11 PM, Nick Balestra <n...@beyounic.com> wrote:
>> I am trying to understand how the joomla framework works, i see an heavy
>> usage of " :: " in its code, here an example:
>>
>> function edit ()
>> {
>> JRequest::setVar('view, 'single');
>> $this ->display();
>> }
>>
>>
>> from my really basic php understanding in the function edit i call a
>> function setVar() and i pass the paramter 'view' and 'single' in it then the
>> output ($this) is passed to the display() function.
>>
>> My question is what does :: means? an more precisely referring to the
>> example: JRequest::setVar('view, 'single'); how do you read it and how do
>> you manage it?
>>
>> Cheers, Nick
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
--- End Message ---
--- Begin Message ---
Hello Nick,
That means that the function SetVar is situated in the jRequest class.
So if you want to modify the function, for example, you need to know
where the class jRequest is situated.
--
With best regards from Ukraine,
Andre
Skype: Francophile; Wlm&MSN: arthaelon @ yandex.ru; Jabber: arthaelon @
jabber.org
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: m_elensule
----- Original message -----
From: Nick Balestra <n...@beyounic.com>
To: php-gene...@lists.php.net <php-gene...@lists.php.net>
Date: Sunday, May 2, 2010, 5:41:07 PM
Subject: [PHP] Joomla FrameWork ::
I am trying to understand how the joomla framework works, i see an heavy usage
of " :: " in its code, here an example:
function edit ()
{
JRequest::setVar('view, 'single');
$this ->display();
}
from my really basic php understanding in the function edit i call a function
setVar() and i pass the paramter 'view' and 'single' in it then the output
($this) is passed to the display() function.
My question is what does :: means? an more precisely referring to the example:
JRequest::setVar('view, 'single'); how do you read it and how do you manage
it?
Cheers, Nick
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
"Adam Richardson" <simples...@gmail.com> wrote in message
news:aanlktikuqehnrjcannzq8ezvmx5pneg_bjvezglj0...@mail.gmail.com...
> On Sat, May 1, 2010 at 6:54 PM, Gary <gwp...@ptd.net> wrote:
>
>>
>> "Adam Richardson" <simples...@gmail.com> wrote in message
>> news:aanlktinqixxb9oipu4op2xztrze_vwpbymaywziwb...@mail.gmail.com...
>> > >
>> >> $sqlStatements = "INSERT INTO guns (manufacturer, type, model,
>> >> caliber,
>> >>
>> > condition, price, description, image_file_name, available) VALUES
>> >
>> > ('$manufacturer',
>> >> '$type',
>> >>
>> '$model','$caliber','$condition','$price','$description','$image_file_name','$available');
>> >
>> > INSERT INTO images(id, image_file) VALUES ('', '$image_file')";
>> >
>> >
>> > Gary, the second insert has what appears to be a troublesome bit of
>> > code:
>> >
>> > VALUES ('', '$image_file')";
>> >
>> > Shouldn't it read:
>> >
>> > INSERT INTO images(image_file) VALUES ('$image_file')";
>> >
>> > That's assuming you have id set to auto-increment, so no id in the
>> > first
>> > or
>> > second set of parentheses. Additionally, the ", before the $image_file
>> > var
>> > would cause issues, too.
>> >
>> > Adam
>> > --
>> > Nephtali: PHP web framework that functions beautifully
>> > http://nephtaliproject.com
>> >
>> >
>> >
>> > __________ Information from ESET Smart Security, version of virus
>> > signature database 5078 (20100501) __________
>> >
>> > The message was checked by ESET Smart Security.
>> >
>> > http://www.eset.com
>> >
>> >
>>
>> Adam
>>
>> The second INSERT is part of a multi_query, and yes there is a
>> auto-increment field in front named id, it is the foreign key that links
>> the tables.
>>
>> I had removed, and just tried again, but the same result.
>>
>> I have tried it so many ways my fingers and eyes are about to bleed. It
>> makes not sense how it works in one but not the other.
>>
>> I cant see to get the error called out.
>>
>> Thanks again.
>>
>> Gary
>>
>>
>>
>>
>> __________ Information from ESET Smart Security, version of virus
>> signature
>> database 5078 (20100501) __________
>>
>> The message was checked by ESET Smart Security.
>>
>> http://www.eset.com
>>
>>
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
> And you also removed the double quote and the comma next to it (sorry,
> just
> making sure?) That is to say, you copied the line of code I sent?
>
> $sqlStatements = "INSERT INTO guns( *id,*manufacturer, type, model, //
> *id,*should be removed
> caliber, condition, price, description, image_file_name,submitted
> ,available) VALUES ('*',*'$manufacturer', '$type', '$model', '$caliber',
> // the *",* combo should be removed
> '$condition', '$price', '$description','$image_file_name', ' ',
> '$available');
>
> INSERT INTO images (*id,* image_file) VALUES('','$image_file')";
> //
> the *id,* should be removed AND the *",* combo should be removed
>
> Also, have you tried directly echoing out the error (e.g., *echo
> mysql_error();* if it's mysql you're using, or the comparable method in
> the
> library you're using.)
>
> If that didn't work, I'd break up the multi-query into 2 separate queries
> to
> better troubleshoot the issue. I like using PDO and setting it up so it
> throws exceptions when something goes wrong (additionally, I like using
> the
> prepared statements, too.) Have you been trying that?
>
> I'm still hopeful you'll get this figured out before there's any
> blood-loss
> ;)
>
> Feel free to send back the new code after the edits if you still have
> issues.
>
> Adam
>
> --
> Nephtali: PHP web framework that functions beautifully
> http://nephtaliproject.com
>
>
>
> __________ Information from ESET Smart Security, version of virus
> signature database 5078 (20100501) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
>
>
Adam
What I ended up doing was I rebuilt the entire thing from start. I created
one table with one column, made sure it worked, then added a few more, then
added the child table.
The only thing that I can think of is that I had one of the columns named
"id", and maybe that is not allowed.
I also just had the form processed on itself, but I cant really imagine that
would have anything to do with it.
I'll post the code later if interested, I am still adding columns, but the
child is working so that would seem to be the only real challenge.
Thanks for all your input.
Gary
__________ Information from ESET Smart Security, version of virus signature
database 5080 (20100502) __________
The message was checked by ESET Smart Security.
http://www.eset.com
--- End Message ---
--- Begin Message ---
At 1:49 AM +0200 5/2/10, Michelle Konzack wrote:
Hello tedd,
Am 2010-05-01 11:54:45, hacktest Du folgendes herunter:
Now on to your problem. You want to take a multidimensional array
that contains the names of directories and names of the files
contained therein and show them in a file tree where you can open
and close the nodes of the tree to show contents -- is that correct?
Yes for the File-Browser. The IMAP Browser need only the directory
structure, but...
It's pretty simple to populate an array in PHP to contain
directories and files. To do this via PHP can produce something like
this:
> http://php1.net/b/file-browser
But where is the PHP script? There is no link to download the ZIP.
That's because I've chosen not to make it public -- it's something I
did for a client.
I only showed the link to make my point that it can be done and to
support a case for using javascript to finish the idea.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
At 11:53 PM -0400 5/1/10, Paul M Foster wrote:
On Fri, Apr 30, 2010 at 01:52:25PM -0400, tedd wrote:
> All the code I provide on this list and on my various web sites is
for free for anyone, except for "governments" (i.e., local, state,
federal, other), to use, review, and/or comment as they wish without
any obligation to me. Oh, as for "governments" if you want a copy of
anything please contact me directly, I have a few forms for you to
fill out.
If you think about it, that's pretty hilarious. Normally, doing anything
with the government requires *you* to fill out a few forms. Making
*them* do it to use your stuff is humorously appropriate.
Paul
Paul:
<government rant>
That wasn't an original idea of mine, but something I experienced in
my last life when I was employed in petroleum exploration industry
(see http://geophysics.com). That was before the US Government
declared OIL a four letter word.
At that time there was an Oil Company who was a client of mine and
they owned a parking structure in Dallas. The Federal government
asked for a suit of parking spaces from them to lease. The company
relied with a list of required documents for the Feds to fill-out
which included proof as to the Feds complying with OSHA, EPA, IRS,
ADA, and so on. It made the local papers.
Yes, it would be nice if the people who work for the government also
had to live under the same rules as the rest of us. As it is, they
live in a state of privilege enjoying salaries that are typically 175
percent above that of the private sector with benefits to match. They
do this without advancing the quality of life for anyone -- they have
no purpose other than to push papers, collect *their* wages, enjoy
*their* health insurance, and wait for *their* lavish retirement. Of
course, they claim they have purpose, but most of us know better. The
sooner we reduce the size and importance of government, the better
off we all will be.
</government rant>
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
Thanks for that, it saved me some thinking when I reach the error
handling class with in my project.
**********************************************
Hans Åhlin
Tel: +46761488019
http://www.kronan-net.com/
irc://irc.freenode.net:6667 - TheCoin
**********************************************
2010/5/2 Rene Veerman <rene7...@gmail.com>:
> On Sun, May 2, 2010 at 1:06 AM, Rene Veerman <rene7...@gmail.com> wrote:
>> I have an custom error handler that i initialize as such;
>>
>> error_reporting(E_ALL);
>> $oldError_handler = set_error_handler("nonFatalErrorHandler");
>>
>> with this, notices are still displayed as single line visible html.
>> i'd like to catch the notices and push them into a db.
>> any ideas on how i do that?
>>
> http://www.codeunit.co.za/2009/09/09/php-how-to-catch-a-script-warning-or-notice/
>
> has the answer :)
>
>
>> --
>> ---------------------------------
>> Greetings from Rene7705,
>>
>> My free open source webcomponents:
>> http://code.google.com/u/rene7705/
>> http://mediabeez.ws/downloads (and demos)
>>
>> http://www.facebook.com/rene7705
>> ---------------------------------
>>
>
>
>
> --
> ---------------------------------
> Greetings from Rene7705,
>
> My free open source webcomponents:
> http://code.google.com/u/rene7705/
> http://mediabeez.ws/downloads (and demos)
>
> http://www.facebook.com/rene7705
> ---------------------------------
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
Paul M Foster wrote:
> On Fri, Apr 30, 2010 at 01:52:25PM -0400, tedd wrote:
>
>> At 10:34 AM -0400 4/30/10, Paul M Foster wrote:
>>> On Thu, Apr 29, 2010 at 05:34:38PM -0400, tedd wrote:
>>>
>>> > Please critically review my example.
>>>
>>> +1
>>>
>>> This thread came up before, and tedd's solution was the least complex,
>>> as far as I could tell. I shamelessly stole his code and regularly use
>>> it in my own projects. ;-}
>>>
>>> Paul
>> Paul:
>>
>> Thanks for the plug.
>>
>> All the code I provide on this list and on my various web sites is
>> for free for anyone, except for "governments" (i.e., local, state,
>> federal, other), to use, review, and/or comment as they wish without
>> any obligation to me. Oh, as for "governments" if you want a copy of
>> anything please contact me directly, I have a few forms for you to
>> fill out.
>
> If you think about it, that's pretty hilarious. Normally, doing anything
> with the government requires *you* to fill out a few forms. Making
> *them* do it to use your stuff is humorously appropriate.
Tedd,
That's awesome.
Best,
Nathan
--- End Message ---