Пример #1
0
function API_Re($tid, $co)
{
    global $Channel, $userid, $username, $onlineip;
    ToOnezCode($co);
    $arr = array('pid' => '', 'fid' => $Channel['forumid'], 'tid' => $tid, 'aid' => '0', 'author' => $username, 'authorid' => $userid, 'icon' => '0', 'postdate' => time(), 'subject' => '', 'userip' => $onlineip, 'ifsign' => '1', 'ipfrom' => getaddress($onlineip), 'ifconvert' => '2', 'ifwordsfb' => '2', 'ifcheck' => '1', 'content' => $co, 'anonymous' => '0', 'ifhide' => '0');
    Conn()->insert("posts", $arr);
    $pid = (int) Conn()->select("posts", "pid", "1 order by tid desc");
    Conn()->query("UPDATE " . Conn()->tbl . "threads SET replies=replies+1,hits=hits+1, lastposter='{$username}', lastpost='" . time() . "' WHERE tid= '{$tid}'");
    Conn()->query("UPDATE " . Conn()->tbl . "memberdata SET  postnum=postnum+1, todaypost=todaypost+1, monthpost=monthpost+1, lastpost='" . time() . "' WHERE uid= '1' ");
    Conn()->query("UPDATE " . Conn()->tbl . "forumdata SET tpost=tpost+'1',article=article+'1' ,lastpost= 'Re:\t{$username}\t" . time() . "\tread.php?tid={$tid}&page=e#a'  WHERE fid= '{$Channel['forumid']}' ");
    $value = (int) Conn()->select("elements", "value", "type='replysort' and mark='{$Channel['forumid']}'");
    $value++;
    Conn()->query("REPLACE INTO " . Conn()->tbl . "elements (type,mark,id,value,addition,special) VALUES  ('replysort','{$Channel['forumid']}','{$tid}','{$value}','','0') , ('replysortday','{$Channel['forumid']}','{$tid}','{$value}','" . time() . "','0') ");
    return 1;
}
           $this->db->join('asset_size', 'asset_size.asi_id = campaign_transaction.asi_id');
           $select_query4 = $this->db->get();
           $ass_size = '';
           foreach ($select_query4->result() as $dat){
               
               $ass_size = $ass_size . ',' .$dat->asi_description;  
           } 
      ?>
   <tr>
       <td><?php echo $data->mec_description;?></td>
        <td><?php echo $ass_size;?><input type="hidden" id="media_category" name="media_category" value="<?php echo $data->cam_latitude.','.$data->cam_longitude ;?>"></input></td>
       <td><?php
      
           $lat= $data->cam_latitude;// 26.754347; //latitude
           $lng= $data->cam_longitude; //81.001640; //longitude
           $address= getaddress($lat,$lng);
           if($address)
           {
           echo $address;
           }
           else
           {
           echo "Not found";
           }
      // echo $data->address;?>
       
       </td>
       <td><?php echo "5km";?></td>
 <?php
 $ids = $_GET['id'];
   $this->db->where('cam_id',  $ids);
Пример #3
0
             $error .= "<br/>Your password is invalid.";
         }
     }
     if ($error) {
         $error = 'You have mistakes with your enter:' . $error;
     } else {
         $checkexistquery = "SELECT * FROM user WHERE email='" . $_POST['email'] . "'";
         $checkesistresult = mysqli_query($link, $checkexistquery);
         $checkexistrows = mysqli_num_rows($checkesistresult);
         if ($checkexistrows) {
             $error = "this email has registered, Do you want to Log in?";
         } else {
             $addnewuserquery = "INSERT INTO `User`(`Email`, `Password`,`Address`,`Name`,`RegisterTime`,`LastAccessTime`) VALUES ('" . $_POST['registeremail'] . "','" . $_POST['registerpassword'] . "','" . $_POST['registeraddress'] . "','" . $_POST['registername'] . "','" . $registertime . "','" . $registertime . "')";
             mysqli_query($link, $addnewuserquery);
             $_SESSION['id'] = mysqli_insert_id($link);
             $array = getaddress($_POST['registeraddress']);
             insertWaitingList($link, $_SESSION['id'], getBlockId($link, $array[1], $array[2]));
             //echo getBlockId($link,$array[1],$array[2]);
             header("Location:NotMemberYet.php");
         }
     }
 }
 if ($_POST['submit'] == "Log in") {
     date_default_timezone_set("America/New_York");
     $lastaccesstime = date("Y-m-d H:i:s");
     $loginquery = "SELECT * FROM User WHERE Email='" . $_POST['loginemail'] . "' AND Password='******'loginpassword'] . "'";
     $loginresult = mysqli_query($link, $loginquery);
     $rows = mysqli_fetch_array($loginresult);
     if ($rows) {
         $_SESSION['id'] = $rows['UserId'];
         $_SESSION['blockid'] = $rows['BlockId'];
Пример #4
0
function fbe_facebook_sdk($facebook_page,$appID,$appSecret){


		FacebookSession::setDefaultApplication($appID,$appSecret);

		$session = FacebookSession::newAppSession();

		try {
			  $session->validate();
		} 
			
		catch (FacebookRequestException $ex) {
			echo $ex->getMessage();
		} 
			
		catch (\Exception $ex) {
			echo $ex->getMessage();
		}


		$i=0;
		$u=0;


		try{

			$eventResponse = (new FacebookRequest($session, 'GET', '/'.$facebook_page.'/events?fields=place,cover,attending_count,description,end_time,id,name,owner,start_time,ticket_uri,timezone&limit=99'))->execute()->getResponse();
			$events = $eventResponse->data;

			foreach ($events as $e) {	
				$session = FacebookSession::newAppSession();
				$venue = (new FacebookRequest($session, 'GET', '/'.$facebook_page.'?fields=phone,photos,username,about,category,cover,emails,general_info,general_manager,location,website&limit=99'))->execute()->getResponse();

				$startDate = $e->start_time;
				$endDate = $e->end_time;
				$timezone = $e->timezone;

				// Convert time for myEventON
				$c_evcal_srow = date("U",strtotime($startDate));
				$c_evcal_erow = date("U",strtotime($endDate));
				$custom_year = date("U",strtotime($StartDate));
				$c_event_year = gmdate("Y", $custom_year);
				//
				
				$category = $e->owner->category;


				$event_id = $e->id;
				$eId = wp_strip_all_tags($e->id);	
				$city = $e->place->location->city;
				$state = $e->place->location->state;
				$zip = $e->place->location->zip;
				$street = $e->place->location->street;
				$region = $e->place->location->region;
				$country = $e->place->location->country;
				$ticket_uri = $e->ticket_uri;
				$eventImage = $e->cover->source;
				$name = $e->place->name;
				$fb_event_uri = 'https://www.facebook.com/events/'.$event_id;
				$lat = $e->place->location->latitude;
				$long = $e->place->location->longitude;

				$venue_name = $e->place->name;
				$venue_phone = $venue->phone;
				$venue_desc = $venue->about;
				$emails = $venue->emails;
				$username = $venue->username; 
				$emailAddress = $emails[0];
				$venue_website = $venue->website;	
				$event_tag = $venue->category;	

				////PRINT
				////$posts_array = get_posts('post_type=post_title');
				////print_r($posts_array);
				//print_r($e->place->name);
				////PRINT
	
				if($state){
					$state = $state.'&nbsp;';
				}
				if($street){
					$street = $street.',&nbsp;';
				}
				if($city){
					$city = $city.',&nbsp;';
				}
				if($country){
					$country = $country.'&nbsp;';
				}
				if($region){
					$region = $region.'&nbsp;';
				}
				 if($zip){
					$zip = $zip.'&nbsp;';
				}

				$location = $street.$city.$state.$zip.$country.$region ;
				$location = str_replace('<<not-applicable>>', '', $location);
				if($location == '&nbsp;' || $location == '' ){
				$location = getaddress(get_fbe_field($lat),get_fbe_field($long));
				}


				$args = array (
				'post_type' => 'facebook_events',
				'posts_per_page' => -1,
				'meta_key' => 'facebook_event_id',
				'meta_query' => array(
						'key'		=> 'facebook_event_id',
						'value'		=> $event_id,
					),
				);
				
				$loop = new WP_Query( $args );
			    if( $loop->have_posts() ){ 
					$u++;	
					while ( $loop->have_posts() ) : $loop->the_post();
						
					  $post_id = get_the_ID();
					  $curEventImage = get_post_meta( $post_id, 'image_url', true );
					  $post_information = array(
							'post_type' => 'facebook_events',
							'ID' => $post_id,
							'post_title' => wp_strip_all_tags($e->name),
							'post_content' => wp_strip_all_tags($e->description),
							'tags_input' => $event_tag,
						);
						 
						if($eventImage != $curEventImage ){insert_image($eventImage,$post_id); }
						 
						wp_update_post( $post_information );
						
					endwhile;
				}
				else
				{ 
				$post_information = array(
					'post_type' => 'facebook_events',
					'post_title' => wp_strip_all_tags($e->name),
					'post_content' => wp_strip_all_tags($e->description),
					'post_status' => 'publish',
					'tags_input' => $event_tag,
				);		
	        
			 $post_id = wp_insert_post( $post_information ); 
			 insert_image($eventImage,$post_id); 
	           

			}
			/*	$i++;

				update_post_meta($post_id,'event_timezone',$timezone);
				update_post_meta($post_id,'start_time',$startDate);
				update_post_meta($post_id,'event_starts',$startDate);
				update_post_meta($post_id,'event_starts_sort_field',$startDate);
				update_post_meta($post_id,'event_ends',$endDate);
				update_post_meta($post_id,'end_time', $endDate);
				update_post_meta($post_id,'facebook_event_id', $eId);
				update_post_meta($post_id,'location',$location);
				update_post_meta($post_id,'ticket_uri',$ticket_uri);
				update_post_meta($post_id,'fb_event_uri',$fb_event_uri);
				update_post_meta($post_id,'geo_latitude',$lat);
				update_post_meta($post_id,'geo_longitude',$long);			
				update_post_meta($post_id,'venue_email',$emailAddress);	
				update_post_meta($post_id,'venue_phone',$phone);	
				update_post_meta($post_id,'venue_website',$website);
				update_post_meta($post_id,'facebook','https://facebook.com/'.$username);
				update_post_meta($post_id,'venue_desc',$venue_desc);
				update_post_meta($post_id,'venue_name',$venue_name);
				*/
			
				/////////////////////////////////////
				// Get the Old Post
				$old_post = get_post( $post_id );

				//$my_post_meta = get_post_meta($post_id, 'image_url', true);
				
				
				$args = array(
					'numberposts' => 1,
					'order'=> 'DESC',
					'post_mime_type' => 'image',
					'post_parent' => $post->ID,
					'post_type' => 'attachment'
					);

				$get_children_array = get_children($args,ARRAY_A);  //returns Array ( [$image_ID]... 
				$rekeyed_array = array_values($get_children_array);
				$child_image = $rekeyed_array[0];  

				// Show Facebook Events ID & Title
				echo "FB_Id		-$post_id<br>";
				echo "FB_Title	-$old_post->post_title <br>";


				//print_r($child_image);  	//Show the contents of the $child_image array.
				//echo "Show the $child_image ID";
				echo "Image_Id   -";
				echo $child_image['ID'];   	//Show the $child_image ID.
				echo "<br>";
				
				$post_image_media = get_post_meta($child_image['ID'], '_wp_attached_file', true);
				echo "Media_file - $post_image_media <br>"; //image location 2015/08/11800415_396471520542665_8991308386259432158_n142.jpg
				
				
				
				
				
				
				$new_post = array(
					'post_status'    => 'publish',
					'menu_order'     => $old_post->menu_order,
					'post_type'      => 'ajde_events',
					'comment_status' => $old_post->comment_status,
					'ping_status'    => $old_post->ping_status,
					'pinged'         => $old_post->pinged,
					'post_author'    => $old_post->post_author,
					'post_category'  => $old_post->post_category,
					'post_content'   => $old_post->post_content,
					'post_excerpt'   => $old_post->post_excerpt,
					'post_name'      => $old_post->post_name,
					'post_parent'    => $old_post->post_parent,
					'post_password'  => $old_post->post_password,
					'post_title'     => $old_post->post_title,
					'tags_input'     => $old_post->tags_input,
					'to_ping'        => $old_post->to_ping,
					'tax_input'      => $old_post->tax_input,
				);
				
				$new_post_id = wp_insert_post( $new_post ); 
				/////////////////////////////////////////
				update_post_meta($new_post_id,'_thumbnail_id', $child_image['ID']);
				
				echo "New_Post_Id- $new_post_id<br>";
				echo "$new_post_id - _thumbnail_id - ";
				echo $child_image['ID'];
				echo "<br>";
				echo "______________________ <br><br>";
				
				$i++;
				/*
				update_post_meta($new_post_id,'evcal_event_color', 206177);
				update_post_meta($new_post_id,'evcal_location', $location);
				update_post_meta($new_post_id,'evcal_location_name', $venue_name);
				update_post_meta($new_post_id,'evcal_name_over_img', no);
				//	update_post_meta($new_post_id,'evcal_organizer', HHHEventOrganizerNameHHH);
				//	update_post_meta($new_post_id,'evcal_org_contact', $emailAddress);
				//	update_post_meta($new_post_id,'evcal_lmlink', JJJEventLinkJJJ);
				update_post_meta($new_post_id,'evcal_subtitle', $venue_desc);
				update_post_meta($new_post_id,'evcal_gmap_gen', yes);
				update_post_meta($new_post_id,'evcal_repeat', no);
				update_post_meta($new_post_id,'evcal_rep_freq', daily);
				update_post_meta($new_post_id,'evcal_rep_gap', 1);
				update_post_meta($new_post_id,'evcal_rep_num', 1);
				update_post_meta($new_post_id,'evp_repeat_rb', dom);
				update_post_meta($new_post_id,'evo_repeat_wom', none);
				update_post_meta($new_post_id,'_evcal_exlink_option', 1);
				update_post_meta($new_post_id,'evo_hide_endtime', no);
				update_post_meta($new_post_id,'evo_span_hidden_end', no);
				update_post_meta($new_post_id,'evo_year_long', no);
				update_post_meta($new_post_id,'event_year', $c_event_year);
				update_post_meta($new_post_id,'evo_evcrd_field_org', no);
				update_post_meta($new_post_id,'evo_exclude_ev', no);
				update_post_meta($new_post_id,'_cancel', no);
				update_post_meta($new_post_id,'evcal_lat', $lat);
				update_post_meta($new_post_id,'evcal_lon', $long);
				update_post_meta($new_post_id,'evcal_srow', $c_evcal_srow);
				update_post_meta($new_post_id,'evcal_erow', $c_evcal_erow);
				update_post_meta($new_post_id,'_evcal_ec_f1a1_cus', Link);
				update_post_meta($new_post_id,'_evcal_ec_f1a1_cusL', $fb_event_uri);
				update_post_meta($new_post_id,' _evcal_ec_f1_onw', yes);
				update_post_meta($new_post_id,'_evcal_ec_f2a1_cus', Buy);
				update_post_meta($new_post_id,'_evcal_ec_f2a1_cusL', $ticket_uri);
				update_post_meta($new_post_id,'_evcal_ec_f2_onw', yes);
				*/
				
				// Image
			
				
				


			
				
			}  


			$a ='';
			$c ='';
			$n ='';

			$error ='';
			if($u > 1){
				$c = $u;
				$a = $i-$u;
				$n = 'updated';
			}
			
			else
			
			{
			$c = $i;
			$n = 'imported';
			}

		} 
	
		catch(Exception $ex){

			$error  = $ex->getCode();
			$errorMsg  = $ex->getMessage();

			if($error == 100 ){
				echo '<div class="error" style="color:#222222; font-weight:700; font-size:1em; padding:10px">Error '.$error.': <a href="https://www.facebook.com/'.$facebook_page.'/events" target="_blank">'.$facebook_page.'</a>. <i> Country or age restricted material. Check your app settings.</i> </div>';
			}
			
			else if ($error == 102){	
				echo '<div class="error" style="color:#222222; font-weight:700; font-size:1em; padding:10px">Error '.$error.': Session key invalid or no longer valid.</div>';
			}
			
			else
				
			{
				echo '<div class="error" style="color:#222222; font-weight:700; font-size:1em; padding:10px">Error '.$error.'&nbsp;'.$errorMsg .'&nbsp;: Troubleshooting tip <a href="https://developers.facebook.com/docs/marketing-api/error-reference" target="_blank">View API Error Codes</a></div>';
			}

		}
		
		if($a >= 1){
			echo '<div class="updated" style="color:#222222; font-weight:700; font-size:1em; padding:10px">'.$a. ' events added</div>';
		}
		
		if($i > 1){
			echo '<div class="updated" style="color:#222222; font-weight:700; font-size:1em; padding:10px">'.$c . ' events '.$n.'</div>';
		}
		
		else if($i == 0){
			 if($error != 100){
			 echo '<div class="updated" style="color:#222222; font-weight:700; font-size:1em; padding:10px">There are <b>no upcoming</b> events to import at <a href="https://www.facebook.com/'.$facebook_page.'/events" target="_blank">'.$facebook_page.'</a></div>';
				}
		}
		
		else
		
		{
			echo '<div class="updated" style="color:#222222; font-weight:700; font-size:1em; padding:10px">'.$c . ' event '.$n.'</div>';
		}

	}
Пример #5
0
<?php

/**
 * Created by PhpStorm.
 * User: bowang
 * Date: 12/23/15
 * Time: 16:56
 */
error_reporting(0);
include "DataRetrieval.php";
include "getaddress.php";
$temp = getaddress("348 61st St Brooklyn");
echo $temp[0];
echo $temp[1];
echo $temp[2];
    
    <span class="pl15 pr15">丨</span>发票: 普通发票 / 个人
    
    </div>
  
    <div class="sub_h4 font14 dark">配送: <?php 
echo $address["name"];
?>
/ <?php 
echo $address["mobile_phone"];
?>
 /<?php 
$arr = explode(',', $address['addressid']);
echo getaddress($arr[0]);
echo getaddress($arr[1]);
echo getaddress($arr[2]);
?>
,<?php 
echo $address["address"];
?>
</div> 
<!-- 
    <div class="sub_h4 font14 dark">配送: 张三 /  138****1111 / 湖北,武汉市,武昌区,光谷广场</div>  -->
   
</div></div>

 

  

 
Пример #7
0
 * Time: 8:38 PM
 */
session_start();
include "DataRetrieval.php";
include "connection.php";
error_reporting(0);
$success = '';
$error = '';
$getexsitinginfo = "SELECT * FROM User WHERE UserId = '" . $_SESSION['id'] . "'";
$result = mysqli_query($link, $getexsitinginfo);
$results = mysqli_fetch_array($result);
if (isset($_POST['submit']) && $_POST['submit'] == 'Update') {
    //   if($_SESSION['blockid']){
    //        echo "here";
    //        //echo getBlockId($link,$array[1],$array[2]);
    //        echo "here1";
    $array = getaddress($_POST['updateaddress']);
    if (isMoveout($link, $array[1], $array[2], $_SESSION['blockid'])) {
        //            echo "moveout";
        insertMoveIn($link, $_SESSION['id'], getBlockId($link, $array[1], $array[2]));
        //            echo "here";
        insertWaitingList($link, $_SESSION['id'], getBlockId($link, $array[1], $array[2]));
    }
    //   }
    $updateinfo = "UPDATE User SET Name= '" . $_POST['updatename'] . "',Age='" . $_POST['updateage'] . "',Gender='" . $_POST['updategender'] . "',Phone1='" . $_POST['updatephone1'] . "',\n    Phone2='" . $_POST['updatephone2'] . "',Address='" . $_POST['updateaddress'] . "',Intro='" . $_POST['updateintro'] . "',NotifyMessage='" . $_POST['updatenotifymessage'] . "',NotifyType='" . $_POST['updatenotifytype'] . "'\n    WHERE UserId = '" . $_SESSION['id'] . "'";
    if (mysqli_query($link, $updateinfo)) {
        $success = "User Infomation Updated Successfully";
    } else {
        $error = "Update Failure";
    }
}
Пример #8
0
}
//See if we have an authenticated user, if so, setup the appropriate message.
if (isset($_SESSION["loggedinUserName"])) {
    // See if xml_data is set, if so see what action the user wants.
    if (isset($xml_data)) {
        $xmldoc = simplexml_load_string($xml_data);
        $request = $xmldoc->action;
    }
    $userID = getUserID($connection);
    /* Output the XML Prolog so the client can tell it is XML */
    $xml = <<<PROLOG
<?xml version="1.0" encoding="iso-8859-1"?>
PROLOG;
    switch ($request) {
        case 'getAddress':
            $xml .= getaddress($userID, $connection);
            break;
        case 'getExercises':
            $xml .= getexercises($userID, $connection, $category);
            break;
        case 'saveTemplate':
            $xml .= savetemplate($userID, $connection, $xml_data);
            break;
        case 'deleteTemplate':
            $xml .= deletetemplate($userID, $connection, $template);
            break;
        case 'loadTemplate':
            $xml .= loadtemplate($userID, $connection, $template);
            break;
        case 'saveDay':
            $xml .= saveday($userID, $connection, $xml_data);