Activity Stream
48,167 MEMBERS
61953 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 6 of 6
  1.     
    #1
    Member

    Default 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

  2.   Sponsored Links

  3.     
    #2
    Member
    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));
    What this is supposed to be doing is registering the {vb:raw post_thanks_count} variable from 'thanks_postbit' template so I can display it in 'threadbit_display' template. But I'm doing something wrong.

  4.     
    #3
    Member
    Website's:
    vbulletin.org
    you 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}

  5.     
    #4
    Member
    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?

  6.     
    #5
    Member
    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

  7.     
    #6
    Probation
    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,

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. User Post Count
    By Tempus in forum vBulletin
    Replies: 21
    Last Post: 21st Nov 2011, 05:19 PM
  2. [REQ] Minimum post count to create thread vbulletin
    By irfan saleem in forum vBulletin
    Replies: 2
    Last Post: 17th Jul 2011, 03:50 AM
  3. Post Count does not increase in same thread
    By vorazeal in forum IP.Board
    Replies: 9
    Last Post: 30th Nov 2010, 01:56 PM
  4. why post count shows 0 ?
    By Mr.Bean in forum Feedback and Suggestions
    Replies: 13
    Last Post: 3rd Nov 2010, 10:03 PM
  5. post count not increasing
    By hdPARADOX in forum Introductions
    Replies: 4
    Last Post: 16th Oct 2010, 04:15 AM

Tags for this Thread

BE SOCIAL