UBB.Dev
Posted By: Gardener Multiple Sigs 1.0 beta (for 6.0.1) - 07/18/2002 5:38 AM
I have now finished my hack which allows users to have multiple signatures to choose from when writing posts. It seems to work on my test site but I haven't given it any major tests.

Had I known when I started out how much changes I had to do to make this work I don't think I would have done it. There are changes to 18 files and 5 files are added. This also makes it highly possible that I have missed something in the install instructions, but I have been as careful as possible and I hope everything is there. I have also tried to make the instructions as easy to follow as possible and have given both code and line number for each step to change. But still, only try this hack on test boards at this point, becuase there are probably still bugs in it, and since there are so many changes to be made it can be easy to miss something.

I have also fixed some bugs that I've found, sometimes the signature isn't shown when viewing posts (like when replying and such).


Mod Name / Version MultipleSigs 1.0beta
Description A hack for UBB.threads 6.x that allows users to have multiple signatures to choose from.
Working under UBB.threads 6.0.1
Any pre-requisites PHP4
Author(s) Gardener
Credits None
Demo Not at the moment.
Files Altered ubbt.inc.php, newpost.php, newreply.php, showflat.php, showthreaded.php, addpost.php, editpost.php, modifypost.php, previewedit.php, changebasic.php, previewedit_preview.tmpl, newreply.tmpl, newpost.tmpl, addpost_preview.tmpl, editbasic.tmpl, editpost_nopoll.tmpl, languages/generic.php, languages/editbasic.php
Database Altered New table w3t_Signatures added, new field B_SigNumber added to w3t_Posts.
New Files editsigs.php, changesigs.php, multiplesigs_install.php, languages/editsigs.php, editsigs.tmpl
Any other info Since there are a lot of files to change, this hack can be a pain to install. Please make sure that you follow the instructions carefully. Since this is a beta version, don't install this on a production board!


Attached File
Posted By: Aglavalin Re: Multiple Sigs 1.0 beta (for 6.0.1) - 07/22/2002 8:16 AM
This is a nice hack A pain in the neck to install, but it's very nice overall!

Two things though...

In the directions, step 10 for addpost.php is a little confusing. It says to cut out a query and replace it with just the query strings. I figured out to just replace the stings, but this should be fixed.

Also, I made a new user after this upgrade was complete and working great for existing logins. The new user could not enter even one signature. No errors, it just didn't get saved for some reason. I made a test login on my testboard for people to see an example of this, but I found I couldn't make any siganatures for it, LOL

For existing users it seems to be working fine from what I have seen so far. I can post with no sig, or one of several I added. Very nice overall
Posted By: Gardener Re: Multiple Sigs 1.0 beta (for 6.0.1) - 07/22/2002 11:32 AM
Thanks for the input, I'll try to make it clearer on step 10. About it being a pain to install I can't do that much about, I do have a zip file containing the changed files but Infopop doesn't allow me to spread that.

Nice catch on the new user's bug, hadn't even tried that one and can't think of why it happens either. It is confirmed though, it doesn't work for me either. =] I just thought of one thing though which will have to be fixed. New users don't get a "Default" signature, which is bad because it is the one called Default that is pre-selected when adding new posts. Without it, the empty signature would be pre-selected. I think that the Default signature shouldn't be allowed to be deleted or the name of it changed...

It's good to hear that you like the hack, I'll try to get the bug fixed as soon as possible. But my server has just been partly fixed, so I'll probably spend the next day configuring and fixing it...
Posted By: Aglavalin Re: Multiple Sigs 1.0 beta (for 6.0.1) - 07/22/2002 9:26 PM
With all the files this hack changes, there is really no way to just replace complete files unless your on a virgin board. My board has quite a few hacks by now, so I really have no choice but to add the code line by line. For me, this hack is worth the time
Posted By: Gardener Re: Multiple Sigs 1.0 beta (for 6.0.1) - 07/22/2002 9:59 PM
Well, it would if it was the first hack you installed. =] But judging by how easy it is to add mods now there probably aren't that many that has a standard install...

You could always bug Scream until he adds it to the main distro. =]
Posted By: WrÅith Re: Multiple Sigs 1.0 beta (for 6.0.1) - 07/22/2002 10:57 PM
Sounds like a great hack. I think I'll wait until the bug with new users gets worked out before I play around with it though.
Posted By: Gardener Re: Multiple Sigs 1.0 beta (for 6.0.1) - 07/22/2002 11:23 PM
That sounds wise. =]

I'll get around to fix it soon, but right now I'm fiddling with my server, it still isn't working right. I've had to upgrade/recompile a bunch of programs, but hopefully it'll work fine soon.
Posted By: Aglavalin Re: Multiple Sigs 1.0 beta (for 6.0.1) - 07/23/2002 2:17 AM
If all else fails fixing a server, kick it!
Posted By: Gardener Re: Multiple Sigs 1.0 beta (for 6.0.1) - 07/23/2002 2:44 AM
I certainly would have, but luckily it's about 1000 km away locked away in a basement to which I have no key...

I could write a book on the trouble this server has caused me... I just hope it ends now, since the only thing that's left of the original computer is the case, the graphics card, a network card and a scsi-disk.
Posted By: Gardener New version: Multiple Sigs 1.0 beta2 - 07/23/2002 3:50 PM
OK, I've fixed the problem with new users. I had forgotten to add a default signature for them when they are added to the database. I also removed the possibility to delete or change the title of the default signature, since there should always be at least one signature.

Changes Since beta1 the files editsigs.php, editsigs.tmpl and languages/editsigs.php has changed, Step 10 has been clarified, Step 21 has been added and Step 5 has changed the text.

Attached File
Posted By: Aglavalin Re: New version: Multiple Sigs 1.0 beta2 - 07/24/2002 3:07 AM
Yeah! it works

Just update your directions for step 21 to read 'edit adduser.php' as the file to make the changes.

