pH reading and controlling with peristaltic pumps (2)

Hello forum, thanks for any help with my current issue.

I have a pH probe set up to print readings at a time interval using millis (first millis-timed event), however, when I try to time the action of the pumps using millis (second millis timed event), they do not turn on. The pump code works if I am not using millis timing on it, but I only would like it to run for 3 second duration and once/twice a day if needed. Can you place if/elseif/else code within an "if" statement that is used to turn on the pumps if the pH of my solution is outside my parameters?

Here is my code, any other help with it would also be great. This is my first project with arduino IDE, so I have learned a lot, but know that I have a lot to learn. I plan on setting up with Blynk when I get the action of the pumps figured out without using too much blocking code.

<

// define sensors and pumps here
#include <DallasTemperature.h>
#include <Blynk.h>
#include <ESP8266WiFi.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <OneWire.h>

#define BaseUp D5
#define AcidDown D6
#define Temp D3
#define ONE_WIRE_BUS D3

LiquidCrystal_I2C lcd(0x3F, 16, 2);
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

float calibration = 22; //change this value to calibrate
const int analogInPin = A0;
int sensorValue = 0;
unsigned long int avgValue;
float b;
int buf[10],temp;
int phValue;

// two independant timed events
const unsigned long pHTempRead = 10000; //pH read interval
const unsigned long pHAdjust = 17300; //pump interval

unsigned long previousTime_1 = 0;
unsigned long previousTime_2 = 0;

void setup() {
Serial.begin(9600);

sensors.begin();

pinMode (AcidDown, OUTPUT);
pinMode (BaseUp, OUTPUT);
pinMode (A0, INPUT);
pinMode (Temp, INPUT);

//Use predefined PINS, SCL is D1
Wire.begin(D2, D1);

lcd.begin(16,2);
lcd.backlight();
lcd.home();

}

void loop() {

unsigned long currentTime = millis();

// event 1 pH and Temp Read
if(currentTime - previousTime_1 >= pHTempRead){

for(int i=0;i<10;i++)
{
buf*=analogRead(analogInPin);*
delay(50);
}
for(int i=0;i<9;i++)
{
for(int j=i+1;j<10;j++)
{
if(buf*>buf[j])*
{
temp=buf*;*
buf*=buf[j];*
buf[j]=temp;
}
}
}
avgValue=0;
for(int i=2;i<8;i++)
avgValue+=buf*;*
float pHVol=(float)avgValue*3.3/1024/6;
float phValue = -5.70 * pHVol + calibration;

* sensors.requestTemperatures();*
* lcd.backlight();*
* Serial.print(" pH: ");*
* Serial.println(phValue);*
* Serial.print("Temp: ");*
* Serial.println(sensors.getTempCByIndex(0));*
* lcd.clear();*
* lcd.print("pH: ");*
* lcd.print(phValue);*
* lcd.setCursor(0,1);*
* lcd.print("Temp(C): ");*
* lcd.print(sensors.getTempCByIndex(0));*
* previousTime_1 = currentTime;
_ }_
if(currentTime - previousTime_2 >= pHAdjust){
_ if (phValue > 0 && phValue < 5.39)
{digitalWrite(BaseUp, LOW); digitalWrite(AcidDown, HIGH); delay(3000);}*_

else if (phValue < 14 && phValue > 6.49) {digitalWrite (AcidDown, LOW);
digitalWrite(BaseUp, HIGH); delay(3000); }
else
{digitalWrite (AcidDown, HIGH); digitalWrite(BaseUp, HIGH);}
* previousTime_2 = currentTime;
_ }}
>*_

Before trying to decipher that code, please help us out: read the sticky which explains how to format your code and what other information we could possibly need (how about a complete wiring diagram of your setup?), and then before posting do format your code properly (use the autoformat function of the IDE). Things like missing indentation and two } on one line are not helping readability, nor do italics in your code.