Try adding some echos in the code to see what is happening, like so:
on *:sockread:topicup.*: {
  var %t, %s = $sockname, %c = $gettok(%s,2,46)
  sockread -f %t
  if ($sockerr) { echo $color(info2) -at * Socket Read ERROR: $sock(%s).wsmsg | return }
  echo -ag Sock Data1: %t
  if (%t == $null) { hadd -m %s read $true }
  if (($hget(%s,read)) && (%t != $null)) {
    echo -ag Sock Data2: %t
    if ($chan(%c).topic != %t) { topic %c %t }

The only other thing i could suggest, is to have your news.php page insert a blank line after the topic line.

I'm not really sure what else to say, the code works just fine for me.

Lost in your digital reality.
#mIRC / #Helpdesk on DALnet.