vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Forum Home Enhancements - Random Thread (https://vborg.vbsupport.ru/showthread.php?t=193061)

GWLiaR 10-07-2008 10:00 PM

Random Thread
 
English:
What Does it?:This hack will add to Navbar Random Thread :).

Install:
+Go to admin Cp
+Plugin System -> Manage Products -> [Add/Import Product] -> Select
+'product-random_thread.xml' then İmport.

Find Navbar:
Code:

        <if condition="$show['pmwarning']"><div><strong><phrase 1="$vbphrase[pmpercent_nav_compiled]">$vbphrase[your_pm_box_is_x_full]</phrase></strong></div></if>
Add Below:
Code:

$rthread
Mark As Installed

GWLiaR 10-08-2008 11:41 AM

*Reserved

TilkiBey 10-08-2008 11:50 AM

pls renew ur ss with supporting file types (jpg,jpeg etc.)

bmp desteklenmiyor inferno,direkt g?z?kmesi daha hoş olur demo g?r?nt?n?n;)

GWLiaR 10-08-2008 11:53 AM

Quote:

Originally Posted by TilkiBey (Post 1640219)
pls renew ur ss with supporting file types (jpg,jpeg etc.)

bmp desteklenmiyor inferno,direkt g?z?kmesi daha hoş olur demo g?r?nt?n?n;)

D?zelttim..
Added JPEG Demo :)

NAZIA 10-08-2008 02:14 PM

reserved...

noppid 10-08-2008 02:36 PM

That query will/could bring a forum to it's knees running every page view.

Code:

mysql> explain Select * From thread order by rand() DESC LIMIT 1
    -> ;
+----+-------------+--------+------+---------------+------+---------+------+------+---------------------------------+
| id | select_type | table  | type | possible_keys | key  | key_len | ref  | rows | Extra                          |
+----+-------------+--------+------+---------------+------+---------+------+------+---------------------------------+
|  1 | SIMPLE      | thread | ALL  | NULL          | NULL | NULL    | NULL | 6026 | Using temporary; Using filesort |
+----+-------------+--------+------+---------------+------+---------+------+------+---------------------------------+
1 row in set (0.03 sec)

As you can see, a full table walk.

Here's a better way.

Code:

60*60 == 3600
3600*24 == 14400
14400*30 == 432000
1223479602 - 432000 == 1223047602

mysql> explain Select * From thread where dateline >= 1223047602 order by dateline DESC limit 1;
+----+-------------+--------+-------+---------------+----------+---------+------+------+-------------+
| id | select_type | table  | type  | possible_keys | key      | key_len | ref  | rows | Extra      |
+----+-------------+--------+-------+---------------+----------+---------+------+------+-------------+
|  1 | SIMPLE      | thread | range | dateline      | dateline | 4      | NULL |  104 | Using where |
+----+-------------+--------+-------+---------------+----------+---------+------+------+-------------+
1 row in set (0.00 sec)

See the difference? Gotta use those indexes. Rand() is bad.

ahtapod 10-08-2008 05:44 PM

It runs wrong.

When used, it transfers users to wrong thread. :(

MrZeropage 10-08-2008 06:51 PM

Attention - this does not take care of hidden forums or forumpermissions, means it could also bring up a thread from your internal hidden administrator-forum...

noppid 10-08-2008 06:55 PM

Add "AND forumid not in(1,2,3)" to the query.

This hack needs a lot of work.

yousellstuff 10-12-2008 11:05 PM

whats the point of this


All times are GMT. The time now is 03:43 AM.

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.01068 seconds
  • Memory Usage 1,736KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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