Skip to main content

Home/ Drupal for Developers/ Group items tagged table

Rss Feed Group items tagged

Daniel Gregoire

Programmatically Create, Insert, and Update CCK Nodes | doug | CivicActions - 2 views

  • Always use content_database_info to get the database info. For example:   $field1 = content_database_info(content_fields('yourfield1', 'yourtable'));  $table1 = $field1['table'];  $column1 = $field1['columns']['value']['column'];  $field2 = content_database_info(content_fields('yourfield2', 'yourtable'));  $table2 = $field2['table'];  $column2 = $field2['columns']['value']['column'];  if ($table1 == $table2) {    $sql = "SELECT n.*, t1.$column1, t1.$column2 FROM {node} n ";    $sql .= " INNER JOIN {$table1} t1 ON t1.nid = n.nid AND t1.vid = n.vid";  }  else {    $sql = "SELECT n.*, t1.$column1, t2.$column2 FROM {node} n ";    $sql .= " INNER JOIN {$table1} t1 ON t1.nid = n.nid AND t1.vid = n.vid";    $sql .= " INNER JOIN {$table2} t2 ON t2.nid = n.nid AND t2.vid = n.vid";  }  $sql .= " WHERE n.nid = %d";
  •  
    Important point: Using special functions to let CCK get the proper name of the field (allowing users to make CCK changes in the UI and let your code continue to work).
Daniel Gregoire

Module Development - Schema Won't Install | drupal.org - 0 views

  • I had similar symptoms ... a simple install file that wouldn't create a table. However, I got it to work by going into the Drupal system table and deleting the record for my module. Then the next time that I enabled my module, Drupal freshly discovered it and ran the .install file to successfully create the table. Summary. When you have a module already in use (and so it appears in the system table), and *then* as a developer you create its .install file, it doesn't look like a *new* installation to Drupal (since the module name was already in the system table), so hook_install never gets called.
  •  
    Trick for schema's that won't install. If you have a custom module that you _had_ installed before making a .install file and including a schema, you need to: (1) Disable your module (2) Uninstall your module (3) Delete your module's row in the 'system' table in your Drupal database. Then you can re-introduce your module, and all its files will be recognized.
Hendy Irawan

Drupal Development - 0 views

  •  
    Drupal Development - Presentation Transcript Drupal Code: Day 1 where am i, and how did i get all these arrays Hi. I'm eaton. Drupal is... http://www.flickr.com/photos/druclimb/282597447/ Drupal is... Drupal Core http://www.flickr.com/photos/druclimb/282597447/ Drupal is... Node Drupal Core User http://www.flickr.com/photos/druclimb/282597447/ Drupal is... Views Five Star CCK Node Drupal Core User http://www.flickr.com/photos/druclimb/282597447/ Drupal is... Theme Views Five Star CCK Node Drupal Core User http://www.flickr.com/photos/druclimb/282597447/ Drupal is... Theme Views Five Star CCK Node Drupal Core User http://www.flickr.com/photos/druclimb/282597447/ name = Demo description = Just a simple demo module. core = 6.x function demo_nodeapi(&$node, $op) { global $user; if ($op == 'view') { if ($node->uid == $user->uid) { $node->title . ' [YOUR ARTICLE]'; } } } demo.info demo.module name = Tricky description = A slightly trickier module. core = 6.x function tricky_form_alter(&form, $form_state, $id) { if ($id == 'node_form') { $title['#required'] = FALSE; } } function tricky_install() { drupal_set_message('You just installed Tricky!'); } tricky.info tricky.module tricky.install views.info views.module views.inc user.inc node.inc blog.inc comment.inc ui.info ui.module arguments.inc handlers.inc filters.inc query.inc sprout.info sprout.module forum.inc views.pages.inc table.inc views.install sprout.install sprout.admin.inc sprout.inc CHANGELOG README views.info views.module views.inc user.inc node.inc blog.inc comment.inc ui.info ui.module arguments.inc handlers.inc filters.inc query.inc sprout.info sprout.module forum.inc views.pages.inc table.inc views.install sprout.install sprout.admin.inc sprout.inc CHANGELOG README views.info views.module views.inc user.inc node.inc blog.inc comment.inc ui.info ui.module arguments.inc handlers.inc filters.inc query.inc sprout.info sprout.module forum.inc views.pages.inc table.inc views.install
Csaba Kovács

Perform bulk operations on a custom database table with views | Wunderkraut - 0 views

  •  
    "/** * Implementation of hook_action_info(). */ function mymodule_action_info() { return array( 'mymodule_mytype_delete_action' => array( 'description' => t('Delete mytype'), 'type' => 'mytype', 'configurable' => FALSE, 'hooks' => array( 'mytype' => array('delete'), ), ), ); }"
Scott Blackburn

Litenode | Development Seed - 0 views

  •  
    Litenode is a new module that uses Views to replace multiple node_loads() on a page. The concept is simple: Views already knows how to grab any of the fields in a single go that many modules load independently in their hook_nodeapi('load'). Why not have Views grab them all at once (as you would do in a table view, for example) and then have a style plugin map the Views fields to all the places where modules expect them to be on a loaded node?
Bartłomiej Małysz

Drupal Database Documentation - 0 views

  •  
    This is png picture from Drupal Database's Documentation
1 - 8 of 8
Showing 20 items per page