The Arcive of vBulletin Modifications Site. |
|
Details »»
|
|||||||||||||||||||||||||
This optimization just may help you out more than the forumdisplay did! Check it out...
edit global.php (the one in /forum, not the admin one) find: Code:
// ###################### Start makeforumjump ####################### Code:
// ###################### Start countchar ####################### Code:
function makeforumjump()
{
// this generates the jump to box
global $DB_site,$forumid,$optionselected,$usecategories, $jumpforumid,$jumpforumtitle, $jumpforumbits,$curforumid;
global $hideprivateforums,$defaultselected, $forumjump,$bbuserid,$bbusergroupid;
if ($forumid!="")
{
$curforumid=$forumid;
}
else
{
if ($threadid!="")
{
$getforumid=$DB_site->query_first("SELECT forumid FROM thread WHERE threadid=$threadid");
$curforumid=$getforumid[forumid];
}
}
$forums=$DB_site->query("SELECT category.categoryid, category.title AS categorytitle,
forumid, forum.title AS forumtitle
FROM category
LEFT JOIN forum ON (category.categoryid = forum.categoryid)
WHERE category.displayorder<>0 AND forum.displayorder <> 0 AND active=1
ORDER BY category.displayorder, forum.displayorder");
$firstcat = 0;
while ($forum=$DB_site->fetch_array($forums))
{
$currentcat = $forum[categoryid];
if ($usecategories == 1)
{
$optionselected="";
if ($firstcat != $currentcat) // Print Category
{
$firstcat = $forum[categoryid];
// This creates our "blank line" in the dropdown
$jumpforumid="";
$jumpforumtitle="";
eval("\$jumpforumbits .= \"".gettemplate("jumpforumbit")."\";");
$jumpforumid="cat$forum[categoryid]";
$jumpforumtitle="Category: $forum[categorytitle]";
eval("\$jumpforumbits .= \"".gettemplate("jumpforumbit")."\";");
$jumpforumid="";
$jumpforumtitle="--------------------";
eval("\$jumpforumbits .= \"".gettemplate("jumpforumbit")."\";");
}
}
if ($hideprivateforums==1)
{
$getperms=getpermissions($bbuserid,$bbusergroupid,$forum[forumid]);
}
else
{
$getperms[canview]=1;
}
if ($getperms[canview]==1)
{
$jumpforumid=$forum[forumid];
$jumpforumtitle=" $forum[forumtitle]";
if ($curforumid==$jumpforumid)
{
$optionselected="selected";
$selectedone=1;
}
eval("\$jumpforumbits .= \"".gettemplate("jumpforumbit")."\";");
}
}
if ($selectedone!=1)
{
$defaultselected="selected";
}
eval("\$forumjump = \"".gettemplate("forumjump")."\";");
}
[Edited by Ed Sullivan on 10-27-2000 at 05:45 PM] Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
|||
|
|||
|
cool.. the forumdisplay one really helped me out ALOT ... by any chance you know if any of the hacks would of changed it ?
|
|
#3
|
|||
|
|||
|
I don't think any hacks would have changed this.
Also don't get upset at me not releasing the calendar hack if I'm spending time optimizing queries ![]() [Edited by rangersfan on 10-26-2000 at 07:26 PM] |
|
#4
|
|||
|
|||
|
Rangersfan well done!
|
|
#5
|
|||
|
|||
i added it on my test forum i got an errorQuote:
|
|
#6
|
|||
|
|||
|
You know what? If I edit the post it is fine, but if you look where it says
curfor umid; The forum has inserted a space from the damned wordwrap bug. You can dl it here -> http://www.hedgehogwheels.com/hacks/...timization.txt |
|
#7
|
|||
|
|||
|
Wow this sounds great. I added it to my forums.
I look forward to more optimizations...if it keeps up maybe I won't need to buy Sybase or another databae solution. Thanks rangersfan. Do you have any other optimizations in mind or planned? |
|
#8
|
|||
|
|||
|
thanks i downloaded the txt one you posted and it works great on my test and live vBs
|
|
#9
|
|||
|
|||
|
Another one?
![]() Cramed for time right now, but is this one similar to: http://www.vbulletin.com/forum/showt...?threadid=2985 Or does it improve a different area. I'm assuming its different, since you had posted in the other thread before, but don't have the time to run through the code atm. Keep 'em coming! |
|
#10
|
|||
|
|||
|
Oh it achieves the same but mine makes a hell of a lot more sense. I posted alot of questions about errors and such with his hack and he never responded.
In reality, someone on vbulletin.org asked for an optimization of forumjump and I had forgot fodder had made one. [Edited by rangersfan on 10-26-2000 at 08:30 PM] |
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|