1.12.7 i starsze - Top10 users website
maminowiec - 24-09-2009, 18:58
lui754, tak dodaje slesze ale jest błąd
Seba123 - 24-09-2009, 18:58
Poprawiony plik go_url.php Kod: | <?php
/***************************************************************************
* go_url.php
* -------------------
* begin : Friday, May 14, 2004
* author : bthivent
* email : bthivent@aol.com
*
* $Id: $
*
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$userid = intval($HTTP_GET_VARS['id']);
if(!ereg('^\d+$', $userid) || $userid < 0)
{
die('Hacking attempt');
}
$sql = "SELECT user_website, user_hits_url
FROM " . USERS_TABLE ."
WHERE user_id = '" . $userid . "'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error sql', '', __LINE__, __FILE__, $sql);
}
if ( !( $row = $db->sql_fetchrow($result) ) )
{
message_die(GENERAL_ERROR, 'Error, user website was not found', '', __LINE__, __FILE__, $sql);
}
else
{
$user_hits_url = $row['user_hits_url'] + "1";
$sql = "UPDATE " . USERS_TABLE ."
SET user_hits_url = '" . $user_hits_url ."'
WHERE user_id = '" . $userid . "'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Error, website hits were not updated', '', __LINE__, __FILE__, $sql);
}
echo '<SCRIPT LANGUAGE="JavaScript">';
echo 'document.location.href="' . $row['user_website'] . '"';
echo '</SCRIPT>';
}
?>
|
lui754 - 24-09-2009, 19:13
seba czemu dodałeś 2 zapytania?
Kod: | $sql = "SELECT user_website, user_hits_url
FROM " . USERS_TABLE ."
WHERE user_id = '" . $userid . "'";
$sql = "SELECT user_website, user_hits_url
FROM " . USERS_TABLE ."
WHERE user_id = '" . $userid . "'"; |
Seba123 - 24-09-2009, 19:14
Przypadkiem. Poza tym, to nie dwa zapytania, tylko 2x to samo przypisałem do zmiennej.
axas - 24-09-2009, 20:11
a takia propozycja, a czy dało by radę zrobić moda aby też zliczał wejścia na stronę użytkownika z postów??
|
|
|