vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin Tips & Tricks (https://vborg.vbsupport.ru/forumdisplay.php?f=239)
-   -   New block in the member profile (https://vborg.vbsupport.ru/showthread.php?t=203775)

cionfs 01-31-2009 10:00 PM

New block in the member profile
 
I happen to want to experience some features of vBulletin. I tried to recreate a box in the personal profile. In short add a box like the ones in the picture below.

https://vborg.vbsupport.ru/external/2009/07/26.jpg

To add an additional block go to AdminCP> Styles and Templates> Search in Templates and search for models MEMBERINFO. Once we found double-click on the mouse to change it.
Inside there is the code. To find this

Code:

<div id="sidebar_container">
    <!-- sidebar -->
    $template_hook[profile_right_first]
    $blocks[stats_mini]
    $template_hook[profile_right_mini]
    $blocks[friends_mini]
    $blocks[albums]
    $template_hook[profile_right_album]
    $blocks[groups]
    $blocks[visitors]
    $template_hook[profile_right_last]
    <!-- / sidebar -->
</div>

To add a new block is needed this code

Code:

<!--new block-->
<!-- $id -->
<div id="$id" class="tborder content_block">
    <h4 class="thead block_title">
        <a href="#top" class="collapse_gadget" onclick="return toggle_collapse('$id')"><img id="collapseimg_$id" src="$stylevar[imgdir_button]/collapse_generic{$vbcollapse['collapseimg_'.$id]}.gif" alt="" border="0" /></a>
        <a name="$id"></a>
        <span class="block_name">BLOCK TITLE</span>
    </h4>
    <div class="block_content" id="collapseobj_$id" style="{$vbcollapse['collapseobj_'.$id]}"><div class="alt1 smallfont block_row block_footer">
<p align="center">
CONTENT
</p>
</div></div>
</div>
<!-- / $id -->
<!--new block-->

You should get something like this

Code:

<div id="sidebar_container">
    <!-- sidebar -->
    $template_hook[profile_right_first]
    $blocks[stats_mini]
<!--new block-->
<!-- $id -->
<div id="$id" class="tborder content_block">
    <h4 class="thead block_title">
        <a href="#top" class="collapse_gadget" onclick="return toggle_collapse('$id')"><img id="collapseimg_$id" src="$stylevar[imgdir_button]/collapse_generic{$vbcollapse['collapseimg_'.$id]}.gif" alt="" border="0" /></a>
        <a name="$id"></a>
        <span class="block_name">BLOCK TITLE</span>
    </h4>
    <div class="block_content" id="collapseobj_$id" style="{$vbcollapse['collapseobj_'.$id]}"><div class="alt1 smallfont block_row block_footer">
<p align="center">
CONTENT
</p>
</div></div>
</div>
<!-- / $id -->
<!--new block-->
    $template_hook[profile_right_mini]
    $blocks[friends_mini]
    $blocks[albums]
    $template_hook[profile_right_album]
    $blocks[groups]
    $blocks[visitors]
    $template_hook[profile_right_last]
    <!-- / sidebar -->
</div>

In this way you will have a result like this:

http://www.cionfs.it/files/sideboxnewres.JPG


PS: Sorry for my English :D

bo.haya 02-01-2009 02:03 AM

thank you

Magnumutz 02-01-2009 09:31 AM

This is more of an article...

cionfs 02-01-2009 09:48 AM

Where? I did not find anything, I created this thread. :)

G4BR13L 02-01-2009 10:03 AM

Cool , Very Nice Nice Release ...

This MOD Is Very Cool ..

Thanks Cionfs ;)

Bye,
Gabriel

adhmwagde 02-01-2009 12:25 PM

thanks man ... but this BLOCK TITLE are free for us to put our variables in vbulletin or this mean something in member info ?

cionfs 02-01-2009 12:43 PM

You can put whatever you want

Magnumutz 02-01-2009 02:31 PM

Quote:

Originally Posted by cionfs (Post 1730735)
Where? I did not find anything, I created this thread. :)

Here are the articles: https://vborg.vbsupport.ru/forumdisplay.php?f=184
You can submit yours there.

GlamRockTalk 02-01-2009 05:54 PM

This is an easy way to get this together :D

Now, to take it to the next step...how do we have someone add a code or ID (like maybe a playlist.com ID or something) to automatically have something appear in the box?

cionfs 02-01-2009 08:53 PM

You should handle all of the variables with.

Aliraqis 02-02-2009 04:51 PM

Nice Thnx

baghdad4ever 05-27-2009 06:46 PM

thanks

webgroup 07-06-2009 05:54 PM

how can I remove the footer info from the block?
in my newly created blcok, the footer info like powered by vbuleltin is appearing on the block

Thanks

cionfs 07-06-2009 06:03 PM

This block does not recall footer.

Change "Content".

SİMAR 07-18-2009 06:49 PM

thank you

Kottonmouth801 07-22-2009 02:32 PM

Reserved for install. :D

Mobo 08-10-2009 10:57 PM

Can the users add info to this block, or can only the info I place in the template edit show up in there?

cionfs 08-11-2009 09:32 AM

Quote:

Originally Posted by Mobo (Post 1864841)
Can the users add info to this block, or can only the info I place in the template edit show up in there?

If you allow users to complete a custom field and enter it in this block, yes.

Mobo 08-11-2009 11:51 AM

How do you do that?

cionfs 08-11-2009 12:14 PM

Quote:

Originally Posted by Mobo (Post 1865078)
How do you do that?

ACP>User profile fields>Add new user profile field and add your field (Remember the number of field).

This field appear in UserCP>Edit Your details.

When yuou add the new block change this code:

Code:

<p align="center">
CONTENT
</p>

With this:

Code:

<if condition="$post[fieldX]">
<p align="center">
$post[fieldX]
</p>
</if>

Change X with your field number. ;)

Mobo 08-11-2009 01:15 PM

Thanks. Just to make sure, I add the new block via your instructions here?

yotsume 08-27-2009 04:27 AM

Great article. I used it to create a block for member's playlist link.

My question is how do I code the block to not show if there is no content? I was thinking I have to warp your block code in some conditional statement to hide the block if it is empty.

How can I achieve this?

THANKS!

Here is my block code: (playlist code is red)

Code:


<!--new block-->
<!-- $id -->
<div id="$id" class="tborder content_block">
    <h4 class="thead block_title">
        <a href="#top" class="collapse_gadget" onclick="return toggle_collapse('$id')"><img id="collapseimg_$id" src="$stylevar[imgdir_button]/collapse_generic{$vbcollapse['collapseimg_'.$id]}.gif" alt="" border="0" /></a>
        <a name="$id"></a>
        <span class="block_name">My Playlist</span>
    </h4>
    <div class="block_content" id="collapseobj_$id" style="{$vbcollapse['collapseobj_'.$id]}"><div class="alt1 smallfont block_row block_footer">
<if condition="$userinfo['fieldXX']">
<div id="simple_aboutme_link"><a class="smallfont" href="#" onclick="window.open('$vboptions[bburl]/playlist.php?$session[sessionurl]userid=$prepared[userid]','playlist','status=1,width=450,height=344'); return false;"><phrase 1="$prepared[username]">$vbphrase[listen_to_xs_playlist]</phrase> <img src="$stylevar[imgdir_misc]/playlist.png" alt="<phrase 1="$prepared[username]">$vbphrase[listen_to_xs_playlist]</phrase>" border="0" class="inlineimg" /></a></div>
</if>

</div></div>
</div>
<!-- / $id -->
<!--new block-->



All times are GMT. The time now is 01:45 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.01607 seconds
  • Memory Usage 1,763KB
  • 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
  • (6)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (22)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