problem with arduino uno r3 cide

Hi everybody!
i’m doing a little sketch to command an alternatig one-way trafficlight but when i try to check it out
it give my some error can you please help me to understand what is wrong?
that is the code

(CODE TAGS please, use the </ button in the menu. Thanks, Moderator)

long t=0;
void setup(){
digitalWrite(8,INPUT);
for(int i=2;i<8;i++)
digitalWrite(i,OUTPUT);
}

void loop()
{
 int r1=2,r2=5,g1=3,g2=6,v1=4,v2=7,t=millis();
 accendi(r1,v2,t);
 accendi(r1,g2,t);
 accendi(v1,r2,t);
 accendi(g1,r2,t);
}
void accendi(int led1,int led2,int &t)
{
 long i=millis();
 i=i-t;
 int n=5000;
 digitalWrite(led1,HIGH);
 digitalWrite(led2,HIGH);
 while(i<n)
 {
  i=millis();
  i=i-t;
  if(digitalRead(8)==HIGH)
   while(digitalRead(8)!=HIGH)
   {
    digitalWrite(led1,LOW);
    digitalWrite(led2,LOW);
    digitalWrite(r1,HIGH);
    digitalWrite(r2,HIGH);
   }
 }
 digitalWrite(led1,LOW);
 digitalWrite(led2,LOW);
 t=millis();
}

In setup(), don't you mean to use pinMode to set the pins to INPUT or OUTPUT?

As for the error, please post the entire error message(s).

Lot of syntax errors:
digitalWrite(8,INPUT);
s/b pinMode (8, INPUT); or (8, INPUT_PULLUP)
int r1=2,r2=5,g1=3,g2=6,v1=4,v2=7,t=millis();
use unsigned long t = millis(); Same for other time elements, make them all unsigned long
allows t to go to 49.7 days
using int t for time only works for 32.767 seconds then it restarts. millis() returns an unsigned long and is always counting up after a reset.

Lot of syntax errors:
digitalWrite(8,INPUT);
s/b pinMode (8, INPUT); or (8, INPUT_PULLUP)

Strictly, that is a semantic error - it'll compile.