![]() |
latest threads in forumdisplay.php?
i want to show the latest 10 threads, pulled from all forums in forumdisplay.php. i have this code:
Code:
// get latest threads |
i dont see 19 queries... only 4
|
getpermissions() = lots of queries, and shouldn't be used in a loop I believe.
|
is the perms that add a query for each thread... you have an idea how it would be the code to pull it out of the loop?
i honestly dont know. as you know firefly, i look at the VB script code and try to make something similar. thare are certain things i do not manage yet. let me know if you could write the loop part here for me. thanks. |
try this
PHP Code:
|
thanks alot scott.
now, can i pm you about an issue that i develloped with a different file? i cannot post the contents of the file because it contains 60% VB script code. i already asked firefly for help. just leting you know that is nothing related to this thread here. i ask this because maybe firefly is busy and i dont want to pm every single one of you every day. if any of you is willing to take a look at the file (firefly, ppn or zzed), please post an answer here and i will attach the file in your pm. is about a misterious query that is added every time i refresh the page. originally it starts with 21 queries on the page, when i login. as soon as i refresh, it adds a new query, for a total of 22. i cant seem to find where it must be unset the forgotten variable, in that file. one more time, thanks. |
Doesn't work at all for me, PPN.
Using your code exactly except for the last query line (mine is: $threadsql = $DB_site->query("SELECT lastposter, threadid, title, replycount FROM thread WHERE open<>10 $forumperms ORDER BY lastpost DESC LIMIT 69"); ) this just didn't work. I made a thread in my admin&mods forum, but a normal member still sees the thread listed while viewing my newsportal. :( |
Quote:
|
does your newsportal include global.php and load the $bbuserinfo array?
|
it includes global.php but I have nothing added myself pertaining to a $bbuserinfo array or anything like that.
|
i was wondering if any of the big guns can look at the file ensemble and let me know if there is some wierd code i have in there?
i have a modified forumdisplay.php file that does what it shows in this pic: News Page for some reason, even with the right perms set for a usergroup, it will still show the last threads in the hidden forums. also, i added comments in that file so you can easy follow the changes i did and evaluate better the code. firefly or PPN, i would apreciate your help on this. if interested, let me know and i will PM the modified file. thanks. |
email me then
scott.macvicar@vbulletin.org Just leaving for school I will check in once i get there. try setting $bbuserinfo[usergroupid] to 1 in the query |
thanks PPN. i emailed you the file.
|
PHP Code:
|
thanks alot scott. when you have a chance, can you look at the file and let me know if there is any unbalanced code? i shrinked alot the forumdisplay.php file. just making sure someone with php experince can give me the ok on that.
i'm concerned about some unset queries and also about some errors that might be in there without knowing (for example the access array)... |
Thanks Scott, your new code works just fine, I've included it in my newsportal hack and will give you credit. :)
|
sure no problem, just glad to help.
|
All times are GMT. The time now is 10:26 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|