Jump to content

SkyRanger

Members
  • Posts

    738
  • Joined

  • Last visited

Posts posted by SkyRanger

  1. Working on a media player for my website that users can download and listen to without needing to install 3rd party media player.  I am having a problem pulling and showing the information from the array.

    Dim tags As String() = Bass.BASS_ChannelGetTagsMETA(stream)
            If tags Is Nothing Then
                ' try http...
                tags = Bass.BASS_ChannelGetTagsHTTP(stream)
            End If
            If Not (tags Is Nothing) Then
                Dim tag As String
                For Each tag In tags
                    Console.WriteLine(tag)
                Next tag
            End If

    This is an example of what is being pulled and shown in console:

    Quote

    StreamTitle='Judy Garland - Have Yourself A Merry Little Christmas';StreamUrl='&artist=Judy%20Garland&title=Have%20Yourself%20A%20Merry%20Little%20Christmas& album=100%20Classic%20Christmas%20Songs&duration=164754&songtype=S&overlay=NO&buycd=&website=&pictur e=az_99_100%20Classic%20Christmas%20Songs_Judy%20Garland.jpg';

    Information I am trying to pull is StreamTitle, Artist and Title.

  2. Thanks Barand. Yeah I don't think I explained that correctly.

    table is called songlist with multiple columns but only pulling info from 2 of them .  title = song title and artist = song artist.  I have multiple song titles with the same name.  ie: Jingle Bells sung by different artist.  Right now I have it showing all the songs in the list without grouping them together. So once the person picks on a song title in the first box a list of artists shows in the second box who did that song.

  3. Not sure why I am thinking this is so hard but keep getting an error in my code (Visual Basic)

    Situation:

    database = xmas
    table = songlist
    column 1 = title
    column 2 = artist

    I have 2 dropdown boxes being populated
    box 1 is the title
    box 2 is the artist

    When person choses song in box 1 it populates the artist name in box 2 (this part is working) . The problem I am running in to is I need to group all of the songs that are the same to be listed in box 1 but not group the names in box 2

    I have(had) select * from songlist group by  title

  4. After scratching my head and staring at it for a bit.  Figured it out.  Need to verify a proper email is entered before continuing.

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    
            Dim par As String
            par = "^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$"
            If Regex.IsMatch(txtEMAIL.Text, par) Then
                If txtFULLNAME.Text = "" Then
                    Form6.Show()
                    Form6.Label1.Text = "You must enter your Full Name"
                ElseIf txtEMAIL.Text = "" Then
                    Form6.Show()
                    Form6.Label1.Text = "You must enter your Email Address"
                Else
                    Form5.Show()
                    Form2.txtFULLNAME.Text = txtFULLNAME.Text
                    Form3.txtFULLNAME.Text = txtFULLNAME.Text
                    Form4.txtFULLNAME.Text = txtFULLNAME.Text
                    Form5.txtFULLNAME.Text = txtFULLNAME.Text
                    Form2.txtEMAIL.Text = txtEMAIL.Text
                    Form3.txtEMAIL.Text = txtEMAIL.Text
                    Form4.txtEMAIL.Text = txtEMAIL.Text
                    Me.Hide()
    
                End If
            Else
                Form6.Show()
                Form6.Label1.Text = "You must enter a proper Email Address"
            End If
    
    
        End Sub

     

  5. Trying to figure out how to verify if email is an email.  txtEMAIL.Text

    Imports System.Text.RegularExpressions
    
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    
            If txtFULLNAME.Text = "" Then
                Form6.Show()
                Form6.Label1.Text = "You must enter your Full Name"
            ElseIf txtEMAIL.Text = "" Then
                Form6.Show()
                Form6.Label1.Text = "You must enter your Email Address"
            Else
                Form5.Show()
                Form2.txtFULLNAME.Text = txtFULLNAME.Text
                Form3.txtFULLNAME.Text = txtFULLNAME.Text
                Form4.txtFULLNAME.Text = txtFULLNAME.Text
                Form5.txtFULLNAME.Text = txtFULLNAME.Text
                Form2.txtEMAIL.Text = txtEMAIL.Text
                Form3.txtEMAIL.Text = txtEMAIL.Text
                Form4.txtEMAIL.Text = txtEMAIL.Text
                Me.Hide()
    
            End If
        End Sub

    Trying to figure out how to insert the Regex in to what is above to have it work properly

    Dim par As String
    par="^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$"
    If Regex.IsMatch(txtEMAIL.Text, par) Then
     'do nothing and continue'
    Else
     Form6.Show()
     Form6.Label1.Text = "You must enter a proper Email Address"
    End If

     

  6. Not sure what I am missing. When submitted gives white page with no submission. Error check is not showing anything.

     global $userdata, $current_user;
    
    $tablename=kudos_table_name();
    
    // Functions to filter user inputs
    function filterkudoagent($field){
        // Sanitize user name
        $field = filter_var(trim($field), FILTER_SANITIZE_STRING);
    
        // Validate user name
        if(filter_var($field, FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>"/^[a-zA-Z-\s]+$/")))){
            return $field;
        } else {
            return FALSE;
        }
    }
    
    function filterkudocust($field){
        // Sanitize user name
        $field = filter_var(trim($field), FILTER_SANITIZE_STRING);
    
        // Validate user name
        if(filter_var($field, FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>"/^[a-zA-Z-\s]+$/")))){
            return $field;
        } else {
            return FALSE;
        }
    }
    
    
    function filterString($field){
        // Sanitize string
        $field = filter_var(trim($field), FILTER_SANITIZE_STRING);
        if(!empty($field)){
            return $field;
        } else{
            return FALSE;
        }
    }
    
    $kudoagentErr = $agentlocErr = $kudoclientErr = $kudocustErr = $kudomsgErr = $kudoadnErr = "";
    $kudoagent = $agentloc = $kudoclient = $kudocust = $kudomsg = $kudoadn = "";
    
    if ($_SERVER["REQUEST_METHOD"] == "POST")
        {
    
        if(empty($_POST["kudoagent"])){
            $kudoagentErr = "Please enter agent name.";
        } else{
            $kudoagent = filterkudoagent($_POST["kudoagent"]);
            if($kudoagent == FALSE){
                $kudoagentErr = "Please enter a valid agent name.";
            }
        }
    
        if(empty($_POST['agentloc'])){
            $agentlocErr = "You must select a location";
        }
    
        if(empty($_POST['kudoclient'])){
            $kudoclientErr = "You must select a queue";
        }
    
        if(empty($_POST["kudocust"])){
            $kudocustErr = "Please enter customer name.";
        } else{
            $kudocust = filterkudocust($_POST["kudocust"]);
            if($kudocust == FALSE){
                $kudocustErr = "Please enter a valid customer name.";
            }
        }
    
        if(empty($_POST["kudomsg"])){
            $kudomsgErr = "Please enter the kudos.";
        } else{
            $kudomsg = filterString($_POST["kudomsg"]);
            if($kudomsg == FALSE){
                $kudomsgErr = "Please enter a valid kudos.";
            }
        }
    
        if(empty($_POST["kudoadminname"])){
            $kudoadnErr = "Please enter the posters name.";
        } else{
            $kudoadn = filterkudocust($_POST["kudoadminname"]);
            if($kudoadn == FALSE){
                $kudoadnErr = "Please enter a valid posters name.";
            }
        }
    
        if (isset($_POST['kudoagentid']) && trim($_POST['kudoagentid']) != '') {
        $kudoagidErr = "Enter Agent ID or leave blank";
    }
    else {
        $kudoacctErr = "";
    }
    
        if (isset($_POST['kudoacct']) && trim($_POST['kudoacct']) != '' && !ctype_digit($_POST['kudoacct'])) {
        $kudoacctErr = "Only numbers are permitted or leave blank";
    }
    else {
        $kudoacctErr = "";
    }
    
         if(empty($kudoagentErr) && empty($kudocustErr) && empty($kudomsgErr) && empty($agentlocErr) && empty($kudoclientErr) && empty($kudoadnErr)){
    
    
    
         global $wpdb;
                $table = $tablename;
                $kudokey = randkey();
                $kudoposted = date("Y-m-d H:i:s");
                $data = array(
                    'kudoid' => '',
                    'kudomsg'    => $_POST['kudomsg'],
                    'kudoagent' => $_POST['kudoagent'],
                    'kudoagentid' => $_POST['kudoagentid'],
                    'kudocust'    => $_POST['kudocust'],
                    'kudoacct' => $_POST['kudoacct'],
                    'kudoclient'    => $_POST['kudoclient'],
                    'kudoloc' => $_POST['agentloc'],
                    'kudoentry'    => $kudoposted,
                    'kudoadmin'    => $_POST['kudoadminname'],
                    'kudopic'     => $_POST['kudobanner'],
                    'kudostatus'   => '1',
         			'kudokey'  => $kudokey,
                );
                $format = array(
                    '%s',
                    '%s',
                    '%s',
                    '%s',
                    '%s',
                    '%s',
                    '%s',
                    '%s',
                    '%s',
                    '%s',
                    '%s',
                    '%s',
                    '%s'
                );
                $success=$wpdb->insert( $table, $data, $format );
                if($success){
    
            echo "<blockquote class=\"otro-blockquote\">";
            echo nl2br($_POST['kudomsg']);
            echo "<span>";
            echo "<b>Kudos for:</b> " .$_POST['kudoagent']. "  " .$_POST['kudoagentid']. ", ".$_POST['agentloc'];
      		echo "<br>By: ".$_POST['kudocust']. ", " . date("F j, Y g:i a", strtotime($kudoposted));
      		echo "<br/>" .$_POST['kudoacct'];
      		echo "<br/> Submitted By: " .$_POST['kudoadminname'];
            echo "</span></blockquote>";
            $urlparts = parse_url(home_url());
            $kudourl = $urlparts['host'];
    
             echo "<div class='success_msg'>Kudos Submitted</div>";
    
                }
        }
    
        } else {
    
    ?>   
    
    	<h3>Add Kudos - No Notification Sent</h3>
        <b>* states required</b>
    
    <form name="kudos_form" id="submitkudos" method="post" action="" enctype="multipart/form-data">
        <table class="addkudotable">
        <tr>
            <td>Agent Name *</td>
            <td>     </td>
            <td><input name="kudoagent" type="text" value="<?php echo $_POST['kudoagent']; ?>"/>
             <?php echo "<div class='note'>".$kudoagentErr."<br/>";?>
            </td>
        </tr>
        <tr>
            <td>Agent ID</td>
            <td></td>
            <td><input name="kudoagentid" type="text" value="<?php echo $_POST['kudoagentid']; ?>" />
            <?php echo "<div class='note'> </div>";?>
            </td>
        </tr>
        <tr>
            <td>Agent Location *</td>
            <td></td>
            <td><select name="agentloc" size="1">
        <option value="<?php echo $_POST['agentloc']; ?>"><?php echo $_POST['agentloc']; ?></option>
        <option></option>
        <option value="Amherst Center">Amherst Center</option>
        <option value="Charlottetown Center">Charlottetown Center</option>
        <option value="Kingston Center">Kingston Center</option>
        </select>
            <?php echo "<div class='note'>".$agentlocErr."</div>";?>
            </td>
        </tr>
        <tr>
            <td>Agent Queue *</td>
            <td></td>
            <td><select name="kudoclient" size="1">
        <option value="<?php echo $_POST['kudoclient']; ?>"><?php echo $_POST['kudoclient']; ?></option>
        <option value=""></option>
        <option value="AR">AR</option>
        <option value="Eastlink Tech Support">Eastlink Tech Support</option>
        <option value="PNI">PNI</option>
        </select>
            <?php echo "<div class='note'>".$kudoclientErr."</div>";?>
        </td>
        </tr>
        <tr>
            <td></td>
            <td></td>
            <td></td>
        </tr>
            <tr>
            <td>Customer Name *</td>
            <td></td>
            <td><input name="kudocust" type="text" value="<?php echo $_POST['kudocust']; ?>"/>
            <?php echo "<div class='note'>".$kudocustErr."</div>";?>
            </td>
        </tr>
            <tr>
            <td>Customer Account #</td>
            <td></td>
            <td><input name="kudoacct" type="text" value="<?php echo $_POST['kudoacct']; ?>" />
            <?php echo "<div class='note'>".$kudoacctErr."</div>";?>
            </td>
        </tr>
            <tr>
            <td>Kudos *</td>
            <td></td>
            <td><textarea cols="50" name="kudomsg" rows="5"><?php echo $_POST['kudomsg']; ?></textarea>
            <?php echo "<div class='note'>".$kudomsgErr."</div>";?>
            </td>
        </tr>
            <tr>
            <td></td>
            <td></td>
            <td></td>
        </tr>
            <tr>
            <td>Choose Image</td>
            <td></td>
            <td><select onchange="$('#imageToSwap').attr('src', this.options[this.selectedIndex].value);" name="kudobanner">
        <option value="<?php echo plugins_url(); ?>/img/kudos/1.jpeg" selected>Kudos 1</option>
        <option value="<?php echo plugins_url(); ?>/kudos/img/kudos/2.jpg">Kudos 2</option>
        <option value="<?php echo plugins_url(); ?>/kudos/img/kudos/3.png">Kudos 3</option>
        <option value="<?php echo plugins_url(); ?>/kudos/img/kudos/4.png">Kudos 4</option>
        <option value="<?php echo plugins_url(); ?>/kudos/img/kudos/5.png">Kudos 5</option>
        <option value="<?php echo plugins_url(); ?>/kudos/img/kudos/6.jpg">Kudos 6</option>
        <option value="<?php echo plugins_url(); ?>/kudos/img/kudos/7.jpg">Kudos 7</option>
        <option value="<?php echo plugins_url(); ?>/kudos/img/kudos/8.jpg">Kudos 8</option>
        <option value="<?php echo plugins_url(); ?>/kudos/img/kudos/9.png">Kudos 9</option>
    </select></td>
        </tr>
            <tr>
            <td>Agent submitting Kudos</td>
            <td></td>
            <td><input name="kudoadminname" type="text" value="<?php echo $_POST['kudoadminname']; ?>">
             <?php echo "<div class='note'>".$kudoadnErr."</div>";?></td>
        </tr>
            <tr>
            <td> </td>
            <td><input type="hidden" name="action" value=""/></td>
            <td></td>
        </tr>
            <tr>
            <td><button type="submit" value="submit" class="aciformbutton" name="submit" />Submit Kudos</button>
            <td></td>
            <td><button type="reset" value="reset" class="aciformbutton">Start Over</button></td>
        </tr>
    
    </table>
    <input type="hidden" value="" name="kudoentry">
    </form>
    <script>
    
    </script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
    <?php
    echo "<img id=\"imageToSwap\" class=\"profile\" src=" . plugins_url() . "/kudos/img/kudos/1.jpeg>";
    
    }

     

  7. Having a validation issue when a person enters a - in there name it is kicking it back as invalid.

    For axample:

    Mary-Ann  Invalid 
    Mary Ann Valid

    Tried including the - but causing myself a lot of grief.

    function filterkudoagent($field){
        // Sanitize user name
        $field = filter_var(trim($field), FILTER_SANITIZE_STRING);
    
        // Validate user name
        if(filter_var($field, FILTER_VALIDATE_REGEXP, array("options"=>array("regexp"=>"/^[a-zA-Z\s]+$/")))){
            return $field;
        } else {
            return FALSE;
        }
    }

     

  8. Awesome Barand thank you.  I also see what I can start it on any day.  Again thank you.  Much easier than what I was attempting to do and PS: This link in your signature.  Still reading it over. Thank you

  9. I am currently working on a date range script and wondering if anybody think of an easier way to do this, doing up to next 8 weeks?  This one starts on a Sunday. I also need to do one starting on a Monday (will figure that one later)

    $thisweek = date("Y-m-d");
    $week = date('w', strtotime($thisweek));
    $date = new DateTime($thisweek);
    $firstWeek = $date->modify("-".$week." day")->format("M d");
    $endWeek = $date->modify("+6 day")->format("M d");
    echo $firstWeek." - ";
    echo $endWeek;
    
    $nextweek = date(("Y-m-d"), strtotime("+7 Days"));
    $week1 = date('w', strtotime($nextweek));
    $date1 = new DateTime($nextweek);
    $firstWeek1 = $date1->modify("-".$week1." day")->format("M d");
    $endWeek1 = $date1->modify("+6 day")->format("M d");
    echo $firstWeek1." - ";
    echo $endWeek1;

     

  10. Thanks Barand, I actually got it to work perfectly from the Sept 9th post you helped me with but been away for a bit and first time back to comment on benanamen post and try to solve another problem I posted in a different through with pulling random posts that I know I have done dozens of times but having a brain meltdown...lol

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.