If anyone wants to see this one working, you can check it out at http://www.newoutriders.org/ubbtest/ Login: test Password: test
Posted By: Gardener Re: New version: Multiple Sigs 1.0 beta2 - 07/24/2002 4:06 AM
Ooops, thanks for the info, as well as the link to check it out. I will soon have my own test site up, but I haven't upgraded it to 6.0.2 yet, or installed any of the hacks...
Posted By: Aglavalin Re: New version: Multiple Sigs 1.0 beta2 - 07/30/2002 8:32 PM
OK, this hack did mess up my calendar forum (Max's Calendar). Basically it made the body not get saved, nor display any of the post details. Although, the date, time and title were showing up on the calendar ok.

I have a partial fix so far, take the addpost.php hacks from the multisig hack and do them the same on the addevent.php file which is from the calendar. This will let the info get saved and display ok, but no signatures will be available.
Posted By: Gardener Re: New version: Multiple Sigs 1.0 beta2 - 07/30/2002 9:28 PM
That doesn't sound good. I'll try to install the calendar hack and see if I can make the changes needed to make them both work.
Posted By: WrÅith Re: New version: Multiple Sigs 1.0 beta2 - 08/20/2002 8:13 AM
Gardner:

Implementing this hack went just fine, but I ran into a problem during my testing. When I delete a signature that was used for a post, the post that used the signature disappears. It is no longer visable in FLAT mode. I suspect this is because it is trying to grab the signature, but it no longer exists. I would recommend putting in a bit of error-checking that if it can't locate the signature, it "defaults" to the Default. That would prevent the post from disappearing.

If you have questions on what I mean, feel free to contact me.
Posted By: Gardener Re: New version: Multiple Sigs 1.0 beta2 - 08/20/2002 5:42 PM
Yikes, that isn't good at all and I know why it is happening. The message tale is joined with signature table where the stored signature_id in w3t_posts is the same as one in the w3t_signatures table. To insert error checking here would mean that a query would have to be added for every post, which isn't that good.

I think it would work if all posts with a signature are updated when the signature is deleted and set to default.
Posted By: WrÅith Re: New version: Multiple Sigs 1.0 beta2 - 08/20/2002 9:12 PM
[]I think it would work if all posts with a signature are updated when the signature is deleted and set to default.

That's what I originally had in mind, but I wasn't sure how that would be implemented. It sounds like it would just need to execute a query that looked for instances of the deleted signatures ID and then changed that to the default. If you want, I'd be happy to test such a query for you on my test site.

Posted By: Gardener Re: New version: Multiple Sigs 1.0 beta2 - 08/20/2002 9:41 PM
These two queries should do the trick:

code:

SELECT S_Number FROM w3t_Signatures WHERE S_User = '{$user['U_Number']}' AND S_Title = 'Default'

UPDATE w3t_Posts SET B_SigNumber = '$DefaultSig' WHERE B_SigNumber = '$DeletedSigNumber'



The first one gets the ID number of the users default signature and the second one updates all posts that have the deleted signature into using the default signature.

Unfortunately I haven't got this hack installed at my test board at the moment as I did a clean install recently. But I'll reinstall it and fix this as soon as possible.
Posted By: WrÅith Re: New version: Multiple Sigs 1.0 beta2 - 08/21/2002 5:34 AM
Where would I put this code in?

Also, one of my users reported another problem. Any time that the quotation marks (") or apostrophe (') are used in a signature, the hack automatically adds the backslash (\) in front of them, thus making them " or \'.

Now I know that you add the \ in before the " or sometimes ' in PHP, but why would the hack be adding that automatically?

You can read about it here.

---------------
The Terran BBS :: Science Fiction Discussion Board
The Senate :: Political Discuss Board (Coming Soon)
USS-Atlantis :: Play-by-Email RPG
StArgÅte Alpha Site Command :: Play-by-Email RPG (Coming Soon)
Posted By: Gardener Re: New version: Multiple Sigs 1.0 beta2 - 08/21/2002 4:04 PM
You would also need some extra php code together with those sql statements. It should go somewhere in changesigs.php where sigs are deleted. But I'll fix it for you when I get the time.

About the backslashes I think the Al Gore-thing is the correct guess on this. ;]
Seems that I've done one addslashes to many or something, I'll check up on that as well.
Posted By: WrÅith Re: Multiple Sigs 1.0 beta (for 6.0.1) - 08/26/2002 6:34 PM
Hey Gardener:

Any movement on this one?
Posted By: Gardener Re: Multiple Sigs 1.0 beta (for 6.0.1) - 08/27/2002 1:24 AM
Nope, not yet, I've been fixing my server (which is now working, but for some reason still slow even though it doesn't have any load), and doing some bug fixes to the quick reply hack.

This is next on the todo-list though, but I won't have time to do anything for a few days yet.
Posted By: WrÅith Re: Multiple Sigs 1.0 beta (for 6.0.1) - 08/27/2002 10:40 PM
No problem. I haven't run into any difficulty with it yet. I disabled the ability to delete a signature, so that should prevent any problems while I'm waiting.
Posted By: Aglavalin Re: New version: Multiple Sigs 1.0 beta2 - 09/13/2002 10:13 AM
Here is an updated instruction list to upgrade to 6.1

This is mainly for boards that already have the beta 1.2 version installed as it does not include a new .php file to create the new table with the new table names introduced in 6.1 . Perhaps you could run this on an existing board BEFORE you upgrade to 6.1, it would still be installable with the original .php added files then.

It seems to be working ok for me so far, as I am still trying to get all the hacks into my new install of 6.1 so I can go live with it...

Attached File
56552-MultipleSigs-1_0b3.txt  (68 downloads)
Posted By: Gardener Re: New version: Multiple Sigs 1.0 beta2 - 09/13/2002 3:37 PM
Thank you for this! I haven't had as much time as I'd hoped lately so it's a relief that I won't have to update this myself. I haven't tried it yet, but I will as soon as I've installed the 6.1 beta.
Posted By: Aglavalin Re: New version: Multiple Sigs 1.0 beta2 - 09/13/2002 11:42 PM
I'll let you double check my instructions and update the .php file that modifies the database
© UBB.Developers