The only moves that have their power rely on friendship are Return and Frustration, and I'm guessing you want Return. (Although there are many better moves for Dialga >_>)
If you want it to have full happiness, do the following:
-Give it a massage at the place in Mauville City (if I remember correctly)
-Just walking around with it
-Feeding it vitamins like Zinc, Carbos, etc.
-Leveling it Up
-Feeding it EV-lowering berries like the Pomeg Berry and the Kelpsy Berry.
-Have it hold the Soothe Bell
-Have caught the Pokemon in a Luxury Ball
You can't check the exact numerical value of its happiness, but you can go to a house in Verdanturf Town to check about how happy it is. The statement for maximum happiness is: "It’s extremely friendly toward you. It couldn’t possibly love you more. It’s a pleasure to see!"
Now, to lower friendship, it is much more difficult. To lose friendship you should:
-Use bitter medicine like Energy Powder and Revival Herbs
-Let it faint in battle
And that's about it. This info is from Serebii's page for Friendship.