Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 10-25-2011, 12:49 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 82,476
SilverDragonTears is on a distinguished road
Default Random Images

How can I get a random image to pop up on the adopts pages, not everytime it loads.... just randomly, and random pictures? I want to make a sort of trick or treat hunt for my members.Once they see an image they click it and it is added to a special page they can access. I know how to do all that, I just don't know how to get the random images to show up.

What if I made a new table called treats? and inserted all the images into it. Then on the adopts page I could make them echo out randomly. Then once it's clicked, run a query that inserts the image into a new field in the users table. But how could I make the image NOT show up every time the page is clicked?
__________________

Check out SilvaTales
Reply With Quote
  #2  
Old 10-25-2011, 01:02 PM
mapleblade mapleblade is offline
Epicness sausage
 
Join Date: May 2009
Posts: 180
Gender: Male
Credits: 19,946
mapleblade
Default

you can try this

PHP Code:

<?php

$treat 
secure($_GET['treat']);

if(!empty(
$_GET['treat'])){

$success 0;

if(
$treat == 0){

// query for adopt?
$success 1;
}
elseif(
$treat == 1){

// query for adopt?
$success 1;
}
elseif(
$treat == 2){

// query for adopt?
$success 1;
}
elseif(
$treat == 3){

// query for adopt?
$success 1;
}
elseif(
$treat == 4){

// query for adopt?
$success 1;
}
elseif(
$treat == 5){

// query for adopt?

$success 1;
}

if(
$success == 1){
echo 
"You have successfully collected this treat!";

}
}else{

$show rand(0,100);

$random rand(0,5);

// 1 on 100 chance to show an image

if($show == 1){

//random image, modify the $random etc, and add more if ya want
if($random == 0){

$image "http://image.com/lol.png";
$link "http://lol.com/adopt.php?id=bl1a";
}elseif(
$random == 1){

$image "http://image.com/lol1.png";
$link "http://lol.com/adopt.php?id=bla";
}
elseif(
$random == 2){

$image "http://image.com/lol1.png";
$link "http://lol.com/adopt.php?id=bla";
}
elseif(
$random == 3){

$image "http://image.com/lol1.png";
$link "http://lol.com/adopt.php?id=bla";
}
elseif(
$random == 4){

$image "http://image.com/lol1.png";
$link "http://lol.com/adopt.php?id=bla";
}
elseif(
$random == 5){

$image "http://image.com/lol1.png";
$link "http://lol.com/adopt.php?id=bla";
}




// now actually paste it

echo "<a href='".$link."'><img src='".$image."' /></a> <font color='red'>YOU FOUND A TREAT! CLICK HERE TO COLLECT IT!</font>";

}
}

?>
all i worry about is spamming treats, you could put some security on it, so it can only be gotten once a time or something :)
__________________
Need coding help? send me a PM! :)

Last edited by mapleblade; 10-25-2011 at 01:26 PM.
Reply With Quote
  #3  
Old 10-25-2011, 01:06 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 82,476
SilverDragonTears is on a distinguished road
Default

Ooooo thank you!! Will try this now =)


EDIT: Ok so maybe I should know how this works. I added in some images and when I refresh I'm getting a broken image every time.

How about show a random image every 10 minutes?
__________________

Check out SilvaTales

Last edited by SilverDragonTears; 10-25-2011 at 01:12 PM.
Reply With Quote
  #4  
Old 10-25-2011, 01:19 PM
mapleblade mapleblade is offline
Epicness sausage
 
Join Date: May 2009
Posts: 180
Gender: Male
Credits: 19,946
mapleblade
Default

i editted the thing a lil bit, uhm check the echo i did, maybe theres an typo in it, and i think it would require cronjobs or a time stamp in a database table, and delete it every 10mins after it was entered.

Edit: u can experiment with it, i really gotta go back to my homework for tomorrw x3
__________________
Need coding help? send me a PM! :)

Last edited by mapleblade; 10-25-2011 at 01:21 PM.
Reply With Quote
  #5  
Old 10-25-2011, 01:24 PM
mapleblade mapleblade is offline
Epicness sausage
 
Join Date: May 2009
Posts: 180
Gender: Male
Credits: 19,946
mapleblade
Default

i saw the error on your site, fixed
__________________
Need coding help? send me a PM! :)
Reply With Quote
  #6  
Old 10-25-2011, 01:26 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 82,476
SilverDragonTears is on a distinguished road
Default

[s]Now I get this... Parse error: syntax error, unexpected T_VARIABLE, expecting '(' in /home/robynswo/public_html/myadopts.php on line 19[/s]

LoL =) Ok so I'm not good with cron jobs.... what would I need to do?

edit:
actually I'm not seeing the image at all... I changed echo to $article_content .=" too and still nothing.. hmm
__________________

Check out SilvaTales

Last edited by SilverDragonTears; 10-25-2011 at 01:31 PM.
Reply With Quote
  #7  
Old 10-25-2011, 01:28 PM
mapleblade mapleblade is offline
Epicness sausage
 
Join Date: May 2009
Posts: 180
Gender: Male
Credits: 19,946
mapleblade
Default

i already fixed it for u in my post, it should work now
__________________
Need coding help? send me a PM! :)
Reply With Quote
  #8  
Old 10-25-2011, 01:33 PM
mapleblade mapleblade is offline
Epicness sausage
 
Join Date: May 2009
Posts: 180
Gender: Male
Credits: 19,946
mapleblade
Default

i found one, it looks like a vampire :D, somehow it changed ur font size? :o?

btw link should be myadopts.php?treat=id
__________________
Need coding help? send me a PM! :)
Reply With Quote
  #9  
Old 10-25-2011, 01:36 PM
SilverDragonTears's Avatar
SilverDragonTears SilverDragonTears is offline
I am your Nemesis.
 
Join Date: Jun 2011
Posts: 1,113
Gender: Female
Credits: 82,476
SilverDragonTears is on a distinguished road
Default

YEa I fixed that part. Thanks for the start! I'll play with it a bit today. If I can't get it working at least I can probably fix it before next Halloween LOL


I've yet to see one O.o

Ha! Got one.. now to figure out how to save it to a user and show it on a new page. ugh.
__________________

Check out SilvaTales

Last edited by SilverDragonTears; 10-25-2011 at 01:48 PM.
Reply With Quote
  #10  
Old 10-25-2011, 01:47 PM
mapleblade mapleblade is offline
Epicness sausage
 
Join Date: May 2009
Posts: 180
Gender: Male
Credits: 19,946
mapleblade
Default

maybe you're better of with using the adopt.php link and limit it to one per acc
__________________
Need coding help? send me a PM! :)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Random egg Skaiya Questions and Supports 2 03-30-2014 02:42 PM
Random 3D Art alonaria Art Gallery 4 06-13-2011 05:19 PM
Random thing I did RoconzaArt Art Gallery 0 02-11-2011 05:21 PM
Random Adoptables fadillzzz Questions and Supports 15 04-12-2010 10:29 PM
Random 5 is not realy random! RipJawWolfFang Questions and Supports 9 04-30-2009 06:03 AM


All times are GMT -5. The time now is 07:40 PM.

Currently Active Users: 9827 (0 members and 9827 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636