Thread post, check field
#1
Hi guys,
I have another problem with my new plugin...
I inserted a new field in new thread page, but I don't know how to show errors, this is my code:
$plugins->add_hook("newthread_do_newthread_start", "ticon_do_newthread");
function ticon_do_newthread() {
    global $lang, $post_errors, $ticon;
    $lang->load("ticon");
    if(!empty($_FILES['ticon']['name']) && !empty($_FILES['ticon']['type'])) {
        if($_FILES['ticon']['size'] > 0) {
            $ticon = $_FILES['ticon'];
            $ext = get_extension(my_strtolower($ticon['name']));
            echo $lang->ticon_errtype;
            if(!preg_match("#^(gif|jpg|jpeg|jpe|bmp|png)$#i", $ext))
                $post_errors[] = $lang->ticon_errtype;
        }
    }
}

help Sad
My Projects - Support My Projects

Don't forget to rate posts!
Reply


Messages In This Thread
Thread post, check field - by chack1172 - 2016-07-14, 06:18 PM
RE: Thread post, check field - by Destroy666 - 2016-07-15, 08:07 PM
RE: Thread post, check field - by chack1172 - 2016-07-15, 09:32 PM
RE: Thread post, check field - by Whiteneo - 2016-07-15, 10:44 PM
RE: Thread post, check field - by chack1172 - 2016-07-16, 12:05 PM
RE: Thread post, check field - by Shade - 2016-07-16, 02:31 PM
RE: Thread post, check field - by chack1172 - 2016-07-16, 04:21 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)