vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   birthday hack idea, what do you think (https://vborg.vbsupport.ru/showthread.php?t=20231)

Mas*Mind 06-14-2001 01:22 PM

I'm thinking of creating a hack so that if a user has his birthday then a 'balloon' (template customizable ofcourse) or something will be shown next to his name within a thread.

What do you think of it? Usefull?

kicks 06-14-2001 02:11 PM

I think it would be pretty cool :)

It'll make the user feel important, I'd definately install it :D

One thing you can do is also link it to a pm for that user so that people can click on it and send them a "happy birthday" pm

Freddie Bingham 06-14-2001 02:38 PM

I did this on 1.1.x and it was rather popular with my forum members.

Steve Machol 06-14-2001 03:14 PM

This is a great idea and would really help buid community spirit. :cool:

-dloh-hammer 06-14-2001 09:42 PM

is it possible to send an email automatic to users have birthday?

Mas*Mind 06-14-2001 10:02 PM

with cron that is yeah.

I'm thinking of a way of implementing a simulated cron, which could be built in in vb without extern programs. This wouldn't be very difficult, only it'll depends on wether your board gets visited daily if it gets executed.

The second drawback is, that one user (per day) will experience the extra load of it.

chrispadfield 06-15-2001 12:35 AM

i have been thinking about this simulated cron thing as well. There are a number of small things i wanted done on a daily/hourly basis and it would be nice if i could put them all in a script called daily.php that got excuted, well daily :)

But not sure the best way to do it. What you need is somewhere a date value and then use one php page to get the data value and compare it to CURDATE() and if 1 day apart than include daily.php

Now, it would be easy just to have another query to check the date but that is quite inefficient. If it was a setting then every page would use it. I thought one way would be to add the extra query to register.php and perform the check on the date there. Register.php is a reasonable choice because i know it gets accessed every day but not that often and it also does not have many queries on it already. For those with less traffic i would think search.php would be good (low queries) or maybe usercp.php but that is a higher amount.

Dakota 06-15-2001 02:58 AM

I think that would be a really cool hack. I know that if you made it, I would use it.:D

Mas*Mind 06-15-2001 06:33 AM

the way I though of it was:

make an extra table cronjobs

with the following fields:

ID, (the unique ID)
includeFile, (the file to be included, containing the necesary functions)
lastExecuted, (timestamp on which the cron was last executed to determine if it should be executed or not.)
busy (a flag to set it on busy to ensure no 2 users will execute the same job concurrently)

then in global.php add an extra query:

select * from cronjobs where (lastExecuted - unix_timestamp()) > 24*60*60

then loop through each cronjob, set busy to 1 and include includeFile. when finished the includeFile should set lastExecuted to the current timestamp.:

while($DB_site->fetch_array($results))
{$DB_site->query("UPDATE cronjobs SET busy = 1 where ID = $result[ID]";
include($results[includeFile]);
}

drawbacks:

-an extra query (on every page)
-it's not ensured that the semi-cronjob is executed (allthough highly likely: the more visitors a day, the more likely)
-one visitor a day should experience the extra load of including the include file

but I agree with you: it may be sufficient to only in clude the croncheck on ONE particular page instead of every page so that the extra query isn't included in every page...

possible pages to perform the check:

-usercp
-register
-search
-pm

The thing I like about this is that you can make it kinda modular. You can built in a cp-function to insert/edit/maintain a new semi-cronjob and it'll work immediately. People can create their own cronjobs and share them amongst people. No code of vb would be touched.

chrispadfield 06-15-2001 08:11 AM

that is a great idea - some thoughts.

1. There is a slight problem of a cron job timing out (unlikely) or more possible someone closing their browser or whatever in the middle of the cron job. Some sort of backup mechanism if the cron job is set to busy all the time as if this happened it would never get out of the busy status.

2. Possibility of having cron jobs only set off by a certain usergroup. It might be that we want to do quite a long cron job, for example the community bulletin. If this was the case, doing something like having a page come up

"Doing important server maintenace, please do not close this browser" sort of thing. So long you explained this to your moderators it would work. I know for certain that at least 1 of my moderators is going to visit the site every day.


All times are GMT. The time now is 08:13 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
  • Page Generation 0.01049 seconds
  • Memory Usage 1,735KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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