예제 #1
0
파일: home.php 프로젝트: ponchov/quizzworld
 function facebook_apps()
 {
     ini_set('display_startup_errors', 1);
     ini_set('display_errors', 1);
     error_reporting(-1);
     //-------------- delete previous item
     /*$current_time = date('Y-m-d H:i:s',(time() - (60*3)));
     		$pre_fb_apps_result_list=$this->home_model->get_pre_fbapps_result($current_time);
     		if($pre_fb_apps_result_list)
     		{
     			foreach($pre_fb_apps_result_list as $row)
     			{
     				//echo $row->image_name; exit;
     				//echo $row->image_name;
     				unlink($row->image_name);
     			}
     			$this->home_model->delete_pre_fbapps_result($current_time); 
     		}*/
     //---------------
     $friend_name = $this->input->post('friend_name');
     $friend_pic = $this->input->post('friend_pic');
     $friend_id = $this->input->post('friend_id');
     $user_pic = $this->input->post('user_pic');
     $user_id = $this->input->post('user_id');
     /*$user_pic="https://scontent.xx.fbcdn.net/hprofile-xat1/v/t1.0-1/p200x200/10846245_10203460416936142_2075582716701364065_n.jpg?oh=c31cfec9ef7847e7a6168f4efd2a1b8b&oe=561686FF";
     		$friend_pic="https://scontent.xx.fbcdn.net/hprofile-xat1/v/t1.0-1/p200x200/10846245_10203460416936142_2075582716701364065_n.jpg?oh=c31cfec9ef7847e7a6168f4efd2a1b8b&oe=561686FF";
     		$user_id="10205018548408455";
     		$friend_id="10205018548408455";
     		$friend_name="Saiful Islam";*/
     $alias = $this->input->post('alias');
     $tests_info = $this->home_model->get_game($alias);
     //$test_bg_image=$tests_info->image;
     $font = 'assets/fonts/Arial Regular.ttf';
     $font_size = 20;
     $text_box = $this->calculateTextBox($friend_name, $font, $font_size, 0);
     $text_width = $text_box['width'];
     $text_height = $text_box['height'];
     $x = floor((630 - $text_width) / 2);
     $y = 40;
     $types = array('image/gif' => 'gif', 'image/jpeg' => 'jpg', 'image/jpg' => 'jpg', 'image/png' => 'png');
     $headers1 = get_headers($user_pic, 1);
     if (is_array($headers1["Content-Type"])) {
         $type1 = $headers1["Content-Type"][1];
     } else {
         $type1 = $headers1["Content-Type"];
     }
     $file_name1 = "assets/fb_apps/{$user_id}." . $types[$type1];
     @copy($user_pic, $file_name1);
     $headers2 = get_headers($friend_pic, 1);
     if (is_array($headers2["Content-Type"])) {
         $type2 = $headers2["Content-Type"][1];
     } else {
         $type2 = $headers2["Content-Type"];
     }
     $file_name2 = "assets/fb_apps/{$friend_id}." . $types[$type2];
     @copy($friend_pic, $file_name2);
     $img_info = pathinfo($file_name1);
     $image_type1 = strtolower($img_info['extension']);
     $img_info = pathinfo($file_name2);
     $image_type2 = strtolower($img_info['extension']);
     if ($image_type1 == 'jpeg' || $image_type1 == 'jpg') {
         $user_img = imagecreatefromjpeg($file_name1);
     } else {
         if ($image_type1 == 'png') {
             $user_img = imagecreatefrompng($file_name1);
         } else {
             if ($image_type1 == 'gif') {
                 $user_img = imagecreatefromgif($file_name1);
             }
         }
     }
     if ($image_type2 == 'jpeg' || $image_type2 == 'jpg') {
         $friend_img = imagecreatefromjpeg($file_name2);
     } else {
         if ($image_type2 == 'png') {
             $friend_img = imagecreatefrompng($file_name2);
         } else {
             if ($image_type2 == 'gif') {
                 $friend_img = imagecreatefromgif($file_name2);
             }
         }
     }
     $result_bg_image = get_testMeta($tests_info->tests_id, 'fb_apps_result_image');
     $bg_img = "assets/img/test_result_img/{$result_bg_image}";
     $bg_info = pathinfo($bg_img);
     $bg_img_type = strtolower($bg_info['extension']);
     //echo $bg_img;
     if ($bg_img_type == 'png') {
         $im = imagecreatefrompng($bg_img);
     }
     if ($bg_img_type == 'jpg' || $bg_img_type == 'jpeg') {
         $im = imagecreatefromjpeg($bg_img);
     }
     if ($bg_img_type == 'gif') {
         $im = imagecreatefromgif($bg_img);
     }
     $font_color = imagecolorallocate($im, 00, 00, 00);
     imagecopyresampled($im, $user_img, 90, 70, 0, 0, 191, 191, 191, 191);
     imagecopyresampled($im, $friend_img, 319, 70, 0, 0, 191, 191, 191, 191);
     imagedestroy($user_img);
     imagedestroy($friend_img);
     imagettftext($im, $font_size, 0, $x, $y, $font_color, $font, $friend_name);
     @unlink($file_name1);
     @unlink($file_name2);
     //$unique_id=uniqid(rand(), true);
     //$time=$unique_id.time();
     $time = $user_id . "_" . time();
     $file_name = "assets/fb_apps/{$time}" . "." . $bg_img_type;
     if ($bg_img_type == 'png') {
         imagepng($im, $file_name);
     }
     if ($bg_img_type == 'jpg' || $bg_img_type == 'jpeg') {
         imagejpeg($im, $file_name);
     }
     if ($bg_img_type == 'gif') {
         imagegif($im, $file_name);
     }
     imagedestroy($im);
     $db_data['test_bg_image'] = base_url() . "{$file_name}";
     $db_data['friend_name'] = $friend_name;
     $db_data['id'] = $time;
     $db_data['tests_info'] = $tests_info;
     //----------- insert into db
     $res_info['id'] = $time;
     $res_info['image_name'] = $file_name;
     $res_info['friend_name'] = $friend_name;
     $res_info['added'] = date('Y-m-d H:i:s');
     $this->db->insert('fb_apps_result', $res_info);
     //------- end
     $res['id'] = $time;
     //$res['bg_img']=$user_pic;
     echo json_encode($res);
     //$this->load->view($this->template.'/home/ajax_facebook_apps_result',$db_data,false);
 }
예제 #2
0
    }
    ?>

		<?php 
}
?>
		
		<?php 
if ($is_real_test == 6) {
    ?>
		
			<?php 
    $button_text = get_testMeta($eng_test_info->tests_id, 'button_text');
    $en_button_text = $button_text;
    if ($test_info) {
        $button_text = get_testMeta($test_info->tests_id, 'button_text');
    }
    ?>
			<div class="form-group">
				<label for="inputInfo" class="col-xs-12 col-sm-3  control-label no-padding-right">Button Text</label>
				<div class="col-xs-12 col-sm-5">
					<?php 
    echo $en_button_text;
    ?>
 <br />
					<span class="block input-icon input-icon-right">
						<input type="text" class="form-control required" id="button_text" name="button_text" value="<?php 
    if ($test_info) {
        echo $button_text;
    }
    ?>
예제 #3
0
    ?>
" />

		</a>

		<?php 
}
?>
	</p>
	
	<?php 
if ($this->session->userdata('user_type') == 3 || $this->session->userdata('user_type') == 4) {
    ?>
		<div class="comments_area">
			<?php 
    $comments = get_testMeta($test_info->tests_id, 'comments');
    ?>
			<form class="form-horizontal" action="<?php 
    echo site_url();
    ?>
admin/lists/edit_comments" method="post">
				<div class="form-group">
					<h3 class="col-sm-12">Comments</h3>
					<div class="col-xs-12 col-sm-7">
						<span class="block input-icon input-icon-right">			
							<textarea name="comments" id="comments" class="form-control"><?php 
    if ($comments) {
        echo $comments;
    }
    ?>
</textarea>					
예제 #4
0
" /></div>
		<div class="snipet_2"><?php 
echo get_testMeta($tests_info->tests_id, 'article_snippet_2');
?>
</div>
		<div class="description"><?php 
echo $tests_info->description;
?>
</div><br />
		<div class="snipet_3"><?php 
echo get_testMeta($tests_info->tests_id, 'article_snippet_3');
?>
</div>
		<div class="video">
			<?php 
$video_name = get_testMeta($tests_info->tests_id, 'video');
$video_info = pathinfo($video_name);
$extension = $video_info['extension'];
if ($video_name != '') {
    ?>
					<video id="example_video_1" class="video-js vjs-default-skin vjs-big-play-centered"
					  controls preload="auto" width="300" height="200"
					  poster="<?php 
    echo base_url();
    ?>
assets/videos/<?php 
    echo $video_name;
    ?>
"
					  data-setup='{"example_option":true}'>
					 <source src="<?php 
예제 #5
0
						<div class="latest_title_mob visible-xs"><?php 
        echo $caption;
        ?>
</div>
					    <div class="latest_games_caption">
							<a href="<?php 
        echo $url;
        ?>
">
								<?php 
        echo $game->title;
        ?>
							</a>
							<div class="latest_description hidden-xs">
								<?php 
        $sub_title = get_testMeta($game->tests_id, 'sub_title');
        ?>
								<a href="<?php 
        echo $url;
        ?>
"><?php 
        if (!empty($sub_title)) {
            echo nl2br($sub_title);
        }
        ?>
</a>
							</div>
						</div>
						
					</div>
				<?php 
예제 #6
0
					<textarea name="comments" id="comments" class="form-control"></textarea>					
				</span>
			</div>				
		</div>
		
		
		<div class="form-group">
			<label for="inputInfo" class="col-xs-12 col-sm-3 control-label no-padding-right">Image</label>
			<div class="col-xs-12 col-sm-5">
				<span class="block input-icon input-icon-right">					
					<input type="file" name="image" id="image" value="" />				
				</span>
			</div>				
		</div>
		<?php 
$is_slider = get_testMeta($test_id, 'is_slider');
if ($is_slider == 1) {
    ?>
					<div class="form-group">
						<label for="inputInfo" class="col-xs-12 col-sm-3 control-label no-padding-right">Without Eyebrows Image</label>
						<div class="col-xs-12 col-sm-5">
							<span class="block input-icon input-icon-right">					
								<input type="file" name="image2" id="image2" value="" />				
							</span>
						</div>				
					</div>
				<?php 
}
?>
          <div class="col-md-offset-3 col-sm-offset-3">
				<input type="hidden" name="is_slider" id="is_slider" value="<?php 
예제 #7
0
            $number_of_posts = get_testMeta($test_info->testid, 'number_of_posts');
            ?>
			<div class="form-group">
				<label for="inputInfo" class="col-xs-12 col-sm-3  control-label no-padding-right">Number of Posts</label>
				<div class="col-xs-12 col-sm-5">
					<span class="block input-icon input-icon-right">
						<input type="text" class="form-control required" id="number_of_posts" name="number_of_posts" value="<?php 
            echo $number_of_posts;
            ?>
">				
					</span>
				</div>				
			</div>
			
			<?php 
            $number_of_photos = get_testMeta($test_info->testid, 'number_of_photos');
            ?>
			<div class="form-group">
				<label for="inputInfo" class="col-xs-12 col-sm-3  control-label no-padding-right">Number of Photos</label>
				<div class="col-xs-12 col-sm-5">
					<span class="block input-icon input-icon-right">
						<input type="text" class="form-control required" id="number_of_photos" name="number_of_photos" value="<?php 
            echo $number_of_photos;
            ?>
">				
					</span>
				</div>				
			</div>
			<?php 
        }
        ?>
예제 #8
0
       }(document, 'script', 'facebook-jssdk'));

    </script>



<div class="col-xs-12 col-sm-12 col-md-12" style="padding:0;">
	<div class="col-xs-12 col-sm-8 col-md-8" id="list_left_panel">
		<div id="left_content">
				<div class="list_title"><?php 
echo $tests_info->title;
?>
</div>	
				<div class="snipet_1"><?php 
echo get_testMeta($tests_info->tests_id, 'list_snippet');
?>
</div>
		
				<div class="social_link">
					<script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js"></script>
					<?php 
$share_url = site_url() . "list/" . $tests_info->alias . ".html";
$shareAttributes = "addthis:url='{$share_url}' addthis:title='Test' addthis:description='' ";
?>
					<!-- AddThis Button BEGIN -->
					<div class="addthis_toolbox addthis_default_style addthis_32x32_style" data-url="<?php 
$share_url;
?>
" data-title="" style="width:100%;" >
						<a class="socila_button addthis_button_facebook" <?php 
예제 #9
0
 function list_view($tests_alias, $active_menu = '')
 {
     $tests_alias = urldecode($tests_alias);
     $db_data = array();
     $db_data['config_info'] = $this->home_model->get_config();
     $tests_info = $this->home_model->get_game($tests_alias);
     if (!$tests_info) {
         redirect(site_url() . 'not-found.html');
     }
     $db_data['tests_info'] = $tests_info;
     $is_slider = get_testMeta($tests_info->tests_id, 'is_slider');
     if ($is_slider == 1) {
         $data['content'] = $this->load->view($this->template . '/home/list_slider_view', $db_data, true);
     } else {
         $data['content'] = $this->load->view($this->template . '/home/list_view', $db_data, true);
     }
     $data['config_info'] = $db_data['config_info'];
     $data['page_title'] = $db_data['tests_info']->page_title;
     $data['page_description'] = $db_data['config_info']->page_description;
     $data['meta_img'] = base_url() . "assets/img/image/" . $db_data['tests_info']->image;
     $data['meta_url'] = base_url() . "list/" . $db_data['tests_info']->alias . ".html";
     $data['fb_meta_description'] = $db_data['tests_info']->fbshare_des;
     //$data['page_title'] ="Testing.......";
     if (!empty($_GET['ref_page']) && $_GET['ref_page'] == 'top') {
         $data['active_menu'] = 'top';
     } else {
         $data['active_menu'] = '';
     }
     $data['cur_page'] = "list view";
     if ($active_menu) {
         $data['active_menu'] = $active_menu;
     }
     $this->load->view($this->template . '/layout/list_default', $data);
 }