Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 12-24-2015, 12:29 AM
setishock setishock is offline
 
Join Date: Feb 2008
Location: Houma, La.
Posts: 1,177
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Album and picture stats

I have a boat load of albums and mucho pictures in most of the albums. It's either reviewing something or a build log. I think it would be real neat to have a stat that shows total albums and total pictures. The rest of my stats look like a pile of poop so it would be nice to have something that has some way up there numbers. I figure it would need to go right under the main stat line.

My pics go to the file system if that makes any difference. I have no clue how to code this complex or I'd take a shot at it. I'm doing good programming my Arduino's.

So is there a mod that does this or is there a simple template edit that would do it?
Reply With Quote
  #2  
Old 12-24-2015, 01:24 AM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

From what I can tell, you would have to query the "album" table to get the number of albums, and then query the "attachment" table to get the number of images uploaded to the albums. An attachment whose "contenttypeid" is 8 is an album picture. (edit: I now see after creating an album that the "album" table has a column that indicates how many pictures are in that album.)

Do you simply want a division in the WGO block that says something like "There are x user albums containing a total of y pictures"?
Reply With Quote
  #3  
Old 12-24-2015, 04:50 AM
setishock setishock is offline
 
Join Date: Feb 2008
Location: Houma, La.
Posts: 1,177
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

YES PLEASE!!!
I would imagine the first run through is going to smack the server pretty hard. I would venture after the initial run have it run at a set interval to keep from banging the server.
Reply With Quote
  #4  
Old 12-24-2015, 03:13 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by setishock View Post
YES PLEASE!!!
I would imagine the first run through is going to smack the server pretty hard. I would venture after the initial run have it run at a set interval to keep from banging the server.
I have a couple of other projects in progress, but I have added this to my list. I will have something for you soon.
Reply With Quote
  #5  
Old 12-24-2015, 04:48 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have attached a product .XML file that you can import. Upon installation, the db is queried to obtain the total number of albums and the total number of images in the albums. This data is written to a .TXT file in your root directory: album_stats.txt

Then this file is read and its contents displayed at the top of the WGO block:



Once a day, the database is queried to update the album stats, which are written to the .TXT file.

To Install:
  1. Download the attached .XML file.
  2. Follow AdminCP -> Plugins & Products -> Manage Products -> Add/Import Product.
  3. Click on "Choose File" and browse to the product .xml file that you downloaded.
  4. Click "Import."

That's it...there are no settings to configure, once installed, it is active. Please let me know if there are any changes you would like made.

If you uninstall the product, then the .TXT file is removed from your file system.
Attached Images
File Type: png markfl_albumstats.png (8.8 KB, 0 views)
Attached Files
File Type: xml product-markflalbumstats.xml (2.6 KB, 2 views)
Reply With Quote
Благодарность от:
setishock
  #6  
Old 12-25-2015, 05:49 AM
setishock setishock is offline
 
Join Date: Feb 2008
Location: Houma, La.
Posts: 1,177
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works great. I thought I had a lot more pictures than I do. I'm going to have to fatten up those numbers.

Thank you Mark. Your response to a question with the speed you did is impressive. Thanks for the plug in. I'm sure others will down load this and try it out.
Thanks again.

Merry Christmas and a happy new year.
Reply With Quote
Благодарность от:
MarkFL
Reply

Thread Tools
Display Modes

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 05:35 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.06430 seconds
  • Memory Usage 2,231KB
  • Queries Executed 14 (?)
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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (2)post_thanks_box_bit
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (2)postbit_attachment
  • (6)postbit_onlinestatus
  • (6)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_postinfo_query
  • fetch_postinfo
  • 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
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • 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_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete