How to select "online" by default in "Members" block on title page?

Hi!

I'm using Dolphin 7.0.4.

The first thing my members are interested in, is which other users are currently logged in. The "Members" block actually can show this information. But by default "Latest" is selected, so (if they even know they can), they have to click "Online" first.

Is it possible to have the "Members" block with "Online" filter selected by default?

Thanks!

Stephan

online.png · 13.8K · 72 views
Quote · 11 Jan 2011

The only solutions I could find so far, were:

  • to append "?MembersMode=online" in the menu builder for the index.php
  • to create a landing page for the base URL which forwards to index.php?MembersMode=online

But both solutions imply that this information is forgotten in many cases, for example when clicking on "Home" in the breadcrumbs path.

Do you know any other solution?

Do you know where the "Members" block is actually being instantiated and filled?

I was playing around in BxBaseBrowse.php, without really knowing what I was doing. But that did not have effect on the Members block on the index.php. Where is the correct place to do it?

Thank you!

Stephan

Quote · 12 Jan 2011

Actually it might also be possible to redefine BX_DOL_URL_ROOT. But it didn't find, where this is being defined.

Do you know, where I can find the original definition? DB or file?

Any better solutions?

Stephan

Quote · 12 Jan 2011

Not intending a thread hijack - but somewhat related.  Is it possible to show just one of the genders - female or male - in that members block?

Quote · 12 Jan 2011

BxBaseIndexPageView.php

template / base / scripts / BxBaseIndexPageView.php

change  - latest by online

searching - this line

$sMode = (in_array($_GET[$sBlockName . 'Mode'], $aModes)) ? $_GET[$sBlockName . 'Mode'] : $sMode = 'last ' ;

change by

$sMode = (in_array($_GET[$sBlockName . 'Mode'], $aModes)) ? $_GET[$sBlockName . 'Mode'] : $sMode = 'online' ;

 

searching - this line - to change the order

$aModes = array('last', 'top', 'online');

change by

$aModes = array('online','last', 'top' );

 

attached file is modified - D 7.0.4 -

BxBaseIndexPageView.php · 16.1K · 66 downloads
Bosun / Moderator -- My Products : http://www.boonex.com/market/posts/danielmarseille
Quote · 12 Jan 2011

Great! Thanks a lot!

This did absolutely do the trick.

Unfortunately I didn't see this myself. I'm wondering if there is any documentation on the code... About the general structure of the system, which parts are located in which files and what steps are generally involved in building a page output. Is there anything like this? This yould avoid some stupid questions...

Anyway, thanks again - Solved!

Stephan

Quote · 12 Jan 2011

 

Not intending a thread hijack - but somewhat related.  Is it possible to show just one of the genders - female or male - in that members block?

If you simply want to limit to one of the genders within the existing Modes, then it seems to be easy. You can simply add the additional condtion into the $sqlCondition variable for the desired mode next to where danielmarseille stated an BxBaseIndexPageView.php.

However, if you want to add additional modes for the gender selection, then that's beyond my current state of understanding of the code. For sure only adding an additional value to $aModes is not enough.

Stephan

Quote · 12 Jan 2011

Stephan - thanks - but could you be more specific?  Where do I add this $sqlCondition?   What should it say to select gender?

Rob

Quote · 12 Jan 2011

 

Stephan - thanks - but could you be more specific?  Where do I add this $sqlCondition?   What should it say to select gender?

Rob

I just gave it a try and if you need it that simple then it's just one line of code (around line 341 of BxBaseIndexPageView.php)

                case 'last':
                    if ($sMode == $sMyMode)
                    $sqlCondition .= " AND `Profiles`.`Sex`=\"male\"";   // SS: Added this line to select only real men :-)
                        $sqlOrder = " ORDER BY `Profiles`.`Couple` ASC, `Profiles`.`DateReg` DESC";
                    $sModeTitle = _t('_Latest');
                break;

Here it worked and the latest users are filtered correctly.

But this of course is a hack. Adding a real additional mode for your new filter would be a lot nicer. But I'm not aware of the project structure yet, and what's required to go the more elegant way.

Stephan

Quote · 13 Jan 2011
 
 
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.