break; case 1: default: continue; break; } // Page Display switch ($STEP) { case 2: if ($NOTICE) { echo display_notice(); } if ($SUCCESS) { echo display_success(); if (COMMUNITY_NOTIFICATIONS_ACTIVE) { community_notify($COMMUNITY_ID, $TOPIC_ID, "post", COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=view-post&id=" . $TOPIC_ID, $RECORD_ID, $PROCESSED["release_date"]); } } break; case 1: default: if ($ERROR) { echo display_error(); } if ($NOTICE) { echo display_notice(); } ?> <form action="<?php echo COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL; ?>
$community_details = $db->GetRow($query); if ($community_details) { $query = "\n\t\t\t\tSELECT * FROM `community_members`\n\t\t\t\tWHERE `community_id` = " . $db->qstr($COMMUNITY_ID) . "\n\t\t\t\tAND `proxy_id` = " . $db->qstr($ENTRADA_USER->getActiveId()); $result = $db->GetRow($query); if ($result) { if ((int) $result["member_active"]) { switch ($STEP) { case 2: $query = "DELETE FROM `community_members` WHERE `community_id` = " . $db->qstr($COMMUNITY_ID) . " AND `proxy_id` = " . $db->qstr($ENTRADA_USER->getActiveId()) . " AND `member_active` = '1' LIMIT 1"; if ($db->Execute($query)) { if ($MAILING_LISTS["active"]) { $mail_list = new MailingList($COMMUNITY_ID); $mail_list->remove_member($result["proxy_id"]); } if (COMMUNITY_NOTIFICATIONS_ACTIVE) { community_notify($COMMUNITY_ID, $ENTRADA_USER->getActiveId(), "leave", ENTRADA_URL . "/people?id=" . $ENTRADA_USER->getActiveId(), $COMMUNITY_ID); } application_log("success", "Removed proxy_id [" . $ENTRADA_USER->getActiveId() . "] from community_id [" . $COMMUNITY_ID . "]."); } else { application_log("error", "Unable to remove proxy_id [" . $ENTRADA_USER->getActiveId() . "] from community_id [" . $COMMUNITY_ID . "]. Database said: " . $db->ErrorMsg()); } if ($_SESSION['details']['group'] == 'guest') { $query = "SELECT COUNT(*) AS total FROM `community_members`\n\t\t\t\t\t\t\t\t\tWHERE `community_members`.`proxy_id` = {$result['ID']} AND `community_members`.`member_active` = 1"; $community_result = $db->GetRow($query); if (!isset($community_result) || $community_result['total'] == 0) { header("Location: " . ENTRADA_URL . "?action=logout"); } } else { header("Location: " . ENTRADA_URL . "/communities"); } exit;
break; case 1: default: $PROCESSED = $file_record; break; } // Page Display switch ($STEP) { case 2: if ($NOTICE) { echo display_notice(); } if ($SUCCESS) { echo display_success(); if (COMMUNITY_NOTIFICATIONS_ACTIVE) { community_notify($COMMUNITY_ID, $RECORD_ID, "file-revision", COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=view-file&id=" . $RECORD_ID, $RECORD_ID); } } break; case 1: default: if ($ERROR) { echo display_error(); } if ($NOTICE) { echo display_notice(); } ?> <form id="upload-file-form" action="<?php echo COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL; ?>
$PROCESSED["updated_date"] = time(); $PROCESSED["updated_by"] = $ENTRADA_USER->getID(); if ($db->AutoExecute("community_gallery_photos", $PROCESSED, "INSERT")) { $photo_id = $db->Insert_Id(); if (COMMUNITY_NOTIFICATIONS_ACTIVE && $_SESSION["details"]["notifications"]) { $db->Execute("INSERT INTO `community_notify_members` (`proxy_id`, `record_id`, `community_id`, `notify_type`, `notify_active`) VALUES (" . $db->qstr($ENTRADA_USER->getID()) . ", " . $db->qstr($photo_id) . ", " . $db->qstr($COMMUNITY_ID) . ", 'photo-comment', '" . (isset($notifications) && $notifications ? "1" : "0") . "')"); } if ($photo_id) { if (communities_galleries_process_photo($_FILES["photo_files"]["tmp_name"][$tmp_photo_id], $photo_id)) { if (!(int) $gallery_record["gallery_cgphoto_id"]) { if (!$db->AutoExecute("community_galleries", array("gallery_cgphoto_id" => $photo_id), "UPDATE", "`cgallery_id` = " . $db->qstr($RECORD_ID) . " AND `community_id` = " . $db->qstr($COMMUNITY_ID))) { application_log("error", "Unable to set the gallery_cgphoto_id to this photo_id when adding the first picture. Database said: " . $db->ErrorMsg()); } } if (COMMUNITY_NOTIFICATIONS_ACTIVE) { community_notify($COMMUNITY_ID, $photo_id, "photo", COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=view-photo&id=" . $photo_id, $RECORD_ID, $PROCESSED["release_date"]); } $SUCCESS++; $SUCCESSSTR[] = "Photo " . $photo_number . " has been successfully uploaded [" . $PROCESSED["photo_title"] . "]."; add_statistic("community:" . $COMMUNITY_ID . ":galleries", "photo_add", "cgphoto_id", $photo_id); communities_log_history($COMMUNITY_ID, $PAGE_ID, $photo_id, "community_history_add_photo", 1, $RECORD_ID); } else { $query = "DELETE FROM `community_gallery_photos` WHERE `cgphoto_id` = " . $db->qstr($photo_id) . " AND `cgallery_id` = " . $db->qstr($RECORD_ID) . " AND `community_id` = " . $db->qstr($COMMUNITY_ID) . " LIMIT 1"; if (!$db->Execute($query)) { application_log("error", "Failed to remove a newly uploaded photo [" . $photo_id . "] from the community_gallery_photos table in community [" . $COMMUNITY_ID . "]. Database said: " . $db->ErrorMsg()); } $error_current++; $ERROR++; $ERRORSTR[] = "Photo " . $photo_number . ": Unable to store the new photo file on the server; the system administrator has been informed of this error, please try again later."; application_log("error", "Failed to move the uploaded Community photo to the storage directory [" . COMMUNITY_STORAGE_GALLERIES . "/" . $photo_id . "]."); }
break; case 1: default: continue; break; } // Page Display switch ($STEP) { case 2: if ($NOTICE) { echo display_notice(); } if ($SUCCESS) { echo display_success(); if (COMMUNITY_NOTIFICATIONS_ACTIVE) { community_notify($COMMUNITY_ID, $FILE_ID, "file", COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=view-file&id=" . $FILE_ID, $RECORD_ID, $PROCESSES["release_date"]); } } break; case 1: default: if ($ERROR) { echo display_error(); } if ($NOTICE) { echo display_notice(); } ?> <form id="upload-file-form" action="<?php
break; case 1: default: continue; break; } // Page Display switch ($STEP) { case 2: if ($NOTICE) { echo display_notice(); } if ($SUCCESS) { echo display_success(); if (COMMUNITY_NOTIFICATIONS_ACTIVE) { community_notify($COMMUNITY_ID, $TOPIC_ID, "reply", COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=view-post&id=" . $RECORD_ID, $RECORD_ID); } } break; case 1: default: if ($ERROR) { echo display_error(); } if ($NOTICE) { echo display_notice(); } ?> <form action="<?php echo COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL; ?>
break; case 1: default: continue; break; } // Page Display switch ($STEP) { case 2: if ($NOTICE) { echo display_notice(); } if ($SUCCESS) { echo display_success(); if (COMMUNITY_NOTIFICATIONS_ACTIVE && isset($_POST["notify_members"]) && $_POST["notify_members"]) { community_notify($COMMUNITY_ID, $ANNOUNCEMENT_ID, "announcement", COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?id=" . $ANNOUNCEMENT_ID, $COMMUNITY_ID, $PROCESSED["release_date"]); } } break; case 1: default: if ($ERROR) { echo display_error(); } if ($NOTICE) { echo display_notice(); } ?> <form action="<?php echo COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL; ?>
} break; case 1: default: continue; break; } // Page Display switch ($STEP) { case 2: if ($NOTICE) { echo display_notice(); } if ($SUCCESS) { if (COMMUNITY_NOTIFICATIONS_ACTIVE && isset($_POST["notify_members"]) && $_POST["notify_members"]) { community_notify($COMMUNITY_ID, $POLL_ID, "poll", COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=vote-poll&id=" . $POLL_ID, $COMMUNITY_ID, $PROCESSED["release_date"]); } echo display_success(); } break; case 1: default: if ($ERROR) { echo display_error(); } if ($NOTICE) { echo display_notice(); } $HEAD[] = "<script type=\"text/javascript\" src=\"" . ENTRADA_URL . "/javascript/selectchained.js\"></script>\n"; $HEAD[] = "<script type=\"text/javascript\" src=\"" . ENTRADA_URL . "/javascript/picklist.js\"></script>\n"; $ONLOAD[] = 'Sortable.create(\'poll_responses\', {onUpdate: updateDatabase})';
continue; break; } // Page Display switch ($STEP) { case 2: if ($NOTICE) { echo display_notice(); } if ($SUCCESS) { echo display_success(); if (COMMUNITY_NOTIFICATIONS_ACTIVE && (isset($_POST["notify_members"]) && $_POST["notify_members"]) && (!$PAGE_OPTIONS["moderate_posts"] || $COMMUNITY_ADMIN)) { community_notify($COMMUNITY_ID, $EVENT_ID, "event", COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?id=" . $EVENT_ID, $COMMUNITY_ID, $PROCESSED["release_date"]); } if (COMMUNITY_NOTIFICATIONS_ACTIVE && ($PAGE_OPTIONS["moderate_posts"] && !$COMMUNITY_ADMIN)) { community_notify($COMMUNITY_ID, $EVENT_ID, "event-moderation", COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?id=" . $EVENT_ID, $COMMUNITY_ID, $PROCESSED["release_date"]); } } break; case 1: default: if ($ERROR) { echo display_error(); } if ($NOTICE) { echo display_notice(); } ?> <form action="<?php echo COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL; ?>
break; case 1: default: continue; break; } // Page Display switch ($STEP) { case 2: if ($NOTICE) { echo display_notice(); } if ($SUCCESS) { echo display_success(); if (COMMUNITY_NOTIFICATIONS_ACTIVE) { community_notify($COMMUNITY_ID, $RECORD_ID, "photo-comment", COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL . "?section=view-photo&id=" . $RECORD_ID, $RECORD_ID); } } break; case 1: default: if ($ERROR) { echo display_error(); } if ($NOTICE) { echo display_notice(); } ?> <form action="<?php echo COMMUNITY_URL . $COMMUNITY_URL . ":" . $PAGE_URL; ?>