vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Community Lounge (https://vborg.vbsupport.ru/forumdisplay.php?f=13)
-   -   Default PM Subject Line (https://vborg.vbsupport.ru/showthread.php?t=50131)

Boofo 03-14-2003 07:42 AM

Default PM Subject Line
 
I made a little 2 line hack (I guess you could almost call it that) that will input a default subject line in a new PM. I always get tired of having to redo all of my new PMs because I preview it or try to send it and get the error that I didn't fill out all of the information. This way, it will always be there, preview or not. What I would like to ask is this: Does anyone have any good ideas for a default line that will work for the entire board? [high]Any[/high] ideas will be appreciated and welcomed.

filburt1 03-14-2003 10:51 AM

Can't you just edit the PM templates? :confused:

Erwin 03-14-2003 11:00 AM

I did the same thing for my forums a long time ago.

What I used as a subject when none is entered is "No subject entered". :)

Boofo 03-14-2003 03:10 PM

Quote:

Today at 06:51 AM filburt1 said this in Post #2
Can't you just edit the PM templates? :confused:
@filburt1 - I thought of that, but if you do a preview private message, then it will always put the subject from the template in there (if I hardcode it that way). This way, I only have it default to a hardcoded title if there isn't one already. If you change it when writing the message, it will stay with the new title.

@ Erwin - LOL I never thought of that one. Thanks. Right now I have "Just a note to say hello" and thought about "From the desk of xxx (the username of the poster would go here).

On the forums, I have it default to "Re ; threadtitle" if there is no post title. If they change it, it will stay at the new title.

filburt1 03-14-2003 04:43 PM

Well you could use conditionals in templates (the hack)...:)

Boofo 03-14-2003 04:47 PM

That's true, I never even thought of that. I have Logician's hack already installed. Maybe I'll play with it and see what I can come up with. Thanks. ;)

Boofo 03-14-2003 05:06 PM

@filburt1 - Here's what I came up with. The code in the php is only 3 small lines and this is what I need to do in the template to get the same thing. Which is better?

Quote:

[[($subject=="")]]
<td bgcolor="#13486D"><normalfont><input type="text" class="bginput" name="title" value="Just a note to say hello" size="40" maxlength="85" tabindex="2"></normalfont></td>
[[/($subject=="")]]
[[($subject!="")]]
<td bgcolor="#13486D"><normalfont><input type="text" class="bginput" name="title" value="$subject" size="40" maxlength="85" tabindex="2"></normalfont></td>
[[/($subject!="")]]

amykhar 03-14-2003 05:15 PM

Actually, it can be done in the javascript in the send pm template. There is a check when the submit button is clicked. If the subject is blank, a box pops up. You can add a check right before that line so that if the title is blank, the title is set to "No Subject Entered"

I did it the PHP way as well in both private.php and private2.php, but I am pretty sure the javascript is all that is required.

Amy

Boofo 03-14-2003 05:22 PM

You lost me here. Where would you do the check for that at? Just before the submit button? And I don't think it would work there for a private message preview, though, would it?

amykhar 03-14-2003 05:33 PM

In priv_sendprivmsg

Find:

Code:

if (theform.touser.value=="" || theform.message.value==""|| theform.title.value=="" ) {
Code:


Add Above:
if(theform.title.value=="") {
  theform.title.value="No Subject Entered";
}

and I forgot about preview cause I never use it :D I'll go peek at that too.

Amy


All times are GMT. The time now is 09:27 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.01147 seconds
  • Memory Usage 1,738KB
  • 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_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (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