How to copy the "members" block to a new page?

Using Page Builder, I've created a new page, and added a couple of HTML blocks to it. 

Now I want to have the "members" block in it (showing site members- recent/online/top), in addition to the one I have at homepage.

 

So I went directly to the DB, table sys_page_compose and I've copied the needed line and edited it, so now Page Builder is showing me the "members" block as available in my new page.

Happily I went and placed the block in the column, but... the block doesn't show up in my site, on the new page. I see it in Page Builder, but it's not present in the actual page.

I guess I'm missing something, I have no idea what. 

 

Hints? Is it even possible to do what I'm trying to do? (I already did something similar to the shoutbox, which I moved to a new page, and it works...)

Quote · 20 May 2013

Shoutbox can be copied. That's why it works.

Usually only blocks of type PHP, RSS and ECHO can be copied. Other blocks are specifically written for the page they were designed for and will not work on other pages. The members block is one of them. It was specifically written for the index page.

https://www.deanbassett.com
Quote · 20 May 2013

Hmmm... got it, thanks for the info.

 

Is there a simple way of creating an "Online members" block in a new page?

("Simple" can involve DB and a bit of code, but not something which takes a couple of days to accomplish... if it's too complicated I'll go around it)

Quote · 20 May 2013

You can try this,
edit a HTML block on your new page from DB, table sys_page_compose, edit to this

1)
Desc: Simple PHP Block

Caption: Online Members

Func: PHP

Content:

global $site;
global $oTemplConfig;

$memonline_num  = '16'; //number of online members

$memonline_res = db_res( "SELECT * FROM `Profiles` WHERE `Status` = 'Active' AND `DateLastNav` > SUBDATE(NOW(), INTERVAL 1 MINUTE) LIMIT $memonline_num" );
  
    $ret .= '<div class="clear_both"></div>';
  
   if( mysql_num_rows( $memonline_res ) > 0 )
   {
    $j=1;
    while( $memonline_arr = mysql_fetch_assoc( $memonline_res ) )
    {

                                        $ret .= '<div class="featured_block_1">';
                                        $ret .= get_member_thumbnail( $memonline_arr['ID'], 'none' );
                                        $ret .= '<a href="' . getProfileLink( $memonline_arr['ID'] ) . '">';
                                        $ret .= process_line_output( $memonline_arr['NickName'] );
                                        $ret .= '</a>';
                                        $ret .= '</div>';
                                            
     $j++;
    }
   }
   else
   {
    $ret .= '<div class="no_result">';
     $ret .= '<div>';
      $ret .= 'No members online now';
     $ret .= '</div>';
    $ret .= '</div>';
   }
   $ret .= '<div class="clear_both"></div>';
 
  return $ret;


SAVE IT


2)
Delete all cache

Quote · 22 May 2013

okweb, you are my hero!

 

I've used your solution with Deanos Tools' "insert PHP block", added a bit of CSS, and it's perfect! just what I needed.

Plused you for that, excellent tip, thank you thank you thank you.

Quote · 23 May 2013

Hello

 

but for random members only with avatar?

(but dont online)

 

thank you?

Quote · 7 Jul 2013

edit sql query, you can try this

from:

$memonline_res = db_res( "SELECT * FROM `Profiles` WHERE `Status` = 'Active' AND `DateLastNav` > SUBDATE(NOW(), INTERVAL 1 MINUTE) LIMIT $memonline_num" );

to this:

$memonline_res = db_res( "SELECT * FROM `Profiles` WHERE `Status` = 'Active' AND `Avatar` > 0 ORDER BY RAND() LIMIT $memonline_num" );

Quote · 7 Jul 2013

 It would be my advise not to use this on large database with lots of profiles. MySQL RAND() is never recommended.

$memonline_res = db_res( "SELECT * FROM `Profiles` WHERE `Status` = 'Active' AND `Avatar` > 0 ORDER BY RAND() LIMIT $memonline_num" );

 

so much to do....
Quote · 7 Jul 2013

Hello

 

nice work

but all thumb is on one column,how setup to 3 or 4 profile in row

 

thank you

Quote · 9 Jul 2013

For those who are not inclined to mess around code, there is a Members Anywhere module that allows you to create custom member blocks on any page.

Paypal email is jeromemingo@gmail.com - http://www.boonex.com/market/posts/modzzz
Quote · 13 Jul 2013

And for those who want to keep it simple is there the Simple Member AnyWhere Module

Dedicated servers for as little as $32 (28 euro) - See http://denre.com for more information
Quote · 14 Jul 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.