Those wires are color for color so hook'em back together. ETRAILER has a repacement 7-way cable with the plug already on it offered in two lengths.
These terminate into a metal junction box under the trailer near the trailer tongue. The newer truck lines are also fused under the hood of the truck it seems. Sounds like you are miswired. When you turn the plug upside down the diagrams get reversed haha...
Etrailer has a nice install video that might be helpful
Also the RV trailers use the BLADE TYPE connectors and plugs - Not the PIN TYPE.
Just my thoughts
Roy Ken