After
appendinclude($phpbb_root_path . 'includes/functions_post.'.$phpEx);
This will give posting.php access to the guestvote functions.// begin guestvote mod include($phpbb_root_path . 'guestvote.'.$phpEx); include($phpbb_root_path . 'guestvote_config.'.$phpEx); // end guestvote mod
Comment out
(line 160) and replace it with$is_auth_type = 'auth_vote';
// begin guestvote mod
$is_auth_type = guestvote_auth_type();
// end guestvote modComment out
$sql = "SELECT *
FROM " . VOTE_USERS_TABLE . "
WHERE vote_id = $vote_id
AND vote_user_id = " . $userdata['user_id'];(line 482) and replace it withComment out
(line 494) and replace it withif ( !($row = $db->sql_fetchrow($result2)) )
// begin guestvote mod
if ( !($row = $db->sql_fetchrow($result2)) && !(guestvote_already_voted_by_cookie()) )
// end guestvote modComment out
$sql = "INSERT INTO " . VOTE_USERS_TABLE . " (vote_id, vote_user_id, vote_user_ip)
VALUES ($vote_id, " . $userdata['user_id'] . ", '$user_ip')";
if ( !$db->sql_query($sql, END_TRANSACTION) )
{
message_die(GENERAL_ERROR, "Could not insert user_id for poll", "", __LINE__, __FILE__,$sql);
}(line 508) and replace it with// begin guestvote mod
if ($guestvote_logging == 1 || $guestvote_logging == 3)
{
$sql = "INSERT INTO " . VOTE_USERS_TABLE . " (vote_id, vote_user_id, vote_user_ip)
VALUES ($vote_id, " . $userdata['user_id'] . ", '$user_ip')";
if ( !$db->sql_query($sql, END_TRANSACTION) )
{
message_die(GENERAL_ERROR, "Could not insert user_id for poll", "", __LINE__, __FILE__, $sql);
}
}
guestvote_set_cookie();
// end guestvote modAfter
appendinclude($phpbb_root_path . 'includes/bbcode.'.$phpEx);
// begin guestvote mod include($phpbb_root_path . 'guestvote.'.$phpEx); include($phpbb_root_path . 'guestvote_config.'.$phpEx); // end guestvote mod
After
(line 581) append// // User authorisation levels output //
// begin guestvote mod
if ($userdata['user_id'] == ANONYMOUS && guestvote_allowed())
{
$is_auth['auth_vote'] = TRUE;
}
// end guestvote modComment out
$sql = "SELECT vote_id
FROM " . VOTE_USERS_TABLE . "
WHERE vote_id = $vote_id
AND vote_user_id = " . intval($userdata['user_id']);(line 708) and replace it with// begin guestvote mod
$is_auth_type = guestvote_auth_type();
// end guestvote modComment out
(line 720) and replace it with$user_voted = ( $row = $db->sql_fetchrow($result) ) ? TRUE : 0;
// begin guestvote mod
$user_voted = $user_voted || guestvote_already_voted_by_cookie();
// end guestvote modAfter
appendinclude($phpbb_root_path . 'common.'.$phpEx);
// begin guestvote mod include($phpbb_root_path . 'guestvote.'.$phpEx); include($phpbb_root_path . 'guestvote_config.'.$phpEx); // end guestvote mod
After
(line 367) append// // User authorisation levels output //
// begin guestvote mod
if ($userdata['user_id'] == ANONYMOUS && guestvote_allowed())
{
$is_auth['auth_vote'] = TRUE;
}
// end guestvote modThank you! This was exactly what I was looking for; one small correction -- on the posting above, it says:
Comment out
$sql = "SELECT * FROM " . VOTE_USERS_TABLE . "
WHERE vote_id = $vote_id
AND vote_user_id = " . $userdata['user_id'];
(line 482) and replace it with
and the replacement is not given. The correct information is in the readme file in the package. It says that you are to replace with the following:
// begin guestvote mod
$sql = guestvote_sql();
// end guestvote mod
Thanks again,
Ben Chapman
Posted by: Ben Chapman at October 12, 2004 6:53 AMadult chat rooms - http://www.fooadultchat.com/
Posted by: adult chat rooms at December 4, 2006 2:11 AM