PDA

View Full Version : Add-On Releases - [DRC] - Thread Starter Avatars


Dr.CustUmz
04-14-2016, 09:00 PM
[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:
https://vborg.vbsupport.ru/external/2016/04/31.png

Avatars in the database with page load time:
https://vborg.vbsupport.ru/external/2016/04/32.png

Avatars in the Filesystem with page load time:
https://vborg.vbsupport.ru/external/2016/04/33.png

and just to be thorough, plugin disabled with page load time:
https://vborg.vbsupport.ru/external/2016/04/34.png
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

MarkFL
04-15-2016, 09:10 PM
Lookin' good, Ryan! :up:

I'll give this a go tonight on vB 3.8.9. :)

Dr.CustUmz
04-15-2016, 09:41 PM
i was going to remove thread status, and post icon columns and use a mini icon for every thread status (which is going to take me forever) but figured why not just release what i got now and move on to something else for now, and do an update later lol

Dr.CustUmz
04-15-2016, 09:43 PM
here's a broader screenshot (titles are not describing them anymore though lol)
https://vborg.vbsupport.ru/external/2016/04/30.png

MarkFL
04-16-2016, 01:29 AM
Okay, I installed this on my vB 3.8.9 dev site, and everything works as expected. Definitely a nice improvement. :)

Dr.CustUmz
04-16-2016, 01:47 AM
glad to here =) thanks for the feedback.

Max Taxable
04-16-2016, 01:54 AM
Hmm.... Avatars not rendering but also not 404.

Dr.CustUmz
04-16-2016, 02:00 AM
are your avatars in the database, or file system?

Max Taxable
04-16-2016, 02:02 AM
File system.

Max Taxable
04-16-2016, 02:05 AM
https://vborg.vbsupport.ru/external/2016/04/13.jpg

Dr.CustUmz
04-16-2016, 02:07 AM
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
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 =)

Max Taxable
04-16-2016, 02:11 AM
Glad i could be helpful. Looks like a great little Mod, adds almost zero to pageload.

MarkFL
04-16-2016, 02:23 AM
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:

$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:

require_once('./global.php');
require_once('./includes/functions_user.php');

Dr.CustUmz
04-16-2016, 02:49 AM
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:

$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:

require_once('./global.php');
require_once('./includes/functions_user.php');


well before seeing this, at least I was on the right track lol

require_once('./includes/functions_user.php');
$userid = $thread['postuserid'];
$avatarurl = fetch_avatar_url($userid);

Dr.CustUmz
04-16-2016, 03:20 AM
what i ended up coming up with
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)
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

MarkFL
04-16-2016, 04:22 AM
You can detect if the avatars are in the file system with:

$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.

Dr.CustUmz
04-16-2016, 12:31 PM
You can detect if the avatars are in the file system with:

$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

$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.

if $vbulletin->options['usefileavatar'] ==1{
USE QUERIES
} ELSE {
NO QUERIES
}

Max Taxable
04-16-2016, 05:36 PM
Datastore? Possible to use that?

Dr.CustUmz
04-16-2016, 05:53 PM
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 :D

Dr.CustUmz
04-16-2016, 05:57 PM
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

Max Taxable
04-16-2016, 06:01 PM
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=110628Yes I agree this Mod is insignificant as a bloat producer or performance negative. It doesn't hurt page load or performance at all. The only thing it really does is add the kb of the avatar image files, but these are small and not a significant source of bloat either.

I only mentioned the Datastore as a possible solution for some of the coding issues you're getting. But really, you're doing just fine the way it is.

Can we get this for search.php now too?

Dr.CustUmz
04-16-2016, 06:05 PM
oh yeah forgot had to add the other pages for the file system side.

what other pages other than search would this need to be activated?... i cant think of any others

Max Taxable
04-16-2016, 06:11 PM
Pretty sure it's just going to be forumdisplay and search.

Dr.CustUmz
04-16-2016, 06:18 PM
*update* Added Support for search result avatars if files are in the file system. - thanks max

if your avatars are not in the file system this feature already exists

Hasann
04-16-2016, 08:06 PM
thank you ryan
can you make last poster avatar too?

Dr.CustUmz
04-16-2016, 08:15 PM
already working on it =) and more mini icons =)

Hasann
04-16-2016, 08:18 PM
already working on it =) and more mini icons =)

I like it how you do those mini icons.. a very good idea please make all of them forum/thread icons like that.

Dr.CustUmz
04-16-2016, 08:29 PM
I am, just going to take a while got to photoshop every post status icon, then create each combination in css. just got done adding vbadvanced support, ill probably hold off on the release though since no one has requested that lol.

Dr.CustUmz
04-16-2016, 10:46 PM
can I get some feedback on this approach
https://vborg.vbsupport.ru/external/2016/04/27.png

https://vborg.vbsupport.ru/external/2016/04/28.png

Hasann
04-16-2016, 11:06 PM
very nice

Max Taxable
04-16-2016, 11:13 PM
*update* Added Support for search result avatars if files are in the file system. - thanks maxInstalled to overwrite, and works perfectly. Thanks!can I get some feedback on this approach
Looks pretty cool.

Dr.CustUmz
04-17-2016, 12:09 AM
got another one for you guys, if you noticed, the avatars make the height of the table row a little taller on each post. To not effect the row height should i shrink the avatars/icons?

here is a close up (the top post)
https://vborg.vbsupport.ru/external/2016/04/25.png

here it is again normal view
https://vborg.vbsupport.ru/external/2016/04/26.png

this does make the mini icons harder to see, but it wont effect the row height this way

Max Taxable
04-17-2016, 12:55 AM
Maybe not quite that small - think of fully responsive mobile styles like I have.

Dr.CustUmz
04-17-2016, 02:53 AM
*UPDATE* v1.3
- vBAdvanced Support
- Plugins only active on specific pages
- Copyright only visible on pages avatars are active
- added T.O.S.

Dr.CustUmz
05-14-2016, 12:38 PM
*nominated for MOTM May 2016, the more people that participate, the better us developers feel =)

Derwin
05-19-2017, 01:43 PM
This is EXACTLY what I've been searching for, but for the vBulletin 4 version.

Will this work on vb4? If not, can you make this to work for vb4?

Please... please... I beg you!

z3r0
05-20-2017, 07:12 AM
This is EXACTLY what I've been searching for, but for the vBulletin 4 version.

Will this work on vb4? If not, can you make this to work for vb4?

Please... please... I beg you!


Try this - https://vborg.vbsupport.ru/showthread.php?t=271540

TTayfun
08-05-2018, 01:52 PM
remember that please add this plugin: search_results_threadbit

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];
}

crazymook
08-28-2018, 03:06 PM
Is there any way to make this work only on certain styles? I dont want it active on our mobile themes.

Dr.CustUmz
05-28-2020, 09:10 PM
This product works perfectly with a responsive theme under 3.8.11 / PHP 7.2.31

thanks for the feedback I havent used this product in a long time I do plan on updating all my addons though