Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
Post Edit History Viewer Details »»
Post Edit History Viewer
Version: 1.00, by Lieva Lieva is offline
Developer Last Online: Mar 2008 Show Printable Version Email this Page

Version: 3.5.1 Rating:
Released: 01-21-2006 Last Update: 11-06-2006 Installs: 46
DB Changes Uses Plugins
Is in Beta Stage  
No support by the author.

When someone edits a post, the old message is stored in another table before the new one overwrites the old message.

Posts that have been edited will have "view edit history" displayed below the post count in the postbit.

Clicking "view edit history" allows previous versions of a post to be seen.

The postbit and postbit_legacy templates are altered using a similar method to the one used in the vbshout extension by Zero Tolerance, i.e. a search and replace. This means that no manual alterations to these templates are required.

Normally, everyone can see the post history for all the posts, however, the XML file post_hist_mods_only.xml restricts it to mods only (and the poster themselves). (Both versions should not be installed at the same time).

--------------------------------

Updated:

use post-hist_1_1b.zip

Changes

- Enable/Disable by forum
-- On/Off by forum

- Enable/Disable by usergroup
-- Can see own history: Yes/No
-- Can see everyone's history: Yes/No

- Indicates who made the edit (if it wasn't the original author)

- Workaround for unknown templates
-- Insert <<Insert Post History>> into postbit and postbit_legacy templates
-- (This is only for templates where the auto-match doesn't work)

The options are controlled by admincp.

By default, nobody can see any of the histories. At minimum, you should set the admin usergroup to see all histories.

Request

I don't know how 3.6.x products work, but if someone tries it on 3.6.x and it works, that would be good to know. I don't actually have 3.6 on our own forums, so can't test it.

Also, if you find out any bugs for < 3.6, that would be good to know too.

Install Info

The zip file contains:

bit_field_post_hist.xml -> XML for permissions
post_hist_1_1.xml -> product file

To install:

copy bit_field_post_hist.xml to /includes/xml

and install the product.

In theory, this should work as an upgrade to the previous version. However, I haven't tested that.

If you uninstall the old version and install the new version, you will lose any saved post histories.

Troubleshooting

bitfield cache
You might have to open:

yourserver.com/admincp/index.php?do=buildbitfields

This re-calculates the bitfields that have been altered. On some versions, the product installer will automatically do it.

Moderators
The postbits determine if a post is a person's own post by seeing if they have permission to edit the post. This means that if you give mods the rights to see their own post histories, then they will be able to click to see everyone elses post histories as they have the rights to edit all posts. However, the link won't have any effect as the actual viewer is restricted based on actual poster.

Usage

The XML file should add 2 options that can be set when setting up a usergroup and 1 new option for each forum.

New options for each usergroup:

Can See Post History (Yes/No)
---- Allows members of this usergroup to see all post histories

Can See Own Post History (Yes/No)
---- Allows members of this usergroup to see their own post history

New option for each forum:

Post History Displayed (Yes/No)
---- Shows post history for every post in this forum

Show Your Support

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

Comments
  #132  
Old 09-30-2006, 09:29 AM
Lieva Lieva is offline
 
Join Date: Apr 2005
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I thought that was possible via the admincp, but it doesn't seem to be. Maybe, it might be worth searching for another hack that does it.

The only way I can see to get it to work would be modify the can_moderate function. The problem is that there is only 1 hook in can_moderate (in 3.5.1 anyway) and it is not in a useful position.

In a later version, they may have added more hooks.

The code required is pretty simple.

In /includes/functions.php there is a section of code:

PHP Code:
.
                
$return false;
                if (!isset(
$vbulletin->bf_misc_moderatorpermissions["$do"]))
                {
                    (
$hook vBulletinHook::fetch_hook('can_moderate_forum')) ? eval($hook) : false;
                }
                return 
$return
Your best bet would be to find 'can_moderate_forum'.

You then need to add

PHP Code:
.
                if ( 
$forumid == 120 )
                    {
                    
$return true;
                    } 
before

PHP Code:
.
                return 
$return
120 in the above code is the forumid of the forum you want to enable. If you want to enable multiple forums, you can just paste the code once for each forum you want to enable.

What is really annoying is that the hook is in exactly the right place, but it doesn't get activated unless the if branch is true.


NOTE: the . in the above php snippets are just for formatting, they shouldn't be copied into the code.
Reply With Quote
  #133  
Old 09-30-2006, 03:48 PM
D.Ilyin D.Ilyin is offline
 
Join Date: Oct 2005
Posts: 193
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
- Enable/Disable by usergroup
-- Can see own history: Yes/No
-- Can see everyone's history: Yes/No
For me not work on 3.6.1
Others functions are well....

Click install, but wait version for vB 3.6.1
Reply With Quote
  #134  
Old 09-30-2006, 06:35 PM
Lieva Lieva is offline
 
Join Date: Apr 2005
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by D.Ilyin
For me not work on 3.6.1
Others functions are well....

Click install, but wait version for vB 3.6.1
Are the options appearing in the usergroup and the forum managers ?

Have you tried browsing to

/admincp/index.php?do=buildbitfields

on your server?

It could be just that the postbit template are not setup/working correctly.

Can you post the postbit and postbit_legacy templates.

Alternatively, if you add

<<Insert Post History>>

into the postbit and postbit legacy templates at the appropriate position, it should also work.

Finally, can you try browsing to:

your_server/showthread.php?p=95518&prev_postid=95518&prev_edit num=0#post95518

replace 95518, in all 3 places, with the postid of a post you have edited since installing the hack. It should show the original version of the post.

Unfortunately, I haven't got 3.6.x installed on any test forums, otherwise, I could check myself. It would be a great help if you could answer this questions.
Reply With Quote
  #135  
Old 10-01-2006, 01:12 PM
kafi kafi is offline
 
Join Date: Apr 2004
Posts: 379
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lieva
I thought that was possible via the admincp, but it doesn't seem to be. Maybe, it might be worth searching for another hack that does it.

The only way I can see to get it to work would be modify the can_moderate function. The problem is that there is only 1 hook in can_moderate (in 3.5.1 anyway) and it is not in a useful position.

In a later version, they may have added more hooks.

The code required is pretty simple.

In /includes/functions.php there is a section of code:

PHP Code:
.
                
$return false;
                if (!isset(
$vbulletin->bf_misc_moderatorpermissions["$do"]))
                {
                    (
$hook vBulletinHook::fetch_hook('can_moderate_forum')) ? eval($hook) : false;
                }
                return 
$return
Your best bet would be to find 'can_moderate_forum'.

You then need to add

PHP Code:
.
                if ( 
$forumid == 120 )
                    {
                    
$return true;
                    } 
before

PHP Code:
.
                return 
$return
120 in the above code is the forumid of the forum you want to enable. If you want to enable multiple forums, you can just paste the code once for each forum you want to enable.

What is really annoying is that the hook is in exactly the right place, but it doesn't get activated unless the if branch is true.


NOTE: the . in the above php snippets are just for formatting, they shouldn't be copied into the code.
Great help Lieva!

Before I try it I just want to check if this will only allow others to edit the post without the rest of moderating options such move, delete etc. ???
Reply With Quote
  #136  
Old 10-01-2006, 01:31 PM
Lieva Lieva is offline
 
Join Date: Apr 2005
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hmm, actually, it grants all mod rights.

For just editing rights, it would be:

PHP Code:
.
                if ( 
$forumid == 120  && $do=='caneditposts' )
                    {
                    
$return true;
                    } 
Reply With Quote
  #137  
Old 10-01-2006, 06:49 PM
kafi kafi is offline
 
Join Date: Apr 2004
Posts: 379
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great, that is what I thought. Thank you for your solution and thank you for picking-up this great add-on again :-)

If you will got some sparetime i have something to think of. I suggest that moderator or owner (if permission is granted) will be able to delete desired part of history of the post. Those kinds like grammar edit etc. .-)

Also short description option for post history version will just do fine .-)

Also I have suggestion for colaborative use of it in the thread. After first post there can be second post (produced automatically and simultaneosly with first post) dedicated to colaborative answer with history option - editable by anybody. Then from 3rd post discussion may start. Anybody willing to contribute to colaborative solution in the second post will be welcomed .-)
Second post - if empty yet should be rolled up - saving some space....

Thank you!
Reply With Quote
  #138  
Old 10-03-2006, 03:39 PM
dcevoclub dcevoclub is offline
 
Join Date: Jul 2003
Posts: 72
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

this does not work on 3.6.1 just FYI
Reply With Quote
  #139  
Old 10-03-2006, 05:54 PM
Lieva Lieva is offline
 
Join Date: Apr 2005
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dcevoclub
this does not work on 3.6.1 just FYI
can you post the postbit and/or postbit_legacy templates for 3.6.1 (I can then add in the search/replace command).

Also, do the options appear in the usergroup manager and forum manager, in admincp, after you install the hack.
Reply With Quote
  #140  
Old 10-15-2006, 10:22 PM
TosaInu's Avatar
TosaInu TosaInu is offline
 
Join Date: Jul 2004
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nice hack Lieva,

We could use this very well for WiKi forums.

The logs do not contain info about who edited (while the field is there).

I guess there should be a bit in plugin POST-HIST: record_edits

Code:
$query = "INSERT INTO `" . TABLE_PREFIX . "post_edits` 
				( postid, editnum, message )
				VALUES
				( " . $postinfo['postid'] . " , " . 
				($postinfo['numedits']) . " , '" .
				addslashes($postinfo['pagetext']) . "' ) ";
to something like

Code:
$query = "INSERT INTO `" . TABLE_PREFIX . "post_edits` 
				( postid, editnum, message, editor )
				VALUES
				( " . $postinfo['postid'] . " , " . 
				($postinfo['numedits']) . " , '" .
				addslashes($postinfo['pagetext']) . "' ,  " .
                                ($postinfo['edit_username']) . " ) ";
I don't quite understand the ." part. And maybe I'm just all wrong. Am I missing something?
Reply With Quote
  #141  
Old 10-16-2006, 10:04 AM
TosaInu's Avatar
TosaInu TosaInu is offline
 
Join Date: Jul 2004
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lieva
It now supports:

- Enable/Disable by forum
-- On/Off by forum
The on/off only stops displaying the history log in those forums. It does not stop actual logging into the database. You need to wrap a conditional around the code in the plugin POST-HIST: record_edits to stop logging other forums (this can consume quite some space and may be an issue for some).

Code:
if($foruminfo['histstatus'] == 1){
..
..
and close the whole block:

}
Lieva, histstatus is a yes/no toggle right? I can change that to boolean/tinychar or something like that in the db?

Quote:
- Indicates who made the edit (if it wasn't the original author)
The field is in the database, but no info is stored there. I can't find code to do it either. VB 3.5 also has 100 positions to store usenames, not 50 anymore.

It's a great hack that has many possible applications: thanks Lieva.

P.S. maybe I just wrecked my installation and encounter errors that aren't there

Logged the id and name of the editor now.
Reply With Quote
Reply

Thread Tools

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 04:34 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08411 seconds
  • Memory Usage 2,337KB
  • Queries Executed 25 (?)
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
  • (3)bbcode_code
  • (7)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete