PDA

View Full Version : Forum Display Enhancements - All Topic / Master Forums - View Threads from Multiple Forums in a Master Forums


BirdOPrey5
06-27-2010, 10:00 PM
This a complete and total upgrade to version 2.0!

This mod is now an importable product, there are no more manual file edits.

In addition this mod will be able to auto edit your templates if you run the standard threadbit template, otherwise there are instructions in the zip file for manual template edits if needed.

What does this mod do? - Basically this is only the most awesomest mod ever for vBulletin. You can now view threads from other forums in "Master Forums" you designate.

For example on my site "Off Topic" is my "Master Forum" and virtually all other forums are assigned to the Master Forum offering user's the ability to browse 1 forum while seeing threads from many others.

New in version 2.0: You can now have multiple master forums.

See the screen shots for an example.

All instructions are included in the zip file.

As pointed out by phpdesk you must have at least 1 thread in your master forum for this to work.

I have tested this on VB 3.8.6 and am sure it will work on all 3.8 versions. I also strongly believe it will work as far back as VB 3.6 but can't test it myself.

This will not work for vBulletin 4.0, do not try to install it. The VB4 Version is here. (https://vborg.vbsupport.ru/showthread.php?t=245839)

If you used the old version revert your forumdisplay.php file back to it's original condition before installing.

Please Mark as Installed if you use this. :)

You can mostly ignore all posts in this thread up to post #28. Old posts are not longer relevant to this new version. (Note: post #7 is still relevant if you have only 1 master forum.)

Upgrade to Version 2.1 (March 3, 2011)
Fixes a bug where the master forum wouldn't display as many pages as there were posts.

F0xy
06-28-2010, 05:28 PM
any chance of a screenshot or a demo?

BirdOPrey5
06-28-2010, 08:04 PM
I attached a couple of screen shots... This is up and running on my forum, www.juot.net, but you need to register to see my main off-topic which is my 'master' forum.

BirdOPrey5
06-29-2010, 04:06 AM
OK I made an optional update to this mod...
This will give users the option of turning this mod off if they would rather not see all the forums you've chosen in a 'master' forum. Install this ONLY if you want to give users a choice.

First in Admin CP go to the menu on the left and choose "Add New User Profile Field" under "User Profile Fields."

Choose "Single Selection Radio Box" from the drop down menu...

On the next screen set the following...

Title: All Topic
Description: Use this setting to enable or disable the 'All Topics' system. [or whatever description you want obviously]
Options:
Yes
No
Field Required: Yes, at registration and...
Private/Field Searchable.../Display on... All "No"
Display Page: Options: Thread Viewing
Leave all other settings to default and hit "Save" to create the profile field.

Inform users the option now exists... The code below is designed so even if a user doesn't make a selection it is enabled by default so they only need to change it to 'opt out.'

Now we'll make the forumdisplay.php edits mentioned in the top post of this thread. Make those same edits except change all the IF statements to the one below:

if (($foruminfo[forumid] == 1) && ($vbulletin->userinfo['field5'] != "No"))

Replace the number 1 of course with the forumid of your "master" forum... Replace 'field5' with the profile field name that was auto created when added the profile field above. Go to "User Profile Field Manager" to see the name the field was given.

And that's that, you now have an "All Topics" system that can be turned on or off by each member.

Kolektor
06-29-2010, 12:01 PM
you know I like this idea :)

Thanks for sharing.

BirdOPrey5
06-30-2010, 03:26 AM
Thanks... I've come up with another add-on / option for this mod...

If you want to edit a thread's title to reflect it is a thread outside of your 'master forum' do the following...

Edit the threadbit template.

Find:


<if condition="$show['sticky']"> <img class="inlineimg" src="$stylevar[imgdir_misc]/sticky.gif" alt="$vbphrase[sticky_thread]" /> </if>
</span>
</if>

After this add:

<if condition="$vbulletin->userinfo['field5'] != 'No'">
<if condition="($foruminfo[forumid] == 1) AND ($thread[forumid] != 1)">[X]</if></if>

Replace the two instances of "1" with the forumid of your master forum. Replace 'field5' with the field name of your opt-in field discussed in post #4 in this thread. If you are not using the opt-in system then instead add the following code:

<if condition="($foruminfo[forumid] == 1) AND ($thread[forumid] != 1)">[X]</if>


You can obviously change "[X]" with any text or code you'd like... in fact I went a step further personally... I have a unique status icon for each of my forums so I used a mini version (18 pixels square) of each icon in place of the [X]. To do this I renamed each icon to be the forumid number of each forum. Then in place of [X] I used:

<img src="/forums/images/ministatus/$thread[forumid].gif" border="0" align="absmiddle">

Of course you'd set the directory path to wherever you uploaded your images. Doing this will produce results like in my screen shot (but with your images of course.) I recommend 18x18 pixel graphics so they are the same size as standard text but any size icons will work.

https://vborg.vbsupport.ru/attachment.php?attachmentid=119023&d=1277871950

BirdOPrey5
06-30-2010, 03:38 AM
One additional change I made that I find works well with a "Master Forum" is to edit your forumjump template to add a 'quick link' back to your 'master forum.' This is because users may be used to using the forum jump menu to quickly return to the forum they were previously browsing, but if they followed a link from your 'master forum' the forum jump menu will send them back to the listing for the forum the thread is 'really' in.

This link can be used to always return users to the 'master forum' in one click and doesn't take up any room on the page that wouldn't otherwise be wasted.

Edit your forumjump template...

Find:

<strong>$vbphrase[forum_jump]</strong><br />


Replace With:

<strong>$vbphrase[forum_jump]: <a href="/forums/forumdisplay.php?f=1">Jump to Master Forum</a></strong><br />


As always replace the number "1" with the forumid of your master forum. Edit "Jump to Master Forum" and the file path to suit your needs, I personally used "Jump to Off-Topic"

Screen Shot:
https://vborg.vbsupport.ru/attachment.php?attachmentid=119024&d=1277872725

funmasti
06-30-2010, 07:00 AM
its great, but can u make a XML (product installation) file?

BirdOPrey5
06-30-2010, 07:05 AM
No, unfortunately I don't know how to put php file edits into an xml file, or if it's even possible due to the edits needed... but I give my permission for someone else to do so if they have the know-how.

ChuteBoxe
07-01-2010, 02:28 AM
Great mod. Does everything that it says it does, and is rather easy to install.

Only question is, is it possible to break it down to a per thread basis?

Maybe like, posts that are moved from the offtopic forum to the subforum, are the only ones that show in both forums?

BirdOPrey5
07-01-2010, 12:53 PM
well anything is possible but to do what you ask would mean adding an additional field to the thread table specifying if the thread had ever been moved, then the query to list threads would have to be updated to reflect on threads from the main forum or threads from other forums where "hasbeenmoved" = 1 or such... plus we'd need to edit the move command to set that flag- maybe other changes too- so yes it's possible but I doubt I could program such a mod let alone make it easy to install.

I am looking into making this an installable product, if I figure it out I will update this with an install file option but from what I've read so far performance will be best the way I have it now, as a direct file edit.

James T Brock
07-01-2010, 08:23 PM
Thanks for releasing this! Awesome job.

vat0r
07-03-2010, 05:23 PM
I'm trying to get this working with 3.8.5 and all I'm getting is a white screen on forumdisplay. I tried disabling all other mods and switching themes with no luck. I've done the edits several times to make sure I had no typos as well. I used only the required edits in the first post. As far as I can tell the relevant code to be replaced is the same as in your guide. Any ideas?

BirdOPrey5
07-03-2010, 05:42 PM
I upgraded to 3.8.5 last night and still working great after I redid the edits... sending you a PM that might help with the edits... If that still doesn't work please let me know what mods you are using and will see what I can do...

Also if you have a link to your forum I can see if anything looks like it may interfere.

vat0r
07-03-2010, 09:37 PM
Thanks to you I got it cleared up. Much appreciated.

BirdOPrey5
07-06-2010, 04:37 AM
I was asked in another thread if this could be adopted to have multiple 'master forums' and yes it can, I shied away from sharing this because I didn't want to make it too daunting looking for most users who only need 1 master forum.

To have multiple master forums simply add an "elseif" statement below the if { } code and above the else { } code... for example in the first edit add to the middle:

elseif ($foruminfo[forumid] == 7) {
$threadscount = $db->query_first_slave("
SELECT COUNT(*) AS threads, SUM(IF(thread.lastpost > $lastread AND open <> 10, 1, 0)) AS newthread
$hook_query_fields
FROM " . TABLE_PREFIX . "thread AS thread
$tachyjoin
$hook_query_joins
WHERE forumid IN (7, 8, 9, 10)
AND sticky = 0
$prefix_filter
$visiblethreads
$globalignore
$limitothers
$datecut
$hook_query_where
");
}


This would make the entire code for the first edit look like:


//Edit added if-else statement
if ($foruminfo[forumid] == 2) {
$threadscount = $db->query_first_slave("
SELECT COUNT(*) AS threads, SUM(IF(thread.lastpost > $lastread AND open <> 10, 1, 0)) AS newthread
$hook_query_fields
FROM " . TABLE_PREFIX . "thread AS thread
$tachyjoin
$hook_query_joins
WHERE forumid IN (2, 3, 4, 5)
AND sticky = 0
$prefix_filter
$visiblethreads
$globalignore
$limitothers
$datecut
$hook_query_where
");
}
elseif ($foruminfo[forumid] == 7) {
$threadscount = $db->query_first_slave("
SELECT COUNT(*) AS threads, SUM(IF(thread.lastpost > $lastread AND open <> 10, 1, 0)) AS newthread
$hook_query_fields
FROM " . TABLE_PREFIX . "thread AS thread
$tachyjoin
$hook_query_joins
WHERE forumid IN (7, 8, 9, 10)
AND sticky = 0
$prefix_filter
$visiblethreads
$globalignore
$limitothers
$datecut
$hook_query_where
");
}
else {
$threadscount = $db->query_first_slave("
SELECT COUNT(*) AS threads, SUM(IF(thread.lastpost > $lastread AND open <> 10, 1, 0)) AS newthread
$hook_query_fields
FROM " . TABLE_PREFIX . "thread AS thread
$tachyjoin
$hook_query_joins
WHERE forumid = $foruminfo[forumid]
AND sticky = 0
$prefix_filter
$visiblethreads
$globalignore
$limitothers
$datecut
$hook_query_where
");
}


In this case you'd change the number 7 to your second master forum id, and 7,8,9,10 to your secondary forum id's (and your master).

You can add as many elseif { } statements as you need for various master forums, and you can even have secondary forums be shared between multiple master forums so forumid '10' for example can be a secondary forum of master forum 2 and 7, there is no problem doing this.

Once you make this elseif{} addition for the first edit you need to make similar edits for the second (optional) and third (required) edits. Just copy the entire 'if' statement for each starting with "if" and ending with "}" then copy and paste it below the if statement, change it from "if" to "elseif" and set the forum id numbers as needed.

It sounds more complicated then it is but can get messy quick if you have a lot of master forums... on the plus side conditionals are very efficient as coding goes and there should be no noticeable decrease in performance no matter how many you realistically have.

sinpin
07-06-2010, 08:14 AM
Great idea,
I did those steps correctly, but it didn't work for me (vb 3.8.2)

Do I must write my forum Ids manually?
If so, it's a bad way (hard code) and it's better to use a recursive function to retrieve hierarchical data automatically.

temporary uninstalled...

I think it must be as default feature in vb

BirdOPrey5
07-06-2010, 01:20 PM
Yes you must write the forum ID's manually... I have this working down on 3.7 so I'm 99.9% sure it should work on 3.8.2 with the correct code edits. I am familiar with recursive functions but honestly don't see how it would apply here. I debated making the forum id's a declaration in only 1 place but I thought the code was neater this way, obviously if you know what you're doing you could do it either way, the crux of this code is merely the placement of the "If" statements and the WHERE clause.

sinpin
07-08-2010, 03:46 AM
it's better to use a recursive function to retrieve hierarchical data automatically.

I checked the Forum's table again,
in fact no need to use recursive function;
while there are 2 handy fields in this table that simplify the work:
1- childlist: stores list of all childs
2- parentlist: stores list of all parents

BirdOPrey5
07-13-2010, 07:49 PM
I can confirm this still works in 3.8.6 with the same changes.

If you are updating to 3.8.6 from 3.8.5 you can keep using your 3.8.5 file provided you make the following small change:

Find the two instances of:
IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid

and replace them both with:

IF(user.displaygroupid=0, user.usergroupid, user.displaygroupid) AS displaygroupid, infractiongroupid

f you can't 'find' the text above via 'find/replace' you probably have an extra blank space at the end of the text, it IS there in 3.8.5.

FleXy
08-11-2010, 01:17 PM
great idea and job, looking for something like this for 2 years! Need mod to simple upload and install. Maybe somebody can realise this at this way: create you own forumdisplayS.php file (modificated). and then we will create "Master Forum". Then install Plugin. Plugin will get option (ID of master forum from settings) and replace the url on Index.php to step users to forumdisplayS.php (modificated). all other options will be stored also at the db and edited from plugin setting menu.

sorry for my english, but the main idea to use 3th part forumdisplayfile.php and substitute there file only for master forum. Substituton need to do with MOD while parse_templated for forumid used by setting (or simple redirect another forum to url or forumdisplayfile.php?f=masterforum). Other setting will be managed by Plugin.

kjsmith84
08-20-2010, 03:12 PM
is ther a way to do this reverse?
I want to take a thread and have it show in mutiple subforums

BirdOPrey5
08-20-2010, 03:18 PM
There is no way I know of of doing this 'per thread.' That is what I was originally looking for and made requests but never found it.

kjsmith84
08-20-2010, 03:40 PM
There is no way I know of of doing this 'per thread.' That is what I was originally looking for and made requests but never found it.

ok I want all threads in one main subforum to show in 5 different sub forums. how do i do this?

do the #16 post?

I have 5 subforums on 5 seperate forum pages- If I post a thread in any one of those 5 subforums I want the thread to show in all the other sbuforums- this is what Im trying to achieve.

BirdOPrey5
08-20-2010, 03:49 PM
Yes, the instructions in post 16 would work but it's going to look really messy with all those else statements... unfortunately it's the only way I know of to do this.

nando99
09-07-2010, 06:48 PM
I'm trying to install this on 3.8.2 and I'm getting the following error:

Database error in vBulletin 3.8.2:

Invalid SQL:

SELECT thread.threadid,
thread.lastpost, thread.lastposter, thread.lastpostid, thread.replycount, IF(thread.views<=thread.replycount, thread.replycount+1, thread.views) AS views

FROM thread AS thread


WHERE forumid (8, 51, 52, 54, 55)
AND sticky = 0

AND visible IN (0,1,2)




ORDER BY sticky DESC, lastpost DESC
LIMIT 0, 20;

MySQL Error : FUNCTION xwnet_1sk.forumid does not exist
Error Number : 1305


I know you tried it on 3.8.4+ but I was wondering if you can help me out...

thanks in advance,

nando

nando99
09-07-2010, 07:18 PM
nevermind, I got it - just redid it a few times - still not sure where i messed up initially... oh well.. thanks 4 the mod!

BirdOPrey5
12-22-2010, 04:47 AM
Major Upgrade On This Mod!

Totally new version is now a product file you can install, no file edits needed!

If you used the old version revert your forumdisplay.php file back to it's original condition before installing.

grey_goose
12-23-2010, 05:22 PM
- Easy install
- Works perfectly
- Great idea
- Nominated

m_7
12-26-2010, 03:11 AM
Great .

Thank you .

TitanJeff
12-28-2010, 07:57 PM
Nice idea but is there a way for the user to turn it off?

BirdOPrey5
12-28-2010, 09:18 PM
Not at the moment but it's a feature I plan on adding soon. Some admins wouldn't want to allow users to turn it off so I would have to make an option both to allow admins to decide if users can turn it off, and if so, actually let users turn it off...

For the time being I allow it on my own site using a custom profile field and a hack of the code but I wouldn't suggest someone who isn't comfortable programming php and vbulletin try this yet.

BirdOPrey5
01-16-2011, 02:23 PM
It has been discovered that you must have at least 1 thread in your master forum for this to work.

MD_Hacker
01-31-2011, 02:21 PM
Would be nice if you had a feature that made the "master forum" use the same format as a forum search does, but with the appearance of an actual forum. By this I mean having a "forum" column at the end of the rows instead of displaying the sub-forum beside the username.

BirdOPrey5
01-31-2011, 02:33 PM
I tried that first but could never get it to work right.

alex_vaa
03-02-2011, 02:23 PM
Thanks for a great mod.
But I noticed that there is so much, they do not all appear in the master forum, but only one page.

BirdOPrey5
03-02-2011, 03:47 PM
Thanks for a great mod.
But I noticed that there is so much, they do not all appear in the master forum, but only one page.

Yes, I see... I will be releasing an update shortly that will work on 3.8.6 and 3.8.7 and fix this issue.

If you want to fix it yourself, it may be a few days before I post the final version, you can edit the plugin: All Topic Forumdisplay Thread Count

Add:

$hook_query_joins = "/*";
$hook_query_where = "*/ WHERE forumid IN ($alltopics) AND sticky = 0 $prefix_filter $visiblethreads $globalignore $limitothers $datecut";


Right above the final:
}
(the last line of the plugin)


I have not tested this on earlier 3.8 versions, only 3.8.6 and 3.8.7.

alex_vaa
03-03-2011, 10:23 AM
Wow, thank you very much. Nominate!

BirdOPrey5
03-03-2011, 12:37 PM
I have upgraded this to version 2.1 to fix the bug mentioned above. It should work on all 3.8.x, 3.7.x, and 3.6.x versions.

Amenadiel
03-22-2011, 08:25 PM
I just checked the plugin in which you comment a large chunk of original code. It's absolutely breathtaking.

I wish every VB query had a way to do that. I'd pretty much rewrite most of them.

(Which I won't do by altering the core files)

BirdOPrey5
03-22-2011, 11:09 PM
I just checked the plugin in which you comment a large chunk of original code. It's absolutely breathtaking.

I wish every VB query had a way to do that. I'd pretty much rewrite most of them.

(Which I won't do by altering the core files)

Yeah, we got lucky with that... Unfortunately they screwed it up in VB 4.x so for 4.x version you need to do a manual file edit or live with the bug that not all posts are displayed- not a big deal for large forums (lots of posts) but very noticeable on small forums that just have a page or two of posts.

Run!
03-30-2011, 10:04 AM
First off this is great - thanks a lot!

Secondly, is there any possibility of doing something similar for vB4? I've been trying to do something similar to this for a while so that we could have:

Australia Forum -> Subforums: Politics, Sport, News
New Zealand Forum -> Subforums: Politics, Sport, News

And then we could use the mod to have a Politics forum (with topics from both politics subforums) a sports forum and a news forum.

BirdOPrey5
03-30-2011, 10:47 AM
The VB4 version is linked in the top post.

Run!
03-30-2011, 05:11 PM
The VB4 version is linked in the top post.

Brilliant - thank you. :)

0ptima
08-10-2011, 12:01 AM
I installed this, but the Forumdisplay Thread Count is not working. When viewing the forum list, the master forum looks empty. When I click on the master forum, all the threads are shown. Im on VB 3.8.6

BirdOPrey5
08-10-2011, 03:39 PM
<span style="text-decoration: line-through">This mod does not affect anything on Forumdisplay.</span> The thread counts remain the same because the threads really are in their original forums, this mod simply lets you see threads from multiple forums in one- it doesn't move or copy the actual thread.

0ptima
08-10-2011, 03:59 PM
thanks for the info. What does these hooks, forumdisplay_query_threadscount and
forumdisplay_query_threadid do?

BirdOPrey5
08-10-2011, 06:07 PM
Sorry I thought you were talking about forumhome earlier. What I meant to say is this mod does not affect forumhome. The hooks you mention change the database query to select all threads from all forums selected as part of the master forum.

0ptima
08-10-2011, 06:58 PM
I was talking about forumhome.... oh well, its a neat mod anyway.

Undertaker #59
08-15-2011, 06:31 PM
Quick question before I see if this will work for me.

In your screen shot, it shows the new thread button. How does that work? In which forum will the new thread appear?

BirdOPrey5
08-15-2011, 07:42 PM
The new thread appears in the master forum.

Undertaker #59
08-15-2011, 07:57 PM
I'll have to test it out, but I am wondering if I can not allow new threads in this forum, but still allow replies. Basically I want to use this mod as a way to view and reply to threads from multiple forums, but I want new threads to be placed in the proper forum for those who choose not to use the master forum view and view the forums singly.

BirdOPrey5
08-15-2011, 08:06 PM
Each thread remains in its own forum... When someone is viewing the master forum the "New Thread" button will put a thread in the Master Forum as if ti was any other forum.

If someone clicks on a thread that is shown in the Master Forum but is from another forum, say Forum 2, then once the user clicks on it they will be in Forum 2. If they use the Forum Jump menu for example they will be taken "back" to Forum 2. That's why on my forum I edited the Jump Menu to include a link back to my master forum at all times.

Best way to understand is just to try it.

punchbowl
08-20-2011, 08:04 AM
Brilliant mod. Just testing it on 3.8 but hopefully it'll bring order to chaos when we upgrade to vb4 too.

Anyone tested this on the vb mobile apps/tapatalk? (I saw something about it not being compatible with tapatalk in this thread or the vb4 one)

If I wanted to force users to select a forum when they hit post new thread when in the master forum I'd have to edit the newthread.php as well as the template wouldn't I? (thinking aloud - I could do it with a plugin)

Cheers!

BirdOPrey5
08-20-2011, 11:15 AM
I know it doesn't work with Tapatalk, not sure about vbulletin mobile app. For Tapatalk I find a lot of people use the "New Posts" feature anyway.

Yes you can edit new thread to ask where to post, but I haven't done it.

Undertaker #59
08-20-2011, 02:27 PM
I would love that feature (having it prompt for forum on new thread).

Anyway, downloading and installing now.

hpidriver
09-01-2011, 03:23 AM
Marked as installed! great mod, extremely useful thank you.

I have a question - I have a forum that is being used a master forum. Where would I edit to have the sub-forums be displayed above the threads (so the opposite as in your first example screenshot)
tia

BirdOPrey5
09-01-2011, 11:22 AM
Marked as installed! great mod, extremely useful thank you.

I have a question - I have a forum that is being used a master forum. Where would I edit to have the sub-forums be displayed above the threads (so the opposite as in your first example screenshot)
tia

To do that best way would be to not use the auto template edit on the threadbit and do the manual edit instead- per the instructions:


Manual Template Edit for vBulletin 3.x series:

In your Admin CP -> Styles & Templates -> Style Manager
Choose your style(s) and go to Edit Templates
Scroll down to Threadbit Templates -> threadbit

In the threadbit template find the code:

<if condition="$show['guestuser']">
$thread[postusername]


And directly after it add the following code:
For your request instead put this code directly BEFORE the above:

<if condition="$thread[forumid] != $foruminfo[forumid]">&nbsp;-&nbsp;$thread[forumtitle]</if>

Also find the code:

<span style="cursor:pointer" onclick="window.open('member.php?$session[sessionurl]u=$thread[postuserid]', '_self')">$thread[postusername]</span>

And REPLACE it with:

<span style="cursor:pointer" onclick="window.open('member.php?$session[sessionurl]u=$thread[postuserid]', '_self')">$thread[postusername]<if condition="$thread[forumid] != $foruminfo[forumid]">&nbsp;-&nbsp;$thread[forumtitle]</if></span>



changes in red.

James T Brock
10-24-2011, 08:44 PM
I am getting the below error. Any ideas on how to fix this?

Database error in vBulletin 3.8.5:

Invalid SQL:

SELECT COUNT(*) AS threads,
(
SELECT COUNT(*) AS newthread
FROM thread AS thread
WHERE forumid = 22
AND lastpost > 1319489077
AND open <> 10
AND sticky = 0

AND visible IN (0,1,2)



*/ WHERE forumid IN (22) AND sticky = 0 AND visible IN (0,1,2)
) AS newthread

FROM thread AS thread

/*
WHERE forumid = 22
AND sticky = 0

AND visible IN (0,1,2)



*/ WHERE forumid IN (22) AND sticky = 0 AND visible IN (0,1,2);

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*/ WHERE forumid IN (22) AND sticky = 0 AND visible IN (0,1,2)
) AS newth' at line 14
Error Number : 1064
Request Date : Monday, October 24th 2011 @ 01:44:44 PM
Error Date : Monday, October 24th 2011 @ 01:44:44 PM
Script : http://website.com/forumdisplay.php?f=22
Referrer : http://website.com/forumdisplay.php?f=11
IP Address : xx.xx.xx.xx
Username : admin
Classname : vB_Database
MySQL Version : 5.1.52-log

BirdOPrey5
10-25-2011, 12:07 AM
I am getting the below error. Any ideas on how to fix this?

Database error in vBulletin 3.8.5:

Invalid SQL:

SELECT COUNT(*) AS threads,
(
SELECT COUNT(*) AS newthread
FROM thread AS thread
WHERE forumid = 22
AND lastpost > 1319489077
AND open <> 10
AND sticky = 0

AND visible IN (0,1,2)



*/ WHERE forumid IN (22) AND sticky = 0 AND visible IN (0,1,2)
) AS newthread

FROM thread AS thread

/*
WHERE forumid = 22
AND sticky = 0

AND visible IN (0,1,2)



*/ WHERE forumid IN (22) AND sticky = 0 AND visible IN (0,1,2);

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*/ WHERE forumid IN (22) AND sticky = 0 AND visible IN (0,1,2)
) AS newth' at line 14
Error Number : 1064
Request Date : Monday, October 24th 2011 @ 01:44:44 PM
Error Date : Monday, October 24th 2011 @ 01:44:44 PM
Script : http://website.com/forumdisplay.php?f=22
Referrer : http://website.com/forumdisplay.php?f=11
IP Address : xx.xx.xx.xx
Username : admin
Classname : vB_Database
MySQL Version : 5.1.52-log

One of two things is the problem...

1) You have another mod using the hook forumdisplay_query_threadscount. In plugin manager see if any other plugin is using that hook and if so let me know which mod and I'll take a look.

Or

2) Are you using a modified or different forumdisplay.php file then came with your version. Please replace your forumdisplay.php with a copy from the original 3.8.5 install. (Keep a backup in case of anything.)

James T Brock
10-25-2011, 03:16 AM
One of two things is the problem...

1) You have another mod using the hook forumdisplay_query_threadscount. In plugin manager see if any other plugin is using that hook and if so let me know which mod and I'll take a look.

vbOptomize Pro. I confirmed it's what's causing the issue, when I disable that hook it works.

Anyway to have them both working together? This is the code in that hook location...

if (class_exists('vb_optimise'))
{
$vars = array(
'lastread' => $lastread,
'hook_query_fields' => $hook_query_fields,
'tachyjoin' => $tachyjoin,
'hook_query_joins' => $hook_query_joins,
'forumid' => $foruminfo['forumid'],
'prefix_filter' => $prefix_filter,
'visiblethreads' => $visiblethreads,
'globalignore' => $globalignore,
'limitothers' => $limitothers,
'datecut' => $datecut,
'hook_query_where' => $hook_query_where,
);

vb_optimise::cache('forumdisplaysub', $db, $vars);
}

BirdOPrey5
10-25-2011, 10:19 AM
Try changing the execution order of the plugin on forumdisplay_query_threadscount.

It is usually "5" - try changing it to "2" or "8" and see if either makes a difference.

James T Brock
10-29-2011, 07:13 PM
Thank you, changing the execution order did fix the issue. One last question, I noticed in the 4.0 version of this mod there is a way to have sticky threads show in the master forum, how do you do it in the 3.8 version of the mod?

BirdOPrey5
10-29-2011, 08:31 PM
I haven't released the updated version for 3.8 yet. If you want to show stickies you can edit the two forumdisplay_query_ plugins...

Find all "sticky = 0" and change it to "sticky = 1" in each plugin.

James T Brock
11-01-2011, 02:10 AM
If you do that ALL threads disappear except for the stickies.

BirdOPrey5
11-01-2011, 10:59 AM
Sorry. I didn't have this version still installed on my test servers.

Change "sticky = 0" to "sticky = 0 OR sticky = 1" in both plugins

punchbowl
11-17-2011, 02:07 PM
it shows threads in the list even if the member has no perms. i.e. if I include nsfw and mod forums in my master forum users will see those threads in the list even if they haven't got perms to see them.

They can't actually open the threads but they still appear in the list.

Is that the same in the vb4 version?

tia

I kinda like it this ^^^ way tbh BUT in the new version if you did * would you be showing (for instance) mod only thread titles in your master forum.

Edit: Get well soon man!

BirdOPrey5
11-19-2011, 05:49 PM
it shows threads in the list even if the member has no perms. i.e. if I include nsfw and mod forums in my master forum users will see those threads in the list even if they haven't got perms to see them.

They can't actually open the threads but they still appear in the list.

Is that the same in the vb4 version?

