0

I got this funcion:

function get_all_in_progress_designments($now) {

$this->db->where('active', 1);
$this->db->where('deleted !=', '1');
$this->db->order_by('date_to', 'DESC');
$designments = $this->db->get('designments')->result_array();
foreach ($designments as $key => &$designment_info) {
    $designment_info['image'] = self::get_image_for_designment($designment_info['designment_id']);

    $designment_info['count_joined'] = self::get_users_count_joined_by_id($designment_info['designment_id']);
    $designment_info['count_ideas'] = self::get_users_count_ideas_by_id($designment_info['designment_id']);
    $date_to = $designment_info['date_to'];
    $diff = $date_to - $now;
    $days = round($diff / 86400);
    $time_left = $days . ' days';

    if($days <= 0){
         $days = 0;

        $time_left = $days . ' days';

It will return the designments that are in progress with the picture, title, and description and some other information.

To show the difference between the in progress and active designments I want the in progress designments turned grey ish/ transparent. Is there a way to put this in the function? I saw a few things like this if($image && imagefilter($im, IMAGE_FILTER_GRAYSCALE)). What do I have to put in the function to make it work?

I hope you can help me

Kind regards,

mr john
  • 5
  • 6
  • I think what I want is way more different compared to your link. – mr john Jul 26 '16 at 07:46
  • In this case it would be great if you can edit the post and update it with short info how does your effect differ from just grayscaling. Maybe also add "css" tag to get attention from designers. – Ruslan Bes Jul 26 '16 at 08:20
  • It seems inefficient to be greyscaling images on the fly (every time the page is loaded. When an image is uploaded, save a greyscale image server-side too (a one-time operation). Conditionally access the right version of the image. Delete both images once they are obsolete (if possible). – mickmackusa Apr 21 '22 at 01:32

0 Answers0