Recent Updates Page 2 Toggle Comment Threads | Keyboard Shortcuts

  • Christofian 11:02 pm on January 21, 2012 Permalink
    Tags: , google docs,   

    Google can create equations easily. Use this url: https://www.google.com/chart?cht=tx&chf=bg,s,FFFFFF00&chco=000000&chl=\frac{5}{10}*2x^3y^2

    replace the get variable chl with your equation. To create fractions include this: \frac{firstnumber}{secnumber} There’s probably more.

    Found by publishing a google doc with an equation in it, and getting the url of the image that contained the equation in the published google doc.

    Advertisements
     
  • Christofian 4:09 am on January 13, 2012 Permalink
    Tags: ,   

    Don’t like google’s personalized results being the default selection? Just add this qet variable to the url:

    pws=0
     
  • Christofian 9:09 pm on January 2, 2012 Permalink
    Tags:   

    http://stackoverflow.com/questions/8641181/html-form-to-multiple-emails How to handel multiple items in forms (such as multiple email addresses)

     
  • Christofian 6:12 pm on December 31, 2011 Permalink
    Tags:   

    Foreach and arrays 

    I had a mysql query, and I needed to store the data for later. So, I:

    1.created an array

    $array = array();

    2. as I looped through the mysql data, I added that data to the array

    $array[] = $mysqldata;

    3. I then later used a foreach to loop through the array:

    foreach($array  as $data) { //this code looped through $array, and each time it get's data from the array it assignes it to $data
    echo $data;
    }

    Bonus: foreaching through two arrays:

    foreach(array_combine($array, $array1)  as $data => $data1) {
    echo $data;
    echo $data1;
    }

    Extra Bonus: foreaching with three arrays:

    foreach (array_map(NULL, $array1, $array2, $array3) as $x) {
      list($array1, $array2, $array3) = $x;
    echo $array1;
    echo $array2;
    echo $array3;
    }
     
  • Christofian 12:54 am on December 31, 2011 Permalink
    Tags:   

    Get Post Count Of WP_Query 

    $the_query_new = new WP_Query(array('post_type' => 'grade', 'assignment' => $theassignmentID));
    $points3 = $the_query_new->found_posts;
    

    create a new wp_query, then do

    $wp_query_variable->found_posts

    That will give you the number of posts that the wp_query finds.

     
  • Christofian 1:23 am on December 30, 2011 Permalink
    Tags:   

    To “sort” dates in php, see here: http://stackoverflow.com/questions/2832467/php-how-can-i-check-if-the-current-date-time-is-past-a-set-date-time

    Use strtotime (http://php.net/manual/en/function.strtotime.php) to convert 06-07-2012 to a unix time format that php can sort.

    Update: difference between mm-dd and dd-mm: http://stackoverflow.com/questions/8554414/strtotime-not-working-with-mm-dd-yyyy

     
  • Christofian 10:09 pm on December 29, 2011 Permalink
    Tags: javascript   

    http://stackoverflow.com/questions/8672369/how-to-draw-a-line-between-two-divs

    How to draw a line between two divs.

     
  • Christofian 10:06 pm on December 28, 2011 Permalink
    Tags:   

    this is pretty cool:

    /*
    echo "hi";
    echo "hey"; // */
    

    Now, I can quickly comment and comment that line of code by removing the topmost /*. See here

    echo "hi";
    echo "hey"; // */
    
     
  • Christofian 3:44 pm on December 28, 2011 Permalink
    Tags: ,   

    http://www.phpbb3seo.com/phpbb3-seo/how-to-optimize-phpbb3-page-titles-p28.html

    viewforum.php & viewtopic.php

    Find: page_header
    Edit the line so it looks like: page_header($topic_data[’topic_title’]);

    overall_header.php

    Edit the content of the title tags so it looks like: {PAGE_TITLE} @ {SITENAME}

     
  • Christofian 7:51 pm on December 27, 2011 Permalink
    Tags:   

    PHPBB Popular Posts 

    This is an mysql query to get a list of the popular posts in phpbb. Created Because of http://communityadmins.com/activity-streams-on-your-community-vt3374.html

    Version #1

    SELECT * FROM `phpbb_topics` ORDER BY ABS( ( ( `phpbb_topics`.`topic_views` *-1 ) - (`phpbb_topics`.`topic_replies` *5 ) ) / ( `phpbb_topics`.`topic_time`) )
    

    NOTE: replace

    phpbb_topics

    with your topics table.
    NOTE To WordPress.Com: You should make it so that the sourcecode shortcode supports mysql 🙂

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel