Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
CamperBot
@camperbot
buntybru sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 435 | @gothamknight |http://www.freecodecamp.com/gothamknight
Jonathan Cunanan
@jcunanan05
@jcunanan05
hello to those who use font-awesome, <span> or <i> ?
they both work, which do you use?
Thompson Ike
@hubhubace
hey guys having problem with code
anyone pls help
Markus Kiili
@Masd925
@hubhubace You can just ask the question and perhaps post the relevant code here.
Thompson Ike
@hubhubace
k
I appended ato a div the return data from php
its a post data
it returns and fill the div but disappears after page refresh
i dont know what to do
here is the php

~~~php
public function post_status($u,$post) {
global $conn;
include_once("check_login_status.php");
if($user_ok != true || $log_username == "") {
exit();
}else{
if(isset($_POST)){
$_SESSION['post-data'] = $_POST;
$u = $_SESSION["username"];
$post = trim($_SESSION['post-data']['post']);
$table = "posts";
$time = time();

     $sql = "insert into $table (username,status,posted_at) values('$u','$post','$time')";
     mysqli_query($conn, $sql);

     $sql = "SELECT * FROM $table WHERE username='$u' LIMIT 100";
     $userpost_query = mysqli_query($conn, $sql);
     //build html format as you need it..
    while($row = mysqli_fetch_array($userpost_query, MYSQLI_ASSOC)){
        $avatar = $row["profile_picture_path"];
        $profile_pic = '<img class="img-responsive img-circle" src="uploads/'.$u.'/'.$avatar.'" alt="'.$u.'">';
        $coment_pic = '<img class="img-responsive img-circle img-sm" src="uploads/'.$u.'/'.$avatar.'" alt="'.$u.'">';
     echo                     
                 '<div class="box-header with-border"> 
                 <div class="user-block">
                    '. $profile_pic.'
                    <span class="username"><a href="#">'. $row ['username'] .'</a></span>
                    <span class="description">Shared publicly at '. $row ['posted_at'] .' Today</span>
                  </div>
                </div>

                <div id="box_body" class="box-body" style="display: block;">
                  <img class="img-responsive show-in-modal" src="img/Post/young-couple-in-love.jpg" alt="Photo">
                  <p>'. $row ['status'] .'</p>
                  <button type="button" class="btn btn-default btn-xs"><i class="fa fa-share"></i> Share</button>
                  <button type="button" class="btn btn-default btn-xs"><i class="fa fa-thumbs-o-up"></i> Like</button>
                  <span class="pull-right text-muted">127 likes - 3 comments</span>
                </div>
                <div class="box-footer box-comments" style="display: block;">
                  <div class="box-comment">
                    <img class="img-circle img-sm" src="img/Friends/guy-2.jpg" alt="User Image">
                    <div class="comment-text">
                      <span class="username">
                      Maria Gonzales
                      <span class="text-muted pull-right">8:03 PM Today</span>
                      </span>
                      It is a long established fact that a reader will be distracted
                      by the readable content of a page when looking at its layout.
                    </div>
                  </div>
                </div>
                <div class="box-footer" style="display: block;">
                  <form action="#" method="post">
                    '. $coment_pic.'
                    <div class="img-push">
                      <input type="text" class="form-control input-sm" placeholder="Press enter to post comment">
                    </div>
                  </form>
                </div></br></br><br><hr style="margin:25px;">';
    }
     }

}
}

php
public function post_status($u,$post) {
global $conn;
include_once("check_login_status.php");
if($user_ok != true || $log_username == "") {
exit();
}else{
if(isset($_POST)){
$_SESSION['post-data'] = $_POST;
$u = $_SESSION["username"];
$post = trim($_SESSION['post-data']['post']);
$table = "posts";
$time = time();

     $sql = "insert into $table (username,status,posted_at) values('$u','$post','$time')";
     mysqli_query($conn, $sql);

     $sql = "SELECT * FROM $table WHERE username='$u' LIMIT 100";
     $userpost_query = mysqli_query($conn, $sql);
     //build html format as you need it..
    while($row = mysqli_fetch_array($userpost_query, MYSQLI_ASSOC)){
        $avatar = $row["profile_picture_path"];
        $profile_pic = '<img class="img-responsive img-circle" src="uploads/'.$u.'/'.$avatar.'" alt="'.$u.'">';
        $coment_pic = '<img class="img-responsive img-circle img-sm" src="uploads/'.$u.'/'.$avatar.'" alt="'.$u.'">';
     echo                     
                 '<div class="box-header with-border"> 
                 <div class="user-block">
                    '. $profile_pic.'
                    <span class="username"><a href="#">'. $row ['username'] .'</a></span>
                    <span class="description">Shared publicly at '. $row ['posted_at'] .' Today</span>
                  </div>
                </div>

                <div id="box_body" class="box-body" style="display: block;">
                  <img class="img-responsive show-in-modal" src="img/Post/young-couple-in-love.jpg" alt="Photo">
                  <p>'. $row ['status'] .'</p>
                  <button type="button" class="btn btn-default btn-xs"><i class="fa fa-share"></i> Share</button>
                  <button type="button" class="btn btn-default btn-xs"><i class="fa fa-thumbs-o-up"></i> Like</button>
                  <span class="pull-right text-muted">127 likes - 3 comments</span>
                </div>
                <div class="box-footer box-comments" style="display: block;">
                  <div class="box-comment">
                    <img class="img-circle img-sm" src="img/Friends/guy-2.jpg" alt="User Image">
                    <div class="comment-text">
                      <span class="username">
                      Maria Gonzales
                      <span class="text-muted pull-right">8:03 PM Today</span>
                      </span>
                      It is a long established fact that a reader will be distracted
                      by the readable content of a page when looking at its layout.
                    </div>
                  </div>
                </div>
                <div class="box-footer" style="display: block;">
                  <form action="#" method="post">
                    '. $coment_pic.'
                    <div class="img-push">
                      <input type="text" class="form-control input-sm" placeholder="Press enter to post comment">
                    </div>
                  </form>
                </div></br></br><br><hr style="margin:25px;">';
    }
     }

}
}

