Topic: Dynamic Cell (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=10894" title="Pages that link to Topic: Dynamic Cell (Page 1 of 1)" rel="nofollow" >Topic: Dynamic Cell <span class="small">(Page 1 of 1)</span>\

 
Moon Shadow
Paranoid (IV) Inmate

From: Rouen, France
Insane since: Jan 2003

posted posted 01-22-2003 21:43

I have a question for experienced webmasters... I think it's not possible, but...

I want to put a text or an image in a cell in a table. This is not too hard. The problem is that I want this cell and this cell only to dynamically change on each visit (or reload) of the page. And, as if it was not enough, I would like this to be compatible with XHTML 1.1. I don't know how I can do something like that. Maybe a javascript ?


Ultimately all things are known because you want to believe you know.
-Zensunni koan

mobrul
Bipolar (III) Inmate

From:
Insane since: Aug 2000

posted posted 01-22-2003 21:49

The only way I can think of to make this happen is to use server-side language like PHP, JSP, or ASP.
I'm not sure if you need the image/text piece to change in a set pattern, according to some changing parameter (like time of day or database content, etc) or simply randomly, but any of these ways could be accomplished. Randomly would be easier, followed by parameter...at least that's my initial thoughts on the subject.

If you're looking for XHTML complience, stay away from tables for layout. Not that tables don't comply, but when used for layout they certainly go against the spirit.

What kind of experience do you have with server side languages?

Moon Shadow
Paranoid (IV) Inmate

From: Rouen, France
Insane since: Jan 2003

posted posted 01-22-2003 22:20

Oh my... This is what I feared

I have no experience in server-side languages... I don't know anything about JSP or ASP. I am not bad in HTML so with a little training I will probably be able to do it in PHP.

Can you please quickly explain to me what should look like a PHP code randomly changing the content ?

And for the tables... You are probably right. It only did it this way because I hadn't found any other way.

Ultimately all things are known because you want to believe you know.
-Zensunni koan

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 01-22-2003 23:09

Moon Shadow: Here is the script I used to make the GN logo randomly change when you reloaded it (it is static now but who knows what the future may bring?

code:
srand ((float) microtime() * 10000000);

$title = array (
"gurus_logo_ozone2.jpeg",
"gurus_logo_ozone.jpeg",
"gurus_logo_ozone4.gif",
"dl44_green1.jpg",
"dl44_space-portal1.jpg",
"dl44_brownies1.jpg",
"dl44_glass1.jpg",
"dl44_steel1.jpg",
"steve-gurulogo-1.jpg",
"steve-gurulogo-2.jpg",
"steve-gurulogo-3.jpg",
"bugimus_logo1.jpg",
"bugimus_logo2.jpg",
"darkgarden_mash.jpg",
"darkgarden_blade.jpg",
"darkgarden_drip.jpg",
"darkgarden_pill.jpg",
"rend_gurus.jpg",
"rend_gurus2.gif"
);

$rand_keys = array_rand ($title, 2);

$guru_main_title = $title[$rand_keys[0]];



[edit: so just replace the image names in the array with your own and that should work fine - its a little loose around the edges but it should work fine.

I'm also sure that this could be done client-side with JavaScript - I believe the old GN design did things this way so check it out - the principle is similarish]

___________________
Emps

FAQs: Emperor

Moon Shadow
Paranoid (IV) Inmate

From: Rouen, France
Insane since: Jan 2003

posted posted 01-23-2003 12:53

Thanks Emperor

Ultimately all things are known because you want to believe you know.
-Zensunni koan

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 01-23-2003 18:33

This can also be done with javascript. I had a little random script on one of my pages a while back done with JS...

Not my script, don't entirely recall where I got it, though I think it may have been Doc's work -

code:
<script language=Javascript>
<!--start random logo script

logonames = new Array
(
"pic00.jpg",
"pic01.jpg",
"pic02.jpg",
"pic03.jpg",
"pic04.jpg",
"pic05.jpg",
"pic06.jpg",
"pic07.jpg",
"pic08.jpg",
"pic09.jpg"
);

rando = Math.round( Math.random() * (logonames.length - 1) )

logoname = logonames[rando];


document.write("<img src=\"path/to/your/image"+logoname+"\" name=\"logo\"");
document.write("width=\"335\" height=\"195\" slt=\"myimage\"> );

//-->
</script>



Moon Shadow
Paranoid (IV) Inmate

From: Rouen, France
Insane since: Jan 2003

posted posted 01-23-2003 18:51

Oh thanks also it will be useful Thanks to you guys.

Ultimately all things are known because you want to believe you know.
-Zensunni koan

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 01-23-2003 19:58

Glad to help. Now that I look at the script a bit more, I recall that it was in fact Doc's original random logo script for the GN. Should add this to the top if you use it -

code:
<!--DocOzone's Javascript code, copyright 1998
// Feel free to borrow and modify this code,
// but be sure leave this credit in the source!
// Your pal, -Dr. Thaddeus Ozone-// .http://www.ozones.com/



Since it seems you will also be looking for alternate wasy to achieve your layout with xhtml compliance, you'll want to check out these great CSS tutorials at the GN as well -
http://www.gurusnetwork.com/tutorials/css/cssintro/cssintro1.html
http://www.gurusnetwork.com/tutorials/css/cssintro2/cssintro2-1.html
http://www.gurusnetwork.com/tutorials/css/box_model/style.html

and this, though a bit old, is still a good source of the real basics behind the switch to XHMTL - http://www.gurusnetwork.com/tutorials/html/xhtml/xhtml1.html

Have fun =)


{edit - took care of those 'extra' posts there }



[This message has been edited by DL-44 (edited 01-23-2003).]

Moon Shadow
Paranoid (IV) Inmate

From: Rouen, France
Insane since: Jan 2003

posted posted 01-23-2003 21:30

No problem I will use the credit. And thanks for the links, this site look interesting.

And for the twin post excuse me I already have Parkinson

Ultimately all things are known because you want to believe you know. -Zensunni koan

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 01-23-2003 21:50
quote:
this site look interesting



Well, we've worked hard to make it become so.

The Gurus Network is somewhat the bastard child of the Ozone Asylum, with it's focus much more directly on Web development and design.

The selection and quality of the tutorials is hard to match anywhere else on the web, and there are many more in the works.



Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 01-23-2003 22:15

Moon Shadow: Yep that is a good script. And if you wanted to use it in ASP or ColdFusion (or any other server-side scripting language) then it could easily be ported into that language with little effort.

DL:

quote:
bastard child





I've always thought of it as the daughter site which we scrimped and saved to send to college or the clever cousin who got into law school

___________________
Emps

FAQs: Emperor

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 01-23-2003 22:22

Hehe.

With a place like this, there's nothing but bastards



Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 01-23-2003 22:24

DL: Speak for yourself

[edit: There are also weirdos, perverts and imbeciles - and thats just me ]

___________________
Emps

FAQs: Emperor

Suho1004
Maniac (V) Inmate

From: Seoul, Korea
Insane since: Apr 2002

posted posted 01-24-2003 05:06

Emps: You left out paranoid conspiracy theorists (also you).

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 01-24-2003 12:37

Suho1004: Who have you been talking to??

___________________
Emps

FAQs: Emperor

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 01-24-2003 14:42

No no no no no!

You've taken the wrong use of bastard! But you would, you bastard!

I meant there are no legitimate children





Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu