{"id":119,"date":"2019-03-30T06:54:49","date_gmt":"2019-03-30T06:54:49","guid":{"rendered":"http:\/\/www.infotheme.in\/blog\/?p=119"},"modified":"2022-08-04T07:36:03","modified_gmt":"2022-08-04T07:36:03","slug":"how-to-make-facebook-like-post-publishing-system-microblogging-system","status":"publish","type":"post","link":"https:\/\/infotheme.net\/blog\/how-to-make-facebook-like-post-publishing-system-microblogging-system\/","title":{"rendered":"Make Facebook like post publishing system ? &#8211; Microblogging System"},"content":{"rendered":"<p>Whenever I think about facebook post publishing system, then i have got one thing how they developed it. Today i have tried to develop another post publishing system like facebook. It will be helpful for everyone who want to develop a micro &#8211; blogging system on their website.<br \/>\nHere below i have used these technologies to developed it PHP, AJAX, JQUERY, CSS, MYSQl.<br \/>\nStructure of post publishing system:<\/p>\n<h2><em><strong>With using below code Make Facebook like post publishing system<\/strong><\/em><\/h2>\n<p>[CODE]<\/p>\n<p><strong>root directory\/<\/strong><br \/>\nimages<br \/>\ndbconnect.php<br \/>\nindex.php<br \/>\nstatusupdater.php<br \/>\nresult.php<\/p>\n<p>[\/CODE]<\/p>\n<p>First i have develop a database table.<\/p>\n<p>[CODE]<br \/>\nCREATE TABLE IF NOT EXISTS `statusupdater` (<br \/>\n`status_id` int(45) NOT NULL AUTO_INCREMENT,<br \/>\n`post_date` datetime NOT NULL,<br \/>\n`status_content` mediumtext COLLATE utf8_bin NOT NULL,<br \/>\n`user` varchar(45) COLLATE utf8_bin NOT NULL,<br \/>\n`post_status` varchar(1) COLLATE utf8_bin NOT NULL,<br \/>\nPRIMARY KEY (`status_id`)<br \/>\n) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT=&#8217;status Updater For demo&#8217; AUTO_INCREMENT=40 ;<\/p>\n<p>[\/CODE]<\/p>\n<p>Once you have create a database table structure then you need to create a connection with mysql database. I Have created a database connection using this file dbconnect.php. Here below is the code of this file.<\/p>\n<p>[CODE]<\/p>\n<p>&lt;?php<br \/>\n\/\/file:dbconnect.php<br \/>\n$con=mysqli_connect(&#8220;localhost&#8221;,&#8221;root&#8221;,&#8221;&#8221;,&#8221;rudb&#8221;);<br \/>\n\/\/ Check connection<br \/>\nif (mysqli_connect_errno())<br \/>\n{<br \/>\necho &#8220;Failed to connect to MySQL: &#8221; . mysqli_connect_error();<br \/>\n}<\/p>\n<p>?&gt;<\/p>\n<p>[\/CODE]<br \/>\nMake an index file where you will show your publishing system. I have created a file name with index.php. Here i have used jquery script to work post publishing form.<\/p>\n<p>[CODE]<\/p>\n<p>&lt;?php<\/p>\n<p>\/\/status updater<br \/>\n\/\/Developer:Rahul Negi<br \/>\n\/\/Dev Url: www.infotheme.in<br \/>\ninclude_once(&#8216;dbconnect.php&#8217;);<br \/>\n?&gt;<\/p>\n<p>&lt;!DOCTYPE html&gt;<br \/>\n&lt;html&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;title&gt;Facebook like post publishing system &#8211; Demo Status Updater&lt;\/title&gt;<br \/>\n&lt;meta name=&#8221;description&#8221; content=&#8221;see demo of facebook like demo status updater system using php, mysql and ajax- Developed by rahul negi&#8221;\/&gt;<br \/>\n&lt;meta keywords=&#8221;facebook status updater, facebook like status upldate system, facebook like publishing system, post publish system using php, facebook like status update&#8221;\/&gt;<br \/>\n&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;style.css&#8221; type=&#8221;text\/css&#8221;\/&gt;<\/p>\n<p>&lt;script src=&#8221;http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.10.2\/jquery.min.js&#8221;&gt;<br \/>\n&lt;\/script&gt;<br \/>\n&lt;!&#8211;jquer ajax call to status updater script&#8211;&gt;<br \/>\n&lt;script type=&#8221;text\/javascript&#8221;&gt;<br \/>\n$(document).ready(function(){<br \/>\n$(&#8220;#statusUpdate&#8221;).click(function(){<br \/>\n$.post(&#8220;http:\/\/localhost\/demos\/status-updater\/statusupdater.php&#8221;,<br \/>\n{<br \/>\nuser:$(&#8220;input:text&#8221;).val(),<br \/>\nstatus:$(&#8220;textarea&#8221;).val()<br \/>\n},<br \/>\nfunction(data,status){<br \/>\nif(status == &#8220;success&#8221;)<br \/>\n{<\/p>\n<p>$(&#8220;#msg&#8221;).replaceWith(&#8220;&lt;div id=msg&gt;&lt;img src=images\/loader.gif&gt;&lt;br\/&gt;Loading Your Status&#8230;&lt;\/div&gt;&#8221;);<br \/>\nsetTimeout(function(){<br \/>\n$(&#8220;#msg&#8221;).replaceWith(&#8220;&lt;span id=msg&gt;&#8221;+data+&#8221;&lt;\/span&gt;&#8221;);<br \/>\n},5000);<br \/>\nsetTimeout(function (){<br \/>\n$(&#8216;#feed&#8217;).load(&#8216;result.php&#8217;).fadeIn(&#8220;slow&#8221;);}, 7000);<br \/>\n}<br \/>\n});<br \/>\n});<br \/>\nsetInterval(function (){<br \/>\n$(&#8220;#msg&#8221;).replaceWith(&#8220;&lt;div id=msg&gt;&lt;img src=images\/loader.gif&gt;&lt;br\/&gt; Loading Your Friend&#8217;s Feeds&#8230;&lt;\/div&gt;&#8221;);<br \/>\nsetTimeout(function (){<br \/>\n$(&#8220;#msg&#8221;).replaceWith(&#8220;&lt;div id=msg&gt;&lt;\/div&gt;&#8221;);<br \/>\n$(&#8216;#feed&#8217;).load(&#8216;result.php&#8217;).fadeIn(&#8220;slow&#8221;);}, 3000);<br \/>\n},19000);<br \/>\n});<br \/>\n&lt;\/script&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body&gt;<br \/>\n&lt;header&gt;<br \/>\n&lt;img src=&#8221;images\/rappLogo.jpg&#8221; alt=&#8221;R Apps &#8211; A Rahul Negi&#8217;s Production&#8221;\/&gt;<br \/>\n&lt;\/header&gt;<br \/>\n&lt;div id=&#8221;entry-title&#8221;&gt;&lt;h1&gt;Demo Status Updater&lt;\/h1&gt;<br \/>\n&lt;h2&gt;How To Make Facebook like post publishing system.&lt;\/h2&gt;<br \/>\n&lt;\/div&gt;<br \/>\n&lt;section&gt;<br \/>\n&lt;div id=&#8221;statusBar&#8221;&gt;<br \/>\n&lt;form action=&#8221;&lt;?php $_SERVER[&#8216;PHP_SELF&#8217;];?&gt;&#8221; name=&#8221;statusUp&#8221; method=&#8221;post&#8221;&gt;<br \/>\n&lt;input type=&#8221;text&#8221; name=&#8221;user&#8221; id=&#8221;user&#8221; value=&#8221;Your Name&#8221; onfocus=&#8221;if(this.value==&#8217;Your Name&#8217;)this.value=&#8221;;&#8221; onblur=&#8221;if(this.value==&#8221;)this.value=&#8217;Your Name&#8217;;&#8221;\/&gt;<br \/>\n&lt;textarea name=&#8221;status&#8221; id=&#8221;status&#8221; onfocus=&#8221;if(this.value==&#8217;What`s On Your Mind?&#8217;)this.value=&#8221;;&#8221; onblur=&#8221;if(this.value==&#8221;)this.value=&#8217;What`s On Your Mind?&#8217;;&#8221;&gt;What`s On Your Mind?&lt;\/textarea&gt;<br \/>\n&lt;div id=&#8221;sbtbar&#8221;&gt;&lt;input type=&#8221;button&#8221; name=&#8221;post&#8221; id=&#8221;statusUpdate&#8221; onclick=&#8221;statusUpdate()&#8221;value=&#8221;Share&#8221;\/&gt;&lt;div class=&#8221;clear&#8221;&gt;&lt;\/div&gt;&lt;\/div&gt;<br \/>\n&lt;div class=&#8221;clear&#8221;&gt;&lt;\/div&gt;<br \/>\n&lt;\/form&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>&lt;div id=&#8221;bottomCol&#8221;&gt;<br \/>\n&lt;div id=&#8221;msg&#8221;&gt;&lt;\/div&gt;<br \/>\n&lt;?php include_once(&#8216;result.php&#8217;);?&gt;<br \/>\n&lt;\/section&gt;<br \/>\n&lt;footer&gt;<br \/>\n&amp;copy; &lt;?php echo date(&#8216;Y&#8217;); ?&gt; 2014 R APPS &lt;small&gt;A Rahul Negi&#8217;s Production&lt;\/small&gt;<br \/>\n&lt;\/footer&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<\/p>\n<p>[\/CODE]<\/p>\n<p>When you have call a status updater script i have used here mysql insert query which insert user data to database.<\/p>\n<p>[CODE]<\/p>\n<p>&lt;?php<\/p>\n<p>\/\/status updater<br \/>\n\/\/Developer:Rahul Negi<br \/>\n\/\/Dev Url: www.infotheme.in<br \/>\ninclude_once(&#8216;dbconnect.php&#8217;);<\/p>\n<p>$msg=&#8221;&#8221;;<br \/>\nif(empty($_POST[&#8216;user&#8217;]) || $_POST[&#8216;user&#8217;]==&#8221;Your Name&#8221;)<br \/>\n{<br \/>\n$msg=&#8221;Please Must Enter Your Name.&#8221;;<br \/>\n}else{<br \/>\n$user=$_POST[&#8216;user&#8217;];<br \/>\n}<br \/>\nif(empty($_POST[&#8216;status&#8217;])|| $_POST[&#8216;status&#8217;]==&#8221;What`s On Your Mind?&#8221;)<br \/>\n{<br \/>\n$msg=&#8221;Please Say What&#8217;s On Your Mind?&#8221;;<br \/>\n}else{<br \/>\n$status=$_POST[&#8216;status&#8217;];<br \/>\n}<br \/>\nif(empty($msg))<br \/>\n{<br \/>\n$date=date(&#8216;y-m-d h:i:s&#8217;);<br \/>\nmysqli_query($con,&#8221;INSERT INTO statusupdater (`post_date`, `status_content`, `user`, `post_status`)<br \/>\nVALUES (&#8216;$date&#8217;,&#8217;$status&#8217;,&#8217;$user&#8217;,&#8217;O&#8217;)&#8221;);<br \/>\n$msg=&#8221;Successfuly Posted On Your Wall&#8221;;<br \/>\n}<br \/>\n?&gt;<br \/>\n&lt;?php if(!empty($msg))<br \/>\n{?&gt;<br \/>\n&lt;div id=&#8221;msgBar&#8221;&gt;&lt;?php echo $msg;?&gt;&lt;\/div&gt;<br \/>\n&lt;?php }?&gt;<\/p>\n<p>[\/CODE]<br \/>\nAfter that you need to make a css( castcading stylesheet ) to design your webpage. below the code of style.css file<\/p>\n<p>[CODE]<\/p>\n<p>\/*style sheet*\/<\/p>\n<p>*{margin:0; padding:0;}<\/p>\n<p>body{background:#eee;font-family:verdana;}<\/p>\n<p>header{display:block; width:100%; background-color:#333; background-size:42px; position:fixed; color:#f9f9f9; text-align:center;background-image:url(&#8216;images\/rappLogo.jpg&#8217;); border-bottom:2px solid #1b1b1b; box-shadow:0 0 40px #000;}<\/p>\n<p>header img{width:82px;}<\/p>\n<p>#entry-title{display: inline-block;padding: 4px;background: #222;font-size: 10px;color: #fff;text-align: center;text-shadow: 2px -2px 0 #5E5E5E;border-bottom: 1px solid #000;margin-top: 84px;width: 100%;}<\/p>\n<p>section{display:block; padding:10px; max-width:800px; margin:0 auto; border-left:1px solid #333; border-right:1px solid #333; min-height:470px;}<\/p>\n<p>.clear{clear:both}<\/p>\n<p>#statusBar{display: block;max-width: 600px;width: 100%;margin: 6px auto;padding: 7px;border: 1px solid #000;}<\/p>\n<p>#statusBar input[type=&#8221;text&#8221;]{display: block;max-width: 300px;width: 100%;font-size: 12px;padding: 6px;border: 1px solid #000;}<\/p>\n<p>#msg{display:block;width:100%;text-align:center;font-size:12px;}<\/p>\n<p>#msg img{width:20px;}<\/p>\n<p>#statusBar input[type=&#8221;button&#8221;]{display: block;float: right;padding: 4px 13px;border: 1px solid #000;background: #000;margin-top: 4px;color: #fff;border-radius: 3px;box-shadow: inset 0 0 3px #A8A59E;cursor: pointer;}<\/p>\n<p>#statusBar textarea{display: block;width: 97.8%;font-size: 13px;padding: 1%;margin-top: 6px;border: 1px dashed #000;border-bottom: 3px solid #000;font-family:verdana;}<\/p>\n<p>#sbtbar{background: #D8D8D8;padding: 3px;border: 1px solid #000;}<\/p>\n<p>#msgBar{display: block;max-width: 594px;text-align: center;font-size: 11px;background: #DACC97;padding: 10px;border: 1px solid #70612F;border-radius: 3px;margin: 15px auto;}<\/p>\n<p>#bottomCol{display: block;max-width: 594px;min-height: 200px;width: 100%;background: #FFFFFF;padding: 10px;margin: 0 auto;border: 1px solid #333;}<\/p>\n<p>#feed{display:block;text-align:center;padding: 6px;border: 1px solid #666;font-size: 12px;line-height: 16px;background: #f9f9f9;margin: 10px 0}<\/p>\n<p>.feedtop{display: block;}<\/p>\n<p>.date{display: block;padding: 2px;margin-top: 4px;color: #505050;border-top: 1px solid #666;border-bottom: 1px solid #666;}<\/p>\n<p>#s_content{display: block;padding: 4px;margin: 7px;font-size: 11px;}<\/p>\n<p>.avatar{display: block;border: 1px solid #333;width: 48px;height: 48px;border-radius: 4px;box-shadow: 0 0 4px #000;margin:0 auto;}<\/p>\n<p>.avatar img{border-radius: 4px;width:100%;height:100%;}<\/p>\n<p>footer{display: block;text-align: center;border-top: 1px solid #333;font-size: 11px;padding: 9px 0;background: #000;color: #fff;}<\/p>\n<p>[\/CODE]<\/p>\n<p>Here i have developed all script to make a mcrobloging system using php, ajax, css, html, mysql. Make your microbloging system today using this code. I will be back with another project here. Microbloging system is easy to develop as i know with this project. This is an open source project you can download it from our repository.<\/p>\n<p>[CODE]<br \/>\n<strong>Developer:<\/strong> Rahul Negi(https:\/\/www.facebook.com\/Mr.Rahul.Negi)<br \/>\n<strong>Production:<\/strong> R Apps( A rahul Negi&#8217;s Production)<br \/>\n<strong>Project Name:<\/strong> Microbloging system &amp; facebook like post publishing system.<\/p>\n<p>[\/CODE]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Whenever I think about facebook post publishing system, then i have got one thing how they developed it. Today i have tried to develop another [&hellip;] <span class=\"read-more-link\"><a class=\"read-more\" href=\"https:\/\/infotheme.net\/blog\/how-to-make-facebook-like-post-publishing-system-microblogging-system\/\">Read More<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":120,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[100],"tags":[118,117,116,119,115],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/infotheme.net\/blog\/wp-json\/wp\/v2\/posts\/119"}],"collection":[{"href":"https:\/\/infotheme.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/infotheme.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/infotheme.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/infotheme.net\/blog\/wp-json\/wp\/v2\/comments?post=119"}],"version-history":[{"count":6,"href":"https:\/\/infotheme.net\/blog\/wp-json\/wp\/v2\/posts\/119\/revisions"}],"predecessor-version":[{"id":130,"href":"https:\/\/infotheme.net\/blog\/wp-json\/wp\/v2\/posts\/119\/revisions\/130"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/infotheme.net\/blog\/wp-json\/wp\/v2\/media\/120"}],"wp:attachment":[{"href":"https:\/\/infotheme.net\/blog\/wp-json\/wp\/v2\/media?parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/infotheme.net\/blog\/wp-json\/wp\/v2\/categories?post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/infotheme.net\/blog\/wp-json\/wp\/v2\/tags?post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}