Tutorial

How to show Random photos on your home page "Profile Photos" Block instead of latest.

This is for Dolphin 6.1x

The fastest and easiest ways to accomplish this would be simply editing the BxDolSharedMedia.php

It's probably a good idea to backup the file before making changes just in case.

Then find and Open:
/templates/base/scripts/BxBaseIndex.php

find this function:

    function getBlockCode_ProfilePhotos() {
        global $site;
        global $tmpl;
   
        // number of photos
        $max_num    = (int)getParam("top_photos_max_num");
           
        $sqlSelect = "
            SELECT
                `media`.`med_id`,
                `med_prof_id`,
                `med_file`,
                `med_title`";
       
        $sqlFrom = "
            FROM `media`
            INNER JOIN `Profiles` ON
                ( `Profiles`.`ID` = `media`.`med_prof_id` )";
       
        $sqlWhere = "
            WHERE
                `med_type` = 'photo' AND
                `med_status` = 'active' AND
                `Profiles`.`Status` = 'Active'";
   
       
        if ( $_GET['Mode_p'] == 'rand' or
             $_GET['Mode_p'] == 'last' or
             $_GET['Mode_p'] == 'top' )
                $mode = $_GET['Mode_p'];
        else
            $mode = 'last';


Change to:

    function getBlockCode_ProfilePhotos() {
        global $site;
        global $tmpl;
   
        // number of photos
        $max_num    = (int)getParam("top_photos_max_num");
           
        $sqlSelect = "
            SELECT
                `media`.`med_id`,
                `med_prof_id`,
                `med_file`,
                `med_title`";
       
        $sqlFrom = "
            FROM `media`
            INNER JOIN `Profiles` ON
                ( `Profiles`.`ID` = `media`.`med_prof_id` )";
       
        $sqlWhere = "
            WHERE
                `med_type` = 'photo' AND
                `med_status` = 'active' AND
                `Profiles`.`Status` = 'Active'";
   
       
        if ( $_GET['Mode_p'] == 'rand' or
             $_GET['Mode_p'] == 'last' or
             $_GET['Mode_p'] == 'top' )
                $mode = $_GET['Mode_p'];
        else
            $mode = 'rand';

Save changes/re-upload.

Refresh your home page to see the changes.

This is more apparent when a there are a large number of "Profile Photo's" uploaded.

Remember this is only for the "Profile Photos" Block on your home page.


Screen Shot Original with Latest:


Profile Photo Block Original Latest

 


Screen Shot After with Random:


Profile Photo Block After Random

 
Written By
Tutorial by: Jeremy LeSarge (AKA Ray)

I am the owner and administrator of DialMe.com. I write Tutorials for Boonex Dolphin as well as tips and resources surrounding website programming and development. I enjoy working with WordPress, SEO, and Web Hosting / Servers. I also maintain a WordPress Blog here on this site where you will find a variety of technology and webmaster resources.

Actions
Sponsored Links
Recommend