vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=192)
-   -   Forum Display Enhancements - See all threads of subforums in a main forum (https://vborg.vbsupport.ru/showthread.php?t=158760)

vBarab 09-24-2007 10:00 PM

See all threads of subforums in a main forum
 
open forumdisplay.php
find
---
$stickies = $db->query_read_slave("
SELECT thread.threadid, lastpost, open
FROM " . TABLE_PREFIX . "thread AS thread
WHERE forumid = $foruminfo[forumid]
AND sticky = 1
$visiblethreads
$limitothers
$globalignore
");
---
replace
---

$getparent_id = '';
$getparentid = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "forum WHERE parentid='" . $foruminfo[forumid] . "'");

if (mysql_num_rows($getparentid) 0) {
while ($getparentids = $db->fetch_array($getparentid)) {

$getparent_id .= ',' . $getparentids[forumid];

}
}

$stickies = $db->query_read_slave("
SELECT thread.threadid, lastpost, open
FROM " . TABLE_PREFIX . "thread AS thread
WHERE forumid IN (" . $foruminfo[forumid] . $getparent_id . ")
AND sticky = 1
$visiblethreads
$limitothers
$globalignore
");
// End SubThread


---
find
---
$getthreadids = $db->query_read_slave("
SELECT " . iif($sortfield == 'voteavg', $votequery) . " thread.threadid
$lastpost_info1
$hook_query_fields
FROM " . TABLE_PREFIX . "thread AS thread
$tachyjoin
$hook_query_joins
WHERE forumid = $foruminfo[forumid]
AND sticky = 0
$visiblethreads
$globalignore
$limitothers
$datecut
$hook_query_where
ORDER BY sticky DESC, $sqlsortfield $sqlsortorder
LIMIT $limitlower, $perpage
");
---
replace
---
$getparent_id = '';
$getparentid = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "forum WHERE parentid='" . $foruminfo[forumid] . "'");
if (mysql_num_rows($getparentid) 0) {
while ($getparentids = $db->fetch_array($getparentid)) {
$getparent_id .= ',' . $getparentids[forumid];
}
}

$getthreadids = $db->query_read_slave("
SELECT " . iif($sortfield == 'voteavg', $votequery) . " thread.threadid
$lastpost_info1
$hook_query_fields
FROM " . TABLE_PREFIX . "thread AS thread
$tachyjoin
$hook_query_joins
WHERE forumid IN (" . $foruminfo[forumid] . $getparent_id . ")
AND sticky = 0
$visiblethreads
$globalignore
$limitothers
$datecut
$hook_query_where
ORDER BY sticky DESC, $sqlsortfield $sqlsortorder
LIMIT $limitlower, $perpage
");
// End SubThread


---

open
threadbit
find :
---
<a href="showthread.php?$session[sessionurl]t=$thread[threadid]$thread[highlight]" id="thread_title_$thread[realthreadid]"<if condition="$show['gotonewpost']"> style="font-weight:bold"</if>>$thread[threadtitle]</a>
---

add after :

---
<span style="float:left"><a href="forumdisplay.php?f=$thread[forumid]">[$thread[forumtitle]]</a></span>
---

hack4: Fnan4arab

dj_f16 09-25-2007 09:40 PM

caps or demo?????

Hornstar 09-28-2007 05:44 AM

A demo of this would be great, and if forum 1 is set to now allow any posts, and only forum 2 and forum 3 are, then does that change anything?

matt3830 10-22-2007 12:54 PM

Great idea, but I couldn't get it to work.

rooban12 10-23-2007 07:35 PM

any samples?

weeno 11-23-2007 03:38 AM

looking for a sample also...

arn

matt3830 05-25-2008 04:58 PM

Could you upgrade this to 3.7?

koolfire 05-25-2008 05:21 PM

Get everythin in codez

hoku 06-08-2008 08:27 AM

nice hack, but a simple:
WHERE forumid IN ($foruminfo[forumid]," . implode(',',$foruminfo['childlist']) . ")
can do the same job in 1 line of code instead of 20, with no extra queries.

for 3.7.x version visit https://vborg.vbsupport.ru/showthread.php?t=181876


All times are GMT. The time now is 10:45 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.01231 seconds
  • Memory Usage 1,726KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete