HomeNotesHow to not display on homepage not active photo?
1563 days ago in 
Reactions: 5 comments 0 points0 reports
 
 

How to not display on homepage not active photo?

I don't found an option in administrator panel to not display on homepage not active photo... needed to change template?

Plussed by

 
 
 
 

Comments

Oldest First
|
Threaded
 
 
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" );
Pimpa
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...
 
 
 
PET:0.073648929595947