Additional Blocks for "newest members" and "most recent visitors"

I would like to have two additional blocks for the homepage on my site, which I would probably like to be visible for members only.  Instead of having the tab selection for this, I would like to have two additional blocks with this as a default and have them in the builders area for the homepage. 

Is this possible? - perhaps with a php block?  I think it would help with the interation on my site.  If anyone knows how to do this it would be a big help. 

 
Quote · 17 Sep 2012

I too am interested in this.

Skype: shawn.nelson
Quote · 17 Sep 2012

what does the "most recent visitor" mean?

so much to do....
Quote · 17 Sep 2012

have you tried making both blocks and dropping them on the page and then assigning them different membership viewing options using advanced page access module or something similar?

 

I often use this for blocks that I only want premium members to see, but there is also a block there in the same place that only standard membership can see.

 

it works very well.

 

Hope it helps

 

 

Quote · 17 Sep 2012

Prashank, by "most recent visitors" I mean just that - the members who have visited the site most recently.   When we put the member block on a site that is the default I think.   On the site I am building at World-Startups.com  I have that mod to show a random sort in the block in the front page.   What I would like, and what I think would be cool, is if we could have a choice of several blocks.  The "newest members" which we have now, "most recent visitors" and I would still like "random" - though I understand it can cause performance issues if it get too big.   This is probably harder than I thought it would be. 

@DBrautenbach - I'm not sure I completely understand your approach, but this wasn't really a membership level issus - though I will play around with page access control to see if I can make something like that work. 

Quote · 18 Sep 2012

lets see if i can write some php blocks for it.

so much to do....
Quote · 18 Sep 2012

@Prashank - that would be awesome - and I think it would help interactivity on many sites.   As you can see, I am using your mod for putting the login at the top of the page, which I think is great.   If I ever get two nickels to rub together, you are the first guy I will hire.  

Quote · 18 Sep 2012

Ofcourse it can be done, i was thinking how should i do that, creating a php block will be little clumsy. So, i will do it other way (the function block)

@Prashank - that would be awesome - and I think it would help interactivity on many sites.   As you can see, I am using your mod for putting the login at the top of the page, which I think is great.   If I ever get two nickels to rub together, you are the first guy I will hire.  

 Thanks for the appreciation Smile

so much to do....
Quote · 19 Sep 2012

That would be awesome Prashank,- I always thought that having some additional membership blocks - like "most recent visitors" and "newest members" could really help interactivity on the site.  I appreciate your taking a look at this. 

Quote · 20 Sep 2012

Sorry i was busy with my exams. Here it is

Add two block and put the name on it whatever you like. Now go to phpmyadmin and put this FUNC field for 2 blocks.

NewMembers

RecentActivity

Respectively for respective blocks. Now open templates/base/script/BxBaseIndexPageView.php and in the bottom put this just after the function "getMembers"

function getBlockCode_NewMembers() {

return $this->getMembersCustom('latest');

}

 

function getBlockCode_RecentActivity() {

return $this->getMembersCustom('activity');

}

 

function getMembersCustom($sMode = 'latest', $iLimit = 8) {

switch($sMode) {

case 'activity':

$sSort = 'ORDER BY `DateLastNav` DESC';

$sBlockName = 'Activity';

break;

case 'latest':

$sSort = 'ORDER BY `DateReg` DESC';

$sBlockName = 'Latest';

break;

default:

$sSort = '';

}

$sqlLJoin = '';

$sqlCondition = "WHERE `Status` = 'active'";

$iCount = (int)db_value("SELECT COUNT(`Profiles`.`ID`) FROM `Profiles` $sqlLJoin $sqlCondition");

$aData = array();

$sPaginate = '';

if ($iCount) {

$iNewWidth = BX_AVA_W + 6;

$iLimit = (int)$iLimit;

$iPages = ceil($iCount / $iLimit);

$iPage = empty($_GET['page']) ? 1 : (int)$_GET['page'];

if ($iPage > $iPages)

$iPage = $iPages;

if ($iPage < 1)

$iPage = 1;

$sqlFrom = ($iPage - 1) * $iLimit;

$sqlLimit = "LIMIT $sqlFrom, $iLimit";

 

$sqlQuery = "SELECT * FROM `Profiles` $sqlLJoin $sqlCondition $sSort $sqlLimit";

$rData = db_res($sqlQuery);

$iCurrCount = mysql_num_rows($rData);

$aOnline = array();

while ($aData = mysql_fetch_assoc($rData)) {

$sCode .= '<div class="featured_block_1" style="width:' . $iNewWidth . 'px;">';

$aOnline['is_online'] = $aData['is_online'];

$sCode .= get_member_thumbnail($aData['ID'], 'none', true, 'visitor', $aOnline);

$sCode .= '</div>';

}

$sCode = $GLOBALS['oFunctions'] -> centerContent($sCode, '.featured_block_1');

 

if ($iPages > 1) {

$oPaginate = new BxDolPaginate( array('page_url' => BX_DOL_URL_ROOT . 'index.php', 'count' => $iCount, 'per_page' => $iLimit, 'page' => $iPage, 'per_page_changer' => true, 'page_reloader' => true, 'on_change_page' => 'return !loadDynamicBlock({id}, \'index.php?' . $sBlockName . 'Mode=' . $sMode . '&page={page}&per_page={per_page}\');', 'on_change_per_page' => ''));

$sPaginate = $oPaginate -> getSimplePaginate(BX_DOL_URL_ROOT . 'browse.php');

}

} else {

$sCode = MsgBox(_t("_Empty"));

}

return array($sCode, '', $sPaginate);

}


Clear cache and done.

Hope it helps. Good luck :)

so much to do....
Quote · 8 Oct 2012

Hello,

 I am not sure how to do this, and now I need some help.

First I don't understand when you wrote: "Add two block and put the name on it whatever you like" - how ?

Did you mean Administration ->Builders->Pages Blocks and then selecting the page where new blocks will be? What kind of block php or html should I choose?

Next you wrote: " Now go to phpmyadmin and put this FUNC field for 2 blocks." OK, but can you be more specific, where, in which tabele in dolphin database? How to do that, I dont understand...please explain to me more detailed.

I hope you'll find some time to answer my questions.

Thanks.

Kind regards

Mayki

"When things get tough the tough get going..."
Quote · 8 Oct 2012

Go to admin->page builder->index page

And add two new html blocks on homepage (it only works on homepage)

Then go to phpmyadmin->dolphinDB->sys_page_compose

search your 2 new blocks and change the FUNC field the way stated above.

Hope its clear now.

If anybody want it somewhere else, i can modify it that way.

so much to do....
Quote · 8 Oct 2012

Oh, cool - I am just seeing this.  Will try this over the weekend.  Thanks Prashank!

Quote · 13 Oct 2012

 

Go to admin->page builder->index page

And add two new html blocks on homepage (it only works on homepage)

Then go to phpmyadmin->dolphinDB->sys_page_compose

search your 2 new blocks and change the FUNC field the way stated above.

Hope its clear now.

If anybody want it somewhere else, i can modify it that way.

 Thanks for your reply Prashank25 

Since users are (by default) redirected to member site after login, it migt be nice if this two blocks would work at member page as well?

Kind regards and thank you for your help

Mayki

"When things get tough the tough get going..."
Quote · 13 Oct 2012

Awesome!!!!   This worked great Prashank!  Thanks so much for your help and this great mod. 

Quote · 13 Oct 2012

Oh I just had an idea I think would be pretty cool.  I have this on my site now, and it is working perfectly, but something I think might be even more cool is if we could have a block of "matching members".   The dating site PlentyofFish is known for they high user engagement, and that is what they do.   When you are looking at a members profile, they give you a strip of I think 7 or 8 ladies that "might also interest you".   

We might not be able to take it quite that far, but I wonder if we could use this code and also make a "matching members" block for the homepage at least.   That would actually be pretty awesome. 

Rob

Quote · 27 Oct 2012

Anyone else want to take a look at this code by any chance"  Prashank might be involved in his classes.  Since "matching members" also ends up in a block when you go to it directly, there must be a way to do this using this technique.   I wish I was not such an idiot with code, because I would just love to have this for my site. 

Quote · 27 Oct 2012

Thanks again Prashank25 for such an easy and excellent index page addition!!

demo here, top right two boxes..http://www.duvallocals.com/index.php 

NewMembers

RecentActivity

 

ManOfTeal.COM a Proud UNA site, six years running strong!
Quote · 28 Oct 2012

I will try to do the match block and maybe will release it as a free module. Currently i am working on a new idea after that i will see what i can do.

so much to do....
Quote · 28 Oct 2012

Thanks Prashank,

I can see you packaging this up, and making it a commercial module, especially if the blocks could be included on other pages.  As I mentioned, I am on a quest here to try to make Dolphin more engaging and I looked at PlentyofFish and that seems to be the key to their user engagement.   When you look at someone's profile there is a strip of several other "you might also like" members at the top of each profile you view, so you are always clicking around and finding people you want to meet.    I can't imagine that adding the "matching members" block here is that big of a change from what you have already shared though so if you - or anyone - can find a bit of time to tweak this code to add that it would help quite a bit.    You're getting a good reputation here so I am looking forward to seeing your idea. 

 

@netwon - nice looking site. I made mine internal only.  

Quote · 28 Oct 2012
 
 
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.