Let $\gamma$ denote the imaginary parts of the nontrivial zeros of the Riemann zeta-function $\zeta(s)$. For sufficiently large $T$ and $\varepsilon>0$, Ivi\'c proved that $\sum_{T<\gamma\leq2T} \vert\zeta(\frac{1}{2}+i\gamma)\vert^2 <\!\!\!<_{\varepsilon} (T(\log T)^2\log\log T)^{3/2+\varepsilon},$ where the implicit constant depends only on $\varepsilon$. In this paper, this result is improved by (i) replacing $\vert\zeta(\frac{1}{2}+i\gamma)\vert^2$ by $\max\vert\zeta(s)\vert^2$, where the maximum is taken over all $s=\sigma+it$ in the rectangle $\frac{1}{2}-A/\log T\leq\sigma\leq2,\, \vert t-\gamma\vert\leq B(\log\log T)/\log T$ with some fixed positive constants $A, B,$ and (ii) replacing the upper bound by $T(\log T)^2\log\log T$. The method of proof differs completely from Ivi\'c's approach.