SVTOA
12-17-2004, 04:46 PM
I originally wrote this mod as an add-on for Vbadvanced Homepage. I have re-written the instructions for vBa CMPS. Since it's really only a template mod, forgive me if it's in the wrong place.
This add-on will create a block of custom links on the vBa CMPS homepage. This allows your members to setup their own "Favorites" within the portal page. It is an easy mod to install, you simply add 2 new profile fields for each link you wish to display, create 1 new template and create the module.
The version show here is written for 5 links, you can add as many or as few as you wish.
The screenshots attached show what your users will see. If an unregistered member views your portal, the block will prompt them to register. If they are already registered, the block will provide a link to the users cpanel to add the links.
INSTRUCTIONS:
Step one: Create 2 new user profile fields for each link choice you wish to add.
Name the first one "Favorite Link URL" and the Second "Favorite Link Name"
Make them user editable but hidden from the profile and do not include in searches.
In your setup of these new fields, be sure to include instructions so your members understand how to create new links. (See screenshots)
The code below is based on 5 custom user links, so this required 10 new profile fields.
Step two:
Create a new template called adv_portal_links and use this code for the template content:
NOTE!!! You must properly edit the [fieldXX] to reflect the field id numbers on your forum! I have left mine in place for examples.
<!-- Favorite Links Block BY SVTOA -->
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr>
<td class="tcat"><span class="smallfont"><b>$vboptions[blockbullet] My Favorite Links </b></span></td>
</tr>
<tr>
<td class="$getbgrow"><span class="smallfont">
<if condition="!$bbuserinfo['userid']">
<span class="smallfont">Not a member yet?<br /><a href="$vboptions[bburl]/register.php">Register now</a> to show favorite Links Here!</span>
<else />
<if condition="$bbuserinfo[field67] !=''">
<a href="http://$bbuserinfo[field67]" target="_blank">$bbuserinfo[field68]</a>
<else />
<a href="$vboptions[bburl]/profile.php?do=editprofile">Add your favorite links</A> to display them here.
</if>
</if>
</span>
</td>
</tr>
<!-- second table links -->
<tr>
<td class="$getbgrow"><span class="smallfont">
<if condition="$bbuserinfo[field69] !=''">
<a href="http://$bbuserinfo[field69]" target="_blank">$bbuserinfo[field70]</a>
</if>
</span>
</td>
</tr>
<!-- third table links -->
<tr>
<td class="$getbgrow"><span class="smallfont">
<if condition="$bbuserinfo[field71] !=''">
<a href="http://$bbuserinfo[field71]" target="_blank">$bbuserinfo[field72]</a>
</if>
</span>
</td>
</tr>
<!-- fourth table links -->
<tr>
<td class="$getbgrow"><span class="smallfont">
<if condition="$bbuserinfo[field73] !=''">
<a href="http://$bbuserinfo[field73]" target="_blank">$bbuserinfo[field74]</a>
</if>
</span>
</td>
</tr>
<!-- fifth table links -->
<tr>
<td class="$getbgrow"><span class="smallfont">
<if condition="$bbuserinfo[field75] !=''">
<a href="http://$bbuserinfo[field75]" target="_blank">$bbuserinfo[field76]</a>
</if>
</span>
</td>
</tr>
</table>
<br/>
Step Three: Create a new module called "Favorite Links" (or whatever you wish to call it) and of course use the template 'adv_portal_links' (remember to just put "links" in the "template to include" box, not 'adv_portal_links' (see added screenshot)
Postion where you want it and save.
Done!
This add-on will create a block of custom links on the vBa CMPS homepage. This allows your members to setup their own "Favorites" within the portal page. It is an easy mod to install, you simply add 2 new profile fields for each link you wish to display, create 1 new template and create the module.
The version show here is written for 5 links, you can add as many or as few as you wish.
The screenshots attached show what your users will see. If an unregistered member views your portal, the block will prompt them to register. If they are already registered, the block will provide a link to the users cpanel to add the links.
INSTRUCTIONS:
Step one: Create 2 new user profile fields for each link choice you wish to add.
Name the first one "Favorite Link URL" and the Second "Favorite Link Name"
Make them user editable but hidden from the profile and do not include in searches.
In your setup of these new fields, be sure to include instructions so your members understand how to create new links. (See screenshots)
The code below is based on 5 custom user links, so this required 10 new profile fields.
Step two:
Create a new template called adv_portal_links and use this code for the template content:
NOTE!!! You must properly edit the [fieldXX] to reflect the field id numbers on your forum! I have left mine in place for examples.
<!-- Favorite Links Block BY SVTOA -->
<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">
<tr>
<td class="tcat"><span class="smallfont"><b>$vboptions[blockbullet] My Favorite Links </b></span></td>
</tr>
<tr>
<td class="$getbgrow"><span class="smallfont">
<if condition="!$bbuserinfo['userid']">
<span class="smallfont">Not a member yet?<br /><a href="$vboptions[bburl]/register.php">Register now</a> to show favorite Links Here!</span>
<else />
<if condition="$bbuserinfo[field67] !=''">
<a href="http://$bbuserinfo[field67]" target="_blank">$bbuserinfo[field68]</a>
<else />
<a href="$vboptions[bburl]/profile.php?do=editprofile">Add your favorite links</A> to display them here.
</if>
</if>
</span>
</td>
</tr>
<!-- second table links -->
<tr>
<td class="$getbgrow"><span class="smallfont">
<if condition="$bbuserinfo[field69] !=''">
<a href="http://$bbuserinfo[field69]" target="_blank">$bbuserinfo[field70]</a>
</if>
</span>
</td>
</tr>
<!-- third table links -->
<tr>
<td class="$getbgrow"><span class="smallfont">
<if condition="$bbuserinfo[field71] !=''">
<a href="http://$bbuserinfo[field71]" target="_blank">$bbuserinfo[field72]</a>
</if>
</span>
</td>
</tr>
<!-- fourth table links -->
<tr>
<td class="$getbgrow"><span class="smallfont">
<if condition="$bbuserinfo[field73] !=''">
<a href="http://$bbuserinfo[field73]" target="_blank">$bbuserinfo[field74]</a>
</if>
</span>
</td>
</tr>
<!-- fifth table links -->
<tr>
<td class="$getbgrow"><span class="smallfont">
<if condition="$bbuserinfo[field75] !=''">
<a href="http://$bbuserinfo[field75]" target="_blank">$bbuserinfo[field76]</a>
</if>
</span>
</td>
</tr>
</table>
<br/>
Step Three: Create a new module called "Favorite Links" (or whatever you wish to call it) and of course use the template 'adv_portal_links' (remember to just put "links" in the "template to include" box, not 'adv_portal_links' (see added screenshot)
Postion where you want it and save.
Done!