1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

1.7 Functions In Submit1 And Edit Token Reset.

Discussion in 'General Troubleshooting' started by narc, Jan 22, 2016.

  1. narc

    narc Well-Known Member

    I have two questions. How can I delete the token when a post has been sent .

    So when I'm on the confirm page , it should no longer be possible to go back and post to edit again .

    the second question , how do I integrate the checking function of ion Submit1 in submit2 . I use submit without step one. so all function check function not
     
  2. narc

    narc Well-Known Member

    and another question. At the moment it is not possible to create posts with the same title . How to Build a feature that automatically attaches the post id to the url , and thus it is possible to create a post with the same title ?
     
  3. valMETNG

    valMETNG Administrator Staff Member Admin

    Function deleteTempData on line 309 of /submit/libs/SubmitFunctions.php, which is called from line 272 every time submit data is saved will delete all tokens from the last 30 minutes. If you want to lower the time, simply change the 30 on line 313 (e.g., changing 30 to 15 will delete everything greater than the last 15 minutes). However, this only executes when someone submits a post. Thus, if no one submits a post for a day, those tokens from the last day will still be available. If you want to delete it immediately after the post is submitted, you'd have to write some custom code and execute it probably somewhere in function doSubmitConfirm within /submit/submit.php (line 303). For example, on line 342 you could probably put something like:
    Code:
    $sql = "DELETE FROM " . TABLE_TEMPDATA . " WHERE tempdata_key = %s";
    $h->db->query($h->db->prepare($sql, $h->vars['submit_key']));
    If I understand your second question properly, you want to execute the checks from submit1 into submit2. I think you might just be able to add what's currently on line 168 of /submit/submit.php:
    Code:
    $this->doSubmit1($h, $funcs);
    ...before line 176 so that line 176 now looks like:
    Code:
    $this->doSubmit1($h, $funcs);
    $this->doSubmit2($h, $funcs);
     
  4. valMETNG

    valMETNG Administrator Staff Member Admin

    I'm not sure if this will work but you can try to change line 680 of submit/libs/SubmitFunctions.php to:
    Code:
    $h->post->url = make_url_friendly($title . $h->post->id);
    You might also be able to comment out lines 551-563 of submit/libs/SubmitFunctions.php so it doesn't do the check at all.
     

Share This Page