topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 7:06 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: Place randomly selected quotes in a specific box on a web page  (Read 5370 times)

Clive

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 116
    • View Profile
    • Donate to Member
I've made a very simple web site for our business - an electronic brochure really. I used Nvu, as I have no coding experience, and based the pages on a CSS template provided by A. Viklund.
Over time we've had some nice thankyou messages from our customers and I incorporated a couple into the site. The other day I thought it would be neat if the quotes changed everytime the home/index page was loaded/refreshed. I did a bit of searching and sure enough plenty of other people had thought of this before me and written some code. The problem with all the code I found was that there was no way to locate its action on the page just where I wanted it.
On my site's home/index page I have a three column single row table with a thumbnail in A1 & C1 and I want the quote to appear in B1.
Is this request worthy of someone's time? If not some gentle nudges in the right direction would be gratefully received.

Thanks,
Clive
« Last Edit: January 20, 2007, 04:24 AM by brotherS »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Idea: Place randomly selected quotes in a specific box on a web page
« Reply #1 on: January 20, 2007, 02:24 AM »
I wrote php code to do this - and there are other scripts as well for it.
As I am going to be revamping this code in the next couple of weeks to include random screenshots and other stuff, let me revisit this issue in february and share what i've written.  in the meantime please post what you find on your own and remind me again in february.

chedabob

  • Participant
  • Joined in 2006
  • *
  • Posts: 34
  • C# Master (if only!!!)
    • View Profile
    • Donate to Member
Re: IDEA: Place randomly selected quotes in a specific box on a web page
« Reply #2 on: January 20, 2007, 01:16 PM »
I could do it, but Id probably need to see the code for the page you want it on.

Clive

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 116
    • View Profile
    • Donate to Member
Re: IDEA: Place randomly selected quotes in a specific box on a web page
« Reply #3 on: January 20, 2007, 10:01 PM »
Here's part of the page including the quotes and the table format - hope that's what you need.

<table style="text-align: left; width: 718px; height: 167px;" border="0" cellpadding="0" cellspacing="0"> <tbody><tr><td style="text-align: left; vertical-align: middle; width: 184px;"><a href="SD_1.html"><img title="Click to go to SD 1 page" style="border: 0px solid ; width: 180px; height: 118px;" alt="Singapore Deep 1 One Bedroom FSC Accommodation near Wilsons Promontory" src="SDOne011b.jpg"></a></td> <td style="width: 315px; text-align: center; vertical-align: middle;">&nbsp;<big><span style="font-style: italic;"></span></big>
<script><SCRIPT LANGUAGE= "JAVASCRIPT"><!--var r_text = new Array () ;
r_text[0] = "My husband and I had a wonderful stay at Singapore Deep. It was just wonderful to go and recharge the batteries. We loved the view of the bay. Laura";
r_text[1] = "Wonderful couple of days,
you should be very proud of your setting and service. Many Thanks, Peter";
r_text[2] = "We had a really lovely 1st anniversary staying at Singapore Deep. We loved the wide sliding doors over looking the water. Sarah";
r_text[3] = "Margaret - thanks again for a wonderful 4 days at your retreat, it was great to meet you. Simon";
r_text[4] = "What an unusual and pleasant two days Paula and I enjoyed this week at Singapore Deep. We were very impressed indeed, not only with the architecture and view but with the cleanliness and high standard of fittings, equipment etc. Ian";
r_text[5] = "Just wanted to say thank you for providing such beautiful accommodation in SD1. We have just had a lovely weekend there enjoying the stunning view and feeling completely relaxed.
You provide just the right combination of privacy and luxury to make the whole experience a joy. Leanne";
r_text[6] = "I would like to let you know that my husband and I had wonderful day at Singapore Deep. We loved the seclusion and the gentle view of the bay. Laura";
var i = Math.round(6*Math.random());document.write(r_text);//--></script></td><td style="vertical-align: middle; white-space: nowrap; width: 175px; text-align: right;"><a target="_blank" href="SD_2.html"><img style="border: 0px solid ; width: 184px; height: 122px;" title="Click to go to SD 2 page." src="SDTwoLHview52WA07a.jpg" alt="Singapore Deep Two - 2 bedroom FSC accommodation" hspace="120"></a></td>

The array, etc is based on an example I found on the web. It doesn't have any code to link it to the blank space in the table.

Clive

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 116
    • View Profile
    • Donate to Member
Re: IDEA: Place randomly selected quotes in a specific box on a web page
« Reply #4 on: February 01, 2007, 12:33 AM »
The problem has been resolved with the help of Ask The CSS Guy. See Ham Radio's post here:https://www.donation...88.msg50527#msg50527
Thanks Mouser & Chedabob for your offers of assistance.

Clive

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: Place randomly selected quotes in a specific box on a web page
« Reply #5 on: February 01, 2007, 06:02 AM »
Fantastic!
Maybe he'll make a post about it on his web page - let's keep our eye out for it - definitely seems like something others would benefit from learning how to do.