~~~
php

~~~
and here is the jquery
Thompson Ike
@hubhubace
~~~
javascripy
$(document).ready(function(){
        $('span#welcome_message').html('Welcome friends to a place of satisfaction.').fadeIn(3000).delay(9000).fadeOut(9000);
});
    </script>
         <script type="text/javascript">

 $(document).ready(function() {

  $('#post_btn').click(function(){


    var post = $('#post_text').val();

    if(post == "" ){
       alert("fill in some text!");
    }
    else {
      $.ajax ({
        url:"php/poststatus.php",
        method:"POST",
        data:{post:post},
        success:function(data){
          $("#post_form").trigger("reset");
          $("#box_widget").append(data);


        }

     });

   }
  });
});
iso
@iso1048
@jcunanan05 i use <i>, but I am no expert so that is nothing to go by.
Jonathan Cunanan
@jcunanan05
thanks mr batman @gothamknight :))
CamperBot
@camperbot
jcunanan05 sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 436 | @gothamknight |http://www.freecodecamp.com/gothamknight
iso
@iso1048
@jcunanan05 sure thing peter parker.
Shubham Singh
@imshubhamsingh
Hey guys open https://codepen.io my pen is selected as one of the picked pens
Jorge
@flawedLogic506
@imshubhamsingh looks really nice! congratz
Shubham Singh
@imshubhamsingh
@OrangeKulture thanks bro
CamperBot
@camperbot
imshubhamsingh sends brownie points to @orangekulture :sparkles: :thumbsup: :sparkles:
:cookie: 467 | @orangekulture |http://www.freecodecamp.com/orangekulture
Jorge
@flawedLogic506
sure thing!
I really need to get into canvas .. havent done anything tbh and I do like animations and graphics
where did u learn? @imshubhamsingh
Shubham Singh
@imshubhamsingh
@OrangeKulture Youtube tutorials and few blog posts
and an inspiration too..
Graham Snowdon
@grahamsnowdon
@imshubhamsingh that’s very good. Inspired me a bit.
Jorge
@flawedLogic506
haha yeah i bet! looks nice .. i reaaally need to get into canvas for sure
great work dude @imshubhamsingh , keep it going!
Shubham Singh
@imshubhamsingh
for canvas I learnt basic from here https://www.youtube.com/watch?v=EO6OkltgudE&list=PLpPnRKq7eNW3We9VdCfx9fprhqXHwTPXL ... btw im still noob in canvas but scss ... Im good at it
George Kemp
@gkemp94
@imshubhamsingh For good reason, that's an awesome effect! :)
George Kemp
@gkemp94
Anybody here an expert on regex?
I'm getting some bizarre results that I don't understand.
Henry
@GitHub-Henry
@imshubhamsingh nice pen
buiphuking
@buiphuking
help me guy, i learn discrete mathematics, plz introduce me a forum like this, plz, guy......
Shubham Singh
@imshubhamsingh
@gkemp94 @GitHub-Henry I know...
Jorge
@flawedLogic506
@buiphuking what do u mean?
@gkemp94 there's several small sites that you can actually test your expressions
buiphuking
@buiphuking
@OrangeKulture i need a place like this to ask any thing about discrete mathematic
piteto
@piteto
@buiphuking Try asking on reddit? https://www.reddit.com/r/learnprogramming
This place is for asking about the Front End Projects at Free Code Camp - building a quote machine, weather app, etc.
Moisés Man
@moigithub
googling "math forums" shows a lot of results
Sajid Unar
@sajidunnar
@buiphuking try irc or you canc reate your channel ;) maybe u can get people here
buiphuking
@buiphuking
@piteto @sajidunnar thank