(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-18-24 03:37 AM
0 users currently in Programming.
Acmlm's Board - I3 Archive - Programming - HTML Random Message New poll | |
Add to favorites | Next newer thread | Next older thread
User Post
Raccoon Sam

Boomerang Brother
Custom Title








Since: 11-20-05
From: Correct

Last post: 6298 days
Last view: 6298 days
Posted on 07-16-06 02:13 PM Link | Quote
Just like the "tip of the day" thing on SMWCentral.
How does one work?
Does it involve Something like, "get information from URL blablabla" or such?

Thank you in advance!
Prince Kassad

320
As you wish.








Since: 06-30-06
From: nowhere

Last post: 6299 days
Last view: 6299 days
Posted on 07-16-06 02:15 PM Link | Quote
I think stuff like this is done with PHP. Though there is a way to do this with javascript (if I remember correctly), not every user has javascript enabled.
Sukasa

Birdo
Not quite as active as before.
Xkeeper supporter
Xk > ||bass
I IP Banned myself! Twice!








Since: 11-17-05
From: Somewhere over there

Last post: 6299 days
Last view: 6298 days
Posted on 07-16-06 03:26 PM Link | Quote
I thnk you can do that with just about ANY active server technology.

I'm pretty sure you can also do that with ASP... and any other AST too, I'd imagine.
Raccoon Sam

Boomerang Brother
Custom Title








Since: 11-20-05
From: Correct

Last post: 6298 days
Last view: 6298 days
Posted on 07-16-06 03:38 PM Link | Quote
Originally posted by Sukasa +
I thnk you can do that with just about ANY active server technology.

I'm pretty sure you can also do that with ASP... and any other AST too, I'd imagine.



What is an ASP/AST?
Definition appreciated.
DarkSlaya

930
Gamma Ray








Since: 11-17-05
From: Montreal, Canada

Last post: 6298 days
Last view: 6298 days
Posted on 07-16-06 04:03 PM Link | Quote
ASP is a programming language.

AST are.... well, beats me. Probably refers to server-side programming languages or something.
Ogre

Paragoomba








Since: 07-12-06

Last post: 6388 days
Last view: 6388 days
Posted on 07-16-06 04:48 PM Link | Quote
ASP is Microsoft's version of PHP in a way, they share several similarities. Except that PHP is free to use, last I checked (long ago) ASP servers had to be paid for.

As for random messages *points at my own* just go find a PHP script and toss it on a free server that allows PHP, there are tons.
Raccoon Sam

Boomerang Brother
Custom Title








Since: 11-20-05
From: Correct

Last post: 6298 days
Last view: 6298 days
Posted on 07-17-06 04:32 PM Link | Quote
Originally posted by Ogre
ASP is Microsoft's version of PHP in a way, they share several similarities. Except that PHP is free to use, last I checked (long ago) ASP servers had to be paid for.

As for random messages *points at my own* just go find a PHP script and toss it on a free server that allows PHP, there are tons.



Cmon dude, where's t3h script.
Deleted User
Banned


 





Since: 05-08-06

Last post: None
Last view: 6299 days
Posted on 07-17-06 04:48 PM Link | Quote
I'm not a big PHP person, but I think something like this may do what you want.

<?php
$variable=rand(1, 3);
if($variable==1) { print "Item 1"; }
if($variable==2) { print "Item 2"; }
if($variable==3) { print "Item 3"; }
?>


The second number depends on how many items you are going to have. Also, this will not work the same way as the SMW Central "Tip of the Day". Instead of the item changing everyday, it'll change on each refresh. Another way to do it is to set different variables to be output on different days. I'm not sure how to do that, though. As I said before, I don't know much PHP. If this helped you at all, you're welcome.


(edited by Syn on 07-17-06 03:49 PM)
Sukasa

Birdo
Not quite as active as before.
Xkeeper supporter
Xk > ||bass
I IP Banned myself! Twice!








Since: 11-17-05
From: Somewhere over there

Last post: 6299 days
Last view: 6298 days
Posted on 07-17-06 05:15 PM Link | Quote
AST meant Active Server Technology, I just didn't feel like saying that. sorry.

Also, SMW central's tip changes on each refresh, not daily.

Edit: I looked on google, I think that for ASP
Randomize()
rnd()

Is the Random number generator, and this Is my try at a random content selector is ASP:
<%
Randomize()
Dim a
dim b
a = round(rnd() * (5 - 1) + 1)
select case a
case 1
b = "tip 1"
case 2
b = "tip 2"
case 3
b = "tip 3"
case 4
b = "tip 4"
case 5
b = "tip 5"
end select
Response.write(b)
%>


Or something like that.

Whoa, good thing I previewed that - the server here parsed it out... but didn't display anythign in it's palce.


(edited by Sukasa + on 07-17-06 04:27 PM)
Ogre

Paragoomba








Since: 07-12-06

Last post: 6388 days
Last view: 6388 days
Posted on 07-17-06 06:23 PM Link | Quote
Although it goes against my better judgement, screw it. Here's my script, it's very simple to modify up. In the array after $quotes=array('1' => put any quote you want in single quotes 'blah blah blah', and add a comma after it if it's not the last one. You can see my quote roll for an example.

If you can't figure that out, I can't (won't.) help you.

[edit]Forgot to mention, you need a \ before any quotation marks you use in a quote to escape breaking the line. (They are removed later by the script.)

And WOW that's a bad setup for showing attachments, it broke the tables, haha.

Attachments

quote.rar (932b) - views: 34



(edited by Ogre on 07-17-06 05:26 PM)
Deleted User
Banned


 





Since: 05-08-06

Last post: None
Last view: 6299 days
Posted on 07-17-06 07:00 PM Link | Quote
Originally posted by Sukasa +
Also, SMW central's tip changes on each refresh, not daily.

Then my way would be perfect for PHP format although Ogre's way works, too.

EDIT: I made a file that has everything you need already setup, but I can't add it yet. I'll post the code here.

<?php
$quote=rand(1,10);
if($quote==1) { $quote="Item 1"; }
if($quote==2) { $quote="Item 2"; }
if($quote==3) { $quote="Item 3"; }
if($quote==4) { $quote="Item 4"; }
if($quote==5) { $quote="Item 5"; }
if($quote==6) { $quote="Item 6"; }
if($quote==7) { $quote="Item 7"; }
if($quote==8) { $quote="Item 8"; }
if($quote==9) { $quote="Item 9"; }
if($quote==10) { $quote="Item 10"; }
print stripslashes($quote);
?>


This way removes backslashes from the quotes unlike my original code. Also, my way allows font editing. The way Ogre did it makes the text an image, so it's less customizable. Use whichever way you prefer.

Another note, put the quotes where it says "Item #". To add more quotes, change the rand(1,10) to something further apart such as rand(1,20) and same goes for removing quotes. When you do this, you'll have to add more if($quote==#) depending on how many more quotes you've added. Another thing you can do if you want a quote to appear more than others is that you can set that quote to multiple numbers such as having numbers 1-5 being one quote and have 6-10 all be different quotes. These are just a few of the things you can do. I'm not going to bother going into it anymore because you probably get the idea by now.


(edited by Syn on 07-17-06 06:23 PM)
(edited by Syn on 07-17-06 06:35 PM)
(edited by Syn on 07-17-06 06:37 PM)
Ogre

Paragoomba








Since: 07-12-06

Last post: 6388 days
Last view: 6388 days
Posted on 07-17-06 09:27 PM Link | Quote
Syn, your way gets very bloated with unnecessary code fast that way. By using an array everything is in a neat, orderly fashion. (Yay for streamlining.)

And less customizable how? =P Actually easier to apply color and size formating to my script. Change the color variables to effect the background and font colors(simple RGB format)
$bg=ImageColorAllocate($img, 255,255,255);
$textc=ImageColorAllocate($img,0,0,0);

and if you want to change up the size, simply modify the two digits I've underlined. (The font size indignation.
$width=ImageFontWidth('2') * strlen(stripslashes($str));
ImageString($img,2,0,0,$str,$textc);


Easy as Pi.
DarkSlaya

930
Gamma Ray








Since: 11-17-05
From: Montreal, Canada

Last post: 6298 days
Last view: 6298 days
Posted on 07-17-06 09:35 PM Link | Quote
Also, Ogre's code renders it in a GD Image, so it can be used anywhere (you aren't limited to JUST your server).

Of course, it has it's downside (most people aren't bother to have paid hosting or don't know people that can give them, and free hosts don't always allow it), but it's useful.
Ogre

Paragoomba








Since: 07-12-06

Last post: 6388 days
Last view: 6388 days
Posted on 07-21-06 06:30 PM Link | Quote
If you need a host that allows the ImageGD, there is always Host.sk. They were good to me when I used them. Ignore the fact I'm not Slovokian.
Zer0wned

Koopa


 





Since: 12-09-05
From: Torrance, ca

Last post: 6455 days
Last view: 6455 days
Posted on 07-23-06 06:57 PM Link | Quote
just to clarify, ASP is an enableable option for windows 2k and up (doesn't even have to be a server edition, but have your setup disk available). it creates the directory C:\inetpub\wwwroot\ which is accessable by typing http://localhost/ into your web browser, or with the correct settings, by typing in your public IP address.

So in short, ASP doesn't cost any (extra) money, as long as you have a non-XP Home edition post 98 windows.

http://www.w3schools.com/asp/asp_adrotator.asp
just so I'm not too off topic, that's another way to pull that off in ASP

And to accomplish this with the assumption that you're using some HTML-only type of service, you're stuck using javascript
This has the code you need

If you'd like I can tell you what you need to run an ASP site entirely from your own windows box (ASTs are only for dynamic portions, as far as I know all dynamic web pages still use standard HTML for the static portions).
http://zeedo.no-ip.org/eshop/ <--this is currently running off of my own computer (looks like crap, but it's for practice anyway)


(edited by Zer0wned on 07-23-06 05:59 PM)
Sukasa

Birdo
Not quite as active as before.
Xkeeper supporter
Xk > ||bass
I IP Banned myself! Twice!








Since: 11-17-05
From: Somewhere over there

Last post: 6299 days
Last view: 6298 days
Posted on 07-24-06 12:41 AM Link | Quote
I have Windows 98 and Personal Web Server... That uses ASP.

And ASP is a tpe of active server technonlogy, as per what I know of it's definition.
Zer0wned

Koopa


 





Since: 12-09-05
From: Torrance, ca

Last post: 6455 days
Last view: 6455 days
Posted on 07-24-06 02:41 AM Link | Quote
Originally posted by Sukasa +
I have Windows 98 and Personal Web Server... That uses ASP.


that's right, I forgot about personal web server... so make that windows 98 (with some help) and up. (and maybe 95, but as I recall that's not the case)
Sukasa

Birdo
Not quite as active as before.
Xkeeper supporter
Xk > ||bass
I IP Banned myself! Twice!








Since: 11-17-05
From: Somewhere over there

Last post: 6299 days
Last view: 6298 days
Posted on 07-24-06 04:09 AM Link | Quote
I don't nelieve so... and what do you mean,'with some help'?
Zer0wned

Koopa


 





Since: 12-09-05
From: Torrance, ca

Last post: 6455 days
Last view: 6455 days
Posted on 07-24-06 05:45 AM Link | Quote
oh, I was just referring to the need to have personal web server in order to be able to use ASP on windows 98, whereas in newer windows versions (except for XP home), it's an included (but by default disabled) optional windows component (Internet Information Services, aka IIS).

So what I was trying to do was to fix my previous statement:
"So in short, ASP doesn't cost any (extra) money, as long as you have a non-XP Home edition post 98 windows."

which excluded windows 98 from ASP-capable windows versions, to a more correct:
"So in short, ASP doesn't cost any (extra) money, as long as you have a non-XP Home edition windows 98 or newer (with personal web server for windows 98, and IIS enabled for NT and up)."

because I had forgotten about personal web server until you mentioned it.

I've been away from forums for a while, so I'm bound to make mistakes like that for a little while...
Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - Programming - HTML Random Message |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.013 seconds; used 445.21 kB (max 567.60 kB)