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

Jump to content

  • (5 Pages)
  • +
  • « First
  • 2
  • 3
  • 4
  • 5
  • You cannot start a new topic
  • You cannot reply to this topic

[Extension] Bbii Forum Forum module

#50 User is offline   Ronald van Belzen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 159
  • Joined: 04-July 13
  • Location:The Netherlands

Posted 29 January 2015 - 10:28 AM

View PostRick, on 28 January 2015 - 08:31 PM, said:

Hi Ronald, thank you for such a wonderful extension!

Have you thought about the ability to attach file(s) to a post and sending emails to thread participants when the thread changes?

Actually, I'm more interested in setting up the ability to define watchers on a thread, board, and category levels.

I'll probably start working towards these features in my spare (yeah right!) time but didn't want to reinvent the wheel if anything similar might be on your roadmap.


Thusfar I have always decided against adding more functionality to the module. Not because it would be difficult to do or because I lack the time, but because I want to keep the module relatively lightweight and easy to adapt. The forum only contains what I consider to be minimum requirements to be functional, and I strive to keep it that way.

However, I have been known to change my mind from time to time.
0

#51 User is offline   Mono 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 21-January 15

Posted 29 January 2015 - 07:29 PM

Hi Ronald.

I think this is not correct.
in file views/forum/_post.php

div class="post">
	<?php echo CHtml::tag('a', array('name'=>$data->id)); ?>
	<div class="member-cell">

may be better

div class="post">
	<div class="member-cell">

0

#52 User is offline   Ronald van Belzen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 159
  • Joined: 04-July 13
  • Location:The Netherlands

Posted 30 January 2015 - 02:33 PM

View PostMono, on 29 January 2015 - 07:29 PM, said:

Hi Ronald.

I think this is not correct.
in file views/forum/_post.php

div class="post">
	<?php echo CHtml::tag('a', array('name'=>$data->id)); ?>
	<div class="member-cell">

may be better

div class="post">
	<div class="member-cell">



You will lose the functionality that automatically scrolls to a post on a page when you do that.
0

#53 User is offline   Mono 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 21-January 15

Posted 30 January 2015 - 03:58 PM

I'v got it. But I don't use it. So I don't see the difference.
thanks for the reply.
0

#54 User is offline   Zummer 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 31-January 15

Posted 31 January 2015 - 06:51 AM

Hi! Where to look for the problem?

Attached File(s)

  • Attached File  123.jpg (136.13K)
    Number of downloads: 19

0

#55 User is offline   Mono 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 21-January 15

Posted 02 February 2015 - 03:33 PM

Hello Ronald,
For the second day, I can not understand how to do it, if at all possible. Maybe you have something to help? How to withdraw paginator show from the post in page 'forum/forum/forum'? As show example in the picture.

Attached File(s)

  • Attached File  forum.png (26.46K)
    Number of downloads: 4

0

#56 User is offline   Stefano Mtangoo 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 366
  • Joined: 02-January 12
  • Location:Dar es Salaam, Tanzania

Posted 02 February 2015 - 04:13 PM

View PostRonald van Belzen, on 10 January 2015 - 06:16 AM, said:

After giving it some thought, I have decided that I am going to redesign this functionality.


So which way are you going this time?
I have found that this is one of hard topics in forums design!
And God said, Let there be science...and it was so! Jukwaa la wanaoongea Kiswahili Hapa, and its github repo here
0

#57 User is offline   Ronald van Belzen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 159
  • Joined: 04-July 13
  • Location:The Netherlands

Posted 02 February 2015 - 05:01 PM

View PostMono, on 02 February 2015 - 03:33 PM, said:

Hello Ronald,
For the second day, I can not understand how to do it, if at all possible. Maybe you have something to help? How to withdraw paginator show from the post in page 'forum/forum/forum'? As show example in the picture.


I have not much experience with the subject of pagination in Yii, but I guess you will have to take a look at http://www.yiiframew...1.1/CPagination and http://www.yiiframew.../1.1/CLinkPager and figure it out.

Good luck.
0

#58 User is offline   oligalma 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 419
  • Joined: 07-April 12
  • Location:Spain

Posted 04 February 2015 - 06:33 PM

I get this error:

Trying to get property of non-object

protected/modules/bbii/views/forum/_footer.php(38)
<th><?php echo Yii::t('BbiiModule.bbii','Newest member'); ?></th><td><?php $member = BbiiMember::model()->newest()->find(); echo CHtml::link($member->member_name, array('member/view', 'id'=>$member->id)); ?></td>


Please help!
0

#59 User is offline   Ronald van Belzen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 159
  • Joined: 04-July 13
  • Location:The Netherlands

Posted 05 February 2015 - 08:02 AM

View Postmoginn, on 04 February 2015 - 06:33 PM, said:

I get this error:

Trying to get property of non-object

protected/modules/bbii/views/forum/_footer.php(38)
<th><?php echo Yii::t('BbiiModule.bbii','Newest member'); ?></th><td><?php $member = BbiiMember::model()->newest()->find(); echo CHtml::link($member->member_name, array('member/view', 'id'=>$member->id)); ?></td>


Please help!


The cause is that database table `bbii_member` is still empty, which is most likely due to not following the installation instructions.

Login before visiting the forum again, or add a dummy user to the table `bbii_member`.
0

#60 User is offline   Mono 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 21-January 15

Posted 07 February 2015 - 02:27 PM

Hello Ronald.

In file ModeratorController.php
in line error

$poll = BBiiPoll::model()->findByAttributes(array('post_id'=>$model->id));

correct model name

$poll = BbiiPoll::model()->findByAttributes(array('post_id'=>$model->id));

0

#61 User is offline   Ronald van Belzen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 159
  • Joined: 04-July 13
  • Location:The Netherlands

Posted 07 February 2015 - 03:28 PM

View PostMono, on 07 February 2015 - 02:27 PM, said:

Hello Ronald.

In file ModeratorController.php
in line error

$poll = BBiiPoll::model()->findByAttributes(array('post_id'=>$model->id));

correct model name

$poll = BbiiPoll::model()->findByAttributes(array('post_id'=>$model->id));



Thanks.

Btw, if you are the owner of the forum I think you are, you will be interested in this neat little adjustment of the pager that will be included in version 1.0.8: http://www.doprogram...Post/view/id/20.
0

#62 User is offline   Mono 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 21-January 15

Posted 08 February 2015 - 02:32 PM

Thank U. I already did that before)
And I did so in the file _topic.php (could not do this with Yii)

this
$postsPerPage
$active
$count_show_page
$url
$url_page

customized for you

How it works, see the picture

 <?php
/* input data */
  $n=$data->num_replies;
  $postsPerPage = 15;
  $count_pages = ceil($n / $postsPerPage);
  $active = 0;
  $count_show_pages = 3;
  $url =  'topic?id='.$data->id;
  $url_page =  'topic?id='.$data->id.'&BbiiPost_page=';
  if ($count_pages > 1) {
    $left = $active - 1;
    $right = $count_pages - $active;
	
    if ($left < floor($count_show_pages / 2)) $start = 1;    
    else $start = $active - floor($count_show_pages / 2);
    $end = $start + $count_show_pages - 1;
    if ($end > $count_pages) {
      $start -= ($end - $count_pages);
      $end = $count_pages;
     $start = 1;
    }
?>
      <!-- start Pagination -->
      <div class="pagination">
        <?php for ($i = $start; $i <= $end; $i++) { ?>
        <div id="pagin"><a href="<?php if ($i == 1) { ?><?=$url?><?php } else { ?><?=$url_page.$i?><?php } ?>"title="<?=$text?>. Cтраница <?=$i?>">
        <?=$i?></a></div>
        <?php } ?>
        <?php if ($count_show_pages < $count_pages) { ?>
       <div id="pagin"><a href="<?=$url_page.$count_pages?>" title="<?=$text?>. Page <?=$count_pages?> ">...
        <?=$count_pages?>
        →</a></div>
        <?php } ?>
      </div>
      <?php } ?>
    </div>
    <!-- end Pagination --> 
    
  </div>
  <div class="forum-cell center">
   ...........

Attached File(s)

  • Attached File  forum.png (14.55K)
    Number of downloads: 17

0

#63 User is offline   Mono 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 21-January 15

Posted 15 February 2015 - 12:48 PM

Refresh in post page not work correct with paginator ( in page 2,3... etc). After refresh any page paginator go to page 1.

Fix - in file ForumController.php
......} elseif(!$this->isModerator()) {
				$groupId = BbiiMember::model()->findByPk(Yii::app()->user->id)->group_id;
				if($forum->membergroup_id != $groupId) {
					throw new CHttpException(403, Yii::t('BbiiModule.bbii', 'You have no permission to read requested topic.'));
				}
			}
		}
		$dataProvider=new CActiveDataProvider('BbiiPost', array(
			'criteria'=>array(
				'condition'=>'approved = 1 and topic_id=' . $topic->id,
				'order'=>'t.id',
				'with'=>array('poster'),
			),
			'pagination'=>array(
				'pageSize'=>$this->module->postsPerPage,
			),
		));


exchange code

......} elseif(!$this->isModerator()) {
				$groupId = BbiiMember::model()->findByPk(Yii::app()->user->id)->group_id;
				if($forum->membergroup_id != $groupId) {
					throw new CHttpException(403, Yii::t('BbiiModule.bbii', 'You have no permission to read requested topic.'));
				}
			}
		}
		if(isset($_GET['BbiiPost_page']) && isset($_GET['ajax'])) {
            $postPage = (int) $_GET['BbiiPost_page'] - 1;
            Yii::app()->user->setState('BbiiPost_page', $postPage);
			Yii::app()->user->setState('BbiiTopic_id', $id);
            unset($_GET['BbiiPost_page']);
        } elseif(isset($_GET['ajax'])) {
            Yii::app()->user->setState('BbiiPost_page', 0);
		} elseif(Yii::app()->user->hasState('BbiiTopic_id') && Yii::app()->user->BbiiTopic_id != $id) {
			unset(Yii::app()->user->BbiiTopic_id);
			Yii::app()->user->setState('BbiiPost_page', 0);
		}
		
		$dataProvider=new CActiveDataProvider('BbiiPost', array(
			'criteria'=>array(
				'condition'=>'approved = 1 and topic_id=' . $topic->id,
				'order'=>'t.id',
				'with'=>array('poster'),
			),
			'pagination'=>array(
				'pageSize'=>$this->module->postsPerPage,
				'currentPage' => Yii::app()->user->getState('BbiiPost_page', 0),
				
			),
		));

0

#64 User is offline   Mono 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 21-January 15

Posted 15 February 2015 - 02:35 PM

for after pagination to get top of the page
add in file topic.php this

'afterAjaxUpdate' => 'function(){
$("html, body").animate({scrollTop: $("body").position().top }, 100);}',


after

<?php $this->widget('zii.widgets.CListView', array(
		'id'=>'bbiiPost',
		'dataProvider'=>$dataProvider,
		'itemView'=>'_post',


I'm sorry I do not speak English and I use Google translator :rolleyes:
0

#65 User is offline   Ronald van Belzen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 159
  • Joined: 04-July 13
  • Location:The Netherlands

Posted 16 February 2015 - 05:34 PM

View PostMono, on 15 February 2015 - 02:35 PM, said:

for after pagination to get top of the page
add in file topic.php this

'afterAjaxUpdate' => 'function(){
$("html, body").animate({scrollTop: $("body").position().top }, 100);}',


after

<?php $this->widget('zii.widgets.CListView', array(
		'id'=>'bbiiPost',
		'dataProvider'=>$dataProvider,
		'itemView'=>'_post',




Something along those line would be a good idea.
0

#66 User is offline   malkabani.com 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 05-May 10

Posted 12 March 2015 - 03:40 AM

how to create polls with options
0

#67 User is offline   Ronald van Belzen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 159
  • Joined: 04-July 13
  • Location:The Netherlands

Posted 12 March 2015 - 05:54 AM

View Postmalkabani.com, on 12 March 2015 - 03:40 AM, said:

how to create polls with options


Create a new topic and click the Add poll button.
0

#68 User is offline   malkabani.com 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 05-May 10

Posted 14 March 2015 - 03:15 AM

View PostRonald van Belzen, on 12 March 2015 - 05:54 AM, said:

Create a new topic and click the Add poll button.

add poll button not apear
0

#69 User is offline   Ronald van Belzen 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 159
  • Joined: 04-July 13
  • Location:The Netherlands

Posted 14 March 2015 - 04:50 AM

View Postmalkabani.com, on 14 March 2015 - 03:15 AM, said:

add poll button not apear


In that case you have configured that forum not to allow polls. Change the Poll setting for the Forum in which you want to allow the creation of polls. Read the manual when you do not know how to do that.
0

Share this topic:


  • (5 Pages)
  • +
  • « First
  • 2
  • 3
  • 4
  • 5
  • 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