//下拉選單用
$placename = '拍攝地點';//作為比對標記
$Photographstheplace = array('基隆','宜蘭','台北','新竹','桃園','苗栗','台中','彰化','南投','嘉義','雲林','台南','高雄','澎湖','屏東','台東','花蓮','金門','連江','香港','大陸','澳洲','美國','加拿大','其它');
修改:editOnePic.php
找到:
if ($CONFIG['user_field1_name'] != ''){
裡面的:
<input type="text" style="width: 100%" name="user1" maxlength="255" value="{$CURRENT_PIC['user1']}" class="textinput" />
用以下的程式碼取代:
<!-- //下拉選單開始 -->
<SELECT NAME="user1" class="textinput" >
<OPTION VALUE="">請選擇拍攝地點</OPTION>
EOT;
$theplace = $CURRENT_PIC['user1'];
if($R != "") $theplace = urldecode($R);
$theplaceString = "";
for($i = 0; $i < count($Photographstheplace); $i++)
{
$tmpplace = stripslashes($Photographstheplace[$i]);
$theplaceString .= ($theplaceString == "" ? "" : ",").$tmpplace;
echo("<OPTION VALUE=\"".htmlspecialchars($tmpplace)."\"");
if(strcasecmp($tmpplace, $theplace) == 0)
{
echo(" SELECTED");
$DefaultRoomFound = 1;
}
echo(">".$tmpplace."</OPTION>");
}
echo <<<EOT
</SELECT>
<!-- //下拉選單結束 -->
修改:editpics.php
找到:
function form_input($text, $name, $max_length,$field_width=100)
{
裡面的:
global $CURRENT_PIC;
用以下的程式碼取代:
//下拉選單引入參數 $placename,$Photographstheplace
global $CURRENT_PIC,$placename,$Photographstheplace;
再往下找到:
<input type="text" style="width: {$field_width}%" name="$name" maxlength="$max_length" value="$value" class="textinput" />
用以下的程式碼取代:
<!-- //下拉選單開始 -->
EOT;
if ($text == $placename )
{
echo <<<EOT
<SELECT NAME="$name" class="textinput" >
<OPTION VALUE="">請選擇拍攝地點</OPTION>
EOT;
$theplace = $CURRENT_PIC['user1'];
if($R != "") $theplace = urldecode($R);
$theplaceString = "";
for($i = 0; $i < count($Photographstheplace); $i++)
{
$tmpplace = stripslashes($Photographstheplace[$i]);
$theplaceString .= ($theplaceString == "" ? "" : ",").$tmpplace;
echo("<OPTION VALUE=\"".htmlspecialchars($tmpplace)."\"");
if(strcasecmp($tmpplace, $theplace) == 0)
{
echo(" SELECTED");
$DefaultRoomFound = 1;
}
echo(">".$tmpplace."</OPTION>");
}
echo <<<EOT
</SELECT>
EOT;
}else{
echo <<<EOT
<input type="text" style="width: {$field_width}%" name="$name" maxlength="$max_length" value="$value" class="textinput" />
EOT;
}
echo <<<EOT
<!-- //下拉選單結束 -->
修改:upload.php
找到:
function text_box_input($text, $name, $max_length, $iterations, $default='') {
裡面的:
global $CURRENT_PIC;
用以下的程式碼取代:
//下拉選單引入參數 $placename,$Photographstheplace
global $CONFIG,$placename,$Photographstheplace;
再往下找到:
<input type="text" style="width: 100%" name="$name" maxlength="$max_length" value="$default" class="textinput" />
用以下的程式碼取代:
<!-- //下拉選單開始 -->
EOT;
if ($text == $placename )
{
echo <<<EOT
<SELECT NAME="$name" class="textinput" >
<OPTION VALUE="">請選擇拍攝地點</OPTION>
EOT;
$theplace = $CURRENT_PIC['user1'];
if($R != "") $theplace = urldecode($R);
$theplaceString = "";
for($i = 0; $i < count($Photographstheplace); $i++)
{
$tmpplace = stripslashes($Photographstheplace[$i]);
$theplaceString .= ($theplaceString == "" ? "" : ",").$tmpplace;
echo("<OPTION VALUE=\"".htmlspecialchars($tmpplace)."\"");
if(strcasecmp($tmpplace, $theplace) == 0)
{
echo(" SELECTED");
$DefaultRoomFound = 1;
}
echo(">".$tmpplace."</OPTION>");
}
echo <<<EOT
</SELECT>
EOT;
}else{
echo <<<EOT
<input type="text" style="width: 100%" name="$name" maxlength="$max_length" value="$default" class="textinput" />
EOT;
}
echo <<<EOT
<!-- //下拉選單結束 -->
整個修改大致完成,但是尚有多方面未考量到因此還有很大的修改空間。
相簿測試網址測試帳號:Guests
測試密碼:Guests