Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Override parent 'WP_Quiz_Pro' class with facebook quiz specific markup,
- */
- class WP_Quiz_Pro_Fb_Quiz extends WP_Quiz_Pro {
- /**
- * Constructor
- */
- public function __construct( $id ) {
- parent::__construct( $id );
- add_filter( 'wp_quiz_data_attrs', array( $this, 'add_fb_data_attrs' ) );
- }
- public function get_html_questions() {
- $questions_html = '';
- if ( ! empty( $this->questions ) ) {
- foreach ( $this->questions as $key => $question ) {
- $desc = ! empty( $question['desc'] ) ? '<p class="desc">' . $question['desc'] . '</p>' : '';
- $questions_html .= '
- <div class="wq_singleQuestionWrapper wq_IsFb" style="">
- <div class="wq_loader-container" style="display:none;">
- <div class="wq_loader_text">
- <img src="' . WP_QUIZ_PRO_ASSETS_URL . 'image/image_spinner.gif" />
- <h3 id="wq_text_loader">' . esc_html__( 'Calculando seu resultado...', 'wp-quiz-pro' ) . '</h3>
- <h4 id="wq_text_loader">' . esc_html__( 'Curta nossa página!', 'wp-quiz-pro' ) . '</h4>
- <div class="curtir-load" style="margin:auto; width:100px; margin-top:15px;">
- <iframe class="facebook-like-button" style="cursor: default;" src="https://www.facebook.com/plugins/like.php?locale=pt_BR&href=https://www.facebook.com/plugins/like.php?locale=pt_BR&href=' . WP_Quiz_Pro_Plugin::get_url_facebook() . '&layout=button_count&action=like&size=small&show_faces=false&share=false&width=50&height=21" width="97" height="20" style="border:none;overflow:hidden;" scrolling="no" frameborder="0" allowTransparency="true">
- </iframe>
- </div><br><br>
- <center><img src="' . WP_QUIZ_PRO_ASSETS_URL . 'image/seta-like.png" style="width:31px; height:71px;"></center>
- </div>
- </div>
- <div class="wq_questionMediaCtr" >
- <div class="wq_questionImage"><img src="' . $question['image'] . '" /><span>' . $question['imageCredit'] . '</span></div>
- </div>
- <div class="wq_questionTextDescCtr">
- <div class="teste-titulo">' . $question['title'] . '</div>
- <div class="titulo-descricao">Por favor, entre com o seu Facebook para ver o seu resultado</div>
- </div>
- <style type="text/css">
- .mao-e-like{ margin:auto; width:140px; height: 20px; padding-top:5px;}
- .curta-aqui{ float:left;}
- .facebook-like-button{ float:right; }
- </style>
- <div class="mao-e-like">
- <div class="curta-aqui"><img src="http://testespop.com.br/wp-content/themes/sidebar/images/gif-mao.gif"></div>
- <iframe class="facebook-like-button" style="cursor: default;" src="https://www.facebook.com/plugins/like.php?locale=pt_BR&href=https://www.facebook.com/plugins/like.php?locale=pt_BR&href=' . WP_Quiz_Pro_Plugin::get_url_facebook() . '&layout=button_count&action=like&size=small&show_faces=false&share=false&width=50&height=21" width="97" height="20" style="border:none;overflow:hidden;" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
- </div>
- <div class="wq_questionLogin">
- <button class="wq_loginFB">
- <i class="fa fa-facebook-official" aria-hidden="true"></i> Entre com Facebook
- </button>
- </div>
- </div>';
- }
- }
- return $questions_html;
- }
- public function get_html_results() {
- $results_html = '';
- $share_html = $this->get_html_share();
- if ( ! empty( $this->results ) ) {
- $results_html .= '
- <div style="display:none;" class="wq_singleResultWrapper wq_IsFb" data-id="">
- <img class="wq_resultImg" src=""/>
- <center><div class="wq_resultDesc" style="line-height:20px; padding-top:10px;padding-bottom:10px;"></div></center>
- <div class="mao-e-like">
- <div class="curta-aqui"><img src="http://testespop.com.br/wp-content/themes/sidebar/images/gif-mao.gif"></div>
- <iframe class="facebook-like-button" style="cursor: default; margin-top:2px;" src="https://www.facebook.com/plugins/like.php?locale=pt_BR&href=https://www.facebook.com/plugins/like.php?locale=pt_BR&href=' . WP_Quiz_Pro_Plugin::get_url_facebook() . '&layout=button_count&action=like&size=small&show_faces=false&share=false&width=50&height=21" width="97" height="20" style="border:none;overflow:hidden;" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
- </div>
- ' . $share_html . '
- </div>
- ';
- }
- return $results_html;
- }
- public function add_fb_data_attrs( $data ) {
- $data .= 'data-quiz-profile="' . $this->settings['profile'] . '" ';
- return $data;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement