PDA

View Full Version : Number Change Help


the1rabbits
04-12-2011, 11:25 PM
I previously ran a ProBoards forum and unfortunately discovered that there is no ProBoards to vBulletin converter. Of course I am much happier with vBulleting but I am hoping it is possible to do the following.

My ProBoards forum had over 60, 000 threads and over 700,000 posts. Is it possible to reflect these numbers in my newly created forum?

Basically I would like to change the Threads: Posts: number so it starts off at 60,000 and 700,000. (as well as the global statistics at the bottom of the site)

Is this possible? And how do I go about doing it

Thanks
the1rabbits :)

Lynne
04-13-2011, 03:00 AM
Unfortuntely, the totalthreads and totalposts variable has been formatted by the time you get to the forumhome_complete hook, so you would have to actually edit these lines to add it in in the forum.php file:
$totalthreads = vb_number_format($totalthreads);
$totalposts = vb_number_format($totalposts);Something like adding this right above:
$totalthreads = $totalthreads + 60000;
$totalposts = $totalposts + 700000;
If you show those stats elsewhere, then you will need to modify the code there too.

the1rabbits
04-13-2011, 03:43 AM
Thanks for your response Lynne :)

Sorry though I am not an advanced user when it comes to PHP coding so I will need a bit of extra help.

I would like to add those respective amount to one particular sub forum and the total statistics at the bottom of the page.

With what you have suggested above does that fix both of what I am looking to do.

Thanks Lynne :)

Lynne
04-13-2011, 04:43 PM
The above code only fixes it for the total on the bottom of the forum.php page. If you need to add to the total for a specific forum, you can try a plugin (look in the manual if you need help) using the hook location "forumbit_display" and this code (change x to your forumid):
if ($forum['forumid'] == x) {
$forum['threadcount'] = vb_number_format($forum['threadcount'] + 60000);
$forum['replycount'] = vb_number_format($forum['replycount'] + 700000);
}

the1rabbits
04-14-2011, 12:06 AM
So would this be correct if I were to re-upload my forum.php like this:

// ### BOARD STATISTICS #################################################

// get total threads & posts from the forumcache
$totalthreads = 0;
$totalposts = 0;
if (is_array($vbulletin->forumcache))
{
foreach ($vbulletin->forumcache AS $forum)
{
$totalthreads += $forum['threadcount'];
$totalposts += $forum['replycount'];
}
}
$totalthreads = $totalthreads + 60000;
$totalposts = $totalposts + 700000;

$totalthreads = vb_number_format($totalthreads);
$totalposts = vb_number_format($totalposts);


Also I am sorry Lynne, however I need further clarification on your above post. Where exactly should I be looking in the manual to help me out there? And what file to I have to place the forumid code in?

Lynne
04-14-2011, 02:59 AM
Yes, I think that code looks correct. Upload it to your test site first if you are not sure - that is what they are for.

As for the plugin code, here is the section in the manual about plugins - Plugin System (http://www.vbulletin.com/docs/html/plugin_system)

the1rabbits
04-14-2011, 03:33 AM
Yes, I think that code looks correct. Upload it to your test site first if you are not sure - that is what they are for.

As for the plugin code, here is the section in the manual about plugins - Plugin System (http://www.vbulletin.com/docs/html/plugin_system)

Thanks Lynne! Test site? I was unaware that I actually had a test site, how do I access it? Or am I being ignorant once again? Do I have to create a test site. Sorry Lynee, I am really new to vBulletin and really do appreciate your help.

Just a quick question on the plugin... Does it matter what number I place in the 'Execution Order' field?

Lynne
04-14-2011, 04:28 PM
You need to create a test site. There are instructions in the Home tab over on vbulletin.com on how to create one. You don't *need* one, but I would certainly never run a site without one. I always test any modifications on my test site first.

Just leave the execution order alone. Usually it doesn't matter. It only matters if you have another plugins running that uses the same hook location and they are not playing nice with each other unless you run one before the other.

the1rabbits
04-14-2011, 10:47 PM
Thank you very much Lynne. I'll set up my test site soon :)

If I have any more questions I will be sure to come back and post here. Thankyou :)

--------------- Added 1302838155 at 1302838155 ---------------

Thank you Lynne :)

I have set up my test site and successfully implemented the changes there. I then implemented them on my LIVE site and all is good.

Thank you for your assistance :)