Closed (fixed)
Project:
Views Filter Block
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Jan 2008 at 16:10 UTC
Updated:
5 Feb 2008 at 17:02 UTC
Jump to comment: Most recent file
Comments
Comment #1
douggreen commented@corix, first Thanks! (This was part of a (GHOP Task).
Second, why did you choose to iterate $conf instead of just calling variable_get('views_filterblock_num') and using that number?
Comment #2
corsix commentedIf you were to set it to say 5 blocks, and configure all five, then decide that you only need 3, then using views_filterblock_num would only get rid of the first 3, leaving the latter two.
Comment #3
dmitrig01 commentedAgreed, this was a good choice.
Comment #4
douggreen commentedI agree that it's a good choice, but I still don't like the code. You're doing a strlen() for each key in that loop, when this is something that you know outside the loop. I'd probably get the length up front, and then use
substr($key, 0, $len) == $prefix. "strncmp" is a sooo C/C++.Comment #5
corsix commentedAgreed, strlen should be done outside the loop. I'm unhappy about using substr, as it causes a new string to be created (you can tell I have a C/C++ background, can't you?), but it is more the PHP way.
Comment #6
douggreen commentedCommitted, Thanks!
Comment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.