Example #1
0
/**
 * Wrapper to edit an item. Does not return.
 *
 * @param  MEMBER		The member performing the action
 * @param  string		The name of the item
 * @param  string		The old name for the item
 * @param  BINARY		Whether the item may be used for bribes
 * @param  BINARY		Whether the item may be used to provide a health boost
 * @param  URLPATH	The picture of the item
 * @param  MEMBER		The owner of the item
 * @param  integer	The maximum number of these items a player may have
 * @param  BINARY		Whether the item may be replicated via a new item copy source
 * @param  string		Description for the item
 */
function edit_item_wrap($member_id, $original_name, $name, $bribable, $healthy, $picture_url, $new_owner, $max_per_player, $replicateable, $description)
{
    if ($name == '') {
        ocw_refresh_with_message(do_lang_tempcode('W_MISSING_NAME'), 'warn');
    }
    if (!has_specific_permission($member_id, 'administer_ocworld') && $GLOBALS['SITE_DB']->query_value('w_itemdef', 'owner', array('name' => $original_name)) != $member_id) {
        ocw_refresh_with_message(do_lang_tempcode('ACCESS_DENIED__I_ERROR', $GLOBALS['FORUM_DRIVER']->get_username(get_member())), 'warn');
    }
    if ($healthy != 1) {
        $healthy = 0;
    }
    if ($bribable != 1) {
        $bribable = 0;
    }
    if ($replicateable != 1) {
        $replicateable = 0;
    }
    if (!($max_per_player > 0)) {
        $max_per_player = 0;
    }
    edit_item($name, $original_name, $bribable, $healthy, $picture_url, $new_owner, $max_per_player, $replicateable, $description);
    ocw_refresh_with_message(do_lang_tempcode('SUCCESS'));
}
Example #2
0
    //Loeschen von verlinkten Dateien im wirklich-ernst Mode
    if ($open_cmd == 'rl') {
        if (delete_link($open_id))
            $msg.="msg§" . _("Die Verlinkung wurde gelöscht") . "§";
        else
            $msg.="error§" . _("Die Verlinkung konnte nicht gelöscht werden") . "§";
    }

    //wurde Code fuer Aendern des Namens und der Beschreibung von Ordnern oder Dokumenten ubermittelt (=id+"_c_"), wird entsprechende Funktion aufgerufen
    if ($open_cmd ==  'c') {
        $change=$open_id;
    }

    //wurde Code fuer Speichern von Aenderungen uebermittelt (=id+"_sc_"), wird entsprechende Funktion aufgerufen
    if ($open_cmd == 'sc' && (!Request::submitted("cancel"))) {
        edit_item($open_id, Request::int('type'), Request::get('change_name'), Request::get('change_description'), Request::int('change_protected', 0));
    }

    //wurde Code fuer Verschieben-Vorwaehlen uebermittelt (=id+"_m_"), wird entsprechende Funktion aufgerufen
    if ($open_cmd == 'm' && (!Request::submitted("cancel"))) {
        $folder_system_data["move"]=$open_id;
        $folder_system_data["mode"]='move';
    }

    //wurde Code fuer Hoch-Schieben einer Datei (=id+"_mfu_") in der Darstellungsreihenfolge ausgewählt?
    if (($open_cmd == 'mfu') && !Request::submitted('cancel')) {
        $query = "SELECT range_id FROM dokumente WHERE dokument_id = ?";
        $statement = DBManager::get()->prepare($query);
        $statement->execute(array($open_id));
        $temp_id = $statement->fetchColumn();
Example #3
0
function link_item ($range_id, $create = FALSE, $echo = FALSE, $refresh = FALSE, $link_update = FALSE) {
    global $filesize;

    if ($create) {
        $link_data = parse_link(Request::get('the_link'));
        if ($link_data["HTTP/1.0 200 OK"] || $link_data["HTTP/1.1 200 OK"] || $link_data["HTTP/1.1 302 Found"] || $link_data["HTTP/1.0 302 Found"]) {
            if (!$link_update) {
                if (insert_link_db($range_id, $link_data["Content-Length"], $refresh)) {
                    if ($refresh) {
                        delete_link($refresh, TRUE);
                    }
                }
                $tmp = TRUE;
            } else {
                $filesize = $link_data["Content-Length"];
                edit_item(
                    $link_update,
                    FALSE,
                    Request::get('name'),
                    Request::get('description'),
                    Request::int('protect'),
                    Request::get('the_link'),
                    $filesize
                );
                $tmp = TRUE;
            }
        } else {
            $tmp = FALSE;

        }
        return $tmp;

    } else {
        if ($echo) {
            echo link_form($refresh,$link_update);
            return;
        } else {
            return link_form($refresh,$link_update);
        }
    }
}
Example #4
0
     // $_GET['id'] is the id of an item that already has a 'checked_out_to' value assigned.
     // This function will decrement the QTY of this item, and increment the QTY of the parent item (who's ID is stored in the 'item_source' field
     // If this item's QTY becomes 0, the item will be destroyed from the inventory
     check_in_bulk($_GET['id']);
     $get_inv_result = get_inv();
     display_inv($get_inv_result, $php_self);
     break;
 case "check_out_bulk":
     // $_GET['id'] is the id of an item that already has a 'checked_out_to' value assigned.
     // This function will increment the QTY of this item, and decrement the QTY of the parent item (who's ID is stored in the 'item_source' field
     check_out_bulk($_GET['id']);
     $get_inv_result = get_inv();
     display_inv($get_inv_result, $php_self);
     break;
 case "edit_item":
     if ($_POST['status'] == "update" && edit_item()) {
         $get_inv_result = get_inv();
         display_inv($get_inv_result, $php_self);
     } else {
         edit_item_form($_GET['id'], $php_self);
     }
     break;
 case "personal_gear_list":
     personal_gear_list($_GET['id'], $php_self);
     break;
 case "restock_list":
     $restock_result = get_restock_list();
     display_inv($restock_result, $php_self);
     break;
 case "get_inv":
 default: