Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Replace_in_output on all profile links

Asked Modified Viewed 2,699 times
K
KonickMultimedia
K
Free Online Games: http://www.gamescut.com
  • Member, joined since
  • Contributed 76 posts on the community forums.
  • Started 9 threads in the forums
  • Started this discussions
asked
Member

Right, lets get straight to the point. Here's what I wanna do: I want to replace all the links to profile.php on my site to include a piece of javascript showing a popup box with the user info and avatar as soon as i move my mouse over the link. (no problem on that, just the replacing part)

Does anyone have an idea on how to do this? We would have to extract the user id from the url to show the right info. I have no idea and no experience with regexp.

Any help would be appreciated
0 replies

5 posts

P
PolarFox
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
answered
Veteran Member

you can change profile_link() function from maincore.
0 replies
K
KonickMultimedia
K
Free Online Games: http://www.gamescut.com
  • Member, joined since
  • Contributed 76 posts on the community forums.
  • Started 9 threads in the forums
  • Started this discussions
answered
Member

I dont have that function... Did it come with a recent version?
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

Are you Looking for this ???

http://www.php-fusion.co.uk/infusions/addondb/view.php?addon_id=100

But this is for version 7.01+

Remember, if you are using a Lower version then you have to do it in all php files where the Link is located.

The Newer Version has a predefined function for posting Links to profile.php called profile_link. Due to this, the Modification is only done in this function and its done all over in the cms...

But for older versions, there is separate definition of profile link... i.e, a href="...profile.php?lookup=$user_id" etc etc

So better update to new version...
0 replies
K
KonickMultimedia
K
Free Online Games: http://www.gamescut.com
  • Member, joined since
  • Contributed 76 posts on the community forums.
  • Started 9 threads in the forums
  • Started this discussions
answered
Member

Well i cant really update it since nearly every file is modified. Anyway, Looks like ive got a lot of manual work to do then :)
0 replies
A
Ankur
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums
answered
Veteran Member

Yeah !!!

But there isn't any lot of hard work required to do that !!!

I'll tell you a method to do that !!!

You can do that all things which I've given in the Mouse Hover Avatar MOD, except Changes in maincore.php

Then Just put this code before, where the Link is defined, i.e, Before some lines :

Before some lines from:
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]<a href='profile.php?lookup=".$data['user_id']."'>[/syntaxhighlighter]
Find this line in your PHP Files by Searching for profile.php text from Wordpad or Notepad..

Code to be added :
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false] $avatarimage = dbresult(dbquery("SELECT user_avatar FROM ".DB_USERS." WHERE user_id='".$user_id."'"wink,0);

if ($avatarimage && file_exists(IMAGES."avatars/".$avatarimage))
{
$onmouseover = 'showhoveravatar("'.IMAGES.'avatars/'.$avatarimage.'"wink';
}
else
{
$onmouseover = 'showhoveravatar("'.IMAGES.'noav.png"wink';
}
$onmouseout = 'hideddrivetip()';[/syntaxhighlighter]

Modification required :
From :
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]<a href='profile.php?lookup=".$data['user_id']."'>[/syntaxhighlighter]

Change to :

[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]<a href='profile.php?lookup=".$data['user_id']."' onmouseover='".$onmouseover."' onmouseout='".$onmouseout."'>[/syntaxhighlighter]

Hope this will work for you
Edited by Ankur on 11-01-2011 17:37,
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 5 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

K
K
Free Online Games: http://www.gamescut.com
  • Member, joined since
  • Contributed 76 posts on the community forums.
  • Started 9 threads in the forums
  • Started this discussions
P
P
  • Veteran Member, joined since
  • Contributed 1,633 posts on the community forums.
  • Started 29 threads in the forums
A
A
Ankur 10
Hi! Its me, Ankur Thakur! smile
  • Veteran Member, joined since
  • Contributed 1,277 posts on the community forums.
  • Started 60 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet