SHANGHAI police have freed Chinese journalist Zhang Weiguo after three weeks of detention, but have barred him from travel within China.Mr. Zhang, former Beijing bureau chief of the outspoken World Economic Herald newspaper, was released two weeks ago. Earlier, he spent 20 months in prison following the June 4, 1989, crackdown on popular protests for democracy. Police began pursuing Mr. Zhang late this June, apparently to prevent him from meeting with a visiting Australian human rights delegation that had requested to see him. Zhang left Shanghai to avoid a confrontation with authorities. But at 2:00 a.m. on July 30, police in more than a dozen vehicles surrounded the home in rural Zhejiang province where Zhang was staying with a relative. He was handcuffed and detained without a warrant. Authorities then took Zhang to Shanghai's No. 1 Detention Center, where they interrogated him about alleged ties with Hong Kong democratic activists, contacts with foreign journalists, and a book he is writing about Qin Benli, the Herald's late editor. Zhang was also asked his views on the failed coup against Soviet President Mikhail Gorbachev. In a clear effort to curb his influence within China, interrogators again advised Zhang that if he applied to go abroad he would quickly be granted a passport to leave. "I told them that all my actions were legal, but they were violating laws and interfering with my life," says Zhang, a former lawyer. "Legally, I could sue them." Several of Zhang's family members and friends were shadowed or detained for questioning during the last two months.