View Single Post
Old July 12th, 2009, 10:10 PM   #8 (permalink)
Fingertips
Member
 
Join Date: Aug 2006
Posts: 108
keywords bulk upload

here is my current code for bulkupload.tmpl. The keyword show up for the first 10 photos but as soon as I process them the keywords box is blank for the remaining uploads

<?php

echo<<<PPPRINT
<script>
function submitonce(theform){
if (document.all||document.getElementById){
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit")
tempobj.disabled=true
}
}
}
</script>

<form action="{$Globals['maindir']}/bulkupload.php" method="POST" enctype="multipart/form-data" onSubmit="submitonce(this)">
<div align="center">
$ppopen
<tr>
<td align="left" class="{$Style['menubar']}">
<span class="{$Style['large']}">{$Globals['pp_lang']['photoadd']}</span>
</td>
</tr>
<tr>
<td class="{$Style['tdbackground']}">
<br />
<table border="0" cellpadding="0" cellspacing="0" class="{$Style['tableborders']}" width="100%">
<tr>
<td>
<table border="0" cellpadding="5" cellspacing="1" width="100%">
PPPRINT;

if ( $photocount > 0 ) {
echo<<<PPPRINT
<tr>
<td colspan="3" class="{$Style['tddetails']}">
<span class="{$Style['medium']}">{$Globals['pp_lang']['addselect']}
</td>
</tr>
<tr>
<td class="{$Style['tddetails']}" align="center"><span class="{$Style['medium']}">{$Globals['pp_lang']['thumbnail']}</span></td>
<td class="{$Style['tddetails']}" align="center" nowrap="nowrap"><span class="{$Style['medium']}">{$Globals['pp_lang']['add']}</span></td>
<td class="{$Style['tddetails']}" align="center"><span class="{$Style['medium']}">{$Globals['pp_lang']['optional']}</span></td>
</tr>
PPPRINT;
}

for ($x=1; $x <= $photocount; $x++) {
if ( is_image($bulkname[$x]) || is_multimedia($bulkname[$x]) ) {
echo<<<PPPRINT
<tr>
<td class="{$Style['tddetails']}" width="200">
<div align="center"><span class="{$Style['small']}"><b>{$thumb[$x]}{$bulkname[$x]}</b></span></div>
</td>
<td class="{$Style['tddetails']}" width="5%" align="center">
<input type="hidden" name="imgname{$x}" value="{$bulkname[$x]}">
<input type="checkbox" checked="checked" value="1" name="add{$x}">
</td>
<td class="{$Style['tddetails']}" width="100%">
<table width="95%" cellpadding="0" cellspacing="0">
<tr>
<td>
<span class="{$Style['small']}">{$Globals['pp_lang']['category']}:</span>
</td>
<td>
<select name="cat$x" style="font-size: 9pt;">
$catoptions
</select>
PPPRINT;

if ( $Globals['optcats'] == "yes" ) {
echo<<<PPPRINT
</td>
</tr>
<tr>
<td>
<span class="{$Style['small']}">{$Globals['pp_lang']['optcat']}:</span>
</td>
<td>
<select name="catwo$x" style="font-size: 9pt; background: #ffffff;">
<option value="0" selected="selected">{$Globals['pp_lang']['none']}</option>$catoptions2</select>
</td>
</tr>
<tr>
<td>
<span class="{$Style['small']}">{$Globals['pp_lang']['optcat']}:</span>
</td>
<td>
<select name="cathree$x" style="font-size: 9pt; background: #ffffff;">
<option value="0" selected="selected">{$Globals['pp_lang']['none']}</option>$catoptions2</select>
</td>
</tr>
PPPRINT;
}
else {
echo<<<PPPRINT
<input type="hidden" name="catwo$x" value="0">
<input type="hidden" name="cathree$x" value="0">
</td>
</tr>
PPPRINT;
}

echo<<<PPPRINT
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td>
<span class="{$Style['small']}">{$Globals['pp_lang']['title']}:</span>
</td>
<td>
<input type="text" class="{$Style['formboxes']}" size="50" name="title$x" value="$title" style="font-size: 9pt; background: #ffffff;">
</td>
</tr>
PPPRINT;

if ( $Globals['dispdesc'] == "yes" ) {
echo<<<PPPRINT
<tr>
<td class="{$Style['tddetails']}">
<span class="{$Style['small']}">{$Globals['pp_lang']['desc']}:</span>
</td>
<td>
<textareahtml name="desc$x" cols="50" rows="5">$desc</textareahtml>
</td>
</tr>
PPPRINT;
}

if ( $Globals['dispkeys'] == "yes" ) {
echo<<<PPPRINT
<tr>
<td class="{$Style['tddetails']}">
<span class="{$Style['small']}">{$Globals['pp_lang']['keywords']}:</span>
</td>
<td>
<input type="text" size="50" class="{$Style['formboxes']}" name="key$x" value="$keywords" />

</td>
</tr>
PPPRINT;
}

$city = $_GET["city"];
$st = $_GET["st"];

if ( $Globals['extra1name'] != "" ) {
echo<<<PPPRINT
<tr>
<td class="{$Style['tddetails']}">
<span class="{$Style['small']}">{$Globals['extra1name']}:</span>
</td>
<td class="{$Style['tddetails']}">
<input type="text" class="{$Style['formboxes']}" name="extra1-$x" value="{$city}"/>
</td>
</tr>
PPPRINT;
}

if ( $Globals['extra2name'] != "" ) {
echo<<<PPPRINT
<tr>
<td class="{$Style['tddetails']}">
<span class="{$Style['small']}">{$Globals['extra2name']}:</span>
</td>
<td class="{$Style['tddetails']}">
<input type="text" class="{$Style['formboxes']}" name="extra2-$x" value="{$st}"/>
</td>
</tr>
PPPRINT;
}

if ( $Globals['extra3name'] != "" ) {
echo<<<PPPRINT
<tr>
<td class="{$Style['tddetails']}">
<span class="{$Style['small']}">{$Globals['extra3name']}:</span>
</td>
<td class="{$Style['tddetails']}">
<input type="text" class="{$Style['formboxes']}" name="extra3-$x" />
</td>
</tr>
PPPRINT;
}

if ( $Globals['extra4name'] != "" ) {
echo<<<PPPRINT
<tr>
<td class="{$Style['tddetails']}">
<span class="{$Style['small']}">{$Globals['extra4name']}:</span>
</td>
<td class="{$Style['tddetails']}">
<input type="text" class="{$Style['formboxes']}" name="extra4-$x" />
</td>
</tr>
PPPRINT;
}

if ( $Globals['extra5name'] != "" ) {
echo<<<PPPRINT
<tr>
<td class="{$Style['tddetails']}">
<span class="{$Style['small']}">{$Globals['extra5name']}:</span>
</td>
<td class="{$Style['tddetails']}">
<input type="text" class="{$Style['formboxes']}" name="extra5-$x" />
</td>
</tr>
PPPRINT;
}

if ( $Globals['extra6name'] != "" ) {
echo<<<PPPRINT
<tr>
<td class="{$Style['tddetails']}">
<span class="{$Style['small']}">{$Globals['extra6name']}:</span>
</td>
<td class="{$Style['tddetails']}">
<input type="text" class="{$Style['formboxes']}" name="extra6-$x" />
</td>
</tr>
PPPRINT;
}

if ( $numcustom > 0 ) {
for( $z=0; $z < $numcustom; $z++ ) {
if ( !empty($extraprompts['name'][$z]) ) {
$thisopts = str_replace( "%%insertid%%", "$x", $extraprompts['options'][$z] );
echo<<<PPPRINT
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td class="{$Style['tddetails']}" valign="top">
<span class="{$Style['small']}">{$extraprompts['name'][$z]}:</span>
</td>
<td class="{$Style['tddetails']}" valign="top">
{$thisopts}
</td>
</tr>
PPPRINT;
}
}
}

if ( is_multimedia($bulkname[$x]) ) {
echo<<<PPPRINT
<tr>
<td class="{$Style['tddetails']}">
<span class="{$Style['small']}">Optional thumbnail:</span>
</td>
<td>
<input type="file" name="theimage[$x]" />
<input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
</td>
</tr>
PPPRINT;
}

echo<<<PPPRINT
</table>
</td>
</tr>
PPPRINT;
}
}

if ( $overlimit > 0 ) {
echo<<<PPPRINT
<tr>
<td colspan="3" class="{$Style['tddetails']}">
<span class="{$Style['medium']}">
<div align="center">{$Globals['pp_lang']['baduploads']}</div>
</td>
</tr>
PPPRINT;
}

if ($photocount == 0) {
if ( $Globals['moderation'] == "yes" ) {
$Globals['pp_lang']['nomore'] .= $Globals['pp_lang']['moderate'];
}
echo<<<PPPRINT
<tr>
<td colspan="3" class="{$Style['tddetails']}">
<span class="{$Style['medium']}">
<div align="center">{$Globals['pp_lang']['nomore']}<br />
<b><a href="{$retlink}">{$Globals['pp_lang']['retmainmenu']}</a></b>
</div>
</td>
</tr>
PPPRINT;
}
else {
echo<<<PPPRINT
<tr>
<td class="{$Style['tddetails']}" colspan="3">
<div align="center">
<input type="hidden" name="upuser" value="$upuser">
<input type="hidden" name="photopath" value="$photopath">
<input type="hidden" name="ppaction" value="addphotos">
<input type="hidden" name="defcat" value="$defcat">
<input type="hidden" name="dthumbs" value="$dthumbs">
<input type="hidden" name="deftitle" value="$deftitle">
<input type="hidden" name="defdesc" value="$defdesc">
<input type="hidden" name="keywords" value="$keywords">
<input type="hidden" name="updir" value="$updir">
<input type="hidden" name="do" value="process">
<input name="thecount" value="$photocount" type="hidden">
<input name="inpath" value="$inpath" type="hidden">
$skipwater
PPPRINT;

if ( $photocount != 0 && ($x-1) == $numprocess ) {
echo<<<PPPRINT
<span class="{$Style['medium']}">{$Globals['pp_lang']['thumbs']} <select name="numprocess">$numopts</select><br /><br />
PPPRINT;
}

echo<<<PPPRINT
<input type="hidden" name="notify" value="$notify">
<input type="hidden" name="comments" value="$comments">
<input type="hidden" name="rating" value="$rating">
<input type="submit" value="{$Globals['pp_lang']['proc']}">
</div>
</td>
</tr>
PPPRINT;
}

echo<<<PPPRINT
</table>
</td>
</tr>
</table>
PPPRINT;

echo<<<PPPRINT
</td>
</tr>
$ppclose
</form>
<br />
PPPRINT;

?>
Fingertips is offline   Reply With Quote