The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Simple newsportal / thread overview to add to your board... Details »» | |||||||||||||||||||||||||||
Simple newsportal / thread overview to add to your board...
Developer Last Online: Nov 2023
Okay, this isn't really a hack, since you don't have to modify any vb-files really, but I figured this was the best place to make it public anyhow. I found it rather useful myself, so I figured others might, too.
Last update: April 28th, 2003! ** Update summary: ** The bug that could occur due to MySQL stupidity has been fixed. Version 2 of the Newsportal script is now attached in this post, you can simply overwrite the newsportal.php on your site with the one from the attached zipfile to upgrade. From now on, no more vB files need to be adjusted nor do you have to make any database changes. If you've already done all that due to the mysql-bug in a previous stage of this hack, you can just leave it like that, it won't do any harm. If you're intent on 'cleaning' your files again, let me know if you can't get it done yourself. Q&A: What does this 'hack' do? http://www.kurafire.com/newsportal.php That's a live example of the fully functional version of the Hack (version 2). I think it speaks for itself. The amount of newsposts & threads on the right is set in a variable at the beginning. Is this hack hard to install? Absolutely not. You upload the newsportal.php, you add the new templates (see zipfile), and you place a link to newsportal.php wherever you want it on your site. That's it. You don't have to modify any vB files, nor your database. Does this hack include my style and everything? Yes, the newsportal page will use your headinclude, header, footer and style-colors (pagebgcolor, tableouterwidth, linkcolor, etc.) and all these settings are easily configureable. You just edit the templates like you're (hopefully) used to with all the normal vB Templates. Version 2: The newsportal script now uses 2 queries to get the necessary information for your News posts. One for all thread info and the postid's of the starting posts, and one for the pagetext (ie. post contents) of all those postid's. You can use 2, 20 or 200 newsposts, that won't matter, it'll always be 2 queries (though I discourage using more than 20 newsposts ). ^_^ That's it, you're all done. Have fun with the newsportal! ^_^ Show Your Support
|
Comments |
#32
|
||||
|
||||
I made this script basically just for my own needs, but figured others might appreciate it as well.
Man, this permissions thing is giving me a headache. Nakkid, I can't say exactly why that part of code of yours is adding 1 query for every thread, but it does suck and it's hell trying to get around it. |
#33
|
||||
|
||||
well i'm not sure, why there is sometimes an error and sometimes not
i think you can solve this problem, with making an extra query for each message news, i have made it so an it works: PHP Code:
PHP Code:
try it and say it to me if it works or not. If not, i will check it a more |
#34
|
||||
|
||||
That should work fine, from what I see, but it adds a query for each news item, and I'm trying to get rid of that since I _know_ this can be done using only 2 queries.
With your code, the default setup would add 8 queries to the 10~12 that global.php runs already. Seems to me as not very efficient. Besides, that's how my _old_ script was run. One query for the newsforum, and one for each news item..... I was hoping to _advance_ Thanks though. Well-appreciated :up: |
#35
|
|||
|
|||
How can I pull news from more than one forum
Code:
$newsforum = 5; |
#36
|
|||
|
|||
Kurafire:
To get the permissions issued addressed on my site I used Code:
if (ismoderator($forumid) or $getperms['canopenclose'] or $getperms['candeletethread'] or $getperms['canmove']) { $threadsql = $DB_site->query("SELECT lastposter, threadid, title, replycount FROM thread WHERE forumid ORDER BY lastpost DESC LIMIT $threadslimit"); } else { $threadsql = $DB_site->query("SELECT lastposter, threadid, title, replycount FROM thread WHERE forumid $forumexclude ORDER BY lastpost DESC LIMIT $threadslimit"); } Parker |
#37
|
||||
|
||||
AndyTSJ:
try replacing that line with PHP Code:
Parker: have you tried that out as a normal registered member? come to think of it, would this piece of code work? PHP Code:
(I'm off for some things so I can't test it myself right now ) |
#38
|
|||
|
|||
That works !!!!!!!!!!!!!!!!! COOL
|
#39
|
|||
|
|||
Kurafire:
I tried the $getperms['canview'] before I tried what I suggested above and that didn't work. The code that I suggested works on my board just fine and it will only allow those admins, etc. that are allowed to view a private forum see the thread listed. If you are a regular member you will not see the ones that you set up in $forumexclude. Parker |
#40
|
||||
|
||||
Parker: ah yes, I saw that already but the thing is, I'm one of those people who have more than the default usergroups. I have 1 category with 4 forums in it that is only accessible to users in a certain usergroup, and 1 forum elsewhere that is only accessible to users in yet Another special usergroup.
Using your code wouldn't help at all for my board, nor for people who have something similar. However, it DOES indeed work on boards where there's only admins, S-mods and normal members, I guess. Thanks for that addition, therefore, because it will at least allow people with such board-setups to include permissions in this script already. |
#41
|
||||
|
||||
kura, PPN rewrote the perms code i had there in a much more elegant way. take a look and insert it also in your script:
https://vborg.vbsupport.ru/showthrea...924#post248924 |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|