PDA

View Full Version : New block in the member profile


cionfs
01 Feb 2009, 01:13
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://www.vbulletin.org/forum/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

<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


<!--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

<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
01 Feb 2009, 04:03
thank you

Magnumutz
01 Feb 2009, 11:31
This is more of an article...

cionfs
01 Feb 2009, 11:48
Where? I did not find anything, I created this thread. :)

G4BR13L
01 Feb 2009, 12:03
Cool , Very Nice Nice Release ...

This MOD Is Very Cool ..

Thanks Cionfs ;)

Bye,
Gabriel

adhmwagde
01 Feb 2009, 14:25
thanks man ... but this BLOCK TITLE are free for us to put our variables in vbulletin or this mean something in member info ?

cionfs
01 Feb 2009, 14:43
You can put whatever you want

Magnumutz
01 Feb 2009, 16:31
Where? I did not find anything, I created this thread. :)
Here are the articles: http://www.vbulletin.org/forum/forumdisplay.php?f=184
You can submit yours there.

GlamRockTalk
01 Feb 2009, 19:54
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
01 Feb 2009, 22:53
You should handle all of the variables with.

Aliraqis
02 Feb 2009, 18:51
Nice Thnx

baghdad4ever
27 May 2009, 20:46
thanks

webgroup
06 Jul 2009, 19:54
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
06 Jul 2009, 20:03
This block does not recall footer.

Change "Content".

SİMAR
18 Jul 2009, 20:49
thank you

Kottonmouth801
22 Jul 2009, 16:32
Reserved for install. :D

Mobo
11 Aug 2009, 00:57
Can the users add info to this block, or can only the info I place in the template edit show up in there?

cionfs
11 Aug 2009, 11:32
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
11 Aug 2009, 13:51
How do you do that?

cionfs
11 Aug 2009, 14:14
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:


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


With this:


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


Change X with your field number. ;)

Mobo
11 Aug 2009, 15:15
Thanks. Just to make sure, I add the new block via your instructions here (http://www.vbulletin.org/forum/showthread.php?t=203775)?

yotsume
27 Aug 2009, 06:27
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)


<!--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-->