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 01-22-2006 08:01 PM

Quote:

Originally Posted by Alex_
Sure?
I don't see the according code... it's just a simple str_replace, isn't it?
When I restricted it to one user only this one could view the history but the link showed up for others as wellg giving them always the same version on every number...

My code looks now like
Code:

if ( $vbulletin->userinfo['usergroupid'] == 6 ) {

$vbulletin->templatecache['postbit'] =  str_replace( $insert_point,  $insert_point . $new_text , $vbulletin->templatecache['postbit'] );

$vbulletin->templatecache['postbit_legacy'] =  str_replace( $insert_point,  $insert_point . $new_text , $vbulletin->templatecache['postbit_legacy'] );

$vbulletin->templatecache['postbit'] =  str_replace( $insert_point2,  $insert_point2 . $new_text , $vbulletin->templatecache['postbit'] );

$vbulletin->templatecache['postbit_legacy'] =  str_replace( $insert_point2,  $insert_point2 . $new_text , $vbulletin->templatecache['postbit_legacy'] );
}


I meant that if you left it as default, it would have worked :p

The check is that those who can edit the post can also see the option.

Alex_ 01-22-2006 08:02 PM

Ah ok... cause I want it for admins only I had to add it ;)

SIINSI 01-22-2006 10:51 PM

Quote:

Originally Posted by Alex_
Ah ok... cause I want it for admins only I had to add it ;)

There's definitely, some kind of problem with this hack. I just had a zillion users PM me that they could not see any posts in a thread at all!!! I disabled the plugin and everything is back to normal.

Miguel

SnickersTK 01-23-2006 05:24 AM

see, now I am scared :-S

ndamico 01-23-2006 01:50 PM

Installed and working fine for me. One minor bug: When viewing pm's it shows a linked "1" now where the "View History" is on edited posts. It does this on all pm's even before the hack was installed. It links to:

http://www.123.com/forum/showthread....editnum=1#post

Minor but could be fixed. I haven't been able to look at and fix it yet myself.

Lieva 01-23-2006 04:44 PM

Quote:

Originally Posted by ndamico
Installed and working fine for me. One minor bug: When viewing pm's it shows a linked "1" now where the "View History" is on edited posts. It does this on all pm's even before the hack was installed. It links to:

http://www.123.com/forum/showthread....editnum=1#post

Minor but could be fixed. I haven't been able to look at and fix it yet myself.

I have fixed it. The problem is that PMs use the same postbit as posts. I just had to add a check so that it doesn't display unless $post[editnums] exists.

Lieva 01-23-2006 04:50 PM

Quote:

Originally Posted by SIINSI
There's definitely, some kind of problem with this hack. I just had a zillion users PM me that they could not see any posts in a thread at all!!! I disabled the plugin and everything is back to normal.

Miguel

Were you able to see the threads, or was it just other users ... it would be surprising if there was a usergroup dependant bug ?

It sounds like the postbit for showthread is broken somehow (and is crashing the postbit generator).

What version of vbulletin are you using and also have you changed the postbit template much ?

Another check that would be worth doing is to see if disabling just the plugin relating to showthread allows you to see normal threads.

If not, then check if disabling just the plugin relating to the postbit allows the you to see threads normally.

If you disable the postbit change, then it is still possible to view older versions of posts by typing in the link directly, you can use:

showthread.php?p=69841&prev_postid=69841&prev_edit num=0#post69841

to view the original version of a post that you have edited. You need to change 69841 to the postid of the post you have just edited.

Lieva 01-23-2006 04:51 PM

Quote:

Originally Posted by SnickersTK
see, now I am scared :-S

:), but you will notice that removing the plugin fixed everything.

Totti 01-23-2006 05:11 PM

hmm,
doesn't rewuire this hack a lot of diskspace due to the double and higher saves of one post?!?

any way of deleting the saved edits after half a year or similar?

Lieva 01-23-2006 05:41 PM

Quote:

Originally Posted by Totti
hmm,
doesn't rewuire this hack a lot of diskspace due to the double and higher saves of one post?!?

any way of deleting the saved edits after half a year or similar?

It only records edited posts. Posts that aren't edited are still only stored once.

SIINSI 01-24-2006 12:50 AM

Quote:

Originally Posted by Lieva
Were you able to see the threads, or was it just other users ... it would be surprising if there was a usergroup dependant bug ?

It sounds like the postbit for showthread is broken somehow (and is crashing the postbit generator).

What version of vbulletin are you using and also have you changed the postbit template much ?

Another check that would be worth doing is to see if disabling just the plugin relating to showthread allows you to see normal threads.

If not, then check if disabling just the plugin relating to the postbit allows the you to see threads normally.

If you disable the postbit change, then it is still possible to view older versions of posts by typing in the link directly, you can use:

showthread.php?p=69841&prev_postid=69841&prev_edit num=0#post69841

to view the original version of a post that you have edited. You need to change 69841 to the postid of the post you have just edited.

Yes, I was able to see the threads, that's what made it so wierd. Supermods were able to see it also. Moderators and another usergroup I made with supermod permissions were not able to see it. I got alot of IM's about it so, I just de-installed. Any ideas? It is a great idea nad could surely be useful.

Miguel

SIINSI 01-24-2006 12:52 AM

Quote:

Originally Posted by Totti
hmm,
doesn't rewuire this hack a lot of diskspace due to the double and higher saves of one post?!?

any way of deleting the saved edits after half a year or similar?

I would think you could just clean out the table it makes anytime you wanted to.

ndamico 01-24-2006 02:12 AM

Quote:

Originally Posted by Lieva
I have fixed it. The problem is that PMs use the same postbit as posts. I just had to add a check so that it doesn't display unless $post[editnums] exists.

Yep, that did it. Thanks for a great hack.

Just a suggestion: How about recording the username that makes the edit and displaying it with each edit version somewhere. I'll probably modify my board with something of this nature.

SnickersTK 01-24-2006 02:57 PM

I love you for this hack :)

Lieva 01-24-2006 05:02 PM

Quote:

Originally Posted by SIINSI
Yes, I was able to see the threads, that's what made it so wierd. Supermods were able to see it also. Moderators and another usergroup I made with supermod permissions were not able to see it. I got alot of IM's about it so, I just de-installed. Any ideas? It is a great idea nad could surely be useful.

Miguel

It sounds like the postbit for showthread is broken somehow. The only thing in there that is usergroup related is the "can_moderate" function. It might be worth trying the version that allows everyone to see old posts.

Another question, as admin do you use a different version of the postbit template ? Maybe you use postbit_legacy ? Also, if you use a different style that might be it as well.

Also, there might be a problem caused by other edits to the postbit template. Are you using the default version of the postbit template ?

There are two places where showthread could be being broken:

-- the plugin where the postbit is modified. This is the plugin using the "parse_templates" hook. It is called "POST-HIST: modify postbits". If you disable that, then the original postbit will be used, but you should still be able to view older versions of a post using the URL directly.

for example:
<forumname>/showthread.php?p=69841&prev_postid=69841&prev_edit num=0#post69841

allows you see the original version of a post before any edits. (change 69841 to the postid of the post you want to examine)

-- in showthread.php, this is where posts are replaced by older versions

The plugin is uses the "showthread_postbit_create" hook and is called "POST-HIST: update showthread"

If you can see the threads with this plugin disabled then this shows that this is where the problem is.

If not, then check if disabling just the plugin relating to the postbit allows the you to see threads normally.

Also, using guest login would probably allow you to replicate the problem

bashy 03-19-2006 01:35 PM

This is working 100% atm, well done :)

Nathan2006 04-11-2006 12:33 AM

Thank you Lieva

This is really cool :cool:

Just one thing I never understood in the other posts how would I be able to restrict it to admins only?

Thanks

Install

Southpaw 04-11-2006 05:45 PM

Is there a way to restrict this only to certain forums?

johngdk 04-24-2006 07:11 PM

Quote:

Originally Posted by Southpaw
Is there a way to restrict this only to certain forums?

I was wondering excatly the same.
Hope someone can help with a mod to the mod ;)

Btw. Great hack!

GrendelKhan{TSU 04-25-2006 10:13 AM

oooOOooo.... does this work with 3.5.4?

also, how deep does the history go? this is would the necessary hack to make something like this:

https://vborg.vbsupport.ru/showthrea...ight=viki+wiki

Stoebi 04-25-2006 06:43 PM

Nice Plugin, thx a lot.

Log out, clear your cookies. The page numbers are visible if you enter http://www.yourdomain.xx/showthread....ditnum=3#post1 for example. Not realy usable but the page numbers are visible.

Can you fix it, please?

EDIT:
I've the mod only version installed (vbtest).


Regards, Stoebi

Djamil 05-29-2006 07:28 PM

Does anybody have an idea how to make old versions available to moderators only and not to the poster ?

Djamil

-=Sniper=- 05-29-2006 07:53 PM

download the mods only version! from the download section in this thread.

Djamil 05-29-2006 08:20 PM

Thanks for your reply, but the suggested download does still allow the post owner to see the post history. I want mods only and nobody else to view the history.

Quote:

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).
Djamil

kafi 05-31-2006 10:28 AM

GREAT Lieva!

I want encourage you to continue in development of this hack because this is what I was looking for SO LONG :-)
and finally YOU made it happen :-)))

As my preposters already said, would be great to elaborate on features such as:

- who made changes (as wiki does)
- per forum permission settings
- per usegroup permission settings
- delete history per post/forum/time

This might become a hack of the month if not YEAR .-)

kafi 06-05-2006 07:41 AM

Is there anybody who will hepl Lieva with this perfect hack??? If I was coder I would definitally pick up this .-)

Djamil 06-11-2006 04:35 PM

Quote:

Originally Posted by Djamil
Does anybody have an idea how to make old versions available to moderators only and not to the poster ?

Isn't anybody in here able to point me the right direction ?

I think it's a simple conditional as "if (is_member_of($usergroupid, 5, 6, 7))" but I can't figure out where exactly to put it into the XML.

Djamil

tamborinegal 06-17-2006 04:11 AM

This is a great hack. Thanks Lieva.

I also agree that it would be good for it to be just for admins... or even admins and moderators.

This should be standard in vBulletin IMO.

Thanks again!

Clancy

kafi 06-20-2006 07:48 AM

Is there anybody interested to contribute to the development of this hack?

If there is more of us willing to pay, maybe Lieva or other coders will be interested to develop this hack...

Djamil 06-21-2006 06:16 PM

Quote:

Originally Posted by kafi
If there is more of us willing to pay, maybe Lieva or other coders will be interested to develop this hack...

I doubt it since this is already under consideration for a standard feature and Lieva was not online for over a month. Feel free to support all people at vb.com that expressed their needs in the thread. :-)

For the meantime I maybe will post in one of the help forums here since it should be no big deal to make this available to mods only. Should be a simple template conditional which I don't know how to place into the XML-file - somebody should be able to help if I find the time to post a proper request.

Djamil

kafi 06-25-2006 09:20 AM

I checked the thread but from it seems that this feature will not be available in 3.6 so I guess it will take long time to wait for it frm vb.com.
Furthermore I guess that there might be more usefull option for this than vb.com will include in official release.
To me it can be used for common knowleadge base - aka wiki.

Lieva 06-27-2006 11:02 PM

Quote:

Originally Posted by Djamil
I doubt it since this is already under consideration for a standard feature and Lieva was not online for over a month. Feel free to support all people at vb.com that expressed their needs in the thread. :-)

For the meantime I maybe will post in one of the help forums here since it should be no big deal to make this available to mods only. Should be a simple template conditional which I don't know how to place into the XML-file - somebody should be able to help if I find the time to post a proper request.

Djamil

Glad to see it has been useful for some peeople. I did this for our own forum, so it's sorta hard coded to what I wanted but I thought it would be nice to share :). It isn't actually that complex so adding the extra features would make it (somewhat) more complex. (There is also a slight problem in that I have somehow killed my local copy of vbulletin that I use for testing changes and haven't got around to figuring out how I broke it :) ).

Anyway, for those who are looking at the XML, there is mainly 2 parts:

The hookpoint: parse_templates

This is basically:

$insert_point = "blah";
$insert_point2 = "blah2";
$new_text = "new text";

Then a few commands do a search and replace on the templates. This is why there is no need to manually update the templates. The problem is that the required insert_point is different from version to version, that's why there is 2 insert_points.

Also, the text required here is the text of the template after some processing, rather than just copy/paste the template from admincp ... so hard to get it to match for different versions. It is also hard to read :).

The check code is
( \$post['numedits'] != 0 ) && ( \$post['editlink'] )

This means that it displays the edit history options as long as there is more than 0 edits and the user is permitted to edit the post.

Any variables that are available to the postbit can be used. I am not sure if usergroup settings are available.

I think that replacing

( \$post['editlink'] )

with

( \$show['inlinemod'] )

in the XML before uploading should make it so only mods can see the controls for viewing older versions. (This assumes that you are using inline mods)

The 2nd hookpoint is
showthread_postbit_create

This is less complex. It is where the post is actually modified so that it looks at the old post. Also, it checks permissions. This is the only part that needs to be updated if you don't mind users seeing the edit history options as long as they can't use the options.

The check is:

( can_moderate($thread['forumid']) || ($post['userid'] == $vbulletin->userinfo['userid'] ) )

The 1st term is the one that allows moderators to view the post history and the second term is for the user themselves.

Changing it to:

( can_moderate($thread['forumid']) )

would mean that only moderators can use the feature.

So, making those 2 chances to the XML (just requires a text editor) should make it so that only mods can see/use the edit history system. I don't have a "scratch" version of 3.5.1 atm, so I can't confirm that.

Btw, have people tried this out on other 3.5.x versions? It would probably be worth a yes/no question for each version. Also, posting the default postbit (and postbit_legacy) for those versions would help if they aren't working.

Getting it to work for the other versions (if they don't work), should just be a matter of adding more $insert_pointx strings.

Also, I haven't actually looked, but is the 3.6.x plugin system compatible with 3.5.x or have they redone everything again ?

Djamil 06-29-2006 01:36 PM

Thank you very much for clarifying this, I will check if this will do it.

BTW, I have "post hist mods only.xml" installed on a 3.5.4 forum and it works as you have designed it. If I manage to change it to work only for mods with your info I will owe you one ... :-)

Djamil

murdo 06-29-2006 02:06 PM

Great job, but I was wondering if there was any way to extend the information? (basically, i want to know who did the edit as well as view the history!)

Is this possible?

kafi 07-12-2006 06:37 PM

Lieva please let us know wheter you are interested to continue development of this hack or do you agree to pick this up by somebody else.

I willing to pay for this hack!

Thank you

SnickersTK 09-07-2006 06:35 PM

Can anyone help fix this error :(

I have no idea what it means or how to fix it. It only appears when you go to thread's you've posted in or your pressing edit, it seems :confused:


please please please help

SnickersTK 09-08-2006 07:36 PM

*waited 24 hours as the rules says*

anyone, please? I would really like this hack to work.

SnickersTK 09-11-2006 04:05 AM

anyone *bumps again*

Cybertims 09-13-2006 12:56 PM

Can you please post the templates edits it would need since the plugin version doesnt work for me as the line it looks for isnt there anymore.....it has all ben changed.

Cheers.

Protonus 09-19-2006 04:33 AM

Ack it seems this broke in 3.6. Just went to use it on my board and the buttons don't show in the template anymore ugh. Anyone got an idea how to fix this in 3.6? I'm assuming this is what Cybertims was enquiring about.

This really ought to be a standard feature in vB... I can't see why you wouldn't want this and if anything you could turn it off...

Anyone have a link to the thread that was aforementioned for support of this as a feature in vB?


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.01475 seconds
  • Memory Usage 1,848KB
  • 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
  • (1)bbcode_code_printable
  • (15)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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