Moin,
bei der Seite von einer Diskothek gibt es ein Problem, wo ich derzeit nicht weiter weiß es geht darum das bei der Seite alle Partyshots einzelnd hochgeladen werden müssen und bei meist weit über 100 Bildern das recht Zeitaufwendig und nervig ist!
Ich habe da ein Javascript schnell mal rauskopiert und wollt fragen ob das Script für den Upload zuständig ist oder ein PHP Script was ich noch nicht gefunden habe.
(Java kann ich noch nicht.)
Hoffe auf zahlreiche Antworten, Tipps und villeicht eine Helfende Hand
Script no1:
Script no2:
Und es gibt noch ein 3. worauf ich aber erst später Zugriff habe welches ich morgen früh nochmal poste
(<script type="text/javascript" src="js/Fileupload.js"></script>)
bei der Seite von einer Diskothek gibt es ein Problem, wo ich derzeit nicht weiter weiß es geht darum das bei der Seite alle Partyshots einzelnd hochgeladen werden müssen und bei meist weit über 100 Bildern das recht Zeitaufwendig und nervig ist!
Ich habe da ein Javascript schnell mal rauskopiert und wollt fragen ob das Script für den Upload zuständig ist oder ein PHP Script was ich noch nicht gefunden habe.
(Java kann ich noch nicht.)
Hoffe auf zahlreiche Antworten, Tipps und villeicht eine Helfende Hand
Script no1:
Code:
var icon = false;
var currentTimeout;
function arrowClickEventHandler(_action, _module) {
if(_action == "remove") {
source = getById(_module + "Selected");
target = getById(_module + "Pool");
}
else if(_action == "add") {
source = getById(_module + "Pool");
target = getById(_module + "Selected");
}
var selectedItems = new Array();
// get selected options
var y = 0;
for (var i = 0; i < source.options.length; i++) {
if (source.options[i].selected) {
selectedItems[y] = source.options[i].value;
y++;
}
}
if(selectedItems.length > 0)
transfer(source, target, selectedItems);
// do transfer
}
function transfer(_source, _target, _values) {
var z = _target.options.length;
var count = _values.length;
var length = _source.length;
var deleted = 0;
for (var i = 0; i < length; i++) {
// begin from 0 if item deleted
if(deleted == 1) {
i = 0;
deleted = 0;
}
for(var y = 0; y < count; y++) {
// check if option exists and value equals with selected item value
if(_source.options[i] && _source.options[i].value == _values[y]) {
// check if already in target (prevent redundancy)
if(!inSelect(_target, _source.options[i].value)) {
// Write entry in target
_target.options[z] = new Option(_source.options[i].text, _source.options[i].value);
}
// delete entry
_source.options[i] = null;
deleted = 1;
z++;
break;
}
}
}
}
function checkSelected(_sender) {
if(_sender.id == "norule" || _sender.id == "friends") {
$("#includeContainer:visible").ctdHide(styEffectPermissionSelectOut[0], styEffectPermissionSelectOut[2], styEffectPermissionSelectOut[1]);
$("#excludeContainer:visible").ctdHide(styEffectPermissionSelectOut[0], styEffectPermissionSelectOut[2], styEffectPermissionSelectOut[1]);
}
else if(_sender.id == "include") {
$("#includeContainer:hidden").ctdShow(styEffectPermissionSelectIn[0], styEffectPermissionSelectIn[2], styEffectPermissionSelectIn[1]);
$("#excludeContainer:visible").ctdHide(styEffectPermissionSelectOut[0], styEffectPermissionSelectOut[2], styEffectPermissionSelectOut[1]);
}
else if(_sender.id == "exclude") {
$("#includeContainer:visible").ctdHide(styEffectPermissionSelectOut[0], styEffectPermissionSelectOut[2], styEffectPermissionSelectOut[1]);
$("#excludeContainer:hidden").ctdShow(styEffectPermissionSelectIn[0], styEffectPermissionSelectIn[2], styEffectPermissionSelectIn[1]);
}
}
function showHide(_element) {
object = getById(_element);
if(object.style.display == "")
object.style.display = "none";
else
object.style.display = "";
}
function inSelect(_select, _needle) {
var length = _select.options.length;
for(var k = 0; k < length; k++) {
if(_select.options[k].value == _needle)
return true;
}
return false;
}
function debug(_value) {
getById("debug").innerHTML += " "+_value;
}
var timeout = false;
function search(_table, _searchField, _searchValue, _idField) {
clearTimeout(currentTimeout);
timeout = true;
var values = _table.split("_");
module = values[0];
pool = values[1];
currentTimeout = setTimeout(function() {
doSearch(_table, _searchField, _searchValue, _idField, false) } , 500);
}
function doSearch(_table, _searchField, _searchValue, _idField, _synchron, _noAjaxLoader) {
var values = _table.split("_");
pool = values[1];
if(!_noAjaxLoader) {
icon = "ajaxLoader" + values[1] + values[2];
ajaxLoaderIcon(icon);
}
var table = values[0] + "_" + values[1];
var selectedValues = getSelectedValues(getById(values[1] + values[2] + "Selected"));
querystring = pathPrefix + "/Ajax/sysSelectOption" + firstSeperator + "table=" + table + "&searchField=" + _searchField;
querystring += "&searchValue=" + _searchValue + "&idField=" + _idField + "&selectedValues=" + selectedValues + sid2;
request = new AjaxRequest(querystring, _synchron);
if(!_synchron)
request.callFunction = refresh;
request.doRequest();
if(_synchron)
refresh(request, true);
}
function ajaxLoaderIcon(_id) {
object = getById(_id);
if(object.style.display == "none")
object.style.display = "";
else
object.style.display = "none";
}
function getSelectedValues(_select) {
var count = _select.options.length;
var values = "";
for(var i = 0; i < count; i++) {
values += _select.options[i].value;
if((i+1) != count)
values = values + ",";
}
return values;
}
function refresh(_request, _synchron) {
if(!_synchron)
var xml = _request.responseXML;
else
var xml = _request.getResponseXML();
var options = xml.getElementsByTagName("option");
getById(pool + "ExcludePool").innerHTML = "";
getById(pool + "IncludePool").innerHTML = "";
for(var i=0; i < options.length; i++) {
var text = options[i].firstChild.nodeValue;
var value = options[i].getAttribute("value");
var option = document.createElement("option");
option.appendChild(document.createTextNode(text));
option.value = value;
getById(pool + "ExcludePool").appendChild(option);
var option = document.createElement("option");
option.appendChild(document.createTextNode(text));
option.value = value;
getById(pool + "IncludePool").appendChild(option);
}
if(icon)
window.setTimeout("ajaxLoaderIcon(icon)", 900);
timeout = false;
}
function selectAll() {
if(getById('groupIncludeSelected')) {
var object = getById('groupIncludeSelected')
count = object.length;
for(var i = 0; i < count; i++) {
object.options[i].selected = "selected";
}
}
if(getById('groupExcludeSelected')) {
var object = getById('groupExcludeSelected')
count = object.length;
for(var i = 0; i < count; i++) {
object.options[i].selected = "selected";
}
}
if(getById('userIncludeSelected')) {
var object = getById('userIncludeSelected')
count = object.length;
for(var i = 0; i < count; i++) {
object.options[i].selected = "selected";
}
}
if(getById('userExcludeSelected')) {
var object = getById('userExcludeSelected')
count = object.length;
for(var i = 0; i < count; i++) {
object.options[i].selected = "selected";
}
}
}
// Form id not longer needed
$($("#norule")[0].form).submit(selectAll);
function loadItems() {
doSearch('sys_group_Exclude',
'name', '',
'grpId', true, true);
doSearch('sys_user_Exclude',
'username', '',
'usrId', true, true);
}
function hideItems() {
if(getById('groupIncludePool')) {
var selected = getById('groupIncludeSelected')
var pool = getById('groupIncludePool');
var count = selected.length;
for(var i = 0; i < count; i++) {
for (var j = 0; j < pool.length; j++) {
if(pool[j].value == selected[i].value)
pool.remove(j);
}
}
}
if(getById('groupExcludePool')) {
var selected = getById('groupExcludeSelected')
var pool = getById('groupExcludePool');
var count = selected.length;
for(var i = 0; i < count; i++) {
for (var j = 0; j < pool.length; j++) {
if(pool[j].value == selected[i].value)
pool.remove(j);
}
}
}
if(getById('userIncludePool')) {
var selected = getById('userIncludeSelected')
var pool = getById('userIncludePool');
var count = selected.length;
for(var i = 0; i < count; i++) {
for (var j = 0; j < pool.length; j++) {
if(pool[j].value == selected[i].value)
pool.remove(j);
}
}
}
if(getById('userExcludePool')) {
var selected = getById('userExcludeSelected')
var pool = getById('userExcludePool');
var count = selected.length;
for(var i = 0; i < count; i++) {
for (var j = 0; j < pool.length; j++) {
if(pool[j].value == selected[i].value)
pool.remove(j);
}
}
}
}
loadItems();
hideItems();
Script no2:
Code:
<script type="text/javascript">
//<![CDATA[
var pathPrefix = "";
var iconPath = "http://forum.jswelt.de/images/icons/Lumina";
var sid1 = "";
var sid2 = "";
if(pathPrefix.indexOf("?") > -1)
var firstSeperator = "&";
else
var firstSeperator = "?";
var fieldName = "thumbnail";
var iframeName = "thumbnail_iframe";
allowedExtensions[allowedExtensions.length] = "bmp";
allowedExtensions[allowedExtensions.length] = "gif";
allowedExtensions[allowedExtensions.length] = "jpeg";
allowedExtensions[allowedExtensions.length] = "jpg";
allowedExtensions[allowedExtensions.length] = "png";
allowedExtensions[allowedExtensions.length] = "svg";
allowedExtensions[allowedExtensions.length] = "svgz";
var newKey = uploadedFiles.length;
var langInvalidFile = "Datei ungültig.";
var langUploadError = "Upload-Fehler, bitte überprüfen Sie Typ und Größe der Datei!";
var langFileNotSet = "Datei erforderlich.";
var langFileAlreadyUploaded = "Datei existiert bereits.";
var langExtensionNotAllowed = "Dateiendung ungültig.";
var amount = 1;
var submit = false;
//]]>
</script>
(<script type="text/javascript" src="js/Fileupload.js"></script>)
Zuletzt bearbeitet von einem Moderator: