[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: Вывод Изображение из БД
leonweb
Доброе время суток!
есть код где выводяться изображения
всё работает классно
но проблема я ни как не могу вставить в javascript php чтобы он мне вытаскивал только с БД
а так вытаскивает только с папки
помогите пожалуйта
это код

<?
$gallery = room_gallery($room_id);
//echo '<pre>';
//print_r($gallery);
//echo '</pre>';

?>


<script>
var fileUploadErrors = {
maxFileSize: 'File is too big',
minFileSize: 'File is too small',
acceptFileTypes: 'Filetype not allowed',
maxNumberOfFiles: 'Max number of files exceeded',
uploadedBytes: 'Uploaded bytes exceed file size',
emptyResult: 'Empty file upload result'
};
</
script>
<?php if($room_data['room_type'] == 'gallery'):?>
<?php
if($gallery === false):?>
<?php
else : ?>
<?php
foreach($gallery as $gkey=>$gval):?>
<script id="template-upload" type="text/html">
{% for (var i=0, files=o.files, l=files.length, file=files[0]; i<l; file=files[++i]) { %}
<tr class="template-upload fade">
<
td class="preview"><span class="fade"></span></td>
<
td class="name">{%=file.name%}</td>
<
td class="size">{%=o.formatFileSize(file.size)%}</td>
{% if (file.error) { %}
<td class="error" colspan="2"><span class="label important">Error</span> {%=fileUploadErrors[file.error] || file.error%}</td>
{% } else if (o.files.valid && !i) { %}
<td class="progress"><div class="progressbar"><div style="width:0%;"></div></div></td>
<
td class="start">{% if (!o.options.autoUpload) { %}<button name="submit" class="btn primary">Start</button>{% } %}</td>
{% } else { %}
<td colspan="2"></td>
{% } %}
<td class="cancel">{% if (!i) { %}<button class="btn info">Cancel</button>{% } %}</td>
</
tr>
{% } %}
</script>
<
script id="template-download" type="text/html">
{%for (var i=0, files=o.files, l=files.length, file=files[0]; i<l; file=files[++i]) { %}
<tr class="template-download fade">
{% if (file.error) { %}
<td></td>
<
td class="name">{%=file.name%}</td>
<
td class="size">{%=o.formatFileSize(file.size)%}</td>
<
td class="error" colspan="2"><span class="label important">Error</span> {%=fileUploadErrors[file.error] || file.error%}</td>
{% } else { %}
<td class="preview">{% if (file.thumbnail_url) { %}

<a href="{%=file.url%}" title="{%=file.name%}" rel="gallery"><img src="{%=file.thumbnail_url%}"></a>
{% } %}</td>
<
td class="name">

<
a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}">{%=file.name%}</a>

</
td>
<
td class="size">{%=o.formatFileSize(file.size)%}</td>
<
td colspan="2"></td>
{% } %}
<td class="delete">
<
button class="btn danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}">Delete</button>
<
input type="checkbox" name="delete" value="1">
</
td>
</
tr>
{% } %}
</script>
<?php endforeach; ?>
<?php
endif; ?>
<?php
endif; ?>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<
script src="vendor/jquery.ui.widget.js"></script>
<
script src="http://blueimp.github.com/JavaScript-Templates/tmpl.min.js"></script>
<
script src="http://blueimp.github.com/JavaScript-Load-Image/load-image.min.js"></script>
<!--
Bootstrap Modal and Image Gallery are not required, but included for the demo -->
<
script src="http://twitter.github.com/bootstrap/1.4.0/bootstrap-modal.min.js"></script>
<
script src="http://blueimp.github.com/Bootstrap-Image-Gallery/bootstrap-image-gallery.min.js& ;quo t;></script>
<script src="
vendor/jquery.iframe-transport.js"></script>
<script src="
vendor/jquery.fileupload.js"></script>
<script src="
vendor/jquery.fileupload-ui.js"></script>
<script src="
vendor/application.js"></script>
<!-- The XDomainRequest Transport is included for cross-domain file deletion for IE >= 8 -->
<script src="
jquery.xdr-transport.js"></script>
<!-- postMessage Transport support can be added with the following plugin -->
<!--script src="
vendor/jquery.postmessage-transport.js"></script-->




Спустя 20 часов, 14 минут, 7 секунд (29.02.2012 - 08:36) Эли4ка написал(а):
leonweb
оформите пожалуйста в нормальный вид..

Спустя 1 час, 17 минут, 1 секунда (29.02.2012 - 09:53) leonweb написал(а):
вот код в javascript


<script>
var fileUploadErrors = {
maxFileSize: 'File is too big',
minFileSize: 'File is too small',
acceptFileTypes: 'Filetype not allowed',
maxNumberOfFiles: 'Max number of files exceeded',
uploadedBytes: 'Uploaded bytes exceed file size',
emptyResult: 'Empty file upload result'
};
</
script>
<
script id="template-upload" type="text/html">
{% for (var i=0, files=o.files, l=files.length, file=files[0]; i<l; file=files[++i]) { %}
<tr class="template-upload fade">
<
td class="preview"><span class="fade"></span></td>
<
td class="name">{%=file.name%}</td>
<
td class="size">{%=o.formatFileSize(file.size)%}</td>
{% if (file.error) { %}
<td class="error" colspan="2"><span class="label important">Error</span> {%=fileUploadErrors[file.error] || file.error%}</td>
{% } else if (o.files.valid && !i) { %}
<td class="progress"><div class="progressbar"><div style="width:0%;"></div></div></td>
<
td class="start">{% if (!o.options.autoUpload) { %}<button name="submit" class="btn primary">Start</button>{% } %}</td>
{% } else { %}
<td colspan="2"></td>
{% } %}
<td class="cancel">{% if (!i) { %}<button class="btn info">Cancel</button>{% } %}</td>
</
tr>
{% } %}
</script>
<
script id="template-download" type="text/html">
{%for (var i=0, files=o.files, l=files.length, file=files[0]; i<l; file=files[++i]) { %}
<tr class="template-download fade">
{% if (file.error) { %}
<td></td>
<
td class="name">{%=file.name%}</td>
<
td class="size">{%=o.formatFileSize(file.size)%}</td>
<
td class="error" colspan="2"><span class="label important">Error</span> {%=fileUploadErrors[file.error] || file.error%}</td>
{% } else { %}
<td class="preview">{% if (file.thumbnail_url) { %}

<a href="{%=file.url%}" title="{%=file.name%}" rel="gallery"><img src="{%=file.thumbnail_url%}"></a>
{% } %}</td>
<
td class="name">
<
a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'gallery'%}">{%=file.name%}</a>
</
td>
<
td class="size">{%=o.formatFileSize(file.size)%}</td>
<
td colspan="2"></td>
{% } %}
<td class="delete">
<
button class="btn danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}">Delete</button>
<
input type="checkbox" name="delete" value="1">
</
td>
</
tr>
{% } %}
</script>
<
script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<
script src="vendor/jquery.ui.widget.js"></script>
<
script src="http://blueimp.github.com/JavaScript-Templates/tmpl.min.js"></script>
<
script src="http://blueimp.github.com/JavaScript-Load-Image/load-image.min.js"></script>
<!--
Bootstrap Modal and Image Gallery are not required, but included for the demo -->
<
script src="http://twitter.github.com/bootstrap/1.4.0/bootstrap-modal.min.js"></script>
<
script src="http://blueimp.github.com/Bootstrap-Image-Gallery/bootstrap-image-gallery.min.js&quo t;></script>
<
script src="vendor/jquery.iframe-transport.js"></script>
<
script src="vendor/jquery.fileupload.js"></script>
<
script src="vendor/jquery.fileupload-ui.js"></script>
<
script src="vendor/application.js"></script>
<!--
The XDomainRequest Transport is included for cross-domain file deletion for IE >= 8 -->
<
script src="jquery.xdr-transport.js"></script>
<!--
postMessage Transport support can be added with the following plugin -->
<!--
script src="vendor/jquery.postmessage-transport.js"></script-->


Спустя 3 минуты, 9 секунд (29.02.2012 - 09:56) leonweb написал(а):
там где написано в строке

<a href="{%=file.url%}" title="{%=file.name%}" rel="gallery"><img src="{%=file.thumbnail_url%}"></a>

это пут к папке а надо вставить код php для вывода из БД название фото
как это сделать
подскажите пожалуйста
Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2024 Invision Power Services, Inc.