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)
-   -   Board Optimization - United-Forum CSS Sprites - ludicrous speed - NOW! (https://vborg.vbsupport.ru/showthread.php?t=266696)

Osbes 07-11-2011 10:00 PM

United-Forum CSS Sprites - ludicrous speed - NOW!
 
1 Attachment(s)
tl;dr Makes your forum faster.

Want an easy one-click installation for this addon? . Vote for this jira-entry

Add on currently is in beta stage

When visiting a website, speed is a very important factor not only for users but crawlers as well. Long loading times are a nuisance since your time is basically wasted during the waiting period. Hence, we are trying everything we can in order to speed up our site. One great way to improve loading times is by the use of css sprites. Unfortunately these are not implemented by vBulletin.

We therefore decided to develop our own css-sprite add on for vBulletin boards and want to share this code with the worldwide vBulletin community.

Live demo
The add on is permanently running in our vBulletin board ( > 2.000.000 posts), take a look:
http://www.united-forum.de

The add on will be supported via this thread. If you have any questions, issues, improvements or feedback regarding this add on, please feel free to post a comment or write us a pm at any time. We are happy to discuss :)

vBulletin performance using css sprites
Our tests are based on version 0.7.0. We used the analytic tools firebug network utility and the googlelabs.com page speed site

on the client side the following parameter were used:
download speed: 5.7 MBit/s
ping: 31ms

https://vborg.vbsupport.ru/external/2011/10/15.png

https://vborg.vbsupport.ru/external/2011/10/16.png
css sprites - what are they?
The intention behind css sprites is the bundling of many small graphics into one large graphic in order to decrease the number of required http requests. This shortens the loading times of the given website. In addition, the the accumulated size of all small graphics is higher than the size of the sprite due to reasons of compression.
You can find further information in a great article by Chris Coyier.
What is the gain in using css sprites?
Aside from the technical implementation, the question on how much one actually does gain by using css sprites is of the most interest. Obviously they decrease loading times - but how important are small loading times and what is the impact on vBulletin overall loading times?

A short time ago, Jasper Aguila pointed out that speed is one crucial stickiness factor in his blog on vBulletin.com.
Quote:

Originally Posted by Jasper Aguila vBulletin Support
The internet has unfortunately contributed to the exponential decrease in attention span for many individuals. That's why this decade is seeing a trend in emerging technologies emphasizing the importance of speed request. It's crucial for your content to be promptly distributed in a timely manner, else bounce rate will increase - making you lose returning visitors. It's also important to note that slow sites may be penalized by search engines.

With better browsers, more powerful processors, and improved technologies constantly releasing each year, it's becoming quite difficult to provide excuses for slow loading pages. Therefore, try optimizing your server for speed. Read up and learn optimization techniques at vBulletin.com's Server Configuration forum.

In addition, the google ranking is influenced by the site speed as well.

Google Webmaster Central Blog
Quote:

Originally Posted by 09.04.2010 - Google Webmaster Central Blog
You may have heard that here at Google we're obsessed with speed, in our products and on the web. As part of that effort, today we're including a new signal in our search ranking algorithms: site speed. Site speed reflects how quickly a website responds to web requests.

vBseo Webmaster Mert G?k?eimam
Quote:

CSS sprites is a huge bonus for big boards , any big board owner definately should use it.
Last but not least, not only the user's loading time is reduced, but also does the server load decrease as the server will have to handle a lot less of http requests. This clears available connections and cpu time.
Add on features
In the current released beta version 0.7.2, sprites are available for FORUMHOME and FORUMDISPLAY. Coming up next SHOWTHREAD.

Sprites are created style based for all forum styles and saved in a folder which you can set via the imgdir_sprite stylevar. You have one additional button in the ACP (CSS-Sprites -> Refresh) which automatically creates all sprites, the according css definitions and includes those css definitions in the vBulletin css rollup files.
Installation

First of all, if you didnt want to change the templates manually, install the Template Modification System (TMS). Now proceed with the installation:
  • upload the contents of the upload folder into your forum home directory.
  • import the add on in the ACP
  • upon installation a new stylevar imgdir_sprite will be created. Update this stylevar based on your file structure - default value is the vbulletin sprite directory. Make sure the folder is writable, else the sprites can't be saved!
  • create the sprites via the ACP at CSS-Sprite using the Refresh option.
  • If you have installed TMS, you are done now. This was an easy gained speed up, not? If you didnt installed TMS and didnt want to do it, proceed with the next point:
  • in order to use the sprites, you then will have to edit some templates. The diffs (xou will find it in the do_not_upload folder show which parts you have to delete '<' and which parts to add '>' In addition, on top find the lines in which you will find the respective code.[/b]

Osbes 07-12-2011 09:51 PM

Frequently Asked Questions

Question
My Icon (mostly the paperclip) looks like http://dl.dropbox.com/u/246391/Robin_result.png (it is stretched and vertical lines are added), what can i do?
Answer
I assume you use a GD Libary older than 2.0.36.

GD had a problem handling grayscale images with alpha channel correctly, which was fixed with GD 2.0.36 in the year 2007.

The solution is to update the GD-Libary to 2.0.36 (or later) or replace every file which uses "gray+alpha" with an version using "color RGBA".
I would advise to update the GD-Libary, cause there is also a serious security problem, that was fixed by Debian in the year 2009.

For the embed Version of GD within PHP, this issue is fixed since PHP 5.3.0.
Question
Does this addon works with CDNs?
Answer
Yes. This addon has one side support for CDNs. One side meaning we can't write the sprite on your external server (and never can). But it doesn't has any problems reading the icons out of your CDN and writing it to a local filepath where your CDN sync function can distribute it to your CDN.
Question
How to add custom icons into the sprite?
Answer
The addon has the option to include custom icons. Be warned it's meant for advanced users (and style designers). An explanation can be found here:
https://vborg.vbsupport.ru/showp...&postcount=177
Question
I am using an Add-On for changing the forum icons (like www.vbulletin.org/forum/showthread.php?t=244351). When using CSS Sprites, my forum icons are reverted to the original state.
Answer
The feature to use forums custom icons is builtin in vBulletin 4. You can add to every forum an own imageprefix, so it will use forums custom icons. If you use the vBulletin imageprefix for your your forums, these icons will instantly added to the sprite.

An explanaition to this can be found in the vBulletin Manual (under Prefix for Forum Status Images):
https://www.vbulletin.com/docs/html/...orum_add_forum
Question
Google pagespeed still tells me that i should combine icons into sprites.
Answer
Despite covering hundreds of icons our addon can't cover everything. Especially gradients can't be automatically replaced since they differ a lot in custom styles. But, we do offer a hook so you can add your own icons into the sprite, based on the needs your board has.
A longer answer why we can't include gradients and all custom icons can be found here
https://vborg.vbsupport.ru/showp...2&postcount=49

To add the missing Icons yourself, please read: How to add custom icons into the sprite?
Question
Double background issue/ search icon dissapears
Answer
Some custom styles do include their own background, for example behind the search icon.
Since sprites replace the icons with the sprite background this gets in the way.
Solution: Modify your search icon to include both background and icon and refresh the sprite.

Osbes 07-12-2011 09:51 PM

Version 0.7.2 (06.08.2011)
  • now supporting folders for forum prefixes
  • sprite generation splittet to avoid timeouts on sites which a huge number of styles
  • checks if the gd version is 2.0.36 or higher (experimental)
Version 0.7.1 (01.08.2011)
  • added support for search.php pages including What's New
  • some minor bugfixes
Version 0.7.0 (01.08.2011)
  • full support for ltr/rtl
  • forum sidebar support added
  • FORUMDISPLAY support added
Version 0.6.3 (23.07.2011)
  • Added the possibility to use TMS for automatic template modification.
  • Icons can now be merged into different sprites and css rollups instead of one big sprite.
  • Addon is now compatible with vBulletin 4.1.x
Version 0.6.2 (17.07.2011)
  • Added support for http filepaths and therefore one-way support for CDNs
  • Templates are now using the cache system
  • clientscript/sprite_vbulletin_collapse.js removed.
Version 0.6.1 (17.07.2011)
  • bug-fix: using alternative paths for post icons could cause that these are not includes in the sprite.
Version 0.6.0 (17.07.2011)
  • possibility to add custom icons into the sprite via plugin-hook sprite_add_icon
  • added log output during sprite generation in the acp
  • option to deactivate using post icons in your sprite (default should be on)
Version 0.5.1 (12.07.2011)
  • Added support php versions < 5.3.0. Addon now just requires php5 due to TypeHinting
Version 0.5.0 (12.07.2011)
  • Add-On release
  • FORUMHOME css-sprite support

Jeff Ledger 07-12-2011 10:20 PM

Let's say

The goal is good but it's hard for other forums using different styles than yours use it.

Sprite require the css must be 100% exactly, and if someone use custom icons they will need to make a different sprite also the css.

It takes even more time than the usually way to reedit sprite and css.

I prefer doing sprite css for every single style, means custom css and custom sprite png. This is more effective and useful than a product like that.

Btw nice mod. Keep up the good work

Jeff

Mooff 07-12-2011 10:31 PM

The goal of our Add on is to solve that problem. The Add on creates a different sprite for each style based on the used icons, their dimension (hight width) and vbulletin stylevars.

We are using 9 different styles (not counting our mobile styles) and it works without problems in all of them. Without additional refinement.

The intention is to create an addon where the board admin doesn't have to know anything about html or css and still can use sprites.

Hornstar 07-13-2011 09:40 AM

Quote:

Originally Posted by Mooff (Post 2219806)
The goal of our Add on is to solve that problem. The Add on creates a different sprite for each style based on the used icons, their dimension (hight width) and vbulletin stylevars.

We are using 9 different styles (not counting our mobile styles) and it works without problems in all of them. Without additional refinement.


The intention is to create an addon where the board admin doesn't have to know anything about html or css and still can use sprites.

Awesome! Can't wait to test this then.

Thanks.

Jeff Ledger 07-13-2011 10:13 AM

Quote:

The goal of our Add on is to solve that problem. The Add on creates a different sprite for each style based on the used icons, their dimension (hight width) and vbulletin stylevars.

We are using 9 different styles (not counting our mobile styles) and it works without problems in all of them. Without additional refinement.


The intention is to create an addon where the board admin doesn't have to know anything about html or css and still can use sprites.
Sounds promising, will test it and give you feedbacks.

Jeff

final kaoss 07-14-2011 02:39 AM

Yeah it sounds like it has some potential

Barbaro 07-14-2011 03:41 PM

guau 4.1.4?

gracias

Mooff 07-14-2011 04:51 PM

I guess you want to know whether it does work with 4.1.4? ;)

We can't test it for ourselfs, since we are going to jump 4.1.4 and update with the release of 4.1.5.
BUT on the german ( www.vbulletin-germany.org ) modding site we received feedback that this addon does work well with 4.1.4


Regards Mooff

Barbaro 07-14-2011 07:06 PM

Exactly, it hurts, I will be pending for 4.1.5.

Good mod, thanks

regards

cherylferraro 07-15-2011 04:08 AM

Not working for me but I think this will be fantastic when it's fully functional. Thank you for working on it :)

Mooff 07-15-2011 07:00 AM

While posing a bug report please include
- vBulletin Version
- full bug description (what, where, whether you did the template edits ...)
(if possible link to your site where the addon is active)

so we can fix whatever the problem is. :)

cherylferraro 07-15-2011 04:23 PM

VB version 4.1.4 patch 1

Bug description: Uploaded the files and did the template edits on a test style. Set 777 permissions on sprite folder and refreshed CSS-Sprites via admincp. No sprites were generated, or if they were they were not added to the images/sprites folder. I can't find the sprites. I guess it goes without saying that the status icons were not displayed on forumhome.

I tried uninstalling and then reinstalling. It still didn't work.

Thanks again for your work on this mod. It will be a great addition to vb.

Osbes 07-15-2011 04:53 PM

Are you using the PHP GD Libary? This addon currently doens't support ImageMagick.
Which Version of the PHP GD Libary is installed?

If you are currently not using the PHP GD Libary or it is older than GD2, please install/update GD and try it agein.

If you are using GD2, please send me via PN the output of
PHP Code:

<?php
phpinfo
();

and the output after refreshing the css-sprites via admincp.

If possible, please check your php error-logs if if some errors related to the sprite.php occurred.




Big Big Thanks for the nice feedback :)

cherylferraro 07-16-2011 04:56 PM

Thank you for your prompt response. Based upon the info you provided I was able to get the sprite generation issue sorted out. The sprite has been generated and now resides in the images/sprites directory.

On to the next issue. I made the template edits in a test style but the status icons do not display on forumhome. The test style is user selectable (testing sprites) if you would like to take a look to see if you can determine what I've done to break your very useful mod :)

The link is: http://www.browncafe.com/forum/

I just took a look at the sprite-css templates and they are all empty. Is that working as intended or was I supposed to put some css in there myself?

Osbes 07-16-2011 05:47 PM

Hi, thanks for your feedback, i just wanted you to ask, whether the sprite-main.css Template is empty or not, since http://www.browncafe.com/forum/clien...prite-main.css was empty.

The templates should be filled automatically after the sprite is generated. I suggest, that the problem is somehow related to your first issue.

What was your solution for this?

Can you insert some debug messages to see, whether the templates are filled or not?

PHP Code:

                    if(empty($template))
                    {
                        
$vB_Database->query_write('
                            INSERT INTO
                                `' 
TABLE_PREFIX 'template`
                            SET
                                title =       "sprite-main.css",
                                styleid =     ' 
$vB_Database->sql_prepare($style['styleid']) . ',
                                template =    ' 
$vB_Database->sql_prepare(compile_template($cssrule)) . ',
                                template_un = ' 
$vB_Database->sql_prepare($cssrule) . ',
                                dateline =    ' 
TIMENOW ',
                                username =    "unitedforum",
                                version =     ' 
$vB_Database->sql_prepare('0.5.0') . ',
                                product =     "sprite",
                                mergestatus = "none"
                        '
);

var_dump("INSERT");
                    }
                    else
                    {
                        
$vB_Database->query_write('
                            UPDATE
                                `' 
TABLE_PREFIX 'template`
                            SET
                                version =     ' 
$vB_Database->sql_prepare('0.5.0') . ',
                                template =    ' 
$vB_Database->sql_prepare(compile_template($cssrule)) . ',
                                template_un = ' 
$vB_Database->sql_prepare($cssrule) . ',
                                dateline =    ' 
TIMENOW '
                            WHERE
                                templateid =  ' 
$vB_Database->sql_prepare($template['templateid']) . '
                        '
);

var_dump("UPDATE");
                    } 

I suggest, that the script dies after

PHP Code:

                    imagepng($spriteDIR '/' $sprite_filepath);
                    
imagedestroy($sprite); 

Which is just before the SQL-Statements. Thats why i think, that it is related to your first issue.

cherylferraro 07-16-2011 08:05 PM

The sprite was generated after I enabled GD to be the image processor.

I am unsure where to put the text for the debug messages you provided so I made a wild guess and pasted that text onto the end of sprite.php. Is that where it is supposed to go?

After refreshing CSS-Sprites via admin panel the sprite-main.css and all of the other css sprite templates are still empty.

Osbes 07-16-2011 11:14 PM

The debug messages are for us to identify your problem. Please send them to me via private message.

I am currently putting the final touch on the next version. Aside performance improvements it will include addtional log output in the acp visible each time the sprites are refreshed. These messages should be helpful to identify and solve problems like yours.

Once you have the new version installed please copy everything which shows up and also send it to me via private message.

Mooff 07-16-2011 11:25 PM

0.6.0 is now live! (changelog will be translated tomorrow, it's 2:30am in germany right now ;) )


Since most of you are still hesitant about the addon i want to give you some numbers:

Without the addon we had ~55* http requests on FORUMHOME. Now we are left with 17. That's a difference of 38 http requests per click.
Let's say you have a small board with 500 pageimpressions on FORUMHOME each day. Makes 19000 http requests you save a day. 570000 requests a month!
Now imagine a big board with 50000 pageimpressions. 57 million saved http requests each month.

Believe me,
your users want you to use css sprites.
your server wants you to use them.
and google wants you to use them.


Sidenote: With the new version we included the member profile popupmenu. Which means not only FORUMHOME is affected now but you save up to 7 http requests on almost every page of your forum - yikes.


*number does vary with number of threads using a threadicon. Threads in our board usually do not have one, so on other boards this number might easily be a lot higher.

Osbes 07-17-2011 09:25 PM

Version 0.6.2 released.
  • Added support for http filepaths and therefore one-way support for CDNs
  • Templates are now using the cache system

cherylferraro, your problem should be solved in 0.6.2.

final kaoss 07-17-2011 09:38 PM

Now if you can automate the template changes, alot more people would be interested. Thanks.

Osbes 07-17-2011 09:45 PM

Andreas has added the corresponding XML-File for the Template Modification System.
http://www.vbulletin-germany.org/sho...5100#post75100

Beside the use of the TMS, i didnt know another way, cause you actually need to replace these lines.

final kaoss 07-17-2011 10:30 PM

ok. Do you mind putting up the template changes in codeboxes again? This is nearly unreadable..

Code:

Template: FORUMHOME
72d72
<    <h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/users_online.png" alt="{vb:rawphrase currently_active_users}" />{vb:rawphrase currently_active_users}</h3>
---
>    <h3 class="blocksubhead"><span class="sprite_misc_users_online" title="{vb:rawphrase currently_active_users}" ></span>{vb:rawphrase currently_active_users}</h3>
90c90
<    <h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/event.png" alt="{vb:rawphrase todays_events}" /><vb:if condition="$show['todaysevents']">{vb:rawphrase todays_events}<vb:else />{vb:rawphrase upcoming_events_for_the_next_x_days, {vb:raw vboptions.showevents}}</vb:if></h3>
---
>    <h3 class="blocksubhead"><span class="sprite_misc_event" title="{vb:rawphrase todays_events}" ></span><vb:if condition="$show['todaysevents']">{vb:rawphrase todays_events}<vb:else />{vb:rawphrase upcoming_events_for_the_next_x_days, {vb:raw vboptions.showevents}}</vb:if></h3>
100c100
<    <h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/birthday.png" alt="{vb:rawphrase todays_birthdays}" />{vb:rawphrase todays_birthdays}</h3>
---
>    <h3 class="blocksubhead"><span class="sprite_misc_birthday" title="{vb:rawphrase todays_birthdays}" ></span>{vb:rawphrase todays_birthdays}</h3>
109c109
<    <h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/forum_stats.png" alt="{vb:rawphrase x_statistics, {vb:raw vboptions.bbtitle}}" />{vb:rawphrase x_statistics, {vb:raw vboptions.bbtitle}}</h3>
---
>    <h3 class="blocksubhead"><span class="sprite_misc_forum_stats" title="{vb:rawphrase x_statistics, {vb:raw vboptions.bbtitle}}" ></span>{vb:rawphrase x_statistics, {vb:raw vboptions.bbtitle}}</h3>
128c128
<    <h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/legend.png" alt="{vb:rawphrase icon_legend}" />{vb:rawphrase icon_legend}</h3>
---
>    <h3 class="blocksubhead"><span class="sprite_misc_legend" title="{vb:rawphrase icon_legend}" ></span>{vb:rawphrase icon_legend}</h3>
131,134c131,134
<    <dt><img src="{vb:stylevar imgdir_statusicon}/forum_new-16.png" alt="{vb:rawphrase new_posts_forum}" /></dt><dd>{vb:rawphrase new_posts_forum}</dd>
<    <dt><img src="{vb:stylevar imgdir_statusicon}/forum_old-16.png" alt="{vb:rawphrase no_new_posts_forum}" /></dt><dd>{vb:rawphrase no_new_posts_forum}</dd>
<    <dt><img src="{vb:stylevar imgdir_statusicon}/category-16.png" alt="{vb:rawphrase category_forum}" /></dt><dd>{vb:rawphrase category_forum}</dd>
<    <dt><img src="{vb:stylevar imgdir_statusicon}/forum_link-16.png" alt="{vb:rawphrase link_forum}" /></dt><dd>{vb:rawphrase link_forum}</dd>
---
>    <dt><span class="sprite_statusicon_forum_new_16"></span></dt><dd>{vb:rawphrase new_posts_forum}</dd>
>    <dt><span class="sprite_statusicon_forum_old_16"></span></dt><dd>{vb:rawphrase no_new_posts_forum}</dd>
>    <dt><span class="sprite_statusicon_category_16"></span></dt><dd>{vb:rawphrase category_forum}</dd>
>    <dt><span class="sprite_statusicon_forum_link_16"></span></dt><dd>{vb:rawphrase link_forum}</dd>


Template: forumhome_forumbit_level2_nopost
3c3
<    <img src="{vb:stylevar imgdir_statusicon}/category_forum_{vb:raw forum.statusicon}.png" class="forumicon" id="forum_statusicon_{vb:raw forum.forumid}" alt="" />
---
>    <span id="forum_statusicon_{vb:raw forum.forumid}" class="forumicon sprite_statusicon_category_forum_{vb:raw forum.statusicon}"></span>


Template: forumhome_forumbit_level2_post
4c4
<    <img src="{vb:stylevar imgdir_statusicon}/{vb:raw forum.imageprefix}forum_{vb:raw forum.statusicon}-48.png" class="forumicon" id="forum_statusicon_{vb:raw forum.forumid}" alt="" />
---
>    <span id="forum_statusicon_{vb:raw forum.forumid}" class="forumicon sprite_statusicon_{vb:raw forum.imageprefix}forum_{vb:raw forum.statusicon}_48"></span>


Template: forumhome_lastpostby
3c3,11
<    <vb:if condition="$show['icon']"><img src="{vb:raw icon.iconpath}" alt="{vb:raw icon.title}" border="0" /></vb:if>
---
>    <vb:if condition="$show['icon']">
>    <vb:if condition="$lastpostinfo['lasticonid'] == -1">
>    <span class="sprite_misc_poll_posticon" title="{vb:raw icon.title}"></span>
>    <vb:elseif condition="$lastpostinfo['lasticonid'] == 0 && !empty($vbulletin->options['showdeficon'])" />
>    <span class="sprite_vbregistry_showdeficon" title="{vb:raw icon.title}"></span>
>    <vb:else />
>    <span class="sprite_icon_{vb:raw lastpostinfo.lasticonid}" title="{vb:raw icon.title}"></span>
>    </vb:if>
>    </vb:if>
6c14
<    <a href="{vb:link thread, {vb:raw threadinfo}, {vb:raw pageinfo_lastpost}}#post{vb:raw lastpostinfo.lastpostid}"><img src="{vb:stylevar imgdir_button}/lastpost-{vb:stylevar right}.png" alt="{vb:rawphrase go_to_last_post}" /></a>
---
>    <a href="{vb:link thread, {vb:raw threadinfo}, {vb:raw pageinfo_lastpost}}#post{vb:raw lastpostinfo.lastpostid}"><span class="sprite_button_lastpost_{vb:stylevar right}" title="{vb:rawphrase go_to_last_post}"></span></a>
18c26
<    <a href="{vb:link thread, {vb:raw threadinfo}, {vb:raw pageinfo_lastpost}}#post{vb:raw lastpostinfo.lastpostid}"><img src="{vb:stylevar imgdir_button}/lastpost-{vb:stylevar right}.png" alt="{vb:rawphrase go_to_last_post}" /></a>
---
>    <a href="{vb:link thread, {vb:raw threadinfo}, {vb:raw pageinfo_lastpost}}#post{vb:raw lastpostinfo.lastpostid}"><span class="sprite_button_lastpost_{vb:stylevar right}" title="{vb:rawphrase go_to_last_post}"></span></a>


Template: forumhome_subforumbit_nopost
2c2
<    <img class="inlineimg" src="{vb:stylevar imgdir_statusicon}/subforum_{vb:raw forum.statusicon}.png" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />
---
>    <span id="forum_statusicon_{vb:raw forum.forumid}" class="inlineimg sprite_statusicon_subforum_{vb:raw forum.statusicon}"></span>


Template: forumhome_subforumbit_post
2c2
<    <img class="inlineimg" src="{vb:stylevar imgdir_statusicon}/{vb:raw forum.imageprefix}subforum_{vb:raw forum.statusicon}-48.png" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />
---
>    <span id="forum_statusicon_{vb:raw forum.forumid}" class="inlineimg sprite_statusicon_{vb:raw forum.imageprefix}subforum_{vb:raw forum.statusicon}_48"></span>


Template: memberaction_dropdown
5c5
<    <img src="{vb:stylevar imgdir_siteicons}/profile.png" alt="" />
---
>    <span class="sprite_siteicons_profile"></span>
12c12
<    <img src="{vb:stylevar imgdir_siteicons}/forum.png" alt="" />
---
>    <span class="sprite_siteicons_forum"></span>
20c20
<    <img src="{vb:stylevar imgdir_siteicons}/message.png" alt="" />
---
>    <span class="sprite_siteicons_message"></span>
29c29
<    <img src="{vb:stylevar imgdir_siteicons}/blog.png" alt="" />
---
>    <span class="sprite_siteicons_blog"></span>
38c38
<    <img src="{vb:stylevar imgdir_siteicons}/homepage.png" alt="" />
---
>    <span class="sprite_siteicons_homepage"></span>
47c47
<    <img src="{vb:stylevar imgdir_siteicons}/article.png" alt="" />
---
>    <span class="sprite_siteicons_article"></span>
56c56
<    <img src="{vb:stylevar imgdir_siteicons}/add.png" alt="" />
---
>    <span class="sprite_siteicons_add"></span>
65c65
<    <img src="{vb:stylevar imgdir_siteicons}/email.png" alt="" />
---
>    <span class="sprite_siteicons_email"></span>

Also, if you intend on keeping the diff file... Please tell people they need to use something like tortoise svn to open the thing. I just so happened to have it still installed and windows basically said "use this"

Mooff 07-17-2011 10:42 PM

It's meant to be read like this:
Code:

Template: forumhome_subforumbit_post
2c2
<    <img class="inlineimg" src="{vb:stylevar imgdir_statusicon}/{vb:raw forum.imageprefix}subforum_{vb:raw forum.statusicon}-48.png" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />
---
>    <span id="forum_statusicon_{vb:raw forum.forumid}" class="inlineimg sprite_statusicon_{vb:raw forum.imageprefix}subforum_{vb:raw forum.statusicon}_48"></span>


translates into:

In template: forumhome_subforumbit_post
In Line 2 - search for
Code:

<img class="inlineimg" src="{vb:stylevar imgdir_statusicon}/{vb:raw forum.imageprefix}subforum_{vb:raw forum.statusicon}-48.png" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />
and replace with
Code:

<span id="forum_statusicon_{vb:raw forum.forumid}" class="inlineimg sprite_statusicon_{vb:raw forum.imageprefix}subforum_{vb:raw forum.statusicon}_48"></span>

Hope that helps.


edit: You do not need any special program to open the diff file. Any editor is enough. It's plain text. Opening it via tortoise svn just adds color coding.

final kaoss 07-17-2011 11:03 PM

oh, I know what it translates into, infact I removed those extra >'s. Alot easier to copy now.

PHP Code:

TemplateFORUMHOME
72d72
<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/users_online.png" alt="{vb:rawphrase currently_active_users}" />{vb:rawphrase currently_active_users}</h3>
---
<
h3 class="blocksubhead"><span class="sprite_misc_users_online" title="{vb:rawphrase currently_active_users}" ></span>{vb:rawphrase currently_active_users}</h3>
90c90
<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/event.png" alt="{vb:rawphrase todays_events}" /><vb:if condition="$show['todaysevents']">{vb:rawphrase todays_events}<vb:else />{vb:rawphrase upcoming_events_for_the_next_x_days, {vb:raw vboptions.showevents}}</vb:if></h3>
---
<
h3 class="blocksubhead"><span class="sprite_misc_event" title="{vb:rawphrase todays_events}" ></span><vb:if condition="$show['todaysevents']">{vb:rawphrase todays_events}<vb:else />{vb:rawphrase upcoming_events_for_the_next_x_days, {vb:raw vboptions.showevents}}</vb:if></h3>
100c100
<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/birthday.png" alt="{vb:rawphrase todays_birthdays}" />{vb:rawphrase todays_birthdays}</h3>
---
<
h3 class="blocksubhead"><span class="sprite_misc_birthday" title="{vb:rawphrase todays_birthdays}" ></span>{vb:rawphrase todays_birthdays}</h3>
109c109
<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/forum_stats.png" alt="{vb:rawphrase x_statistics, {vb:raw vboptions.bbtitle}}" />{vb:rawphrase x_statistics, {vb:raw vboptions.bbtitle}}</h3>
---
<
h3 class="blocksubhead"><span class="sprite_misc_forum_stats" title="{vb:rawphrase x_statistics, {vb:raw vboptions.bbtitle}}" ></span>{vb:rawphrase x_statistics, {vb:raw vboptions.bbtitle}}</h3>
128c128
<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/legend.png" alt="{vb:rawphrase icon_legend}" />{vb:rawphrase icon_legend}</h3>
---
<
h3 class="blocksubhead"><span class="sprite_misc_legend" title="{vb:rawphrase icon_legend}" ></span>{vb:rawphrase icon_legend}</h3>
131,134c131,134
<dt><img src="{vb:stylevar imgdir_statusicon}/forum_new-16.png" alt="{vb:rawphrase new_posts_forum}" /></dt><dd>{vb:rawphrase new_posts_forum}</dd>
<
dt><img src="{vb:stylevar imgdir_statusicon}/forum_old-16.png" alt="{vb:rawphrase no_new_posts_forum}" /></dt><dd>{vb:rawphrase no_new_posts_forum}</dd>
<
dt><img src="{vb:stylevar imgdir_statusicon}/category-16.png" alt="{vb:rawphrase category_forum}" /></dt><dd>{vb:rawphrase category_forum}</dd>
<
dt><img src="{vb:stylevar imgdir_statusicon}/forum_link-16.png" alt="{vb:rawphrase link_forum}" /></dt><dd>{vb:rawphrase link_forum}</dd>
---
<
dt><span class="sprite_statusicon_forum_new_16"></span></dt><dd>{vb:rawphrase new_posts_forum}</dd>
<
dt><span class="sprite_statusicon_forum_old_16"></span></dt><dd>{vb:rawphrase no_new_posts_forum}</dd>
<
dt><span class="sprite_statusicon_category_16"></span></dt><dd>{vb:rawphrase category_forum}</dd>
<
dt><span class="sprite_statusicon_forum_link_16"></span></dt><dd>{vb:rawphrase link_forum}</dd>


Templateforumhome_forumbit_level2_nopost
3c3
<img src="{vb:stylevar imgdir_statusicon}/category_forum_{vb:raw forum.statusicon}.png" class="forumicon" id="forum_statusicon_{vb:raw forum.forumid}" alt="" />
---
<
span id="forum_statusicon_{vb:raw forum.forumid}" class="forumicon sprite_statusicon_category_forum_{vb:raw forum.statusicon}"></span>


Templateforumhome_forumbit_level2_post
4c4
<img src="{vb:stylevar imgdir_statusicon}/{vb:raw forum.imageprefix}forum_{vb:raw forum.statusicon}-48.png" class="forumicon" id="forum_statusicon_{vb:raw forum.forumid}" alt="" />
---
<
span id="forum_statusicon_{vb:raw forum.forumid}" class="forumicon sprite_statusicon_{vb:raw forum.imageprefix}forum_{vb:raw forum.statusicon}_48"></span>


Templateforumhome_lastpostby
3c3
,11
<vb:if condition="$show['icon']"><img src="{vb:raw icon.iconpath}" alt="{vb:raw icon.title}" border="0" /></vb:if>
---
<
vb:if condition="$show['icon']">
<
vb:if condition="$lastpostinfo['lasticonid'] == -1">
<
span class="sprite_misc_poll_posticon" title="{vb:raw icon.title}"></span>
<
vb:elseif condition="$lastpostinfo['lasticonid'] == 0 && !empty($vbulletin->options['showdeficon'])" />
<
span class="sprite_vbregistry_showdeficon" title="{vb:raw icon.title}"></span>
<
vb:else />
<
span class="sprite_icon_{vb:raw lastpostinfo.lasticonid}" title="{vb:raw icon.title}"></span>
</
vb:if>
</
vb:if>
6c14
<a href="{vb:link thread, {vb:raw threadinfo}, {vb:raw pageinfo_lastpost}}#post{vb:raw lastpostinfo.lastpostid}"><img src="{vb:stylevar imgdir_button}/lastpost-{vb:stylevar right}.png" alt="{vb:rawphrase go_to_last_post}" /></a>
---
<
a href="{vb:link thread, {vb:raw threadinfo}, {vb:raw pageinfo_lastpost}}#post{vb:raw lastpostinfo.lastpostid}"><span class="sprite_button_lastpost_{vb:stylevar right}" title="{vb:rawphrase go_to_last_post}"></span></a>
18c26
<a href="{vb:link thread, {vb:raw threadinfo}, {vb:raw pageinfo_lastpost}}#post{vb:raw lastpostinfo.lastpostid}"><img src="{vb:stylevar imgdir_button}/lastpost-{vb:stylevar right}.png" alt="{vb:rawphrase go_to_last_post}" /></a>
---
<
a href="{vb:link thread, {vb:raw threadinfo}, {vb:raw pageinfo_lastpost}}#post{vb:raw lastpostinfo.lastpostid}"><span class="sprite_button_lastpost_{vb:stylevar right}" title="{vb:rawphrase go_to_last_post}"></span></a>


Templateforumhome_subforumbit_nopost
2c2
<img class="inlineimg" src="{vb:stylevar imgdir_statusicon}/subforum_{vb:raw forum.statusicon}.png" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />
---
<
span id="forum_statusicon_{vb:raw forum.forumid}" class="inlineimg sprite_statusicon_subforum_{vb:raw forum.statusicon}"></span>


Templateforumhome_subforumbit_post
2c2
<img class="inlineimg" src="{vb:stylevar imgdir_statusicon}/{vb:raw forum.imageprefix}subforum_{vb:raw forum.statusicon}-48.png" alt="" border="0" id="forum_statusicon_{vb:raw forum.forumid}" />
---
<
span id="forum_statusicon_{vb:raw forum.forumid}" class="inlineimg sprite_statusicon_{vb:raw forum.imageprefix}subforum_{vb:raw forum.statusicon}_48"></span>


Templatememberaction_dropdown
5c5
<img src="{vb:stylevar imgdir_siteicons}/profile.png" alt="" />
---
<
span class="sprite_siteicons_profile"></span>
12c12
<img src="{vb:stylevar imgdir_siteicons}/forum.png" alt="" />
---
<
span class="sprite_siteicons_forum"></span>
20c20
<img src="{vb:stylevar imgdir_siteicons}/message.png" alt="" />
---
<
span class="sprite_siteicons_message"></span>
29c29
<img src="{vb:stylevar imgdir_siteicons}/blog.png" alt="" />
---
<
span class="sprite_siteicons_blog"></span>
38c38
<img src="{vb:stylevar imgdir_siteicons}/homepage.png" alt="" />
---
<
span class="sprite_siteicons_homepage"></span>
47c47
<img src="{vb:stylevar imgdir_siteicons}/article.png" alt="" />
---
<
span class="sprite_siteicons_article"></span>
56c56
<img src="{vb:stylevar imgdir_siteicons}/add.png" alt="" />
---
<
span class="sprite_siteicons_add"></span>
65c65
<img src="{vb:stylevar imgdir_siteicons}/email.png" alt="" />
---
<
span class="sprite_siteicons_email"></span


final kaoss 07-17-2011 11:52 PM

Also, why isn't the logo added in this list? I'm sure everyone keeps the same logo name. Also I've done some testing and the page loading speed, requests & bytes in (tested with wepbagetest.org and my browsers) are roughly the same without this mod installed.

Also, I notice that on the test skin, the images are forced to reload, ignoring the cache settings that I put in my htaccess. And when I clear my cookies and view the regular skin, they cache fine (according to my browser, webpagetest.org and yslow). You should look into that and I think this is what's causing it.

Add ReadMarker Javascript



Code:

/images/misc/vbulletin4_logo.png

giorgino 07-18-2011 06:00 AM

Great great mod, but without forum custom icon support is useless for me :)

Osbes 07-18-2011 07:08 AM

Hello extreme-gaming,

no problem, i putted up the template changes in codeboxes again :)

The extra > and < is to indicate what should be replaced by what, but i understand that it is a little unhandy, if you want to select-copy-replace multiple lines.

I am adding icons step by step. Thats why the Logo is currently not added.

It is weird, that you didnt noticed a significant drop in the requests, using the addon. Can you send me a link, so i can try your implementation in the test skin?


I think you set the expires entity-header and cache-control header in your htaccess for images, right? This should behave totally independent to my addon.

I just double checked this an its working correct on our forum.

My Browsers sends:
Code:

GET /images/sprites/sprite.png HTTP/1.1
If-Modified-Since: Sun, 17 Jul 2011 21:49:42 GMT

and gets as response
Code:

HTTP/1.1 304 Not Modified
and then he loads the file from the browser-cache.

So that this isnt working on your forum seems also a little bit weird. Please send me a link, so i can check this in your test skin and the corresponding .httacces file, so i can check your cache settings.

Best regards
Sebastian

Osbes 07-18-2011 07:16 AM

Quote:

Originally Posted by giorgino (Post 2221803)
Great great mod, but without forum custom icon support is useless for me :)

Hi giorgino,

what do you mean by forum custom icon? We suppport forumicons with imageprefix and - since this is the main concepts of this addon - customised forumicons since the first release.

Check Sprites like:
http://www.united-forum.de/images/sprites/sprite.png
or
http://www.thailand-asienforum.com/f...tes/sprite.png

Best regards
Sebastian

giorgino 07-18-2011 07:36 AM

1 Attachment(s)
Hi Sebastian :)
I mean the forum custom icons, see the pict

giorgino 07-18-2011 07:38 AM

The mod I use for custom icons is https://vborg.vbsupport.ru/showthread.php?t=244351

klaus 07-18-2011 07:44 AM

Works great for me on vb414. There are less requests like promised.

However I use Absolute path (http://cdn.domain.com/forum/image/buttons vs. images/buttons) in my image_dir style vars and this plugin doesn't seem to support it when I run the "refresh".

Overall I think this is a very significant performance enhancer that VB should have built into the software about 2 years ago. Thank you for writing this add-on and keep it going.

Mooff 07-18-2011 07:44 AM

@giorgino
The way you use that mod seems to be no different than the basic vb4 setting (forum prefix).

check our board. We have different icons for almost all our games - starcraft2, tiberium twilight, tiberium wars, red alert3....
www.united-forum.de

giorgino 07-18-2011 07:53 AM

Quote:

Originally Posted by Mooff (Post 2221834)
@giorgino
The way you use that mod seems to be no different than the basic vb4 setting (forum prefix).

check our board. We have different icons for almost all our games - starcraft2, tiberium twilight, tiberium wars, red alert3....
www.united-forum.de

I've tried to install your mod that work but it reset the forums custom icons to default icons... what's wrong?

Osbes 07-18-2011 07:56 AM

@giorgino
The feature to use forums custom icons is builtin in vBulletin 4. You can add to every forum an own imageprefix, so it will use forums custom icons. If you use the vBulletin imageprefix for your your forums, these icons will instantly added to the sprite.

If you want to further use the Forum Category Icons addon, i can create you a plugin, so this icons will also added.

But i would advise you to use the builtin solution from vBulletin, so you didnt need an extra addon and an extra plugin from us on top of this.
This could make your workload during every vBulletin Update easier (less addons and plugins = less problems)

###

@klaus
Can you send me the output, when using an absolute path, via PN? This would help me finding the problem :)

Best regards
Sebastian

doctorsexy 07-18-2011 08:11 AM

Will give it till it can be loaded with less fuss... looks good :D:up:

giorgino 07-18-2011 08:45 AM

Quote:

Originally Posted by Osbes (Post 2221840)
@giorgino
The feature to use forums custom icons is builtin in vBulletin 4. You can add to every forum an own imageprefix, so it will use forums custom icons. If you use the vBulletin imageprefix for your your forums, these icons will instantly added to the sprite.

If you want to further use the Forum Category Icons addon, i can create you a plugin, so this icons will also added.

But i would advise you to use the builtin solution from vBulletin, so you didnt need an extra addon and an extra plugin from us on top of this.
This could make your workload during every vBulletin Update easier (less addons and plugins = less problems)

Ouch Sebastian!
I don't know how to customize each icon per forum basis, with standard vB4 features. Can you advise me a guide to perform this? So I can uninstall the plugin and use yours?

Mooff 07-18-2011 09:23 AM

@giorgino

In the ACP go to
-> Forum Manager
-> search for the forum you want to edit
-> edit forum
-> scroll down to 'Style Options'
-> Prefix for Forum Status Images --> add your forum prefix there (you can have a different one for each forum - and you need to add the prefix in your subforums as well, if you want the special icons to show up there). For forums which should use the default icons - do nothing.

you then need icons which are named accordingly
So if your forum prefix is, let's say, 'sc2_'
you need the following additional icons
sc2_forum_new-48.png
sc2_forum_old-48.png
sc2_subforum_new-48.png
sc2_subforum_old-48.png

In your ../statusicons folder.

Mooff 07-18-2011 09:28 AM

Quote:

Originally Posted by doctorsexy (Post 2221841)
Will give it till it can be loaded with less fuss... looks good :D:up:

Unfortunately we can't make the template changes easier. :(

In order to use sprites we need to replace the image codes in those templates. And since images are widely spread around in those templates it is a bit of a hassle to replace that code.

In addition we can't just upload the whole templates cause the code inbetween the image parts might be modified heavily on some boards and shouldn't be replaced.


If anyone has an idea how to make it easier - please let us know.


All times are GMT. The time now is 04:44 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.01963 seconds
  • Memory Usage 2,059KB
  • 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
  • (7)bbcode_code_printable
  • (4)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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