The influence of weakly nonlocal effects on the speed of second sound along or against the direction of a nonvanishing average heat flow is explored in a formalism based on a dynamical nonequilibrium temperature. The restrictions from the second law of thermodynamics on the nonlocal evolution equation of this temperature are studied from a gradient extension of classical Liu procedure, and the corresponding form of the entropy is derived. Stability requirements obtained from the second differential of the entropy are seen to restrict a nonlinear dependence of the thermal conductivity on the temperature gradient