|
Joined: Apr 2001
Posts: 237
Member
|
Member
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.
|
|
|
|
Joined: Nov 2000
Posts: 2,759
Pooh-Bah
|
Pooh-Bah
Joined: Nov 2000
Posts: 2,759 |
Wow Mike....outstanding work! 
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
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
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 
|
|
|
|
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? 
|
|
|
|
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 
|
|
|
|
Joined: Jul 2000
Posts: 11
Junior Member
|
Junior Member
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
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  755 is fine on the permissions and the news.php file is created automagically once you set it up. 
|
|
|
|
Joined: Jul 2000
Posts: 11
Junior Member
|
Junior Member
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
Joined: Jul 2000
Posts: 11 |
Allen, What the heck is CRON? *grins*
|
|
|
|
Joined: Jul 2000
Posts: 11
Junior Member
|
Junior Member
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 
|
|
|
|
Joined: Jan 2002
Posts: 88
Member
|
Member
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
Joined: Nov 2001
Posts: 1,080 |
Cool job Mike. 
|
|
|
|
Joined: Apr 2001
Posts: 237
Member
|
Member
Joined: Apr 2001
Posts: 237 |
Hi Guys. Go away for a weekend and you miss a lot! Thanks for the HTML corrections Allen, I've updated the script with them. Good thing someone's keeping an eye on me. 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... Cheers
|
|
|
|
Joined: Apr 2001
Posts: 237
Member
|
Member
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.  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
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 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. 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 
|
|
|
|
Joined: Apr 2001
Posts: 237
Member
|
Member
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. 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 
|
|
|
|
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, the css works fine in IE, but in mozilla/firebird, it doesn't show up at all.... any ideas?
|
|
|
|
Joined: Apr 2001
Posts: 237
Member
|
Member
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 
|
|
|
|
Joined: Apr 2001
Posts: 237
Member
|
Member
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 
|
|
|
|
Joined: Jun 2001
Posts: 729
Coder
|
Coder
Joined: Jun 2001
Posts: 729 |
For those running under Windows and need a CRON solution check this out 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 http://www.smarterscripts.com/cron/
|
|
|
|
Joined: Apr 2001
Posts: 237
Member
|
Member
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 
|
|
|
|
Joined: Apr 2001
Posts: 237
Member
|
Member
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 
|
|
|
|
Joined: Apr 2001
Posts: 237
Member
|
Member
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,834 Likes: 20
UBBDev Owner Time Lord
|
UBBDev Owner Time Lord
Joined: Jan 2000
Posts: 5,834 Likes: 20 |
I wish that I could use it, but :sigh: can't use schedualed tasks  ...
|
|
|
|
Joined: Apr 2001
Posts: 237
Member
|
Member
Joined: Apr 2001
Posts: 237 |
Haven't tried it, but it should do the trick for you! 
|
|
|
|
Joined: Apr 2001
Posts: 237
Member
|
Member
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 
|
|
|
|
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 
|
|
|
|
Joined: Apr 2001
Posts: 237
Member
|
Member
Joined: Apr 2001
Posts: 237 |
Let me know if I can be of assistance... 
|
|
|
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.
|
|
Posts: 87
Joined: December 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|