vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   separate images into a different hosts (https://vborg.vbsupport.ru/showthread.php?t=200820)

azsquall 01-05-2009 11:28 PM

separate images into a different hosts
 
HI guys
due to limited bandwidth, I had to to separate content and images into 2 different hosts as much as possible.
My first step is to make a separation of smilies, I noticed of table smilie from which I manipulated values of field smiliepath. I inserted several new smilies into the table manually, and using URL http://remote/host/of/images as values for smiliepath, instead of /images/smilies/...

Although, things seems to be working when I'm inside the WYSIWYG editor, i.e. the remote-hosted smilies were rendered correctly, they disappeared as long as I hit "submitted"
If i used the locally-hosted simlies (those with smiliepath = images/smilies/....), things work out okay.

can you please help?
PS: I've been looking around the source for specific function that does rendering the smilies with posts/threads with no luck

thanks!!!

Dismounted 01-06-2009 02:55 AM

My guess is that the smilies have absolute paths added to them (i.e. they prefix the value set as the Forum URL). The probable fix is that you will need to edit the code that handles parsing (class_bbcode.php).

azsquall 01-06-2009 04:49 AM

thanks!1
i actually had looked at that, but found nothing suspicious.
File class_bbcode.php, around line 560
Code:

// we have to get the smilies from the database
                        DEVDEBUG('querying for smilies');

                        $this->registry->smiliecache = array();

                        $smilies = $this->registry->db->query_read("
                                SELECT *, LENGTH(smilietext) AS smilielen
                                FROM " . TABLE_PREFIX . "smilie
                                ORDER BY smilielen DESC

From there i can see the code is extracting from the database all info about smilies.
Then
Code:

                while ($smilie = $this->registry->db->fetch_array($smilies))
                        {
                                if (!$do_html)
                                {
                                        $find = htmlspecialchars_uni(trim($smilie['smilietext']));
                                }
                                else
                                {
                                        $find = trim($smilie['smilietext']);
                                }

                                // if you change this HTML tag, make sure you change the smilie remover in code/php/html tag handlers!
                                if ($this->is_wysiwyg())
                                {
                                        $replace = "<img src=\"$smilie[smiliepath]\" border=\"0\" alt=\"\" title=\"" . htmlspecialchars_uni($smilie['title']) . "\" smilieid=\"$smilie[smilieid]\" class=\"inlineimg\" />";
                                }
                                else
                                {
                                        $replace = "<img src=\"$smilie[smiliepath]\" border=\"0\" alt=\"\" title=\"" . htmlspecialchars_uni($smilie['title']) . "\" class=\"inlineimg\" />";
                                }

                                $sc["$find"] = $replace;

                                $this->registry->smiliecache["$smilie[smilieid]"] = $smilie;
                        }
                }

                return $sc;
        }

Look like it does get the smilies' locations directly from database. Field [smiliepath] is filled up with URLs, such as http://image.domain.com/image1.gif

The smilie does show up in text-editor mode, but as long as I submit the post the smilie will be gone. and when I tried to edit that same post, the smilie was not there either.

any insight will be great!!!


All times are GMT. The time now is 11:12 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.01083 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
  • (2)bbcode_code_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