Plugin Directory

Changeset 1079176


Ignore:
Timestamp:
01/30/2015 07:20:57 PM (11 years ago)
Author:
Ansr
Message:

updating to work with newest version of wordpress

Location:
hangouts-cosmoquest/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • hangouts-cosmoquest/trunk/readme.txt

    r904882 r1079176  
    33Donate link: http://cosmoquest.org/x/donate/
    44Tags: hangout, hangouts, cosmoquest, ansr, live
    5 Requires at least: 3.9
    6 Tested up to: 3.9
     5Requires at least: 4.1
     6Tested up to: 4.1
    77Stable tag: trunk
    88License: GPLv2
     
    2222can set your channel Settings, Add/Edit recurring show descriptions, and add an upcoming
    2323show description or embed code for a live event. Embed the plugin output on a post or page
    24 with the code [hangouts] and use the Widget options in your Appearance menu to add to your sidebar.
     24with the code [hangout] and use the Widget options in your Appearance menu to add to your sidebar.
    2525
    2626
     
    3737
    3838== Changelog ==
    39 
     39= 1.1 =
     40*updated the code to work with most recent versions of wordpress
    4041= 1.0 =
    4142*first version
    4243== Upgrade Notice ==
    43 
     44= 1.1 =
     45upgrade if using 4.0 or higher certain database calls this plugin made stopped working after 3.9
    4446= 1.0 =
    4547not an upgrade
  • hangouts-cosmoquest/trunk/wp_hangouts.php

    r904882 r1079176  
    155155                array('%d')
    156156            );
    157             $show_id = mysql_real_escape_string($_POST['show']);
    158             $show_description = mysql_real_escape_string($_POST['show_description']);
    159             $get_show = $wpdb->get_results("SELECT * FROM $hangout_shows WHERE id = $show_id",ARRAY_A);
     157            $show_id = $_POST['show'];
     158            $show_description = $_POST['show_description'];
     159            $query = $wpdb->prepare("SELECT * FROM $hangout_shows WHERE id = %s",$show_id);
     160            $get_show = $wpdb->get_results($query,ARRAY_A);
    160161            if (count($get_show) == 0){
    161162                echo "Invalid show number"; die();
     
    184185            }//starting the hangout
    185186            else if ($_POST['task'] == "start") {                 
    186                     $orig = $_POST['embed'];
    187                     $embed = mysql_real_escape_string($orig);           
     187                    $embed = $_POST['embed'];           
    188188                    // Get the hashtag for twitter
    189                     $hashtag = mysql_real_escape_string($_POST['tag']);
     189                    $hashtag = $_POST['tag'];
    190190                    $results = $wpdb->get_results("SELECT id FROM $hangouts order by id desc limit 1",ARRAY_A);
    191                     $show_id = mysql_real_escape_string($_POST['show']);               
     191                    $show_id = $_POST['show'];             
    192192                    $wpdb->update(
    193193                    $hangouts,
     
    321321    if(isset($_POST['hangout_action'])){       
    322322        if($_POST['hangout_action'] =='add_show'){
    323             $name = mysql_real_escape_string($_POST['show_name']);
    324             $url = mysql_real_escape_string($_POST['show_url']);
    325             $description = mysql_real_escape_string($_POST['description']);
     323            $name = $_POST['show_name'];
     324            $url = $_POST['show_url'];
     325            $description = $_POST['description'];
    326326            $wpdb->insert( $table_name,
    327327            array( 'name' => $name,'url' => $url,'description' => $description), 
     
    332332        }
    333333        else if ($_POST['hangout_action'] =='update_show'){
    334           $description = mysql_real_escape_string($_POST['description']);
    335           $delete = mysql_real_escape_string($_POST['delete']);
    336           $name = mysql_real_escape_string($_POST['show_name']);
    337           $url = mysql_real_escape_string($_POST['show_url']);
    338           $id = mysql_real_escape_string($_POST['show_id']);
     334          $description = $_POST['description'];
     335          $delete = $_POST['delete'];
     336          $name = $_POST['show_name'];
     337          $url = $_POST['show_url'];
     338          $id = $_POST['show_id'];
    339339          if($delete =="delete"){
    340340            $wpdb->delete( $table_name, array('id'=>$id), array( '%d' ) );
     
    391391        if($_POST['hangout_action'] =='link_channel'){
    392392            $table_name = $wpdb->prefix . "hangout_data";
    393             $youtube_channel_name = mysql_real_escape_string($_POST['youtube_channel_name']);
    394             $youtube_channel_url = mysql_real_escape_string($_POST['youtube_channel_url']);
    395             $youtube_channel = mysql_real_escape_string($_POST['youtube_embed']);
    396             $link_channel = mysql_real_escape_string($_POST['link_channel']);
    397             $link_text = mysql_real_escape_string($_POST['link_text']);
    398             $width = mysql_real_escape_string($_POST['width']);
     393            $youtube_channel_name = $_POST['youtube_channel_name'];
     394            $youtube_channel_url = $_POST['youtube_channel_url'];
     395            $youtube_channel = $_POST['youtube_embed'];
     396            $link_channel = $_POST['link_channel'];
     397            $link_text = $_POST['link_text'];
     398            $width = $_POST['width'];
    399399            if(is_numeric($width)){
    400400                if($width < 1 || $width > 5000)
     
    402402            }
    403403            else
    404                 die("WIDTH IS NOT A NUMBER");
    405             $delete = $wpdb->query("TRUNCATE TABLE '$table_name'");
    406             $wpdb->insert($table_name,
     404                die("WIDTH IS NOT A NUMBER");
     405            $wpdb->replace($table_name,
    407406                array(
     407                'id' => 1,
    408408                'youtube_channel_name' => $youtube_channel_name,
    409409                'youtube_channel_url' => $youtube_channel_url,
     
    413413                'width' => $width
    414414                ), 
    415                 array('%s','%s','%s','%s','%d','%d')
     415                array('%d','%s','%s','%s','%s','%d','%d')
    416416                );
    417417                echo"<script>alert('Information Updated')</script>";
     
    444444            }
    445445            else{
    446                 embed.value = temp.src;
     446                embed.value = temp.src; 
    447447                document.getElementById("update_settings").submit();
    448448            }
Note: See TracChangeset for help on using the changeset viewer.