vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Show Thread Enhancements - [AJAX] Post Thank You Hack (https://vborg.vbsupport.ru/showthread.php?t=122944)

Abe1 05-16-2007 03:59 PM

Quote:

Originally Posted by shamda (Post 1248824)
That seems to be the problem. We do not use the default vb board and when I look at the default board I see the thanks buttons there. I uploaded the images to the working template that we use but still do not see the buttons. How do I install the hack to work with the template we created rather than the vb default?

Click to edit the template. There is then a button to hit 'history'. Use it.

Seiyaboy 05-16-2007 05:23 PM

The Thank button won't show up when I upgraded it from 6.0 Gold to 6.1. What do you think could be wrong here?

Zagis 05-16-2007 05:38 PM

Quote:

Originally Posted by Seiyaboy (Post 1248911)
The Thank button won't show up when I upgraded it from 6.0 Gold to 6.1. What do you think could be wrong here?

Read a few pages back ;)

Seiyaboy 05-16-2007 05:47 PM

Quote:

Originally Posted by Zagis (Post 1248922)
Read a few pages back ;)

Sorry. That's too much of a hassle. Running a few extra scripts ain't gonna kill me. I'll stick with the template-editing-6.0 for now.

adhari_com 05-16-2007 06:21 PM

Thanks for the patch, but instead shouldn't the last line of the plugin triggered in 'postbit_display_complete' be like this?

PHP Code:

eval('$template_hook[postbit_userinfo_right] = " ' fetch_template('post_thanks_postbit_info') . '";'); 

Just removing the concatinating period would solve the multiple posubit info being repeated.

Abe1 05-16-2007 06:31 PM

Quote:

Originally Posted by adhari_com (Post 1248954)
Thanks for the patch, but instead shouldn't the last line of the plugin triggered in 'postbit_display_complete' be like this?

PHP Code:

eval('$template_hook[postbit_userinfo_right] = " ' fetch_template('post_thanks_postbit_info') . '";'); 

Just removing the concatinating period would solve the multiple posubit info being repeated.

If I do this, then it means I'm hogging this hook and any coder that added info to this before I did would get lost. Would you really like that?

Abe1 05-16-2007 06:32 PM

Quote:

Originally Posted by Seiyaboy (Post 1248911)
The Thank button won't show up when I upgraded it from 6.0 Gold to 6.1. What do you think could be wrong here?

Basically, you have to make sure your templates are up to date. Do a history compare and see what you are missing.

mamashid 05-16-2007 06:45 PM

i just upgraded and once i did...any post that has a thanks posted in it has this:

Quote:

Warning: Illegal offset type in /includes/functions_post_thanks.php on line 110

Warning: Illegal offset type in /includes/functions_post_thanks.php on line 110

Warning: Illegal offset type in /includes/functions_post_thanks.php on line 110

Warning: Illegal offset type in /includes/functions_post_thanks.php on line 110
what do i need to do????

Abe1 05-16-2007 07:07 PM

Quote:

Originally Posted by mamashid (Post 1248977)
i just upgraded and once i did...any post that has a thanks posted in it has this:



what do i need to do????

No clue. Never saw such an error before. Do you have any other hacks that could be affecting this one?

mamashid 05-16-2007 07:13 PM

I dont think....nothing has changed just upgraded!

I am slight new to all the updates etc....what is line 110???
here is the php

Quote:

<?php
/*=====================================*\
|| ################################### ||
|| # Post Thank You Hack version 6.1 # ||
|| ################################### ||
\*=====================================*/

function post_thanks_off($forumid = 0, $postinfo = array(), $threadfirstpostid = 0, $this_script = '')
{
global $vbulletin;

($hook = vBulletinHook::fetch_hook('post_thanks_function_po st_thanks_off_start')) ? eval($hook) : false;

if (!($vbulletin->options['post_thanks_on_off']) || $forumid == 0 || post_thanks_in_array($forumid, $vbulletin->options['post_thanks_forum_off']))
{
return true;
}

if (($vbulletin->options['post_thanks_forum_first_all'] && !($postinfo['postid'] == $threadfirstpostid)) || (post_thanks_in_array($forumid, $vbulletin->options['post_thanks_forum_first']) && !($postinfo['postid'] == $threadfirstpostid)))
{
return true;
}

if (!($this_script == 'showthread' || $this_script == 'showpost' || $this_script == ''))
{
return true;
}

if ($vbulletin->options['post_thanks_usergroup_getting'])
{
if (is_member_of($postinfo, explode("|", $vbulletin->options['post_thanks_usergroup_getting'])))
{
return true;
}
}

($hook = vBulletinHook::fetch_hook('post_thanks_function_po st_thanks_off_end')) ? eval($hook) : false;

return false;
}

function can_thank_this_post($postinfo = array(), $threadisdeleted = 0)
{
global $vbulletin;

($hook = vBulletinHook::fetch_hook('post_thanks_function_ca n_thank_this_post_start')) ? eval($hook) : false;

if ($postinfo['postid'] == 0 || $vbulletin->userinfo['userid'] == 0 || $postinfo['isdeleted'] || $threadisdeleted || (!($vbulletin->options['post_thanks_poster_button']) && $postinfo['userid'] == $vbulletin->userinfo['userid']))
{
return false;
}

if (post_thanks_in_array($vbulletin->userinfo['usergroupid'], $vbulletin->options['post_thanks_usergroup_using']) || post_thanks_in_array($vbulletin->userinfo['userid'], $vbulletin->options['post_thanks_user_useing']))
{
return false;
}

if ($vbulletin->userinfo['posts'] < $vbulletin->options['post_thanks_post_count_needed'])
{
return false;
}

if ($vbulletin->options['post_thanks_days_old'])
{
if (TIMENOW > (($vbulletin->options['post_thanks_days_old'] * 60 * 60 * 24) + $postinfo['dateline']))
{
return false;
}
}

if ($vbulletin->options['post_groan_integrate'])
{
require_once(DIR . '/includes/functions_post_groan.php');
if (groaned_already($postinfo))
{
return false;
}
}

($hook = vBulletinHook::fetch_hook('post_thanks_function_ca n_thank_this_post_end')) ? eval($hook) : false;

return true;
}

function can_delete_all_thanks()
{
global $vbulletin;

($hook = vBulletinHook::fetch_hook('post_thanks_function_ca n_delete_all_thanks_start')) ? eval($hook) : false;

if ($vbulletin->userinfo['usergroupid'] == '6')
{
return true;
}

($hook = vBulletinHook::fetch_hook('post_thanks_function_ca n_delete_all_thanks_end')) ? eval($hook) : false;

return false;
}

function thanked_already($postinfo, $userid = 0)
{
global $vbulletin;
$thanks = fetch_thanks($postinfo['postid']);

($hook = vBulletinHook::fetch_hook('post_thanks_function_th anked_already_start')) ? eval($hook) : false;

$userid != 0 ? $userid = $userid : $userid = $vbulletin->userinfo['userid'];

if ($postinfo['post_thanks_amount'] && $thanks[$userid])
{
return true;
}

($hook = vBulletinHook::fetch_hook('post_thanks_function_th anked_already_end')) ? eval($hook) : false;

return false;
}

function show_thanks_date($forumid = 0)
{
global $vbulletin;

($hook = vBulletinHook::fetch_hook('post_thanks_function_sh ow_thanks_date_start')) ? eval($hook) : false;

if ($vbulletin->options['post_thanks_date_all'] && !post_thanks_in_array($forumid, $vbulletin->options['post_thanks_date_forum']))
{
return true;
}

($hook = vBulletinHook::fetch_hook('post_thanks_function_sh ow_thanks_date_end')) ? eval($hook) : false;

return false;
}

function fetch_thanks($postid = 0, $postids = '', $fetch_again = false)
{
global $vbulletin;
static $cache, $act;

($hook = vBulletinHook::fetch_hook('post_thanks_function_fe tch_thanks_start')) ? eval($hook) : false;

if ((!($cache) && !($act)) || ($fetch_again))
{
$cache = array();

if ($postids)
{
$post_ids = "0$postids";
}
else
{
$post_ids = $postid;
}

$thanks = $vbulletin->db->query_read("SELECT * FROM " .TABLE_PREFIX. "post_thanks WHERE postid IN (" . $post_ids . ") ORDER BY username ASC");

while ($thank = $vbulletin->db->fetch_array($thanks))
{
$cache[$thank['postid']][$thank['userid']]['userid'] = $thank['userid'];
$cache[$thank['postid']][$thank['userid']]['username'] = $thank['username'];
$cache[$thank['postid']][$thank['userid']]['date'] = $thank['date'];
$cache[$thank['postid']][$thank['userid']]['postid'] = $thank['postid'];
}
}

($hook = vBulletinHook::fetch_hook('post_thanks_function_fe tch_thanks_end')) ? eval($hook) : false;

$act = true;
return $cache[$postid];
}

