vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Mini Mods - [DBTech] User Spotlight v1 (vB3) (https://vborg.vbsupport.ru/showthread.php?t=254536)

DragonByte Tech 03-24-2011 03:47 AM

1 Attachment(s)
Quote:

Originally Posted by SamirDarji (Post 2176844)
Yep, just the random username of someone who was active within the week or month that the query is run in. I'm planning to make it into a cron job and just email me or somehow otherwise send me the name.

I want to use this to reward users for being online and logged in. I have a large number of users that visit my site, but don't log in.

Thank you so very much!

Ah okay, easy enough. Just put this file into your includes/cron folder and create a scheduled task for it. It will send you an email with a random username for a user that's logged in the past week and one for the past month. Change the $to_email variable inside the file as well.

Dylan

SamirDarji 03-24-2011 04:26 AM

Quote:

Originally Posted by DragonByte Tech (Post 2176862)
Ah okay, easy enough. Just put this file into your includes/cron folder and create a scheduled task for it. It will send you an email with a random username for a user that's logged in the past week and one for the past month. Change the $to_email variable inside the file as well.

Dylan

OMG!!! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you!

Even though I'm not using the mod in this thread, I'm marking it as installed and nominating it for MOTM. :) It's the least I can do. :)

Should I schedule the cron for every day, or just every week/month?

DragonByte Tech 03-24-2011 05:02 AM

Quote:

Originally Posted by SamirDarji (Post 2176870)
OMG!!! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you!

Even though I'm not using the mod in this thread, I'm marking it as installed and nominating it for MOTM. :) It's the least I can do. :)

Should I schedule the cron for every day, or just every week/month?

For whenever you want. If you want an email weekly then just set it to run every week.

Dylan

SamirDarji 03-24-2011 06:20 AM

Awesome! Thank you very much. I've run it a few times manually to see how it worked. Really sweet. :)

I was looking at the code and I noticed it's using 30 days for the month, which generally works, but I wanted to see if there was a way to get it to be precisely the number of days in a month. I found the date('t') function on php.net that seems like it will return the number of days in the current month which could be used to calculate the exact number of seconds in that month.

