4 votes
Accepted

Add reverse IN clause to db API

That's (arguably) non-standard, so you'll need a where. For example, $query = db_select('foo'); $query->where(':val IN ({table1}.col1, {table2}.col2)', array(':val' => $user->uid)); will ...
  • 164k
4 votes

How do I create a rule to prevent a user from sending a message via the Privatemsg module?

I don't think you can use the Rules module directly for this, because the only action that is provided by Privatemsg is called when a message has been sent. Therefore, I suggest you write an easy ...
  • 2,518
4 votes

Check access to entity for logged in user in Drupal 8

I have tested the entity access and $entity->access('view', $account); that worked in my case. I earlier used the optional $account parameter so that it could check the currently logged in user. I ...
3 votes
Accepted

How to flip order of Privatemsg thread from ASC to DESC?

Any other ways I can get it to work, outside of hacking the module? There is no way to alter a module from another php file / module unless it provides a hook, luckily here they did. I must be blind,...
3 votes

Drupal private messages database table design

In general with Drupal you want to avoid directly querying the database if you didn't create the tables yourself. Instead try to use functions provided by core or the module to get the data for you. ...
  • 2,700
3 votes

Sending private messages between users

By default, giving a role the permission to delete messages will not delete the message for the other user. I just tested this and it works as you require. As for only allowing messages between ...
  • 2,751
3 votes
Accepted

Privatemsg Module and custom timestamp

Add these two date formats (in admin/config/regional/date-time/formats): M d H:i Y M d H:i After that choose above created date formats (in admin/config/regional/date-time) in Privatemsg: Current ...
  • 2,109
3 votes
Accepted

Applying image style to Privatemsg

This is off the top of my head with some parts but I think this is the way you would do it. print theme('image_style', array('path' => $message->author->picture->uri, 'style_name' => '{...
  • 1,456
2 votes
Accepted

privatemsg and services fully integration

There exist a sandbox project pm services clone comand git clone --branch 7.x-1.x https://git.drupal.org/sandbox/deminy/2413647.git privatemsg_services cd privatemsg_services also pm services(...
2 votes

What is the entity ID for private messages?

It turns out mid is correct, but for whatever reason $row['mid'] was returning a string, not an int. Type-casting the string as an int solved the problem.
2 votes
Accepted

How do I create a rule to prevent a user from sending a message via the Privatemsg module?

Have a look at the community documentation about Privatemsg-Rules Integration, especially the child page about Introduction to Privatemsg-Rules: it lists the various Rules Events, Conditions and ...
2 votes
Accepted

How can I allow users to send private messages without revealing sender's address?

The 7.x-1.x branch of Private Message has this setting in the PM Email Notify submodule. When enabled, there is a E-mail notify tab on the settings page (/admin/config/messaging/privatemsg) that ...
  • 26.4k
2 votes
Accepted

How can I send a Privatemsg using Rules and have the name of the site as the sender?

You could create an account for sending the messages and in rules, use direct input and enter its user id. That way, you could also see replies to welcome message.
  • 2,751
2 votes
Accepted

How to display a form filled by a VBO-submission?

As per the "I'm not very experienced in development", you may want to use an alternative approach which only requires site building skills, as further explained below ... Use the integration of the ...
2 votes

Check access to entity for logged in user in Drupal 8

You can check annotations of those entities and find access handler. e.g. /** * Defines the Private Message Thread entity. * * @ContentEntityType( * id = "private_message_thread", * label =...
1 vote

Link to send message is not displayed

DrupalGap's implementation of Private Message has not evolved enough to take into consideration any Private Message configuration set on a DrupalGap Manage Display page for User Entities. That being ...
1 vote

Howto override a function in privatemsg.module?

The _privatemsg_format_participants() function is called from template_preprocess_privatemsg_recipients() function, which is a template preprocess hook. You can simply override ...
  • 3,185
1 vote

Display additional fields in the Inbox?

/** * Implements hook_form_alter(). */ function modulename_form_alter(&$form, &$form_state, $form_id) { if ($form_id == 'privatemsg_list') { $form['updated']['list']['#header']['...
  • 1,624
1 vote
Accepted

Warning to user for including cursing words in private message

Finally found a format that works. Contrary to what the Drupal documentation says, the format: word1|word2|word3 does not work. The proper syntax is: ^.*(word1|word2|word3).*$ i.e.: caret then ...
  • 710
1 vote

How to use the Rules and Group modules to send a privatemsg to users of a role in a group?

Have a look at Comment #2 in issue # 2603136 (from the module maintainer). Here is how it looks like (I added the bold markup in it here): Meaning you can already use Rules to: Add a new Group ...
1 vote

How do I create a rule to prevent a user from sending a message via the Privatemsg module?

Ok. Thanks again to Pierre.Viriens who provided the perfect answer. I wasn't too familiar with the "Drupal is initializing" event but it did the trick and the link he provided How to specify a Rules ...
  • 710
1 vote

Private Message with node.js issues setting up

I had problems too. On line 3, for some reason using localhost never worked for me. Change line 3 to "host":"panduh420.com", Also, if your server has a firewall, make sure port 8989 is open. Also, ...
1 vote

Is there an alternative private messsage module that integrates with Views?

You can also consider theming Private Message. Private Message is an extremely powerful module that offers a much higher degree of customization than some sites may need (messages can be sent to ...
1 vote
Accepted

Re-Theme Private Message Function

$text = l('<img src="messages.png" height="40"/>); looks wrong. "l" is function to create links, i guess thats what is failing here. Try to remove it and leave just $text = '<img src="...
  • 510
1 vote

How can I use the Private Message module for anonymous users?

The Privatemsg module CANNOT be used for anonymous users ... Unless you are ready for some "tweaks" ... as detailed below. I'm assuming your question is about D7, if it is for D6, you might consider ...
1 vote

privatemsg and services fully integration

The current discussion on integrating Privatemsg for Drupal 7 and Services can be found here.
1 vote
Accepted

How to use the Menu Badges to show the number of recieved messages via Privatemsg?

If you don't want to use that "scotch tape" anymore (as in your own answer), then have a look at some of the comments in issue # 1719112, which detail how you may get it to work "as it is supposed to ...

Only top scored, non community-wiki answers of a minimum length are eligible