![]() |
My odd project
Folks-
I'm trying to build something that's not-a-forum using vB3... On the forum home page, I want to display two less threads than are actually in each forum (a long explanation, that I'm happy to skip). The template variable, $forum[threadcount], gives me the actual count?but it appears that it is a string, rather than a value. Is there any way that I can convert the variable to a value, perform an operation on it, convert the result back to a string?within the template? --don |
I guess it depends on the string format. If it automatically converts to the right integer then you might be able to do it (although I'm not certain offhand), otherwise you'd need to use a plugin.
|
$threadcount = intval($forum[threadcount]);
|
Quote:
|
Quote:
|
Quote:
Try this plugin for "forumbit_display" Code:
$forum['threadcount'] = vb_number_format(intval($forum['threadcount']) - 2); |
Quote:
Quote:
|
I don't see any practical way to do it in a template. Youre right about commas. This should catch it before it's formatted:
Code:
$forum['threadcount'] = vb_number_format(intval($counters["$forum[forumid]"]['threadcount']) - 2); |
All times are GMT. The time now is 02:10 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|