vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   More Functions in Edit Post if you are an Admin (https://vborg.vbsupport.ru/showthread.php?t=33761)

Xenon 04-23-2003 04:45 PM

nope, currently not, and i don't have much time these days for releasing new versions.

it's on my plan of the vb3 version, but for now you have to update threadcounters if you want to change the dateline of a thread

Sharg 04-23-2003 04:51 PM

Thanks for your answer.
Well, In fact I tried to update all counters (except search index reindex) and still vbhome did show the non modified date.

Cordially,
Sharg

Boofo 04-24-2003 08:36 PM

Quote:

Yesterday at 11:45 AM Xenon said this in Post #121
nope, currently not, and i don't have much time these days for releasing new versions.

it's on my plan of the vb3 version, but for now you have to update threadcounters if you want to change the dateline of a thread

This seems to work fine:

Add:

PHP Code:

  updatethreadcount($threadinfo[threadid]);
  
updateforumcount($threadinfo[forumid]); 

Right above:

PHP Code:

  eval("standardredirect(\"".gettemplate("redirect_editthanks")."\",\"showthread.php?s=$session[sessionhash]&postid=$postid#post$postid\");"); 

My question is, will this add any extra queries or server load?

Boofo 04-24-2003 09:34 PM

Quote:

Yesterday at 11:51 AM Sharg said this in Post #122
Thanks for your answer.
Well, In fact I tried to update all counters (except search index reindex) and still vbhome did show the non modified date.

Cordially,
Sharg

What version of vbHome Lite are you using? I use 3.8 and had the same problem but just fixed it. ;)

Xenon 04-25-2003 11:30 AM

Boofo: yes, because the forum and the thread tables have to be updated, it will add queries :)

so make sure they're just called if you've done an admin edit ;)

Boofo 04-25-2003 11:34 AM

Quote:

Today at 07:30 AM Xenon said this in Post #125
Boofo: yes, because the forum and the thread tables have to be updated, it will add queries :)

so make sure they're just called if you've done an admin edit ;)

It will only add 2 queries, right?

And where do I need to put them to only do it after an Admin edit? Right now I have them below:

PHP Code:

 //Admin Edit Hack
  
if ($bbuserinfo[usergroupid] == 6) {
    
$datetime=mktime($datetime[hours],$datetime[minutes],0,$datetime[mon],$datetime[mday],$datetime[year])-3600*($bbuserinfo['timezoneoffset']-$timeoffset);
    
$adminsql .= "ipaddress='".addslashes($ipadd)."',dateline='$datetime',editable='$editable',userid='$userid',threadid='$pthreadid',";
  }
  
$DB_site->query("UPDATE post SET " $adminsql "title='".addslashes(htmlspecialchars($title))."',pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',showimage='$showimage',iconid='$iconid'$editedbysql$attachmentsql WHERE postid='$postid'"); 


Xenon 04-25-2003 11:51 AM

it will add 4 queries per function so in sum 8 queries in total

the position is right, but you should put it into an if block so it will just be executed if you're an admin :)

Boofo 04-25-2003 11:58 AM

Quote:

Today at 07:51 AM Xenon said this in Post #127
it will add 4 queries per function so in sum 8 queries in total

the position is right, but you should put it into an if block so it will just be executed if you're an admin :)

Like this?

PHP Code:

  if ($bbuserinfo[usergroupid] == 6) {
  
updatethreadcount($threadinfo[threadid]);
  
updateforumcount($threadinfo[forumid]);
  } 

I didn't know that each of those functions added 4 queries. How come so many?

Also, is there a way to make a checkbox that when ticked will update the post with the current date and time that you are editing the post (like a newreply or newthread) and if not ticked, will just update it as normal (like if you manually change the date or time)?

nhlrat 04-26-2003 03:10 PM

Quote:

04-19-03 at 01:35 PM Xenon said this in Post #113
nope normally impossible with my hack, that's another problem.
Any experts care to help a newbie and shed some light on this file of mine? I'm guessing it's something pretty simple, but don't have enough knowledge yet. Thanks guys!

Xenon 04-26-2003 03:31 PM

@nhl: as it's not a problem with my hack you should start an sepearat thread if you have such problems!

@boofo: correctly that was what i meant ;)
look into functions.php to see why so many queries are needed ;)
also yes it would be possible to add a checkbox for that, but i don't have any time to work on this these days...

nhlrat 04-26-2003 03:35 PM

Quote:

Today at 05:31 PM Xenon said this in Post #130
@nhl: as it's not a problem with my hack you should start an sepearat thread if you have such problems!
Ok thanks just didn't know where to go for the help.

padblaz 06-30-2003 07:40 PM

i've just d/l it
i'm gonna install later in the evening
thanks for this hack ;)

Aaron1 08-22-2003 11:10 AM

first of all great hack!

But just a Q to make this all available to Mods & Supermods:
is this piece of code properly modified to give them access aswell?

PHP Code:

//Admin Edit Hack by Xenon
  
$adminsql "";
  if ((!isset(
$userid) or $userid=="" or $userid==0) and in_array($bbuserinfo['usergroupid'], array(5,6,7))  and $postinfo[userid]!=0) {
    
$userid=0;
    
$adminsql .= "username='Guest',";
  }
  
$userid=intval($userid);
  
  if (!isset(
$pthreadid) or $pthreadid=="" or $pthreadid==0) {
    
$pthreadid=0;
    
$action="deletepost";
  }
  
$pthreadid=intval($pthreadid);
  
  if (!isset(
$ipadd) or trim($ipadd)=="") {
    
$ipadd="";
  } 

I asked because this own't work :(

Xenon 08-22-2003 11:24 AM

yes it seems to be right.
but it's not the only part to change you know, do you?

Aaron1 08-22-2003 11:33 AM

Aha, that should be the reason i presume. Thanks for pointing that out Xenon!
But where should i apply the same modifications aswell?

Sorry for this extra addition request towards your already (IMO almost perfect) hack

Xenon 08-22-2003 12:00 PM

the most important part to change the bbuserinfo into the in_array version is here:
PHP Code:

  // Admin Edit Hack by Xenon
  
if ($bbuserinfo[usergroupid] == 6) {
    eval(
"\$admineditpost = \"".gettemplate("admineditpost")."\";");
  } else {
    
$admineditpost "";
  } 

and of course here:
PHP Code:

  if ($bbuserinfo[usergroupid] == 6) {
    
$datetime=mktime($datetime[hours],$datetime[minutes],0,$datetime[mon],$datetime[mday],$datetime[year])-3600*($bbuserinfo['timezoneoffset']-$timeoffset);
    
$adminsql .= "ipaddress='".addslashes($ipadd)."',dateline='$datetime',editable='$editable',userid='$userid',threadid='$pthreadid',";
  } 

and no problem, for my vb3 version of this hack, it was already planned to add moderator functions to editpost, too :)

Aaron1 08-22-2003 12:20 PM

Thanks Xenon! Hmm it doesn't seem to work somehow, no extra 'edit post' options for moderators nor Super Moderators.
No errors either, works for admin's though...

Here are the actual code i used:

PHP Code:

    //Admin Edit Hack by Xenon
  
$adminsql "";
  if ((!isset(
$userid) or $userid=="" or $userid==0) and in_array($bbuserinfo['usergroupid'], array(5,6,7))  and $postinfo[userid]!=0) {
    
$userid=0;
    
$adminsql .= "username='Guest',";
  }
  
$userid=intval($userid);
  
  if (!isset(
$pthreadid) or $pthreadid=="" or $pthreadid==0) {
    
$pthreadid=0;
    
$action="deletepost";
  }
  
$pthreadid=intval($pthreadid);
  
  if (!isset(
$ipadd) or trim($ipadd)=="") {
    
$ipadd="";
  } 


And ofcourse this one:

PHP Code:

  //Admin Edit Hack  
  
if (in_array($bbuserinfo['usergroupid'], array(5,6,7))) {
    
$datetime=mktime($datetime[hours],$datetime[minutes],0,$datetime[mon],$datetime[mday],$datetime[year])-3600*($bbuserinfo['timezoneoffset']-$timeoffset);
    
$adminsql .= "ipaddress='".addslashes($ipadd)."',dateline='$datetime',editable='$editable',userid='$userid',threadid='$pthreadid',";
  } 


Xenon 08-22-2003 12:22 PM

you have forgotten the first one where the extra template is loaded :)

Aaron1 08-22-2003 12:28 PM

Yes you are right! Thanks!
I am not worthy!* ;-)

*Takes of his hat and bows his head for Xenon

Thoki 08-31-2003 07:38 AM

Thanks for this great Idea to code this!
Installed.

@Aaron1:
Can you please post the complete moification you did?

Thanks at all
Thoki.

TeH Z0mB1E 10-13-2003 08:11 PM

help me please, when i set it so that only mods/super mods/admins can edit posts and save it, it reverts back to author/mods/super mods/admins. i dont think ive got this line of code either :

PHP Code:

for($i=0;$i<5;$i++) $editable[$i]=iif($postinfo[editable]==$i,"CHECKED",""); 

at least i dont think ive got it, ive looked in editpost.php and the adminedit template.
where is it supposed to be?

Xenon 10-13-2003 09:33 PM

if this line isn't in your editpost.php you haven't followed the install file correctly.

do so and the hack will work.

TeH Z0mB1E 10-13-2003 10:59 PM

that lines not in the install file, at least not in mine.... where abouts in editpost.php is this line supposed to be?

if i PM you my editpost.pm file can you have a look at it please?

Xenon 10-14-2003 05:31 PM

it's very visible in the install file:
Quote:

Step 2: File changes
---------------------
open file editpost.php
the particular line you mentioned is line 85 in install file.


and no i don'T do private requests right now

TeH Z0mB1E 10-14-2003 05:56 PM

ok i do have that line, but im still getting the problem on my forums, can you suggest something please? ive tried re-installing the hack but the error still comes up, help.

Xenon 10-14-2003 06:09 PM

hmm, are you sure you have made everything correct now?

it sounds like it doesn't save the changes to the post

be sure
PHP Code:

$DB_site->query("UPDATE post SET " $adminsql "title='".addslashes(htmlspecialchars($title))."',pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid'$editedbysql$attachmentsql WHERE postid='$postid'"); 

is in your editpost.
and i mean the " . $adminsql . " part of it.

if that's not, then i don't know what else could it be.

TeH Z0mB1E 10-15-2003 12:09 AM

its there, could it be a template problem?

PHP Code:

<tr>
    <
td bgcolor="{secondaltcolor}" nowrap><normalfont><b>Thread ID:</b></normalfont></td>
    <
td bgcolor="{secondaltcolor}"><normalfont><input type="text" class="bginput" name="pthreadid" value="$postinfo[threadid]size="40" maxlength="85"></normalfont></td>
</
tr>
<
tr>
    <
td bgcolor="{firstaltcolor}" nowrap><normalfont><b>Author ID:</b></normalfont></td>
    <
td bgcolor="{firstaltcolor}"><normalfont><input type="text" class="bginput" name="userid" value="$postinfo[userid]size="20" maxlength="85">  $postinfo[username] </normalfont></td>
</
tr>
<
tr>
    <
td bgcolor="{firstaltcolor}" nowrap><normalfont><b>Editable by (and higher):</b></normalfont></td>
    <
td bgcolor="{firstaltcolor}"><normalfont><input type="radio" name="editable" $editable[4value="4">Author (no timelimit)| <input type="radio" name="editable" $editable[1value="1">Author | <input type="radio" name="editable" $editable[2value="2">Moderators |<input type="radio" name="editable" $editable[3value="3">Supermods | <input type="radio" name="editable" $editable[0value="0">Admins</normalfont></td>
</
tr>

<
tr>
    <
td bgcolor="{secondaltcolor}" nowrap><normalfont><b>Date/Time:</b></normalfont></td>
    <
td bgcolor="{secondaltcolor}"><normalfont>
                <
input type="text" class="bginput" name="datetime[mday]" value="$datetime[mday]size="1" maxlength="2">.<input type="text" class="bginput" name="datetime[mon]" value="$datetime[mon]size="1" maxlength="2">.<input type="text" class="bginput" name="datetime[year]" value="$datetime[year]size="3" maxlength="4"> - <input type="text" class="bginput" name="datetime[hours]" value="$datetime[hours]size="1" maxlength="2">:<input type="text" class="bginput" name="datetime[minutes]" value="$datetime[minutes]size="1" maxlength="2">

</
normalfont></td>
</
tr>
<
tr>
    <
td bgcolor="{firstaltcolor}" nowrap><normalfont><b>IP Address:</b></normalfont></td>
    <
td bgcolor="{firstaltcolor}"><normalfont><input type="text" class="bginput" name="ipadd" value="$postinfo[ipaddress]size="40" maxlength="85"></normalfont></td>
</
tr

there is my admineditpost template. one of my other admins just pointed this out to me, but my forums is vB 2.3.2 is this hack compatible?

Xenon 10-15-2003 03:45 PM

the template seems like it should, so it shouldn't be a template problem.

i hope you can fix it yourself, as i cannot reproduce it, and therefore also cannot fix it.


All times are GMT. The time now is 04:17 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.01583 seconds
  • Memory Usage 1,895KB
  • 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
  • (12)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (28)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