Jump to content

limitphp

Members
  • Posts

    706
  • Joined

  • Last visited

Posts posted by limitphp

  1. I have a column datetime called date.

    Here's the value of an entry for the datetime:

    2009-05-10 06:06:55

     

    here's the code:

    $date = $row_inbox['date'];
    $date = date('D, M d, Y  g', $date);

     

    its returning:

    Wed, Dec 31, 1969 6

     

    I want it to return short day, short month day, year time

     

    Does anyone know what I am doing wrong?

  2. I get all comments for a song with this:

    SELECT songCommentID, username,date,comment 
    FROM songcomments 
    WHERE songID = '$songID' 
    ORDER BY date ASC

     

    As its pulling each comment from the songcomments table, I need it to check another table to see if the user has reported that particular comment.

    The table it will check will be report_comments.  I'm guessing I will need to have an inner join? to report_comments and check to see if the userID and songCommentID match up.  If they do, then the user has already reported it. 

     

    thanks for any help....my brain is a little confused right now.....

  3. How do you handle credit card transactions?

    Is it best to use someone like paypal or google checkout?

     

    The mp3's I'll be selling will be very inexpensive...less than a dollar.  A microtransaction.  Google checkout is the cheapeast, so far, if I use their adwords.

     

    Is it possible to handle credit card transactions myself? 

  4. I am currently hosted on lunarpages.com

    What I want to do is sell mp3's of local artists.  I only want people to be allowed to download the mp3 if they purchase it.

     

    Is there a best practice method of restricting access to a file, and then allow access only if someone purchases the mp3.  Using a url key or something?

     

    How is this done?

  5. I prefrt using the id, since almost all tables have a id INT(11) AUTO_INCREMENT field.

    But yeah, why make a id/hash system if ya dun use em

     

     

    I would assume to not use the id, since we want the site to be SEO friendly.

     

    The hash names were going to be used to fix the artistName and songName to make them ok for url....

     

    but I figure why enter in each hash name manually, when urlencode will take care of the problem for you?

     

    the only thing is, the percent and urlencode might mess up the adobe mod rewrite.....

     

  6. I have links that have artistName and songName in them.

    Right now I have a column that has artistNameHash and songNameHash and those are what I use for the links.

    ex)

    mysite.com/comments/$artistNameHash/$songNameHash

     

    when I add the artists and songs to the database, thats when i manually add the songNameHash and artistNameHash.....there are no set rules I use....

    so far I'm replacing spaces with dashes and single quotes with underscores....I haven't had any other symbols yet...because I'm just using test songs so far.

     

    so, my mod rewrite handles underscores and dashes.....

     

    I'm thinking I should change it to handle it like this:

    add the song name and artist name to the database when I add the song.

     

    Don't worry about adding a songNameHash and artistnameHash column to my database.

     

    When I need to link using the songName and artistName, run both through the urlencode and use that:

    ex)

    $url_artistName = urlencode($artistname);
    $url_songname = urlencode($songName);
    
    mysite.com/comments/$url_artistName/$url_songName/

     

    and then, fix the mod rewrite to accept all the characters urlencode throws at it.

     

    When the request comes in:

    $artistName = $_GET('artistName');

    it'll get converted back automatically into the original artistname, correct?

     

    does this sound like the better way to do it?

     

    thanks

     

  7. thanks for the reply, ahs10....

    I don't see any real reason why I would need to go in the song clips folder and do anything, other than

    - add songs as new artist sell their music on my site and

    - maybe occasionally replace a clip if it is messed up for some reason.

     

    Other than that, there's no reason for me to go in there.

    No one else will go in there unless my site grows and I need to hire someone to help me out to do the above tasks.

     

    The way i see me adding music to my site is like this:

    an artist gives me a CD.  I rip and put in the ID3 info using LAME or something similar.  I use a program that will make a short clip from the mp3.

    I'll rename the short mp3 clip to the appropriate name (songID.mp3)

     

    I assume whatever I use for the short mp3 clip names, it'll come from the database.  The songIDs are already there, that's why it would be easy.

     

    I also store artistNameHash, and songNameHash, but I don't have any set rules for how I change the names.  So far, I replace the spaces with a dash and single quotes with an underscore.

     

    Is the rawurlencode supposed to be used to create the hash names for you?

    If so, I need to update how the hashes are created.

     

     

     

     

  8. My website will have clips of songs for people to listen to (45-60 seconds), kind of like itunes.

     

    I assume the best way is to have those clips stored as mp3s somewhere.

    o you think I should name the mp3 clips the songID.mp3?

    so they'd be:

    1.mp3, 2.mp3, 89.mp3, etc....

    or do you think I should use artistName_title.mp3 or something similar?

     

    I figure it doesn't matter what the clip name is, they'll see the id3 info or the title and artist info regardless in the tiny built-in flash player on the website.

     

    Using songID could simplify things. I don't have to worry about titles with wierd characters.  Although I would have the songNameHash available to use.

     

    If I need to look up some song clips and delete them or something I could just use the database to pull up the songs I'm looking for and find the songIDs for them....

     

    Anyone see a downside to using songID.mp3?

  9. There's a nice looking, customisable, tiny wordpress plugin that you could almost certainly adapt. http://www.1pixelout.net/code/audio-player-wordpress-plugin/

     

    I have downloaded that one....

    its 12Kb for the swf file and another 12KB for the audio-uncompressed.js file and another 12KB for the required sw_library js file.

     

    I'm looking at sourceforge for some.....if I can't find any really tiny easy to control via javascript ones, I'll try and figure this auioplayer from word press out.

     

    thanks

  10. I'm building a website where independent artists can sell their music, and I'm going to have play buttons that you click to play clips of their songs (like 45 seconds).

     

    What is a good quick way to load those clips and play them?

    Having those clips in mp3 format and pointing to them?

     

    Using flash?

     

    Something else?

     

    It doesn't need to look pretty, just load the clip fast.

  11. I see alot of them on the internet for free to use.

    Can anyone reccommend one?

    I'm looking for something pretty much like amazon uses.

    You can click on a song it it will play the clip....pretty simple...

    only like amazon, I would like it to work with multiple songs as well....

    like on their album pages....where you can click preview all at the top and it will cycle through all the clips of all the songs on the page.

  12. First, if it is only for dates, use DATE instead of DATETIME. YOu save 4 bytes per row.

    Second: MySQL's datetime format is YYYYMMDDHHMMSS, you can use just about any separators with that, for example YYYY-MM-DD HH:MM:SS

     

    Third: You can actually use any format you like, provided that your script will transform it to MySQL compatible format before inserting.

     

    If I change it to DATE, can i still do this:

    WHERE date > NOW()-INTERVAL 7 DAY

     

     

  13. I am building a page that will be used to add songs to my website.

    It will have songName, Genre, and copyrightDate

    copyright Date is a datetime field.

     

    How would I enter it in a textbox?  Do I have to include the time?

     

    The reason it is a datetime field is because I know how to do searches on that type of field based on dates....

  14. Very possible to do, although the title talks about checkboxes? Here is an example:

     

    <?php
    $amt = $_GET['songAmount'];
    $genres = array('Rock', 'Rap', 'Country');
    for ($x = 0; $x < $amt; $x++)
    {
         echo "<select name='genre[$x]'>";
              for ($y = 0; $y < sizeof($genres); $y++)
                   echo "<option value='$genres[$y]'>$genres[$y]</option>";
         echo "</select>";
    }
    

     

    Sorry about that...I meant drop down select lists.....

    When I click the go button to submit how many songs I need it will call a javascript function that will inject these lists in the html page via a innerHTML call....

    sort of like this:

    var num = document.frm.members.value;
    var value1='';
    for (var i=1; i<=num; i++)
    	{
    
    	//select drop down here
    		}
    		document.getElementById('membersBox').innerHTML = value1;
    

     

    Actually...I think I know how I'll do it....

     

     

  15. I have a page where I add artists' songs to my website.  Its an admin page for just me.

    There will be a box that says how many songs do I want to add.

    After I put in the number and hit a go button.....the page will add:

    a textbox for the song name.

    a drop down select with a list of all the genres to select the genre for that particular song.

     

    it will add these two items for as many songs as I put in the number for.

     

    My question is this.....

    the genre drop down list will use php to fill it.  It will be a simple query that gets all the genres from the genre table and displays them in the select drop down list.

     

    I will need to fill the select drop down once with php, but is it possible to repeat this drop down list like I want to do?

     

    thanks

×
×
  • 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.