This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Q: Insert and Update taxonomy data from my module?

Does anybody know how I would go about updating and inserting new taxonomy data from my node module? Are there any type of functions I can use from the taxonomy module or is it best to just query the database from scratch?

Thanks!

unable to set active database

hi

I have two different databases. I am trying to write my first module and got in the problem of switching between databases. I tried db_set_active but that's not helping much. Here is my scenario. I have two databases (say drupal and B). In my module I switch to Database B using db_set_active('B') and use Qcodo framework to build up my output. After that I try to switch back to database drupal using db_set_active('default') but I get an error message. The error message indicates that its trying to find session table in Database B , while it should be looking in the drupal database.

Below is my function where i am juggling different databases
function treemenu_builder() {
global $user;

require_once('prepend.inc');

drupal_add_js(base_path() . path_to_theme() .'/external/dtree.js');
theme_add_style(base_path() . path_to_theme() .'/external/dtree.css');

db_set_active('B');
$js = 'a = new dTree("a");a.config.useCookies=false;';
$js .='a.add(0,-1,"Articles","javascript: void(0);");';
// Add Articles
$articles = Articles::LoadAll();
for($i=0; $i $title = $articles[$i]->__get('Title');
$id = $articles[$i]->__get('ArticleId');
$js = 'a.add($id,0,"' . $title . '", "javascript: void(0);");';
}

db_set_active('default');
$output = '

';
$output .= ' ' . $js . '

';

pathauto problem

Hey. I just installed the path auto module and when I go to: pathauto settings page i get this error:

Fatal error: Cannot use string offset as an array in /home/sittingo/public_html/modules/system.module on line 745

I was wondering if anyone knows what is wrong. Thanks!

newsletter reader

I subsribe some newsletters. I'm looking for a module that converts the receiving newsletter to node or rss item. Has anyone done that before? Thanks

Need serious help with file upload

I've spending a ton of time pouring over documentation and examples but can't seem to figure out just how to upload a file through a form. All I need to do is upload a file through a form on the module's settings page and pass it to a function that processes that file and then I don't ever need to see the file again. Can someone please help? Any and all is much appreciated. Thanks.

tinymce - removed, reinstalled - but wont create tables

ok - i deleted the tinymce tables from my database -- but now no matter what i do, i can't get the install to create the tables again... anyone know how to do this?

thanks!

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions