How to put auto tip-of-day on my site?

by sylviad 17 replies
Hi,

I just had a brilliant idea that involves putting a tip-of-the-day on my site that changes every day. My guess is that there is some type of script that will do that.

I want to be able to load in a series of tips all at once and let it run with a schedule to change daily. It isn't a running ticker, but a static tip. Can't say I've ever seen such a product.

Does anyone know how to do that?

Thanks.

Sylvia
#main internet marketing discussion forum #auto #put #site #tipofday
Avatar of Unregistered
  • Profile picture of the author Mike Montgomery
    Originally Posted by sylviad View Post

    Hi,

    I just had a brilliant idea that involves putting a tip-of-the-day on my site that changes every day. My guess is that there is some type of script that will do that.

    I want to be able to load in a series of tips all at once and let it run with a schedule to change daily. It isn't a running ticker, but a static tip. Can't say I've ever seen such a product.

    Does anyone know how to do that?

    Thanks.

    Sylvia
    Easy to do if you want to put it on a wordpress blog as you could just
    use the timestamp feature or a number of paid products.

    Don't know though if you don't want to use a blog.
    {{ DiscussionBoard.errors[47728].message }}
    • Profile picture of the author sylviad
      Well, I could do it on a blog but I'd rather do it on my site - or both.

      I'm unfamiliar with that Timestamp on Wordpress. Will check it out.

      Thanks.

      Sylvia
      Signature
      :: Got a dog? Visit my blog. Dog Talk Weekly
      :: Need articles, ebooks written? - Award-winning Journalist is taking new projects. Warrior Discounts!
      {{ DiscussionBoard.errors[47750].message }}
      • Profile picture of the author Simon_Sezs
        It can be done with javascript. Go to "hot scripts" or one of the other various free script sites and yank one. I know it is out there, just can't remember where I saw it.
        Signature
        "Either write something worth reading or do something worth writing." Ben Franklin
        {{ DiscussionBoard.errors[47960].message }}
        • Profile picture of the author Robert Plank
          If I was smart I would put this into a product but I guess I'll give it away for free here...

          Start off by making a new text file, call it tips.txt... and put each tip on one line, like this:

          Code:
          tip #1
          tip #2
          tip #3
          tip #4
          Then save this code (http://www.robertplank.com/tips/tips.phps) as tips.php... (I tried to post it here but the forum software wouldn't let me).

          That's it. No database needed or anything. It chooses a random tip but it only changes once a day.

          Just add it to your site like:
          Code:
          <?php require("tips.php"); ?>
          if it's a PHP page or:
          HTML Code:
          <iframe src="tips.php" width="300" height="100"></iframe>
          if you want to do an iframe.
          {{ DiscussionBoard.errors[48034].message }}
          • Profile picture of the author sylviad
            Thank you so much, Robert!

            This looks like the perfect thing - I haven't done much with scripts as this is relatively new to me. My guess is that it just gives a text tip, ie: no way to fancy it up with highlighted background.

            (Am I too demanding or what?! :rolleyes

            That's ok. I can make this work.

            Thanks again.

            Sylvia
            Signature
            :: Got a dog? Visit my blog. Dog Talk Weekly
            :: Need articles, ebooks written? - Award-winning Journalist is taking new projects. Warrior Discounts!
            {{ DiscussionBoard.errors[49811].message }}
            • Profile picture of the author Robert Plank
              You can put a box around the tip...

              Code:
              <div align="center">
              <div style="background-color:yellow; border:black solid 5px; width:400px">
              <?php require("tips.php"); ?>
              </div>
              </div>
              {{ DiscussionBoard.errors[49997].message }}
              • Profile picture of the author Barbara Eyre
                I also want to thank you, Robert .... I kept meaning to look for such a script but never got around to it. It could be used for many things:

                Tip of the Day
                Quote of the Day
                Trivia Tidbit of the Day
                Whatever of the Day
                etc.

                I just got to remember not to go overboard with it LOL
                {{ DiscussionBoard.errors[50471].message }}
                • Profile picture of the author sylviad
                  Thanks, Robert... That's what I was thinking, too. And I can shade the box whatever color I want. Thanks for the additional code. I'm a writer. If there's anything I can do in exchange for your generosity, by all means give me a buzz.

                  Sylvia
                  Signature
                  :: Got a dog? Visit my blog. Dog Talk Weekly
                  :: Need articles, ebooks written? - Award-winning Journalist is taking new projects. Warrior Discounts!
                  {{ DiscussionBoard.errors[51506].message }}
                  • Profile picture of the author Rotco
                    Banned
                    [DELETED]
                    {{ DiscussionBoard.errors[51544].message }}
                    • Profile picture of the author sylviad
                      Originally Posted by Rotco View Post

                      Well its iframe.. Thats not good, some browsers cant see iframe
                      If I'm reading the code right, I believe Robert has provided optional codes - one for iframe and one without.
                      So you can choose whichever works best for your situation.

                      If you use the first option, then you change your HTML extension on your page to .php - it still works the same as html in terms of running on browsers.

                      But Robert... feel free to correct me if I'm wrong.

                      Sylvia
                      Signature
                      :: Got a dog? Visit my blog. Dog Talk Weekly
                      :: Need articles, ebooks written? - Award-winning Journalist is taking new projects. Warrior Discounts!
                      {{ DiscussionBoard.errors[51584].message }}
                • Profile picture of the author sylviad
                  Originally Posted by Barbara Eyre View Post

                  I also want to thank you, Robert .... I kept meaning to look for such a script but never got around to it. It could be used for many things:

                  Tip of the Day
                  Quote of the Day
                  Trivia Tidbit of the Day
                  Whatever of the Day
                  etc.

                  I just got to remember not to go overboard with it LOL
                  Gag or Joke of the Day!

                  Sylvia
                  Signature
                  :: Got a dog? Visit my blog. Dog Talk Weekly
                  :: Need articles, ebooks written? - Award-winning Journalist is taking new projects. Warrior Discounts!
                  {{ DiscussionBoard.errors[51579].message }}
          • Profile picture of the author ariyes
            Originally Posted by Robert Plank View Post

            If I was smart I would put this into a product but I guess I'll give it away for free here...

            Start off by making a new text file, call it tips.txt... and put each tip on one line, like this:

            Code:
            tip #1
            tip #2
            tip #3
            tip #4
            Then save this code (http://www.robertplank.com/tips/tips.phps) as tips.php... (I tried to post it here but the forum software wouldn't let me).

            That's it. No database needed or anything. It chooses a random tip but it only changes once a day.

            Just add it to your site like:
            Code:
            <?php require("tips.php"); ?>
            if it's a PHP page or:
            HTML Code:
            <iframe src="tips.php" width="300" height="100"></iframe>
            if you want to do an iframe.

            wow wow wow its really good. thanks Robert, It's really help full for me.
            Signature
            {{ DiscussionBoard.errors[51695].message }}
            • Profile picture of the author Barbara Eyre
              I was just about to implement this and had 2 questions.

              1) Can the time be adjusted to where the tip refreshes on browser load?

              2) Can the tips, in the .txt file be 2 lines? I was to do questions jokes: ie.,

              Why did the chicken cross the road?
              Answer: To get to the other side.

              (trust me - not THAT joke LOL but just used as an example) *grins*
              {{ DiscussionBoard.errors[101396].message }}
              • Profile picture of the author Robert Plank
                1) Can the time be adjusted to where the tip refreshes on browser load?
                Yeah, just remove this line: srand($hash);

                2) Can the tips, in the .txt file be 2 lines? I was to do questions jokes: ie.,

                Why did the chicken cross the road?
                Answer: To get to the other side.

                (trust me - not THAT joke LOL but just used as an example) *grins*
                If you were displaying it on a web page, why not just add a <br /> to make it look like it's on many lines?

                If you really want the multi-line thing, here's how to modify that code...

                Instead of saying:

                $tips = array_map("trim", file("tips.txt"));

                You would say:

                $tips = array_map("trim", explode("%%", file_get_contents("tips.txt")));

                Then separate each joke with a %%
                {{ DiscussionBoard.errors[101686].message }}
  • Profile picture of the author Kym Robinson
    the easiest thing ever!
    I asked about this 2 days ago and now i have it fully loaded!

    this is for WP
    just google 'wordpress quote rotator plugin"
    and load 'er up!
    then you just add all your tips and set the time span and add it as a widget!

    its great - and thatnks to those who helped me with it!
    Kym
    {{ DiscussionBoard.errors[123772].message }}
  • Profile picture of the author kah22
    Hi Robert I hate to take you back almost a year but I've just came across this post.

    I'm trying to put your code into a Wordpress Blog (Brandford Magazine Theme.

    I've added the two files tips.txt and tips.php into the Brandford Theme and put the following line into my sidebar.php file '<?php require("tips.php"); ?>' but I'm getting the following error messages when I check my site

    Warning: file(tips.txt) [function.file]: failed to open stream: No such file or directory mywebsite.com/public_html/wp-content/themes/branford with mimbo sidebar/tips.php on line 6

    Any suggestions or do I need to place these files in some other wordpress directory.

    Again apoligies for taking you back a year - just goes to show how far I'm behind lol
    {{ DiscussionBoard.errors[949713].message }}
Avatar of Unregistered

Trending Topics