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)

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 12:30 PM.

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.01303 seconds
  • Memory Usage 1,772KB
  • 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
  • (4)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