vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Post Edit History Viewer (https://vborg.vbsupport.ru/showthread.php?t=105989)

kafi 10-26-2006 06:07 PM

Did you accomplished that you see who edited? I do not :-( Can you help?
Thank you!

TosaInu 10-26-2006 08:19 PM

Yes, some extra code has to be added and you need to add at least 1 extra field to the post_edit table (I did that with a SQL edit tool, rather than XML import).

I'm half sleeping now, I'll post tomorrow (unless someone else got better, which is very possible).

TosaInu 10-29-2006 01:43 PM

:( Sorry for being slow.

Use a sql editor and change in table post_edits

Code:

varchar(50) to varchar(100)
Vbul use 100 positions now for nicks afaik.

Add field:

Code:

editorid mediumint(10) UNSIGNED NULL Def NULL
The content of plugin POST-HIST: record_edits becomes:

Code:

if($foruminfo['histstatus'] == 1){

$query = "INSERT INTO `" . TABLE_PREFIX . "post_edits`
                                ( postid, editnum, message, editor, editorid )
                                VALUES
                                ( " . $postinfo['postid'] . " , " .
                                ($postinfo['numedits']) . " , '" .
                                addslashes($postinfo['pagetext']) . "' , '" . ($vbulletin->userinfo['username']) . "' , '" . ($vbulletin->userinfo['userid']) . "' ) ";

        $db->query_write( $query );

        $query = "UPDATE `" . TABLE_PREFIX . "post` SET
                                numedits = numedits + 1 WHERE
                                postid = " . $postinfo['postid'];

        $db->query_write( $query );
}

The 1st if conditions makes that only hist forums are logged and not just everything (that can be an issue when space is your concern).

The content of plugin POST-HIST: update showthread becomes:

Code:

//global $permissions;

$viewown = ( $permissions['userhiststatus'] & 2 ) != 0;
$viewall = ( $permissions['userhiststatus'] & 1 ) != 0;

if(
        (
                ( $foruminfo['viewhist'] != 0) ||
                ( $viewall != 0 ) ||
                ( ( $viewown != 0 ) && ( $vbulletin->userinfo['userid'] == $post['userid'] ) )
        )
        &&
        ( $_REQUEST['prev_postid'] == $post['postid'] )
        &&
        ( $_REQUEST['prev_editnum'] < $post['numedits'] )
  )
                {
                        $post['pagetext'] = 'matched change post';
                        $query =  "SELECT message FROM " . TABLE_PREFIX . "post_edits WHERE
                                                (postid = " . $post['postid'] . "
                                                AND editnum = " . $_REQUEST['prev_editnum'] . ")";
               
                        $post_temp = $db->query_first( $query );

if ($_REQUEST['prev_editnum'] > 0){
                        $query =  "SELECT editor FROM " . TABLE_PREFIX . "post_edits WHERE                                        (postid = " . $post['postid'] . "
                                                AND editnum = " . ($_REQUEST['prev_editnum']-1) . ")";

 $editedby = $db->query_first( $query );
 $edittxt = "\n \n Edited by: " . $editedby['editor'] . "";
}
else {
 $edittxt ="";
}

                        $post['pagetext'] = $post_temp['message'] . $edittxt;
                        $post['pagetext_html'] = "";
                        $post_cachable = 0;
                }

Note that it adds an extra query.

isanda 11-05-2006 08:27 PM

Any news on a version for 3.6 of this mod???

Hornstar 11-06-2006 11:17 AM

If you have this running with no problems on 3.6.2 let us know.

thanks.

Lieva 11-07-2006 04:37 PM

it does say who editted when someone other than the original poster does the editting. However, it places it on the old version of post.

E.g. if you go to version 2, it would say "xxx edited this post" and then version 3 would be the editted version.

I realised that the other way was better but didn't bother :p.

[edit]
Hmm, I seem to have uploaded the wrong file (as my local copy did show who edited the posts). The 1_1b zip file shows who editted the posts.

Viper007Bond 11-07-2006 09:58 PM

Man oh man, I'd love to have this for 3.6.2. :o

TosaInu 11-11-2006 08:13 PM

Quote:

Originally Posted by Lieva
it does say who editted when someone other than the original poster does the editting. However, it places it on the old version of post.

E.g. if you go to version 2, it would say "xxx edited this post" and then version 3 would be the editted version.

I realised that the other way was better but didn't bother :p.

[edit]
Hmm, I seem to have uploaded the wrong file (as my local copy did show who edited the posts). The 1_1b zip file shows who editted the posts.

I guess your method doesn't need the extra query?

Lieva 11-12-2006 05:18 PM

Quote:

Originally Posted by Viper007Bond
Man oh man, I'd love to have this for 3.6.2. :o

go to

admincp->styles and templates->style manager

Press the << >> button for the default style

The click on

postbit templates
postbit

(It might be different in 3.6.2)

Post the contents of the template or PM them to me and unless they seriously changed the format, I should be able to update it.

Lieva 11-12-2006 05:19 PM

Quote:

Originally Posted by TosaInu
I guess your method doesn't need the extra query?

Yeah, think so.


All times are GMT. The time now is 11:10 AM.

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.01257 seconds
  • Memory Usage 1,749KB
  • 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
  • (4)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete