4

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 get you SELECT FROM {foo} foo WHERE (:val IN ({table1}.col1, {table2}.col2)) (with :val replaced by $user->uid).


4

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 piece of code. When a user hasn't set a profile picture yet, the field is empty or displays the default picture if you picked one in your configuration. In both ...


3

In this case, the problem is that privatemsg_get_link() uses array() as default value for $account, but then uses the following code. if ($account == NULL) { global $user; $account = $user; } The function should use NULL as default value for $account, in the same way user_access() does. function user_access($string, $account = NULL) { global ...


3

Have you tried String Overrides module? Here is a quote about it (from the module's project page): ... a quick and easy way to replace any text on the site. Features: Easily replace anything that's passed through t() Locale support, allowing you to override strings in any language Ability to import/export *.po files, for easy migration from the Locale ...


3

Privatemsg 6.x-2.x has a Limits submodule built in, either use that version or use try out the separate project for 6.x-1.x, you will have to find out yourself it is working well enough for you.


3

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' => '{image-style}')); With {image-style} replaced with image style that you want like thumbnail. If this doesn't work I will take a second look.


3

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 year & Privatemsg: Other years respectively.


3

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 certain users, you can prepopulate the "To" field with /messages/new/[nid]. So on the user page or in views or whatever, you can create this link using tokens or ...


3

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. The table structures are often complicated and may change without notice, but the functions for accessing those tables generally adapt to the changes (this is ...


3

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, right above it (line 1098), it says in the comments: * @see hook_query_privatemsg_messages_alter() I found the doc hook_query_privatemsg_messages_alter. ...


2

This will return the unread private messages in Drupal 7. <?php global $user; privatemsg_unread_count($user); ?> Refer this for more discussion This will return pending relationship request for the loggedin user. <?php function _count_pending_relationships($account = NULL) { $counts = &drupal_static(__FUNCTION__, array()); if (!$account |...


2

It's part of the Messages modules; it has nothing to do with Private messages. It's not a glitch, it's what this module does: a simple example of a way to deliver messages (notifications) to users.


2

I'm pretty sure that using Services Entity API will provide what you are looking for. An endpoint shows up for me after enabling the module. This module provides support for all Entity API entity types to Services. All entity types get a standard resource, similar to what Services provides for code entity types such as nodes. This module allows to get ...


2

From my point of view, it would seem Rules are not being triggered at all. You could, however, try invoking a rule manually by placing a rules_invoke_event() call within inside a custom form submit function. Note that the #submit property on Drupal forms allow multiple submit handlers to be called for a single form. In the hook_form_privatemsg_new_alter() ...


2

Hope this will help you, In Drupal 7, you can use privatemsg_get_link. privatemsg_get_link - Returns a link to send message form for a specific users. if ($enabled_private_messages) {//check user private message settings if ($account = menu_get_object('user')) {// Get user object. You can also use user_load to get user object. if (is_object($...


2

What I would do is define your own token. Start off with copying login_one_time_token_info() and login_one_time_tokens() into a custom module, change the hook names and rename the token to something like login-one-time-optional or whatever you prefer :) Then, change the implementation of the hook_tokens() implementation so that you check the field on the $...


2

If you navigate to admin/config/messaging/privatemsg, you will find the template of mail which get send by system when somebody private message to message some user. You can modify the template. If you navigate to tokens below, you will find several tokens, one is - [privatemsg_message:original:body]. You can insert it in above template to send it in mail ...


2

I've just implemented the Privatemsg Panels plugin with the D7 Patch through the pm_existing_pages plugin and it's working quite well! Here's how it all goes down for Drupal 7: Grab the master branch of the privatemsg_panels module and upload to your modules directory Patch Manager is super handy - install it and run the panels_privatemsg7.patch file to ...


2

If you look at the code in Privatemsg module, the autocomplete callback function provides a hook hook_privatemsg_autocomplete_alter(). You can use this hook and unset the current logged in user from the $matches array. I don't have Privatemsg module installed in any of my current projects, so I cannot test it, but the following code should do it: function ...


2

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(profile2) but it needs profile2 to be enabled beore


2

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 allows you to configure the email's from header. By default, if this is blank, it will use the site's default system email. It sounds like the module is configured ...


2

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

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 Actions you have available. I don't think there is anything in it you can take advantage of to do what you are asking for, and it won't help to implement your fall ...


2

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

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 Privatemsg module with Rules instead (make sure to checkout this community docu, and its child pages ...), together with the Views Bulk Operations module. For ...


2

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 = @Translation("Private Message Thread"), * handlers = { * "view_builder" = "Drupal\private_message\Entity\Builder\PrivateMessageThreadViewBuilder", * ...


2

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 loaded my entity with: $entity_manager = \Drupal::entityTypeManager(); $thread_entity = $entity_manager->getStorage('private_message_thread')->load('...


1

There is an issue in the Privatemsg queue with an incomplete patch, privatemsg_realname: Permits to search inside realname field using "LIKE %...%". You're welcome to help re-roll and test the patch. The patch is for 6.x-2.x but it could fairly easily be re-written for 7.x-2.x.


1

Assuming you want to create a link to the author, you should be able to create a simple link in the template - Field that links to a path/url defined with Tokens, is it possible? It would follow something like: http://www.example.com/messages/new/[node:author] You can see a list of tokens here: https://drupal.org/node/390482#token-node


1

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 work": (Comment # 6): The tab menu badges are meant for tabs specifically, not links in the menu. You need to edit the Messages menu item and select a badge ...


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