Previous Thread
Next Thread
Print Thread
Rating: 5
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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!
Attachments
52735-MultipleSigs-1_0beta.zip (0 Bytes, 7 downloads)

Sponsored Links
Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
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

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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...

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
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

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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. =]

Sponsored Links
Joined: Jan 2002
Posts: 218
Enthusiast
Enthusiast
Offline
Joined: Jan 2002
Posts: 218
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.

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
If all else fails fixing a server, kick it!

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.
Attachments
53035-MultipleSigs-1_0beta2.zip (0 Bytes, 15 downloads)

Sponsored Links
Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
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

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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...

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
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.

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: Jan 2002
Posts: 218
Enthusiast
Enthusiast
Offline
Joined: Jan 2002
Posts: 218
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.

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: Jan 2002
Posts: 218
Enthusiast
Enthusiast
Offline
Joined: Jan 2002
Posts: 218
[]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.


Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: Jan 2002
Posts: 218
Enthusiast
Enthusiast
Offline
Joined: Jan 2002
Posts: 218
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)

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: Jan 2002
Posts: 218
Enthusiast
Enthusiast
Offline
Joined: Jan 2002
Posts: 218
Hey Gardener:

Any movement on this one?

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: Jan 2002
Posts: 218
Enthusiast
Enthusiast
Offline
Joined: Jan 2002
Posts: 218
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.

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
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...
Attachments
56552-MultipleSigs-1_0b3.txt (0 Bytes, 68 downloads)

Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
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.

Joined: Jun 2002
Posts: 375
Enthusiast
Enthusiast
Offline
Joined: Jun 2002
Posts: 375
I'll let you double check my instructions and update the .php file that modifies the database


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
Posts: 70
Joined: January 2007
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
Morgan 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)