tia

I kinda like it this ^^^ way tbh BUT in the new version if you did * would you be showing (for instance) mod only thread titles in your master forum.

Edit: Get well soon man!

Thank you for your support punchbowl.

The VB4 version behaves the same way and even with the updated code it will show the thread titles for each forum regardless of the permission to view- but they can't view the actual thread without permission. Offhand I am not sure how I would be able to hide the threads based on permissions without more queries.

punchbowl
11-20-2011, 06:29 PM
Thank you for your support punchbowl.

The VB4 version behaves the same way and even with the updated code it will show the thread titles for each forum regardless of the permission to view- but they can't view the actual thread without permission. Offhand I am not sure how I would be able to hide the threads based on permissions without more queries.

Cheers. No more queries on my account though! For what I need, the product is perfect.

azn_romeo_4u
02-22-2013, 04:37 PM
Thank you. This is a very interesting mod.

azn_romeo_4u
03-26-2013, 07:46 PM
Nice. But it doesn't work with Cerberus mod.

https://vborg.vbsupport.ru/showthread.php?t=254197

The cerberus doesn't let this mod take forum posts if it isn't on the same figure domain even if it is located on the same db and server. But this still has great potential.

Wreck713
05-30-2013, 04:29 PM
How does this work with moving threads?

If a member posts in the main forum and then we move it to the sub (for organization) will it still then show it in the main forum? ie. auto post it there?

BirdOPrey5
05-30-2013, 06:43 PM
If the sub-forum is set to display in the main forum then yes it will still display in the main forum.

Personally I do NOT use "Show Redirects" for threads I move between forums because they are not necessary with this mod if the destination forum is visible in the master forum.

Louva-Deus
07-23-2013, 10:11 PM
Sorry. I didn't have this version still installed on my test servers.

Change "sticky = 0" to "sticky = 0 OR sticky = 1" in both plugins

If you don't use parentheses then the mod displays all threads from all forums.

(sticky = 0 OR sticky = 1)

So use the above instead. At least it worked for me.

I have an issue I am trying to resolve. There is no new post icon indicator for any displayed threads from other forums.

Finally, is there an easy way to prevent this from modifying the search results page?

Can you help? I am running 3.8.7.

Dj Smuggla
12-31-2013, 04:15 PM
Thanks a lot BirdOPrey5 this is just what i was looking for this mod is great, but i seem to have a problem with it.

Now when i make a new thread in the master forum, the thread don't show in the forum.
The only way of making it show is to click on the link in the last post info box from the home page then stick the thread. Then it's displayed in the master forum. Anyone else have the same problem.
Im using 3.8.6

Edit: I've disabled the product & the threads show up as they should now in the master forum.
Can you please update the mod to fix that issue.

Thanks

BirdOPrey5
01-01-2014, 04:05 PM
The mod isn't broken- I have been using it for years without issue. I think you just don't have it setup correctly.

When you specify a master for like 2|x,y,z the forum itself, 2, must be after the | as well so it would be 2|2,x,y,z in most cases.

Here is a screenshot from my own setup-

https://vborg.vbsupport.ru/attachment.php?attachmentid=147732&stc=1&d=1388595864

The master forumid (red arrow) is also repeated after the | character (yellow arrow) - it doesn't have to be immediately after the | but it's easiest to keep track of if you put it there.

Dj Smuggla
01-01-2014, 05:20 PM
Don't i feel stupid...
Thanks for pointing that out mate, the mod works great :p

SoHelpMe
05-25-2016, 04:31 AM
I'll have to test it out, but I am wondering if I can not allow new threads in this forum, but still allow replies. Basically I want to use this mod as a way to view and reply to threads from multiple forums, but I want new threads to be placed in the proper forum for those who choose not to use the master forum view and view the forums singly.

Did you even get this to function / behave as you described you wished that it would? I would wonder if on the master forum if you set "Forum is Open" to NO if that would keep replies going to the original forums but not allow new threads to be started in the Master?

Your idea for behavior is good and I want to get it to work just as you described, basically the Master Forum would act as a portal to combine and allow for viewing of threads from multiple other forums but the master forum should not allow you to start a new thread within it. All new threads would need to started in one of the child forums and then it could be seen or replied to from the Master.

Did you get it working this way?