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)
-   -   Private Text Message Hack v1.0 (https://vborg.vbsupport.ru/showthread.php?t=42444)

g-force2k2 08-20-2002 12:37 AM

ExAvIoUr did you make enable the usergroup to be able to post private text messages?

Schorsch :: thanks for telling me about that... i made it so that you can't edit your private text messages... because if a user trys something then they can't go back and edit it... the only users that can are the ones that can veiw all private text messages... but i will work on a quick fix for the problem about just simply editing :) thanks for bringing that to my attention...

g-force2k2

Boofo 08-20-2002 12:43 AM

Just curious, but xhouldn't there be a comma at the beginning of these lines?

Code:

// +++++++ Private Text Hack [ g-force2k2 ] +++++++
$templatesused.= "postbit_privtxt";
// +++++++ Private Text Hack [ g-force2k2 ] +++++++

like this?

Code:

// +++++++ Private Text Hack [ g-force2k2 ] +++++++
$templatesused.= ",postbit_privtxt";
// +++++++ Private Text Hack [ g-force2k2 ] +++++++


ExAvIoUr 08-20-2002 12:44 AM

I've fixed the problem and it worked like gem!

To all members who want to install this hack: make sure your new templates are NAMED correctly, with "Txt" not "text"...

g-force2k2 08-20-2002 12:53 AM

for the post editing part that Exaviour brought up try this code...

open editpost.php

find:

PHP Code:

// +++++++ Private Text Hack [ g-force2k2 ] +++++++
  
$DB_site->query("UPDATE post SET title='".addslashes(htmlspecialchars($title))."',pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid'$editedbysql$attachmentsql,dopriv=$dopriv,privuser='".addslashes($privuser)."',privmsg='".addslashes($privmsg)."' WHERE postid='$postid'");
// +++++++ Private Text Hack [ g-force2k2 ] +++++++ 

replace it with:

PHP Code:

// +++++++ Private Text Hack [ g-force2k2 ] +++++++
if($getperms[canviewprivtxt]) {
  
$DB_site->query("UPDATE post SET title='".addslashes(htmlspecialchars($title))."',pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid'$editedbysql$attachmentsql,dopriv=$dopriv,privuser='".addslashes($privuser)."',privmsg='".addslashes($privmsg)."' WHERE postid='$postid'");
} else {
  
$DB_site->query("UPDATE post SET title='".addslashes(htmlspecialchars($title))."',pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid'$editedbysql$attachmentsql WHERE postid='$postid'");
}
// +++++++ Private Text Hack [ g-force2k2 ] +++++++ 

can anyone confirm this one for me? thanks i advance :)

g-force2k2

g-force2k2 08-20-2002 12:55 AM

btw Boofo you're correct x_X...

im just a beginner at hacking and it shows :)

thanks for the info Boofo i will update the install shortly but just want to insure any other errors or such :)

g-force2k2

Boofo 08-20-2002 01:04 AM

The editing part you posted above doesn't work. Even as an Admin I can't edit it.

Boofo 08-20-2002 01:09 AM

Also, is there any way to have it so when you have the cursor in the private message box and you click on a smilie, it will add it to the private message instead of the regular message box? I have the code installed that I gave you in the pm already. :)

g-force2k2 08-20-2002 01:13 AM

Boofo does the box just now show up or does it just not edit?

And you can show the code here but i will add it to a new update when i finish sorting things out here ;)

g-force2k2

Boofo 08-20-2002 01:16 AM

The box shows up fine but you can't edit it with or without the new code you posted. It won't even do it with the old code in it. :)

Also, do you need to add "newreply_privtxt" to the templatedused in the newreply template? :)

Quote:

Originally posted by g-force2k2
Boofo does the box just now show up or does it just not edit?

And you can show the code here but i will add it to a new update when i finish sorting things out here ;)

g-force2k2


g-force2k2 08-20-2002 01:41 AM

Boofo the newrepy_privtxt shows n my templatesused ;)

btw send me your editpost.php

i just test and i can edit successfully and Exaviour the code that i stated above works like a charm :)

g-force2k2

Boofo 08-20-2002 01:58 AM

I'm pm'ing it now. What file do you have the newrepy_privtxt in the templatesused section?

Quote:

Originally posted by g-force2k2
Boofo the newrepy_privtxt shows n my templatesused ;)

btw send me your editpost.php

i just test and i can edit successfully and Exaviour the code that i stated above works like a charm :)

g-force2k2


g-force2k2 08-20-2002 02:02 AM

im pretty sure that it was in the newer install O_o but i could be wrong =p

g-force2k2

ExAvIoUr 08-20-2002 02:18 AM

Thanks!!!!

The edit function now works :)

g-force2k2 08-20-2002 02:20 AM

yeah sorry about that Exaviour didn't think of that when i made the hack x_X i will update a new zip in alittle once i get thing squared away sorry for all this trouble >_O

g-force2k2

Schorsch 08-20-2002 02:20 AM

I'm confused, is the edit priv. text message problem solved ?

because a normal registered user or mod still can't edit priv text messages at my forums and when they edit the post the priv. text message is gone. :paranoid:

g-force2k2 08-20-2002 02:22 AM

Schorsch view this post it has the edit... i did not update the file yet sorry...

https://vborg.vbsupport.ru/showthrea...518#post287518

g-force2k2

Schorsch 08-20-2002 02:29 AM

yeah I already did that g-force2k, but nevertheless, they can't edit the priv text messages :( they don't see the box

g-force2k2 08-20-2002 02:33 AM

thats because they don't have permissions too... once you post it you can't change it... but thats just they way i think... only way to edit is if you have permission to view all private text messages... it you'd like i can easily show you how to change that?

g-force2k2

Schorsch 08-20-2002 02:41 AM

can you show me how registered users and mods can edit their priv. text message without having the rights to view all (even from other users) priv. messages ? because viewing all messages is a thing that only admins should be able to do ;)

thanks!!

Schorsch

g-force2k2 08-20-2002 02:45 AM

yeah sure Schorsch just give me a minute thanks...

g-force2k2

elyrain 08-20-2002 03:04 AM

Parse error: parse error, unexpected $ in /home/ibliftin/public_html/forums/newreply.php on line 582

i'm comming up with that error, I do have the tetris hack installed. Anyone know what to do? TIA

g-force2k2 08-20-2002 03:25 AM

elyrain can you show me whats on that line?

thanks in advance...

g-force2k2

Boofo 08-20-2002 03:51 AM

g-force2k2, I still can't get it to take edited text. Also, if I edit a private text message from someone else to me, if gives me the error where I can submit a private text message to myself. :) I thought the Admin could edit any of them.

g-force2k2 08-20-2002 03:58 AM

yeah Boofo but you can't send private text messages to yourself :p thats what Neo was talking about User Validation... btw... i don't know what else could be wrong... you don't edit the user part... thats who the private text message is to... Actually i see what you mean... i will edit that part asap... regards but lets try getting the edit feature to work for you :)

g-force2k2

g-force2k2 08-20-2002 04:01 AM

Boofo for the part about editing a user try this modification... (my bad wasn't thinking again x_X)

open editpost.php

find:

PHP Code:

    // checking user
    
$user $DB_site->query_first("SELECT username FROM user WHERE username='".addslashes(htmlspecialchars($privuser))."'");
      if(empty(
$user[0])) {
        eval(
"standarderror(\"".gettemplate("privtext_error_usernoexist")."\");");
        exit;
      } elseif(
$bbuserinfo[username] == "$user[0]") {
      eval(
"standarderror(\"".gettemplate("privtext_error_userself")."\");");
      exit;
    }
  } 

replace with:

PHP Code:

    // checking user
    
$user $DB_site->query_first("SELECT username FROM user WHERE username='".addslashes(htmlspecialchars($privuser))."'");
      if(empty(
$user[0])) {
        eval(
"standarderror(\"".gettemplate("privtext_error_usernoexist")."\");");
        exit;
      } elseif(
$postinfo[username] == "$user[0]") {
      eval(
"standarderror(\"".gettemplate("privtext_error_userself")."\");");
      exit;
    }
  } 

try and see if that works Boofo :)

g-force2k2

Boofo 08-20-2002 04:02 AM

The only difference between the editpost.php I sent you and the one I am using now is the code from your post about editing that I have in mine, where it isn't in the one I sent you.

Quote:

Originally posted by g-force2k2
yeah Boofo but you can't send private text messages to yourself :p thats what Neo was talking about User Validation... btw... i don't know what else could be wrong... you don't edit the user part... thats who the private text message is to... Actually i see what you mean... i will edit that part asap... regards but lets try getting the edit feature to work for you :)

g-force2k2


g-force2k2 08-20-2002 04:03 AM

Boofo see my recent fix about the problem you brought to my attention :) thanks for showing me that x_X

g-force2k2

Boofo 08-20-2002 04:11 AM

Ok, that fixed the part about me being able to edit a private text message to me when I try editing it. It still won't take the edit though.

g-force2k2 08-20-2002 04:16 AM

could you please post the editpost_privtxt template? thanks in advance Boofo :)

g-force2k2

Jashugan 08-20-2002 04:20 AM

Quote:

Originally posted by Boofo
Ok, that fixed the part about me being able to edit a private text message to me when I try editing it. It still won't take the edit though.
What is the problem excatly? I have no problem with that.. can you give me step by step to detect that problem?

Sho 08-20-2002 04:26 AM

g-force2k2, Boofo considers it a problem that you can't edit a post to add a private text. I know you intended it to work this way - anyway, I'm with Boofo on this one. Give us! :)

Schorsch, on the other hand, considers it a problem that you can't edit a private text after posting. Again, you intended it to work this way. That's okay with me.

Boofo 08-20-2002 04:27 AM

g-force2k2, here you go. It is the excat same template in your install file. :)

Code:

<!-- private text hack [ g-force2k2 ] -->
<tr><td bgcolor="{secondaltcolor}" valign="top"><normalfont><b>Private Text Options:</b></normalfont><br><smallfont>Maximium Characters: $PTMlength</smallfont></td>
<td bgcolor="{secondaltcolor}"><smallfont><input type="checkbox" name="dopriv" value="no" $dopriv><b>Add a private text message to the post?</b><br><input type="text" class="bginput" name="privuser" size="20" maxlength="50" value="$postinfo[privuser]"> <b>Username to send private text to?</b><br><textarea name="privmsg" rows="10" cols="$textareacols" onChange=getActiveText(this) onclick=getActiveText(this)>$postinfo[privmsg]</textarea></td></tr>
<!-- private text hack [ g-force2k2 ] -->

Jashugan, when I go into edit mode and change anything in the private text message, when I go to save it, it is the exact same as it was before I edited it. It doesn't take any changes I made to the original private text message..

g-force2k2 08-20-2002 04:28 AM

// +++++++ Addon for allowing post owner to edit their own private text message +++++++
open editpost.php (2)

find: (1)

PHP Code:

// +++++++ Private Text Hack [ g-force2k2 ] +++++++
if($getperms[canviewprivtxt]) {
  eval(
"\$privtxtedit = \"".gettemplate("editpost_privtxt")."\";");
} else {
  
$privtxtedit "";
}
// +++++++ Private Text Hack [ g-force2k2 ] +++++++ 

replace it with:

PHP Code:

// +++++++ Private Text Hack [ g-force2k2 ] +++++++
if(($getperms[canviewprivtxt]) OR ($postinfo[username] == "$bbuserinfo[username]")) {
  eval(
"\$privtxtedit = \"".gettemplate("editpost_privtxt")."\";");
} else {
  
$privtxtedit "";
}
// +++++++ Private Text Hack [ g-force2k2 ] +++++++ 

find: (2)

PHP Code:

// +++++++ Private Text Hack [ g-force2k2 ] +++++++
if($getperms[canviewprivtxt]) {
  
$DB_site->query("UPDATE post SET title='".addslashes(htmlspecialchars($title))."',pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid'$editedbysql$attachmentsql,dopriv=$dopriv,privuser='".addslashes($privuser)."',privmsg='".addslashes($privmsg)."' WHERE postid='$postid'");
} else {
  
$DB_site->query("UPDATE post SET title='".addslashes(htmlspecialchars($title))."',pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid'$editedbysql$attachmentsql WHERE postid='$postid'");
}
// +++++++ Private Text Hack [ g-force2k2 ] +++++++ 

replace with:

PHP Code:

// +++++++ Private Text Hack [ g-force2k2 ] +++++++
if(($getperms[canviewprivtxt]) OR ($postinfo[username] == "$bbuserinfo[username]")) {
  
$DB_site->query("UPDATE post SET title='".addslashes(htmlspecialchars($title))."',pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid'$editedbysql$attachmentsql,dopriv=$dopriv,privuser='".addslashes($privuser)."',privmsg='".addslashes($privmsg)."' WHERE postid='$postid'");
} else {
  
$DB_site->query("UPDATE post SET title='".addslashes(htmlspecialchars($title))."',pagetext='".addslashes($message)."',allowsmilie='$allowsmilie',showsignature='$signature',iconid='$iconid'$editedbysql$attachmentsql WHERE postid='$postid'");
}
// +++++++ Private Text Hack [ g-force2k2 ] +++++++ 

There that should allow users to edit their own private txt messages...

g-force2k2

Boofo 08-20-2002 04:29 AM

Sho, you must have misubderstood me. I can edit a post to add private text, I just can't edit the private text after it is posted. :)

Quote:

Originally posted by Sho
g-force2k2, Boofo considers it a problem that you can't edit a post to add a private text. I know you intended it to work this way - anyway, I'm with Boofo on this one. Give us! :)

Schorsch, on the other hand, considers it a problem that you can't edit a private text after posting. Again, you intended it to work this way. That's okay with me.


g-force2k2 08-20-2002 04:29 AM

Boofo try taking out the codes that you added in... the onchange and all then try and see if that works? thanks in advance...

g-force2k2

Jashugan 08-20-2002 04:32 AM

Quote:

Originally posted by Boofo
Jashugan, when I go into edit mode and change anything in the private text message, when I go to save it, it is the exact same as it was before I edited it. It doesn't take any changes I made to the original private text message..
Umm when you edit, are you using Admin access? Cuz I edit and save it without any problem with Admin access (g-force didnt add more group permission yet but soon) I change the private message or add few message and it come out normal.

Sho 08-20-2002 04:37 AM

Quote:

There that should allow users to edit their own private txt messages...
Works!

Quote:

Sho, you must have misubderstood me. I can edit a post to add private text, I just can't edit the private text after it is posted.
Didn't work until now, now it works! :)

Sorry about the missunderstanding, Boofo.

Boofo 08-20-2002 04:43 AM

I t0ook the code out and it still doesn't allow me to edit a private text message. I can edit it, it just won't allow me to change it from the original on save.

Quote:

Originally posted by g-force2k2
Boofo try taking out the codes that you added in... the onchange and all then try and see if that works? thanks in advance...

g-force2k2


Sho 08-20-2002 04:46 AM

Quote:

Originally posted by Boofo
I t0ook the code out and it still doesn't allow me to edit a private text message. I can edit it, it just won't allow me to change it from the original on save.
Hm, it works here.

- With my own private texts.

- With other's private texts - after "Can view all private text messages" for my usergroup, of course.

Boofo 08-20-2002 04:46 AM

g-force2k2, look at the code right above it in my editpost.php and see if maybe that is what is causing the problem. The Admin edit options.


All times are GMT. The time now is 01:16 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.01520 seconds
  • Memory Usage 1,883KB
  • 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
  • (8)bbcode_php_printable
  • (10)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