Мод спасибо !
копируем файлы
mod_install/thx_light.xml
style_images/p_thanks.gif
Открываем фаил index.php
Ищем
"reg" => array( "register" , 'register' , array('profilefields') ),
Ниже добавляем
"thanks" => array( "thanks" , 'thanks' , array() ),
Ищем
//===========================================================================
// REQUIRE AND RUN
//===========================================================================
Ниже добавляем
// Thanks Light - Adapted By ThiagoInfo - Start
if($ipsclass->input['act'] == "thanks")
{
$output = "";
$thpid = $ipsclass->input['pid'];
$divid = "thank_".$ipsclass->input['pid'];
$userpost = $ipsclass->input['usp'];
$userpostid = $ipsclass->input['tid'];
if (!$thpid || !$ipsclass->member['id'])
{
return;
}
$userid = $ipsclass->member['id'];
$username = $ipsclass->member['members_display_name'];
$ipsclass->DB->query("INSERT INTO ibf_post_thanks (userid, username, postid) VALUES('$userid', '$username', '$thpid')");
$query = $ipsclass->DB->query("SELECT thanks_point FROM ibf_members WHERE id = '$userpostid'");
$row = $ipsclass->DB->fetch_row($query);
$thanks_point = $row['thanks_point'];
++$thanks_point;
$ipsclass->DB->query("UPDATE ibf_members SET thanks_point ='$thanks_point' where id = '$userpostid'");
$query = $ipsclass->DB->query("SELECT * FROM ibf_post_thanks WHERE postid = '$thpid' ORDER BY username ASC");
$thank_tot = $ipsclass->DB->get_num_rows($query);
if ($thank_tot)
{
$thank_text1 = "The Following {$thank_tot} Users Say Thank You to {$userpost} For This Useful Post:";
while($row = $ipsclass->DB->fetch_row($query))
{
$thank_text .= "
}
$thank_text = preg_replace( "/,s+$/", "" , $thank_text);
$output = "{$thank_text1} {$thank_text}";
$output = str_replace("|", "", $output);
}
echo "$divid|$output";
exit;
}
// Thanks Light - Adapted By ThiagoInfo - End
Открываем фаил sources/action_public/topics.php
Ищем
//-----------------------------------------
// Siggie stuff
//-----------------------------------------
Выше добавляем
// Thanks Ajax Adaptex By ThiagoInfo - Start
if ($this->ipsclass->vars['thanks_mod_enable'])
{
$thank_pid = $row['pid'];
if ($this->ipsclass->vars['thx_topics_replies'])
{
$row['thanks_button'] = "
}
$thank_text = preg_replace( "/,s+$/", "" , $thank_text);
}
$row['who_thanks'] = " n{$thank_text1} {$thank_text}n";
if ($this->ipsclass->vars['thx_member_display'])
{
$thanksquery = $this->ipsclass->DB->query("SELECT thanks_point FROM ibf_members WHERE id = '{$poster['id']}'");
$thanks = $this->ipsclass->DB->fetch_row($thanksquery);
$poster['thanks_point'] = $this->ipsclass->compiled_templates['skin_topic']->member_thanks_point( $thanks['thanks_point'] );
}
}
//Thanks Ajax Adaptex By ThiagoInfo - End
Редактируем скины
Внеший вид > * > Редактировать HTML шаблоны > Topic View > RenderRow:
Ищем
Ниже добавляем
Ищем
{$author['member_posts']}
Ниже добавляем
{$author['thanks_point']}
Ищем
Перед добавляем
{$post['who_thanks']}
Ищем
{$post['delete_button']}
После добавляем
{$post['thanks_button']}
Забрать: