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
piteto
@piteto
@gkemp94 to add a class, delay, and then remove a class, use setTimeout or a Promise
Not sure if that's the animation you're referring to
George Kemp
@gkemp94
sure is. I was thinking about setTimeout. I'll give that a go thanks.
Ismail Hozain
@ismailhozain
hey guys im working on the twitch.tv thing and i got the apis running but i dont know which bit of information to target from my console here it is
iso
@iso1048
@ismailhozain not answering your question, but you could put the usernames in an array and loop through the array, making an ajax call with each iteration of the loop. This avoids repeating the same code multiple times.
Ismail Hozain
@ismailhozain
ok
i have a faint idea of how to do it and it involves setting up a for loop then setting each username to a numerical value then iterating through them in the loop but i wil have to do that twice to get all my info
Gersho
@Gersho
try http://jsonprettyprint.com @ismailhozain
copy the object you get in there and it'll show you "pretty"
Ismail Hozain
@ismailhozain
@Gersho do i paste whats in my console or my code
?
oh ok
Gersho
@Gersho
the object you can as answer from your call
Ismail Hozain
@ismailhozain
it gives me null
Gersho
@Gersho
you can get it by using the call url directly in your browser
https://wind-bow.glitch.me/twitch-api/channels/ogamingsc2
Ismail Hozain
@ismailhozain
thats nice but how do i target each of those elements
Gersho
@Gersho
copy the object you obtained in the prettyfier i linked earlier
Ismail Hozain
@ismailhozain
ok
Gersho
@Gersho
you should get a more readable version of that object
Ismail Hozain
@ismailhozain
that is not what i am talking about i got that object already but how do i target those welements so i can output them in my code
elements
Ismail Hozain
@ismailhozain
ok thanks
mambasnoww
@mambasnoww
Hello can someone help me
Markus Kiili
@Masd925
@mambasnoww You can just ask the question and perhaps post the relevant code here.
BuntyBru
@BuntyBru
Can anyone tell me the difference between "inline" and "inline-block"
iso
@iso1048
@BuntyBru inline-block keeps the element inline but allows you to style it as if it were a block element
BuntyBru
@BuntyBru
@gothamknight
thanks
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 :))