Jump to content

Gayner

Members
  • Posts

    549
  • Joined

  • Last visited

    Never

Everything posted by Gayner

  1. $this->output .= "<form name=\"form\" method=\"post\">"; $styles = array(); $d = dir('images/flags'); while (($entry = $d->read()) !== false) { if (substr($entry, strlen($entry)-4) == '.gif') $styles[] = substr($entry, 0, strlen($entry)-4); } $d->close(); // Only display the style selection box if there's more than one style available if (count($styles) == 1) echo "\t\t\t".'<div><input type="hidden" name="skin" value="'.$styles[0].'" /></div>'."\n"; else if (count($styles) > 1) { natsort($styles); $this->output .= "Select your Country: <select name=skin>"; while (list(, $temp) = @each($styles)) { if ($mm['style'] == $temp) $this->output .= '<option value="'.$temp.'" selected="selected">'.str_replace('_', ' ', $temp).'</option>'; else $this->output .= '<option value="'.$temp.'">'.str_replace('_', ' ', $temp).'</option>'; } $this->output .= "</select>"; } Shows: But I save it to database using this: mysql_query("UPDATE ibf_members SET skin='{$_POST['skin']}' WHERE id={$ibforums->member['id']}"); it works fine and saves which one I chose, but it's not being "select=selected" while (list(, $temp) = @each($styles)) { if ($mm['style'] == $temp) $this->output .= '<option value="'.$temp.'" selected="selected">'.str_replace('_', ' ', $temp).'</option>'; else $this->output .= '<option value="'.$temp.'">'.str_replace('_', ' ', $temp).'</option>'; } that's the part that's supposed to make it selected but it not working
  2. Im trying to find something that.. Selects all my images in my images/flags folder and let's it beable to select each 1 and input type it so it saves it to my Database.. I have my database and stuff all setup i just can't find a script or something to call all my images/flags items.. Thanks.. lol
  3. SELECT f.*, c.id as cat_id, c.position as cat_position, c.state as cat_state, c.name as cat_name, c.description as cat_desc, c.image, m.member_name as mod_name, mr.desktop, m.member_id as mod_id, m.is_group, m.group_id, m.group_name, m.mid FROM ( ibf_forums f, ibf_categories c ) LEFT JOIN ibf_moderators m ON (f.id=m.forum_id) LEFT JOIN ibf_members mr ON (mr.id=f.last_poster_id) When f.* Does that mean it's selecting all for only ibf_forums or for all the tables listed, ibf_members, ibf_categories, etc?
  4. I thought u would use "AND" OMG that is epic, thanks alot for your help, man im learning php so simplier cause of phpfreaks i love it, thanks guys! Topic Solved!
  5. Here is my code: if ($ibforums->member['skinstyle'] == "") $lolnoskin = "0"; Now i want to put AND if ($ibforums->member['monkskin'] == "") in the same IF function so it would be like this: if ($ibforums->member['skinstyle'] == "") AND if ($ibforums->member['monkskin'] == "") ? I want to beable to use AND Statement in my IF Function, help, thx
  6. NEVERMIND!! I used <?php $clicks = $row['clicks']+1; $result = mysql_query("UPDATE downloads SET clicks = '$clicks' WHERE down_id = '$id'") or die (mysql_error()); ?> That technique and changed variables around and it works, i also changed it to INT(2) Default 6, Thanks guys alot!
  7. Thanks, i just tryed that, it didn't work
  8. Thanks guys! it isn't working tho!@ I have limitfriend to default 6, varchar(2) and when i run query it sstays at 6 any ideas? But if i manually change it from database to 6 to 7 it works ? here it is: UPDATE ibf_members set SET limitfriend=limitfriend+1 WHERE id = '{$ibforums->member['id']}'" thanks mate if u can help ~ ?
  9. UPDATE ibf_members set limitfriend = '".mysql_real_escape_string('+1')."' I tried that but it just made it +1.. I want it to add +1.. My limitfriend is varchar(2) default 6, so when i run that query it makes it 7 or just increments. not all my code is here but that's what it is.. full code: UPDATE ibf_members set limitfriend = '".mysql_real_escape_string('+1')."' WHERE id = '{$ibforums->member['id']}'" Thnaks for ur help ~
  10. Ic well im glad I made this topic, no wonder my hosting has server status in red all the time, LOL Because each time a profile is view it's mysqling over 120 extra fields that means nothing, that could be 4-500 more people.. lol
  11. Ok, look, i'l giv u a screenshot tell me if this is bad, im only using like 25field names anyway so u think i should call separately yes or no ?
  12. Actually i counte.d. about 150 Field names... in that 1 table. I only use about 30 on the profile page, should i call them out seperately? I Think i should call them separately, lol
  13. $DB->query("SELECT * FROM ibf_members"); I have over let's say 50 Field names in my IBF_members table. So should call what i need let's say about "25-30 field names" seperately, or use the * so it is quicker ? Which way is more artificial? and less on the database and performance wise?
  14. $pull = $DB->query("SELECT * FROM `ibf_files_comments` WHERE `mem_id` = '" .$this->member['id']. "' and `file_id` = '" .$ibforums->input['id']. "'"); // Check if our $pull query returns a result greater than one if so error message otherwise run the rest if ( $DB->get_num_rows($pull) > 0 ) { $std->Error( array( 'LEVEL' => 1, 'MSG' => 'already_posted' ) ); } This tells me that if somone has Already posted on the specific place. But I want to make it so people Can't post more then 10 times? Would all i have to do is change thiS? [mysql]if ( $DB->get_num_rows($pull) > 10 ) [/mysql] Thank u ,!
  15. :facewall: What do u mean? This script is a wonderful lottery script man.. It works fine, I know i need to add mysqlreal escape to secure it but other then that it's fine bro.. just little dirty i guess? I just want to make it so it's not 1 day 24 hours 59 min and 59 seconds I want it to be 0 days 1 hour.. lol that's all Then $cd is for: <script language='JavaScript' type="text/javascript">countdown($cd);</script> which is: function countdown(Time_Left) { Today = new Date(); if(Time_Left < 0) Time_Left = 0; time_left2=Time_Left; days = Math.floor(Time_Left / (60 * 60 * 24)); Time_Left %= (60 * 60 * 24); hours = Math.floor(Time_Left / (60 * 60)); Time_Left %= (60 * 60); minutes = Math.floor(Time_Left / 60); Time_Left %= 60; seconds = Time_Left; dps = 's'; hps = 's'; mps = 's'; sps = 's'; //ps is short for plural suffix. if(days == 1) dps =''; if(hours == 1) hps =''; if(minutes == 1) mps =''; if(seconds == 1) sps =''; document.getElementById("countdown").innerHTML = days + ' day' + dps + ' '; document.getElementById("countdown").innerHTML += hours + ' hr' + hps + ' '; document.getElementById("countdown").innerHTML += minutes + ' min' + mps + ' and '; document.getElementById("countdown").innerHTML += seconds + ' sec' + sps; //Recursive call, keeps the clock ticking. time_left2--; setTimeout('countdown('+time_left2+');', 1000); } But that's client side htat has nothing to do with, the php is the part that makes that javascript work that's what I need help on the php part There is some more code u might find useful sir, please help!
  16. function p_show_front($message=''){ global $ibforums,$plot; $cd = $this->make_countdown(); $last_draw = $this->make_last_draw(); $next_draw = $this->next_draw(); $form = $this->make_form(); $records = $this->make_records(); if($plot['action']=='settings'){ $your_tickets = $this->p_settings(); }elseif($plot['action']=='payouts'){ $your_tickets = $this->p_payouts(); }elseif($plot['action']=='holders'){ $your_tickets = $this->p_holders(); }else{ $your_tickets = $this->make_your_tickets(); } $this->output = $this->html->front_page($form,$your_tickets,$message,$next_draw,$last_draw,$cd,$records); } This one ? it shows $this->make_countdown(); I know what u mean tho, this is all i can find of make_countdown do i need to find more for u Im trying im best to help u help me. dont worry
  17. Once I Did that, now it turns into: 1 day 4 hrs 15 mins and 45 secs herE is my code : function make_countdown(){ global $ibforums,$plot; $last_draw=$plot['last_draw']; $time_now=time(); $next_draw=$last_draw+($plot['draw_days']*(3600*24)); $plot['next_draw_time']=$next_draw; $sec_left=$next_draw-$time_now; $plot['next_draw'] = date("dS of F Y h:i A",$next_draw); $plot['last_draw'] = date("dS of F Y h:i A",$last_draw); if($sec_left <= '0'){ $this->do_drawing(); exit; } return $sec_left; } function do_drawing(){ global $ibforums,$plot,$INFO,$DB; $count=0; $winning_numbers=array(); while($count < $plot['total_picks']){ $this_num = mt_rand ( $plot['min_number'], $plot['max_number']); if(!in_array($this_num, $winning_numbers)){ array_push($winning_numbers,$this_num); $count++; } } $db_pre=$INFO['sql_tbl_prefix']; $db_tickets = "$db_pre"."p_lottery_tickets"; //delete old tickets $DB->query("delete FROM $db_tickets WHERE status != 'Pending'") or print mysql_error(); $DB->query("SELECT * FROM $db_tickets WHERE status='Pending'") or print mysql_error(); while($row = $DB->fetch_row()){ $picks=explode(',',$row['picks']); $matched=0; foreach($picks as $pick){ if(in_array($pick,$winning_numbers)){ $matched++; } } if($matched >> '0'){ if(!is_array($all_matched[$matched])){$all_matched[$matched]=array();} array_push($all_matched[$matched],$row); } } ##make this draw time today at the set time $b_day=date("d"); $b_month=date("m"); $b_year=date("Y"); $b_time=explode(':',$plot['draw_time']); $bought=mktime ( $b_time['0'], $b_time['1'], 0, $b_month, $b_day, $b_year); //go through all matches of wins foreach($plot['payouts'] as $mc){ //do we have any with this no. of matches? if(is_array($all_matched[$mc['match']])){ //yes there is atleast 1 match $count_match=count($all_matched[$mc['match']]); //is this a percentage? if($mc['type']=='percent'){ $won=round( ($plot['pot']/100) * $mc['pays']); $plot['pot']=$plot['pot']-$won; }else{ $won=$mc['pays']; } //do we divide it? if($mc['divide']=='1'){ $won=$won/$count_match; $plot['pot']=$plot['pot']-$mc['pays']; }else{ $plot['pot']=$plot['pot']-($mc['pays']*$count_match); } $status='Winner'; $matched=$mc['match']; $where='WHERE (id=-99 '; foreach($all_matched[$mc['match']] as $m){ $where .= 'OR id='.$m['id'].' '; } $where.=')'; //make the update query $query= "UPDATE $db_tickets set `status`='$status', `won`='$won', `matched`='$matched', `bought_time`='$bought' $where"; $DB->query($query) or print mysql_error(); } } //make the rest losers $query= "UPDATE $db_tickets set `status`='Loser', `won`='n/a', `matched`='n/a', `bought_time`='$bought' WHERE `status` != 'winner'"; $DB->query($query) or print mysql_error(); //update lottery settings sort($winning_numbers); $winning_numbers=implode('-',$winning_numbers); $db_pre = $INFO['sql_tbl_prefix']; $db_settings = "$db_pre" . "p_lottery"; if($plot['pot'] <= $plot['pot_start']){$plot['pot']=$plot['pot_start'];} $DB->query( "UPDATE $db_settings set `pot` = '{$plot['pot']}', `ticket_count` = '0', `last_draw` = '$bought', `last_numbers` = '$winning_numbers' " ) or print mysql_error(); $this->give_winners_points(); $loc = $this->base_url; header("location:$loc"); }
  18. My script says: 0 days 4 hrs 48 mins and 19 secs Then when I added $next_draw = $last_draw + 3600; to it it went to 0 days 5 hrs 48 mins and 19 secs 1 Hour ahead,
  19. im at ' 0 days 5 hrs 48 mins and 19 secs moved up an houir ? then when i did that it went to Were getting so close!!
  20. HMm now it took away the Day and made it 6hours, lol 0 days 6 hrs 49 mins and 36 secs This is weird. I think ur missing some more scripts to find out problem but I dont really want to post a 5000 line php code.. lol We fixed the day tho.. now it's by hours, that's good but my draw_days varchar(6) field is set to 1.. and it shows 6hours because we edited that codes, should i try my draw days field to like 0.01? then will it go to 1hour ? lol EDIT: I tryed to make it 0.10 and my time went to 5hours lol if i put anything below that it messes it up
  21. SO what is my *24 doing in there? Thanks in advance for ur help
  22. $last_draw=$plot['last_draw']; $time_now=time(); $next_draw=$last_draw+($plot['draw_days']*(3600*24)); $plot['next_draw_time']=$next_draw; $sec_left=$next_draw-$time_now; $plot['next_draw'] = date("dS of F Y h:i A",$next_draw); $plot['last_draw'] = date("dS of F Y h:i A",$last_draw); I need to edit $next_draw=$last_draw+($plot['draw_days']*(3600*24)); so it's only 1hour, what do I times it by using *? thx
  23. Lol ic, so just a personal preference i guess but I'm never gonna do that I think I will stick to turney Operators right? LOL
  24. Random code but.. i have this line it's like this: foreach( $final as $idx => $sess ){$inv = '';if ( strstr( $sess['id'], '_session' ) ){$sess['is_bot'] = 1;if ( $ibforums->vars['spider_anon'] ){if ( $ibforums->member['mgroup'] == $ibforums->vars['admin_group'] ){$inv = '*';}else{continue;}}}else if ($sess['login_type'] == 1){if ( ($ibforums->member['mgroup'] == $ibforums->vars['admin_group']) and ($ibforums->vars['disable_admin_anon'] != 1) ){$inv = '*';}else{continue;}}$col_num++; When i post the code it doesn't look good.. but on my site the line is just 1 big horizontal line.. is that faster for php to handle if it's like that or bad? or does it even matter? honestly. I mean it works fine and cleaner on my editing page.. soo lol
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.