UBB.Dev
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.
Wow Mike....outstanding work!

laugh
Posted By: LK Re: [6.x] ubb_portal.pl - A Poor Man's UBB Portal - 05/13/2003 8:52 PM
Very cool (too bad I can't add scheduled tasks)! I think tho you should explain which CSS tags are used and where...
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
Great work Mike laugh
This is a new ubbnews-like script using CI? smile
Might wanna consider either closing the

with a or changing to

and changing
to
smile
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
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!
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
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
Allen,
What the heck is CRON? *grins*
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. :-/
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
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!
Cool job Mike. thumbsup
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
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?
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.
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
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...
danke, I'll try that out once I update the files here smile
looking good, smile

the css works fine in IE, but in mozilla/firebird, it doesn't show up at all.... any ideas?
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...
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
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
gracias Mike, that will be more useful now smile
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/
Hey, thanks! nnCron looks pretty useful!
yeah, thanks Steven, that'll most likely be useful to all of us laugh
I've added a note to the script with those links. Thanks!

I've also made ubb_portal now use post icons as well...
danke, makes it purty smile
One more minor update: images in posts were sometimes broken (as I noticed on the main page here), and that won't happen now.
Posted By: Gizmo Re: [6.x] ubb_portal.pl - A Poor Man's UBB Portal - 07/13/2003 12:26 PM
I wish that I could use it, but :sigh: can't use schedualed tasks cry...
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
Minor update, there's now a "Post A Reply" link with each entry...
danke Mike thumbsup
Updated to work properly with the new Spider URLs... (http://perl.bobbitt.ca/ubb_portal)
Thanks Mike, I need to update the one here smile
Let me know if I can be of assistance... smile
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?
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...
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
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
Err, dump dump dump dump....

[Linked Image]

Must be my sleepy head.

Zhnxz anyway.
No worries, had me fooled at first too. smile
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?
Ah ... and where can I get the news.php file from?
https://www.ubbdev.com/ubb/ultimatebb.php/topic/33/42.html#000000

that's where you can get the PHP version
Wanna send me the zip file? I don't see a link to download.
http://thegeeksinc.com/subzero/ubbhacks/ubbnews.zip
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
could I actually see the domain so I can see the issue?
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
© UBB.Developers