Example #1
0
 $result = $site_db->query($sql);
 $config = array();
 while ($row = $site_db->fetch_array($result)) {
     $config[$row['setting_name']] = $row['setting_value'];
 }
 show_form_header("settings.php", "updatesettings");
 show_table_header($lang['nav_general_settings'], 2);
 echo "<tr class=\"tablerow\"><td colspan=\"2\">";
 echo "<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\"><tr valign=\"top\">\n";
 $numgroups = sizeof($setting_group);
 $percolumn = ceil($numgroups / 2);
 $settingcounter = 0;
 foreach ($setting_group as $key => $val) {
     $settingcounter++;
     echo "<td>";
     show_text_link($val, "#setting_group_" . $key);
     echo "<br /></td>\n";
     if ($settingcounter == 4) {
         echo "</tr><tr>";
         $settingcounter = 0;
     }
 }
 echo "</tr></table>\n";
 echo "</td></tr>";
 show_table_separator($setting_group[1], 2, "setting_group_1");
 show_setting_row("site_name", "", 1);
 show_setting_row("site_email");
 show_setting_row("use_smtp", "radio");
 show_setting_row("smtp_host");
 show_setting_row("smtp_username");
 show_setting_row("smtp_password");
            $where_t = where($error[4]);
            echo "<tr align=\"center\" class=\"" . get_row_bg() . "\"><td>{$i}</td>";
            echo "<td><input type=\"checkbox\" name=\"selectimages[]\" value=\"" . $image_row['image_id'] . "\" /></td>";
            echo "<td align=\"left\">";
            $thumb = "<img src=\"" . (empty($image_row['image_thumb_file']) ? ICON_PATH . "/" . get_file_extension($image_row['image_media_file']) . ".gif" : (is_remote($image_row['image_thumb_file']) ? remote_file_exists($image_row['image_thumb_file'], 1) ? $image_row['image_thumb_file'] : ICON_PATH . "/404.gif" : (file_exists(ROOT_PATH . THUMB_DIR . "/" . $image_row['cat_id'] . "/" . $image_row['image_thumb_file']) ? ROOT_PATH . THUMB_DIR . "/" . $image_row['cat_id'] . "/" . $image_row['image_thumb_file'] : ICON_PATH . "/404.gif"))) . "\" width=\"40\" height=\"40\" border=\"1\" alt=\"\" /><b>&nbsp;&nbsp;" . $image_row['image_name'] . "</b>";
            echo "<a href=\"../images.php?action=editimage&image_id=" . $image_row['image_id'] . "\" target=\"4images_editimage\">" . $thumb . "</a>";
            echo "</td><td>" . $image_row['image_id'] . "</td>";
            echo "<td><a href=\"" . $site_sess->url(ROOT_PATH . "categories.php?" . URL_CAT_ID . "=" . $image_row['cat_id']) . "\" target=\"_blank\">" . htmlspecialchars($cat_cache[$image_row['cat_id']]['cat_name']) . "&nbsp;&nbsp;[ID: <b>" . $image_row['cat_id'] . "</b>]</a></td>\n";
            $show_user_name = htmlspecialchars($image_row[$user_table_fields['user_name']]);
            if ($image_row['user_id'] != GUEST && empty($url_show_profile)) {
                $show_user_name = "<a href=\"" . $site_sess->url(ROOT_PATH . "member.php?action=showprofile&" . URL_USER_ID . "=" . $image_row['user_id']) . "\" target=\"_blank\">{$show_user_name}</a>";
            }
            echo "<td>" . $show_user_name . "</a></td>\n";
            echo "<td>" . format_date($config['date_format'], $image_row['image_date']) . "</td>\n";
            echo "<td><font color={$where}>{$ok_show}</font></td><td>" . substr(strrchr($image_row['image_media_file'], "."), 1) . "</td>" . ($thumbs ? "<td><font color={$where_t}>{$ok_t_show}</font></td><td>" . substr(strrchr($image_row['image_thumb_file'], "."), 1) . "</td>" : "") . "<td>&nbsp;&nbsp;";
            show_text_link("View", "../../details.php?" . URL_IMAGE_ID . "=" . $image_row['image_id'], 1);
            show_text_link($lang['edit'], "../images.php?action=editimage&image_id=" . $image_row['image_id'], 1);
            show_text_link($lang['delete'], "files_check.php?action=removeimage&image_id=" . $image_row['image_id']);
            echo "</td></tr>\n";
            $i++;
        }
        echo "<tr class=\"tablefooter\">\n<td colspan=\"12\" align=\"left\" class=\"tableseparator\">\n&nbsp;";
        echo "<input type=\"submit\" value=\"  " . $lang['delete'] . "   \" class=\"button\">\n&nbsp;&nbsp;&nbsp;";
        echo "</tr></table></td></tr></table><br>";
        show_text_link("Back", "files_check.php");
    } else {
        echo "<p><b>Files Check Complete!<br /><br /> No more errors found.</b><p>\n";
        show_text_link("Back", "files_check.php");
    }
}
show_admin_footer();
Example #3
0
         if (strlen($comment_row['comment_text']) > 75) {
             $comment_row['comment_text'] = substr($comment_row['comment_text'], 0, 75) . "...";
         }
         $show_comment .= format_text($comment_row['comment_text']);
         echo "<td>" . $show_comment . "</td>\n";
         $show_user_name = format_text($comment_row['user_name'], 2);
         if ($comment_row['user_id'] != GUEST && empty($url_show_profile)) {
             $show_user_name = "<a href=\"" . $site_sess->url(ROOT_PATH . "member.php?action=showprofile&" . URL_USER_ID . "=" . $comment_row['user_id']) . "\" target=\"_blank\">{$show_user_name}</a>";
         }
         echo "<td>" . $show_user_name . "</td>\n";
         $show_image = "<a href=\"" . $site_sess->url(ROOT_PATH . "details.php?" . URL_IMAGE_ID . "=" . $comment_row['image_id']) . "\" target=\"_blank\">" . format_text($comment_row['image_name'], 2) . "</a> (ID: " . $comment_row['image_id'] . ")";
         echo "<td>" . $show_image . "</td>\n";
         echo "<td>" . format_date($config['date_format'] . " " . $config['time_format'], $comment_row['comment_date']) . "</td>\n";
         echo "<td><p>";
         show_text_link($lang['edit'], "comments.php?action=editcomment&comment_id=" . $comment_row['comment_id']);
         show_text_link($lang['delete'], "comments.php?action=removecomment&comment_id=" . $comment_row['comment_id']);
         echo "</p></td>\n";
         echo "</tr>\n";
     }
     echo "<tr class=\"tablefooter\">\n<td colspan=\"6\" align=\"left\">\n&nbsp;";
     echo "<input type=\"submit\" value=\"  " . $lang['delete'] . "   \" class=\"button\">\n";
     echo "&nbsp;\n</td>\n</tr>\n</table>\n</td>\n</tr>\n</table>\n</form>\n";
 } else {
     show_description_row($lang['no_search_results'], 6);
     show_form_footer("", "");
 }
 echo "<div align=\"right\">";
 echo "<form action=\"" . $site_sess->url("comments.php") . "\" name=\"form2\" method=\"post\">\n";
 if ($limitnumber != 5000 && $limitfinish < $countcomments['comments']) {
     show_hidden_input("action", "findcomments");
     show_hidden_input("image_id", $image_id);
Example #4
0
    show_form_footer($lang['do_backup'], $lang['reset']);
    show_table_header($lang['list_backups'], 4);
    $handle = opendir(ROOT_PATH . DATABASE_DIR);
    $filelist = array();
    while ($file = @readdir($handle)) {
        if (is_file(ROOT_PATH . DATABASE_DIR . "/" . $file) && $file != "." && $file != ".." && preg_match("/\\.sql/i", $file)) {
            $filelist[] = $file;
        }
    }
    closedir($handle);
    if (!empty($filelist)) {
        rsort($filelist);
        foreach ($filelist as $key => $file) {
            echo "<tr class=\"" . get_row_bg() . "\" width=\"30%\">\n<td><p class=\"rowtitle\">{$file}</p></td>\n";
            $file_time = format_date($config['date_format'] . " " . $config['time_format'], filemtime(ROOT_PATH . DATABASE_DIR . "/" . $file));
            echo "<td>" . $file_time . "</td>";
            $file_size = format_file_size(@filesize(ROOT_PATH . DATABASE_DIR . "/" . $file));
            echo "<td>" . $file_size . "</td>";
            echo "<td>";
            echo "<a href=\"javascript:RestoreBackup('" . $file . "')\">[" . $lang['restore_backup'] . "]</a>&nbsp;&nbsp;";
            echo "<a href=\"javascript:DeleteBackup('" . $file . "')\">[" . $lang['delete_backup'] . "]</a>&nbsp;&nbsp;";
            show_text_link($lang['download_backup'], "backup.php?action=downloadbackup&file={$file}");
            show_text_link($lang['show_backup'], "backup.php?action=showbackup&file={$file}");
            echo "</td></tr>";
        }
    } else {
        show_description_row($lang['no_backups'], 4);
    }
    show_table_footer();
}
show_admin_footer();
Example #5
0
         echo "<td><input type=\"checkbox\" name=\"deleteimages[]\" value=\"" . $image_row['image_id'] . "\" /></td>";
         echo "<td><b><a href=\"" . $site_sess->url(ROOT_PATH . "details.php?" . URL_IMAGE_ID . "=" . $image_row['image_id']) . "\" target=_blank>" . format_text($image_row['image_name'], 2) . "</a></b> (" . $image_row['image_media_file'];
         if (!get_file_path($image_row['image_media_file'], "media", $image_row['cat_id'], 1, 0)) {
             echo " <b class=\"marktext\">!</b>";
         }
         echo ")</td>\n";
         echo "<td><a href=\"" . $site_sess->url(ROOT_PATH . "categories.php?" . URL_CAT_ID . "=" . $image_row['cat_id']) . "\" target=\"_blank\">" . format_text($cat_cache[$image_row['cat_id']]['cat_name'], 2) . "</a></td>\n";
         $show_user_name = format_text($image_row[$user_table_fields['user_name']], 2);
         if ($image_row['user_id'] != GUEST && empty($url_show_profile)) {
             $show_user_name = "<a href=\"" . $site_sess->url(ROOT_PATH . "member.php?action=showprofile&" . URL_USER_ID . "=" . $image_row['user_id']) . "\" target=\"_blank\">{$show_user_name}</a>";
         }
         echo "<td>" . $show_user_name . "</a></td>\n";
         echo "<td>" . format_date($config['date_format'], $image_row['image_date']) . "</td>\n";
         echo "<td><p>";
         show_text_link($lang['edit'], "images.php?action=editimage&image_id=" . $image_row['image_id']);
         show_text_link($lang['delete'], "images.php?action=removeimage&image_id=" . $image_row['image_id']);
         echo "</p></td>\n";
         echo "</tr>\n";
     }
     echo "<tr class=\"tablefooter\">\n<td colspan=\"6\" align=\"left\">\n&nbsp;";
     echo "<input type=\"submit\" value=\"  " . $lang['delete'] . "   \" class=\"button\">\n";
     echo "&nbsp;\n</td>\n</tr>\n</table>\n</td>\n</tr>\n</table>\n</form>\n";
 } else {
     show_description_row($lang['no_search_results'], 6);
     show_form_footer("", "");
 }
 echo "<div align=\"right\">";
 echo "<form action=\"" . $site_sess->url("images.php") . "\" name=\"form2\" method=\"post\">\n";
 //if ($limitnumber != 5000 && $limitfinish < $countimages['images']) {
 show_hidden_input("action", "findimages");
 show_hidden_input("image_id", $image_id);
Example #6
0
    if (!isset($HTTP_POST_VARS['emails']) || empty($HTTP_POST_VARS['emails'])) {
        $error['emails'] = 1;
    }
    if (empty($error)) {
        @set_time_limit(1200);
        include ROOT_PATH . 'includes/email.php';
        $site_email = new Email();
        $site_email->set_to($config['site_email']);
        $site_email->set_subject($subject);
        $site_email->register_vars(array("message" => $message, "site_email" => $config['site_email'], "site_name" => $config['site_name']));
        $site_email->set_body("admin_email", $config['language_dir']);
        $emails = $HTTP_POST_VARS['emails'];
        $site_email->set_bcc($emails);
        echo $site_email->send_email() ? $lang['send_emails_success'] : $lang['send_emails_error'];
        echo "<p>";
        show_text_link($lang['back'], "javascript:history.back(1)");
    } else {
        $msg = sprintf("<span class=\"marktext\">%s</span>", $lang['lostfield_error']);
        $action = "emailusers";
    }
}
if ($action == "emailusers") {
    if ($msg != "") {
        printf("<b>%s</b>\n", $msg);
    }
    show_form_header("email.php", "sendemails");
    show_table_header($lang['send_emails'], 2);
    show_input_row($lang['send_emails_subject'], "subject", "", 45);
    show_textarea_row($lang['send_emails_message'], "message", "", 60, 20);
    $select = "<select name=\"emails[]\" size=\"15\" multiple=\"multiple\">\n";
    $sql = "SELECT " . get_user_table_field("", "user_id") . get_user_table_field(", ", "user_level") . get_user_table_field(", ", "user_name") . get_user_table_field(", ", "user_email") . "\n          FROM " . USERS_TABLE . "\n          WHERE " . get_user_table_field("", "user_id") . " <> " . GUEST . " AND " . get_user_table_field("", "user_allowemails") . " = 1\n          ORDER BY " . get_user_table_field("", "user_level") . " DESC";
Example #7
0
         $show_user_name = format_text($user_row[$user_table_fields['user_name']], 2);
         if ($user_row[$user_table_fields['user_id']] != GUEST && empty($url_show_profile)) {
             $show_user_name = "<a href=\"" . $site_sess->url(ROOT_PATH . "member.php?action=showprofile&" . URL_USER_ID . "=" . $user_row[$user_table_fields['user_id']]) . "\" target=\"_blank\">{$show_user_name}</a>";
         }
         echo "<td><b>" . $show_user_name . "</b></td>\n";
         echo "<td>" . $user_row[$user_table_fields['user_email']] . "</td>\n";
         echo "<td>" . format_date($config['date_format'] . " " . $config['time_format'], $user_row[$user_table_fields['user_joindate']]) . "</td>\n";
         echo "<td>" . format_date($config['date_format'] . " " . $config['time_format'], $user_row[$user_table_fields['user_lastaction']]) . "</td>\n";
         echo "<td><p>";
         if (!defined('USER_INTEGRATION') || defined('USER_INTEGRATION') && USER_INTEGRATION == "none") {
             show_text_link($lang['edit'], "users.php?action=edituser&user_id=" . $user_row[$user_table_fields['user_id']]);
         }
         show_text_link($lang['delete'], "users.php?action=removeuser&user_id=" . $user_row[$user_table_fields['user_id']]);
         echo "&nbsp;&nbsp;";
         show_text_link($lang['permissions'], "usergroups.php?action=editpermissions&user_id=" . $user_row[$user_table_fields['user_id']]);
         show_text_link($lang['nav_usergroups'], "usergroups.php?action=edituser&user_id=" . $user_row[$user_table_fields['user_id']]);
         echo "</p></td>\n";
         echo "</tr>\n";
     }
     echo "<tr class=\"tablefooter\">\n<td colspan=\"6\" align=\"left\">\n&nbsp;";
     echo "<input type=\"submit\" value=\"  " . $lang['delete'] . "   \" class=\"button\">\n";
     echo "&nbsp;\n</td>\n</tr>\n</table>\n</td>\n</tr>\n</table>\n</form>\n";
 } else {
     show_description_row($lang['no_search_results'], 6);
     show_form_footer("", "");
 }
 echo "<div align=\"right\">";
 echo "<form action=\"" . $site_sess->url("users.php") . "\" name=\"form2\" method=\"post\">\n";
 //if ($limitnumber != 5000 && $limitfinish < $countusers['users']) {
 show_hidden_input("action", "findusers");
 show_hidden_input("user_level", $user_level);
Example #8
0
            echo "<tr class=\"" . get_row_bg() . "\">";
            $image_path = is_remote($image_row['image_media_file']) ? $image_row['image_media_file'] : MEDIA_TEMP_PATH . "/" . $image_row['image_media_file'];
            $file_src = get_file_path($image_row['image_media_file'], "media", 0, 1);
            echo "<td><input type=\"radio\" name=\"image_list[" . $image_row['image_id'] . "]\" value=\"1\"></td>";
            echo "<td><input type=\"radio\" name=\"image_list[" . $image_row['image_id'] . "]\" value=\"0\"></td>";
            echo "<td><a href=\"" . $image_path . "\" target=\"_blank\"><img src=\"" . $file_src . "\" border=\"1\" height=\"50\"></a></td>";
            echo "<td><b><a href=\"" . $image_path . "\" target=\"_blank\">" . format_text($image_row['image_name'], 2) . "</a></b> (" . $image_row['image_media_file'];
            if (!get_file_path($image_row['image_media_file'], "media", 0, 0, 0)) {
                echo " <b class=\"marktext\">!</b>";
            }
            echo ")</td>\n";
            echo "<td><a href=\"" . $site_sess->url(ROOT_PATH . "categories.php?" . URL_CAT_ID . "=" . $image_row['cat_id']) . "\" target=\"_blank\">" . format_text($cat_cache[$image_row['cat_id']]['cat_name'], 2) . "</a></td>\n";
            $show_user_name = format_text($image_row[$user_table_fields['user_name']], 2);
            if ($image_row['user_id'] != GUEST && empty($url_show_profile)) {
                $show_user_name = "<a href=\"" . $site_sess->url(ROOT_PATH . "member.php?action=showprofile&" . URL_USER_ID . "=" . $image_row['user_id']) . "\" target=\"_blank\">{$show_user_name}</a>";
            }
            echo "<td>" . $show_user_name . "</td>\n";
            echo "<td>" . format_date($config['date_format'] . " " . $config['time_format'], $image_row['image_date']) . "</td>\n";
            echo "<td><p>";
            show_text_link($lang['edit'], "validateimages.php?action=editimage&image_id=" . $image_row['image_id']);
            echo "</p></td>\n";
            echo "</tr>\n";
        }
        show_form_footer($lang['submit'], $lang['reset'], 8);
    } else {
        $bgcounter = 0;
        show_description_row($lang['no_search_results'], 8);
        show_table_footer();
    }
}
show_admin_footer();
Example #9
0
function show_category_rows($cid = 0, $depth = 1)
{
    global $site_db, $site_sess, $lang, $category_cache, $cat_parent_cache;
    if (!isset($category_cache[$cid])) {
        return false;
    }
    foreach ($category_cache[$cid] as $key => $cats) {
        $class = "tablerow2";
        if ($cats['cat_parent_id'] == 0) {
            $class = "tablerow";
        }
        echo "<tr class=\"{$class}\">\n";
        if (!$GLOBALS['show_all_subcats']) {
            if (!empty($cat_parent_cache[$cats['cat_id']])) {
                $href = $site_sess->url("categories.php?action=modifycats");
                if (isset($GLOBALS['map'][$cats['cat_id']]) || $GLOBALS['open_all']) {
                    $char = $GLOBALS['close_cat_link'];
                    $href .= "&closecat=" . $cats['cat_id'];
                } else {
                    $char = $GLOBALS['open_cat_link'];
                    $href .= "&opencat=" . $cats['cat_id'];
                }
                $char = '<a href="' . $href . '">' . $char . '</a>';
            } else {
                $char = '&nbsp;';
            }
            echo "<td align=\"center\">" . $char . "</td>";
        }
        echo "<td>\n";
        if ($depth > 1) {
            echo str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;", $depth - 1) . "<img src=\"images/folder_path.gif\" alt=\"\">\n";
        }
        echo "<img src=\"" . ROOT_PATH . "admin/images/folder.gif\" alt=\"\"><b><a href=\"" . $site_sess->url(ROOT_PATH . "categories.php?cat_id=" . $cats['cat_id']) . "\" target=\"_blank\">" . format_text($cats['cat_name'], 2) . "</a>\n</b> (ID: " . $cats['cat_id'] . ")&nbsp;&nbsp;&nbsp;&nbsp;";
        show_text_link($lang['edit'], "categories.php?action=editcat&cat_id=" . $cats['cat_id']);
        show_text_link($lang['delete'], "categories.php?action=removecat&cat_id=" . $cats['cat_id']);
        show_text_link($lang['add_subcategory'], "categories.php?action=addcat&cat_parent_id=" . $cats['cat_id']);
        echo "\n</td>\n<td align=\"center\">";
        echo "<a href=\"" . $site_sess->url("categories.php?action=ordercat&move=up&cat_id=" . $cats['cat_id']) . "\"><img src=\"images/arrow_up.gif\" border=\"0\"></a>\n";
        echo "<a href=\"" . $site_sess->url("categories.php?action=ordercat&move=down&cat_id=" . $cats['cat_id']) . "\"><img src=\"images/arrow_down.gif\" border=\"0\"></a>\n";
        echo "</td>\n</tr>\n";
        show_category_rows($cats['cat_id'], $depth + 1);
    }
    unset($category_cache[$cid]);
}
        if ($cat_id) {
            $batchend = $row['image_id'];
        }
        printf($lang_rebuild_image, $row['image_name'], $row['image_id']);
        flush();
        @set_time_limit(90);
        $search_words = array();
        foreach ($search_match_fields as $image_column => $match_column) {
            if (isset($row[$image_column])) {
                $search_words[$image_column] = $row[$image_column];
            }
        }
        remove_searchwords($row['image_id']);
        add_searchwords($row['image_id'], $search_words);
        echo " <b>OK</b><br />\n";
        flush();
    }
    if ($num_rows) {
        $sql = "SELECT cat_id\n            FROM " . IMAGES_TABLE . "\n            WHERE {$cat_filter} AND image_id >= " . ($batchend + 1) . $order;
        $num_rows = $site_db->query_firstrow($sql);
    }
    if ($num_rows) {
        next_step($batchend + 1, $batchsize, $autoredirect);
        show_text_link($lang_rebuild_back, "rebuild_searchindex.php");
    } else {
        echo "<p><b>" . $lang_rebuild_success . "</b><p>\n";
        show_text_link($lang_rebuild_back, "rebuild_searchindex.php");
        $site_sess->set_session_var("rsibatchstart", 0);
    }
}
show_admin_footer();
Example #11
0
    show_form_header("usergroups.php", "updategroup");
    show_hidden_input("group_id", $group_id);
    show_table_header($lang['nav_usergroups'], 2);
    show_input_row($lang['field_usergroup_name'], "group_name", $result['group_name'], $textinput_size);
    show_form_footer($lang['save_changes'], $lang['reset'], 2, $lang['back']);
}
if ($action == "modifygroups") {
    if ($msg != "") {
        printf("<b>%s</b>\n", $msg);
    }
    show_form_header("usergroups.php", "addgroup", "form");
    show_table_header($lang['nav_usergroups'], 2);
    $sql = "SELECT group_id, group_name\n          FROM " . GROUPS_TABLE . "\n          WHERE group_type = " . GROUPTYPE_GROUP . "\n          ORDER BY group_name ASC";
    $result = $site_db->query($sql);
    $found = 0;
    while ($row = $site_db->fetch_array($result)) {
        echo "<tr class=\"" . get_row_bg() . "\"><td><p><b>" . $row['group_name'] . "</b></p></td><td><p>";
        show_text_link($lang['edit'], "usergroups.php?action=editgroup&group_id=" . $row['group_id']);
        show_text_link($lang['delete'], "usergroups.php?action=removegroup&group_id=" . $row['group_id']);
        show_text_link("<b>" . $lang['permissions'] . "</b>", "usergroups.php?action=editpermissions&group_id=" . $row['group_id']);
        echo "</p></td></tr>";
        $found = 1;
    }
    if (!$found) {
        echo "<tr class=\"" . get_row_bg() . "\">\n<td colspan=\"2\">" . $lang['no_search_results'] . "</td></tr>";
    }
    show_table_separator($lang['add_usergroup'], 2);
    show_custom_row("<input type=\"text\" name=\"group_name\" value=\"\" size=\"" . $textinput_size . "\">", "<input type=\"submit\" value=\"" . $lang['add_usergroup'] . "\" class=\"button\">");
    show_table_footer();
}
show_admin_footer();