vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Add Signature in Non-Signatured Posts? (https://vborg.vbsupport.ru/showthread.php?t=107416)

forumsoup.com 02-07-2006 09:58 PM

Add Signature in Non-Signatured Posts?
 
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:
Code:

                $userdata->set('signature', $signature);
and add before it:
Code:

                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:

[sql]UPDATE post SET showsignature = 1 WHERE showsignature = 0;[/sql]

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:
Code:

****** 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
PHP Code:

$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 -
PHP 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:
PHP Code:

$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.


All times are GMT. The time now is 01:20 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01157 seconds
  • Memory Usage 1,744KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (14)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete