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

Organic Groups invite customization

So what my friend and I want is a customization of the OG Invite module that allows the user to search through the database of users and based on whatever criterion present in their profiles, select the users to receive the invite to their group.

There is already a way to search through user profiles that is exactly what we want, and a way to do invitations, I'd just like to be able to combine the two of these together.

Has anyone already solved this problem?

Dave

version 5.x upgrade for smtp.module

I wanted to use LukeLast's smtp module with version 5.x. Here is what I did to get it working:

CONVERSION OF SMTP.MODULE TO 5.X

1) create directory sites/all/modules
2) create directory sites/all/modules/smtp
3) place smtp.module in sites/all/modules/smtp
4) create the file smtp.info in sites/all/modules/smtp
5) paste the following text into smtp.info

; $Id$
name = SMTP
description = Provides SMTP

6) in smtp.module insert the following just prior to the Settings Hook function:

/**
* smtp_menu
*/
function smtp_menu() {

$items = array();

$items[] = array(
'path' => 'admin/settings/smtp',
'title' => t('SMTP module settings'),
'callback' => 'drupal_get_form',
'callback arguments' => 'smtp_settings',
'access' => user_access('access administration pages'),
'type' => MENU_NORMAL_ITEM,
);

return $items;
}

7) in smtp.module, at the end of smtp_settings function change:

return $form;

to

return system_settings_form($form);

8) in smtp.module replace user_mail() with drupal_mail() in smtp_settings function as follows:

drupal_mail(t('mailkey', $test_address, t('Drupal test email'), t('If you receive this message it means your site is capable of sending email.'), variable_get('site_mail', 'test@example.com'), 'From: ' . variable_get('site_mail', 'test@example.com'));

DELETE query does not work ???

Im having a weird problem while developing a custom module and was wondering if anyone might have come across it before...

Core is 4.7.4 and im using an exiting contributed module as a template - modying it to suit my needs. Im a competent PHP and MYSQL developer.

Views - Sort Criteria Random Error

Im trying to create a block that randomly swaps iamges from a specific image gallery. I have the views module installed as per documentation and I'm getting a really weird error. If I create a custom block view it works fine. when i try and randomize it I get the followuing error:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(), node.nid AS node_nid FROM node node LEFT JOIN term_node term_node ON node.n' at line 1 query: SELECT node.nid, rand() AS _rand(), node.nid AS node_nid FROM node node LEFT JOIN term_node term_node ON node.nid = term_node.nid WHERE (node.status = '1') AND (node.type IN ('image')) AND (term_node.tid IN ('8')) ORDER BY _rand() ASC, node_nid ASC LIMIT 0, 1 in...

when i disable the random sort criteria it works fine.

here is an exported view of my query:
$view = new stdClass();
$view->name = 'Random_People';
$view->description = '';
$view->access = array (
);
$view->view_args_php = '';
$view->block = TRUE;
$view->block_title = 'Random Image';
$view->block_header = '';
$view->block_header_format = '1';
$view->block_footer = '';
$view->block_footer_format = '1';
$view->block_empty = '';
$view->block_empty_format = '1';
$view->block_type = 'table';
$view->nodes_per_block = '1';
$view->block_more = FALSE;

How to turn off validation for particular submit?

In my form I have several fields that are required. I also have Cancel submit button, which should simply redirect to some page. But when I press Cancel the redirection doesn’t happen cause it tries to validate those fields and validation fails.

Is there a way to turn off validation just when user clicks Cancel button?

Thanx for any help :-)

form output under original form

I'm making a website for my sportsclub (track and field). I've created a page with php where users can check the club- and personal records. It's a form where the user can choose some variables (personal or clubrecords, male/female, search on name, etc). I don't use a redirect because a user may look for different records. It's working fine except for the problem that the output comes before the form. The form should stay on top of the output.

Pages

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