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

Reply
 
Thread Tools Display Modes
  #1  
Old 03-23-2009, 09:05 PM
TNCclubman's Avatar
TNCclubman TNCclubman is offline
 
Join Date: Sep 2008
Posts: 690
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to get the javascript edit for profile field on another page?

I want to set up a vB powered page and have the ability for the user to edit a field in their ABOUT ME section, from this new page. Ive got the following code all done (see below) and attached screenshot. The edit pencil links to the edit your details page which is a temp work around. What I want is to do the javascript instant inline editing like it does in their profile about me section. Can you have a look at my coding and let me know where (and what) to place in so that when I click on the pencil, you can instantly edit the profile field?

Thanks!!

Code:
<!-- ########## WHATS ON YOUR MIND ######### -->

    <tr><td class="alt1" nowrap align="left">

<fieldset> 
<a href="/profile.php?do=editprofile"><img src="/image.php?u=$bbuserinfo[userid]" alt="Some avatar" border="0" /></a>
<b>What's On Your Mind?:</b><br>
$bbuserinfo[field15]<a class="smallfont" href="profile.php?$session[sessionurl]do=editprofile"> <img class="inlineimg" border="0" src="/board/images/misc/userfield_edit.gif"/></a> </fieldset></td>
  </tr>

<!-- ########## /WHATS ON YOUR MIND ######### -->
Attached Images
File Type: jpg whatsonyourmind.jpg (14.3 KB, 0 views)
Reply With Quote
  #2  
Old 03-23-2009, 09:11 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you read my post here about this?
Reply With Quote
  #3  
Old 03-24-2009, 03:18 AM
TNCclubman's Avatar
TNCclubman TNCclubman is offline
 
Join Date: Sep 2008
Posts: 690
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yep, read it, tried the code you placed but nothing showed up.

Im not as advanced with this as I look, looking for someone with experience to help me get past the final loop and post the solution (code) to get it to work.

Anyone know the code to use?
Reply With Quote
  #4  
Old 03-24-2009, 04:01 AM
TigerC10's Avatar
TigerC10 TigerC10 is offline
 
Join Date: Apr 2006
Location: Austin, TX
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

She's saying you should be doing this:

Code:
<!-- ########## WHATS ON YOUR MIND ######### -->

    <tr><td class="alt1" nowrap align="left">

<fieldset> 
    <a href="/profile.php?do=editprofile"><img src="/image.php?u=$bbuserinfo[userid]" alt="Some avatar" border="0" /></a>
    <dt class="shade" id="profilefield_title_15">What's On Your Mind?:</dt>
    <dd id="profilefield_value_15">
        $bbuserinfo[field15]
        <script type="text/javascript">
        <!--
        vBulletin.register_control("vB_ProfilefieldEditor", "15");
        //-->
        </script>
    </dd>
</fieldset>

    </td></tr>

<!-- ########## /WHATS ON YOUR MIND ######### -->
Is that the code you tried?
Reply With Quote
  #5  
Old 03-24-2009, 04:12 AM
TNCclubman's Avatar
TNCclubman TNCclubman is offline
 
Join Date: Sep 2008
Posts: 690
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

actually that disabled the pencil I had there...and the javascript one isnt there either...

--------------- Added [DATE]1237872370[/DATE] at [TIME]1237872370[/TIME] ---------------

also this in your code
vBulletin.register_control("vB_ProfilefieldEditor" , "1");

I changed to
vBulletin.register_control("vB_ProfilefieldEditor" , "12");

and still no edit pencil...
Reply With Quote
  #6  
Old 03-24-2009, 04:35 AM
TigerC10's Avatar
TigerC10 TigerC10 is offline
 
Join Date: Apr 2006
Location: Austin, TX
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You should be sure to add in the .js includes... I thought you had done that already.

Code:
<script type="text/javascript" src="clientscript/vbulletin_profilefield_edit.js?v=$vboptions[simpleversion]"></script>

<!-- ########## WHATS ON YOUR MIND ######### -->

    <tr><td class="alt1" nowrap align="left">

<fieldset> 
    <a href="/profile.php?do=editprofile"><img src="/image.php?u=$bbuserinfo[userid]" alt="Some avatar" border="0" /></a>
    <dt class="shade" id="profilefield_title_15">What's On Your Mind?:</dt>
    <dd id="profilefield_value_15">
        $bbuserinfo[field15]
        <script type="text/javascript">
        <!--
        vBulletin.register_control("vB_ProfilefieldEditor", "15");
        //-->
        </script>
    </dd>
</fieldset>

    </td></tr>

<!-- ########## /WHATS ON YOUR MIND ######### -->
Reply With Quote
  #7  
Old 03-24-2009, 04:40 AM
TNCclubman's Avatar
TNCclubman TNCclubman is offline
 
Join Date: Sep 2008
Posts: 690
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wow, that worked you rock !!!!
Reply With Quote
  #8  
Old 03-24-2009, 04:43 AM
TigerC10's Avatar
TigerC10 TigerC10 is offline
 
Join Date: Apr 2006
Location: Austin, TX
Posts: 616
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Use the variable $vboptions[simpleversion] instead of 381. You can put it anywhere above where you call it, the head is fine.
Reply With Quote
  #9  
Old 03-24-2009, 04:52 AM
TNCclubman's Avatar
TNCclubman TNCclubman is offline
 
Join Date: Sep 2008
Posts: 690
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Tiger and Lynne!

Solution reached!
Reply With Quote
  #10  
Old 03-24-2009, 12:54 PM
TNCclubman's Avatar
TNCclubman TNCclubman is offline
 
Join Date: Sep 2008
Posts: 690
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Actually, 1 more question...

The layout is taking up to much space by putting the text UNDER the avatar...

How can I put the text to the right of the avatar?

I've tried putting the avatar in the left cell of a table, and the text on the right, but the table structure breaks up the tables bad on the page Im using...

Is there another way to do it without tables?
(Ive attached a screenshot of the way it looks now, and how I want the layout to look...
Attached Images
File Type: jpg whatonyourmindlayout.jpg (29.9 KB, 0 views)
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 08:39 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.04355 seconds
  • Memory Usage 2,279KB
  • Queries Executed 12 (?)
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
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)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_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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete