Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.


Search for REALLY old threads / posts


Login or Register to Reply

 
Thread Tools Search this Thread
# 8  
Hey Rudi,

If I post the search.php and the HTML template file are you willing to come up with the PHP and HTML code mods to create your "Search By Year" option for this feature request?
# 9  
I am keen to help / contribute, but am afraid my capabilities are limited. I promise to have a deeper look into the project, but I'll have to start from zero with php, code mods, and HTML.
# 10  
OK.. "mai pen rai" .... I think this is the basic PHP ....

Code:
<?php
if ($vbulletin->GPC['searchbyyear'] >= 2000 and $vbulletin->GPC['searchbyyear'] <= $date('Y')) {
    $start_year_unixtime = $mktime(0, 0, 0, 1, 1, $vbulletin->GPC['searchbyyear']);
    $end_year_unixtime = $mktime(23, 59, 59, 12, 31, $vbulletin->GPC['searchbyyear']);
    $thread_query_logic[] = "thread.dateline >= " . $start_year_unixtime . " thread.dateline <= " . $end_year_unixtime;
}

I think I just add this logic above ... and set up the HTML and the HTTPD $_POST for this new $vbulletin->GPC['searchbyyear'] var and we are all set.
# 11  
WAIT!

That will only give threads you started.....

You need all your individual posts, right?

Or do you need all threads you have posted in?
# 12  
We should go for individual posts, as threads would be accessible from there, wouldn't they? And, the limit to 500 posts should be dropped as there could be more in one year.
# 13  
Yes... I see that Smilie



Code:
mysql> select count(*) from post where dateline > UNIX_TIMESTAMP(20180101) and dateline < UNIX_TIMESTAMP(20190101) AND username = 'RudiC';
+----------+
| count(*) |
+----------+
|     1841 |
+----------+
1 row in set (0.03 sec)

mysql> select count(*) from post where dateline > UNIX_TIMESTAMP(20170101) and dateline < UNIX_TIMESTAMP(20180101) AND username = 'RudiC';
+----------+
| count(*) |
+----------+
|     1851 |
+----------+
1 row in set (0.03 sec)

mysql> select count(*) from post where dateline > UNIX_TIMESTAMP(20160101) and dateline < UNIX_TIMESTAMP(20170101) AND username = 'RudiC';
+----------+
| count(*) |
+----------+
|     2502 |
+----------+
1 row in set (0.05 sec)

mysql> select count(*) from post where dateline > UNIX_TIMESTAMP(20150101) and dateline < UNIX_TIMESTAMP(20160101) AND username = 'RudiC';
+----------+
| count(*) |
+----------+
|     2638 |
+----------+
1 row in set (0.06 sec)

mysql> select count(*) from post where dateline > UNIX_TIMESTAMP(20140101) and dateline < UNIX_TIMESTAMP(20150101) AND username = 'RudiC';
+----------+
| count(*) |
+----------+
|     1722 |
+----------+
1 row in set (0.08 sec)

mysql> select count(*) from post where dateline > UNIX_TIMESTAMP(20130101) and dateline < UNIX_TIMESTAMP(20140101) AND username = 'RudiC';
+----------+
| count(*) |
+----------+
|     2407 |
+----------+
1 row in set (0.15 sec)


mysql> select count(*) from post where dateline > UNIX_TIMESTAMP(20120101) and dateline < UNIX_TIMESTAMP(20130101) AND username = 'RudiC';
+----------+
| count(*) |
+----------+
|      829 |
+----------+
1 row in set (0.12 sec)

mysql> select count(*) from post where dateline > UNIX_TIMESTAMP(20110101) and dateline < UNIX_TIMESTAMP(20120101) AND username = 'RudiC';
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (0.14 sec)

# 14  
Hey Rudi,

Here is the current draft PHP query for this.

Seems to fit the bill what you asked for.

Code:
<?php
if ($vbulletin->GPC['searchbyyear'] >= 2000 and $vbulletin->GPC['searchbyyear'] <= $date('Y')) {
    $max_results = 3000;
    $start_year_unixtime = $mktime(0, 0, 0, 1, 1, $vbulletin->GPC['searchbyyear']);
    $end_year_unixtime = $mktime(23, 59, 59, 12, 31, $vbulletin->GPC['searchbyyear']);
    $nl_query_limit = 'LIMIT ' .   $max_results;
    $thread_query_logic[] = "post.dateline >= " . $start_year_unixtime . " thread.dateline <= " . $end_year_unixtime;
}

This User Gave Thanks to Neo For This Post:
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

1 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

How do i delete threads/posts?

I cannot find the option anywhere when i click on "Edit". (2 Replies)
Discussion started by: johnthebaptist
2 Replies

Featured Tech Videos