Yii Framework Forum: [Extension] Yii-Forum - Yii Framework Forum

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

[Extension] Yii-Forum Yii forum module Rate Topic: -----

#21 User is offline   Ronald van Belzen 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 64
  • Joined: 04-July 13
  • Location:The Netherlands

Posted 04 July 2013 - 03:40 PM

View PostSolid, on 26 June 2013 - 04:05 PM, said:

Great ext!

Easy to install, and easy to modify.

I have one question tho, the
Yii::app()->controller->module->format_date

how can i customize that? Cant seem to find it, i need to translate it.

Thanks!

You can find it in the script YiiForumModule.php located in the root of the module package.
0

#22 User is offline   mikeklon 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 30-July 11
  • Location:Florida USA

Posted 05 August 2013 - 11:06 AM

Good Afternoon all. I'm kind of a newbie.

This is my first attempt at installing a module. I'm attempting to install the Forum module onto an "out-of-the-box" Yii installation. I followed the instructions to download and modify files. I got Forum to open initially, but then ran into some problems. I've read this forum and have implemented some of the suggested fixes - thank you all. The error I'm getting right now is:

Property "CWebUser.isAdmin" is not defined.

I have added the line:

$this->setState('isAdmin', ($this->name == 'admin'));

in the UserIdentity.php file

This shows up when I just try to access the Forum. Any thoughts? Any help or directions would be appreciated.

Thanks so much - Mike K
0

#23 User is offline   Ronald van Belzen 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 64
  • Joined: 04-July 13
  • Location:The Netherlands

Posted 06 August 2013 - 07:16 AM

View Postmikeklon, on 05 August 2013 - 11:06 AM, said:

Good Afternoon all. I'm kind of a newbie.

This is my first attempt at installing a module. I'm attempting to install the Forum module onto an "out-of-the-box" Yii installation. I followed the instructions to download and modify files. I got Forum to open initially, but then ran into some problems. I've read this forum and have implemented some of the suggested fixes - thank you all. The error I'm getting right now is:

Property "CWebUser.isAdmin" is not defined.

I have added the line:

$this->setState('isAdmin', ($this->name == 'admin'));

in the UserIdentity.php file

This shows up when I just try to access the Forum. Any thoughts? Any help or directions would be appreciated.

Thanks so much - Mike K


The question in return is how you have added the line to set the state for Yii::app()->user->isAdmin ?

The error you are getting seems to indicate that you are logged in while the state is not set, because in the code of a couple of views of that module I read:
$isAdmin = !Yii::app()->user->isGuest && Yii::app()->user->isAdmin;


If this info does not help, can you post your UserIdentity.php so that we can have a look at it?
0

#24 User is offline   mikeklon 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 30-July 11
  • Location:Florida USA

Posted 04 November 2013 - 03:07 PM

View Postmikeklon, on 05 August 2013 - 11:06 AM, said:

Good Afternoon all. I'm kind of a newbie.

This is my first attempt at installing a module. I'm attempting to install the Forum module onto an "out-of-the-box" Yii installation. I followed the instructions to download and modify files. I got Forum to open initially, but then ran into some problems. I've read this forum and have implemented some of the suggested fixes - thank you all. The error I'm getting right now is:

Property "CWebUser.isAdmin" is not defined.

I have added the line:

$this->setState('isAdmin', ($this->name == 'admin'));

in the UserIdentity.php file

This shows up when I just try to access the Forum. Any thoughts? Any help or directions would be appreciated.

Thanks so much - Mike K



Good afternoon (again).

I had to put this issue aside for a bit. I was finally able to revisit installing the extension this past weekend.

I went through the exercise again and I'm not experiencing the problem any more.

I subsequently tried to add the extension to an existing app and the module seems to continue to behave as expected.

One question now is that the existing app uses a theme. The theme does not carry over into the extensions widget views. MIght there be a way to apply that gobally or do I have to modify each view?

Thank you to all for the responses!
0

#25 User is offline   mikeklon 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 30-July 11
  • Location:Florida USA

Posted 12 November 2013 - 02:53 PM

Hello and good afternoon.

A bug showed up for me:

CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1364 Field 'is_sticky' doesn't have a default value. The SQL statement executed was: INSERT INTO `thread` (`forum_id`, `subject`, `created`) VALUES (:yp0, :yp1, :yp2)

This occurs when someone tries to add a new thread to an existing topic/forum.

This occurs on my development AND production server.

Any suggestions?

Thank you for all help.
0

#26 User is offline   mikeklon 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 17
  • Joined: 30-July 11
  • Location:Florida USA

Posted 12 November 2013 - 03:26 PM

View Postmikeklon, on 12 November 2013 - 02:53 PM, said:


A bug showed up for me:

CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1364 Field 'is_sticky' doesn't have a default value. The SQL statement executed was: INSERT INTO `thread` (`forum_id`, `subject`, `created`) VALUES (:yp0, :yp1, :yp2)

This occurs when someone tries to add a new thread to an existing topic/forum.


I fixed it. I modified the the MySQL table "thread" to have default values for the fields "is_sticky" (0), "is_locked" (0), and "view_count" (1).

No changes to the code.
0

Share this topic:


  • (2 Pages)
  • +
  • 1
  • 2
  • 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