This website is composed of information connected through taxonomy. It is simultaneously a proof-of-concept and a means to allow Agaric to share and store information both within the collective and the world as part of our open documentation philosophy.

User login

This website is composed of information connected through taxonomy. It is simultaneously a proof-of-concept and a means to allow Agaric to share and store information both within the collective and the world as part of our open documentation philosophy.

Dead end: super-complicated forms

For the community managed taxonomy node form user interface, I need either multiple forms one after another (probably best) or a crazy way to parse one form with multiple buttons that, by virtue of what button is pressed alone, do different things.

That plan would involve calling each form element's parent by what sort of submit I want, e.g. $form['endorse_placement']

and doing crazy stuff on the result to turn the array of variables in this into a bunch of strings with the variable names

Use the compact function

For the community managed taxonomy node form user interface, I need either multiple forms one after another (probably best) or a crazy way to parse one form with multiple buttons that, by virtue of what button is pressed alone, do different things.

That plan would involve calling each form element's parent by what sort of submit I want, e.g. $form['endorse_placement']

and doing crazy stuff on the result to turn the array of variables in this into a bunch of strings with the variable names

Use the compact function

http://us.php.net/manual/en/function.compact.php

no, no, no. Multiple forms on a page.

Yet another resolved existential crisis

current existential crisis (actually this was a while ago)

  1. which name to use -- how to make top-chosen name easily available for proposed term hierarchies

as an extra column in term_hierarchy? Done. For both name and weight, there's a "faked" table called cmt_term_data that does nothing but hold the top results from cmt_term_name and cmt_term_weight.

  1. how/when do terms in a hierarchy get created? Immediately.

current existential crisis (actually this was a while ago)

  1. which name to use -- how to make top-chosen name easily available for proposed term hierarchies

as an extra column in term_hierarchy? Done. For both name and weight, there's a "faked" table called cmt_term_data that does nothing but hold the top results from cmt_term_name and cmt_term_weight.

  1. how/when do terms in a hierarchy get created? Immediately.

PHP4 limitation- cannot do foreach by reference

This currently slightly ugly code in the function cmt_get_hierarchies() is required because PHP4 can't handle references in a foreach:

<pre>
  reset($hierachies);
  while (list($key, $value) = each($hierarchies)) {
    $hierarchy =& $hierarchies[$key];
    array_reverse($hierarchy);
  }
</pre>

For PHP5 only it will be possible to do this-- so save this page for upgrading to Drupal 6!

This currently slightly ugly code in the function cmt_get_hierarchies() is required because PHP4 can't handle references in a foreach:

<pre>
  reset($hierachies);
  while (list($key, $value) = each($hierarchies)) {
    $hierarchy =& $hierarchies[$key];
    array_reverse($hierarchy);
  }
</pre>

For PHP5 only it will be possible to do this-- so save this page for upgrading to Drupal 6!

<pre>
  foreach($hierarchies AS &$hierarchy) {
    array_reverse($hierarchy);
  }
</pre>

From http://us2.php.net/foreach

<

blockquote>joaohbruni at yahoo dot com dot br

taxonomy_get_parents_all doesn't retain hierarchy info

As taxonomy_get_parents_all does not preserve the relationships between parents -- it provides all parent terms in a flat array -- I need to create a new function for showing the hierarchy of chosen and suggested terms on community-managed taxonomy below-the-node forms.

As taxonomy_get_parents_all does not preserve the relationships between parents -- it provides all parent terms in a flat array -- I need to create a new function for showing the hierarchy of chosen and suggested terms on community-managed taxonomy below-the-node forms.

CMT module and providing hooks: none at the moment

If anyone wants hooks for my saving and editing of the community-managed portion of vocabularies, or anywhere else for that matter, I'll gladly do that.

I can put in custom hooks everywhere, but as I don't see any use for hooks anywhere, I shall put them nowhere.

If anyone wants hooks for my saving and editing of the community-managed portion of vocabularies, or anywhere else for that matter, I'll gladly do that.

GNU rocks the internet

It takes great Google gymnastics to get past the millions of GNU's Not Unix references to the actual animal (gnu is another name for wildebeast), for instance:

gnu -unix -computer -compiler -project -software -make -emacs -coding -mailing -wget -autoconf -objective-c -utilities -printf +mammal

We want searching for Agaric to be something of the same ;-)

Prepopulating CMT's additions to the edit vocabulary form

The below is quite moot, but an interesting addition to "Ben's brain loses to itself in 14 rounds" series. I decided to keep community management information for each vocabulary separate, called with cmt_get_vocabulary(), and turn both it and the results of taxonomy_get_vocabulary() into arrays and array_merge() them.

Because the form gets all its information by calling taxonomy_get_vocabulary($vid), when editing an existing vocabulary the form would forget all about the Community Managed Taxonomy option. Very sad.

The below is quite moot, but an interesting addition to "Ben's brain loses to itself in 14 rounds" series. I decided to keep community management information for each vocabulary separate, called with cmt_get_vocabulary(), and turn both it and the results of taxonomy_get_vocabulary() into arrays and array_merge() them.

Crazy talk. Parsing a form based on what button is pressed

For the community managed taxonomy node form user interface, I need either multiple forms one after another (probably best) or a crazy way to parse one form with multiple buttons that, by virtue of what button is pressed alone, do different things.

This test:

$form['randomness'] = array(
'#type' => 'submit',
'#value' => t('Save'),
'#name' => 'detail on the randomness',
);

For the community managed taxonomy node form user interface, I need either multiple forms one after another (probably best) or a crazy way to parse one form with multiple buttons that, by virtue of what button is pressed alone, do different things.

This test:

<

blockquote>
$form['randomness'] = array(
'#type' => 'submit',
'#value' => t('Save'),
'#name' => 'detail on the randomness',
);

$text = "inthechaos";
$form['order'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
'#name' => $text,
);

$form['nid'] = array(
'#type' => 'value',
'#value' => $edit['nid'],

Display PHP errors on screen for debugging

apache print php errors to screen
apache log errors to screen
apache print php errors to screen
apache display errors

This is not an option for Apache as far as I can tell. You'll have to look in the log file for Apache server errors. However, to output PHP errors to the screen, make sure to have this line:

display_errors = On
; PHP tells us about errors rather that just sit there with a blank screen!

Note that you only want to do this in your dev or test environment, and not on your live server.

apache print php errors to screen
apache log errors to screen
apache print php errors to screen
apache display errors

This is not an option for Apache as far as I can tell. You'll have to look in the log file for Apache server errors. However, to output PHP errors to the screen, make sure to have this line:

display_errors = On
; PHP tells us about errors rather that just sit there with a blank screen!

Note that you only want to do this in your dev or test environment, and not on your live server.

thanks to:
http://istos.ws/index.php?option=com_content&task=view&id=162

Unbelievable

Poor conspiracy theorists... how can they ever hope to keep up with conspiracy reality?

SeeingYellow.com

ben

From: