abraham/twitteroauth reply to a perticular tweet in PHP [closed] - php

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
Hi i am totally new here and title says it all ..
i want to reply to a tweet using abraham/twitteroauth library for twitter .. update for the twitte is working fine but i am unable to do reply thing .
I am doing this ..
$status = $connection->post('statuses/update', array("status" =>
$dataa, "in_reply_to_status_id" =>$id));
twitteroauth_row('statuses/update', $status, $connection->http_code,
$parameters);
this code also updates the account with value in $dataa variable but do not reply to the tweet defined in $id
Please help .
Sorry for my bad english .This is my first post.
Thanks

yap . there was mistake from my side while updating the post .. after reading api document .. i found that without #username sign to perticular user it won't appear in his reply section ..

hamdoulilah the solution is so easy
you need just to add #username for who you want to replay to
$status_id = '480775609728385024';
$twitt_reply = '#username the replay text';
$responce = $connection->post('statuses/update', array('in_reply_to_status_id'=> $status_id , 'status' => $twitt_reply ));

Related

How to allow access for one specific IP [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 days ago.
Improve this question
I need to allow access to one specific WordPress page for one IP. It works fine in normal browser, but in anonymous browser with VPN i can still open the page.
This is my code:
function restrict_access_by_ip_address() {
$allowed_ips = array( '11.11.11.111' ); // replace with your own IP addresses
$current_ip = $_SERVER['HTTP_X_FORWARDED_FOR'] ?? $_SERVER['REMOTE_ADDR'];
if ( ! in_array( $current_ip, $allowed_ips ) && is_page( '2533' ) ) {
wp_die( 'Access Denied' );
}
}```

How to print the logged in user name on Woocommerce My Account page? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I'm struggling with printing the logged in user name on the My Account page of Woocommerce. I have a function that looks like this:
add_action( 'woocommerce_order_details_before_order_table_items', function() {
_e('<p class="you-ordered">Hey! Here\'s what you ordered:</div></p>');
} );
I'm trying to get it to say: "Hey, Jim! Here's what you ordered:".
I've tried:
add_action( 'woocommerce_order_details_before_order_table_items', function() {
_e('<p class="you-ordered">Hey! '.$current_user->display_name.' Here\'s what you ordered:</div></p>');
} );
But that didn't work. Any ideas?
Here's the solution:
add_action('woocommerce_order_details_before_order_table_items', function() {
$current_user = wp_get_current_user();
_e('<p class="you-ordered">Hey! ' . $current_user->display_name .
' Here\'s what you ordered:</div></p>');
});

Check, if is allowed embedding ( youtube video ) PHP, new youtube API [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
can someone hep with replace old way to new YouTube API?
I am looking for check option - allowed embedding.
My old code in PHP:
$url="http://gdata.youtube.com/feeds/api/videos/" . $videoID . "?v=2&alt=jsonc&prettyprint=true";
$json = file_get_contents($url, true);
$json_output = json_decode($json);
echo "emb = ".$json_output->data->accessControl->embed;
I am looking for easy, fast code, because i need to check more videos at time.
Thx.
The new base URL to get information about a video, through the ID, like http://www.youtube.com/watch?v=abcdefghijkl is:
https://www.googleapis.com/youtube/v3/videos?id=abcdefghijkl&key=YOUR_API_KEY&part={parts you want}
To get the status, if it's embaddable you have to set part to status, so your request looks like this
https://www.googleapis.com/youtube/v3/videos?id=abcdefghijkl&key=YOUR_API_KEY&part=status
The response output will look something like this:
"status": {
"uploadStatus": "processed",
"privacyStatus": "public",
"license": "youtube",
"embeddable": true,
"publicStatsViewable": true
}
Source: YouTube API - Getting started and YouTube API - Reference Videos
I didn't test it, but I hope it will work and I could help you!

free and paid registration guest user in my website using paypal using php please help me [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
In my site i want to free and paid membership.
I am new in paypal integration. How to use paypal payment system please help me.
After insert this detail in database and how to redirect on paypal.
Duration : 1year, 2year and lifetime membership
Prize :$10 ,$20, $100
Here is my PHP code
function payment_info()
{
global $obj;
$jobseeker_id = $_SESSION['jobseeker_logged_in_id'];
$s=$obj->FetchObject("SELECT * FROM candidate_registration WHERE jobseeker_id='".$jobseeker_id."'");
$fname =$s->candidate_fname;
$candidate_lname =$s->candidate_lname;
$candidate_name =$fname.' '.$candidate_lname;
$candidate_current_location =$s->candidate_current_location;
$candidate_mob =$s->candidate_mob;
$candidate_dob =$s->candidate_dob;
$candidate_gender =$s->candidate_gender;
$email_id =$s->email_id;
$duration = $_REQUEST['item_name'];
$pid = $_REQUEST['item_number'];
$prize = $_REQUEST['amount'];
$sql_data_array=array('pid'=>$pid,
'jobseeker_id'=>$jobseeker_id,
'duration'=>$duration,
'prize'=>$prize,
'email_id'=>$email_id,
'jobseeker_name'=>$candidate_name,
'candidate_current_location'=>$candidate_current_location,
'candidate_mob'=>$candidate_mob,
'candidate_gender'=>$candidate_gender,
'candidate_dob'=>$candidate_dob,
'membership_status'=>'1',
'membership_date'=>'now()');
$obj->Insert('jobseeker_member',$sql_data_array);
$_SESSION['success']="user detail added successfully";
header("location:");
}
on the above code after this line $obj->Insert('jobseeker_member',$sql_data_array); you want to set your paypal integration which are redirect to paypal with all the elements in paypal.

CakePHP help in blog tutorial - Simple Authentication and Authorization Application Last Part [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
In the Blog Tutorial on Cakephp 2.0 in the Simple Authentication and Authorization Section there is a code block in the last part that I can't understand
what does this line do?
// app/Model/Post.php
public function isOwnedBy($post, $user) {
return $this->field('id', array('id' => $post, 'user_id' => $user)) === $post;
}
I hope anyone can help me into this.
Leonardo is right, it checks if
there is a post with id $post AND user_id = $user
if yes it checks if the returned id is equal (even in type) to $post
if yes it returns true, else false
It's explained in the docs
In your case, it retrieves the Post's id field and try to match with the conditions in the second parameter: array('id' => $post, 'user_id' => $user) === $post.
This is:
find in the table Postsa row(s) with this user and this post
It will return the field in case a match is found, and false otherwise

Categories