  We construct a family of PBWD bases for the positive subalgebras of quantum
loop algebras of type $B_n$ and $G_2$, as well as their Lusztig and RTT (for
type $B_n$ only) integral forms, in the new Drinfeld realization. We also
establish a shuffle algebra realization of these $\mathbb{Q}(v)$-algebras
(proved earlier in arXiv:2102.11269 by completely different tools) and
generalize the latter to the above $\mathbb{Z}[v,v^{-1}]$-forms. The rational
counterparts provide shuffle algebra realizations of positive subalgebras of
type $B_n$ and $G_2$ Yangians and their Drinfeld-Gavarini duals. All of this
generalizes the type $A_n$ results of arXiv:1808.09536 by the second author.
