vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Mod Help (https://vborg.vbsupport.ru/showthread.php?t=206355)

pein87 02-23-2009 03:25 PM

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?

TigerC10 02-23-2009 03:47 PM

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?

pein87 02-23-2009 04:56 PM

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.

TigerC10 02-23-2009 05:03 PM

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...

pein87 02-23-2009 05:44 PM

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?

TigerC10 02-23-2009 06:00 PM

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.

pein87 02-23-2009 06:14 PM

I see thanks for your help mate

Dismounted 02-24-2009 04:35 AM

Quote:

Originally Posted by pein87 (Post 1752510)
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.


All times are GMT. The time now is 05:54 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.01852 seconds
  • Memory Usage 1,726KB
  • 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
  • (8)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