The only problem is that vb's cron doesn't have a setting to run at the end of the month. :( A quick google search came up with some exotic cron lines that I'm not familar with nor know how to implement. So the other option would be to execute the script in two different crons in vb, once for the end of the week, once for the first of the month, and if the script detects that it's running at the first of the month that's not the end of the week, subtract a day and then calculate the month via that time and determine the random user.

But the more I think about this, since the week or month would be executed separately in two different crons, maybe the script should just be croned to run daily and do its own end of week and end of month detection and execute accordingly. Then the cron variable is taken out of the picture.

So the whole body of the script could be two if statements. If today is last day of month, execute for last day of month and email. If today is last day of the week, excute for end of the week and email. If it doesn't fall into either loop, the cron will execute with no output. But looking at the structure of your cron, it's designed to execute both queries back to back from an array, so the main loop would change. Would it be too much to ask for this design change?

I've figured out that
Code:

if(date('j') == date('t'))
can be used to check eom and
Code:

if(date('N') == 7)
should be able to be used to check eow. But this research has taken me over an hour. :(

tommydamic68 04-02-2011 09:57 AM

I have a problem as well, the user never changes.:mad:

here is my log:
16544 Dragonbyte-Tech: Spotlight - Pick Random User 07:04, 2nd Apr 2011 Not time to update spotlight userid yet
16375 Dragonbyte-Tech: Spotlight - Pick Random User 01:06, 1st Apr 2011 Not time to update spotlight userid yet
16368 Dragonbyte-Tech: Spotlight - Pick Random User 00:01, 1st Apr 2011 Not time to update spotlight userid yet
16361 Dragonbyte-Tech: Spotlight - Pick Random User 23:00, 31st Mar 2011 Not time to update spotlight userid yet
16354 Dragonbyte-Tech: Spotlight - Pick Random User 22:01, 31st Mar 2011 Not time to update spotlight userid yet
16347 Dragonbyte-Tech: Spotlight - Pick Random User 21:01, 31st Mar 2011 Not time to update spotlight userid yet
16340 Dragonbyte-Tech: Spotlight - Pick Random User 20:01, 31st Mar 2011 Not time to update spotlight userid yet
16337 Dragonbyte-Tech: Spotlight - Pick Random User 19:45, 31st Mar 2011 Not time to update spotlight userid yet
16332 Dragonbyte-Tech: Spotlight - Pick Random User 19:05, 31st Mar 2011 Not time to update spotlight userid yet
16325 Dragonbyte-Tech: Spotlight - Pick Random User 18:01, 31st Mar 2011 Not time to update spotlight userid yet
16318 Dragonbyte-Tech: Spotlight - Pick Random User 17:00, 31st Mar 2011 Not time to update spotlight userid yet
16311 Dragonbyte-Tech: Spotlight - Pick Random User 16:00, 31st Mar 2011 Not time to update spotlight userid yet
16304 Dragonbyte-Tech: Spotlight - Pick Random User 15:00, 31st Mar 2011 Not time to update spotlight userid yet
16297 Dragonbyte-Tech: Spotlight - Pick Random User 14:00, 31st Mar 2011 Not time to update spotlight userid yet
16290 Dragonbyte-Tech: Spotlight - Pick Random User 13:02, 31st Mar 2011 Not time to update spotlight userid yet

DragonByte Tech 04-04-2011 09:05 AM

Quote:

Originally Posted by tommydamic68 (Post 2180061)
I have a problem as well, the user never changes.:mad:

How often is it set to update and when was the last time it was updated?
If you want to force it to start over login to the ACP and go to the settings area. On the spotlight settings set the Spotlight Next Cron Run field to 1. It will start with a new user that fits the criteria next time it checks to run.

ShawneyJ 08-25-2011 12:22 AM

i have a problem where, when you click on the next page number it dont work the first click. ie: your on page "1" when you click page "2" in a thread or forum, i had to click on page number twice for the the page to display. this also effected usernames, click on a username and the URL in browser would change, but the page stays the same until you clicked twice. i disabled my hacks 1 by 1 and finally after disabling "this mod" my forum is back to normal, as in, you only have to click on a username or next page once now for it to direct rather than 2 times. hope this makes sense.
cheers.
testing on 3.8.4.

DragonByte Tech 08-25-2011 06:43 AM

Quote:

Originally Posted by jaycob (Post 2237659)
i have a problem where, when you click on the next page number it dont work the first click. ie: your on page "1" when you click page "2" in a thread or forum, i had to click on page number twice for the the page to display. this also effected usernames, click on a username and the URL in browser would change, but the page stays the same until you clicked twice. i disabled my hacks 1 by 1 and finally after disabling "this mod" my forum is back to normal, as in, you only have to click on a username or next page once now for it to direct rather than 2 times. hope this makes sense.
cheers.
testing on 3.8.4.

Do you mean it's doing this when viewing a thread? The mod should only be showing and affecting anything on the forum homepage.

Dylan

ShawneyJ 08-26-2011 01:30 AM

Quote:

Originally Posted by DragonByte Tech (Post 2237786)
Do you mean it's doing this when viewing a thread? The mod should only be showing and affecting anything on the forum homepage.

Dylan

hi mate,

i actually changed DBTech: Spotlight - Show Random User to "global_start" to show on all pages and put the code in my sidebar. maybe thats where i went wrong.
sorry for not explaining fully.

DragonByte Tech 08-26-2011 04:51 PM

Quote:

Originally Posted by jaycob (Post 2238157)
hi mate,

i actually changed DBTech: Spotlight - Show Random User to "global_start" to show on all pages and put the code in my sidebar. maybe thats where i went wrong.
sorry for not explaining fully.

Yes, it was only designed to run on the forum home for vB3. Changing the hook probably make it act like it is.

Goomzee 04-03-2012 11:38 AM

could i show user spotlight on my home page?

CoffeeLovesYou 04-04-2012 07:55 PM

Does this work with vBAdvanced?

Goomzee 04-05-2012 04:40 AM

Quote:

Originally Posted by Goomzee (Post 2316330)
could i show user spotlight on my home page?

Quote:

Originally Posted by CoffeeLovesYou (Post 2316799)
Does this work with vBAdvanced?


i also want to know this?

DragonByte Tech 04-05-2012 07:45 AM

Quote:

Originally Posted by Goomzee (Post 2316330)
could i show user spotlight on my home page?

Quote:

Originally Posted by CoffeeLovesYou (Post 2316799)
Does this work with vBAdvanced?

Sorry, it's only a forumhome mod currently. We'll probably expand it to a CMS widget and add it to vBAdvanced next version, that's not scheduled to be worked on at the moment though.

Dylan

aciurczak 01-19-2013 03:39 PM

I have a question about two parameters in the control panel: Minimum Days, Minimum Days since Last Post

It seems that these are actually behaving as a Maximum, not a Minimum, right? I had 14 in there for both (default), and it chose a user that has logged in today and posted yesterday. If it were going by minimum 14 days, it would have chosen a user that has *not* logged in, in at least 14 days, right?

DragonByte Tech 02-13-2013 07:31 AM

Quote:

Originally Posted by aciurczak (Post 2397936)
I have a question about two parameters in the control panel: Minimum Days, Minimum Days since Last Post

It seems that these are actually behaving as a Maximum, not a Minimum, right? I had 14 in there for both (default), and it chose a user that has logged in today and posted yesterday. If it were going by minimum 14 days, it would have chosen a user that has *not* logged in, in at least 14 days, right?

Correct, sorry, I'll change the wording on that. It is the maximum time since a user has logged in/posted. So if you set them to 14, then it will only show users who have logged in or posted in the last 14 days.

Dylan

DragonByte Tech 04-05-2013 11:33 PM

Updated to v1.6.6

Feature: Can now specify userid's not selectable
Fix: Phrased all cron and vbsetting text


All times are GMT. The time now is 01:34 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01265 seconds
  • Memory Usage 1,793KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (17)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete