HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Block missing in forum when side panel is added

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#29027 (In Topic #6656)
Avatar

Community saint

Hi.
I added left side panel to the forum, but then the Member information block disapeared from the top of the page. Is that designed so, or it is the bug? Is it possible to have both?
Back to the top
 
Posted
Rating:
#29047
Avatar

This is supposed to happen as it's effectively redundant. Between a menu block, a personal side stats block, and a personal topics block, it's virtually all on the panel. A code modification could put it back. Make a sources_custom/ocf_general.php that contains:

Code

<?php
function ocf_wrapper($title,$content,$show_personal_bar=true,$show_stats=true,$forum_id=NULL)
{
   global $ZONE;
   $old_zone_wide=$ZONE['zone_wide'];
   $ZONE['zone_wide']=1;
   $ret=non_overrided__ocf_wrapper($title,$content,$show_personal_bar=true,$show_stats=true,$forum_id=NULL);
   
   $ZONE['zone_wide']=$old_zone_wide;
   return $ret;
}
?>
(untested)


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#29106
Avatar

Community saint

I am just wondering, where is the limit of flexibility here :)

but you are right. It is not really needed. Maybe just the date of the last visit and the number of new topics and posts since then. Is it possible to have this info in the Forum block?



Last edit: by Mindaugas
Back to the top
 
Posted
Rating:
#29130
Avatar

Not currently, but I've just written the code for some new symbols that'll allow that.
In sources/symbols.php, add the following into the big set of similar lines (the file is basically a repeating pattern of 'case…break' groups up to line 1006).

Code

         case 'LAST_VISIT_TIME':
            if (get_forum_type()=='ocf')
            {
               $member_info=ocf_read_in_member_profile(get_member(),true);
               $value=strval($member_info['last_visit_time']);
            }
            break;

         case 'NUM_NEW_TOPICS':
            if (get_forum_type()=='ocf')
            {
               $member_info=ocf_read_in_member_profile(get_member(),true);
               $_new_topics=$GLOBALS['FORUM_DB']->query('SELECT COUNT(*) AS mycnt FROM '.$GLOBALS['FORUM_DB']->get_table_prefix().'f_topics WHERE NOT t_forum_id IS NULL AND t_cache_first_time>'.(string)intval($member_info['last_visit_time']));
               $new_topics=$_new_topics[0]['mycnt'];
               $value=strval($new_topics);
            }
            break;

         case 'NUM_NEW_POSTS':
            if (get_forum_type()=='ocf')
            {
               $member_info=ocf_read_in_member_profile(get_member(),true);
               $_new_posts=$GLOBALS['FORUM_DB']->query('SELECT COUNT(*) AS mycnt FROM '.$GLOBALS['FORUM_DB']->get_table_prefix().'f_posts WHERE NOT p_cache_forum_id IS NULL AND p_time>'.(string)intval($member_info['last_visit_time']));
               $new_posts=$_new_posts[0]['mycnt'];
               $value=strval($new_posts);
            }
            break;

Then say, in a template of your choice,

Code

<p>Last visit: {$FROM_TIMESTAMP,d/m/Y h:i:s,{$LAST_VISIT_TIME}}</p>
<p>New topics: {$NUM_NEW_TOPICS}</p>
<p>New posts: {$NUM_NEW_POSTS}</p>

I'll be adding this to the next patch release.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#29157
Avatar

Community saint

I'll be adding this to the next patch release.
That is very good news :)
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: