[F I X E D] exit.php not redirecting (CVS)
[F I X E D] exit.php not redirecting (CVS)
I used a html-nugget sidebar to put in some websites I visit. The html content are only simple <a> tags. S9y generates invalid content:
It generates: http:// <weblog url> /exit.php?url_id=Y for every entry.
mysql> select * from serendipity_references; does not list the html nugget urls, which makes sense.
So I assume I cannot track exits throughout my htmlnugget.
Any idea how to fix this by either disabling the tracking for the html nugget, or to fix tracking?
/Stephan
It generates: http:// <weblog url> /exit.php?url_id=Y for every entry.
mysql> select * from serendipity_references; does not list the html nugget urls, which makes sense.
So I assume I cannot track exits throughout my htmlnugget.
Any idea how to fix this by either disabling the tracking for the html nugget, or to fix tracking?
/Stephan
Last edited by stephanb on Fri Jul 09, 2004 11:41 pm, edited 1 time in total.
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: exit.php not redirecting
I guess you're using latest CVS snapshot then?
That's quite weird your getting this behaviour. In case a link is not found inside the references table, it should use old style redirection with the ?url= parameter instead of ?url_id.
Could you please open plugins/serendipity_event_trackexits/serendipity_event_trackexits.php and locate this line:
Then please change it temporarily to:
And please report the output. And please tell which database you are using (postgre, mysql, sqlite). Thanks!
Regards,
Garvin.
That's quite weird your getting this behaviour. In case a link is not found inside the references table, it should use old style redirection with the ?url= parameter instead of ?url_id.
Could you please open plugins/serendipity_event_trackexits/serendipity_event_trackexits.php and locate this line:
Code: Select all
if (isset($this->links[$url])) {
return sprintf(
'<a%shref="%sexit.php?url_id=%s%s" title="%s" onmouseover="window.status=\'%s\';return true;" onmouseout="window.status=\'\';return true;"',
$buffer[1],
$serendipity['baseURL'],
$this->links[$url],
($entry_id != 0) ? '&entry_id=' . $entry_id : '',
$url,
$url
);
} else {
return sprintf(
'<a%shref="%sexit.php?url=%s%s" title="%s" onmouseover="window.status=\'%s\';return true;" onmouseout="window.status=\'\';return true;"',
$buffer[1],
$serendipity['baseURL'],
base64_encode($url),
($entry_id != 0) ? '&entry_id=' . $entry_id : '',
$url,
$url
);
}
Code: Select all
if (isset($this->links[$url])) {
echo 'Found URL <u>' . $url . '</u> in array ' . $this->links[$url] . '!<br />';
echo 'Buffer is: ' . print_r($buffer, true) . '<br />';
return sprintf(
'<a%shref="%sexit.php?url_id=%s%s" title="%s" onmouseover="window.status=\'%s\';return true;" onmouseout="window.status=\'\';return true;"',
$buffer[1],
$serendipity['baseURL'],
$this->links[$url],
($entry_id != 0) ? '&entry_id=' . $entry_id : '',
$url,
$url
);
} else {
echo 'Using old style.<br />';
echo 'Buffer is: ' . print_r($buffer, true) . '<br />';
return sprintf(
'<a%shref="%sexit.php?url=%s%s" title="%s" onmouseover="window.status=\'%s\';return true;" onmouseout="window.status=\'\';return true;"',
$buffer[1],
$serendipity['baseURL'],
base64_encode($url),
($entry_id != 0) ? '&entry_id=' . $entry_id : '',
$url,
$url
);
}
Regards,
Garvin.
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Found URL http://www.rtp.org/ in array Y!
Buffer is: Array ( [0] => [2] => " [3] => www.rtp.org/ [4] => " )
I'm using mysql.
Buffer is: Array ( [0] => [2] => " [3] => www.rtp.org/ [4] => " )
I'm using mysql.
Hold on, looking further I found that $this->links is not filled correctly. Somehow the SQL statement that is supposed to fill this array in serendipity_db_query() is erroring.stephanb wrote:Found URL http://www.rtp.org/ in array Y!
Buffer is: Array ( [0] => [2] => " [3] => www.rtp.org/ [4] => " )
I'm using mysql.
$this->links is defined as the mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Lemme see where serendipity_db_query() goes wrong here:
Code: Select all
$this->links = serendipity_db_query("SELECT id, link FROM {$serendipity['dbPrefix']}references WHERE entry_id = {$serendipity['encodeExitsCallback_entry_id']}", false, 'both', false, 'link', 'id');
Code: Select all
"SELECT id, link FROM serendipity_references WHERE entry_id = "
Correct me if I'm misinterpreting things here
./Stephan
Last edited by stephanb on Fri Jul 09, 2004 8:12 pm, edited 2 times in total.
SOLUTION ?
Code: Select all
$this->links = serendipity_db_query("SELECT id, link FROM {$serendipity['dbPrefix']}references WHERE entry_id = {$serendipity['encodeExitsCallback_entry_id']}", false, 'both', false, 'link', 'id');
Code: Select all
$this->links = serendipity_db_query("SELECT id, link FROM {$serendipity['dbPrefix']}references WHERE entry_id = '{$serendipity['encodeExitsCallback_entry_id']}'", false, 'both', false, 'link', 'id');
Code: Select all
"SELECT id, link FROM serendipity_references WHERE entry_id = '' "
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: SOLUTION ?
Hi Stephan!
Thanks a lot for your debugging! I have commited a different patch (http://garv.info/files/te.diff) to CVS now, which should be somehwat 'cleaner', but basically achieves the same like you coded.
Regards,
Garvin.
Thanks a lot for your debugging! I have commited a different patch (http://garv.info/files/te.diff) to CVS now, which should be somehwat 'cleaner', but basically achieves the same like you coded.
Regards,
Garvin.
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: SOLUTION ?
Is there a delay in the CVS reproductions ?garvinhicking wrote:Hi Stephan!
Thanks a lot for your debugging! I have commited a different patch (http://garv.info/files/te.diff) to CVS now, which should be somehwat 'cleaner', but basically achieves the same like you coded.
When I try to checkout the newer entry, I still get :
Code: Select all
<?php # $Id: serendipity_event_trackexits.php,v 1.10 2004/07/05 08:25:50 garvinhicking Exp $
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: SOLUTION ?
Yes, there sadly is a 24hour delay for anonymous CVS access, so you sadly have to wait. But if you're familar with patch/diff utils you could download the link I gave you and you'll have the patch I committed.
Regards,
Garvin.
Regards,
Garvin.
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/