Opportunistic network that consists of mobile devices carried by social people is called community based opportunistic network (CON) which has community characteristics. Currently prevalent multi-copy routing algorithms in opportunistic networks have not considered these characteristics, therefore when these algorithms are used in CON, they will lead to high transmission delay and packet loss rate. This paper proposes a Community-based Data Transmission Scheme (CDTS) to solve these problems. CDTS organizes all nodes into different communities based on the contact frequency between nodes. CDTS adaptively adjusts the number of data copies in the network and data can be transmitted to target community mainly relying on active nodes. Simulation results show that CDTS can achieve satisfying data delivery ratio in community-based opportunistic networks and reduces the data forwarding times by 19.4% to 24.7%.