BLOCK Type: Special Block, What I learned

I am posting this to help others who may have a desire to understand how this works.

I want to add a link to the default "Site Stats" on the home page.

(I know that I can add the link in other ways but I want to do it this way to help my understanding of Special Blocks in Dolphin 7.1)

 

Here we go...

on the home page I have a block called "Site Stats"

go in to Admin and then the Page builder,

select the Homepage,

click the hyperlink on the "Site Stats"

It displays a block

 

The block type is "Special Block"

The Key is "_Site Stats"

 

I then go to my database and I query the sys_page_compose table for rows related to this caption

It returns one row.

The only field that seems to possibly tie to a function is in a column called Func.

The name of the Function in the field is  "SiteStats"

 

I now do a case sensitive string search for the "SiteStats" on a copy of the entire Dolphin 7.1 website.

It shows "SiteStats" to be located in 3 files.

 

1. cachedb_sys_page_compose.inc_SOMEGUID.php

2. incclassesBxDolInstaller.php

3. templatesbasescriptsBxBaseIndexPageView.php

 

So my first guess is that the Special Block is being rendered based on something in the file under templatesbasescripts.

I open the BxBaseIndexPageView.php file.

I search for "SiteStats"

I find one function that seems to be related.

    function getBlockCode_SiteStats()

    {

        return array(getSiteStatUser(), array(), array(), false);

    }

 

I did not see what I was looking for here.

 

I now do a case sensitive string search for the "getSiteStatUser" on a copy of the entire Dolphin 7.1 website.

It shows "getSiteStatUser" to be located in 3 files.

1. incclassesBxDolPageView.php

2. incdesign.inc.php

3. and the file I just had open. (BxBaseIndexPageView.php)

 

So I open the BxDolpageView.php file.

Here is the function I find...

    function getBlockCode_MemberStat()

    {

        return getSiteStatUser();

    }

 

I think that function is getting the data that is displayed.

 

So I open the design.inc.phpfile.

Here is the function I find...

function getSiteStatUser()

{

    global $aStat;

    $aStat = getSiteStatArray();

    $sCode  = '<div class="siteStatMain">';

    foreach($aStat as $aVal)

        $sCode .= $GLOBALS['oFunctions']->getSiteStatBody($aVal);

    $sCode .= '<div class="clear_both"></div></div>';

    return $sCode;

}

 

That looks a lot better.  :-)

I added the word test in the div.

 

I.E. 

    $sCode .= '<div class="clear_both"></div>TEST</div>';

 

I uploaded the file, cleared my cache, reloaded and it worked.

I had the word test at the bottom of my site stats.

 

Thanks,

Cory

 

 

 

Quote · 16 Feb 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.