PDA

View Full Version : Add Signature in Non-Signatured Posts?


forumsoup.com
02-07-2006, 09:58 PM
I noticed that if you post a post/thread (etc) without having a signature and then add a signature in your user cp and make a new post/thread (etc), the signature of course is there. If you look at one of your old post/thread (etc) that was posted before you added your signature, the signature has not been updated their. If you update your signature, the post/thread (etc) with the older signature will be updated but the post/thread (etc) that was made before the signature was made, will never be updated. Is there a mod/hack/ext. (etc) to enable adding signatures to posts that never had signatures?

ajmboy
10-27-2006, 10:58 AM
There was by running an SQL query..I saw in another post....

CyberAlien
10-27-2006, 11:46 AM
In profile.php find this: $userdata->set('signature', $signature);
and add before it: if(empty($vbulletin->userinfo['signature']))
{
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "post SET showsignature = '1' WHERE userid='" . $vbulletin->userinfo['userid'] . "'");
}

This will automatically add signature to old posts if user has just set a signature and signature was empty before.

fordp
07-21-2007, 02:49 PM
Where do you edit this?

Kirk Y
07-21-2007, 03:59 PM
In your "profile.php" file, located in your forum's root directory. Download it from your FTP, perform the above edits, and then re-upload the file.

fordp
07-21-2007, 05:05 PM
Thanks for your help.
I downloaded the php, modified it as stated, uploaded it back, refreshed old post with no sig, still no sig. The poster has a sig enabled/set.
??

Kirk Y
07-21-2007, 05:11 PM
The above edits will only work from this point forward. To show signatures retroactively, perform the following SQL Query:

UPDATE post SET showsignature = 1 WHERE showsignature = 0;

fordp
07-21-2007, 05:31 PM
Just received:

"vBulletin Message

You are not authorized to execute SQL queries"

Any ideas?

Kirk Y
07-21-2007, 05:39 PM
You can either execute the query through PHPMyAdmin or give yourself permission to execute queries through vBulletin by editing your includes/config.php file.

Search for the following in your includes/config.php file if you wish to do the latter:
****** USERS WITH QUERY RUNNING PERMISSIONS ******

MediaHound
12-14-2007, 02:13 PM
Thanks CyberAlien and Kirk, much appreciated, exactly what I needed too!

MediaHound
06-10-2008, 02:46 PM
There's a hook now in the profile.php page right after
$userdata->set('signature', $signature);
entitled profile_updatesignature_complete
Will the hook be good being that its AFTER the bit, not BEFORE it?

If so, this would be the permanent fix -
Visit your plugin manager, click add new plugin.

Product - vbulletin
Hook location - profile_updatesignature_complete
title - update signatures
code - if(empty($vbulletin->userinfo['signature']))
{
$vbulletin->db->query_write("UPDATE " . TABLE_PREFIX . "post SET showsignature = '1' WHERE userid='" . $vbulletin->userinfo['userid'] . "'");
}
plugin is active - yes
and remove the code from your profile.php (if you are reading this message, its probably not there anyway)

Thoughts?

Dismounted
06-11-2008, 07:16 AM
You can prevent using the query if there is a hook that is after $signature is defined, but before that line.

MediaHound
06-11-2008, 01:11 PM
The hook is directly after:
$userdata->set('signature', $signature);

If I create this plugin it will be in the proper place?
You say we can prevent the query if the hook is there.
The plugin has the query in it. Please clarify, sorry for any confusion.

Dismounted
06-12-2008, 06:11 AM
If you can insert code BEFORE that line - you can alter the code and prevent using the query.