ysva's CB Custom Profile's [Tips and Tricks]

17 years 5 months ago #24113 by ysva
The reason that this topic is in this forum, is because there's no Tips&Tricks forum.

I've been working a lot on changing profile looks, and I've learned a lot on the way. I'll be posting many ways on how to mod your way through the hardcoded CB jungle. I'm not that of a coder, so I cannot turn this into plugins. Still need to learn how to make plugins. Eventually this can all be put together to have user defined profile layouts so they can choose the look of their profile themselves.

1. Profile title in custom font [Page 1]
2. Move the menu to a module menu [Page 1] {HELP NEEDED}
3. Member quicksearch [Page 1] {HELP NEEDED}
4. Change look of "Div with title" [Page 1]
5. Template Cleanup 1 [Page1]
6. Remove alternating field colors [Page 2]
7. Profile editing not in tabs [Page 2] {HELP NEEDED}
8. Template Cleanup 2 [Page3]
More coming soon...

(Scroll through the topic to see more tricks,they're not ordered.)

NOTE:
I'm writing this áfter I've changed my files, so not all might be correct. If something's wrong, please tell me and I'll change it.

HELP NEEDED:
In order to finish everything I'm working on, I need a lot of help from others. If you feel like helping, then please join in!



Do you like this? Karma me up!:laugh:

Post edited by: ysva, at: 2006/11/07 16:39

Post edited by: ysva, at: 2006/11/09 16:22
The following user(s) said Thank You: wahabawq

Please Log in to join the conversation.

17 years 5 months ago #24114 by ysva
Trick 1

Profiletitle in custom font

About:
This enables many options to change the look of a CB profile.


Needed:
JoGadgets


Hacked files:
wwwroot/components/com_comprofiler/plugin/user/plug_cbcore/cb.core.php


This is what you need to do:

1. Add:
[code:1]include_once('_jgfw_/jgfw.php');[/code:1]
into the cb.core.php file (place it on something like line 2 of the fle)

2. From line 38 and on you need your code like this:
[code:1] function getDisplayTab($tab,$user,$ui) {
global $ueConfig;
// Display user's name + "Profile Page"
$params=$this->params;
$title=getLangDefinition($params->get('title', '_UE_PROFILE_TITLE_TEXT'));
$name = getNameFormat($user->name,$user->username,$ueConfig);
$ysva_profiletitle = sprintf($title, $name);
$ysva_profiletitlewrap = '<div id="cbProfileTitle">'.'{jgitext text:= size:=[40] color:=[000000] bgcolor:=[ffffff] font:=[default.ttf]}</div>';
return $GLOBALS->doparse( $ysva_profiletitlewrap );

}
} // end class getPageTitleTab[/code:1]

Don't forget to:
1. Change the:
size:=[40]
color:=[000000]
bgcolor:=[ffffff]
font:=[default.ttf]
to what you want to make of it.
2. Make sure
you've got JoGadgets installed


Post edited by: ysva, at: 2006/11/07 13:02

Please Log in to join the conversation.

17 years 5 months ago #24117 by ysva
Trick 2

Move the menu to a module menu

Still working on this!
Current progress:
-Still need to find out how to display certain items ONLY when they need to be displayed.
For example: "Add connection" should only be displayed if the member is not in the friendlist yet, otherwise it should be "Cancel connection request" or "Remove connection"
And "Remove photo" should be only visible when there's a custom photo.
-Need to create an "anker" (forgot the english name, hope it's correct). So when the menu item gets clicked, the page is on the correct place instead of at the top of the page.


About:
Personally I hate it to have the menu in the same space as the profile, and decided to move it to my usermenu in my Joomla template's rightbar.


Needed:
1. usermenu (the Joomla one, not CB )
2. The name of the tabs you have


Hacked files:
Coming soon


This is what you need to do:
1. Get the name of a tab.

I've been doing a bit of searching and found some:
Connectiontab: index.php?option=com_comprofiler&task=userProfile&tab=getconnectiontab
Forumtab: index.php?option=com_comprofiler&task=userProfile&tab=getforumtab
Profilebooktab: index.php?option=com_comprofiler&task=userProfile&tab=getprofilebooktab

2. Create the menu item. You can see in step 1 how I made my menu items. If you use different sort of links you can do:
/component/option,com_comprofiler/task,userProfile/tab,getforumtab/

3. Get the links that can be found in the CB Menu.
You need to get the one's that you've got enabled, like:
index.php?option=com_comprofiler&Itemid=&task=userAvatar
for changing their profilepicture.

Don't forget to:
1. make sure the usermenu or the menu item is only visible for the registered!


Post edited by: ysva, at: 2006/11/07 14:27

Please Log in to join the conversation.

17 years 5 months ago #24119 by ysva
Trick 3

Member quicksearch

Help needed!
This REALLY needs to be in a module instead of this way.


About:
Quicksearch, I'd rather made a module, but I've got no idea how to make one.


Needed:
1. Your templatefile


Hacked files:
None


This is what you need to do:
1. Add this at the place in you're template where you want it: (I'd recommend at the top of your right sidebar.

[code:1]<tr>
<td>
<form name="adminForm" method="post" action="index.php?option=com_comprofiler&task=usersList&listid=2&Itemid=1&action=search" >
<table width="100%" cellpadding="4" cellspacing="0" border="0" align="center" class="moduletable">
<tr>
<th valign="top">Search member...</th>
</tr>
<tr>
<td>
<input type="text" name="search" class="inputbox" size="15" maxlength="100" value="Search member..."
onblur="if(this.value=='') this.value='Typ Search member...';"
onfocus="if(this.value=='Search member...') this.value='';"/>
<input type="image" src="components/com_comprofiler/images/search.gif" alt="Search member!" align="top" style="border: 0px;" />
</td>
</table>
</form>
</td>
</tr>[/code:1]

Don't forget to:
1. change all the "Search member..." if you want a different text displayed
2. make sure the image components/com_comprofiler/images/search.gif exists or change it into a different image, or just remove it completely


Post edited by: ysva, at: 2006/11/07 14:27

Please Log in to join the conversation.

17 years 5 months ago #24121 by ysva
Trick 4

Change look of "Div with title"

About:
This is a big step towards a user defined profile layout.


Needed:
CB default CSS file


Hacked files:
/administrator/components/com_comprofiler/comprofiler.class.php


This is what you need to do:
1. Change all the "contentheading" to "contentheading_ysva"
2. Open up your CB css file
(by default: /components/com_comprofiler/plugin/templates/default/template.css)
and add
[code:1]/*ysva's adjustments*/

.contentheading_ysva{
color: #000000;
text-align: left;
font-weight: bold;
background-image: url(YOURWEBSITE.com/components/com_comprofiler/plugin/templates/default/ysva_profileimages/bg_componentheading_ysva.gif);
padding: 5px 10px 5px 50px;
}[/code:1]
3. As you see you noticed that you need an image. You can also just change it into a color if you want. Otherwise you need to upload an image. (NOTE: I made a subfolder called profile_images, you don't have to do this, but you do have to change it if you don't.) The image I made was 25px high, and I had a small star in the left of the image. That's why I padded the text a bit to the right so it wouldn't come over the star.

Don't forget to:
1. UPLOAD THE IMAGE


Post edited by: ysva, at: 2006/11/07 13:48

Please Log in to join the conversation.

17 years 5 months ago #24122 by ysva
Trick 5

Template Cleanup 1

About:
Future adjustments. I don't know why this is in here, CB team must have it's reasons - which I don't understand.


Needed:
None


Hacked files:
components/com_comprofiler/comprofiler.html.php


This is what you need to do:
1. On line 828 (I'm not sure)
change [code:1]echo "<div class=\"cbClr\">&/n/b/s/p/;</div></div>";[/code:1]
into [code:1]echo "<div class=\"cbClr\"></div></div>";[/code:1]
2. Of course it's not &/n/b/s/p/;, it's without the /'s. I had to put them in for Joomlaboard reasons.

Post edited by: ysva, at: 2006/11/07 14:01

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.257 seconds

Facebook Twitter LinkedIn