[cBB Portal] a few things


no_avatar
leschek
 
Posts: 65
Joined: Sat Sep 08, 2012 10:08 pm
 Sat Sep 08, 2012 10:41 pm • via Web
Hi,
I really like your portal and I would like to install it on my live forum, but while testing it on localhost and found few problems with blocks I would like to solve:

Age ranges block
If no member of forum sets his/her age you get this errors:

Code: Select all
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 95: Division by zero
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 95: Division by zero
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 95: Division by zero
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 95: Division by zero
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 95: Division by zero
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 95: Division by zero
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 95: Division by zero
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 95: Division by zero
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 102: Division by zero

If at least one user write his/her birthdays to UCP everything is OK.

Login block

When I log in with the login block, it redirect me to wrong address:

Code: Select all
http://127.0.0.1/quickinstall_newboards/cBB_portal/portal.php

instead of

Code: Select all
http://127.0.0.1/quickinstall_new/boards/cBB_portal/portal.php

(there is missing "/" before "boards/")

Recent Topics block
If I set topic as Global announcement it doesn't show on announcement tab. Would be possible to make another tab for global announcements or show them in recent announcements tab (similar as with announcement block)?

Calendar with events block
I really like it, but would be possible to make it compatible with alightner calendar (or maybe make another block)? I mean if I add event with your block I would like to see it on alightner calendar and if I add event there I would like to see it on the block on portal.

A few ideas
I guess it would be nice if users can hide blocks on index, viewtopic and viewforum pages to side so forum would be visible on whole page.
I also would like to ask for Gallery addon and Classifieds MOD addon.

Problem with Advanced BBCode Box3 MOD

While testing the portal I found the options for image resizing. Because I have on my live forum installed Advanced BBCode Box3 MOD (it also allow image resizing) I tried to install cBB Portal on forum with ABBC 3 MOD and have
problem with few parts of code:

Open: includes/bbcode.php

Find
Code: Select all
            'img'=>'<img src="$1" alt="' . $user->lang['IMAGE'] . '" />',

but I have

Code: Select all
            'img'      => '<img src="$1" alt="' . $user->lang['IMAGE'] . '" class="resize_me" />',   

Open: styles/prosilver/template/bbcode.html

Find

Code: Select all
      <!-- BEGIN img --><img src="{URL}" alt="{L_IMAGE}" /><!-- END img -->

but I have

Code: Select all
<!-- BEGIN img --><img src="{URL}" alt="{L_IMAGE}" class="resize_me" /><!-- END img -->

Open: styles/prosilver/template/attachment.html

Find

Code: Select all
<dt class="attach-image"><img src="{_file.U_INLINE_LINK}" alt="{_file.DOWNLOAD_NAME}" onclick="viewableArea(this);" /></dt>

but I have

Code: Select all
<dt class="attach-image"><img src="{_file.U_INLINE_LINK}" alt="{_file.DOWNLOAD_NAME}" onclick="viewableArea(this);" class="attach_me" /></dt>

Basically it uses class "attach_me" instead of "rsz-image".
I didn't do those edits and so far everything seems OK, but I would like to know if there is better way to edit the files than don't edit them at all?
User avatar
IvanPF
Administrator
 
Posts: 2010
Joined: Fri Jun 17, 2011 12:15 am
Location: España (Spain)
 Mon Sep 10, 2012 8:08 pm • via Web
Age ranges block
If no member of forum sets his/her age you get this errors:

Code: Select all
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 95: Division by zero
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 95: Division by zero
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 95: Division by zero
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 95: Division by zero
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 95: Division by zero
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 95: Division by zero
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 95: Division by zero
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 95: Division by zero
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 102: Division by zero

If at least one user write his/her birthdays to UCP everything is OK.

Try this. Open /portal/block/age_ranges_block.php
Find:
Code: Select all
'USERS'      => $range['users'] . ' (' . (($range['users']*100) / $total_birthdays) . '%)',

Replace with:
Code: Select all
'USERS'      => ($total_birthdays) ? $range['users'] . ' (' . (($range['users']*100) / $total_birthdays) . '%)' : 0,


Login block

When I log in with the login block, it redirect me to wrong address:

Code: Select all
http://127.0.0.1/quickinstall_newboards/cBB_portal/portal.php

instead of

Code: Select all
http://127.0.0.1/quickinstall_new/boards/cBB_portal/portal.php

(there is missing "/" before "boards/")

The block uses the path specified on the phpbb configuration. Check if this path is correct.

Recent Topics block
If I set topic as Global announcement it doesn't show on announcement tab. Would be possible to make another tab for global announcements or show them in recent announcements tab (similar as with announcement block)?

Try this. Open /portal/block/recent_topics_block.php
Find:
Code: Select all
      $sql_ary = array(
         'recent_topics' => ') ORDER BY topic_time DESC',

         'recent_replies' => 'AND topic_replies > 0
            ORDER BY topic_last_post_time DESC',

         'recent_announcements' => 'AND topic_type IN(' . POST_ANNOUNCE . ', ' . POST_GLOBAL . ')
            ORDER BY topic_time DESC',
      );

      foreach($sql_ary as $tab => $sql)
      {
         //Delete the array in the template if exists, prevent errors between blocks
         $template->destroy_block_vars($tab);

         $query = 'SELECT forum_id, topic_id, topic_replies, topic_views, topic_time, topic_title,
            topic_poster, topic_first_poster_name, topic_first_poster_colour, topic_last_post_id
            FROM ' . TOPICS_TABLE . '
            WHERE topic_status <> ' . ITEM_MOVED . '
            AND topic_approved = 1
            AND ' . $db->sql_in_set('forum_id', $forum_ids) . "
            $sql";

Replace with:
Code: Select all
      $sql_ary = array(
         'recent_topics' => ') ORDER BY topic_time DESC',

         'recent_replies' => 'AND topic_replies > 0)
            ORDER BY topic_last_post_time DESC',

         'recent_announcements' => 'AND topic_type = ' . POST_ANNOUNCE . ')
            OR (forum_id = 0 AND ' . POST_GLOBAL . ')
            ORDER BY topic_time DESC',
      );

      foreach($sql_ary as $tab => $sql)
      {
         //Delete the array in the template if exists, prevent errors between blocks
         $template->destroy_block_vars($tab);

         $query = 'SELECT forum_id, topic_id, topic_replies, topic_views, topic_time, topic_title,
            topic_poster, topic_first_poster_name, topic_first_poster_colour, topic_last_post_id
            FROM ' . TOPICS_TABLE . '
            WHERE topic_status <> ' . ITEM_MOVED . '
            AND (topic_approved = 1
            AND ' . $db->sql_in_set('forum_id', $forum_ids) . "
            $sql";


Calendar with events block
I really like it, but would be possible to make it compatible with alightner calendar (or maybe make another block)? I mean if I add event with your block I would like to see it on alightner calendar and if I add event there I would like to see it on the block on portal.

I'll check this but I do not think it's possible.

A few ideas
I guess it would be nice if users can hide blocks on index, viewtopic and viewforum pages to side so forum would be visible on whole page.
I also would like to ask for Gallery addon and Classifieds MOD addon.

I will review the topic of addons. If it is possible, I will develop.
The option to hide the blocks (slidebars) will be included in the next version of the mod (I'm developing it at the moment)


Problem with Advanced BBCode Box3 MOD

While testing the portal I found the options for image resizing. Because I have on my live forum installedAdvanced BBCode Box3 MOD (it also allow image resizing) I tried to install cBB Portal on forum with ABBC 3 MOD and have
problem with few parts of code:

Open: includes/bbcode.php

Find
Code: Select all
            'img'=>'<img src="$1" alt="' . $user->lang['IMAGE'] . '" />',

but I have

Code: Select all
            'img'      => '<img src="$1" alt="' . $user->lang['IMAGE'] . '" class="resize_me" />',   

Open: styles/prosilver/template/bbcode.html

Find

Code: Select all
      <!-- BEGIN img --><img src="{URL}" alt="{L_IMAGE}" /><!-- END img -->

but I have

Code: Select all
<!-- BEGIN img --><img src="{URL}" alt="{L_IMAGE}" class="resize_me" /><!-- END img -->

Open: styles/prosilver/template/attachment.html

Find

Code: Select all
<dt class="attach-image"><img src="{_file.U_INLINE_LINK}" alt="{_file.DOWNLOAD_NAME}" onclick="viewableArea(this);" /></dt>

but I have

Code: Select all
<dt class="attach-image"><img src="{_file.U_INLINE_LINK}" alt="{_file.DOWNLOAD_NAME}"onclick="viewableArea(this);" class="attach_me" /></dt>

Basically it uses class "attach_me" instead of "rsz-image".
I didn't do those edits and so far everything seems OK, but I would like to know if there is better way to edit the files than don't edit them at all?

If you let these editions as they are, the images of the post will be resized with Advanced BBCode Box3 MOD.

If you change these lines as indicated in the cBB Portal Installer, the images will be resized by cBB Portal.
You must decide which mod you want to use for this function because you can not mix them.
no_avatar
leschek
 
Posts: 65
Joined: Sat Sep 08, 2012 10:08 pm
 Mon Sep 10, 2012 9:38 pm • via Web
Thank you for fast reply with fixes.
1.
Admin wrote:Try this. Open /portal/block/age_ranges_block.php
Find:

Code: Select all
'USERS' => $range['users'] . ' (' . (($range['users']*100) / $total_birthdays) . '%)',

Replace with:

Code: Select all
'USERS' => ($total_birthdays) ? $range['users'] . ' (' . (($range['users']*100) / $total_birthdays) . '%)' : 0,


I did the edits and it helped, but I still get one error:
Code: Select all
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 102: Division by zero


2. Login block

Admin wrote:The block uses the path specified on the phpbb configuration. Check if this path is correct.


You are correct, There was wrong path. It's interesting, because it worked with board login without any problem, so I didn't check it before. I guess it is problem of Quick install I use to install testing boards.

3. Recent Topics block
Your solution is working

4. Block addonsThose MODs I wrote about are quite popular so I hope you will develop them. Or is somewhere tutorial for users to make their own blocks?

5.Advanced BBCode Box3 MOD
Admin wrote:You must decide which mod you want to use for this function because you can not mix them.


Thanks for explanation. I just don't want to mess code on live forum.
User avatar
IvanPF
Administrator
 
Posts: 2010
Joined: Fri Jun 17, 2011 12:15 am
Location: España (Spain)
 Mon Sep 10, 2012 9:53 pm • via Web
leschek wrote:Thank you for fast reply with fixes.
1.
Admin wrote:Try this. Open /portal/block/age_ranges_block.php
Find:

Code: Select all
'USERS' => $range['users'] . ' (' . (($range['users']*100) / $total_birthdays) . '%)',

Replace with:

Code: Select all
'USERS' => ($total_birthdays) ? $range['users'] . ' (' . (($range['users']*100) / $total_birthdays) . '%)' : 0,


I did the edits and it helped, but I still get one error:
Code: Select all
[phpBB Debug] PHP Warning: in file [ROOT]/portal/block/age_ranges_block.php on line 102: Division by zero

Sorry, Try this:
Find:
Code: Select all
foreach($ranges as $range)
      {

Add before:
Code: Select all
      // Return if no birthdays
      if(!$total_birthdays)
      {
         return false;
      }

The block don't show if no birthdays are present.


4. Block addonsThose MODs I wrote about are quite popular so I hope you will develop them. Or is somewhere tutorial for users to make their own blocks?

I will writeda tutorial when the new version of cBB Portal will be released.
no_avatar
leschek
 
Posts: 65
Joined: Sat Sep 08, 2012 10:08 pm
 Tue Sep 11, 2012 12:48 pm • via Web
Thanks for the fix and great support. It's working OK.

Admin wrote:I will writeda tutorial when the new version of cBB Portal will be released.


Awesome. I look forward to the new version.

Who is online

Users browsing this forum: No registered users and 0 guests