Esempio n. 1
0
 }
 if ($member_db[UDB_CBYEMAIL] == 1) {
     $added_by_email = $member_db[UDB_EMAIL];
 } else {
     $added_by_email = "none";
 }
 // avatar check
 if ($manual_avatar) {
     $manual_avatar = check_avatar($manual_avatar);
     if ($manual_avatar == false) {
         $error_messages .= getpart('addnews_err', array(lang('Avatar not uploaded!')));
     }
 }
 // Additional fields ---
 foreach ($cfg['more_fields'] as $i => $v) {
     $pack = edit_option($pack, $i, $_REQUEST[$i]);
 }
 // Preview tool
 $preview_hmtl = false;
 if (isset($preview) && $preview == 'preview') {
     $new[NEW_ID] = time();
     $new[NEW_USER] = $member_db[2];
     $new[NEW_TITLE] = $title;
     $new[NEW_SHORT] = $short_story;
     $new[NEW_FULL] = $full_story;
     $new[NEW_AVATAR] = $manual_avatar;
     $new[NEW_CAT] = $nice_category;
     $new[NEW_MF] = $pack;
     $new[NEW_OPT] = $options;
     $preview_hmtl = getpart('addnews_preview', array(lang('Preview active news'), template_replacer_news($new, $template_active)));
     $preview_hmtl .= getpart('addnews_preview', array(lang('Preview full story'), template_replacer_news($new, $template_full)));
Esempio n. 2
0
            // Update information for Element
            //if ($action == "updat") { header("Refresh: 3; main.php?id=".$element_id); }
        // Update information for Element
        //if ($action == "updat") { header("Refresh: 3; main.php?id=".$element_id); }
        case "edit":
            // Edit Element
        // Edit Element
        case "delet":
            // Delete the Element
        // Delete the Element
        case "add":
            // Add new Element
            if ($_SESSION['ticket_user_is_admin'] > 0) {
                print "<!-- " . $action . "ing the selected Element -->";
                // edit_option($id,$action,$page,$GLOBALS['OPTION'], $element_id="")
                edit_option($id, $action, $page, $element_id);
            } else {
                do_title(ucfirst($action) . "ing " . $title . " " . $temp_trailing);
                print '<p class="severity_high">You are not allowed to Add nor Modify existing information';
            }
            break;
        case '':
            // Show entry
            print "<!-- Showing the selected Element -->";
            //  function show_action_data($id,$table,$start_id=0)
            $i = show_action_data($id, $GLOBALS['OPTION_TABLE'], $title, $start_id, $GLOBALS['MAIN_PAGE']);
            break;
    }
}
powered();
// Print "Powered by" and end the HTML page
Esempio n. 3
0
        // Close Element
        case "closeupdat":
            if ($_SESSION['ticket_user_is_admin'] > 0) {
                print "<!-- Closing the selected Element -->";
                close_element($id, $action, $GLOBALS['MAIN_TABLE']);
                //,$page);
            } else {
                do_title(ucfirst($action) . "ing " . $GLOBALS['ELEMENT'] . " ");
                // . $temp_trailing);
                print '<p class="severity_high">You are not allowed to Add nor Modify existing information';
            }
            break;
        case '':
            // Show entry
            print "<!-- Showing the selected Element -->";
            require_once 'functions03.inc';
            $i = show_data($id, $GLOBALS['MAIN_TABLE'], $title, $page, $start_id);
            // List Option from current Element
            $SQL_option = " AND `{$linking_field}` = {$id} ";
            mysql_open("{$mysql_db}", "{$mysql_user}", "{$mysql_passwd}");
            edit_option("", "add", $id);
            mysql_open_next("{$mysql_db_next}", "{$mysql_user_next}", "{$mysql_passwd_next}");
            do_title($GLOBALS['OPTION'] . "s belonging to this " . $GLOBALS['ELEMENT'] . ". Click on date to edit action", 0);
            // Do not generate HTML headers (the "0")
            list_option($SQL_option);
            break;
    }
}
powered();
// Print "Powered by" and end the HTML page
die;
Esempio n. 4
0
     fwrite($new_db, $old_db_line);
 } else {
     $have_perm = 0;
     if ($member_db[UDB_ACL] == ACL_LEVEL_ADMIN or $member_db[UDB_ACL] == ACL_LEVEL_EDITOR) {
         $have_perm = 1;
     } elseif ($member_db[UDB_ACL] == ACL_LEVEL_JOURNALIST and $old_db_arr[NEW_USER] == $member_db[UDB_NAME]) {
         $have_perm = 1;
     }
     if ($have_perm) {
         if ($ifdelete != "yes") {
             // If save as postponed news
             $id = $source == "postponed" ? mktime($from_date_hour, $from_date_minutes, 0, $from_date_month, $from_date_day, $from_date_year) + $config_date_adjust * 60 : $old_db_arr[NEW_ID];
             $old_db_arr[NEW_ID] = $id;
             // Only for editor without wysiwyg
             if ($config_use_wysiwyg == 'no') {
                 $old_db_arr[NEW_OPT] = edit_option($old_db_arr[NEW_OPT], 'use_html', $if_use_html == 'yes' ? 1 : 0);
             } else {
                 $old_db_arr[NEW_OPT] = str_replace("\n", "", $old_db_arr[NEW_OPT]);
             }
             fwrite($new_db, "{$old_db_arr['0']}|{$old_db_arr['1']}|{$title}|{$short_story}|{$full_story}|{$editavatar}|{$nice_category}|{$old_db_arr['7']}|{$more}|{$old_db_arr['9']}|\n");
             $okchanges = true;
         } else {
             $okdeleted = true;
             // For postponed don't delete comment: it not exists
             if ($source != 'postponed') {
                 $all_file = file($com_file);
                 $new_com = fopen($com_file, "w");
                 foreach ($all_file as $line) {
                     $line_arr = explode("|>|", $line);
                     if ($line_arr[0] == $id) {
                         $okdelcom = true;