Hi can you try this replace all the code in your approve.php file with this.
It is my own version, of the orig I use in my mod version ...
But I am curious if it works for you.
If this works then maybe Klem can figure out why?
as theres nothing that I know of that would cause that prob in this file.
Code: Select all
<?php
/*******************************************************************************
* Title: LinkMan reciprocal link manager
* Version: 1.7a @ April 18, 2009
* Author: Klemen Stirn
* Website: http://www.phpjunkyard.com
********************************************************************************
* COPYRIGHT NOTICE
* Copyright 2004-2009 Klemen Stirn. All Rights Reserved.
*
* This script may be used and modified free of charge by anyone
* AS LONG AS COPYRIGHT NOTICES AND ALL THE COMMENTS REMAIN INTACT.
* By using this code you agree to indemnify Klemen Stirn from any
* liability that might arise from it's use.
*
* Selling the code for this program, in part or full, without prior
* written consent is expressly forbidden. Using this code, in part or full,
* to create competing scripts or products is expressly forbidden.
*
* Obtain permission before redistributing this software over the Internet
* or in any other medium. In all cases copyright and header must remain
* intact. This Copyright is in full effect in any country that has
* International Trade Agreements with the United States of America or
* with the European Union.
*
* Removing any of the copyright notices without purchasing a license
* is illegal! To remove PHPJunkyard copyright notice you must purchase a
* license for this script. For more information on how to obtain a license
* please visit the site below:
* http://www.phpjunkyard.com/copyright-removal.php
*******************************************************************************/
define('IN_SCRIPT',1);
require('settings.php');
$approve = intval($_GET['approve']);
$hash = pj_input($_GET['id'],'Missing ID hash. Please make sure you copy the full approval/rejection URL!');
$hash = preg_replace('/[^a-z0-9]/','',$hash);
$file = 'apptmp/'.$hash.'.txt';
/* Check if the file hash is correct */
if (!file_exists($file)){
problem('Wrong link ID hash. Possible problems:<br><br>• The link has already been approved or rejected<br>• You didn\'t copy the full approval/rejection URL');
}
/* Reject the link */
if (!$approve){
unlink($file);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" type="text/css" href="style.css">
<title>Link Rejected!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle"><br><BR>
<table width="400" height="150" cellpadding="5" cellspacing="0">
<tr>
<td height="25" align="center" class="head">Link Rejected!</td>
</tr>
<tr>
<td align="left" class="dol"><br> <br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="14%"><img src="images/imp.gif" border="0"></td>
<td width="86%">The selected link has been rejected from the link exchange.</td>
</tr>
</table>
<br><br>
</td>
</tr>
</table>
<br></td>
</tr>
</table>
</body>
</html>
<?php
exit();
}
/* Approve link */
$replacement = trim(@file_get_contents('apptmp/'.$hash.'.txt'));
if (empty($replacement)){
problem('This link doesn\'t exist or has already been approved or rejected!');
}
$replacement .= "\n";//Fixed
if ($settings['add_to'] == 0){
$lines = file($settings['linkfile']);
/* Make sure new link is added after any featured ones */
$i = 0;
foreach ($lines as $thisline){
list($name2,$email2,$title2,$url2,$recurl2,$description2,$featured2,$pr2)=explode($settings['delimiter'],$thisline);
$featured2 = $featured2 ? 1 : 0;
if ($featured2 == 0){
$lines[$i] = $replacement . $thisline;
break;
}
$i++;
}
$replacement = implode('',$lines);
$fp = fopen($settings['linkfile'],'w') or problem('Couldn\'t open links file for writing! Please CHMOD all txt files to 666 (rw-rw-rw)!');
flock($fp, LOCK_EX);
fputs($fp,$replacement);
flock($fp, LOCK_UN);
fclose($fp);
}else{
$fp = fopen($settings['linkfile'],'a') or problem('Couldn\'t open links file for appending! Please CHMOD all txt files to 666 (rw-rw-rw)!');
flock($fp, LOCK_EX);
fputs($fp,$replacement);
flock($fp, LOCK_UN);
fclose($fp);
}
unlink($file);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" type="text/css" href="style.css">
<title>Link Approved!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle"><br><BR>
<table width="400" height="150" cellpadding="5" cellspacing="0">
<tr>
<td height="25" align="center" class="head">Link Approved!</td>
</tr>
<tr>
<td align="left" class="dol"><br> <br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="14%"><img src="images/suc.gif" border="0"></td>
<td width="86%">The selected link has been approved and included in the link
exchange.</td>
</tr>
</table>
<br><br>
</td>
</tr>
</table>
<br></td>
</tr>
</table>
</body>
</html>
<?php
exit();
/*** FUNCTIONS ***/
function problem($problem) {
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" type="text/css" href="style.css">
<title>ERROR!</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle"><br><BR>
<table width="400" height="150" cellpadding="5" cellspacing="0">
<tr>
<td height="25" align="center" class="head">Error Detected!</td>
</tr>
<tr>
<td align="left" class="dol"><br> <br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="14%"><img src="images/err.gif" border="0"></td>
<td width="86%">'.$problem.'</td>
</tr>
</table>
<br><br>
</td>
</tr>
</table>
<br></td>
</tr>
</table>
</body>
</html>';
exit();
}
?>
DC