vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   New Posting Features - Cel Photo Popup - Insert pictures from vB Albums, Attachs, Photopost, vBGallery (https://vborg.vbsupport.ru/showthread.php?t=243865)

cellarius 03-03-2012 06:58 PM

This is most likely caused by the imageresizer Addon you are obviously using.

BWJ 03-04-2012 12:04 AM

Thanks for a nice mod. I have noticed a little problem:

Vbulletin version 4.1.11
Chrome and Firefox: seems to work perfectly
IE8: editor doesn't show up

lachgas 03-04-2012 08:28 AM

Thank `s Cellarius

ehpoole 03-09-2012 09:19 AM

Quote:

Originally Posted by cellarius (Post 2300047)
Thanks for your reports; I have corrected the two code bugs you reported. Regarding the server error, however, I have never witnessed this myself or had any reports on it. I really don't have an idea either what could cause this or what I could to to try to reproduce it...

I apologize for the delay in getting back to you, I've been meaning to find the time to write this up for the past several weeks and you know how that goes once you start putting something off!

Anyhow, a few days after my original post I was able to find some time to continue debugging the photo_popup.php code and was able to determine that the cause of our "500 Internal Server Error" was caused by -- and please forgive me for my bluntness -- very inappropriate use of Cookies to spare a simple SQL Query. Basically, photo_popup.php was attempting to define a nearly 12KB cookie (approx 100 albums or 4KB unserialized), which grossly exceeds the standard HTTP Header buffer in Apache (8KB) and is a major violation of both the Cookie Specifications as well as the spirit of what cookies were intended for.

Per the Cookie Specifications (RFC2965) a site is only guaranteed support for a maximum of 20 cookies. The absolute maximum size for any cookie is 4KB (including data, expiration, and cookie name). Most importantly the absolute maximum storage available for ALL cookies for a given site is 4KB (i.e. one could do a single cookie of 4KB or 20 cookies of 204 bytes, or some combination that remains within these limits). As you are no doubt aware, vBulletin and its various Addons define a number of cookies, the exact number of which will vary from site to site, so in designing Addon components we must play nice and be respectful of the other cookies. Just as importantly from a design standpoint should be the recognition that ALL COOKIES must be transmitted by the browser to the web server with EACH and every request (even in Keep-Alive sessions). Given that the act of retrieving a single vBulletin page can easily entail many dozens of hits (HTML, CSS, images, buttons, etc), that quickly adds up to a lot of wasted bandwidth if we push our cookies to anywhere near 4KB (50 hits multiplied by 4KB is 200KB of bandwidth consumed just in cookies alone!). This is why cookies were never meant to exceed a few dozen to a couple hundred bytes at the absolute maximum.

Add to this issue that Web Servers have absolute maximums set on their HTTP Header buffers (8KB in Apache and 16KB in IIS), more than adequate for acceptable headers, we must be all the more respectful of the Cookie Specifications. Web Browsers also have their own limits (and only promise to abide by the Cookie Specifications) and have very undefined behaviors once the total cookies exceeds 20 or the total bytes exceeds 4KB -- some browsers will stop sending cookies altogether, some will begin deleting cookies to free up space, and others still will only transmit the portion below 4KB whenever the threshold exceeds 20 cookies or 4KB!

Any how, the simplest interim fix is to change line 220 (in Cel_PP 4.1.004) from:
vbsetcookie('photo_popup_albums', $cache_cookie, FALSE);
to
vbsetcookie('photo_popup_albums', '', FALSE);
you can also comment out line 218 since serializing $cache_cookie becomes irrelevant if we are not sending the cookie (well, we are but we're clearing it). This interim fix will prevent the web server from choking on an out-of-spec cookie and allow otherwise normal and expected behavior on the site. It will also reduce wasted bandwidth since the cookie will no longer be retransmitted to the web server for each and every hit requested by the user's browser.

In fairness, if you are concerned with regard to the cost of the SQL Query (much of which I would expect to be Indexed any how) the more appropriate strategy would be to create your own caching table (e.g. cellpp_cache) on the SQL server to store the aggregated information for the user(s). The cost of not only setting a large cookie (and possibly blowing up the web server) and the constant retransmission of such large cookies by the browser (to the server) on each and every request is, IMHO, far more costly than any SQL query the cookie may have been intended to spare the server.

For what it's worth, as a developer you are in good company in making this oversight. Before my retirement I spent quite a few years as a freelancer fixing web applications and by far one of the most common issues was developer failure to consider the upper and lower limits of their variable/storage types -- especially with regard to languages, such as C and SQL, where variables are rigidly typecast. Your issue with the out-of-spec cookie is very much the same sort of issue.

I really hope I have not been too harsh, but I feel strongly that if you make the changes I have suggested and keep storage limits in mind with future implementations you will have a much more superior product.

Lest I forget, our recent issues aside, we are very grateful for your work in developing Cel_PhotoPopup as our users very much appreciate the ease with which it allows them to insert photos from their albums.

If you have any questions or concerns with regard to any of my comments, please feel free to ask.

PS - I would also mention the missing "My Photo" toolbar text in plugin.js due to an unregistered variable, but I believe you mentioned already addressing that issue in an earlier post.

Noerenberg 03-11-2012 09:28 PM

reading before posting.

everthing is fine.

thanks for th great mod

ChimeraRS 03-19-2012 05:22 PM

Quote:

Originally Posted by BWJ (Post 2305906)
Thanks for a nice mod. I have noticed a little problem:

Vbulletin version 4.1.11
Chrome and Firefox: seems to work perfectly
IE8: editor doesn't show up

Same problem here - any idea what might be causing it?

Front Range 4x4 05-16-2012 12:45 AM

Installed in 4.1.12 Patch Level 1, my members love it, thanks Cellarius!

Nominated

I have some attachments not showing up but can live with that for now. Benefits far outweigh this small issue.

trackpads 05-27-2012 11:54 PM

Again, thanks for the hard work on this!

Hostboard 06-02-2012 09:17 PM

Quote:

Originally Posted by Hostboard (Post 2300875)
I am getting a TMS error:

Code:

There are 1 Template-Modifications that were not designed for the currently installed vBulletin version. To make sure that vBulletin and your installed Products are working correctly, you must check and maybe modify those Template-Modifications.
It is stemming from editor_smiliebox

Quote:

Originally Posted by cellarius (Post 2301112)
Regarding the TMS error: That may be because I may still be using an older version of TMS on my dev board. You should be able to ignore that.

I actually took some time to look at this and it seems it is the text within the template editor_smiliebox that your searching for is incorrect.

The search for text should be:
Code:

<vb:if condition="$show['moresmilieslink']">
    <div class="moresmilies">[<a href="javascript://" onclick="vB_Editor['{vb:raw editorid}'].open_smilie_window(); return false" title="{vb:rawphrase showing_x_smilies_of_y_total, {vb:raw vboptions.smtotal}, {vb:raw totalsmilies}}">{vb:rawphrase more}</a>]</div>
</vb:if>

Once I corrected this, the text in the simile box appeared and is working as it was designed.

Front Range 4x4 06-28-2012 03:07 PM

Quote:

Originally Posted by Front Range 4x4 (Post 2329733)
Installed in 4.1.12 Patch Level 1, my members love it, thanks Cellarius!

Nominated

I have some attachments not showing up but can live with that for now. Benefits far outweigh this small issue.

Okay, the thumbnails not showing is a forum wide issue so it does bother me. Obviously it's not caused by this great mod but figured I'd ask if anyone knows a solution. Yes, rebuilding thumbnails works but requires rebuilding them all which starts at the beginning and it's the latest thumbnails that don't show up.

Does anyone have a better way to fix this?


All times are GMT. The time now is 03:41 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.02608 seconds
  • Memory Usage 1,761KB
  • 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
  • (2)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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