adding random votes

CrazyCoder

Member
hello people, so yeah another stupid idea, but ...
just in order to devellop a new site, i would like to add random votes, each day, to several site i registered bymyself

yesss its bad, bad, bad, but this way i can make my new site, quickly known and attractive to real new members

so, a few php should do the trick right ?


some insert random values to the right stats fields, a simple php line,
i could repeat for several members i choose to

can anybody help me please ?


i guess, maybe into the ranking file ? or better into the in.php

:))))
 

Basti

Administrator
Staff member
new_day.php ( via a plugin ofcourse )
Code:
$my_site_votes = 5;

$DB->query("UPDATE {$CONF['sql_prefix']}_stats SET
                        unq_in_0_daily = unq_in_0_daily + {$my_site_votes},
                        tot_in_0_daily = tot_in_0_daily + {$my_site_votes},
                        unq_in_0_weekly = unq_in_0_weekly + {$my_site_votes},
                        tot_in_0_weekly = tot_in_0_weekly + {$my_site_votes},
                        unq_in_0_monthly = unq_in_0_monthly + {$my_site_votes},
                        tot_in_0_monthly = tot_in_0_monthly + {$my_site_votes},
                        unq_in_overall = unq_in_overall + {$my_site_votes},
                        tot_in_overall = tot_in_overall + {$my_site_votes}
                        WHERE username = 'myUser' OR username = 'myOtherUser'", __FILE__, __LINE__);
 

CrazyCoder

Member
is it possible to give a random value integer to $my_site_votes ? something like : $my_site_votes = rand(1, 150); ?
 

CrazyCoder

Member
yeahhhhhh super great, hihii i just could order my domain name, 12.99$ 1 year, cant wait to buy my VL renew, lets see to pick up more money from mummy, next week, haha yeahhhhh mummy is great too, lol ;)
thanks again Basti ;)
 

CrazyCoder

Member
huuummm ... thinking about creating a cron job, so putting this code into an external file, to make it run each 30 minutes.
so i could make looks those "virtual" votes, more realistics, lol ...
will report tomorrow if i succeed.
 

CrazyCoder

Member
done ! in the hope i created the cron job correctly, hihihiii, lets see, ... this way, every 15 minutes the file will be run AND i separated each website, calculating a new random vote value,
so its more realistic and smooth, here i attach my final file ;)
in the case someone is interrested to use it
of course ! to those wanting to use this, CHANGE all usersnames to YOURS, lol hihiii ... just in case ;)
 

Attachments

leonor

Active Member
License Active
interesting idea ^^

Did you now Arrys and loop's ? ... I will show you later what i mean =)
 

CrazyCoder

Member
excuses me am not english, sometimes i do not well understand what people are writing, :)
what do u mean by => "Did you now Arrys and loop's ?"

all is running file , from a cron job i added to my webadmin server, all 15 minutes its adding random votes to each member i coded, hehehe

HERE the last version of the file , i attach it ;)

HERE the cron job command line : /usr/bin/lynx --dump http://www.lannuaire-francophone.com/randomly_adding_votes_to_several_sites.php

of course i setup the minutes, lol : 0,15,30,45 dats it :)
 

Attachments

Basti

Administrator
Staff member
What leonor means are array and loops. Reducing your amount of code you need to write
Code:
$users = array('user1', 'user2', 'user3');

foreach($users as $user) {
    $votes = rand(1, 17);
    // the mysql query here, just one.
    // using WHERE username = '{$user}'
}
Such loops "loop" through the array, so doing the code inside the loop for each of the array items. In this case for each user
 

CrazyCoder

Member
haaaaaaaaaaaaaa yeaahhhhhhh ok ok ok sych a great code improvement !!!

heheheheee yessssss congrats !!!! leonor and basti :)))))))

thank u
 

CrazyCoder

Member
oops seems i forgot something hihi have a look please =>

DailyUnique InTotal InUnique OutTotal Out
Average10.510.50.00.0
Today10510500



no in unique + no out total out

how would i fix this ? please, seems i must add another query for those 2 ones
i guess 2 differents random values for both of those :)))
here my last file, i dont already corected to improved the php code
 

Attachments

CrazyCoder

Member
another small fix i need, certainly my mistake, once i want to rate a site, i get a blanck page , as example => http://www.lannuaire-francophone.com/rate/admin-francophonie/

seems its since i moved my site to its final adress, coz on my test site, i could rate and review, of course i added the aardwark code to go back to rate and reviews internal

EDIT ===> this way its working ====

http://www.lannuaire-francophone.com/index.php?a=rate&u=alamandra

maybe something wrong to my htaccess ......

i have clean urls enabled

yeahhhh got it, its clean urls, i disabled it for now, gonna look after some fix ;)
 
Last edited:

CrazyCoder

Member
woo god .. what should i do ? autokill me ? sucide me, if its right english said, lol woo basti sorry :rolleyes::rolleyes:

On clean urls its "review" and not "rate"
oops, ok ok so i changed the link to review

but now, reviews are not shown, arrfff i miss something else somewhere ... sometimes ... in a summer times ... :p
 

Basti

Administrator
Staff member
A look at the htaccess files shows what you are missing. Left side clean version "mapped" to right side original
Code:
RewriteRule ^review/(.*)/ index.php?a=rate&u=$1 [L]
RewriteRule ^reviews/(.*)/ index.php?a=details&u=$1&all_reviews=1 [L]
So it would be "review" to rate, and "reviews" to view them
 
Top