vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Statistics Modifications - Top Thank Earners (monthly stats) for non-vb pages (https://vborg.vbsupport.ru/showthread.php?t=146277)

tanyeri24 05-04-2007 01:33 AM

Its working for you?

LBmtb 05-04-2007 02:40 AM

Quote:

Originally Posted by tanyeri24 (Post 1241022)
Its working for you?

I made a new version of it. Hopefully it's easier to use and configure. By default vbSEO URLs and using the cached queries technique is turned off. Make sure you read the instructions.

Let me know if that works for ya! :)

LBmtb 05-04-2007 02:50 AM

Quote:

Originally Posted by RMS-Chef (Post 1240959)
What kind of queries are involved here and can I alter it to update cache like every 12 hours instead? I just get a little worried since I have over 1.3 million "thanks" issued on my board. Thanks for any advice you may be able to give.

The query is:
Code:

SELECT p.username, p.userid
FROM {$this->db_prefix}post_thanks t INNER JOIN {$this->db_prefix}post p
ON t.postid = p.postid
WHERE t.date BETWEEN ". $this->beginning ." AND ". $this->end_month ."
ORDER BY date DESC

You CAN change the option for how long it takes to refresh the query. You'd have to supply constructor arguments to the class when you create the instance of it (in the php file). For a thourough rundown on what arguments it takes and how to do it, check out this link. It's on the last paragraph of page 272 and then beginning of the next page.

Let me know if you need help with that. Good luck!

Hornstar 05-04-2007 03:51 AM

hey nice work, i always like to see more hacks for non vb pages. ill give this a go another day tho. thanks.

tanyeri24 05-04-2007 04:32 PM

Quote:

Originally Posted by LBmtb (Post 1241049)
I made a new version of it. Hopefully it's easier to use and configure. By default vbSEO URLs and using the cached queries technique is turned off. Make sure you read the instructions.

Let me know if that works for ya! :)

Hi thanks for update. I get only a blank page with the codes in 3). At 4) I've again error code like this:
Code:

Fatal error: Cannot instantiate non-existent class: thanks in /usr/www/users/xxx/xxx.php on line 5
:erm: :o :(

fn9mm 05-15-2007 08:36 AM

Got it working for 1 month, however I'm experiencing probs when i want to display 2 months or more (PHP NOOB here:o )

Code for 1 month (working)
Code:

<?php
// change to true if you wish to use either of the following ...
$vbseo_urls = false;
$cached_technique = false;

if ($cached_technique)
{
        require 'Cache/DB.php';
}

if ($vbseo_urls)
{
        include_once "forum/includes/functions_vbseo.php";
}

require "thanks1-02.php";
?>
<?php
// NOTE: "$thisMonth" variable should be different for each table you're making (each instance of thanks class)
//        $string (required): Any variable name in form of a string (should be different for each table) 


// 2 months ago
$start_epoch = mktime(0, 0, 0, (date(m)-2), 1, date(Y));  // epoch for beginning of month
$end_epoch = mktime(23, 59, 0, (date(m)-1), 0, date(Y));  // epoch for end of month

$twoMonthsAgo = new thanks($start_epoch,$end_epoch);
$twoMonthsAgo ->grab_n_sort($string,$vbseo_url,$cached_technique);
$twoMonthsAgo ->print_chart(10,$table_summary);
       
?>

Code for 2 months (results in blank page)
Code:

<?php
// change to true if you wish to use either of the following ...
$vbseo_urls = false;
$cached_technique = false;

if ($cached_technique)
{
        require 'Cache/DB.php';
}

if ($vbseo_urls)
{
        include_once "forum/includes/functions_vbseo.php";
}

require "thanks1-02.php";
?>
<?php
// NOTE: "$thisMonth" variable should be different for each table you're making (each instance of thanks class)
//        $string (required): Any variable name in form of a string (should be different for each table) 


// 2 months ago
$start_epoch = mktime(0, 0, 0, (date(m)-2), 1, date(Y));  // epoch for beginning of month
$end_epoch = mktime(23, 59, 0, (date(m)-1), 0, date(Y));  // epoch for end of month

$twoMonthsAgo = new thanks($start_epoch,$end_epoch);
$twoMonthsAgo ->grab_n_sort($string,$vbseo_url,$cached_technique);
$twoMonthsAgo ->print_chart(10,$table_summary);
       
// 1 month ago       
$start_epoch = mktime(0, 0, 0, (date(m)-1), 1, date(Y)); // beginning of month epoch ex. 01/01/07 12:00 AM
$end_epoch = mktime(23, 59, 0, (date(m)), 0, date(Y)); // end of month epoch ex. 01/31/07 11:59 PM

$oneMonthAgo = new thanks($start_epoch,$end_epoch); 
$oneMonthsAgo ->grab_n_sort($string,$vbseo_url,$cached_technique);
$oneMonthsAgo ->print_chart(10,$table_summary);
?>

What am I doing wrong?
I guess it has something to do with the $string ?
What should i use in stead of $string for the other months,....?
tia

fn9mm 05-15-2007 10:00 AM

Solved like this,
is this a good code?
Code:

// This month
$string = 'thismonth';
$thisMonth = new thanks($start_epoch,$end_epoch); 
$thisMonth->grab_n_sort($string,$vbseo_url,$cached_technique); 
$thisMonth->print_chart(10,$table_summary);

// 1 month ago
$start_epoch = mktime(0, 0, 0, (date(m)-1), 1, date(Y));  // epoch for beginning of month
$end_epoch = mktime(23, 59, 0, (date(m)), 0, date(Y));  // epoch for end of month
$string = 'oneMonthsAgo';

$twoMonthsAgo = new thanks($start_epoch,$end_epoch);
$twoMonthsAgo ->grab_n_sort($string,$vbseo_url,$cached_technique);
$twoMonthsAgo ->print_chart(10,$table_summary);

// 2 months ago
$start_epoch = mktime(0, 0, 0, (date(m)-2), 1, date(Y));  // epoch for beginning of month
$end_epoch = mktime(23, 59, 0, (date(m)-1), 0, date(Y));  // epoch for end of month
$string = 'twoMonthsAgo';

$oneMonthsAgo = new thanks($start_epoch,$end_epoch);
$oneMonthsAgo ->grab_n_sort($string,$vbseo_url,$cached_technique);
$oneMonthsAgo ->print_chart(10,$table_summary);


bollie 07-18-2007 11:35 AM

nice ;)

vitrag24 08-20-2007 07:03 PM

when it'll be in alpha stage?
:D

vitrag24 09-15-2007 02:17 PM

no alpha yet?


All times are GMT. The time now is 08:50 PM.

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.01117 seconds
  • Memory Usage 1,751KB
  • 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
  • (5)bbcode_code_printable
  • (3)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