Programmers, how hard would this be?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jace
    FBOP Class Of 2013
    • Jan 2004
    • 35562

    #1

    Programmers, how hard would this be?

    I have a Lyrics script running on a site of mine, and it allows me to have an rss feed...the issue is that the rss only publishes the title of the lyric with a link to that lyric, plus it only lists the last 20 lyric posts

    I want the feed to publish all the lyrics to that song, and also when the site hasn't been updated that day to publish a random lyric from the database...it has over 500,000 songs in it, so even if we set it to do any random song, the probability of it being a duplicate that the rss has seen recently is minimum

    the script is Lyricing, you can see it in action here: http://www.lyricing.com/

    the feed is http://www.lyricing.com/rss.php and the code to rss.php is

    Code:
    <?
    
    include_once "config.php";
    
    header("Content-type: text/xml");
    
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
    
    echo '<rss version="2.0">';
    
    echo '<channel>
    
    <title>lyrics</title>
    
    <description>music lyrics</description>
    
    <link>http://www.domain.com/</link>';
    
    $ex_sql = mysql_query( "select lyric_id, lyric_artist, lyric_title from lyrics where approved='1' order by lyric_id desc limit 20");
    
    $num_rows = mysql_num_rows($ex_sql);
    
    if ( $num_rows >= 1) {
    
    while ($mysql_array = mysql_fetch_array($ex_sql)) {
    
    echo '<item>
    
    <link>http://www.domain.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</link>
    
    <title>'.htmlspecialchars($mysql_array['lyric_artist']).' - '.htmlspecialchars($mysql_array['lyric_title']).'</title>
    <guid>http://www.domain.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</guid>
    </item>';
    
    }
    
    } else {
    
    echo 'No latest lyrics available.';
    
    }
    
    echo '</channel></rss>';
    
    ?>
    lyric_text is the field that stores the lyrics for each song

    how hard would this be?
    Last edited by Jace; 01-30-2008, 10:35 PM.
  • fr0gman
    Confirmed User
    • Feb 2005
    • 2093

    #2
    Interesting... I will hit up a dude and see what he can do.
    Earn up to $.03 per Visitor -> No Click Monetization!
    "Because the World Wide Web is all about two things: horrifyingly stupid psychodrama, and naked chicks."
    Wild College Videos | ICQ: 7746696

    Comment

    • Jace
      FBOP Class Of 2013
      • Jan 2004
      • 35562

      #3
      Originally posted by fr0gman
      Interesting... I will hit up a dude and see what he can do.
      if he needs to contact me he can icq me 3 9 9 6 0 8 4 8 2

      I would be willing to pay for it, I have this script installed on like 10 domains and it would be sweet to have this available on them all

      Comment

      • LOOPNAME Se Vende!
        Registered User
        • Jan 2008
        • 64

        #4
        Sorry I can not help you good luck
        Domains For Sale
        Email: LoopName@gmail★com

        Comment

        • fr0gman
          Confirmed User
          • Feb 2005
          • 2093

          #5
          Originally posted by Jace
          if he needs to contact me he can icq me 3 9 9 6 0 8 4 8 2

          I would be willing to pay for it, I have this script installed on like 10 domains and it would be sweet to have this available on them all

          You know Steve in NY (aka Hudson) right?
          Earn up to $.03 per Visitor -> No Click Monetization!
          "Because the World Wide Web is all about two things: horrifyingly stupid psychodrama, and naked chicks."
          Wild College Videos | ICQ: 7746696

          Comment

          • wpkings
            Registered User
            • Jan 2008
            • 98

            #6
            Hey Jace,
            It's not hard at all...unfortunately I'm very tired right now and may not be completely understanding you correctly, but it sounds like you would just need to add 'lyric_text' to the SELECT query, and loop that into an element, for example:

            Code:
            <lyrics>' . $mysql_array['lyric_text']) . '</lyrics>
            Of course with the appropriate strip if necessary..
            Like I said I'm tired but if you want to shoot an email to wpkings at gmail then I can take a look at it tomorrow. From the sound of it, it's like a 10 min job that wouldn't really cost anything.
            Premium WordPress Blog Services
            TeenieHeaven Theme Released!
            ICQ: 442150682 | E: wpkings at gmail

            Comment

            • mr.K?
              Confirmed User
              • Dec 2006
              • 201

              #7
              Yeah, that's right. and you might want to put a cdata block around the lyric text else your rss would break in case of any special chars.

              Comment

              • Dynamix
                G F Y not
                • Jan 2004
                • 2910

                #8
                Originally posted by Jace
                and also when the site hasn't been updated that day to publish a random lyric from the database...it has over 500,000 songs in it, so even if we set it to do any random song, the probability of it being a duplicate that the rss has seen recently is minimum
                The SQL query isn't pulling by date, it's just pulling the most recent 20 songs, meaning there will never be an empty results set so there's no need to randomize.

                TGPFactory Full TGP Design & Installation Services
                ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
                See who I am at AdultWhosWho.com!

                Comment

                • wpkings
                  Registered User
                  • Jan 2008
                  • 98

                  #9
                  And obviously the result limit is set with LIMIT:
                  Code:
                  $ex_sql = mysql_query( "select lyric_id, lyric_artist, lyric_title from lyrics where approved='1' order by lyric_id desc limit 20");
                  So you could just change that LIMIT 20 to LIMIT 40 etc

                  And yes, like mr.K mentioned...
                  Code:
                  <lyrics><![CDATA[' . $mysql_array['lyric_text']) . ']]></lyrics>
                  But there might be a better way.

                  The other part with the random lyrics isn't hard but I'd probably give you the wrong code if I tried now, so that can wait until tomorrow
                  Premium WordPress Blog Services
                  TeenieHeaven Theme Released!
                  ICQ: 442150682 | E: wpkings at gmail

                  Comment

                  • Dynamix
                    G F Y not
                    • Jan 2004
                    • 2910

                    #10
                    Nevermind I think I realize what you mean.. can you paste the column name in the SQL database for date added, and also the format (likely YYYY-MM-DD but want to be sure)

                    TGPFactory Full TGP Design & Installation Services
                    ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
                    See who I am at AdultWhosWho.com!

                    Comment

                    • Jace
                      FBOP Class Of 2013
                      • Jan 2004
                      • 35562

                      #11
                      Originally posted by Dynamix
                      The SQL query isn't pulling by date, it's just pulling the most recent 20 songs, meaning there will never be an empty results set so there's no need to randomize.
                      but what if I don't update new lyrics for a month, will the same lyrics be sitting in the rss feed for a month?

                      I want to use it to update blogs, and if the songs never rotate then the blog will pull the same songs every day

                      Comment

                      • Jace
                        FBOP Class Of 2013
                        • Jan 2004
                        • 35562

                        #12
                        Originally posted by wpkings
                        Hey Jace,
                        It's not hard at all...unfortunately I'm very tired right now and may not be completely understanding you correctly, but it sounds like you would just need to add 'lyric_text' to the SELECT query, and loop that into an element, for example:

                        Code:
                        <lyrics>' . $mysql_array['lyric_text']) . '</lyrics>
                        Of course with the appropriate strip if necessary..
                        Like I said I'm tired but if you want to shoot an email to wpkings at gmail then I can take a look at it tomorrow. From the sound of it, it's like a 10 min job that wouldn't really cost anything.
                        quite simply, I want the song lyrics in the rss feed, not just the title

                        can I hit you up tomorrow to do this?

                        Comment

                        • Jace
                          FBOP Class Of 2013
                          • Jan 2004
                          • 35562

                          #13
                          Originally posted by wpkings
                          And obviously the result limit is set with LIMIT:
                          Code:
                          $ex_sql = mysql_query( "select lyric_id, lyric_artist, lyric_title from lyrics where approved='1' order by lyric_id desc limit 20");
                          So you could just change that LIMIT 20 to LIMIT 40 etc

                          And yes, like mr.K mentioned...
                          Code:
                          <lyrics><![CDATA[' . $mysql_array['lyric_text']) . ']]></lyrics>
                          But there might be a better way.

                          The other part with the random lyrics isn't hard but I'd probably give you the wrong code if I tried now, so that can wait until tomorrow
                          yeah, i figured out the amount of articles pulled, that was easy

                          now I just need to figure out how to get the lyrics to show up too

                          Comment

                          • Dynamix
                            G F Y not
                            • Jan 2004
                            • 2910

                            #14
                            Paste column name for full lyrics text, date, and sample date.. I'll get this cooked up for you before heading to bed

                            TGPFactory Full TGP Design & Installation Services
                            ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
                            See who I am at AdultWhosWho.com!

                            Comment

                            • Jace
                              FBOP Class Of 2013
                              • Jan 2004
                              • 35562

                              #15
                              lyric_text is the sql column that holds all the lyrics data

                              Comment

                              • Jace
                                FBOP Class Of 2013
                                • Jan 2004
                                • 35562

                                #16
                                there is also
                                temp_date
                                submit_date

                                Comment

                                • Dynamix
                                  G F Y not
                                  • Jan 2004
                                  • 2910

                                  #17
                                  what format is submit_date in? 2008-01-31 ?

                                  TGPFactory Full TGP Design & Installation Services
                                  ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
                                  See who I am at AdultWhosWho.com!

                                  Comment

                                  • Jace
                                    FBOP Class Of 2013
                                    • Jan 2004
                                    • 35562

                                    #18
                                    this is weird though, all the dates are showing up as
                                    0000-00-00 00:00:00

                                    Comment

                                    • wpkings
                                      Registered User
                                      • Jan 2008
                                      • 98

                                      #19
                                      Originally posted by Jace
                                      quite simply, I want the song lyrics in the rss feed, not just the title

                                      can I hit you up tomorrow to do this?
                                      Sure if you don't get it figured out tonight, email wpkings at gmail or icq 442150682
                                      Good luck
                                      Premium WordPress Blog Services
                                      TeenieHeaven Theme Released!
                                      ICQ: 442150682 | E: wpkings at gmail

                                      Comment

                                      • Nicky
                                        Too lazy to set a custom title
                                        • Mar 2003
                                        • 30071

                                        #20
                                        Lot's of help here it seems, I suck at programming anyway lol

                                        gfynicky @ gmail.com

                                        Comment

                                        • Jace
                                          FBOP Class Of 2013
                                          • Jan 2004
                                          • 35562

                                          #21
                                          there is a lyric_id field though, you could randomize with that

                                          but I only want the random thing when I don't add lyrics, if I add lyrics for the day there would be no random lyric

                                          Comment

                                          • Dynamix
                                            G F Y not
                                            • Jan 2004
                                            • 2910

                                            #22
                                            Not sure why your dates are screwy, assuming they worked this code ought to do the trick:

                                            Code:
                                            <?
                                            
                                            include_once "config.php";
                                            
                                            header("Content-type: text/xml");
                                            
                                            echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
                                            
                                            echo '<rss version="2.0">';
                                            
                                            echo '<channel>
                                            
                                            <title>lyrics</title>
                                            
                                            <description>music lyrics</description>
                                            
                                            <link>http://www.domain.com/</link>';
                                            
                                            $sql_query = "select lyric_id, lyric_artist, lyric_title, lyric_text from lyrics where approved='1' order by lyric_id desc limit 20";
                                            
                                            // Analyze date of latest entry
                                            $date_chk= mysql_query("select submit_date from lyrics where approved='1' order by lyric_id desc limit 1");
                                            $latest= mysql_fetch_array($date_chk);
                                            $latest_date= split(" ",$latest['submit_date']);
                                            if ($latest_date[0]!=date("Y-m-d")) $sql_query = "select lyric_id, lyric_artist, lyric_title, lyric_text from lyrics where approved='1' order by rand() limit 20";
                                            
                                            
                                            $ex_sql = mysql_query( $sql_query );
                                            
                                            $num_rows = mysql_num_rows($ex_sql);
                                            
                                            if ( $num_rows >= 1) {
                                            
                                            while ($mysql_array = mysql_fetch_array($ex_sql)) {
                                            
                                            echo '<item>
                                            
                                            <link>http://www.domain.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</link>
                                            
                                            <title>'.htmlspecialchars($mysql_array['lyric_artist']).' - '.htmlspecialchars($mysql_array['lyric_title']).'</title>
                                            <lyrics><![CDATA['.htmlspecialchars($mysql_array['lryic_text']).']]></lyrics>
                                            <guid>http://www.domain.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</guid>
                                            </item>';
                                            
                                            }
                                            
                                            } else {
                                            
                                            echo 'No latest lyrics available.';
                                            
                                            }
                                            
                                            echo '</channel></rss>';
                                            
                                            ?>

                                            TGPFactory Full TGP Design & Installation Services
                                            ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
                                            See who I am at AdultWhosWho.com!

                                            Comment

                                            • Jace
                                              FBOP Class Of 2013
                                              • Jan 2004
                                              • 35562

                                              #23
                                              Originally posted by Nicky
                                              Lot's of help here it seems, I suck at programming anyway lol
                                              gfy really actually does have some nice folks on here, usually late night though

                                              btw, anyone that helps me will be paid something, and get some free hard links

                                              Comment

                                              • Jace
                                                FBOP Class Of 2013
                                                • Jan 2004
                                                • 35562

                                                #24
                                                Originally posted by Dynamix
                                                Not sure why your dates are screwy, assuming they worked this code ought to do the trick:

                                                Code:
                                                <?
                                                
                                                include_once "config.php";
                                                
                                                header("Content-type: text/xml");
                                                
                                                echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
                                                
                                                echo '<rss version="2.0">';
                                                
                                                echo '<channel>
                                                
                                                <title>lyrics</title>
                                                
                                                <description>music lyrics</description>
                                                
                                                <link>http://www.domain.com/</link>';
                                                
                                                $sql_query = "select lyric_id, lyric_artist, lyric_title, lyric_text from lyrics where approved='1' order by lyric_id desc limit 20";
                                                
                                                // Analyze date of latest entry
                                                $date_chk= mysql_query("select submit_date from lyrics where approved='1' order by lyric_id desc limit 1");
                                                $latest= mysql_fetch_array($date_chk);
                                                $latest_date= split(" ",$latest['submit_date']);
                                                if ($latest_date[0]!=date("Y-m-d")) $sql_query = "select lyric_id, lyric_artist, lyric_title, lyric_text from lyrics where approved='1' order by rand() limit 20";
                                                
                                                
                                                $ex_sql = mysql_query( $sql_query );
                                                
                                                $num_rows = mysql_num_rows($ex_sql);
                                                
                                                if ( $num_rows >= 1) {
                                                
                                                while ($mysql_array = mysql_fetch_array($ex_sql)) {
                                                
                                                echo '<item>
                                                
                                                <link>http://www.domain.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</link>
                                                
                                                <title>'.htmlspecialchars($mysql_array['lyric_artist']).' - '.htmlspecialchars($mysql_array['lyric_title']).'</title>
                                                <lyrics><![CDATA['.htmlspecialchars($mysql_array['lryic_text']).']]></lyrics>
                                                <guid>http://www.domain.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</guid>
                                                </item>';
                                                
                                                }
                                                
                                                } else {
                                                
                                                echo 'No latest lyrics available.';
                                                
                                                }
                                                
                                                echo '</channel></rss>';
                                                
                                                ?>
                                                that is randomizing them every time it pulls the rss page up

                                                http://lyrics.gamesandlyrics.com/rss.php

                                                Comment

                                                • Dynamix
                                                  G F Y not
                                                  • Jan 2004
                                                  • 2910

                                                  #25
                                                  Originally posted by Jace
                                                  that is randomizing them every time it pulls the rss page up

                                                  http://lyrics.gamesandlyrics.com/rss.php
                                                  Right, because your date column is fucked up :/

                                                  Run this SQL query:

                                                  UPDATE lyrics set submit_date = '2008-01-30' where 0=0;

                                                  To set all dates to yesterday

                                                  TGPFactory Full TGP Design & Installation Services
                                                  ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
                                                  See who I am at AdultWhosWho.com!

                                                  Comment

                                                  • Dynamix
                                                    G F Y not
                                                    • Jan 2004
                                                    • 2910

                                                    #26
                                                    Originally posted by Dynamix
                                                    Right, because your date column is fucked up :/

                                                    Run this SQL query:

                                                    UPDATE lyrics set submit_date = '2008-01-30' where 0=0;

                                                    To set all dates to yesterday
                                                    May want to set to today '2008-01-31' so it stops randomizing

                                                    TGPFactory Full TGP Design & Installation Services
                                                    ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
                                                    See who I am at AdultWhosWho.com!

                                                    Comment

                                                    • Jace
                                                      FBOP Class Of 2013
                                                      • Jan 2004
                                                      • 35562

                                                      #27
                                                      now there is nothing there, haha

                                                      http://lyrics.gamesandlyrics.com/rss.php

                                                      i guess because it technically hasn't been entered yet

                                                      I know why all the dates are that way though, the sql dump I got was all set to have no submission dates, so when I start enterring them manually they will start having normal datwes

                                                      Comment

                                                      • Jace
                                                        FBOP Class Of 2013
                                                        • Jan 2004
                                                        • 35562

                                                        #28
                                                        i set it back to 2008-01-30 so I can see what I am working with

                                                        thanks!!!!

                                                        now...to get the full lyrics text in there

                                                        Comment

                                                        • Dynamix
                                                          G F Y not
                                                          • Jan 2004
                                                          • 2910

                                                          #29
                                                          add this after the first <link></link> set:

                                                          <lyrics>full lyrics</lyrics>

                                                          TGPFactory Full TGP Design & Installation Services
                                                          ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
                                                          See who I am at AdultWhosWho.com!

                                                          Comment

                                                          • Dynamix
                                                            G F Y not
                                                            • Jan 2004
                                                            • 2910

                                                            #30
                                                            nope i lied... one sec

                                                            TGPFactory Full TGP Design & Installation Services
                                                            ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
                                                            See who I am at AdultWhosWho.com!

                                                            Comment

                                                            • Dynamix
                                                              G F Y not
                                                              • Jan 2004
                                                              • 2910

                                                              #31
                                                              Change:
                                                              Code:
                                                              <lyrics><![CDATA['.htmlspecialchars($mysql_array['lryic_text']).']]></lyrics>
                                                              to:
                                                              Code:
                                                              <description><![CDATA['.htmlspecialchars($mysql_array['lryic_text']).']]></description>

                                                              TGPFactory Full TGP Design & Installation Services
                                                              ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
                                                              See who I am at AdultWhosWho.com!

                                                              Comment

                                                              • Dynamix
                                                                G F Y not
                                                                • Jan 2004
                                                                • 2910

                                                                #32
                                                                and change my typo of lryic_text to lyric_text

                                                                TGPFactory Full TGP Design & Installation Services
                                                                ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
                                                                See who I am at AdultWhosWho.com!

                                                                Comment

                                                                • Jace
                                                                  FBOP Class Of 2013
                                                                  • Jan 2004
                                                                  • 35562

                                                                  #33
                                                                  Originally posted by Dynamix
                                                                  and change my typo of lryic_text to lyric_text
                                                                  oh shit, there it is!

                                                                  http://lyrics.gamesandlyrics.com/rss.php

                                                                  now, how do I get it to keep the html formatting?

                                                                  Comment

                                                                  • Dynamix
                                                                    G F Y not
                                                                    • Jan 2004
                                                                    • 2910

                                                                    #34
                                                                    Can you paste the PHP back? There's an error in there somewhere that needs correcting, view source you'll see the PHP warning.

                                                                    TGPFactory Full TGP Design & Installation Services
                                                                    ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
                                                                    See who I am at AdultWhosWho.com!

                                                                    Comment

                                                                    • Jace
                                                                      FBOP Class Of 2013
                                                                      • Jan 2004
                                                                      • 35562

                                                                      #35
                                                                      Originally posted by Dynamix
                                                                      Can you paste the PHP back? There's an error in there somewhere that needs correcting, view source you'll see the PHP warning.
                                                                      yup, i see it

                                                                      Code:
                                                                      <?
                                                                      
                                                                      include_once "config.php";
                                                                      
                                                                      header("Content-type: text/xml");
                                                                      
                                                                      echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
                                                                      
                                                                      echo '<rss version="2.0">';
                                                                      
                                                                      echo '<channel>
                                                                      
                                                                      <title>lyrics</title>
                                                                      
                                                                      <description>music lyrics</description>
                                                                      
                                                                      <link>http://lyrics.gamesandlyrics.com/</link>';
                                                                      
                                                                      $sql_query = "select lyric_id, lyric_artist, lyric_title, lyric_text from lyrics where approved='1' order by lyric_id desc limit 20";
                                                                      
                                                                      // Analyze date of latest entry
                                                                      $date_chk= mysql_query("select date from lyrics where approved='1' limit 1");
                                                                      $latest= mysql_fetch_array($date_chk);
                                                                      $latest_date= split(" ",$latest['date']);
                                                                      if ($latest_date[0]!=date("Y-m-d")) $sql_query = "select lyric_id, lyric_artist, lyric_title, lyric_text from lyrics where approved='1' order by rand() limit 20";
                                                                      
                                                                      
                                                                      $ex_sql = mysql_query( $sql_query );
                                                                      
                                                                      $num_rows = mysql_num_rows($ex_sql);
                                                                      
                                                                      if ( $num_rows >= 1) {
                                                                      
                                                                      while ($mysql_array = mysql_fetch_array($ex_sql)) {
                                                                      
                                                                      echo '<item>
                                                                      
                                                                      <link>http://lyrics.gamesandlyrics.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</link>
                                                                      
                                                                      <title>'.htmlspecialchars($mysql_array['lyric_artist']).' - '.htmlspecialchars($mysql_array['lyric_title']).'</title>
                                                                      <description><![CDATA['.htmlspecialchars($mysql_array['lyric_text']).']]></description>
                                                                      <guid>http://lyrics.gamesandlyrics.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</guid>
                                                                      </item>';
                                                                      
                                                                      }
                                                                      
                                                                      } else {
                                                                      
                                                                      echo 'No latest lyrics available.';
                                                                      
                                                                      }
                                                                      
                                                                      echo '</channel></rss>';
                                                                      
                                                                      ?>

                                                                      Comment

                                                                      • Jace
                                                                        FBOP Class Of 2013
                                                                        • Jan 2004
                                                                        • 35562

                                                                        #36
                                                                        somewhere on this line

                                                                        $date_chk= mysql_query("select date from lyrics where approved='1' limit 1");

                                                                        Comment

                                                                        • Dynamix
                                                                          G F Y not
                                                                          • Jan 2004
                                                                          • 2910

                                                                          #37
                                                                          Code:
                                                                          <?
                                                                          
                                                                          include_once "config.php";
                                                                          
                                                                          header("Content-type: text/xml");
                                                                          
                                                                          echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
                                                                          
                                                                          echo '<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">';
                                                                          
                                                                          echo '<channel>
                                                                          
                                                                          <title>lyrics</title>
                                                                          
                                                                          <description>music lyrics</description>
                                                                          
                                                                          <link>http://lyrics.gamesandlyrics.com/</link>';
                                                                          
                                                                          $sql_query = "select lyric_id, lyric_artist, lyric_title, lyric_text from lyrics where approved='1' order by lyric_id desc limit 20";
                                                                          
                                                                          // Analyze date of latest entry
                                                                          $date_chk= mysql_query("select submit_date from lyrics where approved='1' limit 1");
                                                                          $latest= @mysql_fetch_array($date_chk);
                                                                          if ($latest){
                                                                          	$latest_date= split(" ",$latest['submit_date']);
                                                                          	if ($latest_date[0]!=date("Y-m-d")) $sql_query = "select lyric_id, lyric_artist, lyric_title, lyric_text from lyrics where approved='1' order by rand() limit 20";
                                                                          }
                                                                          
                                                                          
                                                                          $ex_sql = mysql_query( $sql_query );
                                                                          
                                                                          $num_rows = mysql_num_rows($ex_sql);
                                                                          
                                                                          if ( $num_rows >= 1) {
                                                                          
                                                                          while ($mysql_array = mysql_fetch_array($ex_sql)) {
                                                                          
                                                                          echo '<item>
                                                                          
                                                                          <link>http://lyrics.gamesandlyrics.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</link>
                                                                          
                                                                          <title>'.htmlspecialchars($mysql_array['lyric_artist']).' - '.htmlspecialchars($mysql_array['lyric_title']).'</title>
                                                                          <description><![CDATA['.htmlspecialchars($mysql_array['lyric_text']).']]></description>
                                                                          <guid>http://lyrics.gamesandlyrics.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</guid>
                                                                          </item>';
                                                                          
                                                                          }
                                                                          
                                                                          } else {
                                                                          
                                                                          echo 'No latest lyrics available.';
                                                                          
                                                                          }
                                                                          
                                                                          echo '</channel></rss>';
                                                                          
                                                                          ?>

                                                                          TGPFactory Full TGP Design & Installation Services
                                                                          ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
                                                                          See who I am at AdultWhosWho.com!

                                                                          Comment

                                                                          • Dynamix
                                                                            G F Y not
                                                                            • Jan 2004
                                                                            • 2910

                                                                            #38
                                                                            Yeah it's because 'date' isn't the column name, 'submit_date' is.. thought I changed that but obviously not

                                                                            TGPFactory Full TGP Design & Installation Services
                                                                            ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
                                                                            See who I am at AdultWhosWho.com!

                                                                            Comment

                                                                            • Jace
                                                                              FBOP Class Of 2013
                                                                              • Jan 2004
                                                                              • 35562

                                                                              #39
                                                                              now how do I get the html to show up?

                                                                              Comment

                                                                              • Dynamix
                                                                                G F Y not
                                                                                • Jan 2004
                                                                                • 2910

                                                                                #40
                                                                                That's what I'm looking at.. comparing yours to MSNBC, the only difference is this line:

                                                                                Code:
                                                                                <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
                                                                                But I thought that was only used to display media (video, photo, etc.)

                                                                                TGPFactory Full TGP Design & Installation Services
                                                                                ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
                                                                                See who I am at AdultWhosWho.com!

                                                                                Comment

                                                                                • Dynamix
                                                                                  G F Y not
                                                                                  • Jan 2004
                                                                                  • 2910

                                                                                  #41
                                                                                  i'm a moron. change this line:

                                                                                  Code:
                                                                                  <description><![CDATA['.htmlspecialchars($mysql_array['lyric_text']).']]></description>
                                                                                  to:

                                                                                  Code:
                                                                                  <description><![CDATA['.$mysql_array['lyric_text'].']]></description>

                                                                                  TGPFactory Full TGP Design & Installation Services
                                                                                  ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
                                                                                  See who I am at AdultWhosWho.com!

                                                                                  Comment

                                                                                  • Jace
                                                                                    FBOP Class Of 2013
                                                                                    • Jan 2004
                                                                                    • 35562

                                                                                    #42
                                                                                    YOU FUCKING ROCK

                                                                                    http://lyrics.gamesandlyrics.com/rss.php

                                                                                    Comment

                                                                                    • Jace
                                                                                      FBOP Class Of 2013
                                                                                      • Jan 2004
                                                                                      • 35562

                                                                                      #43
                                                                                      what is your epass?

                                                                                      Comment

                                                                                      • Dynamix
                                                                                        G F Y not
                                                                                        • Jan 2004
                                                                                        • 2910

                                                                                        #44
                                                                                        PWMOORE@ Appreciate it, although it's not necessary.. just enjoy a mid-night challenge ;)

                                                                                        TGPFactory Full TGP Design & Installation Services
                                                                                        ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
                                                                                        See who I am at AdultWhosWho.com!

                                                                                        Comment

                                                                                        • Jace
                                                                                          FBOP Class Of 2013
                                                                                          • Jan 2004
                                                                                          • 35562

                                                                                          #45
                                                                                          Originally posted by Dynamix
                                                                                          PWMOORE@ Appreciate it, although it's not necessary.. just enjoy a mid-night challenge ;)
                                                                                          sent

                                                                                          and no worries, I believe that everyone should get paid for the work they do

                                                                                          Comment

                                                                                          • POed-poster
                                                                                            Confirmed User
                                                                                            • Feb 2005
                                                                                            • 1588

                                                                                            #46
                                                                                            Originally posted by Jace
                                                                                            I have a Lyrics script running on a site of mine, and it allows me to have an rss feed...the issue is that the rss only publishes the title of the lyric with a link to that lyric, plus it only lists the last 20 lyric posts

                                                                                            I want the feed to publish all the lyrics to that song, and also when the site hasn't been updated that day to publish a random lyric from the database...it has over 500,000 songs in it, so even if we set it to do any random song, the probability of it being a duplicate that the rss has seen recently is minimum

                                                                                            the script is Lyricing, you can see it in action here: http://www.lyricing.com/

                                                                                            the feed is http://www.lyricing.com/rss.php and the code to rss.php is

                                                                                            Code:
                                                                                            <?
                                                                                            
                                                                                            include_once "config.php";
                                                                                            
                                                                                            header("Content-type: text/xml");
                                                                                            
                                                                                            echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
                                                                                            
                                                                                            echo '<rss version="2.0">';
                                                                                            
                                                                                            echo '<channel>
                                                                                            
                                                                                            <title>lyrics</title>
                                                                                            
                                                                                            <description>music lyrics</description>
                                                                                            
                                                                                            <link>http://www.domain.com/</link>';
                                                                                            
                                                                                            $ex_sql = mysql_query( "select lyric_id, lyric_artist, lyric_title from lyrics where approved='1' order by lyric_id desc limit 20");
                                                                                            
                                                                                            $num_rows = mysql_num_rows($ex_sql);
                                                                                            
                                                                                            if ( $num_rows >= 1) {
                                                                                            
                                                                                            while ($mysql_array = mysql_fetch_array($ex_sql)) {
                                                                                            
                                                                                            echo '<item>
                                                                                            
                                                                                            <link>http://www.domain.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</link>
                                                                                            
                                                                                            <title>'.htmlspecialchars($mysql_array['lyric_artist']).' - '.htmlspecialchars($mysql_array['lyric_title']).'</title>
                                                                                            <guid>http://www.domain.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</guid>
                                                                                            </item>';
                                                                                            
                                                                                            }
                                                                                            
                                                                                            } else {
                                                                                            
                                                                                            echo 'No latest lyrics available.';
                                                                                            
                                                                                            }
                                                                                            
                                                                                            echo '</channel></rss>';
                                                                                            
                                                                                            ?>
                                                                                            lyric_text is the field that stores the lyrics for each song

                                                                                            how hard would this be?
                                                                                            How well are you doing with this site?
                                                                                            If you have a music site that sells digital downloads, please contact me.

                                                                                            Comment

                                                                                            • polle54
                                                                                              Confirmed User
                                                                                              • Jul 2004
                                                                                              • 4626

                                                                                              #47
                                                                                              LOL I just read this old thread Dynamix is the only one who seemed to understand that you can't just put a <randomtext> tag in an rss feed
                                                                                              I thought every programmer and his mother understood rss from xml by now
                                                                                              ICQ# 143561781

                                                                                              Comment

                                                                                              • raven1083
                                                                                                Confirmed User
                                                                                                • Jul 2007
                                                                                                • 7687

                                                                                                #48
                                                                                                seems hard dude! Going to ask a friend for you!
                                                                                                Femdom Stories | Bound BBW Blog and Videos |Bondage Sex Videos and Pictures

                                                                                                Hardcore Japanese Bondage | BDSM Movies And Galleries Mistress Cuckold CBT

                                                                                                Comment

                                                                                                Working...