function fetch_thanks_bit($forumid = 0, $thanks)
{
global $vbulletin;

($hook = vBulletinHook::fetch_hook('post_thanks_function_fe tch_thanks_bit_start')) ? eval($hook) : false;

$number_rows = count($thanks);

$cmpt=1;

foreach ($thanks AS $thank)
{
if ($cmpt<$number_rows)
{
$virg=",";
}
else
{
$virg="";
}

if (show_thanks_date($forumid))
{
$date_thank = vbdate($vbulletin->options['dateformat'], $thank['date'], true);
}

eval('$liste_user .= " ' . fetch_template('post_thanks_box_bit') . '";');
$cmpt++;
}

($hook = vBulletinHook::fetch_hook('post_thanks_function_fe tch_thanks_bit_end')) ? eval($hook) : false;

return $liste_user;
}

function fetch_post_thanks_template($post)
{
global $vbulletin, $vbphrase, $stylevar;

($hook = vBulletinHook::fetch_hook('post_thanks_function_fe tch_post_thanks_template_start')) ? eval($hook) : false;

if ($vbulletin->options['legacypostbit'])
{
eval('$template = "' . fetch_template('post_thanks_postbit_legacy') . '";');
}
else
{
eval('$template = "' . fetch_template('post_thanks_postbit') . '";');
}

($hook = vBulletinHook::fetch_hook('post_thanks_function_fe tch_post_thanks_template_end')) ? eval($hook) : false;

return $template;
}

