vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Miscellaneous Hacks - Forum Home and Forumdisplay avatars (like XF) (https://vborg.vbsupport.ru/showthread.php?t=269031)

kotkerk 08-23-2011 10:00 PM

Forum Home and Forumdisplay avatars (like XF)
 
1 Attachment(s)
yes, i know =)
exists similar mods, but they produce mount of SQL queries on forum home page and forumdisplay page
i'm tried to create one product, that has no additional queries and save server resources
debug from my test forum (vbkerk.com)
No hack
====
Homepage
Page Generation 0.02608 seconds Memory Usage 1,558KB Queries Executed 10
Forumdisplay (Has threads)
Page Generation 0.03031 seconds Memory Usage 1,878KB Queries Executed 14
Forumdisplay (No threads - Category)
Page Generation 0.02724 seconds Memory Usage 1,832KB Queries Executed 8

Hack installed
====
Homepage
Page Generation 0.02612 seconds Memory Usage 1,600KB Queries Executed 10
Forumdisplay (Has threads)
Page Generation 0.03360 seconds Memory Usage 1,912KB Queries Executed 14
Forumdisplay (No threads - Category)
Page Generation 0.02957 seconds Memory Usage 1,855KB Queries Executed 8

Important Note!
avatar files must be in the File System! Not in Data Base!
and users used custom avatars, not uploaded by admin

====
I will no support this product
I don't know, how forum will work with this mod and mods, that used hooks:
cache_ordered_forums
forumdisplay_query
becouse, if you use hook cache_ordered_forums, you can not add fields, unless unsetting one variable ($counter_select) before

my english is bad, блин =)
live DEMO

Hornstar 08-24-2011 09:23 AM

I may give this a go later, thanks for sharing your work :)

ShawneyJ 08-25-2011 12:58 AM

tagged for now thanks, nice demo "Sorry. The administrator has banned your IP address" lol.

kotkerk 08-25-2011 12:39 PM

Quote:

administrator has banned your IP address
probably your IP address was used by some spam bots
ok, I removed all banned IP's

Tyran1 08-26-2011 07:33 PM

Icon and Avatar to Avatar and Icon its better ;-)

Artes_Marciales 09-01-2011 04:32 AM

Great mod! : D

Artes_Marciales 09-01-2011 07:05 AM

1 Attachment(s)
does not work in new results or search :confused:

kotkerk 09-02-2011 12:08 PM

Quote:

does not work in new results or search
in mod description not promised, that mod would work in search results =)
look at thread title:
Forum Home and Forumdisplay avatars
ok, if you want to add this feature, add new module in:
1.
Plugins & Products
Add New Plugin =>
===
Product = XFAvatar
Hook Location = search_results_query_threads
Title = XFAvatar - search_results_query_threads
Execution Order = 5 (default)
Plugin PHP Code:
PHP Code:

if(file_exists(DIR '/krscripts/xfavatar/search_results_query_threads.php'))
{
     require_once(
DIR '/krscripts/xfavatar/search_results_query_threads.php');


2.
Create new file called search_results_query_threads.php
put php code in this file:
PHP Code:

<?php
if(!is_object($vbulletin))
{
     exit;
}
$hook_query_fields ",
post_user.userid AS lastposterid, post_user.avatarrevision AS avatarrevision, user.avatarrevision AS post_avatarrevision,
customavatar.width AS avwidth, customavatar.height AS avheight,
post_customavatar.width AS post_avwidth, post_customavatar.height AS post_avheight,
NOT ISNULL(post_customavatar.userid) AS post_customavatar,
NOT ISNULL(customavatar.userid) AS hascustom
"
;
$hook_query_joins "
LEFT JOIN " 
TABLE_PREFIX "user AS post_user ON(post_user.username = thread.lastposter)
LEFT JOIN " 
TABLE_PREFIX "avatar AS avatar ON(avatar.avatarid = user.avatarid)
LEFT JOIN " 
TABLE_PREFIX "avatar AS post_avatar ON(post_avatar.avatarid = post_user.avatarid)
LEFT JOIN " 
TABLE_PREFIX "customavatar AS customavatar ON(customavatar.userid = user.userid)
LEFT JOIN " 
TABLE_PREFIX "customavatar AS post_customavatar ON(post_customavatar.userid = thread.postuserid)
"
;
?>

upload this file to your server into folder *your_forum*/krscripts/xfavatar/

https://vborg.vbsupport.ru/external/2011/09/62.png

Artes_Marciales 09-02-2011 01:05 PM

Amazing!!!
Nominated, I love this mod!
Thanks kotkerk!!!

Artes_Marciales 09-03-2011 05:45 AM

1 Attachment(s)
Sorry to bother you again.
It seems that some users without avatar avatars are not displayed correctly, there is no apparent reason for this failure.
The problem is that the image looks in the folder but they are users without avatars avatar.
The image should have this route images/misc/unknown.gif but somehow find a route in the folder customavatars.
For this error they must have at least 10 new messages in 5 for example you may not see the error :o
example: http://www.foroartesmarciales.com/se...hp?do=getdaily

I wonder if you could review the code for a solution. Thank you very much for your patience and apologize for any inconvenience.

PL: apologize for my English


All times are GMT. The time now is 12:39 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.01364 seconds
  • Memory Usage 1,746KB
  • 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_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (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