vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   no more data posts within 30 second. how to do that (https://vborg.vbsupport.ru/showthread.php?t=278565)

Oracle simsim 02-14-2012 02:51 PM

no more data posts within 30 second. how to do that
 
Hello

I have made a mini plugin that enable my members to choose their mood directly from the a button in the header. when that button pressed the following happen:

1- a prompt box will be shown asking the member about his mood
2- if member write something, an ajax post request will be sent to the server.
3 using a plugin in misc.php, the request will be validated and processed then update the associated userfiled.

I want to prevent members to change their moods frequently . I mean if any member request to change his/her mood. it will not be allowed to change it again within 30 second or less or more.

how vbulletin prevent the user from writing another post with 30 second ? same idea

forgive my weak English and bad title. Any small information will be helpful.

kh99 02-14-2012 02:58 PM

When a user posts, the lastpost time is saved in the user table. When the user posts again, the lastpost time is subtracted from the current time and compared with the setting.

Oracle simsim 02-14-2012 03:15 PM

Quote:

Originally Posted by kh99 (Post 2299615)
When a user posts, the lastpost time is saved in the user table. When the user posts again, the lastpost time is subtracted from the current time and compared with the setting.


aha .. that's mean I need to save the current timestamp along with mood data then query that value before validating the request. I thought there is a function or global value that I can check against.

thanks


All times are GMT. The time now is 06:52 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.00979 seconds
  • Memory Usage 1,712KB
  • 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)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete