deeemm-cms /includes/build_newsbox_content.php

Language PHP Lines 53
MD5 Hash 17aeb13c524e1e74c92f4ab49af6de12 Estimated Cost $728 (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
<?php
defined( '_INDM' ) or die( 'POSSIBLE HACK ATTEMPT!' );

$value = NULL;

//===========================================================================
//>create newsbox article
//===========================================================================
foreach ($newsbox_libraries as $value){

	//>get newsbox title in current language from structure
	$sql_query = mysql_query("SELECT * FROM `" . $db_table_prefix . "core_structure` WHERE `table` = '$value'");
	while ($sql_result = mysql_fetch_array($sql_query)){
  $newsbox_item_title = $sql_result[category_lan_ . $language];
  $newsbox_article = $sql_result[table];
	}

	//>get total number of articles in table
	$sql_result = mysql_query("select count(*) from `" . $db_table_prefix . 'cat_' . "$value`");
	$num_newsarticles = mysql_result($sql_result,0);

	if ($num_newsarticles > 0) {

  //>read template + add to newsbox list
  $newsbox .= read_file($default_url . $templates_dir . "newsbox.tpl");

  //>get latest article
  $sql_query = mysql_query("SELECT * FROM `" . $db_table_prefix . 'cat_' . "$value` ORDER BY `date` DESC LIMIT 1");
  while($sql_result = mysql_fetch_array($sql_query)){
  	$news_image = $media_dir . $sql_result[image];
  	$headline_text = strip_tags($sql_result[title_lan_ . $language]);
  	$tool_tip = strip_tags($sql_result[tool_tip_lan_ . $language]);
  	$story_text = strip_tags($sql_result[description_lan_ . $language]);
  	$story_id = strip_tags($sql_result[id]);
  	$newsbox_item_date = strftime("%a %d %b  %Y", strtotime($sql_result[date]));
  }

  //>truncate characters and add link
  if(strlen($story_text) > 140) {
	  $story_text = truncate($story_text, 210);
	  $story_text = balanceTags($story_text);
	  $story_text .= '<A class="float_right" title="' . $tool_tip . '" href="' . $default_url . '?page=' .$value . '&amp;id=' . $story_id . '"> ...Read More</A><BR /><BR />';
  }
  $newsbox = replace_variables($newsbox);
	} else {
		$headline_text = $lan[no_news];
	}

}

$value = NULL;

?>
Back to Top