On Mon, May 25, 2015 at 2:54 AM Tiffany Grenier <[email protected]>
wrote:
> Hi, it's me again !
>
> Always looking for a way to easily have a more flexible BOLTwire, I came
> to notice the following things:
>
> - adding a mesage such as
> var_content: The content of variable $1 is $2
> would be very helpful for debuggging purposes
>
> This is probably better put up somewhere as a tip in the documentation.
>
> - in BOLTCless,
> if (is_numeric($test0) && is_numeric($test1)) return $test0 < $test1;
> could be replaced by
> if (is_number($test0) && is_number($test1)) return $test0 < $test1;
> since is_numeric was deprecated
>
> Actually is_numeric is php, is_number is BoltWire. I added it because
is_numeric allows things through I don't like. But in a comparison like
this, I think numeric is better.
>
> - Im BOLTCnew, I don't see the use of line
> if ($c == '') $type = count($BOLTnewCond);
> If there is none, it should be removed
>
> I think there was a reason for this, but it has long since escaped me.
Probably something arcane like doing counts within counts. I suspect $type
should be replaced with $c, but it works either way for basic purposes.
I'll comment it out for now. If no one complains we'll delete later.
>
> - I suggest to replace all ' by ' and all " by " in
> order to be consitent with the use of < and >
>
> I have had endless troubles with those pesky quote marks. As long as it is
working, I think I'll leave it as is. If you want to try it for awhile as a
test, I might make this change later. It makes sense, just not wanting to
fix something that ain't broke. :)
>
> - I propose to add a variable {:parent} that only returns the parent
> page of the current page (the before-last part). This feature can be
> achieve with 3 lines in library.php:
> $out = str_replace('{+parent}', substr($page,0,strrpos($page,'.')),
> $out);
> needs to be added in BOLTdisplayReplace,
> $BOLTvar['#'][$page]['parent'] = substr($page,0,strrpos($page,'.'));
> needs to be added in BOLTvarCache,
> and you should replace in BOLTvars
> if (inlist($field,
> ":p,:page,:title,:p0,:p1,:p2,:p3,:p4,:p5,:p6,:p7,:p8,:p9,:data"))
> $field = substr($field, 1);
> by
> if (inlist($field,
> ":p,:page,:title,:parent,:p0,:p1,:p2,:p3,:p4,:p5,:p6,:p7,:p8,:p9,:data"
> )) $field = substr($field, 1);
>
> I like this suggestion! But after thinking about it a bit, I noticed we
already have the {+group} variable in BOLTdisplayReplace, which does the
same thing. Parent maybe a better word--as we often use page groups as
well. I never thought of adding it as a page var however. Not sure which
way to go--guess we'll go with parent for 5.00. :)
>
> -
> - Don't have more than one BOLTmessage per line, in order to improve
> readability, and
> foreach($arr as $a) $out .= implode(' ', $a) . ' ';
> into
> foreach($arr as $a) $out .= implode("\n", $a) . "\n";
>
> I prefer them together but it should be configurable. And as it is easier
to hard code the \n I guess I'll go with your default. Here's the code I
used:
$join = BOLTinit(BOLTconfig('msgJoins', "\n"), $args['join']);
foreach($arr as $a) $out .= implode(' ', $a) . $join;
>
> - One could also think about removing exact duplicates (like "source
> retrieved for page"... which my appear one hundred times with the data
> action, but I have no suggestion for that at the moment
>
> Sometimes we might want to see this, don't you think? To make sure each
action happens?
>
> - Add a unique flag in the search function
>
> It looks like it is done automatically.
>
> - In BOLTsearchResults, replace
> if ($args['if'] != '' || $args['count'] != '') $outarray =
> BOLTsearchResultsWhenCount($outarray, $args);
> by
> if ($args['when'] != '' || $args['count'] != '') $outarray =
> BOLTsearchResultsWhenCount($outarray, $args);
>
> Thank you
>
> - In BOLTsecureFilter, replace
> if ($args['case'] != '') {
> switch ($args['case']) {
> case upper: $value = strtoupper($value); break;
> case lower: $value = strtolower($value); break;
> case initial: $value = ucfirst(strtolower($value)); break;
> case words: $value = ucwords(strtolower($value)); break;
> }
> }
> by
> if ($args['case'] != '') {
> switch ($args['case']) {
> case 'upper': $value = strtoupper($value); break;
> case 'lower': $value = strtolower($value); break;
> case 'initial': $value = ucfirst(strtolower($value)); break;
> case 'words': $value = ucwords(strtolower($value)); break;
> }
> }
>
> Thank you again!
>
> - In BOLTexists, you should replace
> if (strpos(dir, '..') !== false) return false;
> by
> if (strpos($dir, '..') !== false) return false;
>
> Yep. You are right... :)
>
> - In markups.php, replace
> MarkUp('style', 'color',
> '/<color\=[\'"]?([a-zA-Z0-9\#]{3,9})[\'"]?>(.*?)<\/color>/sie',
> "BOLTMspandivs('color',
> '$1', '$2')"); // <color=red>
> by
> MarkUp('style', 'color',
> '/<color\=[\'"]?([a-zA-Z0-9\#]{3,25})[\'"]?>(.*?)<\/color>/sie',
> "BOLTMspandivs('color',
> '$1', '$2')"); // <color=red>
> because the longest valid color name has 25 characters (see
> http://www.w3schools.com/html/html_colornames.asp)
>
> Fair enough!
Appreciate all your help polishing up the code!
Cheers,
Dan
--
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/boltwire.
For more options, visit https://groups.google.com/d/optout.