Re: [PHP] Highlighting image map on load

2009-12-15 Thread leledumbo
> I'm not sure if you can use CSS alone to highlight, but if you can, just > give the area a class as you output it with PHP That's the problem, area itself isn't visible, so giving a CSS class won't highlight it. -- View this message in context: http://old.nabble.com/Highlighting-image-map-on-

[PHP] Highlighting image map on load

2009-12-14 Thread leledumbo
I have image map with dynamic circle areas whose coordinates stored in database. I'd like to colorize these areas so that it's obvious to see them. Most solutions I found on the net highlights the area on mouse hover, while my needs is to do it once when the window is loaded. Any idea? -- View th

Re: [PHP] Multilingual website, texts in external JavaScript problem

2009-11-09 Thread leledumbo
> I don't see why you can't use inline script in XHTML 1.0 Strict Because I don't know about CDATA, thanks. -- View this message in context: http://old.nabble.com/Multilingual-website%2C-texts-in-external-JavaScript-problem-tp26261666p26278740.html Sent from the PHP - General mailing list archi

[PHP] Multilingual website, texts in external JavaScript problem

2009-11-08 Thread leledumbo
I need to create a multilingual website and my framework already gives me that facility. However, I also use JavaScript quite extensively and since XHTML 1.0 Strict doesn't allow inline script, I must use external .js file. The problem is in these scripts, there are strings that needs to be transl

Re: [PHP] Calling extension function from another

2009-08-29 Thread leledumbo
extension A has function a, extension B has function b. How can I make b calls a? -- View this message in context: http://www.nabble.com/Calling-extension-function-from-another-tp25185839p25200892.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List

[PHP] Calling extension function from another

2009-08-28 Thread leledumbo
Is it possible to call a function that resides in an extension from another extension? -- View this message in context: http://www.nabble.com/Calling-extension-function-from-another-tp25185839p25185839.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing

Re: [PHP] anchor inside form

2009-08-25 Thread leledumbo
> Why not just use another submit button? Because it's actually an entry in a tree-like menu. I need to send parameters via get method, and code above is one way I can think of. -- View this message in context: http://www.nabble.com/anchor-inside-form-tp25129981p25131146.html Sent from the PHP

[PHP] anchor inside form

2009-08-25 Thread leledumbo
If I have an anchor inside form, how can I send form using the anchor without displaying target url? I've tried the code below but IE says that this.form is null or empty and Firefox does nothing. # Pick me -- View this message in context: http://www.nabble.com/anchor-inside-form-tp25129

[PHP] HTML text extraction

2009-08-18 Thread leledumbo
Usually, a website gives preview of its articles by extracting some of the first characters. This is easy if the article is a pure text, but what if it's a HTML text? For instance, if I have the full text: bla bla bla item 1 item 2 item 3 and I take the first 40 characters,

RE: [PHP] Radio buttons problem

2009-08-10 Thread leledumbo
> Unless, of course, what you have is > >name[], email[], sex[0] >name[], email[], sex[1] >name[], email[], sex[2] Yep, that's exactly what I have. > If it's important to you that the indexes match across name[], email[] and > sex[], then you must supply > them explicitly for every

RE: [PHP] Radio buttons problem

2009-08-10 Thread leledumbo
> Why do you? There's no reason you *have* to have consecutive indexes -- just iterate over the resulting > array with foreach, and there's no problem. There is, the entries are grouped by its index. So, I group name[0], email[0], and sex[0] as one. The problem if I don't maintain the index for r

Re: [PHP] Radio buttons problem

2009-08-06 Thread leledumbo
> you will have to manually maintain the number in the bracket. but you > can try using a template engine like smarty, and use a for loop to > take care of the numbers in the brackets Well.. the entries are inserted / deleted dynamically using JavaScript (to avoid unnecessary refresh). Why can't

Re: [PHP] Radio buttons problem

2009-08-06 Thread leledumbo
> This should work: > > > > > Yes, that works. But should I manually maintain the number in the bracket? Is there anyway so that it can be automatically maintained? Because my app allows to delete entries arbitrarily. For instance, consider this layout (+ is insert button, - is delete): ent

[PHP] Radio buttons problem

2009-08-03 Thread leledumbo
I'm creating a form with variable number of entries (user controlled) where each entry consists of some input fields. For most input types, appending [] to their names is enough to allow me processing each entry. So, for instance, if there are 3 entries with field name[] and email[], they can be a

Re: [PHP] if elseif elseif elseif....

