function addPics() { global $moduleName, $iConfig; //$uploadPath = $iConfig['upload_path']; //if ((substr( $uploadPath, -1) ) == '/') { $uploadPath = substr( $uploadPath, 0, -1); } $inlineJS = '<script type="text/javascript">//<![CDATA[' . PHP_EOL; $inlineJS .= ' $(document).ready(function() {' . PHP_EOL; $inlineJS .= ' var options = {' . PHP_EOL; $inlineJS .= ' target: \'#upload-alert\',' . PHP_EOL; $inlineJS .= ' url: \'modules.php?name=' . $moduleName . '&op=uploadMoveAjax\',' . PHP_EOL; $inlineJS .= ' success: function() {' . PHP_EOL; $inlineJS .= ' $(\'input:file\').MultiFile(\'reset\' );' . PHP_EOL; $inlineJS .= ' $(\'#upload-alert\').fadeIn(\'slow\' );' . PHP_EOL; $inlineJS .= ' $(\'#upload-file-list\').empty();' . PHP_EOL; $inlineJS .= ' }' . PHP_EOL; $inlineJS .= ' };' . PHP_EOL; $inlineJS .= ' $(\'#upload-form\').ajaxForm(options);' . PHP_EOL; $inlineJS .= '});' . PHP_EOL; $inlineJS .= '//]]></script>' . PHP_EOL; AddJSToHead('includes/jquery/jquery.js', 'file'); AddJSToHead('modules/' . $moduleName . '/includes/jquery/jquery.form.js', 'file'); AddJSToHead('modules/' . $moduleName . '/includes/jquery/jquery.MultiFile.pack.js', 'file'); AddJSToHead($inlineJS, 'inline'); galleryHeader(); uploadDiv(); galleryFooter(); }
function galManageComments() { global $db, $prefix, $user_prefix, $iConfig, $moduleName, $admin_file; $deleted = isset($_GET['deleted']) ? intval($_GET['deleted']) : 0; $updated = isset($_GET['updated']) ? intval($_GET['updated']) : 0; $inlineJS = '<script type="text/javascript"> $(document).ready(function() { $(\'.ask\').click(function(e) { e.preventDefault(); thisHref = $(this).attr(\'href\'); if($(this).next(\'div.question\').length <= 0) $(this).after(\'<div class="question">' . _IG_ADM_ARE_YOU_SURE . '<br/> <span class="yes">' . _YES . '</span><span class="cancel">' . _NO . '</span></div>\'); $(\'.question\').animate({opacity: 1}, 300); $(\'.yes\').live(\'click\', function(){ window.location = thisHref + \'confirm=1\'; }); $(\'.cancel\').live(\'click\', function(){ $(this).parents(\'div.question\').fadeOut(300, function() { $(this).remove(); }); }); }); }); </script>'; AddJSToHead('includes/jquery/jquery.js', 'file'); AddJSToHead($inlineJS, 'inline'); include 'header.php'; galAdminMenu(); if ($deleted == 1) { echo '<div class="warning">' . _IG_ADM_COMMENT_DELETED . '</div>' . PHP_EOL; } elseif ($deleted == 2) { echo '<div class="warning">' . _IG_ADM_COMMENT_DELETED_ERROR . '</div>' . PHP_EOL; } if ($updated == 1) { echo '<div class="warning">' . _IG_ADM_COMMENT_UPDATED . '</div>' . PHP_EOL; } elseif ($updated == 2) { echo '<div class="warning">' . _IG_ADM_COMMENT_UPDATED_ERROR . '</div>' . PHP_EOL; } echo '<div id="show-comments">' . PHP_EOL; echo ' <h2>' . _IG_ADM_MANAGECOMMENTS . '</h2>' . PHP_EOL; $result = $db->sql_query('SELECT * FROM ' . $prefix . '_igallery_comments ORDER BY comment_date DESC ;'); while ($comment = $db->sql_fetchrow($result)) { $commentId = intval($comment['comment_id']); $userId = intval($comment['comment_userid']); $message = nl2br($comment['comment_data']); $date = $comment['comment_date']; $pictureId = $comment['comment_pictureid']; $usrInfo = $db->sql_fetchrow($db->sql_query('SELECT username, user_avatar FROM ' . $user_prefix . '_users WHERE user_id=' . $userId . ' LIMIT 1')); $posterName = $usrInfo['username']; $posterAvatar = $usrInfo['user_avatar']; $posterLink = 'modules.php?name=Your_Account&op=userinfo&username='******''; $thumbSrc = 'modules.php?name=' . $moduleName . '&op=getThumb&pictureid=' . $pictureId; if (!empty($posterAvatar) && !eregi('blank.gif', $posterAvatar)) { if (eregi('http://', $posterAvatar)) { $src = $posterAvatar; } else { $src = 'modules/Forums/images/avatars/' . $posterAvatar; } } else { $src = 'modules/' . $moduleName . '/images/no_avatar.png'; } echo '<div class="comment-box">' . PHP_EOL; echo '<table style="width:100%;">' . PHP_EOL; echo ' <tr>' . PHP_EOL; echo ' <td class="show-comment-image">' . PHP_EOL; echo ' <a href="modules.php?name=' . $moduleName . '&op=showPic&pictureid=' . $pictureId . '"><img src="' . $thumbSrc . '" title="" alt="" /></a>' . PHP_EOL; echo ' </td>' . PHP_EOL; echo ' <td class="show-comment-info">' . PHP_EOL; echo ' <a href="' . $posterLink . '"><img class="comment-avatar" src="' . $src . '" alt="' . $posterName . '" title="' . $posterName . '" /></a>' . PHP_EOL; echo ' <span class="comment-poster"><a href="modules.php?name=Your_Account&op=userinfo&username='******'">' . $posterName . '</a></span>' . PHP_EOL; echo ' <span class="comment-date">' . dateToDays($date) . '</span>' . PHP_EOL; echo ' <span class="comment-admin">' . PHP_EOL; echo ' <a href="' . $admin_file . '.php?op=galDeleteComment&id=' . $commentId . '&" class="ask"><img class="icon-small" src="modules/' . $moduleName . '/images/edit-delete.png" title="' . _IG_ADM_DELETE_COMMENT . '" alt="" /></a>' . PHP_EOL; echo ' <a href="' . $admin_file . '.php?op=galEditComment&id=' . $commentId . '"><img class="icon-small" src="modules/' . $moduleName . '/images/format-justify-fill.png" title="' . _IG_ADM_EDIT_COMMENT . '" alt="" /></a>' . PHP_EOL; echo ' <a href="modules.php?name=' . $moduleName . '&op=showPic&pictureid=' . $pictureId . '#show-comments"><img class="icon-small" src="modules/' . $moduleName . '/images/internet-group-chat.png" title="' . _IG_ADM_VIEW_COMMENT_THREAD . '" alt="" /></a>' . PHP_EOL; echo ' </span>' . PHP_EOL; echo ' <div class="comment">' . $message . '</div>' . PHP_EOL; echo ' </td>' . PHP_EOL; echo ' </tr>' . PHP_EOL; echo '</table>' . PHP_EOL; echo '</div>' . PHP_EOL; } echo '</div>' . PHP_EOL; CloseTable(); include 'footer.php'; }