The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Plugin Help Pretty-Please
Thank-you to anyone who reads this with a view to helping me. I'm stuck
I'm trying to get a home-made addon that I used on my old 3.6.8 board to work on my 4.0.6 board. Everything works except one plugin that calculates the values of table rows to show total debits ($totaldebits), total credits ($totalcredits) and overall total ($totaltotal). Values are entered in admincp fields and display on a table. Negative values entered in the admincp fields display within the Debit column & Balance column whereas positive values display within the Credit column & Balance column. I use the following to achieve that: Sample of table ROW code: PHP Code:
Table Result: The old plugin (for 3.6.8) automatically calculated the totals of the Debit, Credit and Balance columns and looks like this: PHP Code:
PHP Code:
Code:
$templater->register('totaldebits', $totaldebits); $templater->register('totalcredits', $totalcredits); $templater->register('totaltotal', $totaltotal); PHP Code:
I've tried using different Hook Locations but with no success. I'm guessing there is something wrong with my 4.0.6 plugin and was hoping someone might be able to spot something obvious and push me in the right direction. |
#2
|
||||
|
||||
There is more to registering a variable than just what you wrote above. That one part is correct for that part. But, we'd need to see the whole thing in order to see that you did it correctly.
|
#3
|
||||
|
||||
Quote:
At present the list of variables are all bunched up together on my .xml document between </templates> and <plugins>. PHP Code:
[S]I've attached the .xml and .php files in case that might assist with spotting what I've done wrong.[/S] Removed attachment. |
#4
|
||||
|
||||
That shouldn't be all either. Here are the basic steps - create the template, register the variables, render the template:
PHP Code:
|
#5
|
||||
|
||||
Thanks very much indeed Lynne. The plugin now calculates my table rows as it should. Awesome!
Now I've just got to reinstall my test board after experimenting to find the best Hook for that plugin and turning my entire board white hehehe. |
#6
|
||||
|
||||
I thought I'd post here because my question relates to this same project. I hope that is okay.
I've 99.9% completed what I wanted to achieve. The only remaining issue that I'm unsure of how to fix is: - How do I enable the parsing of either BBCode or HTML that is entered in to a text field in the AdminCP and outputted to a table cell in my custom php page? I didn't do anything special with my 3.6.8 version to be able to achieve parsing HTML in the same circumstances (although BBCode didn't work there): |
#7
|
||||
|
||||
Look at the API (in Quick Links) for functions that deal with html and bbcode. I'm sure you'll find it in there.
|
#8
|
||||
|
||||
Quote:
100% working now THE END |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|