Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons

Reply
 
Thread Tools
[DRC] - Thread Starter Avatars Details »»
[DRC] - Thread Starter Avatars
Version: 1.3.1, by Dr.CustUmz Dr.CustUmz is offline
Developer Last Online: Aug 2023 Show Printable Version Email this Page

Category: Add-On Releases - Version: 3.8.10 Rating:
Released: 04-14-2016 Last Update: 04-16-2016 Installs: 19
Supported Uses Plugins Auto-Templates
Additional Files  

[DRC] - Thread Starter Avatars

Nominated for MOTM May 2016 BE SURE TO CAST YOUR VOTE!
https://vborg.vbsupport.ru/showthread.php?t=322496

If this wins, it means it has more interest than I thought. I will put it on high priority =)

Home Page:
http://dirtrif.com

Upon Downloading any DRC product you acknowledge and agree to abide by the following:
Products are designed for default vBulletin, downloads are as is and not gurenteed to work with your custom site.
You are permitted to alter the product code and images for your own personal use.
Under no circumstances is the code (original or modified) permitted to be redistributed.
Exceptions will only be made with written permission from Dirt RIF CustUmz.
All copyright notices must remain in the templates and are not to be modified.
Unless a One-Time or Universal Branding Free license is purchased. (contact me via PM untill the shop is complete)
If you have any concerns in regards to this, please contact me.

Information:
Shows thread starter avatars on thread listings. If your avatars are stored in the database (which vBulletin does by default) this will not add any additional queries, if you have moved your avatars into your file system this will add an additional query for fetching each avatar. Barely any hit to page load though =). Does not remove anything from your template, but does add icons for new post, hot thread, and closed thread that overlap the avatar in a stylish way.

Features:
- thread starter avatar
- hot thread icon
- new thread icon (that links to new post)
- locked thread icon

Planned:
- show last poster avatar as a mini icon on top of thread starter avatar (this will add queries though)
- options to enable disable things
- options for positions

Preview:

Avatars in the database with page load time:

Avatars in the Filesystem with page load time:

and just to be thorough, plugin disabled with page load time:
hardly even a hit =)


Thanks / Credits:
To MarkFL for his constant support, and help.
To Max Taxable for finding the file system bug

If you have any ideas to add don't be shy, and share your thoughts!


Changelog:
---------------------------------------------
v1.3
- vBAdvanced Support
- Plugins only active on specific pages
- Copyright only visible on pages avatars are active
- added T.O.S.

---------------------------------------------
v1.2
- added support for file system avatars in search results

---------------------------------------------
v1.1
- added support for avatars in the filesytem

---------------------------------------------
v1.0
- initial release

Download Now

File Type: zip [DRC] - Thread Starter Avatars.zip (127.9 KB, 160 views)

Screenshots

File Type: png 4vIGmFZ.png (122.1 KB, 0 views)

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
lange

Comments
  #12  
Old 04-16-2016, 02:07 AM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ah that would be why, this pulls the avatar from image.php which I believe the image has to be in the database for that.

this is the exact code for the image src
Code:
image.php?u=$thread[postuserid]&type=thumb
I will make a note of this in the description, and will see if I can fix it =)
Reply With Quote
  #13  
Old 04-16-2016, 02:11 AM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad i could be helpful. Looks like a great little Mod, adds almost zero to pageload.
Reply With Quote
  #14  
Old 04-16-2016, 02:23 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't know if it works the same in vB 3 as in vB 4, but in vB 4, when I want to get a user's avatar from the file system, I use code in the following form:

PHP Code:
$avatar_url fetch_avatar_url($userid);
$avatar $avatar_url[0];

if (!
$avatar)
{
    
$avatar $vbulletin->stylevars['imgdir_misc']['imagedir'] . '/unknown.gif';

edit: I forgot, you will likely need this before the call to the fetch_avatar_url() function:

PHP Code:
require_once('./global.php');
require_once(
'./includes/functions_user.php'); 
Reply With Quote
  #15  
Old 04-16-2016, 02:49 AM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
I don't know if it works the same in vB 3 as in vB 4, but in vB 4, when I want to get a user's avatar from the file system, I use code in the following form:

PHP Code:
$avatar_url fetch_avatar_url($userid);
$avatar $avatar_url[0];

if (!
$avatar)
{
    
$avatar $vbulletin->stylevars['imgdir_misc']['imagedir'] . '/unknown.gif';

edit: I forgot, you will likely need this before the call to the fetch_avatar_url() function:

PHP Code:
require_once('./global.php');
require_once(
'./includes/functions_user.php'); 
well before seeing this, at least I was on the right track lol

Code:
require_once('./includes/functions_user.php');
        $userid = $thread['postuserid'];
        $avatarurl = fetch_avatar_url($userid);
Reply With Quote
  #16  
Old 04-16-2016, 03:20 AM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

what i ended up coming up with
Code:
require_once(DIR . '/includes/functions_user.php');
$drcav = fetch_avatar_url($thread[postuserid]);
if (!$drcav) {
  $drcav = $stylevar['imgdir_misc'] . '/unknown.gif';
} else {
  $drcav = $vbulletin->options['bburl'] . '/' . $drcav[0];
}
but good news and bad news. this works but will cause an additional query per avatar on the page since it has to fetch it, with avatars in file system there is no way around this, unless...

food for thought (for me to return to lol)
Code:
you take $vboptions[SomeFolderNameOption]/avatar$thread[postuserid]_1.gif
but how to get that pesky revision number... hmm

$array['avatarrevision']
so to keep with the products title, i can not in good faith release this as an update. What i can do though is release another version altogether =) that way both sides can be happy... I hope. but its past 1 am here

heres a quick fix for now, i will release the revised version when i wake up

THIS IS ONLY FOR AVATARS IN FILESYSTEM! and was intended to fix max's issues to be good enough for now

and does not work in search results till tomorrow, only forumdisplay as im doing it as a quick fix before bed. again i will work the rest out tomorrow
Attached Files
File Type: xml product-drctsa.xml (6.6 KB, 17 views)
Reply With Quote
  #17  
Old 04-16-2016, 04:22 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can detect if the avatars are in the file system with:

PHP Code:
$vbulletin->options['usefileavatar'
This will be an integer value of 1 if the file system is being used, and an integer value of 0 if the database is being used.
Reply With Quote
  #18  
Old 04-16-2016, 12:31 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
You can detect if the avatars are in the file system with:

PHP Code:
$vbulletin->options['usefileavatar'
This will be an integer value of 1 if the file system is being used, and an integer value of 0 if the database is being used.
yeah but how does that help lol, say i were to use for the img src

Code:
$vboptions[avatarurl_2]/avatar$thread[postuserid]_1.gif
that would work by itself, without a query. but that _1 at the end is the revision number, so I would need something like $thread[postuseridAvatarRev] where the 1 is, and i dont see any way of doing this without creating queries.

I guess for now i can combine it into one product using, ill just inform that if your avatars on your file system it will create a query for avatar loaded.

Code:
if $vbulletin->options['usefileavatar'] ==1{
USE QUERIES
} ELSE {
NO QUERIES
}
Reply With Quote
  #19  
Old 04-16-2016, 05:36 PM
Max Taxable's Avatar
Max Taxable Max Taxable is offline
 
Join Date: Feb 2011
Posts: 3,134
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Datastore? Possible to use that?
Reply With Quote
  #20  
Old 04-16-2016, 05:53 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Max Taxable View Post
Datastore? Possible to use that?
as they say in developing 'anything is possible' lol, but beyond my skillset, this is =P

can you give me an example? a product that uses this method, a way vbulletin uses it? im looking into it now too
Reply With Quote
  #21  
Old 04-16-2016, 05:57 PM
Dr.CustUmz's Avatar
Dr.CustUmz Dr.CustUmz is offline
 
Join Date: Aug 2013
Location: USA
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

it doesnt even touch the page load whether you have the additional queries or not though (at least from what Ive seen). all the queries mean, is it's asking the database for more information. on some products, queries matter, but from the testing ive put on my crappy little server sitting next to me i have not noticed any stress at all =) and its just a little ubuntu server i made from old pc parts, so if your site is on a real server youll have no issues =)

found a good article, but this may have to wait =)
https://vborg.vbsupport.ru/showthread.php?t=110628
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:20 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06413 seconds
  • Memory Usage 2,362KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (6)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (3)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete