What am I talking about?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nightraven
Forum Newbie
Posts: 1
Joined: Sun Sep 12, 2004 5:10 pm

What am I talking about?

Post by nightraven »

Hi folks, this is my first time here but I hope it's okay to ask a quick question?

I am designing a website for free software tutorials, on the home page I want each software package to have a small space where I can have say 'todays featured tutorials'. I want these tutorials and the links to change constantly (selected from a list of all tutorials for that topic).

see http://www.newventuresuccess.com/test.htm

each featured item will have a small picture, and a text link to the tutorial.

Is there anyway I can make this happen? Does anyone know what this is called so I can discuss it with people who know what they are talking about?[/url]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I don't know of a definitive name, however it's normally done with a database query which is asked to randomly select x number of records. These records hold the image, text and link information.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

The question is do you want to rotate through the list (i.e. show 1..10, then 11..20, then 21..30) or do you want to a random selection from the list. If you want random, the next question is do you want each set to be different from the previous set, picking each selection only from those that have not been shown, or just picking a random set which may show the same one (randomly) shown twice. There are different methods for each.
(#10850)
Slacker
Forum Newbie
Posts: 17
Joined: Thu Aug 12, 2004 9:19 pm

Post by Slacker »

Sounds like you want a small twist on a Random 'Insert Functionality Here' script.
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

You may want to look at "banner ads" :evil: as an example of some methods to use.
User avatar
phpScott
DevNet Resident
Posts: 1206
Joined: Wed Oct 09, 2002 6:51 pm
Location: Keele, U.K.

iframes

Post by phpScott »

after you figure out how you want to choose your featured tutorial you may want to check out IFRAMES in html as they will allow you to add dynamic content to the front of your page if you first page is like index.html or the like.
User avatar
dull1554
Forum Regular
Posts: 680
Joined: Sat Nov 22, 2003 11:26 am
Location: 42:21:35.359N, 76:02:20.688W

Post by dull1554 »

only problem with iframes is that...last time i checked, and correct me if im wrong....not all browers support iframes, a matter-a-fact i think only IE 4.0 or later does....

but ive been wrong before and i could be wrong again
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Firefox 0.8+ supports iframes too.. dunno about others..
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

The question you need to ask is what is your target audience ? How many people within your audience will still use older browsers which do not use your features and is it worth while coding your tutorial based on that kind of browser. Coding for all browsers, whilst giving great access means a lot of complications and generally messy scripts (often bad in a tutorial).

I am all for giving an introduction page for all browsers stating that Mozilla/Explorer X is required - Download Mozila here <link>.

You have an even better case to do this within a free tutorial, after all they are getting something for free, some initial work when needed isn't too much to ask.
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

Don't overcomplicate the issue with client-side stuff that's not necessary.
The SQL (MySQL) for grabbing random rows from the database would look a bit like this:

Code: Select all

SELECT 	tutorial_name, 
		tutorial_author,
		tutorial_date,
		tutorial_url
ORDER BY RAND()
ORDER BY RAND() will obviously do the randomizing work for you.
User avatar
vigge89
Forum Regular
Posts: 875
Joined: Wed Jul 30, 2003 3:29 am
Location: Sweden

Post by vigge89 »

feyd wrote:Firefox 0.8+ supports iframes too.. dunno about others..
IFRAMES are supported in most browsers, just the old ones which doesn't support them. I advice you not to use them though...
Post Reply