How to not display on homepage not active photo?

Pimpa posted 14th of February 2008 in Community Voice. 5 comments.
I don't found an option in administrator panel to not display on homepage not active photo... needed to change template?
 
Comments
·Oldest
·Top
Please login to post a comment.
MichelSwiss
In your file templates/tmpl_xxx/scripts/index.php look for an SQL query like that:

$featured_res = db_res( "SELECT `Profiles`.`ID`, `Pic_0_addon`, `ProfileType`, `NickName`, `Headline`, `Sex`, `Country`, `DateOfBirth`, `DateOfBirth2` FROM `Profiles` WHERE `Status` = 'Active' AND `Featured` = '1' ORDER BY RAND() LIMIT $feature_num" );

and change it to:

$featured_res = db_res( "SELECT `Profiles`.`ID`, `Pic_0_addon`, `ProfileType`, `NickName`, `Headline`, `Sex`, `Country`, `DateOfBirth`, see more `DateOfBirth2` FROM `Profiles` WHERE `Status` = 'Active' AND `Featured` = '1' <b>AND `Picture` = '1'</b> ORDER BY RAND() LIMIT $feature_num" );

You can add this code - AND `Picture` = '1' - to other SQL queries, depends of your needs...
MichelSwiss
!!! delete the HTML tags <b> and </b> I added to the query to make the modification to appear in bold case... :-(

$featured_res = db_res( "SELECT `Profiles`.`ID`, `Pic_0_addon`, `ProfileType`, `NickName`, `Headline`, `Sex`, `Country`, `DateOfBirth`, `DateOfBirth2` FROM `Profiles` WHERE `Status` = 'Active' AND `Featured` = '1' AND `Picture` = '1' ORDER BY RAND() LIMIT $feature_num" );
My solution is another for more security:

on file

inc/shared.inc.php

before

$aNum = db_arr( "SELECT COUNT(`sharePhotoFiles`.`medID`) $sqlFrom $sqlWhere" );
$aNum = db_arr( "SELECT COUNT(`RayMovieFiles`.`ID`) $sqlFrom $sqlWhere" );
$aNum = db_arr( "SELECT COUNT(`RayMusicFiles`.`ID`) $sqlFrom $sqlWhere" );

add

if ($sqlWhere=="") $sqlWhere = " WHERE `Approved`='true' ";

and add in query viewPhoto.php add: AND `sharePhotoFiles`.`Approved`='true'
and see more add in query viewMusic.php add: AND `RayMusicFiles`.`Approved`='true'
and add in query viewVideo.php add: AND `RayMovieFiles`.`Approved`='true'
MichelSwiss
Sorry Pimpa... I misunderstood your question :-(

My code is to display only profiles with profile photos...
 
 
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.
PET:0.10677289962769