add adsense after 2 paragraphs in php - adsense

I am trying from quite some time to insert adsense into a website post in a php website. I'm not really familiar with codes, but your help will be highly appreciated. I am using Varient - Magazine and News CMS. The following is the code in the post.php:
<div class="post-text">
<?= $post->content; ?>
</div>

Related

How to use facebook share plugin using bootstrap button?

I am trying to use facebook share button to my wordpress theme. I have use this code for that
<div class="fb-share-button btn btn-default" data-href="<?php the_permalink(); ?>" data-type="button_count"></div>
It is showing the share button. You can check the result here http://www.racecarwow.com/crazy-crash-v2-0/ . But my goal is , the share button will be look like the share button of this site http://blog.petflow.com/bravo-heroic-little-girl-saves-a-trapped-puppys-life/ .
I think, http://lipis.github.io/bootstrap-social/ will be a good solution for me. But i could not understand how can i use <div class="fb-share-button btn btn-default" data-href="<?php the_permalink(); ?>" data-type="button_count"></div> to that button. Please help me.
Yes ! i have got the solution by combining following the two site
http://ostr.io/code/html-social-like-share-buttons-no-javascript.html
http://lipis.github.io/bootstrap-social/
Hope it will be helpful for other person.
Well, it appears, that you have a slight mistake in your code, there is no function like the_parmalink() in Wordpress so far, but the correct one is the_permalink().
This function retrieves the permanent link to the post currently being processed in The Loop (as you can guess from it's name).
This tag must be within The Loop, and is generally used to display the permanent link for each post, when the posts are being displayed. Since this template tag is limited to displaying the permalink for the post that is being processed, you cannot use it to display the permalink to an arbitrary post on your web site.
Refer to get_permalink() if you want to get the permanent link for a post, given its unique post id.
So fix your code and try again:
<div class="fb-share-button btn btn-default" data-href="<?php the_permalink();?>" data-type="button_count"></div>

Custom title, summary is not working in facebook sharer

I had links in my website which were working fine but I noticed that these are not working now.
eg : http://www.facebook.com/sharer/sharer.php?s=100&p[url]=http://www.otlcampaign.org/blog/2013/02/04/inconvenient-truth-education-reform&p[images][0]=http://www.otlcampaign.org/sites/default/files/journey-for-justice-mlk-memorial.jpg&p[title]=The+Inconvenient+Truth+of+Education+'Reform'!&p[summary]=Recent+events+have+revealed+how+market-driven+education+policies,+deceivingly+labeled+as+%22reform,%22+are+revealing+their+truly+destructive+effects+on+the+streets+and+in+the+corridors+of+government:
this link was working fine before but its not taking custom title , summary etc. Please help me to resolve this problem.
I'm not using meta tags because there are lot of share buttons which have different title, description, image urls.
I have already gone through existing question on this site but those solutions are obselete. eg Facebook Share doesn't show my description or my thumbnail
Any suggestions please.
I'm not sure if you're comfortable with using PHP, but have you tried the following?
<?php
$title=urlencode('Title');
$url=urlencode('http://www.facebook.com/yourfanpage'); /* Note Personal FB Pages will not work */
$summary=urlencode('Custom message');
$image=urlencode('http://www.yourdomain.com/facebookshare/images/customthumbnail.jpg');
?>
<a onClick="window.open('http://www.facebook.com/sharer.php?s=100&p[title]=<?php echo $title;?>&p[summary]=<?php echo $summary;?>&p[url]=<?php echo $url; ?>&&p[images][0]=<?php echo $image;?>', 'sharer', 'toolbar=0,status=0,width=548,height=325');" target="_parent" href="javascript: void(0)">
Share our Facebook page!
</a>
From your example, also, I noticed that one of the issues might be the ampersands. You have 100& instead of 100& You will need to double check all of the links for these and the spaces, etc.

How to insert multiple Facebook comment boxes on one page?

I am looking for a way to integrate several Facebook Comment Boxes on one page, but with different comments. i have an image grid view and inserted in the lightbox overlays the code from the Facebook comment box generator. With an random number at the end of the URL i tried to fix it, but there comes the error:
Warning: https://URL/#2087943573 can not be opened.
Any ideas?
You just have to add an anchor to the absolute URL, like it is explained in another thread:
Multiple facebook comment boxes on a single page?
You can even test this in the plugin generator:
https://developers.facebook.com/docs/reference/plugins/comments/
...try changing "http://example.com" to "http://example.com#test" and you will see that some other people already commented on that one too.
edit: After a small chat, we found out that the problem might be with the https. So, maybe it just doesn´t work with SSL, i´ve also tried with another server and it only works with the http link.
Try to make "fake" pages for each article that you have with GET variable. For the example:
example.com?fb_share=article1, example.com?fb_share=article2, etc.
Then here you must put the URL:
<div class="fb-comments" data-href="http://example.com?fb_share=article1" data-numposts="5" data-colorscheme="light"></div>
and
<div class="fb-comments" data-href="http://example.com?fb_share=article2" data-numposts="5" data-colorscheme="light"></div>
You don't need to use these pages, but you need it because when someone commenting, the FB comment will be posted on the wall with backlink to your article and for data-href attribute.
By doing these code, it works for my site. Using $_SESSION while looping and echoing data from MySQL database.
<div id= "area_post">
<?php
$query= mysql_query("select * from promo_diskon");
$url_id=0;
while($data= mysql_fetch_assoc($query)){
$textpromo = nl2br($data['deskripsi']);
$_SESSION["url_id"]="http://localhost/xampp/kerjapraktik/promo_diskon.php?posting=".$url_id."";
echo
"<div id='posting'>
<div id='layer'><div class='judul'>".$data['judul']."</div><div class='tanggal'>".$data['tanggal']."</div>
<br/ ><br /><p id= 'deskripsi1' class='deskripsi1'>".$textpromo."</p></div>
<a href=''><img class= 'img-thumbnail' src= ".$data['url_foto']." width= '440px' alt=''></a>
</div>";
//echo '<div class="fb-comments" data-href="http://localhost/xampp/kerjapraktik/promo_diskon.php?posting="'.$url_id.'"" data-width="956" data-numposts="5" data-colorscheme="dark"></div>';
echo '<div class="fb-comments" data-href="'.$_SESSION["url_id"].'" data-width="956" data-numposts="5" data-colorscheme="dark"></div>';
$url_id++;
}
?>
</div>

Shopify form post to external url

I have a site hosted with Shopify. I would like to implement a form that posts to an external url. This is a custom form. My original thought is that I could just create a new page and add a form similar to these examples here - http://wiki.shopify.com/Contact_And_Signup_Forms#Signup_Forms
But, I don't see an option to post to an external url. I am completely new to Shopify. I had hoped that being a rails programmer would have helped, but it looks like I need to work with the liquid template system and not rails.
Any assistance would be appreciated.
Instead of using the liquid form tag, just use straight HTML and specify an action for your form that points to an external URL.
Example:
<form action="http://your-url.com" method="post">
<input type="text" name="email_address">
<input type="submit" value="Go!">
</form>
The above example will POST to http://your-url.com.

cakephp / webtechnick's : share button hides like button and comments

my issue might look a strange a little bit.
i'm working on a cakephp website in which i want to integrate facebook comments, like, and share functions. i'm using for that Webtechnick's Facebook plug-in, and i think this far everything is doing great. except one thing.
whene i call comments and like:
<?php $facebook->comments(); ?>
<?php $facebook->like(); ?>
it works and i have my share and like buttons, but when i call
<?php $facebook->share(); ?>
<?php $facebook->comments(); ?>
<?php $facebook->like(); ?>
only the share button is displayed. It's like if the share button hides likes and comments
not sure if this is clear enough, I know it's a strange problem.
If anybody has experienced something similar to this please help, thank you.
You may be better off using the social plugin versions of these three. I'd recomment you start with the HTML5 versions and go from there.
See:
https://developers.facebook.com/docs/reference/plugins/like/ (does both like and send)
https://developers.facebook.com/docs/reference/plugins/comments/