Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 5 1 2 3 4 5
Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
* Updated September 15, 2005
ubbnews.php
Modification and Redistribution of this code without perission is prohibited
The Official Code can be found at https://www.ubbdev.com/ubb/ultimatebb.php/topic/33/42.html

Reads the UBB for the latest topic in a forum, and displays a teaster of it on a page
Required Parameter -- forum=## where ## is the forum number requested
Optional Parameter -- threads=# where # is the number of threads to tease (5 limit)
Optional Parameter -- surl=1 will turn on Spider Friendly URLs (Requires 6.7.x)

Usage: just do an include with "http://yourdomain.com/path/ubbnews.php?forum=##&threads=X(&surl=1)" where ## is the number of the forum without any leading zeros and X is a number between 1 and 5. You will need to put your noncgi path in the script so it may read the vars_config.inc.php for your UBB paths.
Download: UBBDev
Requires: 6.4+

Features:
- Counts your comments and puts the count next to the Comments Link
- Comments Link will give them UBB Reply Screen
- Read More takes them to the entire topic
- Will display 1 topic of no threads=X is added to the URL
- Feed multiple forums by doing multiple includes of the ubbnews.php
- Will NOT feed private forums
- Will display a message if your forum_##.threads file is missing
- Author's name links to their profile
- Spider Friendly URLs

Known Issues:
- Doesn't process Gramelins This can be corrected by placing ubbnews.php in your noncgi directory
- Sometimes doesn't process URL's correctly (I've seen it on rare occasions, but bumping the Max Characters setting noted in the code should cure it)
- You will receive a missing .threads error message after an upgrade. Rebuild your Forum Metadata on that forum to correct this error.

This may/may not work on earlier versions, so use at your own risk.

I put a hard limit of 5 in the PHP code to prevent the code from trying to tease every topic in the forum (Could kill performance). You can change this by editing
Code
       if ($threads > 5)
$threads = 5;
just change the 5 in both lines to whatever you want to cap it at. I honestly don't see a need to be over 10.

Also, this may show a bit of lag if you have thousands of topic in the forums. I haven't tested this on large forums.

August 26, 2005 Notice
UBBFeed was an unauthorized modification of the UBBNews code and I will provide NO support for UBBFeed, or my code contained in it. Posting here for support of UBBFeed will result in an unpleasant response.

Sponsored Links
Joined: Nov 2001
Posts: 1,080
Member
Member
Offline
Joined: Nov 2001
Posts: 1,080
Any demo (of what you have so far)? This sounds very promising. If you can get it so that the user can determine how many "teasers" that are displayed (other than default "1") that would be cool. smile

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
demo: http://thegeeksinc.com/

nice work Ron laugh the graemlins shouldn't be too difficult, I believe we worked through them for ubbnews and for a threads mod smile


- Allen wavey
- What Drives You?
Joined: Nov 2001
Posts: 1,080
Member
Member
Offline
Joined: Nov 2001
Posts: 1,080
Quote
quote:
Originally posted by AllenAyres:
demo: http://thegeeksinc.com/
OOPS...I feel quite <-- thumbsup

Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
Thanks guys smile

I only wanted to tease one thread (the latest) but it could probably be modified to do more. You can feed more than one forum by doing multiple includes of the .php

Sponsored Links
Joined: Jun 2002
Posts: 111
Member
Member
Offline
Joined: Jun 2002
Posts: 111
Quote
quote:
Originally posted by Sub Zero:
the vars_config.inc.php for your UBB paths.

Feel free to suggest any improvements to the code, as I'm still learning PHP smile This may/may not work on earlier versions, so use at your own risk.
vars_config.inc.php is different in 6.4, so i any one wants to use it on 6.4.x u have to change the link towards the the topic.

Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
6.5 Zip File Updated with a bugfix - ultimatebb.cgi was not in the URL

Patch: Add /ultimatebb.cgi before ?ubb= on lines 52 and 56

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
changing the
to
would fix the xhtml-compliance smile

What do you see when you have graemlins in the post sz? some html?
- Allen wavey
- What Drives You?
Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
The best way to check if it cuts any HTML command (including graemlins, images, etc) is to check the number of <'s in comparison to the number of >'s, and if there are more <'s just remove everything after the last <, including it.

For example if it is:
Quote
quote:
This is a sample sentence! Welcome to our board! ", so it removes everything after and including the last <, which is "
Joined: Sep 2001
Posts: 93
Member
Member
Offline
Joined: Sep 2001
Posts: 93
its not really working for me on 6.4, what do I do wrong confused

http://www.greek-forum.de/ubb/ubbnews.php?forum=46

Sponsored Links
Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
Sorry for the slow reply. I checked it out. You are running 6.4.0.1, and I wrote this on a 6.5 board, so there might be some differences, but it should work.

Also, you really should get your host to upgrade your PHP as you are running 4.0.6. The exact problem is the way I get the query string (?forum=46) must not be recognized on the older version of PHP. Either way, I would recommend upgrading the PHP as there are some vulnerabilities fixed.

Joined: Sep 2001
Posts: 93
Member
Member
Offline
Joined: Sep 2001
Posts: 93
hmmm it's my own server so I have to upgrade it by my own, oh well, i will try this then wink tipsy

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
Sub, anyway to have it relay the last 5 or so stories?


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
Right now, it only teases one. When I figure out a sane way to parse the necessary files, I will expand it.

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
Ok, can't wait to see it smile ...


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
The Zip file has been updated with a new version that now allows a tease upto 5 topics.

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
yey! anyway to make it 15 :x


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
nm, i see it :x... thanks sub!


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
The limit is in there to prevent someone from trying to crash the server by doing threads=99999 smile

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
yeh, i see how to mod it to allow what i need, I love this mod, now I can begin to use it for my implimentation of taking over the world... err umm news posting...


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Jun 2001
Posts: 2,849
Spotlight Winner
Spotlight Winner
Offline
Joined: Jun 2001
Posts: 2,849
I realize that this is for 6.5 and 6.6 but I figured 6.4 *might* work so I gave it a shot and I set it to forum 9 (announcement) and threads =5 and it comes up blank. If I put ubbnews.php?forum=9 then it gives me one thread and it seems to pull it up from last year. Any ideas?

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
if i had ftp access to my domain from here, and if my domain wasn't blocked from here i'd test it, but i'm not expecting my laptop back till next week smirk...


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Joined: Jun 2001
Posts: 2,849
Spotlight Winner
Spotlight Winner
Offline
Joined: Jun 2001
Posts: 2,849
Quote
quote:
Originally posted by twslex:
quote:
[qb]Originally posted by Sub Zero:
the vars_config.inc.php for your UBB paths.

Feel free to suggest any improvements to the code, as I'm still learning PHP smile This may/may not work on earlier versions, so use at your own risk.
[/qb]
vars_config.inc.php is different in 6.4, so i any one wants to use it on 6.4.x u have to change the link towards the the topic.
Can we get a little more detail on how to get it to work with 6.4?

Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
Ok... I haven't tested it with 6.4 but assuming the metadata formats haven't changed it should work.

Regarding pulling the old thread, rebuild the forum stat files for that particular forum and see if that cures it. If not, I'll have to figure a way to handle metadata being out of order. Maybe something of using the lastnumber and counting backwards and searching for existing files.

doing ubbnews.php?forum=9&threads=5 should pull 5 threads and tease them.

Joined: Jun 2001
Posts: 2,849
Spotlight Winner
Spotlight Winner
Offline
Joined: Jun 2001
Posts: 2,849
Thanks, I'll work on it. I appreciate the reply!!

edit: the stat rebuild didn't help and the threads=5 still just pulls one old thread up. Thread it pulls is consistent though. Here's the link I'm trying;

http://www.netwerkin.com/noncgi/ubbnews.php?forum=9&threads=5

Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
Lemme dig up a 6.4 zip and I'll install it locally and see if I can't sort it out. I wrote this during 6.5, so I never got a chance to run it on 6.4.

Joined: Jun 2001
Posts: 2,849
Spotlight Winner
Spotlight Winner
Offline
Joined: Jun 2001
Posts: 2,849
You are the man, I hope I'm not causing too much trouble. I want to upgrade but I don't want to kill the look I have at Netwerkin right now and it's a pain to build.

Joined: Jun 2001
Posts: 2,849
Spotlight Winner
Spotlight Winner
Offline
Joined: Jun 2001
Posts: 2,849
I got the threads to show 5 but they are still old ones. I had made a mistake while editing the page.

Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
Aye! The forum_XX.threads files in 6.4 aren't in sync like the 6.6 files(The ones on my 6.6 board are sorted in numeric order which makes for clean processing of the array). The way I wrote this, I take the .threads, pop the bottom rows off, then invert the array so I can process it in reverse order. It looks like with 6.4, I need to sort the array myself before processing it.

Let me see what I can cook up for porting this mod back to 6.4....

On a positive note, you helped me solve the graemlin processing problem. Drop ubbnews.php into the noncgi directory. I call mine out of the root because it is with the rest of the PHP scripts that power the main page on my site.

Joined: Jan 2000
Posts: 5,073
Admin Emeritus
Admin Emeritus
Joined: Jan 2000
Posts: 5,073
Fair warning: The fact that hashes are alpha-sorted in 6.6 is actually a bug. I meant to turn that off. 6.6.1+ corrects this. tipsy


UBB.classic: Love it or hate it, it was mine.
Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
Damn...It makes metadata much easier to examine.

Joined: Jan 2000
Posts: 5,073
Admin Emeritus
Admin Emeritus
Joined: Jan 2000
Posts: 5,073
Eh, it's not so bad. The fact that alpha-sorted forums will use a date-sorted .threads file in 6.7 will make up for it. (Meaning alpha-sorted forums will be able to be pruned, mass moved from, and have CIs stuck on them, in addition to your routines being able to work with them.)


UBB.classic: Love it or hate it, it was mine.
Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
ok, I've gotten as far as this

http://www.alforadmin.com/ubb/ubbnews.php?forum=10&threads=5

shocked How do I include it in a webpage?

Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
just do a

Code
<? include("http://www.alforadmin.com/ubb/ubbnews.php?forum=10&threads=5"); ?>
Now to start rewriting the fetching engine so it can properly sort the .threads file smile

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
smile Thank you, I got it working here http://www.alforadmin.com/ubb/index.php

Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
That has a nice look to it Al.

Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
Updated the zip with a sorting bugfix which pulls old topics.

Randy, this should work with 6.4 now smile

Joined: Jun 2001
Posts: 2,849
Spotlight Winner
Spotlight Winner
Offline
Joined: Jun 2001
Posts: 2,849
Thank you SO much. I've been building a 6.6 upgrade kit for Netwerkin but it's weeks away and I've been dying to have a front page again. Netwerkin used to be rather large but I moved the tutorials etc. to www.randymcelroy.com (my personal site).

Joined: Nov 2001
Posts: 745
Admin Emeritus
Admin Emeritus
Offline
Joined: Nov 2001
Posts: 745
Between the news feeder and CIs, you should be able to build one in no time smile

Joined: Jan 2000
Posts: 5,833
Likes: 20
UBBDev / UBBWiki Owner
Time Lord
UBBDev / UBBWiki Owner
Time Lord
Joined: Jan 2000
Posts: 5,833
Likes: 20
I found an, odd, bug...

When you view the script here and compaire it to my forum #6 it pretty much pick and chooses which stories it wants to use...


UBB.Dev - Putting Dev into UBB.threads
Company: VNC Web Services - UBB.threads Scripts and Scripting, Install and Upgrade Services, Site and Server Maintenance.
Forums: A Gardeners Forum, Scouters World, and UGN Security
UBB.Threads: My UBB Themes, My UBB Scripts
Page 1 of 5 1 2 3 4 5

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)