Hey Allister, Adding functions is really easy in BoltWire. If you name them properly they are automatically recognized and activated as soon as you put them in a config file. So you can limit them to certain sections of your site, or make them site wide. The other option is to set them up as a plugn and then activate them in site.config. Whichever's easiest, really. Here are the basic steps:
On Mon, May 25, 2009 at 4:53 AM, Allister Jenks <[email protected]> wrote: > Hey, the heater has warmed the room and my brain is getting some of this. I > essentially have the basic design working now and can see where some of the > tweaks need to be made. (Not to mention the whole skin design and a site > structure outside the items & categories!!) > > One, perhaps unintended consequence of doing the categories this way is that > I can probably use a regex text editor on my old source to get all the > categories set quick smart. :-) > > Next questions before I go too far on the data entry front. > > 1) I need to do some number crunching for each item when displayed. I have a > PHP function I tweaked for PmWiki. What's the best way to integrate that? > Basically I have two metric measurements stored on each item and I need to > output in inches and 1/2s, 1/4s or 1/8s. The PHP function converts one > measurement from mm to in. 1) Go into site/config and create a page called config.php, with the following content: <?php if (!defined('BOLTWIRE')) exit(); function BOLTFconvert($args, $zone='') { return $args[1] / 2.54; // or whatever php code you want... } Then on the page put {:data} centimeters = [(convert {:data})] inches Change data to whatever the name of the data value is that stores the information. Not tested or polished of course... The F in BOLTFconvert makes it a Function. BOLTX is a form command. And BOLTC is a conditional. If you look at the scripts with those names in the core code (boltwire/barn/scripts) you can see lot's of examples of how these scripts are set up in BoltWire. Simply copy one similar to your needs, rename it, and modify it to your hearts desire. Change the function above to use strtoupper($args[1]) and you can solve your other issue. There's a php tools plugin that automatically adds that as well as several other php text handling functions. > 2) Re getting the data across, I have around 200 items which I can munge in > a text editor, but as I see it I have to create 200 separate pages. Is there > a way to script that somehow? It'd be a one-off exercise. My main concern is > ensuring no details change between old and new sites. Not sure what you mean by this, but if it is a bunch of data used in various places, I would probably set it up as an info page: field1: data1 field2: data2 ... field200: data200 Then you can access this info using {info.whateverpage::field37}. Is this what you are looking for? There a way to mine data from a bunch of different pages in one of the solution pages (info plus or something) which allows data mining. For example you can tell it to extract all the emails form a bunch of member profiles and generate a list. I haven't looked at it in a while. You can generate all kinds of reports based on the data and modify the data values easily. It's much faster than having to open and read 200 pages. This is a good example of the advantages of info vars over data vars. Let me know if some of this is not clear. Cheers, Dan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "BoltWire" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/boltwire?hl=en -~----------~----~----~----~------~----~------~--~---
