deeemm-cms /includes/build_imagebox_content.php

Language PHP Lines 61
MD5 Hash 8918703435d186b27a87e82421be2e99 Estimated Cost $872 (why?)
Repository https://bitbucket.org/mpercy/deeemm-cms View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php

defined( '_INDM' ) or die( 'POSSIBLE HACK ATTEMPT!' );


$value = NULL;
// add check for imagebox_libraries
if ($imagebox_libraries){ // need to check what happens if none set!!!!!!!!!!!

	foreach ($imagebox_libraries as $value){
		//get number of images in media library
		$sql_result = mysql_query("select count(*) from `" . $db_table_prefix . 'cat_' . "$value`");
		$num_media_files = mysql_result($sql_result,0);

		$sql_query = mysql_query("SELECT * FROM `" . $db_table_prefix . "core_structure` WHERE `table` = '$value'");
		while($sql_result = mysql_fetch_array($sql_query)){
			$media_library_enabled = $sql_result[media_library_enabled];
			$media_library_default_view = $sql_result[media_library_default_view];
			$num_slideshow_images = $sql_result[num_slideshow_images];
			$imagebox_type = $sql_result[imagebox_type];
		}
		//		breakpoint($imagebox_type);
		if ($num_media_files <> 0) {

			switch ($imagebox_type) {

				case 'random';
				$imagebox .= read_file($default_url . $templates_dir  . "imagebox_random.tpl");

				//get random image id
				$sql_query = mysql_query("SELECT * FROM `" . $db_table_prefix . 'cat_' . "$value` WHERE `image` NOT LIKE '%mpg' AND `image` NOT LIKE '%pdf' AND `image` NOT LIKE '%mov' AND `image` NOT LIKE '%zip' AND `image` NOT LIKE '%txt' ORDER BY RAND()");
				while($sql_result = mysql_fetch_array($sql_query)) {
					$random_image_name = $sql_result[image];
					$random_image_title = $sql_result[title_lan_ . $language];
					$random_image_description = $sql_result[description_lan_ . $language];
					$random_image_num = $sql_result[id];
				}
				if ($random_image_name == ''){
					$random_image_name = 'image_unavailable.jpg';
				}

				break;

				case 'slideshow';
				$imagebox .= read_file($default_url . $templates_dir  . "imagebox_slideshow.tpl");
				break;

			}//end switch
				
		} ELSE {
			//do nothing
		}

		$imagebox = replace_variables($imagebox);
	}//end for each
}//end if imagebox_libraries

$value = NULL;


?>
Back to Top