function add_thanks($postinfo)
{
global $vbulletin, $vbphrase;

($hook = vBulletinHook::fetch_hook('post_thanks_function_ad d_thanks_start')) ? eval($hook) : false;

$vbulletin->db->query_write("
INSERT INTO ". TABLE_PREFIX ."post_thanks
(userid, username, date, postid)
VALUES
('" . $vbulletin->userinfo['userid'] . "', '" . $vbulletin->db->escape_string($vbulletin->userinfo['username']) . "', " . TIMENOW . ", " . $postinfo['postid'] .")
");

$set_user_gave = 'post_thanks_user_amount = 1 + post_thanks_user_amount';
$set_user_got = 'post_thanks_thanked_times = 1 + post_thanks_thanked_times';
$set_post = 'post_thanks_amount = 1 + post_thanks_amount';

if ($postinfo['post_thanks_amount'] == 0)
{
$set_user_got .= ', post_thanks_thanked_posts = 1 + post_thanks_thanked_posts';
}

if ($vbulletin->options['post_thanks_reputation'])
{
$vbulletin->db->query_write("
INSERT IGNORE INTO ". TABLE_PREFIX ."reputation
(postid, userid, reputation, whoadded, reason, dateline)
VALUES
('".$postinfo['postid']."', '".$postinfo['userid']."', '" . $vbulletin->options['post_thanks_reputation'] . "', '" . $vbulletin->userinfo['userid'] . "', '$vbphrase[post_thanks_thanked_post]', " . TIMENOW . ")
");

if ($vbulletin->db->affected_rows() != 0)
{
$set_user_got .= ", reputation = " . $vbulletin->options['post_thanks_reputation'] . " + reputation";
}
}

if ($vbulletin->options['post_thanks_post_count'])
{
$set_user_gave .= ', posts = 1 + posts';
}

$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET $set_user_gave
WHERE userid = '" . $vbulletin->userinfo['userid'] . "'
");

$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET $set_user_got
WHERE userid = '$postinfo[userid]'
");

$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "post
SET $set_post
WHERE postid = '$postinfo[postid]'
");

($hook = vBulletinHook::fetch_hook('post_thanks_function_ad d_thanks_end')) ? eval($hook) : false;
}

function delete_all_thanks($postinfo)
{
global $vbulletin, $vbphrase;

($hook = vBulletinHook::fetch_hook('post_thanks_function_de lete_all_thanks_start')) ? eval($hook) : false;

$thanks=$vbulletin->db->query_read("SELECT * FROM ". TABLE_PREFIX ."post_thanks WHERE postid='$postinfo[postid]' ORDER BY username");
$nb=$vbulletin->db->num_rows($thanks);

if ($nb != 0)
{
while ($thank = $vbulletin->db->fetch_array($thanks))
{
$thank_userids[] = $thank['userid'];
}

$vbulletin->db->query_write("DELETE FROM ". TABLE_PREFIX ."post_thanks WHERE postid='$postinfo[postid]'");

$set_user_gave = 'post_thanks_user_amount = post_thanks_user_amount - 1';
$set_user_got = "post_thanks_thanked_times = post_thanks_thanked_times - $nb, post_thanks_thanked_posts = post_thanks_thanked_posts - 1";
$set_post = 'post_thanks_amount = 0';
$postinfo['post_thanks_amount'] = 0;

if ($vbulletin->options['post_thanks_reputation'])
{
$vbulletin->db->query_write("DELETE FROM ". TABLE_PREFIX ."reputation WHERE postid = '$postinfo[postid]' AND reason = '$vbphrase[post_thanks_thanked_post]'");

if ($vbulletin->db->affected_rows() != 0)
{
$total_rep_got = $vbulletin->options['post_thanks_reputation'] * $nb;
$set_user_got .= ", reputation = reputation - $total_rep_got";
}
}

if ($vbulletin->options['post_thanks_post_count'])
{
$set_user_gave .= ', posts = posts - 1';
}

$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET $set_user_gave
WHERE userid IN (".implode(",",$thank_userids).")
");

$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET $set_user_got
WHERE userid = '$postinfo[userid]'
");

$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "post
SET $set_post
WHERE postid = '$postinfo[postid]'
");
}

($hook = vBulletinHook::fetch_hook('post_thanks_function_de lete_all_thanks_end')) ? eval($hook) : false;
}

function delete_thanks($postinfo, $userid)
{
global $vbulletin, $vbphrase;

($hook = vBulletinHook::fetch_hook('post_thanks_function_de lete_thanks_start')) ? eval($hook) : false;

if (!(thanked_already($postinfo, $userid)))
{
return false;
}

$vbulletin->db->query_write("DELETE FROM ". TABLE_PREFIX ."post_thanks WHERE postid = '$postinfo[postid]' AND userid = '$userid'");

$set_user_gave = 'post_thanks_user_amount = post_thanks_user_amount - 1';
$set_user_got = "post_thanks_thanked_times = post_thanks_thanked_times - 1";
$set_post = 'post_thanks_amount = post_thanks_amount - 1';

if ($postinfo[post_thanks_amount] == 1)
{
$set_user_got .= ', post_thanks_thanked_posts = post_thanks_thanked_posts - 1';
}

if ($vbulletin->options['post_thanks_reputation'])
{
$vbulletin->db->query_write("DELETE FROM ". TABLE_PREFIX ."reputation WHERE postid = '$postinfo[postid]' AND whoadded = '$userid' AND reason = '$vbphrase[post_thanks_thanked_post]'");

if ($vbulletin->db->affected_rows() != 0)
{
$set_user_got .= ", reputation = reputation - ". $vbulletin->options[post_thanks_reputation] ."";
}
}

if ($vbulletin->options['post_thanks_post_count'])
{
$set_user_gave .= ', posts = posts - 1';
}

$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET $set_user_gave
WHERE userid = '$userid'
");

$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "user
SET $set_user_got
WHERE userid = '$postinfo[userid]'
");

$vbulletin->db->query_write("
UPDATE " . TABLE_PREFIX . "post
SET $set_post
WHERE postid = '$postinfo[postid]'
");

($hook = vBulletinHook::fetch_hook('post_thanks_function_de lete_thanks_end')) ? eval($hook) : false;

return true;
}

function post_thanks_in_array($number = 0, $array = 0)
{
$array_split = explode("|", $array);

foreach ($array_split AS $array_number)
{
if ($number == $array_number)
{
return true;
}
}
return false;
}
?>


Quote:

Originally Posted by Abe1 (Post 1248994)
No clue. Never saw such an error before. Do you have any other hacks that could be affecting this one?



All times are GMT. The time now is 09:21 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06142 seconds
  • Memory Usage 1,809KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (6)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete