Results 1 to 6 of 6
-
15th May 2011, 08:43 AM #1OPMember
Preregister a variable for use in another template
What I'm trying to do is insert {vb:raw post_thanks_count} from thanks_postbit template to threadbit template, but when I insert the code into threadbit template, it is just blank, and doesn't show the thanks count.
itsHERO Reviewed by itsHERO on . Show thanks count for each post on threadbit & forumdisplay What I'm trying to do is insert {vb:raw post_thanks_count} from thanks_postbit template to threadbit template, but when I insert the code into threadbit template, it is just blank, and doesn't show the thanks count. Rating: 5
-
16th May 2011, 05:38 AM #2OPMember
I figured out what I have to do, sorta...
I have to preregister the variable for use in another template. So I tried creating a plugin/hook to threadbit_display with PHP Code..
Code:$post_thanks_count = $templater->render(); vB_Template::preRegister('thanks_postbit',array('post_thanks_count' => $post_thanks_count));
-
16th May 2011, 07:53 AM #3MemberWebsite's:
vbulletin.orgyou can't add post_thanks_count like this.
an sql query should be enter in threadbit display to count thanks.
Example :
PHP Code:$thankquery = sql query
$thank = $vbulletin->db->fetch_array($thankquery);
$thank['count'] = $thankquery;
$templater = vB_Template::create('thanks_threadbit');
$templater->register('thank', $thank);
$thanks_threadbit = $templater->render();
vB_Template::preRegister('threadbit',array('thanks_postbit' => $thanks_threadbit));
where thanks_threadbit is a template which u have to create in style manager.
in that add (vb raw thank.count}
-
16th May 2011, 10:20 PM #4OPMember
Thanks. I am anxious to try this when I get home. I hope it works. If it does then I will gladly send you a few dollars through PayPal to show my appreciation.
So I just add the first code to a new plugin that hooks to threadbit_display and then I would create a new template called thanks_threadbit and insert (vb raw thank.count}
This will then display the amount of Thanks Received for that thread in the threadbit?
-
17th May 2011, 03:07 AM #5OPMember
This is what I got..
Parse error: syntax error, unexpected T_STRING in /home/earkandy/public_html/forumdisplay.php(1050) : eval()'d code on line 4
-
19th Nov 2011, 03:30 AM #6Probation
Hi itsHERO,
Did you successes modified the thank count outside postbit? If already please help me. I also want to add the thank count to thanks_wrapper template to show the total thanks for every post.
Regard,
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
User Post Count
By Tempus in forum vBulletinReplies: 21Last Post: 21st Nov 2011, 05:19 PM -
[REQ] Minimum post count to create thread vbulletin
By irfan saleem in forum vBulletinReplies: 2Last Post: 17th Jul 2011, 03:50 AM -
Post Count does not increase in same thread
By vorazeal in forum IP.BoardReplies: 9Last Post: 30th Nov 2010, 01:56 PM -
why post count shows 0 ?
By Mr.Bean in forum Feedback and SuggestionsReplies: 13Last Post: 3rd Nov 2010, 10:03 PM -
post count not increasing
By hdPARADOX in forum IntroductionsReplies: 4Last Post: 16th Oct 2010, 04:15 AM
themaRegister - register to forums...
Version 3.56 released. Open older version (or...