Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
Modification Name: ubb_portal.pl - A Poor Man's UBB Portal

Author(s): Mike Bobbitt

Description: ubb_portal.pl is designed to work with a UBB content island. It reads through the posts listed in an HTML content island (styled or unstyled work OK), and generates a "news" page that can be included in a portal. As the content island is automatically updated by UBB, so is the news page.

Demo: http://Army.ca/main.php

Requirements: UBB 6.x, using Content Islands, access to crontab or scheduled tasks

Download Link: http://Perl.Bobbitt.ca/ubb_portal

Notes: No UBB modifications required. This script runs standalone, reading the content islands created by UBB and generating a "news" page that can be included in your portal.

Works with both recent topic and recent post CIs and can be configured to truncate long posts (with ...). Properly updates Graemlin links to work, and won't truncate in the middle of an HTML tag. A sample style sheet is included, to get things going.

In the demo link above, the centre colum ("Army.ca News") is the sample output.

Sponsored Links
Joined: Nov 2000
Posts: 2,759
Pooh-Bah
Pooh-Bah
Offline
Joined: Nov 2000
Posts: 2,759
Wow Mike....outstanding work!

laugh

Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
Very cool (too bad I can't add scheduled tasks)! I think tho you should explain which CSS tags are used and where...

Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
Thanks guys!

Good point LK.

EDIT: I've included a ubb_portal.css file in the zip.

You can change any of that through the code if you want (just search for each class name), but it's probably easier to just define the classes as you want to see them.

Cheers

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Great work Mike laugh


- Allen wavey
- What Drives You?
Sponsored Links
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
This is a new ubbnews-like script using CI? smile


- Allen wavey
- What Drives You?
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Might wanna consider either closing the

with a or changing to

and changing
to
smile


- Allen wavey
- What Drives You?
Joined: Jul 2000
Posts: 11
Junior Member
Junior Member
Offline
Joined: Jul 2000
Posts: 11
I'm having a few problems with installing the portal.
(Somewhat off subject: I have a small teddy on the top of my monitor. A friend tells me whenever I have a coding problem, to talk to the teddy FIRST before I scream for help. It's good advice and has saved alot of friendships, however, I've talked to my teddy for the last hour or so....and I'm still stumped on this one)

First off:
[an error occurred while processing this directive]
I'm getting this message after I've followed the instructions with all except one.

The one I haven't been able to figure out:
4. Enable ubb_portal.pl to be run as a cron job (*nix) or scheduled task (Windows). Sample crontab entry to run ubb_portal.pl every 15 minutes is:
00,15,30,45 * * * * /home/user/www/cgi-bin/ubb_portal.pl
(prays I don't need root access to the server or unix to do this.....) Could you dumb down your response to me? Give me a link to where I need to read up on this?

Also....I want to be sure on the paths....
my $ubbdir="/home/bobbitt/www/army/ubb";
my $ubbpath="http://Army.ca/ubb";
my $cifile="$ubbdir/ContentIslands/7/html.html";
my $outputfile="/home/bobbitt/www/army/includes/news.php";

I have:
my $ubbdir="/home/arianna/ubb/noncgi";
my $ubbpath="http://dimhorizon.com/ubb/noncgi/icons";
my $cifile="$ubbdir/ContentIslands/9/html.html";
my $outputfile="/home/arianna/ubb/noncgi/includes/news.php";

OTHER QUESTIONS:
*****
Do I chmod ubb_portal.php to 755 or 777? (Chmoded to 755 at the moment) I've tried both with no change...
Do I add a news.php blank file to the includes folder and chmod 755 or 777? (Chmoded to 755 at the moment) Or will ubb portal create the file?

I've checked and double checked my paths....
still getting the error...HELP!

Thanks for all that help.
Regards,
Arianna

Joined: Jul 2000
Posts: 11
Junior Member
Junior Member
Offline
Joined: Jul 2000
Posts: 11
ok...looks like my paths are ok. I've managed to get rid of
[an error occurred while processing this directive]

*talks once more to the teddy on her monitor*
betcha it's something exceptionally stupid that I'm forgetting!

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
This:
my $ubbpath="http://dimhorizon.com/ubb/noncgi/icons";

looks a little suspect, are you sure you want the /icons on the end?

I'm not a cron expert tho.. but it'll work at least once when everything (not including the cron task) is setup correctly smile 755 is fine on the permissions and the news.php file is created automagically once you set it up. smile


- Allen wavey
- What Drives You?
Sponsored Links
Joined: Jul 2000
Posts: 11
Junior Member
Junior Member
Offline
Joined: Jul 2000
Posts: 11
Everything should be ok now, except this....

Enable ubb_portal.pl to be run as a cron job (*nix) or scheduled task (Windows). Sample crontab entry to run ubb_portal.pl every 15 minutes is:
00,15,30,45 * * * * /home/arianna/cgi-bin/ubb_portal.pl

Joined: Jul 2000
Posts: 11
Junior Member
Junior Member
Offline
Joined: Jul 2000
Posts: 11
Allen,
What the heck is CRON? *grins*

Joined: Jul 2000
Posts: 11
Junior Member
Junior Member
Offline
Joined: Jul 2000
Posts: 11
Gotta love Google...
I've found out what Cron is...and also scheduled tasks... bummer. Was hoping this would be a little less a hassle to use. Gonna continue my research and see if I can get it to work.

BTW...it's still not working even without the Cron task. So something in either my paths or chmoding is foobar'd. :-/

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
You'll most likely need to get your server admin to set it up for you, unless you have some sort of control panel that allows you to set up a cron job smile


- Allen wavey
- What Drives You?
Joined: Jan 2002
Posts: 88
Member
Member
Offline
Joined: Jan 2002
Posts: 88
mike... you keep on amazing me...

it seems like the only thing you do is scripting! lol

i am still fine tuning your Album.pl, but now we have this again...

why do you keep on giving me that work...


but i love it!

thnx!

Joined: Nov 2001
Posts: 1,080
Member
Member
Offline
Joined: Nov 2001
Posts: 1,080
Cool job Mike. thumbsup

Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
Hi Guys. Go away for a weekend and you miss a lot! smile

Thanks for the HTML corrections Allen, I've updated the script with them. Good thing someone's keeping an eye on me. wink

Arianna, looks like you've figured out most of what's going on. What results (if any) do you get when you run ubb_portal.pl now? Is there a news.php file created? Does it have anything in it? There is a debug statement you can turn on ("$::debug=0;" changes to "$::debug=4;") but that may not help much.

messagedj, thanks! I actually do have a life -- well, sort of... I put this script together in an evening, so it didn't take too much time. Seems that's starting to show a bit... wink

Cheers

Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
Hey, just noticed UBBDev is running ubb_portal.pl on the main page. Thanks!

Guess I need to make it look prettier now. wink Plus, it says 0 replies, but there are 6. Is that a script bug or is it just slow to update?

Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
Quick note: I've added ubb_portal.css to the zip file, which has all the style classes pre-defined. I've also added some additional classes such as a header and footer block.

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Thanks for the updates Mike smile

Quote
quote:
Originally posted by Mike Bobbitt:
Hey, just noticed UBBDev is running ubb_portal.pl on the main page. Thanks!

Guess I need to make it look prettier now. wink Plus, it says 0 replies, but there are 6. Is that a script bug or is it just slow to update?
We don't have a cron job setup to update it.. not sure how yet without bugging an already over-worked navaho tipsy


- Allen wavey
- What Drives You?
Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
Heheh. Ok. It could probably be changed to work off the existing CI schedule code, but that would mean making changes to UBB code. I'm a chicken. frown

I guess you could even resort to a low-tech method of calling https://www.ubbdev.com/ubbcgi/ubb_portal.pl through a web browser. It doesn't give any feedback, but it rebuilds the news.php file. So even running a scheduled task on a different system to open ubb_portal.pl in a web browser (or better yet - wget it) would work...

P.S. On most systems "crontab -e" will open the current crontab file in your preset editor. Then you can just add a line like:

00,15,30,45 * * * * /home/path/to/ubb_portal.pl

That'll make ubb_portal.pl run every 15 minutes... You probably already knew that...

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
danke, I'll try that out once I update the files here smile


- Allen wavey
- What Drives You?
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
looking good, smile

the css works fine in IE, but in mozilla/firebird, it doesn't show up at all.... any ideas?


- Allen wavey
- What Drives You?
Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
Darn. I think it's because the css uses classes like portalbody/header/footer without making them td classes.

Nope, it looks fine at my example site... Maybe it's either a) the use of multiple style sheets in one page, b) overriding classes from another sheet, or c) the placement of the ubb_portal.css tag. (It's below the others, but still in the HTML head block...)

I also noticed that in IE, the footer links disappear into the background with here...

I'll keep checking to see what might be going on with Mozilla...

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
yeah, I am still trying to get the link colors worked out... could be that we're using 3-4 different stylesheets on that page tipsy


- Allen wavey
- What Drives You?
Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
Quick update: you can now identify multiple CI files, and they'll all be parsed. For example, I have the last 1 topic from my "admin" forum and the last 5 posts from my "news" forum.

Cheers

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
gracias Mike, that will be more useful now smile


- Allen wavey
- What Drives You?
Joined: Jun 2001
Posts: 729
Coder
Coder
Offline
Joined: Jun 2001
Posts: 729
For those running under Windows and need a CRON solution check this out wink

http://www.nncron.ru/

And those of you running under *NIX and do not have access to CRON here is a solution for you too wink

http://www.smarterscripts.com/cron/

Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
Hey, thanks! nnCron looks pretty useful!

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
yeah, thanks Steven, that'll most likely be useful to all of us laugh


- Allen wavey
- What Drives You?
Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
I've added a note to the script with those links. Thanks!

I've also made ubb_portal now use post icons as well...

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
danke, makes it purty smile


- Allen wavey
- What Drives You?
Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
One more minor update: images in posts were sometimes broken (as I noticed on the main page here), and that won't happen now.

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 wish that I could use it, but :sigh: can't use schedualed tasks cry...


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: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
Quote
quote:
Originally posted by 1QuickSI:
For those running under Windows and need a CRON solution check this out wink

http://www.nncron.ru/

And those of you running under *NIX and do not have access to CRON here is a solution for you too wink

http://www.smarterscripts.com/cron/
Haven't tried it, but it should do the trick for you! wink

Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
Minor update, there's now a "Post A Reply" link with each entry...

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
danke Mike thumbsup


- Allen wavey
- What Drives You?
Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
Updated to work properly with the new Spider URLs... (http://perl.bobbitt.ca/ubb_portal)

Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
Thanks Mike, I need to update the one here smile


- Allen wavey
- What Drives You?
Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
Let me know if I can be of assistance... smile

Joined: Jun 2002
Posts: 111
Member
Member
Offline
Joined: Jun 2002
Posts: 111
Quote
quote:
Originally posted by Mike Bobbitt:
Let me know if I can be of assistance... smile
Hi,

Need a little assistence here, i keep on giving me an error:

Code
<head><title>Error in CGI Application</title></head>
<body><h1>CGI Error</h1>The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:



<pre>165: UBB file: <PATH_TO:$NONCGI>/Forum2/000769.cgi
189: Z&#0124;&#0124;000004&#0124;&#0124;bob.com&#0124;&#0124;11-10-2003&#0124;&#0124;09:35 AM&#0124;&#0124;&#0124;&#0124;</font><blockquote><font size="1" face="Verdana, Helvetica, sans-serif">quote:</font><hr /><font size="2" face="Verdana, Helvetica, sans-serif">Originally posted by lruddick:
<strong> The whole list...


</strong></
Where does it goes wrong?

Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
Looks like you've got debug on. smile

Try setting $::debug=0; (it's located near the top of the file).

That should make it behave better...

Joined: Jun 2002
Posts: 111
Member
Member
Offline
Joined: Jun 2002
Posts: 111
Quote
quote:
Originally posted by Mike Bobbitt:
Looks like you've got debug on. smile

Try setting $::debug=0; (it's located near the top of the file).

That should make it behave better...
LOL, if debug is off it still gives the same error, that's why i have put debug on....

rockband

Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
Heheh. Reason being you're trying to run it from the web, but it wasn't really designed to be. The ubb_portal script generates a file that is viewable from the web, but is meant to be run via cron (or manually).

Check the "$outputfile" it probably has the portal page, ready to be included or viewed directly.

Cheers

Joined: Jun 2002
Posts: 111
Member
Member
Offline
Joined: Jun 2002
Posts: 111
Err, dump dump dump dump....

[Linked Image]

Must be my sleepy head.

Zhnxz anyway.

Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
No worries, had me fooled at first too. smile

Joined: Aug 2001
Posts: 103
Member
Member
Offline
Joined: Aug 2001
Posts: 103
Am I doing something wrong here? I changed the absolute and actual paths in the .pl file but did not set the content island urls. I just wanted to see what the portal looked like. I tried both ways, 755 and 777 permission settings for the .pl file and it still doesn't work.
Is there something special I'm supposed to do?

Joined: Aug 2001
Posts: 103
Member
Member
Offline
Joined: Aug 2001
Posts: 103
Ah ... and where can I get the news.php file from?

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2

Joined: Aug 2001
Posts: 103
Member
Member
Offline
Joined: Aug 2001
Posts: 103
Wanna send me the zip file? I don't see a link to download.

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2

Joined: Aug 2001
Posts: 103
Member
Member
Offline
Joined: Aug 2001
Posts: 103
Ian, also wanna tell me why I can't load the ubb_portal.pl? Just doesn't want to show up with I type in the url: http://mydomain.com/cgi-bin/ubb_portal.pl

Joined: Jan 2003
Posts: 3,456
Likes: 2
Master Hacker
Master Hacker
Offline
Joined: Jan 2003
Posts: 3,456
Likes: 2
could I actually see the domain so I can see the issue?

Joined: Apr 2001
Posts: 237
Member
Member
Offline
Joined: Apr 2001
Posts: 237
There won't be any output when you run it from the web, all ubb_portal.pl does is quietly generate news.php. (So no need to download it from the above link - it's created on the fly...)

I run ubb_portal as a cron job (scheduled task) so it just runs every 15 mins or so, updating news.php with new info in the background.


Cheers

Page 1 of 2 1 2

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
isaac
isaac
California
Posts: 1,157
Joined: July 2001
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
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)