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

Can I cause a php snippet to run when preview or submit is clicked?

I'm developing a module which grabs contents from an external page authored in Macromedia Dreamweaver, and inserts it into the body of a new node. I have a form which allows me to enter the path to the page, the start and end delimiters, and a couple other things. Once the data is entered, I submit it, and it creates the node. What I'd like it to do is run the import code snippet when I click on preview or submit, so that the page is sucked in and stored in the database.

The two problems I have right now are (and I'm sure this reveals my ignorance of PHP :-):
1. When the node is created, the page grabbing php code snippet needs to use the path, delimiters and other variables I've entered in to the form before it's been written to the database.
2. The page grabbing code needs to run and update the body every subsequent time that the preview or submit button is clicked.

I'm working from the node_example.module code. Here's my module code.


<?php
// $Id: mmcontrib.module,v 1.153 2006/02/21 18:46:54 binky Exp $

/** Database definition:
* @code
* CREATE TABLE mmcontrib_data (
* nid int(10) unsigned NOT NULL default '0',
* path varchar(255) NOT NULL default '',
* subpath varchar(255) NOT NULL default '',
* startdelim varchar(255) NOT NULL default '<--starthere-->',
* enddelim varchar(255) NOT NULL default '<--endhere-->',
* updinterval int(10) unsigned NOT NULL default '0',

limit password changes

Is there an easy way of not allowing users to change passwords other than hacking the user module

Marksmary not working properly

I have the Marksmarty module installed properly and the input formats are set correctly. Marksmarty is working except when I try to use the automatic e-mail links. For example, if I use [mail@address.com](mailto:mail@address.com), it works fine. But if I just try to use <mail@address.com> nothing prints. The e-mail address doesn't even exist in the source code. Ayone had this problem?

PHP in secondary link part

Howdie ya'll,

I probably can't use php in the secondary links part of the page?
Tried to put in my flash ticker getting the data from a mysql db but it showed on the empty flash movie without the ticker content. Tried the same way in a block with another tickerlike thing and there it worked.

See ya and thanks for any hints
Wickus

Creating a new user without using a form

Hi,

How can I use user.module API to create a new user account without having the need to use the form registration?
I need to create new user accounts using XMLRPC throught an external application.

Thanks,
Fernando Silva

Manually setting password on account creation

Hi,

I'm trying to set the user's password during account creation, rather than accepting Drupal's randomized starter password. I'm doing this in hook_user / insert, and have tried everything I can think of, to no avail:

  • db_query( "UPDATE users SET pass = MD5('new password') WHERE uid = " . $user->uid );
  • $edit['pass'] = "new password";
  • $user['pass'] = "new password"; $edit['pass'] = NULL;
  • user_save($user, array('pass' => MD5('new password')));

Help!

Thanks,
Jeff Bellsey

Pages

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