Forum

Whether it's a plugin thats causing issues, a theme, or just needed help with styling your site...We can help! Live Person Support for all your Wordpress Needs!

Welcome Guest

Pages: 1
Limtiing users to messaging only the admin?
saharaPostOct 01 2010, 03:57 PM

Newbie
Posts: 9
Registered:
Oct 01 2010, 09:18 PM
Hot topicLimtiing users to messaging only the admin?

Is it possible to limit the addresses that a user can send messages to??

i would like to use cartpauj as a way to communicate with my blogs registered users (100+).... but do not want the users to communicate with each other just yet... any hints???

thanks so much... it was an easy install... and the test communication happened within minutes... and i am a wp newbie...

thanks so much
sahara



Shrink, Track, Share, Control ... Dominate
cartpaujPostOct 01 2010, 08:01 PM

Administrator
Posts: 2976
Registered:
Apr 27 2010, 05:10 PM
Hot topicRe: Limtiing users to messaging only the admin?

How are you wanting to limit the messaging?

Cartpauj...it's pronounced (cart.paw.ja) - Donate!
Mingle Forum Video Tutorials

saharaPostOct 02 2010, 05:03 AM

Newbie
Posts: 9
Registered:
Oct 01 2010, 09:18 PM
Hot topicRe: Limtiing users to messaging only the admin?

to have only the admin in the drop down menu on the on the users message page... is it possible??? even it it could just say "admin" in the to: box with no drop down menu that would be great...

cartpaujPostOct 02 2010, 10:11 AM

Administrator
Posts: 2976
Registered:
Apr 27 2010, 05:10 PM
Hot topicRe: Limtiing users to messaging only the admin?

How code savvy are you?

Cartpauj...it's pronounced (cart.paw.ja) - Donate!
Mingle Forum Video Tutorials

saharaPostOct 02 2010, 10:17 AM

Newbie
Posts: 9
Registered:
Oct 01 2010, 09:18 PM
Hot topicRe: Limtiing users to messaging only the admin?

i can cut and paste with the best of them...

cartpaujPostOct 02 2010, 10:25 AM

Administrator
Posts: 2976
Registered:
Apr 27 2010, 05:10 PM
Hot topicRe: Limtiing users to messaging only the admin?

on line 273 of pm-class.php find and replace this:

				"<input type='text' id='search-q' onkeyup='javascript:autosuggest(\"".$this->actionURL."\")' name='message_to' autocomplete='off' value='".$this->convertToUser($to)."' /><br/>

with:

				"<input type='text' id='search-q' name='message_to' autocomplete='off' value='admin' /><br/>

Cartpauj...it's pronounced (cart.paw.ja) - Donate!
Mingle Forum Video Tutorials

saharaPostOct 02 2010, 10:28 AM

Newbie
Posts: 9
Registered:
Oct 01 2010, 09:18 PM
Hot topicRe: Limtiing users to messaging only the admin?

thanks!!! i will give it a shot and let you know how it goes...

cartpaujPostOct 02 2010, 10:29 AM

Administrator
Posts: 2976
Registered:
Apr 27 2010, 05:10 PM
Hot topicRe: Limtiing users to messaging only the admin?

oh and just a heads up, the value='admin' part just change 'admin' to the username of the user you want to send messages to.

Cartpauj...it's pronounced (cart.paw.ja) - Donate!
Mingle Forum Video Tutorials

saharaPostOct 02 2010, 01:21 PM

Newbie
Posts: 9
Registered:
Oct 01 2010, 09:18 PM
Hot topicRe: Limtiing users to messaging only the admin?

is it possible to create a conditional if-then to keep the original drop down menu for userlevel=admin and the new modified single address option for all others???

otherwise i will not be able to communicate easilly from my own message page...

thanks again...

saharaPostOct 02 2010, 01:29 PM

Newbie
Posts: 9
Registered:
Oct 01 2010, 09:18 PM
Hot topicRe: Limtiing users to messaging only the admin?

WOULD THIS WORK???

<?php if(is_admin()) { ?>
"<input type='text' id='search-q' onkeyup='javascript:autosuggest(\"".$this->actionURL."\")' name='message_to' autocomplete='off' value='".$this->convertToUser($to)."' /><br/>
<?php } else { ?>
"<input type='text' id='search-q' name='message_to' autocomplete='off' value='admin' /><br/>

cartpaujPostOct 02 2010, 02:08 PM

Administrator
Posts: 2976
Registered:
Apr 27 2010, 05:10 PM
Hot topicRe: Limtiing users to messaging only the admin?

Change the whole if function to this:

			if (!$this->isBoxFull($user_ID, $adminOps['num_messages'], '1'))
			{
				$newMsg = "<p><strong>".__("Create New Message", "cartpaujpm").":</strong></p>";
				$newMsg .= "<form name='message' action='".$this->actionURL."checkmessage' method='post'>".
				__("To", "cartpaujpm").":<br/>";
				if (current_user_can('level_8'))
					$newMsg .= "<input type='text' id='search-q' onkeyup='javascript:autosuggest(\"".$this->actionURL."\")' name='message_to' autocomplete='off' value='".$this->convertToUser($to)."' /><br/>";
				else
					$newMsg .= "<input type='text' id='search-q' name='message_to' autocomplete='off' value='admin' /><br/>";
				$newMsg .= "<div id='results'></div>".
				__("Subject", "cartpaujpm").":<br/>
				<input type='text' name='message_title' maxlength='65' value='' /><br/>".
				__("Message", "cartpaujpm").":<br/>".$this->get_form_buttons()."<br/>
				<textarea name='message_content'></textarea>
				<input type='hidden' name='message_from' value='".$user_ID."' />
				<input type='hidden' name='message_date' value='".current_time('mysql', $gmt = 1)."' />
				<input type='hidden' name='parent_id' value='0' /><br/>
				<input type='submit' onClick='this.disabled=true;this.form.submit();' value='".__("Send Message", "cartpaujpm")."' />
				</form>";
				
				return $newMsg;
			}

Cartpauj...it's pronounced (cart.paw.ja) - Donate!
Mingle Forum Video Tutorials

saharaPostOct 02 2010, 02:34 PM

Newbie
Posts: 9
Registered:
Oct 01 2010, 09:18 PM
Hot topicRe: Limtiing users to messaging only the admin?

holy cow thats alot of code... thanks for putting that together for me...

one more silly question... where exactly do I put this???

cartpaujPostOct 02 2010, 02:40 PM

Administrator
Posts: 2976
Registered:
Apr 27 2010, 05:10 PM
Hot topicRe: Limtiing users to messaging only the admin?

Just overwrite that whole block that's already there. The only part of that code above that was changed from the original is this:

				__("To", "cartpaujpm").":<br/>";
				if (current_user_can('level_8'))
					$newMsg .= "<input type='text' id='search-q' onkeyup='javascript:autosuggest(\"".$this->actionURL."\")' name='message_to' autocomplete='off' value='".$this->convertToUser($to)."' /><br/>";
				else
					$newMsg .= "<input type='text' id='search-q' name='message_to' autocomplete='off' value='admin' /><br/>";
				$newMsg .= "<div id='results'></div>".

Cartpauj...it's pronounced (cart.paw.ja) - Donate!
Mingle Forum Video Tutorials

LudoviclPostMay 02 2012, 10:37 AM

Newbie
Posts: 6
Registered:
May 02 2012, 04:08 PM
Hot topicRe: Limtiing users to messaging only the admin?

Hi,

I'm new here and I'm french (for my english)

I want 2 things :

    a user only can send a message to admin
    the admin can send message to each user.

Could you give the code I must change and where exactly I must do that.

Thanks a lot

Ludovic

pdesmondPostJan 04 2013, 01:22 AM

Newbie
Posts: 1
Registered:
Jan 04 2013, 08:12 AM
Hot topicRe: Limtiing users to messaging only the admin?

I am also looking for this functionality. Definitely going to try this out. great plugin.
Also, is it possible to have the admin inbox on the backend of wordpress?

Pages: 1
Mingle Forum by Cartpauj | Version: 1.1.0beta | Page loaded in: 0.533 seconds.


Shrink, Track, Share, Control ... Dominate