Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
  #1  
Old 02-23-2009, 03:25 PM
pein87's Avatar
pein87 pein87 is offline
 
Join Date: Sep 2008
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Mod Help

I`m planning to try a databaseless chat box where everything would be stored in a xml file. Some planned add ons are the ability to have private conversations in a pop up. My question is should I use php to write to the xml file or javascript? Also could I use vbulletins xml engine to add check boxes like you can in the admincp?
Reply With Quote
  #2  
Old 02-23-2009, 03:47 PM
TigerC10's Avatar
TigerC10 TigerC10 is offline
 
Join Date: Apr 2006
Location: Austin, TX
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You would definitly want PHP to write to the XML file, because you can do security checks. Javascript is entirely client-side, meaning anyone can reverse engineer it and get the info they need to write spam to your XML file without restriction (or worse, erase it).

Databaseless chat, huh? What's the aversion to the database?



Is this why you wanted that "security mod" with flock?
Reply With Quote
  #3  
Old 02-23-2009, 04:56 PM
pein87's Avatar
pein87 pein87 is offline
 
Join Date: Sep 2008
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Some what yes Well most chat boxes request info from the database and its server high. Why not use xml's storage abilities instead making it less server heavy. I would have to set it so its browser compatable with IE 5 and up. Basiclly make it so a script writes the info to the xml file which wil then be displayed where ever the templates variable is added. My ajax isnt the best but wit some work and time I`ll get this mod perfected. So whats your take on this would it be feesable to to make a chatbox that doesnt request info from a database? I was thinking about using a text file so all the css info would be there and I could load it with the mark up already in place.
Reply With Quote
  #4  
Old 02-23-2009, 05:03 PM
TigerC10's Avatar
TigerC10 TigerC10 is offline
 
Join Date: Apr 2006
Location: Austin, TX
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Fiesable? Yes. Practical? No.

It's not quite that server-intensive. Honestly, constantly writing to an XML file is more server intensive than database queries. Plus, you run into issues if people send write requests at the same time...
Reply With Quote
  #5  
Old 02-23-2009, 05:44 PM
pein87's Avatar
pein87 pein87 is offline
 
Join Date: Sep 2008
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I see I used CYB shoutbox but it constantly send xmlhttprequests even if no ones posting which can bulid server load if its always refreshing. Any way to fix it so it only sends a request/data if the user hits enter or presses the submit button?
Reply With Quote
  #6  
Old 02-23-2009, 06:00 PM
TigerC10's Avatar
TigerC10 TigerC10 is offline
 
Join Date: Apr 2006
Location: Austin, TX
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I never used a shoutbox, but I imagine that shoutboxes send those requests because every page has it on there, maybe even if it's hidden.

I think that you should write a javascript chatbox and put it on only one page - this will keep the requests down to whoever's actually chatting. The javascript will keep your load off the PHP engine.
Reply With Quote
  #7  
Old 02-23-2009, 06:14 PM
pein87's Avatar
pein87 pein87 is offline
 
Join Date: Sep 2008
Posts: 352
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I see thanks for your help mate
Reply With Quote
  #8  
Old 02-24-2009, 04:35 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by pein87 View Post
I see I used CYB shoutbox but it constantly send xmlhttprequests even if no ones posting which can bulid server load if its always refreshing. Any way to fix it so it only sends a request/data if the user hits enter or presses the submit button?
That requires a constant open connection from client -> server. Once the page has finished loading - that's it from a traditional HTTP point of view (the connection is then closed). AJAX "expands" this by allowing JS to send requests to the server, after the page has loaded.

Shoutboxes in this sense need to continuously poll the server to check for new messages.
Reply With Quote
Reply

Thread Tools
Display Modes

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 07:03 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04660 seconds
  • Memory Usage 2,226KB
  • Queries Executed 13 (?)
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)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)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_postinfo_query
  • fetch_postinfo
  • 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