vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Profile Enhancements - User notes visibile immediately on user's profile (https://vborg.vbsupport.ru/showthread.php?t=278884)

Alan_SP 02-19-2012 11:00 PM

User notes visibile immediately on user's profile
 
1 Attachment(s)
With this you could have user notes visible immediately on user's profile and you could add them, edit them and everything else you do with user notes without need to go to separate window.

This was inspired by @rammieone question here: https://vborg.vbsupport.ru/showpost....&postcount=161

You need to edit at least one template (MEMBERINFO), but probably you would like to edit two more templates to make it more practical.

To add usernotes inside member profile edit MEMBERINFO template.

Two most logical places is above and below user's profile tabs.

To place it above user's profile tabs find:

HTML Code:

{vb:raw memberinfo_customize}
To place it below user's profile tabs find:

HTML Code:

{vb:raw template_hook.profile_tabs}
In both cases below add this:

HTML Code:

<vb:if condition="is_member_of($bbuserinfo,5,6,7)"><div><IFRAME SRC="usernote.php?{vb:raw session.sessionurl}u={vb:raw prepared.userid}" WIDTH="100%" HEIGHT="300"></IFRAME></div></vb:if>
With $bbuserinfo,5,6,7 you define which usergroups will see user notes inside user's profile.

You could define height to different value, depending what you prefer, it doesn't have to be 300px. Also you could add FRAMEBORDER=0 if you don't want border around your IFRAME.

Also, you can made this into collapsible block, so if you don't want to see it time from time, use this html code instead:

HTML Code:

<div class="block collapse" id="usernotes_in_userprofile">
        <h2 class="blockhead"><img src="{vb:stylevar imgdir_siteicons}/note.png" alt="{vb:rawphrase user_notes}" class="inlineimg" /> {vb:rawphrase user_notes} ({vb:raw prepared.usernotecount})

<a class="collapse" id="collapse_usernotesprofile" href="{vb:raw relpath}#top"><img src="{vb:stylevar imgdir_button}/collapse{vb:raw vbcollapse.collapseimg_cel_dummy_img}_40b.png" alt="{vb:rawphrase collapse_this_category}" /></a>

</h2>
        <div class="blockbody settings_form_border" id="usernotesprofile">

<vb:if condition="is_member_of($bbuserinfo,5,6,7)"><div><IFRAME SRC="usernote.php?{vb:raw session.sessionurl}u={vb:raw prepared.userid}" WIDTH="100%" HEIGHT="300"></IFRAME></div></vb:if>

        </div>
</div>

Code for making something into collapsible block you can find here.

In case that you decide to use this template change, it would be wise to change two additional templates, to remove unwanted header, navbar and footer.

Edit templates usernote and usernote_note

Remove from them:

HTML Code:

{vb:raw header}
{vb:raw navbar}


{vb:raw footer}

In template usernote you also need to find:

HTML Code:

<div id="pagetitle">
        <h1>{vb:rawphrase user_notes_for_x, {vb:raw userinfo.username}}</h1>
</div>

Add below two </BR> so you have:

HTML Code:

<div id="pagetitle">
        <h1>{vb:rawphrase user_notes_for_x, {vb:raw userinfo.username}}</h1>
</div>
</br>
</br>

This is that button for adding new user notes is separated from title of page.

I attached image how it looks if you place it above user's profile tabs.

v1.00 - Initial version.
v2.00 - Added option that usernotes block can be collapsible. Also changed text you need to find and add code below it, if you want it above user profile tabs.

ProFifaLeagues 02-20-2012 06:43 PM

Thanks Alan Superb Work mate

ProFifaLeagues 02-20-2012 06:52 PM

Worked Superb Just what was needed for us!

BlueCheri 02-21-2012 05:02 AM

Tagged.

Looks useful, waiting for some feedback from other members.

G!

ProFifaLeagues 02-21-2012 06:21 AM

Quote:

Originally Posted by BlueCheri (Post 2301812)
Tagged.

Looks useful, waiting for some feedback from other members.

G!

Confirmed working fine on 4.1.3 and 4.1.5
Looks just the same as the screenshots above and you can easy alter the sizes etc

Alan_SP 02-21-2012 11:29 AM

Quote:

Originally Posted by BlueCheri (Post 2301812)
Looks useful, waiting for some feedback from other members.

Usernotes are separate page and IFRAME is used to load pages inside page.

Only thing this modification does is creates iframe page of user's notes if user who looks at member's profile is in allowed usergroup. There's nothing that would prevent this modification to work. If it doesn't work, you have problems with usernotes themselves.

ProFifaLeagues 02-21-2012 02:08 PM

Alan would there be any way I can include a user profile Field to be shown on the notes system.Would be handy if every member who uses a certain Profile field on our Forums could also be shown on there user notes.

Cheers for any help

Alan_SP 02-22-2012 10:54 AM

I'm not sure how to do that.

ProFifaLeagues 02-22-2012 07:00 PM

No probs mate thanks so much for the help in bringing this mod alive

ProFifaLeagues 06-13-2012 09:09 PM

Just a Quick update that this works the same for 4.2 all edits 100%

Toorak Times 10-06-2012 04:22 PM

Hi guys,

Works as said on my 4.2.

Been following, downloaded and implemented the basic model. I see this as an important attribute to the Profile page, I really want to pump it up there.

I don't know why but I can't get bbcode to work, does it work in the frame?

Elixar 11-27-2015 08:01 PM

How can you make it appear in a collapsable menu?

Alan_SP 11-28-2015 10:17 PM

For making some part collapsible (if I understand your question), you need to use this code:

Code:

<div class="block collapse" id="unique id name">
        <h2 class="blockhead">Name of the block, can be phrase, can be hardcoded

<a class="collapse" id="collapse_unique name" href="{vb:raw relpath}#top"><img src="{vb:stylevar imgdir_button}/collapse{vb:raw vbcollapse.collapseimg_cel_dummy_img}_40b.png" alt="{vb:rawphrase collapse_this_category}" /></a>

</h2>
        <div class="blockbody settings_form_border" id="unique name">

-------------here goes code that you want inside collapsible block, whatever it is --------------

        </div>
</div>

In upper example I used CODE BBtag so I can use color BBcode, so you can see in red what are variables you can (and have to) change to suit your needs. The two unique names in green must be the same that collapsing work.

For this particular example you can use this code:

HTML Code:

<div class="block collapse" id="usernotes_in_userprofile">
        <h2 class="blockhead"><img src="{vb:stylevar imgdir_siteicons}/note.png" alt="{vb:rawphrase user_notes}" class="inlineimg" /> {vb:rawphrase user_notes} ({vb:raw prepared.usernotecount})

<a class="collapse" id="collapse_usernotesprofile" href="{vb:raw relpath}#top"><img src="{vb:stylevar imgdir_button}/collapse{vb:raw vbcollapse.collapseimg_cel_dummy_img}_40b.png" alt="{vb:rawphrase collapse_this_category}" /></a>

</h2>
        <div class="blockbody settings_form_border" id="usernotesprofile">

<vb:if condition="is_member_of($bbuserinfo,5,6,7)"><div><IFRAME SRC="usernote.php?{vb:raw session.sessionurl}u={vb:raw prepared.userid}" WIDTH="100%" HEIGHT="300"></IFRAME></div></vb:if>
        </div>
</div>

In above example you have for title of collapsible block first image (you can easily remove it), phrase for user_notes and total number of usernotes for that user.

Info about collapse status of the block is kept in cookies, so if you change browser, this info isn't remembered.

I'll also add this info in first post, and I also change location where you need to add this code to have user notes bellow navbar.

Elixar 11-29-2015 05:03 AM

When it closes, it seems to close really choppy and moves the page. How can you make it to close with Ajax like a clean effect?

Alan_SP 11-29-2015 07:44 PM

I also changed location where you should add code, it's in the first post.

Also, you should now that what you're experiencing is the way your browser handles HTML, or just problem with speed with your computer.

For example, in my browser collapsing on and off is instant. Try it with different browser, or on different computer.

From code perspective, there's nothing that can be done to speed it up (and it is fast). It collapses as speedy as any other collapsing object within vB.

Elixar 11-30-2015 02:35 AM

Quote:

Originally Posted by Alan_SP (Post 2559494)
I also changed location where you should add code, it's in the first post.

Also, you should now that what you're experiencing is the way your browser handles HTML, or just problem with speed with your computer.

For example, in my browser collapsing on and off is instant. Try it with different browser, or on different computer.

From code perspective, there's nothing that can be done to speed it up (and it is fast). It collapses as speedy as any other collapsing object within vB.

Very sorry, but not sure why I'm not following. :(

Elixar 02-04-2016 02:08 PM

I noticed an error, it shows on the WOL that rather than saying you are Viewing User Profile, it now says Viewing User Note. :(

Alan_SP 02-05-2016 10:52 AM

Probably because you call both pages, and somehow user notes gets precedence.

Elixar 02-05-2016 01:53 PM

Quote:

Originally Posted by Alan_SP (Post 2564270)
Probably because you call both pages, and somehow user notes gets precedence.

How can I fix this?

Alan_SP 02-07-2016 09:44 AM

I don't know. I guess you should find php code in user notes script that makes user visible in WOL. What code is that, I don't know.

Elixar 02-07-2016 02:42 PM

Quote:

Originally Posted by Alan_SP (Post 2564388)
I don't know. I guess you should find php code in user notes script that makes user visible in WOL. What code is that, I don't know.

Ah darn, hopefully someone knows. :P

Alan_SP 02-08-2016 09:29 AM

Just an idea, you can test and see if it will work or not.

Every file has something like this on beginning:

PHP Code:

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT''usernote'); 

This one is from usernote.php. Try to edit usernote and put profile instead. It can affect how vBulletin works, so be prepared to put things back and if it would work, test other things as well before you start thinking that it solved your problem.

Elixar 02-08-2016 05:27 PM

Quote:

Originally Posted by Alan_SP (Post 2564443)
Just an idea, you can test and see if it will work or not.

Every file has something like this on beginning:

PHP Code:

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT''usernote'); 

This one is from usernote.php. Try to edit usernote and put profile instead. It can affect how vBulletin works, so be prepared to put things back and if it would work, test other things as well before you start thinking that it solved your problem.


Mark said it would involve editing core files, so I went ahead and just removed this from the themes. Thanks though. :)


All times are GMT. The time now is 09:15 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.01283 seconds
  • Memory Usage 1,808KB
  • 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
  • (8)bbcode_html_printable
  • (2)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (23)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete