Ben teşekkür botunu kurdum herşey düzgün bi şekilde çalışıyor fakat forumda mesajların altına teşekkür eden kişilerin isimleri gelmiyor... bununla ilgili yapabileceğim birşey varmı acaba?
Kod: Tümünü seç
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
$pagination = ( $highlight != '' ) ? generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order&highlight=$highlight", $total_replies, $board_config['posts_per_page'], $start) : generate_pagination("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postdays=$post_days&postorder=$post_order", $total_replies, $board_config['posts_per_page'], $start);
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Start Thank Post by User Mod
//
// Set to 1 to use pop-ups instead of using the same window
$popup_enabled = 0;
if ($popup_enabled == 1) {
$thanks_javascript ='<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, \'" + id + "\', \'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=400,height=225\');");
}
// End -->
</script>';
}
//
// End Thank Post by User Mod
//
#
#-----[ FIND ]------------------------------------------
#
'FORUM_ID' => $forum_id,
#
#-----[ BEFORE, ADD ]------------------------------------------
#
'THANKS_JAVASCRIPT' => $thanks_javascript,
#
#-----[ FIND ]------------------------------------------
#
$search = '<a href="' . $temp_url . '">' . sprintf($lang['Search_user_posts'], $postrow[$i]['username']) . '</a>';
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// Start Thank Post by User Mod
//
$thanks_img = '';
if ( ($userdata['session_logged_in']) && ($userdata['user_id'] != $poster_id) ) {
// Posts SQL
$sql = "SELECT thanks_from_user_id
FROM " . POSTS_TABLE . "
WHERE post_id = " . $postrow[$i]['post_id'];
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain post information", '', __LINE__, __FILE__, $sql);
}
$post_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$already_thanked = 0;
if ($post_row['thanks_from_user_id'] != null) {
$thanked_users = explode("|",$post_row['thanks_from_user_id']);
$thanked_count = count($thanked_users);
// Loop through all users who thanked the post
for ($x = 0; $x < $thanked_count; $x++) {
if ($thanked_users[$x] == $userdata['user_id']) {
$already_thanked = 1;
}
}
}
// If the user hasn't thanked this post
if ($already_thanked == 0) {
$temp_url = append_sid("thanks.$phpEx?p=" . $postrow[$i]['post_id']);
if ($popup_enabled == 1) {
$thanks_img = '<a href="javascript:popUp(\'' . $temp_url . '\')"><img src="' . $images['icon_thank'] . '" alt="' . $lang['Thanks_text'] . '" title="' . $lang['Thanks_text'] . '" border="0" /></a>';
}
else {
$thanks_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_thank'] . '" alt="' . $lang['Thanks_text'] . '" title="' . $lang['Thanks_text'] . '" border="0" /></a>';
}
}
}
//
// End Thank Post by User Mod
//
#
#-----[ FIND ]------------------------------------------
#
$template->assign_block_vars('postrow', array(
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// Start Thank Post by User Mod
//
// If the user isn't anonymous
if ($postrow[$i]['user_id'] != ANONYMOUS) {
// From Users SQL
$sql = "SELECT user_posts, user_thanks_given, user_thanks_received
FROM " . USERS_TABLE . "
WHERE user_id = " . $postrow[$i]['user_id'];
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
// Thanked Posts SQL
$sql = "SELECT COUNT(thanks_count) AS thanks_count
FROM " . POSTS_TABLE . "
WHERE poster_id = " . $postrow[$i]['user_id'] . "
AND thanks_count <> 0";
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain posts information", '', __LINE__, __FILE__, $sql);
}
$thanked_post_count = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$thanks_given = $lang['Thanks_thanks'] . ': ' . $user_row['user_thanks_given'];
$thanks_received = $lang['Thanks_thanked_1'] . ' ' . $user_row['user_thanks_received'] . ' ' . $lang['Thanks_thanked_2'] . ' ' . $thanked_post_count['thanks_count'] . ' ' . $lang['Thanks_thanked_3'];
}
else {
$thanks_given = "";
$thanks_received = "";
}
//
// End Thank Post by User Mod
//
#
#-----[ FIND ]------------------------------------------
#
'POSTER_FROM' => $poster_from,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'POSTER_THANKS_GIVEN' => $thanks_given,
'POSTER_THANKS_RECEIVED' => $thanks_received,
#
#-----[ FIND ]------------------------------------------
#
'EDIT' => $edit,
#
#-----[ AFTER, ADD ]------------------------------------------
#
'THANKS_IMG' => $thanks_img,
#
#-----[ FIND ]------------------------------------------
#
}
$template->pparse('body');
#
#-----[ BEFORE, ADD ]------------------------------------------
#
//
// Start Thank Post by User Mod
//
if ($postrow[$i]['thanks_count'] >= 1) {
$thanked_by = "";
$thanked_users = explode("|",$postrow[$i]['thanks_from_user_id']);
$thanked_count = $postrow[$i]['thanks_count'];
// Loop through all users who thanked the post
for ($x = 0; $x < $thanked_count; $x++) {
// Users SQL
$sql = "SELECT user_id, username
FROM " . USERS_TABLE . "
WHERE user_id = " . $thanked_users[$x];
if ( !($result = $db->sql_query($sql)) ) {
message_die(GENERAL_ERROR, "Could not obtain user information", '', __LINE__, __FILE__, $sql);
}
$user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($x >= 1) { $thanked_by .= ", "; }
// Add user to thanked by list
$temp_url = "profile.$phpEx?mode=viewprofile&u=" . $user_row['user_id'];
$thanked_by .= '<a href="' . $temp_url . '">' . $user_row['username'] . '</a>';
}
$template->assign_block_vars('postrow.thanks', array(
'L_THANKS_TEXT' => $lang['Thanks_thanked_by'],
'THANKS_USERS' => $thanked_by)
);
}
//
// End Thank Post by User Mod
//
Kod: Tümünü seç
templates/subSilver/viewtopic_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<table width="100%" cellspacing="2" cellpadding="2" border="0">
#
#-----[ BEFORE, ADD ]---------------------------------
#
{THANKS_JAVASCRIPT}
#
#-----[ FIND ]------------------------------------------
#
{postrow.ROW_CLASS}
#
#-----[ IN-LINE FIND ]------------------------------------------
#
{postrow.POSTER_POSTS}<br />
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
<br />{postrow.POSTER_THANKS_GIVEN}<br />{postrow.POSTER_THANKS_RECEIVED}<br /><br />
#
#-----[ FIND ]------------------------------------------
#
{postrow.QUOTE_IMG}
#
#-----[ IN-LINE FIND ]------------------------------------------
#
{postrow.QUOTE_IMG}
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
{postrow.QUOTE_IMG} {postrow.THANKS_IMG}
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="spaceRow" colspan="2" height="1"><img src="templates/subSilver/images/spacer.gif" alt="" width="1" height="1" /></td>
</tr>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<!-- BEGIN thanks -->
<tr>
<td colspan="2" class="{postrow.ROW_CLASS}" width="100%" valign="bottom"><table cellspacing="0" cellpadding="0" border="0" height="18">
<tr>
<td valign="middle"><span class="gen">{postrow.thanks.L_THANKS_TEXT}: {postrow.thanks.THANKS_USERS}</span></td>
</tr>
</table></td>
</tr>
<!-- END thanks -->
Yardımcı olursanız sevinirim...
[ resmi görüntülemek için tıklayın ]