View Full Version : Forum Home Enhancements - Forum Goals with Animated Progress Bar
BirdOPrey5
12-25-2010, 10:00 PM
This mod will display an animated progress bar on your forum index (FORUMHOME) showing your progress as your forum approaches a "goal" you set, either a number of posts or threads.
Demo: http://www.juot.net/forums/forum.php
Optionally you can set a date for the goal and it will display a countdown of days to reach the goal.
All text output is fully phrased so you can easily change the wording to your needs.
In addition the table is its own template, forumgoals, which you can further customize as needed.
You can also easily select a custom icon without needing to edit any templates.
Finally you can turn off the auto template injection and manually place the $forumgoals template variable anywhere on your FORUMHOME template.
Full instructions are included in the zip file.
This should work on 3.7.x and 3.8.x and possibly earlier versions as well.
The progress par requires JavaScript to display. If JS is off only a percentage will show.
The progress bar uses a freely distributed JavaScript library available here:
http://www.bram.us/projects/js_bramus/jsprogressbarhandler/
"The [JavaScrpt] is now released under a creative commons Attribution-ShareAlike 2.5 license."
2 JavaScript and 2 images to upload
1 custom template
3 plugins
10 phrases
4.x version - https://vborg.vbsupport.ru/showthread.php?t=257689
Please Mark as Installed if you use this!:)
BirdOPrey5
12-25-2010, 10:17 PM
Reserved.
tafreeh
12-26-2010, 02:13 AM
wow, can we get this for vb4 please :)
EddyMaxx
12-26-2010, 02:38 AM
Couldn't get it to work properly. I added the $forumgoals manually as well and nothing displayed.
I'm on 3.8.6. It must be conflicting with something.
Digital Jedi
12-26-2010, 02:48 AM
When I get a chance to catch up on some things, I'm going to give this a try. Might goad a few folks into posting.
BirdOPrey5
12-26-2010, 02:58 AM
Couldn't get it to work properly. I added the $forumgoals manually as well and nothing displayed.
I'm on 3.8.6. It must be conflicting with something.
Are you getting absolutely nothing to display?
Did you actually "set" a goal? If you don't change the goal from the default of 0 (zero) it won't show.
I made this on 3.8.6 and have it installed on 2 boards, one of them heavily modified...
wow, can we get this for vb4 please :)
Hopefully but every time I try to do something for VB4 something goes wrong and makes it take 10 times as long as it should...
EddyMaxx
12-26-2010, 03:17 AM
Yeah I set the goal to 150,000 posts to enable it and nothing appeared. Let me try it again.
BirdOPrey5
12-26-2010, 03:21 AM
Don't put commas into the number... just set it to 150000
EddyMaxx
12-26-2010, 04:01 AM
Yeah its definitely conflicting with something. Not sure what because I have a test site (slightly less modded then my live version) and it worked. So on my newer live version... there is something conflicting with it.
When I import the file... it just goes blank. In my test site it imports as it should and refreshes.
EddyMaxx
12-26-2010, 04:13 AM
Ok I figured it out Joe. It conflicts with the Today's Top Thread Starter(s) on Forum Home
mod.
https://vborg.vbsupport.ru/showthread.php?t=205483
I disabled that mod because I prefer this one. Thanks man!!
thx alot bro u r the best
BirdOPrey5
12-26-2010, 11:22 AM
Ok I figured it out Joe. It conflicts with the Today's Top Thread Starter(s) on Forum Home
mod.
https://vborg.vbsupport.ru/showthread.php?t=205483
I disabled that mod because I prefer this one. Thanks man!!
Cool, thanks a lot for this info... I will see if I can get both to work because someone else might have the same issue.
sulasno
12-26-2010, 11:24 AM
waiting for vB 4's version
BirdOPrey5
12-26-2010, 12:07 PM
EddyMaxx- I uninstalled my mod, installed the mod you linked to, and reinstalled my mod without issue. If you want to use both you may try re-installing the Top Thread Starts mod and see what's happening.
Reviewing the code there is nothing that should conflict off-hand.
Also I noticed the Top Thread Starter has 2 versions available, the newest one is V2, is that the one you were using?
EddyMaxx
12-26-2010, 03:12 PM
Joe... I tried it again and still didn't work. If I have "Top Thread" enabled... "Forum Goals" doesn't work and vice versa. Could be also my custom template.
But either way... I'm happy with this mod. :)
BirdOPrey5
12-26-2010, 03:33 PM
Thank you. :up:
ctrlbrk
12-28-2010, 07:33 PM
Thank you for your work. Can I make some suggestions?
1) If the goal is a Post goal, don't show # of threads (and vice versa)
2) If the goal has a date, please show not only the # remaining but what that works out to per day (ie: 500 posts/day to meet goal)
3) If you are feeling real generous, you could do something like a 7-day average of how many posts per day the forum is running and then display something like "On target" or "Falling behind" or "Ahead of schedule" based on how the post per day average compares to the goal figure.
Thx!
Mike
BirdOPrey5
12-28-2010, 09:56 PM
Suggestion 1)
Small changes like this can be made via template edits to customize it to your needs. The template to edit is: forumgoals
You can erase all the code in your existing template and replace it with the code below and it will only display threads or posts depending on your goal type:
<table class="tborder" id="collapseobj_forumhome_goal" style="">
<tr>
<td class="thead" colspan="2">
$vboptions[bbtitle] $vbphrase[bop5goals]
</td>
</tr>
<tr>
<td class="alt2"><img src="$stylevar[imgdir_misc]/$bop5goalimg" alt="$vbphrase[bop5goals]" border="0" /></td>
<td class="alt1" width="100%">
<table align="center" width="100%">
<tr>
<td width="120"><div align="center" class="smallfont" ><if condition="$bopgoalsport == 1">$vbphrase[threads]: $totalthreads<else /> </if></div></td>
<td width="120"><div align="center" class="smallfont" ><if condition="$bopgoalsport == 0">$vbphrase[posts]: $totalposts<else /> </if></div></td>
<td><div align="center" class="smallfont" ><span class="progressBar" id="element1"> $bopgoalper%</span></div></td>
<td width="170"><div align="center" class="smallfont" >$vbphrase[bop5goal] $bop5goalposts <if condition="$bopgoalsport == 0">$vbphrase[bop5posts]<else />$vbphrase[bop5threads]</if></div></td>
<td width="170"><div align="center" class="smallfont" >
<if condition="$goalreached">
$vbphrase[bop5goalreached]
<else />
<if condition="$bopgoalsport == 0">
$vbphrase[bop5poststogoal] $poststogo
<else />
$vbphrase[bop5threadstogoal] $poststogo
</if>
</if>
</td>
</tr>
<if condition="$vbulletin->options[bopgoalshowdate]">
<tr>
<td colspan="2"><div align="center" class="smallfont" >$vbphrase[today]: $bop5todayF</div></td>
<td><div align="center" class="smallfont" > <if condition="$goalreached">$bop5goalmess<else /><if condition="$bop5daysleft >= 0">$vbphrase[bopdaystogoal] <strong>$bop5daysleftF</strong><else />$vbphrase[bopovertime]</if></if></div></td>
<td colspan="2"><div align="center" class="smallfont" >$vbphrase[bopgoaldate] $bop5goaldateF</div></td>
</tr>
</if>
</table>
</td>
</tr>
</table>
<br />
You are encouraged to experiment to make further edits, if you get something that looks better feel free to even share the code in this thread if you're willing.
If you ever mess things up too much you can always go back by clicking the "revert template" button in style manager or at worst re-install the mod.
2) Yes that sounds like a good idea, I will include it in the next release.
3) I'm pretty sure keeping an average would require editing the database which will add a whole new level of complexity to the mod so I will probably be passing on this option for the time being, but I will keep it in mind should things change.
Just a reminder to anyone this is marked as "re-usable code" if anyone wants to take a shot and add more features they are free to do so and re-release their own version.
ctrlbrk
12-28-2010, 10:05 PM
Thanks Joe, I have tagged the mod.
The post per day stuff is already in vb, just look at admincp - statistics - new posts.
Mike
BirdOPrey5
12-29-2010, 01:33 AM
Thanks Joe, I have tagged the mod.
The post per day stuff is already in vb, just look at admincp - statistics - new posts.
Mike
Good to know, I never really checked statistics before... Will see what's available. :up:
Dexperia
01-23-2011, 02:30 PM
Pretty cool, installed.
However, I'm trying to modify it so it allows me to set goals for the number of users registered.
I'm not sure if I have it done correctly though.
Is it ok if I send to you in a PM what I have so far? Because I may need a little bit of help with it.
I've never really tried to make any changes to any addon, but I thought I'd give it a try with this just to see if it works.
BirdOPrey5
01-23-2011, 02:51 PM
Please post what you have here for everyone's benefit, I will help best I can... thinking about this just about everything will need to be changed to make this user # based, it's not a quick edit.
Dexperia
01-23-2011, 02:57 PM
Please post what you have here for everyone's benefit, I will help best I can... thinking about this just about everything will need to be changed to make this user # based, it's not a quick edit.
Ohhhh right, I see :p
Anyway, here's what I got so far.
I've got it working to select the goal for members in the admincp, but when it comes to displaying on the forum page, that's where the problems start.
I'll attach the file to this post.
Because I wasn't sure how it would work, I just gave it a guess and obviously it didn't turn out according to plan :p
But hey, everyone has to start somewhere, so why not guess :D
BirdOPrey5
01-23-2011, 04:07 PM
OK... here's a "beta" version I haven't tested much but seems to work...
I added "users" as a goal type in options you can select...
I added logic to the plugin to handle users...
I added logic and code to the template to handle user goal type...
I added 2 phrases related to users.
The forumgoal template could probably be nicer for # of member goals but it's a real good start if nothing else.
Import this product, allow overwrite set to "Yes."
Dexperia
01-23-2011, 06:59 PM
Thanks :)
Works like a charm :)
BirdOPrey5
01-24-2011, 12:37 AM
VB 4.x Version Released: https://vborg.vbsupport.ru/showthread.php?t=257689
Wonksta
02-06-2011, 02:02 PM
Big Big Issue when uninstalling.
I had to uninstall it but it removed almost every image from my forum home. I had to install it again but when I uninstall it my forum is completely white with just hyperlinks and text no images showing.
Please help.
BirdOPrey5
02-06-2011, 02:36 PM
This mod doesn't change your database or contain any custom install code at all, it's highly unlikely this mod caused your issues. You might have had a sever error in the middle of the uninstall unrelated to this mod, hard to know for sure.
To manually Uninstall go to the Admin CP, Plugin Manager... Find the section Forum Goals by BOP5 there should be 3 plugins listed, delete each one manually.
Then go to your styles and template manager, find the template forumgoals and
delete that too.
There are several phrases too but they won't hurt anything... If you really want to delete go to your Phrase Manager, find and delete the following phrases:
bop5goal
bop5goalreached
bop5goals
bop5posts
bop5poststogoal
bop5threads
bop5threadstogoal
bopdaystogoal
bopgoaldate
bopovertime
That's it... that will remove all traces of this mod. You can also try to uninstall it again if it's still listed in your product manager.
If you can't get to your admin cp follow the instructions to disable hooks first:
http://www.vbulletin.com/forum/showthread.php/196688-Disable-the-plugin-hook-system-globally
That should get you back in the system.
Wonksta
02-06-2011, 10:24 PM
Thanks before doing what you said I tried to do the normal uninstall thinking it was just a once off but yeah the issue happened again so I had to import the XML and then do it manually very strange.
Scyther
06-06-2011, 09:34 AM
nice mod..thanks
Code Geass
12-06-2012, 11:23 AM
plz update for vb4.x
BirdOPrey5
12-06-2012, 07:02 PM
4.x version - https://vborg.vbsupport.ru/showthread.php?t=257689
Xexiu
04-26-2013, 01:17 AM
Testes it on vb 3.8.6 with jquery boxes and callbacks and seems that prototype.js conflicts with jquery! Any solution? Maybe a Forum Goal realease with jquery?
Uninstalled for the momemt till a solution is found. Anyways, nice idea and keep up the good working ;).
BirdOPrey5
04-26-2013, 07:37 PM
I believe if you change the order the scripts are called in it can resolve the conflict- I've seen that work on the 4.x version.
My development of this mod is over, it is reusable code if anyone wants to continue with it.
datoneer
05-22-2013, 03:58 PM
Will this work on 4.2.1?
datoneer
05-22-2013, 04:02 PM
I tried it and got this error:
Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: forumgoals in [path]/includes/functions.php on line 4591
Parse error: syntax error, unexpected T_VARIABLE in /home/____/public_html/includes/class_core.php(4716) : eval()'d code on line 90
datoneer
05-22-2013, 04:03 PM
Omg i didn't noticed that this is v 3.8.x hahahahaha
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.