Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)

Reply
 
Thread Tools Display Modes
  #1  
Old 10-14-2001, 03:52 AM
Mike Gaidin's Avatar
Mike Gaidin Mike Gaidin is offline
 
Join Date: Oct 2001
Location: Michigan
Posts: 247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any hack that will allow me to to add a poster's posts per day (like the one that's shown in the profiles) under the avatar? I think it should be easy, but I know nothing of php yet to figure it out for myself.
Reply With Quote
  #2  
Old 10-14-2001, 07:07 AM
Reeve of shinra's Avatar
Reeve of shinra Reeve of shinra is offline
 
Join Date: Oct 2001
Location: NYC
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can find the variable string used to display that in a template you can reach from your admin panel. Then just copy and paste that in the post-bit template under the advatar somewhere.
Reply With Quote
  #3  
Old 10-14-2001, 07:36 AM
JamesUS's Avatar
JamesUS JamesUS is offline
 
Join Date: Oct 2001
Posts: 347
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually this does require a code hack. You need to put this block of code:
PHP Code:
  $jointime = (time() - $userinfo[joindate]) / 86400// Days Joined
  
if ($jointime 1) { // User has been a member for less than one day.
    
$postsperday "$userinfo[posts]";
  } else {
    
$postsperday sprintf("%.2f",($userinfo[posts] / $jointime));
  } 
directly under line 265 of admin/functions.php

Then into the postbit template, add $postsperday.

I haven't tested this at all but it should work.
Reply With Quote
  #4  
Old 10-14-2001, 03:06 PM
Freddie Bingham's Avatar
Freddie Bingham Freddie Bingham is offline
 
Join Date: Oct 2001
Posts: 506
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just stick $postsperday into the postbit template and you will have what you want since I created the value to be used but don't display it by default.
Reply With Quote
  #5  
Old 10-14-2001, 03:40 PM
Mike Gaidin's Avatar
Mike Gaidin Mike Gaidin is offline
 
Join Date: Oct 2001
Location: Michigan
Posts: 247
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great! Thanks for your help!
Reply With Quote
  #6  
Old 01-18-2002, 02:45 PM
Crapforum Crapforum is offline
 
Join Date: Jan 2002
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by JamesUS
PHP Code:
  $jointime = (time() - $userinfo[joindate]) / 86400// Days Joined
  
if ($jointime 1) { // User has been a member for less than one day.
    
$postsperday "$userinfo[posts]";
  } else {
    
$postsperday sprintf("%.2f",($userinfo[posts] / $jointime));
  } 
Is it possible to run this code agains the db to get the user with the highest post per day?

Something like a "user of the day hack"

I tried it myself but i don't no how to do calculations with fieldvalues in a loop.

tia,
www.crapforum.nl
Reply With Quote
  #7  
Old 01-18-2002, 03:38 PM
Admin's Avatar
Admin Admin is offline
Coder
 
Join Date: Oct 2023
Location: Server
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't really understand what you are trying to do, but anyhow this code will give you the userid,username,postsperday and posts of the user with the highest posts per day ranking:
Code:
$user=$DB_site->query_first("SELECT userid,username,posts,(posts/((UNIX_TIMESTAMP(NOW())-joindate)/86400)) AS postsperday FROM user ORDER BY postsperday DESC");
Have fun.
Reply With Quote
  #8  
Old 01-20-2002, 06:10 PM
Crapforum Crapforum is offline
 
Join Date: Jan 2002
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thx for giving me some pointers here

i've got it working now.

you can checkit out on my forum.

www.crapforum.nl

topright "poster of the day"
Reply With Quote
  #9  
Old 01-21-2002, 08:43 AM
squawell's Avatar
squawell squawell is offline
 
Join Date: Oct 2001
Posts: 681
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by FireFly
I don't really understand what you are trying to do, but anyhow this code will give you the userid,username,postsperday and posts of the user with the highest posts per day ranking:
Code:
$user=$DB_site->query_first("SELECT userid,username,posts,(posts/((UNIX_TIMESTAMP(NOW())-joindate)/86400)) AS postsperday FROM user ORDER BY postsperday DESC");
Have fun.
where should i put this code??

functions or other else~~~??

could someone tell me??
Reply With Quote
  #10  
Old 02-11-2002, 09:00 PM
Brian Brian is offline
 
Join Date: Nov 2001
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I want to add this to the memberlist area. However when I do this it shows 0.00 for the posts per day :/

In memberlist.php on the top I added

Code:
$jointime = (time() - $userinfo[joindate]) / 86400; // Days Joined
  if ($jointime < 1) { // User has been a member for less than one day.
    $postsperday = "$userinfo[posts]";
  } else {
    $postsperday = sprintf("%.2f",($userinfo[posts] / $jointime));
  }
And then used the variable $postsperday in the memberlistbit template but it outputs 0.00 instead of their avb posts per day :/

Can anyone help

-Brian
Reply With Quote
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 02:45 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.04820 seconds
  • Memory Usage 2,259KB
  • Queries Executed 13 (?)
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
  • (3)bbcode_code
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete