I decide that I should?knmt wrote:As I said earlier you should use the way search.php
Code: Select all
$sql_array = array(
'SELECT' => 'p.post_id, p.poster_id',
'FROM' => array (POSTS_TABLE => 'p'),
'WHERE' => "p.post_id = $post_id");
$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
Code: Select all
$sql = 'SELECT p.poster_id, t.topic_id
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t
WHERE p.post_id = ' . $post_id . '
AND p.post_id = t.topic_first_post_id';
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
Code: Select all
WHERE post_id = $post_id AND user_id = " . $user->data['user_id'];
Code: Select all
WHERE user_id = " . $user->data['user_id'];
Code: Select all
'S_FORUM_THANKS' => ($auth->acl_get('f_thanks', $forum_id)) ? true : false,
Code: Select all
'S_FIRST_POST' => ($row['post_id'] == $topic_data['topic_first_post_id']) ? true : false,
Code: Select all
<!-- ELSEIF postrow.S_IS_OWN_POST and not postrow.THANKS -->
Code: Select all
<!-- ELSEIF not postrow.S_FIRST_POST -->
I hope soKamahl19 wrote:I was using Geoffreak's MOD but when many users were online and they thank a much, it was getting me DB errors and hosting shuted me down. Are these problems with allocating many memmory etc solved?
yesand what about an DB upgrade? can i upgrade the thanks from geoffreaks mod to this?
I do not think that this is the right way. There is a MOD AutoGroup that automatically add users to group, depending on the number of posts. And this group, you can determine any rights, which would like, including gratuities.turbopanel wrote:I want users with minimum 20 posts can thank you. Please help me ?
Thank you very much.
You may have to simply insert a condition in the file viewtopivc_body.html before the conclusion of the buttons thanksusenet2you wrote:Is it possible to thank only the first post??
nvm, I have tweaked it:
Code: Select all
<!-- IF not START and postrow.S_ROW_COUNT == 0 -->
Hmm with that code, I think you can also see the thanks button on 1st post of the 2nd page. If not, yeah its much easier then lol.Палыч wrote:You may have to simply insert a condition in the file viewtopivc_body.html before the conclusion of the buttons thanksusenet2you wrote:Is it possible to thank only the first post??
nvm, I have tweaked it:Code: Select all
<!-- IF not START and postrow.S_ROW_COUNT == 0 -->
You're right. You need to add:usenet2you wrote:Hmm with that code, I think you can also see the thanks button on 1st post of the 2nd page. If not, yeah its much easier then lol.
Code: Select all
==open==
viewtopic.php
==find==
'PAGE_NUMBER' => on_page($total_posts, $config['posts_per_page'], $start),
==after-add==
'START' => $start,
Code: Select all
// Check if the topic viewer has posted in a topic
$unhide = false;
if ($user->data['user_id'] != ANONYMOUS)
{
// If moderator or admin, skip reply check, auto unhide
if ($auth->acl_get('m_', $forum_id))
{
$unhide = true;
}
else if ($thanked($user->data['user_id']))
{
$unhide = true;
}
else
{
$sql = "SELECT poster_id, topic_id
FROM " . POSTS_TABLE . "
WHERE post_id = $msg_id
AND poster_id = " . $user->data['user_id'];
$result = $db->sql_query($sql);
$unhide = $db->sql_affectedrows($result) ? true : false;
$db->sql_freeresult($result);
}
}
Code: Select all
else if ($thanked($user->data['user_id']))
{
$unhide = true;
}
Hmm.. I put the mod Simple Hide BBCode, but found no conflict in viewtopic...usenet2you wrote:I'll try it tommorow, thanks.
What about a addon: Simple Hide BBCode add-on? When user has thanked, it will unhide.
Code: Select all
// Check if the topic viewer has posted in a topic
$unhide = false;
if ($user->data['user_id'] != ANONYMOUS)
{
// If moderator or admin, skip reply check, auto unhide
if ($auth->acl_get('m_', $forum_id))
{
$unhide = true;
}
else if (already_thanked($user->data['user_id']))
{
$unhide = true;
}
else
{
$sql = "SELECT poster_id, topic_id
FROM " . POSTS_TABLE . "
WHERE post_id = $msg_id
AND poster_id = " . $user->data['user_id'];
$result = $db->sql_query($sql);
$unhide = $db->sql_affectedrows($result) ? true : false;
$db->sql_freeresult($result);
}
}
Code: Select all
else if (already_thanked($user->data['user_id']))
{
$unhide = true;
}
won't work, you can thank the 2nd only instead of the 1st only, and I even think the user will be able to thank other posts then the 2nd one with your modification for this, simple change post_id. With my modification you wouldn't be able to thank the 2nd post.Палыч wrote:You're right. You need to add:usenet2you wrote:Hmm with that code, I think you can also see the thanks button on 1st post of the 2nd page. If not, yeah its much easier then lol.Code: Select all
==open== viewtopic.php ==find== 'PAGE_NUMBER' => on_page($total_posts, $config['posts_per_page'], $start), ==after-add== 'START' => $start,
Code: Select all
// Check if the topic viewer has posted in a topic
$unhide = false;
if ($user->data['user_id'] != ANONYMOUS)
{
// If moderator or admin, skip reply check, auto unhide
if ($auth->acl_get('m_', $forum_id))
{
$unhide = true;
}
else if (already_thanked($user->data['user_id']))
{
$unhide = true;
}
else
{
$sql = "SELECT poster_id, topic_id
FROM " . POSTS_TABLE . "
WHERE post_id = $msg_id
AND poster_id = " . $user->data['user_id'];
$result = $db->sql_query($sql);
$unhide = $db->sql_affectedrows($result) ? true : false;
$db->sql_freeresult($result);
}
}
Code: Select all
else if (already_thanked($user->data['user_id']))
{
$unhide = true;
}