Nowadays, with the widespread access to web 2.0, the social network plays an unbelievable role in knowledge sharing and diffusion of new products. People can share their views and can visit other's opinion about the particular material, news, products, artifacts and, trends, etc. anywhere, anytime, and anywhere. An Opinion leader is a critical person who can change, modify and transform other's view by their knowledge and proficiency. In this article, an innovative approach is proposed to discover the top-N local and global opinion leader within the community and social network respectively. Initially, we identified the community structure within the social network using the modified Louvain method and next identified the opinion leader using a modified firefly algorithm in each community. We also determined the global opinion leader within the same social network using the same firefly algorithm. The proposed approach is exceptionally supportive to expert and intelligent system because it competently discovered the local optimum concurrently in each subgroup of the social network. All the users can update its attractiveness value without any supposition, and as soon as the distance among the user's increases, the other users can automatically create another subgroup in the network and form the local community. In addition, as the population size in the network increases, the entire users measure their prominence simultaneously. Therefore, there is no consequence on computational time and accuracy of the algorithm. Thus, the proposed algorithm is superlative suitable for discovering the opinion leader in the local community and globally in the social network. For legalized the proposed approach, we implemented our proposed method on synthesized as well as on real dataset. Finally, we concluded that both the recommended procedures are much better concerning the accuracy, precision, recall, and F1-score with the widely used standard Social Network Analysis (SNA) measures.