我是一名設計師/前端開發人員,但我必須在div之前使用「span-4」類移動div與一類「跨度20」。編寫php的開發人員無法提問如何不搞亂他的php標記。試圖在另一個div之前移動div而不會搞砸php,我不明白:)
非常感謝您的幫助!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>THRIVE</title>
<?php include("header.php"); ?>
</head>
<body>
<div class="container">
<div id="thumbnails" class="span-20 last">
<?php
$accessoriesDir = "images/accessories/";
$collectionCount = 1;
while(is_dir($accessoriesDir . $collectionCount . "/"))
{
$collection_dir = $accessoriesDir . $collectionCount . "/";
if ($season_dh = opendir($collection_dir))
{
$accsArray = array();
$accsCount = 0;
while (($accessoryFolder = readdir($season_dh)) !== false)
{
if(filetype($collection_dir . $accessoryFolder) == "dir" && strlen($accessoryFolder) > 2)
$accsArray[$accsCount++] = $accessoryFolder;
}
closedir($season_dh);
?>
<div id="collection<?php echo $collectionCount?>" class="thumbsHolder <?php if($collectionCount !== 1) echo 'hidden'?>">
<div class="cats span-4">
<?php
foreach($accsArray as $index => $accessory)
{
$class = "accessory-tab";
if($index == 0)
{
$class .= " selected";
}
echo "<a id='".strtolower($accessory)."-tab' class='".$class."'>".$accessory."</a><br/>";
}
?>
</div>
<?php
foreach($accsArray as $index => $accessory)
{
?>
<div id="<?php echo strtolower($accessory);?>-view" class="view <?php if($index != 0) echo 'hidden';?>">
<?php
$imageCount = 0;
$accessoryDir = $collection_dir.$accessory."/";
$dh = opendir($accessoryDir);
while (($file = readdir($dh)) !== false && $imageCount < 8)
{
if(filetype($accessoryDir . $file) == "file" && substr($file, -4) == ".jpg")
{
?>
<div class="thumbnailExpander <?php if($imageCount % 2 !== 0)echo 'expandLeft';?> <?php if($imageCount >= 4)echo 'bottom';?>"
style="left:<?php echo ($imageCount % 4) * (317-132) ?>px;top:<?php echo 110+((132+53)*intval($imageCount/4));?>px;">
<!--div class="thumbAnchor"-->
<img src="<?php echo $accessoryDir . $file ?>" style=""/>
<!--/div-->
</div>
<?php
$imageCount++;
}
}
?>
</div><!-- #accessory-view -->
<?php
closedir($dh);
}
?>
</div><!-- .thumbsHolder -->
<?php
}
$collectionCount++;
}
?>
</div><!-- #thumbnails -->
<?php include("nav.php"); ?>
<div id="debug" style="color:white"></div>
</div>
</body>
</html>
感謝上帝,開發者不在身邊,那是嘔吐誘導。將業務邏輯與表示邏輯分開可以解決這個問題。 – M2tM 2010-10-21 19:11:59
從演示中分離業務邏輯不是在該示例XD中討論的唯一問題。很長一段時間,因爲我看到有人瘋狂地做一些純粹基於文件系統的網上商店。 – ITroubs 2010-10-21 19:17:25
這是每日wff值得的東西就在這裏 – GSto 2010-10-21 19:26:03