Name: ubb.db
Description: Adds a plug-n-play file database to your site with ubb authentication.
Original Author: Cal (thank you for permission to distribute
)
Credits and Thank yous: - LK for the majority of the grunt work updating from the v5 series it was written for and adding additional admin features
- Mark Badolato for code optimization and putting up with my questions
- Charles for code assistance
- Burak for code assistance
- Clankiller for bugfixes
Link:
https://www.ubbdev.com/ubb/upload/00000494/ubbdb.zip Demo:
https://www.ubbdev.com/ubbcgi/db.cgi Requirement: UBBâ„¢ 6.3+ Install Notes: - Unzip the file and upload the cgi-bin contents to your ubb cgi directory in ascii, setting permissions to 755. Upload the /uploads folder to your ubb non-cgi directory and set permissions to 777.
- Access your admin at db.cgi?action=admin there are some 'starter' categories in there you can edit.
- A method was added to make using additional file types easir to upload. Line # 282:
code:
my ($base, $path, $ext) = fileparse($zip, qr{.(zip|txt|jpg)});
Change the (zip|txt|jpg) to add whatever file types you need. For example, to add .gif file, you would change that line to read:
code:
[qb]my ($base, $path, $ext) = fileparse($zip, qr{.(zip|txt|gif|jpg)});
[/qb]
To-Do:- templates
- better customization features
- continuing optimizing code
Changelog:- Nov. 29, 2002 - v2.9 - bugfixes and minor updates (thanks Clankiller)
- Nov. 20, 2002 - v2.8 - removed unused code (thanks Burak
)
- Nov. 20, 2002 - v2.7 - Added easier method to upload additional file types (thanks Mark
)
- Nov. 11, 2002 - v2.5 - Wordlets Done
- Oct. 28, 2002 - Initial Update for v6.3+
- Way
way back - cal henderson wrote this for ubbcodehackers and ubb v5
Wow, this is great... Thanks Allen
BTW: Is this gonna be used with the Portal?
Allen, did you remove the option of "Create new thread"?
I guess I am a bit ignorant - what does this add ? That is what does having a "plug n play database" do for the board?
Woah... hey. I know a guy who was looking for this very thing a while back. I told him to just create a Forum called Downloads and stick the links in there... this is much *much* nicer.
Thanks
No LK, forgot that
The 'create new threads' needs to be left unchecked. We'll most likely remove it completely in the next update. Your ubb header and footer can be added easily as well. it'll be included in the next version too
quote:
Originally posted by CTM:
Wow, this is great... Thanks Allen
BTW: Is this gonna be used with the Portal? welcome
This will probably become part of the portal, once the coding issues are worked out and modularization issues are worked out for the portal project. That's under the 'code optimization' todo list
Great work with this, should be a good addition to many forums.
danke
It'll be more useful once we get the wordlets and a few other tidbits done
Good job Allen. (And Mark, LK and CC)
quote:
Originally posted by CaCoffin:
I guess I am a bit ignorant - what does this add ? That is what does having a "plug n play database" do for the board?
Eh?
Very very cool !!!
Thanks a lot for this pluggin
Very usefull!!!
bobbel
I don't see any catagories, and the on.gif and off.gif files point to my webpage root, obviously they don't exist.
OK nm - I uploaded the CONTENTS of the uploads folder, not the folder itself. Obviously we have to modify for our own icons everywhere I assume? No problem if so...
OK, got everything figured except the files won't actually upload. The form submits ok, but it's pathing with the complete path including my local drive.
Ah...i see there is a file check for .zip - you need to have it reject the form if a non .zip is trying to be uploaded...I will try to figure out how to modify this because I am only going to use it for .jpg
OK, got everything figured out except how to easily add my header and footer...help?
I want to have this come up as one of my forum section, like instead fo seeing threads, I want to see the db section with all my formatting. After figuring out how to use the header and footer, I think it just means creating a new forum section, then modifying the forum record to display the db.cgi instead of the forum code. Help?
quote:
Originally posted by CaCoffin:
quote:
[qb]Originally posted by CaCoffin:
I guess I am a bit ignorant - what does this add ? That is what does having a "plug n play database" do for the board?[/qb]
Eh?
Man I must be the biggest idiot in the world that I am the only one who does not understand the purpose of this MOD.
Such an idiot that it is obviously so apparent that not one person has chosen to add a few lines explaining.
Would anyone care to enlighten this idiot?
Yeah, it's not immediately apparent what it is. It's a file database. Users can upload items and have them displayed and indexed.
bglynn - that's a heck of a lot of work you're looking at there... can you explain why you want to change the look so much?
I'll add the header/footer to this once I get back in town bglynn, along with doing wordlets so it's more easily customized
OK, first, QUICKREPLY FARKING SUCKS! That's TWICE I lost the message because something was wrong witht he post, and the back button wipes it clean! ARGH!
This is bglynn, I switched emails and can't retrieve my old password.
Ca - click on the demo link in the first post - it's self explanitory.
Charles - I'm making a profile driectory like
this one. Here are a couple rough examples:
add entry ,
pic demo
quickreply is optional
Nice adaptation
You can add your forum's header/footer in the lib.cgi - check for this :
If you use the same variables as used in public_common.pl, you should be able to easily add them. I'll get them Monday tho for the rest
quote:
Originally posted by Charles Capps:
Yeah, it's not immediately apparent what it is. It's a file database. Users can upload items and have them displayed and indexed.
Ok, thank you.
I am already using an upload utility for people to upload files for posting, but there is no way for them to see what has been uploaded so it looks like it is probably a better way to go.
Thank you!
Well
that\'s looking better now! Thanks!
Hey if anyone is around right now, I'm running into something weird - whenever there is more than one entry in a catagory, the table gets all garbled - I'm trying to compare teh code but I'm not sure where it's not tripping right...
http://www.sbtontheweb.com/cgi-bin/db.cgi?action=cat;id=1
OK, I found the problem...I have a textarea field, and wheneer someone uses a hard return it screws up the datatable. I need to find out how to have it convert to  . For now I changed the textarea to a text field.
I'm also having a problem where if the contributing member ID is switched on all records int he catagory to the last entry's name.
OK, I had a problem with file uploading, turns out that it's rejecting anything with an upper case extension, I imagine that will be easy to fix, probably add an or statement or something...new to programming, bear with me.
I wonder if you ran into the same ID problem, since you don't display the member name on the individual forms? For now I took mine off as well, they are only stored and displayed correctly on the Cat display page. I would like to have it array them correctly in each record though...
Wow, it worked...this stuff is kinda fun! Takes me back to HS
I didnt look at the code, but in the db.cgi file, you are loading an unnecessary module 'UBBCGI'... The codes below are using 'CGI' ...
code:
use CGI qw(:standard);
use UBBCGI ':cgi';
also, you are not using %in... so, this code is unnecessary also:
code:
[qb]%in = map{
my @z = param($_);
( scalar(@z) > 1 ?
( $_ => join(",", @z) ) :
( $_ => $z[0] )
)
} param();
[/qb]
Thankyou Burak, I'll update the zip tomorrow - let me know if you see anything else please?
Hey kaelaria, if you found some bugs, mind sharing the fixes?
zip updated with Burak's post and added the ubb header/footer to the layout
I just added an or to check for both cases of file extension - I haven't had time to fix the rest - for now I removed the edit feature, because the variables were getting switched, and removed the top-10 because of presumably a formatting issue, although it could be a variable carry over also. fixed a couple spots of the on off icons, that were missing part of the variable...that's about it so far. The rest is just a lot of additional building on your base so far.
If you don't mind posting the files, I'll Beyond Compare in the pieces that would work here, thanks for the work
email me and I'll send them:
[email protected]
Hi,
what have I to do to show my forums-background Picture! Now there is only a black background....
Thanks
d-talk
Hello d-talk, have you used the most recent version? It should be following your styles you have set. You have a link to the problem?
thank you, it seems to be doing the css wrong for the background image. I'll update it today
in the mean time, change this in lib.cgi:
background : http://www.giga-board.com/ubb/bg.jpg;
to:
background-image: url(
http://www.giga-board.com/ubb/bg.jpg);
It works Thank you!!!
d-talk
Hi,
is there any possibility to add other files than .zip, like .exe,.tar...... where must I modify the datafiles?
Thanks
d-talk
Files updated to version 2.5 as I just finished the wordlets. It should be much easier to customize to your site now
bglynn changed this line on line # 281 of db.cgi to add the ability to upload .jpg files. I haven't had time to check his changes
if ($zip ne "" && ($zip =~ /.jpg$/ or $zip =~ /.JPG$/)) {$zip = &UploadFile($zip,"$UploadPath/db","zip");}
Sorry, it doesn't work! Internal Server error!
Can you please tell me also why I couldn't see the possibility to add a attachment when I edit a post! I rehack the file 10 times but nothing is to see there...
Thanks
d-tlak
There is no code there to add more than one attatchment or change the attatchment. You have to delete the record and create a new one of you need to change the attatchment right now.
If you want to add file types, in the line quoted above add statements like:
or $zip =~ /.exe$/ or $zip =~ /.EXE$/ or $zip =~ /.tar$/ or $zip =~ /.TAR$/
etc.
or just add $zip =~ /.exe$/i, then you don't have to also add EXE
Hi, at which line i hav to ad it, I also get an internal server error....
thanks d-talk
Hi,
another problem:
everytime a person postn a reply the signature will not be shown at the posting!
The sig is only shown by the topic-starter...
Thanks d-talk
do you have a link to that d-talk? Someone posting a reply shouldn't have anything to do with this mod
Hi,
the problem with the signature was form an other hack... but i can't add other file-types like exe, jpg, ect...
link:
http://www.giga-board.com/cgi-bin/dg.cgi+ thanks
d-talk
it's being filtered out... I'll check a couple other mods for the type of filtering being done
Hi,
i have installed the myStyle hack too! Now at every style-template at the db the background of the standard-template is shown and not the backgroundcolor choosen at the cp!
What can I do?
thanks
d-talk
Un-install the mystyle hack
Seriously, we can't account for every variation in modifications out there. You can hard-code the colors in for the db.cgi file if you like. Check the lib.cgi file and the css within.
Files updated to make it easier to add file types, check the first post for instructions
umm.. Allen, there is a lot of junk code in the files
for example [lib.cgi],
in sub CreateNewThread, this code looks like unnecessary? I couldnt locate any code using them:
code:
#adjust bgcolor variables
if ($vars_style{BGColor} ne ""){$BGColor = qq(bgcolor="$vars_style{BGColor}");}
if ($vars_style{AltColumnColor1} ne ""){$AltColumnColor1 = qq(class="color1");}
if ($vars_style{AltColumnColor2} ne ""){$AltColumnColor2 = qq(class="color2");}
if ($vars_style{CategoryStripColor} ne ""){$CategoryStripColor = qq(bgcolor="$vars_style{CategoryStripColor}");}
if ($vars_style{TableColorStrip} ne ""){$TableColorStrip = qq(bgcolor="$vars_style{TableColorStrip}");}
if ($vars_style{PageBackground} ne ""){$PageBackground = qq(background="$vars_config{NonCGIURL}/$vars_style{PageBackground}");}
if ($vars_style{TableBorderColor} ne ""){
$TableWidth2 = "100%";
$BorderTop = $TBT;
$BorderBottom = $TBB;
} else {
$TableWidth2 = $vars_style{TableWidth};
$BorderTop = $TBT;
$BorderBottom = $TBB;
}
also there are un-closed and un-openen curlies:
in sub Lock, while is not closed but you' ve closed it in Unlock
code:
[qb]sub Lock {
local ($lockname) = @_;
local ($endtime);
$endtime = 15;
$endtime = time + $endtime;
while (-e $lockname && time < $endtime) {
open (LOCKFILE, ">$lockname");
} #end lock sr
#############################################################################
sub Unlock {
local ($lockname) = @_;
close (LOCKFILE);
unlink ($lockname);
}
} # end Unlock sr
[/qb]
etc... etc...
also sub GetAge looks unnecessary ?
quote:
Originally posted by AllenAyres:
Thankyou Burak, I'll update the zip tomorrow - let me know if you see anything else please? Look familar?
I am not a perl coder, if you are able to clean the files up a bit, I'd really appreciate it
I think some of that is from the 'create new thread' stuff we are removing, it was used in the original version for ubb v5
ok I can clean the code, but I cant adapt any ubb interface(s) to the files i.e. "$filehandle = new UBB::FileHandler(%vars_config);" => I dont know what it does
Also the "SendAnEmail" sub looks unnecessary, and UBB has a module and sub for sending email afaik?
yeah, I am looking through the code as well, a lot of this deals with ubb v5 stuff that isn't needed now. Am I right to say if a sub isn't called to perform anywhere else other than where it is written (as in Sub SendAnEmail), then it can be removed? There's a lot in lib.cgi that isn't needed
yes, if no one calls, you can delete it...
so we can delete 'CreateNewThread' sub also?
quote:
Originally posted by AllenAyres:
I think some of that is from the 'create new thread' stuff we are removing, it was used in the original version for ubb v5
does this look better? Everything still seems to work
https://www.ubbdev.com/ubb/upload/00000494/lib.txt
running an errand, will be back in a couple hours
Let me know what you think and I'll update the zips a bit later. Thank you for your help
You've deleted CreateNewThread, but db.cgi has a call to it (if you have not deleted it and others also
)
$thread = &CreateNewThread($CreateIn,$username,$message,$name);
Thank you, removed the thread stuff from db.cgi as well
Zip file updated with latest revisions, just upload lib.cgi and db.cgi to get the latest changes
Hi there are many bugs at the links , whenn a file added for exaple for back ther is the wrong path and so on...
thanks
d-talk
got a link to the problem d-talk? Are they uploading to your ubb's noncgi/uploads folder?
I am sending you guys the same files we use here and we don't have path problems on the test db.
ok, I've checked maybe 25 files, they all worked except one, it might be corrupted or something, try re-uploading any you've seen and tell me if you are still having problems.
At first
1- How can I install worldlet of this mod?
2- How can I rearrange style of this mod?
I have just uploaded the file but I think I have to rearrange some files and pl_common.cgi.
Just upload the included wordlet file in the same directory as your other variables files.
In your ubb noncgi directory, upload the upload folder and the files within
Finally....
Great workx man!
Maybe you can also insert a rating system?
thnx for the work!
Message Deejay
Is there any way to set who can upload? I would only like admin and auth users.
Also a way to limit the size of the file uploaded
Good input, those are some features that would be nice to add...
I think it would be a simple thing to only allow admins/moderators to upload, or list individual user numbers. I'll try to look at it this week
Is anyone haveing a problem with the redirect besides just me?
i got a problem with Edit and Del after i use it and hit the Click here to return it takes me to a blank page.
but outher then that everything works just fine.
(edit)
umm never mind i found the prob in vars_wordlets_db i am not sure if it is right or not but it works now.
Hi ClanKiller,
I have the problem too!!!
d-talk
hey d-talk i had the problem but the only want i could find to fix it was to look in.
(edit to make post smaller)
This oode is not in vars_wordlets_db.cgi
d-talk
Well i should be d-talk it was in mine i did not just add it there myself.
thanks for the fix CK, I'll get it added to the files
allen i fixed a few outher things i had problems with.
you can get the files at it at this
Link
muchas gracias
Zip updated with Clankiller's bugfixes (thank you
). Pay attention to the new folder with icons that needs to be uploaded as well
Hi,
I get this error after i want to upload a zip file until i changed to UBB-Classic 6.4.0 Beta Release 1
Error:
>/home/www/web3/html/ubb/uploads/db/UBBclassic-6400-br1a-release.zip can't open output file
What can I do?
mebbe too big? I wouldn't recommend uploading the ubb zip, that could get you in a world of trouble
Hey great hack! I installed and tweaked it with ease. One question, how will it work with the UBB 6.4 MD5 hashes for password stuff?
Chris
Just by looking at the code quickly, they don't have the necessary routines and/or requires for decrypting the MD5 hash from the cookie. If they are presenting a login box, it doesn't need the MD5 routines, as the MD5 only affects the cookie.
quote:
Originally posted by Sub Zero:
Just by looking at the code quickly, they don't have the necessary routines and/or requires for decrypting the MD5 hash from the cookie. If they are presenting a login box, it doesn't need the MD5 routines, as the MD5 only affects the cookie.
Oops, yep you are right, I don't know what I was thinking. Thanks!
I do have an item for the wish list. My site is a car related site and we use the uploads db for guys to show their pictures, videos and sounds.
http://ubb.turboford.org/cgi-bin/db.cgi I would like it if when the user uploads something, it automatically creates a directory with his username and puts all of his files in his directory. Then, when they add any additional items it checks to see if they have an existing directory. Thanks!
You might check out mike's album.pl for that Chris. It's a very nice script that already works with 6.4
quote:
Originally posted by Sub Zero:
Just by looking at the code quickly, they don't have the necessary routines and/or requires for decrypting the MD5 hash from the cookie. If they are presenting a login box, it doesn't need the MD5 routines, as the MD5 only affects the cookie.
Just been testing with it, but to get access to the admin section u need the modifications to access it with md5.
[/code]Needs to be in place of:
[code]
Hopefully later on today i have the time to hack the other pieces.
As far as i can see right now, it works 100% ok.
She also the thread in beta mods 6.4.x (https://ubbdev.com/ubb/ultimatebb.php?ubb=get_topic;f=33;t=000014)
The only think that is bugging me is that the tendb.cgi file does not contain the correct cat number in the field, so the top 10 is not correct.
Later.
TwsLex