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)

Lieva 09-30-2006 09:29 AM

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.

D.Ilyin 09-30-2006 03:48 PM

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

Lieva 09-30-2006 06:35 PM

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.

kafi 10-01-2006 01:12 PM

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

Lieva 10-01-2006 01:31 PM

Hmm, actually, it grants all mod rights.

For just editing rights, it would be:

PHP Code:

.
                if ( 
$forumid == 120  && $do=='caneditposts' )
                    {
                    
$return true;
                    } 


kafi 10-01-2006 06:49 PM

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!

dcevoclub 10-03-2006 03:39 PM

this does not work on 3.6.1 just FYI :)

Lieva 10-03-2006 05:54 PM

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.

TosaInu 10-15-2006 10:22 PM

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?

TosaInu 10-16-2006 10:04 AM

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.


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.01401 seconds
  • Memory Usage 1,777KB
  • 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
  • (7)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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