vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Advanced Editing Options For Mods & Admins (https://vborg.vbsupport.ru/showthread.php?t=61412)

Natch 07-08-2004 11:01 AM

Quote:

Originally Posted by Slynderdale
Nice hack, just wanted to mention that it installed fine on vBulletin 3.0.3.
Had a little problem with another hack but I managed to fix it. I fyou have the quick edit hack installed and tried to quick edit a post, all the options get reset like IP, userid and name, the date and so on.

If anyone else has this problem heres a quick fix, in the template "showthread_quickedit" find:
HTML Code:

  <form enctype="multipart/form-data" name="vbulletinform" style="display:inline;" action="editpost.php" method="post">
and add under it:
HTML Code:

  <input type="hidden" name="quickedit" value="true" />
Then find in editpost.php:
PHP Code:

  if ($_POST['do'] == 'updatepost' AND  $bbuserinfo['editlevel'] > $editlevel['author']) 

and change it to:
PHP Code:

  if ($_POST['do'] == 'updatepost' AND  $bbuserinfo['editlevel'] > $editlevel['author'] AND !$_POST['quickedit']) 

and that should solve that problem.

Also I notice a small problem with this hack, if you change the user of the post, the original poster count doesn't decrese and the new user post count doesn't increase so you would have to update the counters to get them accurate again. Other then that, its a good hack.

Might this have some relation to the issue I was mentioning about the info being lost if SuperMods edit a post ?

Xenon 07-08-2004 12:23 PM

@Sly: hmm, a lint to that post

would have fit also ^^

As for the postcount, yes i know, will have to add that in my next update (when i find the time to add what i want to add ^^)

Slynderdale 07-08-2004 09:18 PM

Quote:

Originally Posted by Xenon
@Sly: hmm, a lint to that post

would have fit also ^^

As for the postcount, yes i know, will have to add that in my next update (when i find the time to add what i want to add ^^)

Didn't notice that post.

I made some changes to your hack that fixed up a couple things, one is corectly setting the users pos count and the other is updating the forum last poster and first poster info if you change the user.

After you install this hack, find:
PHP Code:

        // now do changes to thread, if logged in user is an admin and changed the dateline
            
if ($bbuserinfo['editlevel'] == $editlevel['admin'] AND
                
$postinfo['dateline'] != $newpost['dateline'])
            {
                require_once(
'./includes/functions_databuild.php');
                
build_thread_counters($postinfo['threadid']);
            } 

Replace it with:
PHP Code:

        //------------------------------------------------------------
        
if($postinfo['userid']!=$newpost['userid'] && $foruminfo['countposts'])
        {
          if (
$postinfo['userid'] > 0)
          {
            
$DB_site->query("
                  UPDATE " 
TABLE_PREFIX "user
                    SET  posts=posts-1
                 WHERE userid = 
$postinfo[userid]
                "
);
          }
          if (
$newpost[userid] > 0)
          {
            
$DB_site->query("
                UPDATE " 
TABLE_PREFIX "user
                SET  posts=posts+1
                  WHERE userid = 
$newpost[userid]
              "
);
          }
        }
        
//------------------------------------------------------------
    
        // now do changes to thread, if logged in user is an admin and changed the dateline
            
if ($bbuserinfo['editlevel'] == $editlevel['admin'] AND
                
$postinfo['dateline'] != $newpost['dateline'] OR
                
$postinfo['userid']!=$newpost['userid'])
            {
                require_once(
'./includes/functions_databuild.php');
                
build_thread_counters($postinfo['threadid']);
            } 

Now in includes/function_datastore.php find:
PHP Code:

    // ###################### Start updatethreadcount #######################
    
function build_thread_counters($threadid)
    {
        global 
$DB_site$threadcache

and change it to:
PHP Code:

    // ###################### Start updatethreadcount #######################
    
function build_thread_counters($threadid)
    {
        global 
$DB_site$threadcache$vbphrase

Now a little ways under that find:
PHP Code:

    $lastposter iif(empty($lastposts['username']), $lastposts['postuser'], $lastposts['username']); 

under it add:
PHP Code:

    $lastposter iif(empty($lastposter),$vbphrase['guest'],$lastposter); 

Now a little ways under that find:
PHP Code:

    $firstposter iif(empty($firstposts['username']), $firstposts['postuser'], $firstposts['username']); 

and under it add:
PHP Code:

    $firstposter iif(empty($firstposter),$vbphrase['guest'],$firstposter); 

Thats all, now the posts will show Guest instead of nothing when you enter in a blank field. Also it will now update the post count of those who you change the post to and from.

Xenon 07-08-2004 11:34 PM

Thx for sharing your changes :)

i might add, that your code for the postcounts isn't correct 100%
if you have forums where post's aren't counted, then of course you would not have to change the postcount ;)

but i'm sure a lot can use this, until i can come up with the next version (which hopefully has all of that implemented and the special additions i want to have ;))

Slynderdale 07-10-2004 04:45 AM

Quote:

Originally Posted by Xenon
Thx for sharing your changes :)

i might add, that your code for the postcounts isn't correct 100%
if you have forums where post's aren't counted, then of course you would not have to change the postcount ;)

but i'm sure a lot can use this, until i can come up with the next version (which hopefully has all of that implemented and the special additions i want to have ;))

Thanks for bringing that to me attention, fixed it by adding:
&& $foruminfo['countposts']
To the If statement.

The only problem now is updating the user's usertitle if they gain/lose enough posts for a different one.

Xenon 07-10-2004 09:33 AM

:)

now you see why i didn't add that things to the first version of my hack ;)

Casparian 08-31-2004 02:53 PM

If you edit the date, does it bump the post up the list/to the top? Or is it just whats displayed when the post is viewed?

Xenon 08-31-2004 04:42 PM

it does bump the post up/down the list (in linear mode)
in threaded mode it just changes the displayed time

Ocean 09-07-2004 11:12 AM

Hi, Xenon! I was wondering if you had any ideas as to when you'll be releasing the next version of this hack? :)

Xenon 09-07-2004 04:36 PM

unfortunatelly not.
I'm currently totally overworked with other things, but i will at some day.

I expect when i'm back at university *gg*


All times are GMT. The time now is 11:14 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.01368 seconds
  • Memory Usage 1,786KB
  • 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
  • (2)bbcode_html_printable
  • (10)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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