Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-15-2003, 01:36 PM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Ember's pet hack

I have made Embers pets in flash with a counter in it. When a day is passed the image changed in a dead pet and a member must click the 'feed me' button to restart the counter. But what i had completly overlooked was the fact that in the postbit these counters starts at zero over and over on each time you look or open the posting/reply. I hope that there is a way to use a flash counter or another method that let's the counter run to it's end no matter if a petowner post or reply's. Is this possible?

example flash: http://www.cyberty.nl/forum/images/pets/FishFemale.swf
Reply With Quote
  #2  
Old 03-15-2003, 02:41 PM
lynda's Avatar
lynda lynda is offline
 
Join Date: Nov 2001
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice idea.

It would seem to me that in order to do this properly, you'll need to pass a "last fed time" variable into flash and then when the user clicks feed me, update the database again with the "last fed time"

I don't know much about flash, but it seems to me it could be done easier with plain old php.

Just add a "last fed" timestamp in the user table and set everyone's to today's time (beause it will need to start with something)

Then if last fed was over X days ago (depending on what you want to set it for) display the dead pet image. If last fed was under X days ago, everything is okay.

I think instead of the pet being fed by clicking a button however, it should be based on when you last posted - in that case, you would not need to add anything to the database at all and could use the preexisting lastpost field (or lastvisit or lastactivity, depending on what you really want to do)

Then if your last post was over X days ago, it could display the dead graphic and if not, display the normal one.
Reply With Quote
  #3  
Old 03-15-2003, 02:57 PM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes it could be done with just php, but i'm not so good in writing such code for it.
The flash code that put's feed times into the database could be similar to the sorts of code that put scores into the db as in Futureal's flash arcade. But these are in this case not absolute values, they must decrease and later increase with use of a commandbutton or other action but that's level pro php/flash i guess. Maybe a cron job to render that section to zero after 24 hours.
Reply With Quote
  #4  
Old 03-15-2003, 05:31 PM
lynda's Avatar
lynda lynda is offline
 
Join Date: Nov 2001
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It would be easier to add a field in the user table for "last fed" than to use a counter inside of Flash. Again, I think flash pets could be really cool if they had any specific actions, but I think for this sort of hack, flash is complete overkill.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:03 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.06485 seconds
  • Memory Usage 2,183KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (4)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete