登录 注册

登录

问题 我想用模板最大化显示 有什么方法啊

更多
2010年02月10日 16:51 #1 作者: thackeraybh
index.php 里面有这么一句

$templatewidth = intval($this->params->get('templatewidth'));

模板宽度是获取的PARAMS.INI里面的一个整数值。
而我想使这个能过即时的获取屏幕的宽度值。
所以我想用JS获得屏幕宽度,而用这个$templateswidth = ‘屏幕宽度’

问下JS怎么写 放在什么地方  还有这个值怎么传递

登录 或者   注册一个会员帐号 来参与讨论

更多
2010年02月10日 17:30 - 2010年02月10日 19:13 #2 作者: thackeraybh
我用的是comuna3_plazza  模板    想改成 随窗口变换大小的 形式的
INDEX.PHP文件 是
<?php
defined('_JEXEC') or die('Restricted access');
$url = clone(JURI::getInstance());
?>
<?php echo '<?xml version="1.0" encoding="utf-8"?' .'>'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" >
<head>
<jdoc:include type="head" />
<?php JHTML::_('behavior.mootools'); ?>
<?php 
include('scripts/php/template_config.php');
include('scripts/php/user.php');
?> 
<?php 
$templatewidth = intval($this->params->get('templatewidth'));
 
//mainbody width
if ($tp_left  >= 1) {	
	$mbody = $templatewidth - 160;
	} else {
	$mbody = $templatewidth ;
	}
if ($tp_right >= 1) {	
	$mcontent = $mbody - 310;
	} else {
	$mcontent = $mbody;
	}
 
 
// 4 bottom mod width calculation 
$wrp4width = $templatewidth - 34;
if ($tp_user11 >= 1 ) $u11 = 1; 
	else $u11 = 0; 
if ($tp_user12 >= 1 ) $u12 = 1; 
	else $u12 = 0; 
if ($tp_user13 >= 1 ) $u13 = 1; 
	else $u13 = 0;
if ($tp_user14 >= 1 ) $u14 = 1; 
	else $u14 = 0;
if ($u11 + $u12  + $u13 + $u14 == 4 ) { 
	$u11121314 = $wrp4width/4 - 6;
	$xtmargin = 8; }
if ($u11 + $u12  + $u13 + $u14 == 3 ) { 
	$u11121314 = $wrp4width/3 - 8;
	$xtmargin = 8; } 
if ($u11 + $u12  + $u13 + $u14 == 2 ) { 
	$u11121314 = $wrp4width/2 - 8;
	$xtmargin = 8; } 
if ($u11 + $u12  + $u13 + $u14 == 1 ) { 
	$u11121314 = $wrp4width;
	$xtmargin = 0; }
 
?>
 
<link rel="stylesheet" href="templates/comuna3_plazza/css/css.gzip.php?style=<?php echo $style; ?>&amp;type=<?php echo $type; ?>&amp;size=<?php echo $size; ?>" type="text/css" />
<script type="text/javascript" src="templates/comuna3_plazza/scripts/js/js.gzip.php"></script>
 
 
 
 
<!--[if IE 6]><script type="text/javascript">
var IEPNGFix = window.IEPNGFix || {};
IEPNGFix.data = IEPNGFix.data || {};
IEPNGFix.blankImg = '<?php echo JURI::base(); ?>templates/comuna3_plazza/images/spacer.gif';
</script>
<style type="text/css">
#topmenus, #topwrapper, #tp-mainnav, #logos_left, #logos_right, .pngfix, img  { behavior: url(<?php echo JURI :: base() ?>/templates/comuna3_plazza/scripts/js/iepngfix.htc);
 }</style>
<![endif]-->
 
</head>
<body class="bodies">
	<div id="maincpwrapper" align="center">
		<div id="pagewrapper" style="width:<?php echo $templatewidth; ?>px;">				
			<!-- #wrp1 >> logo - module positions : user8 -->
			<div id="wrp1">
				<div id="wrp1_inner">
					<div>
						<div id="logos_<?php echo $orient; ?>">
						<a href="<?php echo $this->baseurl ?>">
							<img src="templates/comuna3_plazza/images/spacer.gif" alt="Logo" width="300" height="68" border="0" />
						</a>
						</div>
						<?php if ($tp_user8) { ?>
						<div id="menuwrp_<?php echo $orient; ?>" style="width:<?php echo $templatewidth-380; ?>px">
							<jdoc:include type="modules" name="user8" style="raw" />	
						</div>
						<?php } ?>
						<div class="clrfix"></div>
					</div>
					<div class="clrfix"></div>
				</div>
				<?php if ($tp_banner) { ?>
				<div id="wrp1_inner2">
						<jdoc:include type="modules" name="banner" style="raw" />				
				</div>
				<?php } ?>
				<div class="clrfix"></div>
			</div>
			<div class="clrfix"></div>
			<!--  wrp2 -->
			<?php if ($tp_cpanel || $tp_user4) { ?>
			<div id="wrp2">
				<?php if ($tp_cpanel) { ?>
				<div class="topmenupanel">
				<jdoc:include type="modules" name="cpanel" style="raw" />
				</div>
				<?php } ?>
				<?php if ($tp_user4) { ?>
				<div class="searchpanel">
					<jdoc:include type="modules" name="user4" style="raw" />
				</div>
				<?php } ?>			
				<div class="clrfix"></div>		
			</div>
			<?php } ?>
 
			<?php if ($tp_breadcrumb) { ?>
			<div id="brdcrmb"><jdoc:include type="modules" name="breadcrumb" /></div>
			<?php } ?>
			<!-- ############# BODY ############### -->
			<div id="wrp3">
				<div id="wrp3_inner">
					<div id="mbody_<?php echo $orient; ?>" style="width:<?php echo $mbody; ?>px;">
					<jdoc:include type="message" />
						<?php $option = JRequest::getVar( 'option' );
						$view = JRequest::getVar( 'view' );
						if($option == 'com_content' && $view == 'frontpage'){ ?>
						<div id="mcontent" style="width:<?php echo $mcontent; ?>px;">
 
							<?php if ($tp_inset) { ?>
								<?php $user =& JFactory::getUser();
					 			if(!$user->id) {?>
								<div class="advert">
									<div class="advert_inner">
					 					<jdoc:include type="modules" name="inset" style="xhtml" />
									</div>
								</div>
					 			<?php } ?>
							<?php } ?>
							<?php if ($tp_advert1) { ?>
							<div class="advert">
								<div class="advert_inner">								
									<jdoc:include type="modules" name="advert1" style="xhtml" />
								</div>
							</div>
							<?php } ?>						
 
							<jdoc:include type="component" />
							<?php if ($tp_advert2) { ?>
							<div class="advert">
								<div class="advert_inner">								
										<jdoc:include type="modules" name="advert2" style="xhtml" />
								</div>
							</div>	
							<?php } ?>
						</div>
						<?php } else {?>
						<div id="mcontent" style="width:<?php echo $mcontent; ?>px;">
 
							<?php if ($tp_inset) { ?>
								<?php $user =& JFactory::getUser();
					 			if(!$user->id) {?>
								<div class="advert">
									<div class="advert_inner">
					 					<jdoc:include type="modules" name="inset" style="xhtml" />
									</div>
								</div>
					 			<?php } ?>
							<?php } ?>
							<?php if ($tp_advert1) { ?>
							<div class="advert">
								<div class="advert_inner">							
										<jdoc:include type="modules" name="advert1" style="xhtml" />							
								</div>
							</div>	
							<?php } ?>						
 
							<div id="mcontent_inner">
								<div id="mcontent_inner_box">
									<jdoc:include type="component" />
								</div>
							</div>
							<?php if ($tp_advert2) { ?>
							<div class="advert">
								<div class="advert_inner">								
										<jdoc:include type="modules" name="advert2" style="xhtml" />
								</div>
							</div>	
							<?php } ?>
						</div>
						<?php }?>
						<?php if ($tp_right) { ?>
						<div id="rightbox">
							<div id="rightbox_inner">
								<jdoc:include type="modules" name="right" style="xhtml" />
							</div>
						</div>	
						<?php } ?>					
					</div>
					<?php if ($tp_left) { ?>
					<div id="leftbox_<?php echo $orient; ?>">
						<jdoc:include type="modules" name="left" style="xhtml" />
					</div>
					<?php } ?>
 
				</div>		
			</div>
			<div class="clrfix"></div>
			<!-- ########## END BODY ########-->
 
 
			<!--  wrp 4 - 4 bottom modules -->
			<?php if ($tp_user11 || $tp_user12 || $tp_user13|| $tp_user14) { ?>
			<div id="wrp4">
					<div id="wrp4_inner">
						<div id="wrp4_inner_box">
						<?php if($tp_user11) { ?>
						<div id="u11" style="width:<?php echo $u11121314; ?>px; margin-right:<?php echo $xtmargin; ?>px;">
							<jdoc:include type="modules" name="user11" style="xhtml" />
						</div>						
						<?php } ?>
						<?php if($tp_user12) { ?>
						<div id="u12" style="width:<?php echo $u11121314; ?>px; margin-right:<?php echo $xtmargin; ?>px;">
							<jdoc:include type="modules" name="user12" style="xhtml" />
						</div>					
						<?php } ?>
						<?php if($tp_user13) { ?>
						<div id="u13" style="width:<?php echo $u11121314; ?>px;  margin-right:<?php echo $xtmargin; ?>px;">
							<jdoc:include type="modules" name="user13" style="xhtml" />
						</div>					
						<?php }?>
						<?php if($tp_user14) { ?>
						<div id="u14" style="width:<?php echo $u11121314; ?>px;">
							<jdoc:include type="modules" name="user14" style="xhtml" />
						</div>					
						<?php }?>
						<div class="clrfix"></div>
						</div>
					</div>	
			</div> <!-- end wrp4 -->
			<?php } ?>	
 
			<!-- #wrp5 >> footer - module positions : user3 -->
			<div id="wrp5">
				<div id="wrp5_inner">
					<div id="footer_wrapper">
						<div id="footer_left">				
							<div>
								<div class="footimg">
									<img src="templates/comuna3_plazza/images/logofooter.png" alt="logo footer" border="0" class="pngfix" width="20" height="20" align="left"/>
								</div>Designed by <a href="http://www.templateplazza.com" target="_blank"><strong> TemplatePlazza</strong></a> - All Rights Reserved
							</div>
						</div>
						<?php if ($tp_user3) { ?>
						<div id="footer_right">
							<jdoc:include type="modules" name="user3" style="raw" />				
						</div>
						<?php  }?>
						<div style="clear:both; line-height:1px;">&nbsp;</div>
					</div>				
				</div>
			</div> <!--  end wrp5 -->	
 
		</div><!-- end pagewrapper -->
	</div><!-- end maincpwrapper -->	
 
</body>
</html>

登录 或者   注册一个会员帐号 来参与讨论