Jump to content
MakeWebGames

secret_life

Members
  • Posts

    65
  • Joined

  • Last visited

Everything posted by secret_life

  1. thanks for your help. Now i have my table shorted how i can get position for user number 1 exemple   $rs=$osDB->query("SELECT COUNT(*) AS vote_count, ROUND((SUM(r.rating) / COUNT(*), 1) AS avg_rating FROM flirt_userrating ORDER BY avg_rating DESC, vote_count DESC") ;
  2. Hi all i have toplist on my website and this is my code   <?php if ( !defined( 'SMARTY_DIR' ) ) { include_once( 'init.php' ); } $psize = "10"; // Limit $minimum_votes = "3"; // Minimum number of votes required $cpage = $_REQUEST['page']; if( $cpage == '' ) { $cpage = 1; } $sql = 'SELECT u.country, u.state_province, u.city, u.id, u.username, floor(period_diff(extract(year_month from NOW()),extract(year_month from u.birth_date))/12) as age, u.gender, u.lookgender, count( * ) vote_count , round(avg( r.rating ),1) avg_rating FROM ! u INNER JOIN ! r ON u.id=r.profileid GROUP BY 1,2,3,4,5 HAVING COUNT(*)>="'.$minimum_votes.'" ORDER BY avg_rating DESC, vote_count DESC LIMIT 10'; $rs = $osDB->query( $sql, array( USER_TABLE, USER_RATING_TABLE ) ); $rcount = $rs->numRows(); if( $rcount > 0 ) { $t->assign( 'totalrecs', $rcount ); $pages = ceil( $rcount / $psize ); $start = ( $cpage - 1 ) * $psize; $t->assign ( 'start', $start ); if( $pages > 1 ) { if ( $cpage > 1 ) { $prev = $cpage - 1; $t->assign( 'prev', $prev ); } $t->assign ( 'cpage', $cpage ); $t->assign ( 'pages', $pages ); if ( $cpage < $pages ) { $next = $cpage + 1; $t->assign ( 'next', $next ); } } $sql .= " limit $start, $psize" ; } $data = array(); $number = 1; while ( $row = $rs->fetchRow() ) { $countryname = $osDB->getOne('select name from ! where code = ?', array(COUNTRIES_TABLE, $row['country'] ) ); $statename = $osDB->getOne('select name from ! where code = ? and countrycode = ?', array(STATES_TABLE, $row['state_province'], $row['country'] ) ); $row['countryname'] = $countryname; $row['statename'] = ($statename != '') ? $statename : $row['state_province']; $row['username'] = $row['username']; $row['number'] = $number; $data[] = $row; $number+=1; } hasRight(''); $t->assign ( 'querystring', $querystring ); $t->assign ( 'psize', $psize ); $t->assign ( 'data', $data ); $t->assign ( 'lang', $lang ); $t->assign ( 'rendered_page', $t->fetch('showtoplist.tpl') ); $t->display ( 'index.tpl' ); exit; ?>   I want to put user global ranking in user homepage but i can make a query that work in. I want like this '' You ranked : 123 '' i know i need to use this count( * ) vote_count , round(avg( r.rating ),1) avg_rating before but im lost. Please help me for this query if you can Thanks
  3. Game look very nive but is slow a little. Get page speed for firefox and optimise your image, enable gzip, compress your 7 javascript file and i hope you lot of players :)
  4. Try this :)   $q2=$db->query("SELECT `dlevel`,`accpoints`,`maxpoints` FROM `users` WHERE `userid` > 0"); WHILE ($r=$db->fetch_row($q2)) { IF (($r['accpoints'])<= ($r['maxpoints'])) { if ($r['dlevel'] == 1) { $accpointsgain = $r['accpoints']+300; if ($accpointsgain <= $r['maxpoints']) { $db->query("UPDATE users SET accpoints=$accpointsgain WHERE {$r['userid']}"); } else { $db->query("UPDATE users SET accpoints={$r['maxpoints']} WHERE {$r['userid']}"); } } if ($r['dlevel'] == 2) { $accpointsgain = $r['accpoints']+400; if ($accpointsgain <= $r['maxpoints']) { $db->query("UPDATE users SET accpoints=$accpointsgain WHERE {$r['userid']}"); } else { $db->query("UPDATE users SET accpoints={$r['maxpoints']} WHERE {$r['userid']}"); } } if ($r['dlevel'] == 3) { $accpointsgain = $r['accpoints']+500; if ($accpointsgain <= $r['maxpoints']) { $db->query("UPDATE users SET accpoints=$accpointsgain WHERE {$r['userid']}"); } else { $db->query("UPDATE users SET accpoints=$r['maxpoints'] WHERE $r['userid']"); } } } }
  5. Merry Christmas all !
  6. for fun maybay http://img705.imageshack.us/img705/2671/wallpapergv.png
  7. Gona be an Epic fail Nice look your game +1
  8. second is better ;)
  9. i dont think is a great idee, when i see a website use google translate i try to take original version in english because french is a complicat language then translation have alwais big mistake and no sens text. If you want to make many language i think best idee will be language file, but i have try it in a dating website and i have erase it because french people dont want talk with english people. For my game i start it in english ( 80% people speak english ) after if the game work i gona make it in french.
  10. Hi, make description in text not in image, remove ads and remove keyword stuffing in footer ( google gona put you in the 50 pages - bad for seo ) maybe put google analytics but all of this is just my opinion ;)
  11. i agree with a_bertrand i speak french and i always play in french when the game offer it. Look all great game have different server per language. Imagine now a spanish guy want trade item with a french guy, little complicated loll
  12. Good work just change header background a little to fit main color use this http://colorschemedesigner.com/ and +1 for subjet of your game to many mafia game ;) nice job
  13. Im interested to
  14. nice escape mark ;)
  15. lol im not a coder i just give a solution if is lazy give your pro solution for help all to learn ;)
  16. is true but just change it to   if(strlen($_POST['cash']) > 9) { echo 'where are you going bambi'; $h->endpage(); exit; }   and set it to max 999,999,999 i dont think peaople cry for 1$ :)
  17. just use   if(strlen($_POST['cash']) > 10) { echo 'where are you going bambi'; $h->endpage(); exit; }
  18. Hi ok now i need a partner. The game is unique and i have to much job for finish im. I dont want say my game idee there before the game start. Tip: If you like secret thing is for you :) the game is 75% done and have a lot of idea not seen before. My game dont just use click skill loll but you need to use you brain to play. the game use video, and other new thing and i have find new way to attract people mccode V2 MySQL: 5.1.52 PHP: 5.2.4 What i need : you have 18+ year old and your serious very good english speaking and writing ( im not english, im french you gona be my compass ) very good in php ( who use mysql_real_escape_string lol ) i dont want a lazy partner who make unsecure thing css html What i offer: good in html very good in graphic design php ( i always learn ) very good in seo and marketing communication will be in email because im french and i dont speak well english partner are not going to have acces to cpanel beacause i have a lot of website with sensitive information. cash benefit will be split 50/50 weekly if your interested with this send me a PM and talk about you, your skill, what you have done, and please give me exemple of what type code you can do thanks
  19. i know is a old post but i want know if the bug when you clic on black and red i same bet have ben corected ? thanks
  20. i am a marchand to and paypal do not refound download thing. Paypal refound just shipping thing. so your okay :)
  21. i try to add a friend and i always got this message That user isnt a real person im afraid... Come back later...   an idee ??? thanks
  22. thanks Danny for your answer i have corect the file lottery.php <?php // Created, and released for free for the MWG (makewebgames.io) community by Kieran-R include "globals.php"; $ticketssold=$db->num_rows($db->query("SELECT * FROM moneylotto")); $mytickets=$db->num_rows($db->query("SELECT * FROM moneylotto WHERE userid=$userid")); $jackpot=($ticketssold*50000)*0.90; echo" <h2>Weekly Lottery</h2> Welcome to the weekly money lottery! Buy your lottery ticket for this week and be in with a chance of winning the jackpot! You can purchase as many lottery tickets as you wish for $50,000 per ticket: [b]Total Tickets Sold:[/b] $ticketssold [b]Your Tickets:[/b] $mytickets [b]Current Jackpot:[/b] ".money_formatter($jackpot)." [b]Payout Time:[/b] Friday 9:00PM "; if (isset($_POST['tickets'])){ if ($ir['money'] < 50000){ echo " Sorry. You need [b]$50,000[/b] or more to buy a lottery ticket!"; } else { $db->query("UPDATE users SET money=money-50000 WHERE userid=$userid"); $db->query("INSERT INTO moneylotto (ticketid, userid) VALUES ('', '$userid')"); echo " Congratulations on purchasing a lottery ticket for this weeks lottery!"; } } echo" <form method='POST' action='lottery.php'> <input type='hidden' name='tickets' value=1 length=2 /> <input type='submit' value='Buy Lottery Ticket'> "; //Previous Winners $prewinners=$db->query("SELECT * FROM moneylottowinners ORDER BY id DESC LIMIT 10"); echo" <h3>Previous Winners</h3> <table width=65% cellspacing=1 class='table' border='1'><tr><th>Winner</th><th>Amount</th></tr>"; while($r=$db->fetch_row($prewinners)) { $user = mysql_fetch_array($db->query("SELECT username FROM users WHERE userid={$r['winner']}")); echo"<tr><td><a href=viewuser.php?u={$r['winner']}>{$user['username']}</td><td>[b]".money_formatter($r['amount'])."[/b]</td></tr>"; } echo"</table>"; //Previous Winners Done $h->endpage(); ?>   pointslottery.php <?php // Created, and released for free for the MWG (makewebgames.io) community by Kieran-R include "globals.php"; $ticketssold=$db->num_rows($db->query("SELECT * FROM pointslotto")); $mytickets=$db->num_rows($db->query("SELECT * FROM pointslotto WHERE userid=$userid")); $jackpot=($ticketssold*50)*0.90; echo" <h2>Weekly Points Lottery</h2> Welcome to the weekly points lottery! Buy your lottery ticket for this week and be in with a chance of winning the jackpot! You can purchase as many points lottery tickets as you wish at 50 points per ticket: [b]Total Tickets Sold:[/b] $ticketssold [b]Your Tickets:[/b] $mytickets [b]Current Jackpot:[/b] $jackpot Points [b]Payout Time:[/b] Friday 9:00PM "; if (isset($_POST['tickets'])){ if ($ir['crystals'] < 50){ echo " Sorry. You need [b]50 Points[/b] or more to buy a points lottery ticket!"; } else { $db->query("UPDATE users SET crystals=crystals-50 WHERE userid=$userid"); $db->query("INSERT INTO pointslotto (ticketid, userid) VALUES ('', '$userid')"); echo " Congratulations on purchasing a points lottery ticket for this weeks lottery!"; } } echo" <form method='POST' action='point_lottery.php'> <input type='hidden' name='tickets' value=1 /> <input type='submit' value='Buy Lottery Ticket'> "; //Previous Winners $prewinners=$db->query("SELECT * FROM pointslottowinners ORDER BY id DESC LIMIT 10"); echo" <h3>Previous Winners</h3> <table width=65% cellspacing=1 class='table' border='1'><tr><th>Winner</th><th>Amount</th></tr>"; while($r=$db->fetch_row($prewinners)) { $user = mysql_fetch_array($db->query("SELECT username FROM users WHERE userid={$r['winner']}")); echo"<tr><td><a href=viewuser.php?u={$r['winner']}>{$user['username']}</td><td>[b]{$r['amount']} Points[/b]</td></tr>"; } echo"</table>"; //Previous Winners Done $h->endpage(); ?>   lotterycron.php <?php // Created, and released for free for the MWG (makewebgames.io) community by Kieran-R include "config.php"; include "global_func.php"; global $_CONFIG; if($_GET['code'] != $_CONFIG['code']) { die(""); } define("MONO_ON", 1); require "../class/class_db_{$_CONFIG['driver']}.php"; $db=new database; $db->configure($_CONFIG['hostname'], $_CONFIG['username'], $_CONFIG['password'], $_CONFIG['database'], $_CONFIG['persistent']); $db->connect(); $c=$db->connection_id; $set=array(); $settq=$db->query("SELECT * FROM settings"); while($r=$db->fetch_row($settq)) { $set[$r['conf_name']]=$r['conf_value']; } //Money Lotto $ticketssold=$db->num_rows($db->query("SELECT * FROM moneylotto")); $payout=($ticketssold*50000)*0.90; $rand=rand(1,$ticketssold); $win=$db->query("SELECT * FROM moneylotto where ticketid=$rand"); $winner = mysql_fetch_array($win); event_add($winner['userid'],"Congratulations! You have won the weekly lottery, and claimed your ".money_formatter($payout)." reward!",$c); $db->query("INSERT INTO announcements VALUES('User ID {$winner['userid']} won the weekly lottery. Well done!', unix_timestamp())"); $db->query("UPDATE users SET new_announcements=new_announcements+1"); $db->query("UPDATE users SET bankmoney=bankmoney+$payout WHERE userid={$winner['userid']}"); $db->query("TRUNCATE TABLE moneylotto"); $db->query("INSERT INTO moneylottowinners (id, winner, amount) VALUES ('', '{$winner['userid']}', '$payout')"); //Money Lotto End //Points Lotto $ticketssold=$db->num_rows($db->query("SELECT * FROM pointslotto")); $payout=($ticketssold*50)*0.90; $rand=rand(1,$ticketssold); $win=$db->query("SELECT * FROM pointslotto where ticketid=$rand"); $winner = mysql_fetch_array($win); event_add($winner['userid'],"Congratulations! You have won the weekly points lottery, and claimed your $payout points reward!",$c); $db->query("INSERT INTO announcements VALUES('User ID {$winner['userid']} won the weekly point lottery. Well done!', unix_timestamp())"); $db->query("UPDATE users SET new_announcements=new_announcements+1"); $db->query("UPDATE users SET crystals=crystals+$payout WHERE userid={$winner['userid']}"); $db->query("TRUNCATE TABLE pointslotto"); $db->query("INSERT INTO pointslottowinners (id, winner, amount) VALUES ('', '{$winner['userid']}', '$payout')"); //Points Lotto End ?>   i have add announcements for both thanks for this mod :)
  23. dont work for me, money always show and the IQ is less then other an idee ? thanks
  24. nice job just little problem there in lottery.php and pointslottery.php change this echo" <form method='POST' action=lottery> <input type='hidden' name='tickets' value=1 length=2 /> <input type='submit' value='Buy Lottery Ticket'>   to this   echo" <form method='POST' action='lottery.php'> <input type='hidden' name='tickets' value=1 length=2 /> <input type='submit' value='Buy Lottery Ticket'>   i have a porblem when i run cronjob i have try it in browser with my key :) and i have fatal error Fatal error: Call to undefined method database::fetch_array() in .......mywebsite........../lotterycron.php on line 30 line 30 is   $winner=$db->fetch_array($win);   i dont know how corect the cron can you help :) thanks
×
×
  • Create New...