function nofile($update_id)
{
    global $settings;
    deleteupdatedfile($update_id);
    $tempdate = date('Y-m-d H:i:s');
    //big question: are we just updating or creating a new file?
    if (!$update_id) {
        //insert a new row to the database and fill it with some nice data
        $dosql = "INSERT INTO {$GLOBALS['prefix']}lb_postings\n         (author_id, title, posted, filelocal, status)\n         VALUES\n         (\n         '{$_SESSION['authorid']}',\n         'New Posting',\n         '" . date('Y-m-d H:i:s') . "',\n         '0',\n         '1'\n         );";
        $result = mysql_query($dosql) or die(mysql_error());
        //if the parser gets until here, all should be good
        echo "<p class=\"msg\">Posting without audio was created successfully!</p>";
    } else {
        //update an existing row in the database
        $dosql = "UPDATE {$GLOBALS['prefix']}lb_postings SET\n\n         author_id = '{$_SESSION['authorid']}',\n         posted   = '{$tempdate}',\n         filelocal = '0',  \n         audio_file= '',\n         audio_size= '',\n         audio_length= '',\n         audio_type= '0' \n         \n         WHERE id = '{$update_id}';";
        $result = mysql_query($dosql) or die(mysql_error());
    }
    //get id for editing data after finishing this function
    $dosql = "SELECT id FROM {$GLOBALS['prefix']}lb_postings \n          WHERE posted='" . $tempdate . "';";
    $result = mysql_query($dosql) or die(mysql_error());
    $row = mysql_fetch_assoc($result);
    return $row['id'];
}
Example #2
0
function nofile($update_id)
{
    global $settings;
    deleteupdatedfile($update_id);
    $tempdate = date('Y-m-d H:i:s');
    //big question: are we just updating or creating a new file?
    if (!$update_id) {
        //insert a new row to the database and fill it with some nice data
        $dosql = "INSERT INTO {$GLOBALS['prefix']}lb_postings\n         (author_id, title, posted, filelocal, status, \n         countweb, countfla, countpod, countall)\n         VALUES\n         (\n         '{$_SESSION['authorid']}',\n         'New Posting',\n         '" . date('Y-m-d H:i:s') . "',\n         '0',\n         '1','0','0','0','0'\n         )";
        $GLOBALS['lbdata']->Execute($dosql);
        //if the parser gets until here, all should be good
        echo "<p class=\"msg\">" . bla("msg_plainsuccess") . "</p>";
    } else {
        //update an existing row in the database
        $dosql = "UPDATE {$GLOBALS['prefix']}lb_postings SET\n\n         author_id = '{$_SESSION['authorid']}',\n         filelocal = '0',  \n         audio_file= '',\n         audio_size= '',\n         audio_length= '',\n         audio_type= '0' \n         \n         WHERE id = '{$update_id}'";
        $GLOBALS['lbdata']->Execute($dosql);
    }
    //get id for editing data after finishing this function
    $dosql = "SELECT id FROM {$GLOBALS['prefix']}lb_postings \n          WHERE posted='" . $tempdate . "'";
    $row = $GLOBALS['lbdata']->GetArray($dosql);
    return $row[0]['id'];
}