The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
I was presented an idea and have been racking my brain trying to figure out how to pull it off.
I need to find a way to have Automated Thread Prefixes for a specific forum, according to thread views. For instance, if a particular thread reaches 100 views... Then the thread prefix automatically becomes "Title 1"; then if it reaches 500 views it becomes "Title 2". Any ideas? |
|
#2
|
||||
|
||||
|
Create a new plugin hooked at "cron_script_cleanup_hourly" with the following code:
PHP Code:
PHP Code:
In the lines: PHP Code:
Note: I haven't tested this, but it is based on a plugin from one of my products I use at MHB. Please let me know if you have any issues with it.
|
| Благодарность от: | ||
| TheLastSuperman | ||
|
#3
|
|||
|
|||
|
Quote:
|
| Благодарность от: | ||
| TheLastSuperman | ||
|
#4
|
||||
|
||||
|
You could also do it a completely different way (in real time) by having some code on a reply hook that checks the reply count and updates the prefix as required.
|
| Благодарность от: | ||
| TheLastSuperman | ||
|
#5
|
||||
|
||||
|
Quote:
|
|
#6
|
||||
|
||||
|
Views ? oh, I didnt notice that. Strange thing to base it on, very easily abused.
Still, yeah, same thing, different hook. |
|
#7
|
|||
|
|||
|
Good point, how would I change it to replies instead of views?
|
|
#8
|
||||
|
||||
|
If you are using my cron-based approach, then change all instances of $v_thread['views'] to $v_thread['replycount'].
|
|
#9
|
|||
|
|||
|
Quote:
--------------- Added [DATE]1474160516[/DATE] at [TIME]1474160516[/TIME] --------------- Quote:
--------------- Added [DATE]1474160680[/DATE] at [TIME]1474160680[/TIME] --------------- PHP Code:
|
|
#10
|
||||
|
||||
|
Did you manually run the cron job, or wait for it to run?
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|