Example #1
0
function validate_recpr_link($value, $empty, &$params, &$form)
{
    global $tpl;
    if ($empty && empty($value)) {
        return 1;
    }
    $ret = check_recpr_link($form);
    if (empty($ret) || $ret == 0) {
        return 0;
    }
    return 1;
}
     $data = array();
     $data['ID'] = $id;
     $val['VALID'] = $data['VALID'] = $valid;
     $data['LAST_CHECKED'] = gmdate('Y-m-d H:i:s');
     if ($valid == 0 && (in_array(1, $IL) && $val['STATUS'] == 1 || in_array(2, $IL) && $val['STATUS'] == 2)) {
         $data['STATUS'] = 0;
     }
     if ($valid == 2 && (in_array(0, $AL) && $val['STATUS'] == 0 || in_array(1, $AL) && $val['STATUS'] == 1)) {
         $data['STATUS'] = 2;
     }
     $db->Replace($tables['link']['name'], $data, 'ID', true);
     $tpl->assign('link_valid', $valid);
     $tpl->assign('errstr', $errstr);
 }
 if ($VALIDATE_RECPR) {
     $recpr_valid = check_recpr_link($val);
     $data = array();
     $data['ID'] = $id;
     $data['RECPR_VALID'] = $recpr_valid > 0 ? 2 : 0;
     $data['RECPR_LAST_CHECKED'] = gmdate('Y-m-d H:i:s');
     if ($val['RECPR_REQUIRED'] && $recpr_valid < 1 && (in_array(1, $IR) && $val['STATUS'] == 1 || in_array(2, $IR) && $val['STATUS'] == 2)) {
         $data['STATUS'] = 0;
     }
     if ($val['VALID'] > 0 && $recpr_valid > 0 && (in_array(0, $AR) && $val['STATUS'] == 0 || in_array(1, $AR) && $val['STATUS'] == 1)) {
         $data['STATUS'] = 2;
     }
     $db->Replace($tables['link']['name'], $data, 'ID', true);
     $tpl->assign('recpr_valid', $val['RECPR_URL'] ? $recpr_valid : -2);
 }
 // Progress bar update BEGIN
 $percent_now = round($i * $percent_per_loop);