vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Simple newsportal / thread overview to add to your board... (https://vborg.vbsupport.ru/showthread.php?t=38334)

KuraFire 05-07-2002 08:30 PM

Thanks, checking it out right away. :):up:

inetd 05-07-2002 08:49 PM

good hack
/me installed this hack

KuraFire 05-07-2002 08:56 PM

didn't work one bit, so far, awaiting PPN's response....

(edit: this pertaining to PPN's permissions code in the other thread)

kreftt 05-08-2002 01:59 AM

this one is really cool

i added a few things, and now i wont need vbportal (for smaller sites) anymore :D
we shouldnt forget that vbportal has some functions that i personally wouldnt wanna code myself...

greets

kreftt

leeherron 05-08-2002 05:01 AM

I worked on a project like this a while back, never polished up enough to release. The twist I took was I had it run when someone submitted post; it created an HTML that could be served many times with no queries. The theory: thread reads = a lot, posts submissions = not as many.

TECK 05-08-2002 06:35 AM

kura.. if you have a chance, look at the perms included in the vbHome hack. they work, but perms = alot of queries, as firefly mention it to me earlier. PPN was kind enough to look at my hole file i wrote. i will let you know what he says about the perms, then i will post here the mods PPN did to the code, so you can insert it also in your hack.

team work. :)

TECK 05-08-2002 06:52 AM

here it is kura, from my file the code that works (thanks PPN):
Code:

// latest threads ***************************
$doperms=$DB_site->query("SELECT canview,forumid FROM forumpermission WHERE usergroupid='$bbuserinfo[usergroupid]'");
while ($doperm = $DB_site->fetch_array($doperms)) {
  $perms["$doperm[forumid]"] = $doperm;
}
$DB_site->free_result($doperms);
unset($doperm);

$forum=$DB_site->query("SELECT forumid FROM forum");
while ($forums=$DB_site->fetch_array($forum)) {
  if($perms["$forums[forumid]"]["canview"] == 1 || !isset($perms["$forums[forumid]"]["canview"])) {
    $forumperms[]=$forums["forumid"];
  }
}
$DB_site->free_result($forum);
unset($forums);

if(!empty($forumperms)) {
  $forumperms='AND forumid='.implode(' OR forumid=',$forumperms);
}

$dothreads=$DB_site->query("SELECT * FROM thread WHERE open=1 AND open<>10 $forumperms ORDER BY lastpost DESC LIMIT 10");
while ($dothread=$DB_site->fetch_array($dothreads)) {
  $dots='';
  if (strlen($dothread[title])>29) {
    $dots='...';
  }
  $forumid=$dothread[forumid];
  $threadid=$dothread[threadid];
  $threadtitle=substr($dothread[title], 0, 32);

  $lastthreadbits .= '<a href="showthread.php?s='.$session[sessionhash].'&forumid='.$forumid.'&threadid='.$threadid.'">'.$threadtitle.$dots.'</a><br>';
}
unset($dothread);

i use this code in corelation with a higly modified forumdisplay.php file. it involved several mods to the tables. but the result is nice, i think:
https://vborg.vbsupport.ru/attachmen...&postid=249059

try the code and let me know what you think. i will update my vbHome hack also. later on today... ;)

KuraFire 05-08-2002 09:09 AM

I didn't use your code above nakkid, but I used PPN's new code (his former had a wrong var.name) and it works.

The first post is updated and the hack now includes permissions. Re-download if you have this installed and overwrite newsportal.php and re-set your variables, to include the permission checking (works like a charm! :D)

KuraFire 05-08-2002 09:11 AM

Okay I just wanna say a big THANK YOU NAKKID for helping me out, sure PPN did the actual code-writing but nakkid pointed me to it and helped out nonetheless. Thanks Nakkid! :):up:

pattox2k1 05-08-2002 10:40 AM

hey kreft on that test forum i like dat avatar............where u got it from???? or could u PLZ pm me it??????

inetd 05-08-2002 06:44 PM

Help me!
I don't see changes in "Attachment: newsportal-hack.zip" from first post. :<
Anybody, please attach new newsportal.php. Thx!

kreftt 05-08-2002 07:57 PM

it might help to empty your cache in internet explorer and try downloading again...

kreftt

KuraFire 05-08-2002 09:50 PM

or you just use a Real browser and get Mozilla :D:D:D

Floris 05-09-2002 07:54 AM

Mozilla is a real browser, but not a final version yet. (just pointing out)

About the different type of "portal" / "cms" scripts that are out now, everybody has written their own, and they have included, excluded several features. This makes it perfect for certain groups. Some do not need the bulk from vBportal and then this is just fine. Also, adding stuff that is missing is a bliss for this script. Others who do not like vBportal can pick vBhome/ vBindex and/or whatever else is out there. It all ends on support/performance/serverload and ease in use. This differs per user. I am happy enough with this one, for it won't be a part of my frontpage.

Sketch 05-10-2002 01:13 AM

So I imagine the original file is now the completely updated and final version of this hack?

Also, can this be used on a non-vb page, such as my home page to the whole site?

Sketch

KuraFire 05-10-2002 07:43 AM

No, it's not the final version cos this script *still* has that random bug that randomly appears, and takes not the first post out of a thread on your newsforum, but a random post. But it appears not to happen all that frequently, and some people haven't even had it (or just haven't noticed / complained about it :D).

This technically _is_ a non-vb page itself. As far as I can see, it won't work if you place it outside your vb folder (where global.php etc. are). It might, but you'll have to adjust the path, for starters. Still not sure it'll work then, you probably have to hardcode the FULL path to functions.php in your global.php first.

AndyTSJ 05-11-2002 06:59 AM

Any fix for the bug yet. I'm using the script for news posts and instead of showing the story it is showing a reply instead.

Floris 05-11-2002 07:59 AM

AndyTSJ -- read previous post from Kura, its explained there I think.

KuraFire 05-11-2002 09:34 AM

Nope, I requested some MySQL-help over at vb.com but nobody has responded, and I don't know how to fix it, either :(

AndyTSJ 05-12-2002 06:56 AM

Take a look at how it is handled in PluhNews (pluhnews.php) - that script posts the contents of the first post without posting a reply by accident.

You're right though, it doesn't happen all the time.... weird !

Darren Lewis 05-13-2002 10:15 AM

Great work KuraFire :)

I like to be able to pull info from my vB forum database onto my webpages, but I don't want to use a portal system. I write the website in HTML, and use PHP scripts for certain areas by having "include" statements in those HTML pages (named with .php extensions rather than .html). The portals I've looked at require you to write your webpages via vB templates, which I don't want to do.

I've got your hack working on a non-vB webpage. Had to alter the templates to suit my needs (I use Tubedog's hack for the latest threads), and had to tinker a small amount with the newsportal.php script to make it work OK outside of the vB forums directory. No modifications to any of vB's own php file needed :)

I'm trying to teach myself php, and a lot of what I learn is by looking at how other people have done things, and reading these forums a lot.

If anyone's interested, and as long as KuraFire doesn't mind, I'll post the "modifications" to get it working on a non-vB page.

I've had another idea of using your script to preview the latest book review on the website homepage too. The reviews are in their own forum, so could be pulled as for a news item.

The only thing that concerns me is the "bug" that you mention. I haven't noticed it yet.

Thanks.

Darren.

Darren Lewis 05-24-2002 12:12 PM

Quote:

Originally posted by KuraFire
.... and I don't know how to fix it, either :(
Kurafire, I've sent you a PM about this. Let me know what you think :)

JTMON 05-24-2002 02:52 PM

Quote:

Originally posted by Darren Lewis
Great work KuraFire :)

I like to be able to pull info from my vB forum database onto my webpages, but I don't want to use a portal system. I write the website in HTML, and use PHP scripts for certain areas by having "include" statements in those HTML pages (named with .php extensions rather than .html). The portals I've looked at require you to write your webpages via vB templates, which I don't want to do.

I've got your hack working on a non-vB webpage. Had to alter the templates to suit my needs (I use Tubedog's hack for the latest threads), and had to tinker a small amount with the newsportal.php script to make it work OK outside of the vB forums directory. No modifications to any of vB's own php file needed :)

I'm trying to teach myself php, and a lot of what I learn is by looking at how other people have done things, and reading these forums a lot.

If anyone's interested, and as long as KuraFire doesn't mind, I'll post the "modifications" to get it working on a non-vB page.

I've had another idea of using your script to preview the latest book review on the website homepage too. The reviews are in their own forum, so could be pulled as for a news item.

The only thing that concerns me is the "bug" that you mention. I haven't noticed it yet.

Thanks.

Darren.

I understand that vbPortal is overkill for some people but you can easily write pages in html, it's built right into vbPortal.

At any rate, nice hack

KuraFire 05-24-2002 05:00 PM

Okay, I have the bug fixed, people! :)

I will edit the first post later tonight or tomorrow, I don't have time right now but I can say this:

it requires some database work;
more importantly: if you don't want to wait X newsthreads before it'll work entirely, you will have to do some search-find-and-query work on the newsthreads you already have. But, I can safely say that once done, not a single random post will ever appear, anymore. Ever! :D

AndyTSJ 05-24-2002 11:11 PM

Sweet :)

KuraFire 05-26-2002 07:32 AM

It's fixed! Check the first post:

https://vborg.vbsupport.ru/showthrea...547#post248547

to see how to patch your board to remove the random bug! :):up:

Floris 05-26-2002 08:47 AM

The first version didn't require any MySQL modification right?
So I can just upload your new file and re-add the template. Then run the query?

KuraFire 05-26-2002 10:36 AM

Upload new file;
Template: wha? there's no template adjusting with the bug-fix...

hack newthread.php;
hack newreply.php;
upload both files
alter your database to set the existing threads' "isfirst" column to 'Y';

done.

Travis641 06-08-2002 02:59 AM

I got it working outside the vb directory, that was easy. But how would I call it to my index.php page?

If you could include that feature it would be great!

Travis641 06-08-2002 03:06 AM

Nevermind I was able to do it myself! :D

BigJohnson 06-08-2002 04:19 AM

Sorry everyone . I dont no what is wrong with me today but i tried installing this and i cant get it to work. I hacked everything to what it said in the first post. I just didnt do the PHPmyadmin stuff yet. What query do i actual put in?. I tried some but i keep getting errors in my PHPmyadmin saying it doesnt no what isfirst means. What do i do?

KuraFire 06-08-2002 09:31 AM

run this query on your database:

ALTER TABLE post ADD isfirst char(1) NOT NULL DEFAULT 'N';

and with the newthread.php and newreply.php hacks, it should work. However, it'll only work once you start making new Newsthreads, unless you edit a bunch of posts that are currently the first posts of your existing newsthreads....

chris frolic 06-11-2002 12:19 AM

great hack, perfect for my needs! I removed the "threads" part of it, so its just a simple news updates for my main page. Thanks alot.

Ryangel 07-12-2002 12:14 AM

hmmm I'm stumped...

So what do i need to do so that my users cant see the "Admin boards" listed on the Latest threads?
Thanks.

KuraFire 07-12-2002 12:45 AM

The newest edition of the zip (first post attachment - clear your cache!)
has permissions support built-in, so users will only see what they're
allowed to see.

Ryangel 07-12-2002 03:49 AM

Quote:

Originally posted by KuraFire
The newest edition of the zip (first post attachment - clear your cache!)
has permissions support built-in, so users will only see what they're
allowed to see.

hmm i just downloaded it on 9 July 2002. Has it been updated?
Maybe it doesnt work because the file is not in the root directory .... I did link the path to global correctly though...

KuraFire 10-02-2002 10:02 AM

I think you need to re-download it then...

I don't know if it'll work outside the root of the vB. I've not tested it there and so far only heard that others couldn't get it to work outside of the root, so... :/

Automated 12-24-2002 08:10 AM

nice mod/hack/addition whatever this would be classed as!

[high]* Automated clicks install :p[/high]

dgmayor 01-06-2003 06:22 PM

Here's a question for ya. Is there a way to have it call the templates from a style other than the Default? Maybe by way of passing a variable in the url or something?

Reason being, is that I want to pull my news from a forum and have it display on my site, and it needs to match the site. But the thing is, it's not the "main" portion of the site.

Basically my site breaks down like this:

Index
|---Portion 1 (Guild/clan page for Game #1)
| |--Forum Category 1
|---Portion 2 (Guild/clan page for Game #2)
| |--Forum Category 2
|---Portion 3 (Guild/clan page for Game #3)
| |--Forum Category 3
|
|--Forum Home

If that makes sense. Basically each category has a different style, and thus the news will need to pull form different forums from different categories and output in different styles. Now if I have to have 3 seperate copies of newsportal.php for each mini site, then fine, but how can I have it pull from different headers? I suppose if I had 3 seperate copies of newsportal, I could hardcode 3 different template names that each contained 3 different styles, but I'm sure there can be an easier way to do this?

KuraFire 01-07-2003 02:47 PM

you mean, you want it to _overrule_ the Style set that the User has picked?


All times are GMT. The time now is 04:12 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.01287 seconds
  • Memory Usage 1,823KB
  • 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)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete