Yii Framework Forum: [EXTENSION]: private-messaging - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[EXTENSION]: private-messaging This Yii Framework module allows you to add quickly private messaging Rate Topic: ***** 1 Votes

#1 User is offline   Weavora Team 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 137
  • Joined: 06-December 10

Posted 24 November 2011 - 05:44 AM

http://www.yiiframew...vate-messaging/

Guys, hope you'll find it useful.
0

#2 User is offline   Cade 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 04-July 12

Posted 04 July 2012 - 05:26 AM

Hi,
I'm fairly new to Yii but have years of PHP experience so I'm not finding it too tricky to run with it and implement some of the addons people have created.

I am however confused on how to implement the private-messaging module, which is a shame as it looks really cool from what I've read/seen.

Do you have any additional information not available here on Github.

Ideally a more step-by-step process on adding it to an existing Yii Project or even an example project running this module.

Thanks in advance for your time.

Cade


 Weavora Team, on 24 November 2011 - 05:44 AM, said:

http://www.yiiframew...vate-messaging/

Guys, hope you'll find it useful.

Regards,
Cade

Current Projects
You Do It List: http://youdoitlist.com.au
0

#3 User is offline   Sampa 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 173
  • Joined: 18-December 11
  • Location:Stockholm,Sweden

Posted 04 July 2012 - 05:46 AM

 Cade, on 04 July 2012 - 05:26 AM, said:

Hi,
I'm fairly new to Yii but have years of PHP experience so I'm not finding it too tricky to run with it and implement some of the addons people have created.

I am however confused on how to implement the private-messaging module, which is a shame as it looks really cool from what I've read/seen.

Do you have any additional information not available here on Github.

Ideally a more step-by-step process on adding it to an existing Yii Project or even an example project running this module.

Thanks in advance for your time.

Cade


I use this extension by following the instructions on the extension page, so they re complete and on step by step basis. But could you perhaps tell us where things goes wrong? any errors?any part you dont understand what It means?
0

#4 User is offline   Cade 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 04-July 12

Posted 04 July 2012 - 07:45 AM

 Sampa, on 04 July 2012 - 05:46 AM, said:

I use this extension by following the instructions on the extension page, so they re complete and on step by step basis. But could you perhaps tell us where things goes wrong? any errors?any part you dont understand what It means?


Hi Sampa,
I loaded all of the files into my project/protected directory however I wasn't sure where the file "MessageModule.php" was meant to be loaded.

When trying to open one of the Controllers, say Inbox I got the following error:

Trying to get property of non-object 
$this->userModel = Yii::app()->getModule('message')->userModel;



This appears to relate to the calling of the MessageModule.php file and specifically userModel variable, which appears to get assigned during the construct of the class and I assume I need to use something like the following mentioned in the Extension:
return array(
    'modules' => array(
        'message' => array(
            'userModel' => 'User',
            'getNameMethod' => 'getFullName',
            'getSuggestMethod' => 'getSuggest',
        ),
    ),
);



My problem is I'm not sure where to store MessageModule.php or how to load it. I thought maybe it needs to be put into the /config/main.php, but I'm really not sure.


I would really appreciate any information you can give me on this and any corrections to any of my observations I have mentioned above.
Regards,
Cade

Current Projects
You Do It List: http://youdoitlist.com.au
0

#5 User is offline   Sampa 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 173
  • Joined: 18-December 11
  • Location:Stockholm,Sweden

Posted 04 July 2012 - 11:45 AM

The MessageModule.phpare suppossed to be in protected/modules/message/MessageModule.php (the module "root")
There you also put the view/controller/models/data folders.

'modules'=>array(
....
'message' => array(
'userModel' => 'User', //make sure this is the same as the user model you use
'getNameMethod' => 'getFullName',
'getSuggestMethod' => 'getSuggest',
),
....
),
0

#6 User is offline   Cade 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 04-July 12

Posted 05 July 2012 - 05:31 AM

 Sampa, on 04 July 2012 - 11:45 AM, said:

The MessageModule.phpare suppossed to be in protected/modules/message/MessageModule.php (the module "root")
There you also put the view/controller/models/data folders.

'modules'=>array(
....
'message' => array(
'userModel' => 'User', //make sure this is the same as the user model you use
'getNameMethod' => 'getFullName',
'getSuggestMethod' => 'getSuggest',
),
....
),


Yep, that did the trick.

Thanks for all your help


Just to recap for anyone else who is very new to Yii and wants to use this.

Step 1
Extract the contents of the ZIP to /protected/modules/message/
NOTE: the MessageModule.php file should be directly under this directory

Step 2
Modify the protected/config/main.php file and add the following in 'modules' (same location as 'gii'=>array):
		'message' => array(
			'userModel' => 'User',
			'getNameMethod' => 'getFullName',
			'getSuggestMethod' => 'getSuggest',
			'viewPath' => '/message/fancy',
		),

NOTE: The viewPath line at the end is optional and uses the fancy style rather than default

Step 3
Create the database as per the /protected/modules/message/data/message.sql

Step 4
Update your User module (or what module you specify in step 2 to include a getFullName and getSuggest module
examples for this are in the Private Messaging Extension

Step 5
Access the module via: ..../index.php/message
The above will depend on your URL structure


Issues
I did get 1 issue at step 5 where it complained it couldn't find the database {{messages}}.
I had to edit the protected/modules/message/models/Message.php and change the line:
return '{{messages}}';
To
return 'messages';
Regards,
Cade

Current Projects
You Do It List: http://youdoitlist.com.au
0

#7 User is offline   Sampa 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 173
  • Joined: 18-December 11
  • Location:Stockholm,Sweden

Posted 05 July 2012 - 04:48 PM

 Cade, on 05 July 2012 - 05:31 AM, said:

Yep, that did the trick.

Thanks for all your help


Just to recap for anyone else who is very new to Yii and wants to use this.
.........


wow, I'm glad it solved it for you and amazing you wrote that "How-to". Thats the spirit.
I think you can have helped some beginners.
0

#8 User is offline   DenizB 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 11-May 12

Posted 25 July 2012 - 04:17 PM

Step 1
Extract the contents of the ZIP to /protected/modules/message/
NOTE: the MessageModule.php file should be directly under this directory

Step 2
Modify the protected/config/main.php file and add the following in 'modules' (same location as 'gii'=>array):
		'message' => array(
			'userModel' => 'User',
			'getNameMethod' => 'getFullName',
			'getSuggestMethod' => 'getSuggest',
			'viewPath' => '/message/fancy',
		),

...

It is real step-by-step explanation.Thank you Cade.
0

#9 User is offline   sanguina 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 40
  • Joined: 22-July 12

Posted 28 February 2013 - 02:33 PM

Hi

thanks for this extension. worked out of box :)

can you suggest how to customize name-suggestions feature to show names near the text-field rather than at the top corner of the page ?

thanks again.
until I become certain that there is no certainty.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users