Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Edit guest username on posts Details »»
Edit guest username on posts
Version: 1.00, by Paul Paul is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 08-10-2002 Last Update: Never Installs: 10
 
No support by the author.

Hi,

It aggrevates me that this feature isn't a part of vBulletin, so I've gone and added it myself. Let me know on this thread if you have any problems with it. This hack will allow you to change the username value for any posts made by a guest on your forum. If you don't allow guests to post, don't bother with this hack.

I don't have the time to create a screenshot, so you'll have to use some imagination (unless someone else would like to provide one). Just imagine a Username: input box when a moderator with editpost permissions edits a post made by a guest. This will not appear otherwise.

Files to be edited: 1
Template addition: 1

In editpost.php:

Find:
PHP Code:
$foruminfo=getforuminfo($threadinfo[forumid]); 
ABOVE it, insert:
PHP Code:
// Edit username on post hack
if (ismoderator ($threadinfo["forumid"],"caneditposts")  && $postinfo[userid]==0) {
  if (!
$username) {
    
$postusername $postinfo["username"];
    
$postusername htmlspecialchars($postusername);
    eval(
"\$editusername = \"".gettemplate("editpost_editusername")."\";");
  } else {
    
$postusername "";
  }
}
// End edit username on post hack 
Find:
PHP Code:
if ($HTTP_POST_VARS['action']=="updatepost") { 
BELOW it, insert:
PHP Code:
  // Edit username of post hack
  
if ($postinfo[userid]==0) {
    
$username trim($username);
    
$username eregi_replace("( ){2,}"" "$username);

    if (!
$username) {
      eval(
"standarderror(\"".gettemplate("error_nousername")."\");");
    }
    if (
$userinfo=$DB_site->query_first("
            SELECT user.*,userfield.*
            FROM user,userfield
            WHERE     (username='"
.addslashes(htmlspecialchars($username))."' OR
                    username='"
.addslashes(eregi_replace("[^A-Za-z0-9]","",$username))."') AND
                    user.userid=userfield.userid"
)) {
      eval(
"standarderror(\"".gettemplate("error_usernametaken")."\");");
    } else {
      
$postusername htmlspecialchars($username);
    }
  }
  
// End edit username of post hack 
Find:
PHP Code:
    $DB_site->query("UPDATE thread SET title='".addslashes(htmlspecialchars($title))."', iconid=".intval($iconid)." WHERE threadid=$threadinfo[threadid]");
    
//$title="";
  

BELOW it, insert:
PHP Code:
  // Start edit username of post hack
  
if ($isfirst and $postinfo[userid]==and $postinfo[username]!=$postusername) {    
    
$DB_site->query("UPDATE thread SET postusername='".addslashes($postusername)."' WHERE threadid=$threadinfo[threadid]");
  }
  
// End edit username of post hack 
Find:
PHP Code:
  $DB_site->query("UPDATE post SET title='".addslashes(htmlspecialchars($title))."',pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid'$editedbysql$attachmentsql WHERE postid='$postid'"); 
BELOW it, insert:
PHP Code:
  // Start edit username of post hack
  
if ($postinfo[userid]==&& $postinfo[username]!=$postusername) {
    
$DB_site->query("UPDATE post SET username='".addslashes($postusername)."' WHERE postid='$postid'");
  }  
  
// End edit username of post hack 
Add a template called "editpost_editusername"

Paste the following into the new template and save it (remember to take out the spaces in { firstaltcolor }:
PHP Code:
<tr>
    <
td bgcolor="{ firstaltcolor }" nowrap><normalfont><b>Username:</b></normalfont></td>
    <
td bgcolor="{ firstaltcolor }"><normalfont><input type="text" class="bginput" name="username" value="$postinfo[username]size="25" tabindex="1"></normalfont></td>
</
tr
Save and upload editpost.php. All done!

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 06-23-2003, 03:27 AM
wickedfate wickedfate is offline
 
Join Date: May 2003
Location: New Zealand
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice, got any screenshots?
Reply With Quote
  #3  
Old 06-24-2003, 07:01 AM
S.Shady's Avatar
S.Shady S.Shady is offline
 
Join Date: Apr 2003
Location: Cleveland, Ohio
Posts: 179
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

or use the vb intergrated funtion were a guest can enter a name of their own
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:42 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.04125 seconds
  • Memory Usage 2,246KB
  • Queries Executed 18 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (9)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (2)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete