if (($query = $db->sql_query($sql)) !== false) { if (($row = $db->sql_fetchrow($query)) !== false) { $link = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=about&" . NV_OP_VARIABLE . "=" . $row['alias']; $title = $row['title']; $bodytext = $row['bodytext']; //$bodytext = strip_tags( $row['bodytext'] ); $bodytext = nv_clean60($bodytext, 300); $is_show = true; } } } if ($is_show) { if (file_exists(NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/blocks/global.about.tpl")) { $block_theme = $global_config['module_theme']; } elseif (file_exists(NV_ROOTDIR . "/themes/" . $global_config['site_theme'] . "/blocks/global.about.tpl")) { $block_theme = $global_config['site_theme']; } else { $block_theme = "default"; } $xtpl = new XTemplate("global.about.tpl", NV_ROOTDIR . "/themes/" . $block_theme . "/blocks"); $xtpl->assign('LINK', $link); $xtpl->assign('TITLE', $title); $xtpl->assign('BODYTEXT', $bodytext); $xtpl->parse('main'); return $xtpl->text('main'); } return ""; } } $content = nv_message_about();
$sql = "SELECT `id`,`title`,`alias`,`bodytext`,`keywords`,`add_time`,`edit_time` FROM `" . NV_PREFIXLANG . "_" . $site_mods[$module]['module_data'] . "` WHERE `status`=1 ORDER BY rand() DESC LIMIT 1"; if (($query = $db->sql_query($sql)) !== false) { if (($row = $db->sql_fetchrow($query)) !== false) { $link = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&" . NV_NAME_VARIABLE . "=" . $module . "&" . NV_OP_VARIABLE . "=" . $row['alias']; $title = $row['title']; $bodytext = strip_tags($row['bodytext']); $bodytext = nv_clean60($bodytext, 300); $is_show = true; } } } if ($is_show) { if (file_exists(NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/about/block.about.tpl")) { $block_theme = $global_config['module_theme']; } elseif (file_exists(NV_ROOTDIR . "/themes/" . $global_config['site_theme'] . "/modules/about/block.about.tpl")) { $block_theme = $global_config['site_theme']; } else { $block_theme = "default"; } $xtpl = new XTemplate("block.about.tpl", NV_ROOTDIR . "/themes/" . $block_theme . "/modules/about"); $xtpl->assign('LINK', $link); $xtpl->assign('TITLE', $title); $xtpl->assign('BODYTEXT', $bodytext); $xtpl->parse('main'); return $xtpl->text('main'); } return ""; } } $content = nv_message_about($block_config);