No problem, happy to help any way I can. I'm almost finished with my
current project (it's taken about 2 years) and will soon be diverting
attention back to BoltWire and the release of 7.0 sometime soon. Hopefully
before the end of the year. And with lot's of cool changes!

Blessings,
Dan

On Thu, Oct 10, 2019 at 4:03 AM mz <tcc.pla...@gmail.com> wrote:

> Wow, thank you for your comprehensive and super quick answer.
> I will check the two options, fmt= would be enough, but I understand your
> concerns.
>
> Thanks again, Martin
>
>
> Am Mittwoch, 9. Oktober 2019 20:14:14 UTC+2 schrieb Dan:
>>
>> I'm not sure there is an easy way to do this in the core code. Adding an
>> info processor or even a custom conditional (when=unique) would not work
>> because those are all processed before the output is generated, and what
>> you want is a filter based on the final output.
>>
>> We would have to add something custom to the core code. I tried modifying
>> the last part of the BOLTdisplayFmt function in library.php to this.
>> Basically I added an optional unique=true parameter to any search, query,
>> and list functions...
>>
>> foreach($pages as $i => $page) {
>>      if ($c != '') {
>>      if ($ii == $c) { $out .= "[c width={$w}%]"; $ii = 0; }
>>      $ii = $ii + 1;
>>      }
>> $page = trim($page);
>> if ($page == '') continue;
>> $fmt_temp = BOLTdisplayReplace($fmt, $i, $pages, $args);
>> if ($args['unique'] == 'true') {
>>      if (is_array($uniques)) {
>>           if (in_array($fmt_temp, $uniques)) continue;
>>           }
>>      $uniques[] = $fmt_temp;
>>      }
>> $out .= $fmt_temp . $join;
>> }
>>
>> The problem is this only works with fmt= and not template=. I thought
>> that might actually be easier to fix, but it turns out to be a much more
>> complicated issue there. And to be honest, I'm a bit reluctant to put this
>> in the core, if I can't get it to work using either display mode. Another
>> option might be to add some kind of hook in the various functions to allow
>> processing of the final output before returning it to the page.
>>
>> If it were me, I would probably create a simply function to do what I
>> want. For example, given this info file:
>>
>> alpha: bob
>> beta: dan
>> gamma: bob
>> epsilon: mary
>> tau: bob
>>
>> You could write a function that does something like this (not tested):
>>
>> function BOLTFuniquelist($args) {
>>      $contents = BOLTloadpage($args['page']);
>>      $lines = explode("\n", $contents);
>>      foreach ($lines as $line) {
>>           if (strpos($line, ': ') === false) continue;
>>           list($field, $value) = explode(': ', $line);
>>           $uniques[$value] = '';
>>           }
>>      return implode(',', array_keys($uniques));
>>      }
>>
>> Then in your site just put [(uniquelist page=whatever)].  If you want
>> more templating you could tie it into the template engine with an extra
>> line or so...
>>
>> Let me know what you think. I would definitely encourage the latter route
>> though, as I'm not sure I'll keep the core update above for the next
>> release. Still thinking about it...
>>
>> Cheers,
>> Dan
>>
>> On Wed, Oct 9, 2019 at 8:48 AM mz <tcc....@gmail.com> wrote:
>>
>>> Hi
>>>
>>> I want to get all values from info which are in part=x but filtered, so
>>> that there are no doubles.
>>> Something like: [(query page=some.page fmt={+#2} join=", ")] returns:
>>> Bob, Mike, Bob, Bob ...
>>> I like to get: Bob, Mike
>>>
>>> Tried several things including looking for undocumented features in the
>>> scripts and writing an info processor myself, but without success.
>>> Is there any solution available?
>>>
>>> Thank you, Martin
>>>
>>> --
>>> 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 bolt...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/boltwire/4a7c43d6-8029-40d7-934f-0fec9ce1e26e%40googlegroups.com
>>> <https://groups.google.com/d/msgid/boltwire/4a7c43d6-8029-40d7-934f-0fec9ce1e26e%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>> --
>>
>>
>> *Join me January 1 for REVIVE ::
>> 2017http://www.fastmissions.com/boost/fast4god
>> <http://www.fastmissions.com/boost/fast4god>*
>>
> --
> 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 boltwire+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/boltwire/be8ef1d2-2766-4654-88c0-47cbee82e7ac%40googlegroups.com
> <https://groups.google.com/d/msgid/boltwire/be8ef1d2-2766-4654-88c0-47cbee82e7ac%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>


-- 


*Join me January 1 for REVIVE ::
2017http://www.fastmissions.com/boost/fast4god
<http://www.fastmissions.com/boost/fast4god>*

-- 
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 boltwire+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/boltwire/CABnVu_49VdWXypwYeT_CaQrGqeReJ%2BOfLvfG78B0G9WveDSQKw%40mail.gmail.com.

Reply via email to