|
From: Jon O. <jon...@us...> - 2008-01-28 21:58:55
|
Update of /cvsroot/mxbb/mx_phpCA/ads_mod In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv18718/ads_mod Modified Files: ads_functions.php ads_renewal_mailer.php Log Message: hmmm...i have no idea what i have done ;) Index: ads_renewal_mailer.php =================================================================== RCS file: /cvsroot/mxbb/mx_phpCA/ads_mod/ads_renewal_mailer.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ads_renewal_mailer.php 6 Jun 2007 22:24:34 -0000 1.1 --- ads_renewal_mailer.php 28 Jan 2008 21:58:51 -0000 1.2 *************** *** 23,27 **** $file = fopen($filename, 'w'); ! if ( !$file ) { message_die(GENERAL_ERROR, 'Error creating chaser log file'); --- 23,27 ---- $file = fopen($filename, 'w'); ! if ( !$file ) { message_die(GENERAL_ERROR, 'Error creating chaser log file'); *************** *** 29,34 **** // Get all active ads ! $sql = "SELECT * ! FROM ". ADS_ADVERTS_TABLE ." WHERE status = 'active' AND USER_ID <> ". ADS_GUEST; --- 29,34 ---- // Get all active ads ! $sql = "SELECT * ! FROM ". ADS_ADVERTS_TABLE ." WHERE status = 'active' AND USER_ID <> ". ADS_GUEST; *************** *** 41,45 **** srand((double) microtime() * 1000000); ! while ($row = $db->sql_fetchrow($result)) { $id = $row['id']; --- 41,45 ---- srand((double) microtime() * 1000000); ! while ($row = $db->sql_fetchrow($result)) { $id = $row['id']; *************** *** 49,53 **** $status = $row['status']; ! $sql = "SELECT * FROM ". ADS_CHASERS_TABLE ." WHERE id = '$id'"; --- 49,53 ---- $status = $row['status']; ! $sql = "SELECT * FROM ". ADS_CHASERS_TABLE ." WHERE id = '$id'"; *************** *** 62,67 **** { // Get recipients details from phpBB ! $profiledata = get_userdata($username,'true'); ! $recip_email = $profiledata['user_email']; // Renewal passwords only for free ads! --- 62,67 ---- { // Get recipients details from phpBB ! $profiledata = mx_get_userdata($username,'true'); ! $recip_email = $profiledata['user_email']; // Renewal passwords only for free ads! *************** *** 105,114 **** { // Is second chase due? ! if ( $row2['last_chase_type'] == '1' and time() >= ($expiry_date - ($ads_config['second_chase_days']*60*60*24)) ) { // Get recipients details from phpBB ! $profiledata = get_userdata($username,'true'); ! $recip_email = $profiledata['user_email']; // Renewal passwords only for free ads! --- 105,114 ---- { // Is second chase due? ! if ( $row2['last_chase_type'] == '1' and time() >= ($expiry_date - ($ads_config['second_chase_days']*60*60*24)) ) { // Get recipients details from phpBB ! $profiledata = mx_get_userdata($username,'true'); ! $recip_email = $profiledata['user_email']; // Renewal passwords only for free ads! *************** *** 137,141 **** $sql = "UPDATE ". ADS_CHASERS_TABLE ." ! SET last_chase_type = '$last_chase_type' WHERE id = $id"; --- 137,141 ---- $sql = "UPDATE ". ADS_CHASERS_TABLE ." ! SET last_chase_type = '$last_chase_type' WHERE id = $id"; *************** *** 149,159 **** fwrite ($file, $record); } ! // Is final chase due? if ( $row2['last_chase_type'] == '2' and time() >= $expiry_date ) { // Get recipients details from phpBB ! $profiledata = get_userdata($username,'true'); ! $recip_email = $profiledata['user_email']; // Renewal passwords only for free ads! --- 149,159 ---- fwrite ($file, $record); } ! // Is final chase due? if ( $row2['last_chase_type'] == '2' and time() >= $expiry_date ) { // Get recipients details from phpBB ! $profiledata = mx_get_userdata($username,'true'); ! $recip_email = $profiledata['user_email']; // Renewal passwords only for free ads! *************** *** 182,186 **** $sql = "UPDATE ". ADS_CHASERS_TABLE ." ! SET last_chase_type = '$last_chase_type' WHERE id = $id"; --- 182,186 ---- $sql = "UPDATE ". ADS_CHASERS_TABLE ." ! SET last_chase_type = '$last_chase_type' WHERE id = $id"; *************** *** 198,202 **** $sql = "UPDATE ". ADS_ADVERTS_TABLE ." ! SET status = '$status' WHERE id = $id"; --- 198,202 ---- $sql = "UPDATE ". ADS_ADVERTS_TABLE ." ! SET status = '$status' WHERE id = $id"; *************** *** 207,211 **** // Delete the images ! $sql = "SELECT * FROM ". ADS_IMAGES_TABLE ." WHERE id = $id --- 207,211 ---- // Delete the images ! $sql = "SELECT * FROM ". ADS_IMAGES_TABLE ." WHERE id = $id *************** *** 214,218 **** $result = $db->sql_query($sql); ! while ($row = $db->sql_fetchrow($result)) { $img_seq_no = $row['img_seq_no']; --- 214,218 ---- $result = $db->sql_query($sql); ! while ($row = $db->sql_fetchrow($result)) { $img_seq_no = $row['img_seq_no']; *************** *** 220,224 **** $sql2 = "UPDATE ". ADS_IMAGES_TABLE ." SET img_deleted_ind = 1 ! WHERE id = '$id' AND img_seq_no = '$img_seq_no'"; --- 220,224 ---- $sql2 = "UPDATE ". ADS_IMAGES_TABLE ." SET img_deleted_ind = 1 ! WHERE id = '$id' AND img_seq_no = '$img_seq_no'"; *************** *** 245,248 **** fwrite ($file, $record); ! fclose ($file); ?> \ No newline at end of file --- 245,248 ---- fwrite ($file, $record); ! fclose ($file); ?> \ No newline at end of file Index: ads_functions.php =================================================================== RCS file: /cvsroot/mxbb/mx_phpCA/ads_mod/ads_functions.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ads_functions.php 6 Jun 2007 22:24:33 -0000 1.1 --- ads_functions.php 28 Jan 2008 21:58:51 -0000 1.2 *************** *** 27,31 **** global $userdata, $phpEx; ! if ( $view_level == ADS_GUEST ) { $view_allowed = TRUE; --- 27,31 ---- global $userdata, $phpEx; ! if ( $view_level == ADS_GUEST ) { $view_allowed = TRUE; *************** *** 57,92 **** } ! // ========================= ! // Move allowed ! // ========================= ! function move_allowed($user_id, $ads_move_level) ! { ! global $userdata, $phpEx; ! if ( ( $ads_move_level == ADS_USER and $userdata['user_id'] == $user_id and $userdata['session_logged_in'] ) ! or ( $ads_move_level == ADS_USER and $userdata['user_level'] == MOD ) ) ! { ! $move_allowed = TRUE; ! } ! if ( $ads_move_level == ADS_MOD and $userdata['user_level'] == MOD ) ! { ! $move_allowed = TRUE; ! } ! if ($userdata['user_level'] == ADMIN ) ! { ! $move_allowed = TRUE; ! } ! if ( $move_allowed == TRUE) ! { ! return TRUE; ! } ! else ! { ! return FALSE; ! } ! } // ========================= --- 57,92 ---- } ! // ========================= ! // Move allowed ! // ========================= ! function move_allowed($user_id, $ads_move_level) ! { ! global $userdata, $phpEx; ! if ( ( $ads_move_level == ADS_USER and $userdata['user_id'] == $user_id and $userdata['session_logged_in'] ) ! or ( $ads_move_level == ADS_USER and $userdata['user_level'] == MOD ) ) ! { ! $move_allowed = TRUE; ! } ! if ( $ads_move_level == ADS_MOD and $userdata['user_level'] == MOD ) ! { ! $move_allowed = TRUE; ! } ! if ($userdata['user_level'] == ADMIN ) ! { ! $move_allowed = TRUE; ! } ! if ( $move_allowed == TRUE) ! { ! return TRUE; ! } ! else ! { ! return FALSE; ! } ! } // ========================= *************** *** 97,101 **** global $userdata, $phpEx; ! if ( $search_level == ADS_GUEST ) { $search_allowed = TRUE; --- 97,101 ---- global $userdata, $phpEx; ! if ( $search_level == ADS_GUEST ) { $search_allowed = TRUE; *************** *** 134,138 **** global $userdata, $phpEx; ! if ( $cat_create_level == ADS_GUEST ) { $create_allowed = TRUE; --- 134,138 ---- global $userdata, $phpEx; ! if ( $cat_create_level == ADS_GUEST ) { $create_allowed = TRUE; *************** *** 140,146 **** else { ! if ( !$userdata['session_logged_in'] ) { ! redirect(append_sid("login.$phpEx?redirect=ads_create.$phpEx")); } } --- 140,146 ---- else { ! if ( !$userdata['session_logged_in'] ) { ! mx_redirect(append_sid("login.$phpEx?redirect=ads_create.$phpEx")); } } *************** *** 277,281 **** global $userdata, $phpEx; ! if ( $cat_comment_level == ADS_GUEST ) { $comment_allowed = TRUE; --- 277,281 ---- global $userdata, $phpEx; ! if ( $cat_comment_level == ADS_GUEST ) { $comment_allowed = TRUE; *************** *** 315,319 **** $height = imagesy($im); ! if (($resizewidth and $width > $resizewidth) or ($resizeheight and $height > $resizeheight)) { --- 315,319 ---- $height = imagesy($im); ! if (($resizewidth and $width > $resizewidth) or ($resizeheight and $height > $resizeheight)) { *************** *** 360,364 **** imagecopyresized($newim, $im, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); } ! touch($filename . ".jpg"); ImageJpeg ($newim,$filename . ".jpg"); // ImageDestroy ($newim); --- 360,364 ---- imagecopyresized($newim, $im, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); } ! touch($filename . ".jpg"); ImageJpeg ($newim,$filename . ".jpg"); // ImageDestroy ($newim); *************** *** 366,370 **** else { ! touch($filename . ".jpg"); ImageJpeg ($im,$filename . ".jpg"); } --- 366,370 ---- else { ! touch($filename . ".jpg"); ImageJpeg ($im,$filename . ".jpg"); } *************** *** 374,378 **** // Image popups // ========================= ! //function popup($medium_img_url, $large_img_url, $title, $width=false, $height=false) //{ // $title_urlencoded = rawurlencode($title); --- 374,378 ---- // Image popups // ========================= ! //function popup($medium_img_url, $large_img_url, $title, $width=false, $height=false) //{ // $title_urlencoded = rawurlencode($title); *************** *** 400,404 **** srand((double)microtime()*1000000); ! for ($i = 0; $i < 30; $i++) { $x1 = rand(0,120); --- 400,404 ---- srand((double)microtime()*1000000); ! for ($i = 0; $i < 30; $i++) { $x1 = rand(0,120); *************** *** 406,413 **** $x2 = rand(0,120); $y2 = rand(0,30); ! imageline($image, $x1, $y1, $x2, $y2 , $gray); } ! for ($i = 0; $i < 5; $i++) { $cnum[$i] = rand(0,9); --- 406,413 ---- $x2 = rand(0,120); $y2 = rand(0,30); ! imageline($image, $x1, $y1, $x2, $y2 , $gray); } ! for ($i = 0; $i < 5; $i++) { $cnum[$i] = rand(0,9); *************** *** 418,423 **** $fnt = rand(5,8); $x = $x + rand(12 , 20); ! $y = rand(7 , 12); ! imagestring($image, $fnt, $x, $y, $cnum[$i] , $darkgray); } --- 418,423 ---- $fnt = rand(5,8); $x = $x + rand(12 , 20); ! $y = rand(7 , 12); ! imagestring($image, $fnt, $x, $y, $cnum[$i] , $darkgray); } *************** *** 429,433 **** //header('Content-type: image/png'); $image = imagepng($image); ! imagedestroy($image); return $image; --- 429,433 ---- //header('Content-type: image/png'); $image = imagepng($image); ! imagedestroy($image); return $image; *************** *** 455,467 **** $emailer->from($sender_email); $emailer->replyto($sender_email); ! $emailer->use_template('admin_send_email', $user_lang); $emailer->email_address($recip_email); $emailer->set_subject($subject); $emailer->extra_headers($email_headers); ! $emailer->assign_vars(array( ! 'SITENAME' => $board_config['sitename'], ! 'BOARD_EMAIL' => $board_config['board_email'], 'MESSAGE' => $message)); --- 455,467 ---- $emailer->from($sender_email); $emailer->replyto($sender_email); ! $emailer->use_template('admin_send_email', $user_lang); $emailer->email_address($recip_email); $emailer->set_subject($subject); $emailer->extra_headers($email_headers); ! $emailer->assign_vars(array( ! 'SITENAME' => $board_config['sitename'], ! 'BOARD_EMAIL' => $board_config['board_email'], 'MESSAGE' => $message)); *************** *** 473,511 **** // Create a comma separated value file from an array // ========================================================== ! function create_csv_file($file, $data) { //check for array ! if (is_array($data)) ! { ! $post_values=array_values($data); //build csv data ! foreach($post_values as $i) {$csv.="\"$i\",";} //remove the last comma from string ! $csv = substr($csv,0,-1); //check for existence of file ! if (file_exists($file) and is_writeable($file)) ! {$mode = "a";} ! else {$mode="w";} //create file pointer $fp = @fopen($file,$mode); ! //write to file ! fwrite($fp,$csv . "\n"); //close file pointer ! fclose($fp); ! return true; ! } else ! { ! return false; ! } } --- 473,511 ---- // Create a comma separated value file from an array // ========================================================== ! function create_csv_file($file, $data) { //check for array ! if (is_array($data)) ! { ! $post_values=array_values($data); //build csv data ! foreach($post_values as $i) {$csv.="\"$i\",";} //remove the last comma from string ! $csv = substr($csv,0,-1); //check for existence of file ! if (file_exists($file) and is_writeable($file)) ! {$mode = "a";} ! else {$mode="w";} //create file pointer $fp = @fopen($file,$mode); ! //write to file ! fwrite($fp,$csv . "\n"); //close file pointer ! fclose($fp); ! return true; ! } else ! { ! return false; ! } } *************** *** 513,517 **** // Create a comma separated value file from an array // ========================================================== ! function create_error_file($file, $message) { $open = fopen ($file, "a"); --- 513,517 ---- // Create a comma separated value file from an array // ========================================================== ! function create_error_file($file, $message) { $open = fopen ($file, "a"); *************** *** 519,523 **** { fwrite ($open, $message."\r\n"); ! fclose ($open); } } --- 519,523 ---- { fwrite ($open, $message."\r\n"); ! fclose ($open); } } *************** *** 572,576 **** // htmlspecialchars_decode // ========================================================== ! function htmlspecialchars_decode_php4($str, $quote_style = ENT_COMPAT) { if ( function_exists('htmlspecialchars_decode') ) --- 572,576 ---- // htmlspecialchars_decode // ========================================================== ! function htmlspecialchars_decode_php4($str, $quote_style = ENT_COMPAT) { if ( function_exists('htmlspecialchars_decode') ) |