} else {
                                 $q = "INSERT into " . $table_prefix . "dates (event_id, date) values (" . $_REQUEST["id"] . ", DATE_ADD('" . $start_date . "', INTERVAL " . $next . " DAY))";
                             }
                             $query = mysql_query($q);
                             if (!$query) {
                                 $msg .= "Database Error : " . $q;
                             }
                             $juno++;
                         }
                     }
                 }
             }
         }
         if ($_POST["notify"]) {
             include "includes/notify.php";
             notify_group($_POST["id"]);
         }
         $msg .= $lang["event_updated"];
         if ($_REQUEST["size"] != "small") {
             mysql_close($link);
             header("Location: " . $path . "index.php?msg=" . $msg);
         } else {
             $javascript .= "\n<script language=\"JavaScript\" type=\"text/javascript\">\n<!--\nopener.location.reload(true);\nself.close();\n// -->\n</script>\n";
         }
     }
 }
 include "includes/header.php";
 $scategory = $_POST["category"] ? $_POST["category"] : $c;
 $sgroup = $_POST["group"] ? $_POST["group"] : $w;
 if ($msg) {
     echo "<p class=\"warning\">" . $msg . "</p>\n";
                                } else {
                                    $q = "INSERT into " . $table_prefix . "dates (event_id, date) values (" . $event_id . ", DATE_ADD('" . $start_date . "', INTERVAL " . $next . " DAY))";
                                }
                                $query = mysql_query($q);
                                if (!$query) {
                                    $msg .= "Database Error : " . $q;
                                }
                                $juno++;
                            }
                        }
                    }
                }
            }
            if ($_POST["notify"]) {
                include "includes/notify.php";
                notify_group($event_id);
            }
            $msg .= $lang["event_added"];
            unset($_POST);
            $javascript .= "\n<script language=\"JavaScript\" type=\"text/javascript\">\n<!--\nopener.location.reload(true);\n// -->\n</script>\n";
        }
    }
    include "includes/header.php";
    $scategory = $_POST["category"] ? $_POST["category"] : $c;
    $sgroup = $_POST["group"] ? $_POST["group"] : $w;
    ?>

<form action="add_event.php" id="event" name="event" method="post">
<?php 
    include "includes/hidden_fields.php";
    ?>
function approve($event_id)
{
    global $table_prefix, $lang, $edit_groups, $link;
    if (!$edit_groups) {
        $q = "select moderate from " . $table_prefix . "groups_to_events where event_id = " . $event_id . " and user_id = " . $_SESSION["user_id"] . "";
        $query = mysql_query($q);
        if (mysql_num_rows($query) > 0) {
            $mod = mysql_result($query, 0, 0);
            if ($mod > 2) {
                $moderate = true;
            }
        } else {
            $moderate = false;
        }
    } else {
        $moderate = true;
    }
    if ($moderate) {
        $sq = "update " . $table_prefix . "events set status_id = 4, quick_approve = NULL where event_id = '" . $event_id . "'";
        $squery = mysql_query($sq);
        if ($squery) {
            $msg = $lang["event_updated"];
            include "includes/notify.php";
            notify_group($event_id);
        } else {
            $msg = "Database Error: {$sq}";
        }
    } else {
        $msg = $lang["not_authorized_approve"];
    }
    header("Location: index.php?msg=" . $msg . "&" . $common_get);
}
Beispiel #4
0
function approve($code)
{
    global $table_prefix, $lang, $link;
    if (get_magic_quotes_gpc()) {
        $code = mysql_real_escape_string(stripslashes($code));
    } else {
        $code = mysql_real_escape_string($code);
    }
    $q = "select event_id from " . $table_prefix . "events where quick_approve = '" . $code . "'";
    $query = mysql_query($q);
    if (mysql_num_rows($query) > 0) {
        $sq = "update " . $table_prefix . "events set status_id = 4, quick_approve = NULL where quick_approve = '" . $code . "'";
        $squery = mysql_query($sq);
        if ($squery) {
            $msg = $lang["event_updated"];
            $event_id = mysql_result($query, 0, 0);
            include "includes/notify.php";
            notify_group($event_id);
        }
    } else {
        $msg = $lang["event_not_found"];
    }
    header("Location: index.php?msg=" . $msg);
}