• Forum
  • Doc
  • Screenshots
  • Download
  • Donate
  • Contributors
  • Contact
  • Follow @phpfreechat
  • DEMO
  • Board index ‹ Version 1.x branch ‹ Contributions (v1.x)
  • Change font size
  • FAQ
  • Register
  • Login

Hack for Profil link in list

Post a bug fix, a new feature, a theme ...

Moderators: OldWolf, re*s.t.a.r.s.*2

Post a reply
5 posts • Page 1 of 1

Postby Sonya* » Mon Feb 25, 2008 3:57 pm

Hello,

I've been wating for "raw html" feature in nickmeta. It took a little bit long for me, so I tryed to find the implementation in svn. It works in Firefox and it doesn't work in IE6. Therefore I implemented profile link my way. Profile link is shown above "Private message" link while clicking on user name in user list. It is provided with a small icon.

Here is the hack:

Open: data/public/js/pfcclient.js
Find:
&& k != 'flood_nbchar'

Add after:
&& k != 'profile_link' // Profile link hack

Find:
div.appendChild(table);

Add after:
// Profile link hack
// add profile link (do not add it if this button is yourself)
if (pfc.getUserMeta(nickid,'nick') != this.nickname)
{
var p = document.createElement('p');
p.setAttribute(className, 'pfc_nickwhois_pv');
var a = document.createElement('a');
a.setAttribute('href', pfc.getUserMeta(nickid,'profile_link'));
a.setAttribute('target', '_blank');
a.pfc_nickid = nickid;
a.pfc_parent = div;
var img = document.createElement('img');
img.setAttribute('src', this.res.getFileUrl('images/user.gif'));
img.alt = document.createTextNode(this.res.getLabel('Profile'));
a.appendChild(img);
a.appendChild(document.createTextNode(this.res.getLabel('Profile')));
p.appendChild(a);
div.appendChild(p);
}

Open: src/phpfreechat.class.php
Find:
"Private message", // _pfc

Add after:
"Profile", // Profile link hack

Open: i18n/en_Us/main.php (or your preferred language file)
Find:
// line 109 in pfcclient.js.tpl.php
$GLOBALS["i18n"]["Private message"] = "Private message";

Add after:
$GLOBALS["i18n"]["Profile"] = "User profile";

Now you can provide individual link for chat user in index.php. Add this line in your chat configuration in index.php:
....
$params['nickmeta']['profile_link'] = "/userprofile/".$userid;
....

Example: I use the chat with phpbb3 and my link to forum profile is:
$params['nickmeta']['profile_link'] = "/forums/memberlist.php?mode=viewprofile&u='.$user->data['user_id'];

Enjoy!
Last edited by Sonya* on Mon Feb 25, 2008 3:58 pm, edited 1 time in total.
New Chat on Herzlink
Sonya*
New member
 
Posts: 8
Joined: Wed Dec 26, 2007 6:58 pm
Top

Postby OldWolf » Mon Feb 25, 2008 10:28 pm

Thank you for your contribution. :)
Signature:
Read before Posting: Forum Rules
Note: I am unable to offer support through PM/e-mail at this time.
OldWolf
Site Admin
 
Posts: 1918
Joined: Sun Sep 23, 2007 5:48 am
Top

Postby cactux » Wed Apr 16, 2008 9:45 pm

Hello,

Is there a chance to have this integrated in the main branch of PFC?
If so, I would prefer to have the link displayed for all membres, i.e. not checking if it is the current user. People like to see the page as others see it :)

Yann
cactux
Member
 
Posts: 16
Joined: Wed Feb 15, 2006 11:08 pm
Location: France
  • Website
Top

Postby phpfreechat » Mon Apr 28, 2008 8:11 am

The raw html feature has been implemented in 1.1 release.
Please have a look to demo65.
phpfreechat
Site Admin
 
Posts: 2657
Joined: Tue Feb 07, 2006 3:35 pm
Location: France
Top

Postby SalamiY2k » Thu Jun 05, 2008 10:08 am

Is it possible to make this work when the username is directly clickable? Like demo 34?
Last edited by SalamiY2k on Thu Jun 05, 2008 10:09 am, edited 1 time in total.
SalamiY2k
Member
 
Posts: 24
Joined: Tue May 13, 2008 12:50 pm
Top


Post a reply
5 posts • Page 1 of 1

Return to Contributions (v1.x)

Who is online

Users browsing this forum: No registered users and 14 guests

  • Board index
  • The team • Delete all board cookies • All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
Sign in
Wrong credentials
Sign up I forgot my password
.
jeu-gratuit.net | more partners
Fork me on GitHub