DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ # Execute le gestion des fichiers lier par l'action {{attach}} # Necessite le fichier actions/attach.php pour fonctionner # voir actions/attach.php ppour la documentation # copyrigth Eric Feldstein 2003-2004 //vérification de sécurité if (!WIKINI_VERSION) { die("accès direct interdit"); } echo $this->Header(); ?> <div class="page"> <?php if ($this->UserIsOwner()) { if (!class_exists('attach')) { include $this->GetConfigValue('action_path') . '/attach.class.php'; } $att = new attach($this); $att->doFilemanager(); unset($att); } else { echo $this->Format("//Seul le propriétaire de cette page peut accéder au gestionnaire des fichiers attaché//"); } ?> </div> <?php echo $this->Footer();
.attach_vmiddle {vertical-align: text-bottom;} 10)Pour configurer l'aspect du gestionnnaire de fichier utiliser les classes de style .tableFM tableFMCol1 et tableFMCol2 Exemple : .tableFM {border: thin solid Black; width: 100%; } .tableFM THEAD { background-color: Silver; font-weight: bold; text-align: center; } .tableFM TFOOT { background-color: Silver; font-weight: bold; text-align: left; } .tableFM TBODY TR { text-align: center; } .tableFMCol1 { background-color: Aqua; } .tableFMCol2 { background-color: Yellow; } *******************************************************************************/ if ($this->config[upload_permission]=="oui") { if ($this->GetPageOwner()) { if (!class_exists('attach')){ include($this->GetConfigValue('action_path').'/attach.class.php'); } $att = new attach($this); $att->doAttach(); unset($att); } else { print "<span style=\"color:red\">La fonction de téléchargement de fichier n'est disponible que pour le propriétaire de la page</span>"; } } else { print "<span style=\"color:red\">La fonction de téléchargement de fichier n'est pas disponible sur le présent wiki!</span>"; } ?>
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ # Execute le download des fichiers lier par l'action {{attach}} # Necessite le fichier actions/attach.php pour fonctionner # voir actions/attach.php ppour la documentation # copyrigth Eric Feldstein 2003-2004 //vérification de sécurité if (!WIKINI_VERSION) { die("accès direct interdit"); } if (!class_exists('attach')) { include $this->GetConfigValue('action_path') . '/attach.class.php'; } $att = new attach($this); $att->doDownload(); unset($att);
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ # Execute l'upload des fichiers lier par l'action {{attach}} # Necessite le fichier actions/attach.php pour fonctionner # voir actions/attach.php ppour la documentation # copyrigth Eric Feldstein 2003-2004 //vérification de sécurité if (!WIKINI_VERSION) { die("accès direct interdit"); } echo $this->Header(); ?> <div class="page"> <?php if (!class_exists('attach')) { include $this->GetConfigValue('action_path') . '/attach.class.php'; } $att = new attach($this); $att->doUpload(); unset($att); ?> </div> <?php echo $this->Footer();
function post_attach($text) { $data = ldb_select('site_attach_files', '*', '`id` IN (SELECT `file_id` FROM `site_attach_post` WHERE `id_1`=\'' . $this->id_1 . '\' AND `id_2`=' . $this->id_2 . ')'); if (!$data) { return ''; } $data = array_id2key($data); # Get list of attaches inline in post $match = array(); if (preg_match_all('"file/([0-9]+)/"Uuims', $text, $m)) { for ($x = 0; $x < count($m[1]); $x++) { if (isset($data[$m[1][$x]])) { $match[$m[1][$x]] = 1; } } } $types = array(); foreach ($data as $id => $at) { if (isset($match[$id])) { continue; } $type = $this->get_type($at['file_name']); if ($type == 'IMAGE') { $types['image'][] = $at; continue; } if ($type == 'FVIDEO') { $types['fvideo'][] = $at; continue; } $types['other'][] = $at; } if (!$types) { return ''; } // No files $out = ''; # Images if (@$types['image']) { $out .= '<div class="attaches_list">'; $out .= '<a name="attach_img"></a>'; $out .= '<h3>Фотографии</h3>'; foreach ($types['image'] as $att) { $out .= '<a href="' . $this->file_link($att) . '" rel="lightbox[roadtrip]"><img src="' . $this->file_link($att) . '?size=600x120" alt="" style="margin:3px;vertical-align:middle;" class="attach_img_gal"/></a> '; } $out .= '</div>'; } # Flash video if (@$types['fvideo']) { $out .= '<div class="attaches_list">'; $out .= '<a name="attach_video"></a>'; $out .= '<h3>Видео</h3>'; $tpl = new ltpl('attach_video'); $list = ''; $init = array(); foreach ($types['fvideo'] as $att) { if (!$init) { $init = $att; } $list .= '<table width="100%" cellpadding="0" cellspacing="0"><tr>'; $list .= '<td width="80" align="center"><img src="' . URL . '/tpl/img/play_sd.png" id="att_video_btn_' . $att['id'] . '" style="cursor:pointer;" onclick="play_video(' . $att['id'] . ',\'' . $att['key'] . '\');" alt="Посмотреть" title="Посмотреть"/></td>'; $list .= '<td align="left" valign="top">'; #$list .= '<div class="attach_video_name">'.$att['file_name'].'</div>'; #$list .= '<div class="attach_video_size">'.format_size($att['file_size']).'</div>'; $list .= '</td>'; $list .= '</tr></table>'; } $init['url'] = attach::file_link($init); $tpl->v('list', $list); $tpl->v('init', $init); $out .= $tpl->get(); $out .= '</div>'; } # Other if (@$types['other']) { $out .= '<div class="attaches_list">'; $out .= '<h3>Прочие файлы</h3>'; foreach ($types['other'] as $att) { $out .= '<table width="100%" cellpadding="1" cellspacing="0"><tr>'; $out .= '<td width="80" align="center"><a href="' . $this->file_link($att) . '" target="_blank">' . $this->list_prev($att) . '</a></td>'; $out .= '<td valign="top" align="left">'; $out .= '<div><a href="' . $this->file_link($att) . '" target="_blank">' . $att['file_name'] . '</a></div>'; $out .= 'Размер: ' . format_size($att['file_size']); #$out .= ' <img src="'.URL.'/file/'.$att['id'].'/'.$att['file_name'].'?size=120x120" alt=""/></a> '; $out .= '<td></tr></table>'; } $out .= '</div>'; } # dbg ($types); return $out; }
} $cache = false; if (@$_SERVER['HTTP_IF_MODIFIED_SINCE'] || @$_SERVER['HTTP_IF_NONE_MATCH']) { @header('HTTP/1.1 304 Not Modified'); $cache = true; } $mime = $data['file_mime']; # thumb requested? if (@$_GET['size'] && attach::get_type($data['file_name']) == 'IMAGE') { $res = get_prev($id, $_GET['size']); if ($res) { #$mime = 'image/png'; $data_l = $res; } } if (@$_GET['size'] && attach::get_type($data['file_name']) == 'FVIDEO') { $res = get_video_prev($id, $_GET['size']); #exit (); if ($res) { $mime = 'image/jpeg'; $data_l = $res; } } if ($mime) { @header('Content-Type: ' . $mime); } else { @header('Content-Type: application/x-force-download'); } #@header ('Last-Modified: Fri, 02 May 2008 00:00:00 GMT'); header('Last-Modified: ' . gmdate('D, d M Y H:i:s', 880000) . ' GMT'); header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 880000) . ' GMT');
derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ # Execute le gestion des fichiers lier par l'action {{attach}} # Necessite le fichier actions/attach.php pour fonctionner # voir actions/attach.php ppour la documentation # copyrigth Eric Feldstein 2003-2004 //vérification de sécurité if (!WIKINI_VERSION) { die("accès direct interdit"); } if ($this->HasAccess('write')) { if (!class_exists('attach')) { include 'tools/attach/actions/attach.class.php'; } $att = new attach($this); $att->doFilemanagerAction(); unset($att); } else { echo '<div class="alert alert-danger">' . _t('ATTACH_NO_RIGHTS_TO_ACCESS_FILEMANAGER') . '.</div>' . "\n"; }
$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION)); // Using strtolower to overcome case sensitive if (!in_array($ext, $supported_image_extensions)) { echo '<div class="alert alert-danger"><strong>' . _t('ATTACH_ACTION_BACKGROUNDIMAGE') . '</strong> : ' . _t('ATTACH_PARAM_FILE_MUST_BE_IMAGE') . '.</div>' . "\n"; return; } // image size $height = $this->GetParameter('height'); $width = $this->GetParameter('width'); if (empty($width)) { $width = 1920; } if (!class_exists('attach')) { include 'tools/attach/actions/attach.class.php'; } $att = new attach($this); //recuperation des parametres necessaire $att->file = $file; $att->desc = 'background image ' . $file; $att->height = $height; $att->width = $width; $fullFilename = $att->GetFullFilename(); //test d'existance du fichier if (!file_exists($fullFilename) || $fullFilename == '') { $att->showFileNotExits(); //return; } } // container class $class = $this->GetParameter('class'); echo '<div class="background-image' . (!empty($class) ? ' ' . $class : '') . '" style="' . (!empty($bgcolor) ? 'background-color:' . $bgcolor . '; ' : '') . (!empty($height) ? 'height:' . $height . 'px; ' : '') . (isset($fullFilename) ? 'background-image:url(' . $fullFilename . ');' : '') . '">' . "\n" . '<div class="table-center">' . "\n";