The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

How to link a PHP variable to an image? (to create a Profile button)

5 posters

Go down

How to link a PHP variable to an image? (to create a Profile button) Empty How to link a PHP variable to an image? (to create a Profile button)

Post by karkooshy June 24th 2011, 1:28 pm

I'm currently working on a navbar... and what really bugs me is the fact that the 'Profile' link on the default navbar, actually links to the 'Edit Profile' page... and in the edit profile page, we have an option to see our profiles Razz
If anything, the link has to be to our profiles, and in our profiles pages, there should be a link to edit the profile xP
Anyways, I realized the PHP variable USERLINK gives each user a direct link to their actual profile... but there are a couple of problems in adding this to the navbar...
1. Some templates don't accept this PHP variable.. apparently
2. My navbar is made of images and i truthfully have no idea how to link this variable to an image to create a button xD

Wondering if anyone has any ideas on the matter..
Thank you in advance Smile
karkooshy
karkooshy
Forumember

Male Posts : 327
Reputation : 7
Language : English

http://quable.forumotion.com

Back to top Go down

How to link a PHP variable to an image? (to create a Profile button) Empty Re: How to link a PHP variable to an image? (to create a Profile button)

Post by mgt98 June 24th 2011, 2:09 pm

I don't know what you mean, but this is what I did because it doesn't redirect to the profile, I made a button with the writing User CP (User Control Panel), and made that the image. So when users click it, they expect to be at a edit profile page XD
mgt98
mgt98
Forumember

Male Posts : 344
Reputation : 45
Language : English

Back to top Go down

How to link a PHP variable to an image? (to create a Profile button) Empty Re: How to link a PHP variable to an image? (to create a Profile button)

Post by karkooshy June 29th 2011, 10:04 pm

Thanks Dion... I think I understand... but it's still not working... xP
Anything wrong with the code I'm using?

Code:

<span id=unl>{USERLINK}</span><script src="http://yourjavascript.com/82932161441/userlink.js" type="text/javascript"></script>


I'm using it in the profile_add_body template for profiles....
Also if I were to apply an image, where does the img tags go?
Thank you again Smile
(Awesome site btw)
karkooshy
karkooshy
Forumember

Male Posts : 327
Reputation : 7
Language : English

http://quable.forumotion.com

Back to top Go down

How to link a PHP variable to an image? (to create a Profile button) Empty Re: How to link a PHP variable to an image? (to create a Profile button)

Post by SC__Programmer July 2nd 2011, 4:00 am

here is what i do,

1) Go to Display>Headers & Navigation
2) Make a customized menu
3) Put the title as Profile2 or whatever,insert your Picture for the profile,insert the text,and insert the url you want to go to e.g. /forum
4) Create it
5) Push the up arrow until its below Profile
6) Go to Display>Pics management
7) Clear the field for Edit your profile and save

Now when you go to your forum you will have that custom link that says profile and it will direct you to your profile Very Happy
avatar
SC__Programmer
Forumember

Male Posts : 58
Reputation : 40
Language : English

http://digitaldesigns.forumotion.com/

Back to top Go down

How to link a PHP variable to an image? (to create a Profile button) Empty Re: How to link a PHP variable to an image? (to create a Profile button)

Post by mgt98 July 2nd 2011, 9:28 am

So, what did you put as the link?
mgt98
mgt98
Forumember

Male Posts : 344
Reputation : 45
Language : English

Back to top Go down

How to link a PHP variable to an image? (to create a Profile button) Empty Re: How to link a PHP variable to an image? (to create a Profile button)

Post by karkooshy July 2nd 2011, 9:46 am

SC__Programmer wrote:here is what i do,

1) Go to Display>Headers & Navigation
2) Make a customized menu
3) Put the title as Profile2 or whatever,insert your Picture for the profile,insert the text,and insert the url you want to go to e.g. /forum
4) Create it
5) Push the up arrow until its below Profile
6) Go to Display>Pics management
7) Clear the field for Edit your profile and save

Now when you go to your forum you will have that custom link that says profile and it will direct you to your profile Very Happy


Thanks a bunch Smile
Although I've already tried that xD
And like mgt98 said, what did you put as the link? There's a different link for every profile... only a PHP variable would work... I think Razz
Thanks for the help anyways ^^
karkooshy
karkooshy
Forumember

Male Posts : 327
Reputation : 7
Language : English

http://quable.forumotion.com

Back to top Go down

How to link a PHP variable to an image? (to create a Profile button) Empty Re: How to link a PHP variable to an image? (to create a Profile button)

Post by karkooshy July 4th 2011, 7:28 am

-bumpie-
karkooshy
karkooshy
Forumember

Male Posts : 327
Reputation : 7
Language : English

http://quable.forumotion.com

Back to top Go down

How to link a PHP variable to an image? (to create a Profile button) Empty Re: How to link a PHP variable to an image? (to create a Profile button)

Post by Saxaca July 4th 2011, 9:49 pm

http://diondesigns.forumotion.com/t440-

The second code there should work...
You can easily create a custom element, and append it to your navigation...

Something like this:
Code:
$(function() {
    var uid = document.getElementById('uid').innerHTML;

    if (uid !=-1) {
        var x = $('a.mainmenu[href*="/profile?mode=editprofile"]')[0];

        x.href = '/u'+ uid;
        x.innerHTML = 'My profile';
    }
});
Saxaca
Saxaca
Forumember

Male Posts : 539
Reputation : 26
Language : Markup.

Back to top Go down

How to link a PHP variable to an image? (to create a Profile button) Empty Re: How to link a PHP variable to an image? (to create a Profile button)

Post by ClockWork July 7th 2011, 8:35 am

I hate making nav. bars. I always mess up.
avatar
ClockWork
New Member

Posts : 11
Reputation : 0
Language : English

https://i.servimg.com/u/f47/16/57/81/19/my_sig13.png

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum