Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-16-2009, 01:56 PM
Dirtchamber Dirtchamber is offline
 
Join Date: Dec 2007
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Making a text editor appear with text inside

Is there any way to "spawn" a text editor (i.e. the thing I'm using to type this message) with text already inside? So, for example, if I were asking people to upload images, I'd like to make it so the text editor spawns with some predefined profile text inside - stuff like "Name, Age etc.".

Is that possible?

Thanks much,
Dan
Reply With Quote
  #2  
Old 01-16-2009, 02:30 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do a search for the Thread Stencil mod. I think that will do what you want.
Reply With Quote
  #3  
Old 01-18-2009, 03:02 AM
Dirtchamber Dirtchamber is offline
 
Join Date: Dec 2007
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey Lynne,

That's actually a really useful mod, and although I'll use it for other stuff, it doesn't do what I need in this instance. See, the thing is, I'm using the Ultimate Media Gallery, and it's in there that I'd like to spawn a text editor with text.

So: is there a manual way to do it? Like, perhaps I need to edit a PHP file or a template or something?

Any help appreciated,
Dan
Reply With Quote
  #4  
Old 01-18-2009, 03:32 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm not familiar with that mod, but it sounds like you are just talking about a form (like this box is). If so, google "form html" and you should be see how to pre-populate form elements. (I think that is what you are trying to do?)
Reply With Quote
  #5  
Old 01-18-2009, 03:42 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The two most popular (text) elements, pre-populated:
HTML Code:
<input type="text" name="something" length="15" value="Some Text" />
<textarea name="sometextarea" cols="60" rows="10">
Some Text Here
</textarea>
Reply With Quote
  #6  
Old 01-18-2009, 03:54 AM
Dirtchamber Dirtchamber is offline
 
Join Date: Dec 2007
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
I'm not familiar with that mod, but it sounds like you are just talking about a form (like this box is). If so, google "form html" and you should be see how to pre-populate form elements. (I think that is what you are trying to do?)
Ach! I'm terrible at explaining myself when it comes to this stuff. Perhaps I should just show you what I mean?

Basically, I want the 'Description' box here to be pre-populated with text - namely, some basic stuff like "Name, Age etc.". So, I don't want to create a form per se, but populate an existing one (I guess?).

What I'm wondering is how I'd do that. And an idea of where I'd do it - i.e. in PHP, or in templates etc.

I apologise if I'm coming across a bit dense. I'm sort of just picking this stuff up as I go, and appreciate all your help.

Dan
Reply With Quote
  #7  
Old 01-18-2009, 03:31 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Exactly what I was thinking. That Description box is a form element - a <textarea> as Hanson wrote above. So, you want to pre-populate the <textarea>. Hanson wrote the html to do that.
Reply With Quote
  #8  
Old 01-18-2009, 03:34 PM
ragtek ragtek is offline
 
Join Date: Mar 2006
Location: austria, croatia
Posts: 1,630
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If it is a vb add-on which is using the construct_edit_toolbar function(and i think it is one), you'll have to search for the call of construct_edit_toolbar in the file and add the text you want to have into, as first parameter!

PHP Code:
// #############################################################################
/**
* Prepares the templates for a message editor
*
* @param    string    The text to be initially loaded into the editor
* @param    boolean    Is the initial text HTML (rather than plain text or bbcode)?
* @param    mixed    Forum ID of the forum into which we are posting. Special rules apply for values of 'privatemessage', 'usernote', 'calendar', 'announcement' and 'nonforum'
* @param    boolean    Allow smilies?
* @param    boolean    Parse smilies in the text of the message?
* @param    boolean    Allow attachments?
* @param    string    Editor type - either 'fe' for full editor or 'qr' for quick reply
* @param    string    Force the editor to use the specified value as its editorid, rather than making one up
*
* @return    string    Editor ID
*/
function construct_edit_toolbar($text ''$ishtml false$forumid 0$allowsmilie true$parsesmilie true$can_attach false$editor_type 'fe'$force_editorid ''
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:58 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.08810 seconds
  • Memory Usage 2,239KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_html
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete