 |
|
|
|

| Autor |
Nachricht |
jeffy777
phpBB2.de User


Anmeldungsdatum: 13.08.2004
Beiträge: 393
|
Verfasst am:
Di 31 Jul, 2007 22:09 |
  |
I've recently noticed a few bugs when attempting to "E-mail This Topic" with phpbb Plus:
Whenever you are at the Portal and you are reading a news article, if you click to "E-mail This Topic", the link that gets inserted in the email is wrong. The code is designed for viewtopic.php instead of portal.php, so the link that the friend receives is invalid and will only take them to the portal's main page, because the portal uses topic_id=....but the link is t=....
The other problem is that there are also some problems if you are not logged in when trying to "E-mail This Topic". You click to "E-mail This Topic", but you are re-directed to the login page. After logging in, the link gets messed up and also the topic title.
So here is a quick fix that I came up with:
| Code: |
#
#-----[ OPEN ]------------------------------------------
#
tellafriend.php
#
#-----[ FIND ]------------------------------------------
#
$link = $HTTP_GET_VARS['link'];
#
#-----[ AFTER, ADD ]------------------------------------------
#
$link = str_replace("portal.".$phpEx, "viewtopic.".$phpEx, $link);
#
#-----[ FIND ]------------------------------------------
#
if( !$userdata['session_logged_in'] )
{
header("Location: " . append_sid("login.$phpEx?redirect=tellafriend.php&topic=$topic&link=$link", true));
exit;
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
if( !$userdata['session_logged_in'] )
{
$link2 = str_replace("http://".$HTTP_SERVER_VARS['HTTP_HOST'].$board_config['script_path'], "", $link);
header("Location: " . append_sid("login.$phpEx?redirect=$link2", true));
exit;
}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM |
Now portal link problem is fixes because the link will always point to viewtopic.php , which makes more sense because this is a more direct link to the full version of the topic.
Also the login problem is fixed. After logging in, the user will be re-directed to the topic where they can click to "E-mail This Topic". |
|
|
   |
 |
Google
|
Verfasst am:
|
 |
|
|
 |
|
|
|
|
|
Nächstes Thema anzeigen
Vorheriges Thema anzeigen
Du kannst keine Beiträge in dieses Forum schreiben. Du kannst auf Beiträge in diesem Forum nicht antworten. Du kannst deine Beiträge in diesem Forum nicht bearbeiten. Du kannst deine Beiträge in diesem Forum nicht löschen. Du kannst an Umfragen in diesem Forum nicht mitmachen. Du kannst Dateien in diesem Forum posten Du kannst Dateien in diesem Forum herunterladen
|
|
| |