2009-03-05 Thread leledumbo
Daniel Brown-7 wrote: > > On Wed, Mar 4, 2009 at 20:10, Al wrote: >> >> $obligatoryFieldNotPresent=null; >> >> foreach($_POST, as $value) >> { >>if(!empty($value)continue; > > Parse error. ;-P > There should be no comma there. See http://id2.php.net/manual/en/control-structures.

Re: [PHP] optimizing space for array of booleans

2009-02-25 Thread leledumbo
> but you're trying to pass stuff to it: > >public function tostring() { > $str = $this->binstr($this->bits[0]); > for ($i=1;$i<8;$i++) >$str .= "," . $this->binstr($this->bits[$i]); > return $str; >} Slap (on my face)! My stupidity... I come from a strongly typed

Re: [PHP] optimizing space for array of booleans

2009-02-24 Thread leledumbo
Good points, I'll try it. > Without testing it (it's late here), your binstr() function doesn't > accept parameters, so it would always return the same result each time > it's called, regardless of what you pass into it. In case you want to check it tomorrow or later: private function binstr()

Re: [PHP] optimizing space for array of booleans

2009-02-24 Thread leledumbo
> Generally relationships like the one you describe are stored in three > separate and related tables: Students, Courses, and Enrollment. The > latter is a n:m association between the first two. The advantage this > approach has with regard to storage is that it is a sparse matrix. I've done that

Re: [PHP] optimizing space for array of booleans

2009-02-24 Thread leledumbo
Just tried serializing array of 256 booleans and printing the length, it really shocked me: 2458. This project will be used by about 500 students, so in the worst case (all students enroll all courses) it will eat 500 * 2458 (assuming one character eats one byte) = 1229000 Bytes ~= 1.2 MB. Not a b

Re: [PHP] optimizing space for array of booleans

2009-02-23 Thread leledumbo
> you should not worry about optimizing boolean values unless you would store them in database. I DO need to store them in a database, that's why I'm asking. I won't care if I only use PHP, since it won't keep my data in memory for a long time. > anyways, use bitwise operators I think I've stated

[PHP] optimizing space for array of booleans

2009-02-23 Thread leledumbo
Some languages allows to bit-pack structures to save spaces. Since PHP doesn't have native set data type and operations, will array of booleans be optimized as such? If not, how can I achieve the same result? I need to save about 200 boolean values and I guess it's a good idea to use bitsets. Req

[PHP] Class constant inconsistency

2009-02-08 Thread leledumbo
I've read the docs about class constants and found some inconsistency (at least according to my knowledge), namely in the following statement: "The value must be a constant expression, not (for example) a variable, a class member, result of a mathematical operation or a function call." Questions

RE: [PHP] Visibility of class constant

2009-02-03 Thread leledumbo
Got it, thanks. I see that PHP is unlike many other OO language, it's a little stricter in scoping. -- View this message in context: http://www.nabble.com/Visibility-of-class-constant-tp21803985p21823751.html Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Maili

[PHP] Visibility of class constant

2009-02-02 Thread leledumbo
I got a weird behaviour of class constant. Suppose I have Index_Controller and Another_Controller classes, both extending Controller class. I define some constants (let's assume I only have one, call it MY_CONST) in Controller class to be used by its descendants. In Index_Controller, I can freely

RE: [PHP] Please explain: index.php/index/index

2009-01-21 Thread leledumbo
Boyd, Todd M. wrote: > > IIRF - Ionics ISAPI Rewrite Filter [1] is totally free... and it > supports the use of Regular Expressions [2] in your rewrite rules. If > you're going to use any sort of MVC-based URLs in IIS, this library is a > must-have. > Thanks for the link, I'll try it tonight. -

Re: [PHP] Please explain: index.php/index/index

2009-01-21 Thread leledumbo
Is this web server specific? I can't get it to run under Microsoft IIS, but it works flawlessly in Apache. -- View this message in context: http://www.nabble.com/Please-explain%3A-index.php-index-index-tp21578728p21579384.html Sent from the PHP - General mailing list archive at Nabble.com. --

Re: [PHP] Please explain: index.php/index/index

2009-01-21 Thread leledumbo
Carlos Medina-2 wrote: > > this is a Front Controller situation (Pattern) > Could you explain more on that? I've never seen anything like this in any tutorial I've found on the net. I'm using kohana framework. So, if I have index.php/index/index where does it actually go? -- View this message

[PHP] Please explain: index.php/index/index

2009-01-21 Thread leledumbo
I don't understand it. index.php should be a file and indeed it's a file, so what does /index/index after it mean? There's no index directory under directory where index.php resides. -- View this message in context: http://www.nabble.com/Please-explain%3A-index.php-index-index-tp21578728p2157872