/    Sign up×
Community /Pin to ProfileBookmark

Displaying random content on other websites

Hello,

I have a simple script for showing my content (pictures) on other websites, but it generates the content by reading the users date (1-31), and because of that can show only certain amount of content/pictures (31) on a mountly bases. Can I edit this simple script to randomize the way the content is being displayed, so I’ll be able to display a greater number of content?

Example of the way the content is displayed:
[url]http://www.girlsonwallpapers.com/test.html[/url]

Code that displays the script:

[CODE]<script language=”JavaScript” src=”http://www.girlsonwallpapers.com/girls.js”></script>[/CODE]

Script:

[CODE]var msg = new Array();
Stamp = new Date();
today = Stamp.getDate();
msg[1] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[2] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[3] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[4] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[5] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[6] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[7] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[8] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[9] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[10] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[11] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[12] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[13] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[14] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[15] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[16] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[17] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[18] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[19] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[20] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[21] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[22] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[23] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[24] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[25] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[26] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[27] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[28] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[29] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[30] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;
msg[31] = “<a target=_blank href=http://www.girlsonwallpapers.com/megan-fox/megan-fox3.jpg><img src=http://www.girlsonwallpapers.com/megan-fox/m-megan-fox3.jpg width=93 height=70 border=0></a>”;

function writeTip() {
document.write(msg[today]);
}
document.write(msg[today]);
document.write(‘<br>[<a <a target=_blank href=”http://www.girlsonwallpapers.com”>girlsonwallpapers.com</a>]’);[/CODE]

Thanx ?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@FangNov 13.2009 — Use the array length to generate a random number:document.write(msg[Math.round((msg.length-1) * Math.random()));
×

Success!

Help @shockyz spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...