- Posts: 6
COMMUNITY FORUM
Adding new input in user's account
- Mikołaj Baczyński
-
Topic Author
- Offline
- New Member
Less
More
10 years 2 months ago - 10 years 2 months ago #140935
by Mikołaj Baczyński
Adding new input in user's account was created by Mikołaj Baczyński
I would add new input on the "my accout" page, in K2 ofc. I added new column in mysql named "fb" with settings like in "url".
Next I added code in the profile.php like this:
And it works, I checkec and link which I pasted in this field shows in datebase.
Now, how can I show that link in another places? I tried on the user's page. But this is not working.
For now I want in order to make it works, but later I'll have to add something like:but I have to define somewhere value 'userFB' right?
In general, like you for sure noticed, I want to give authors possibility to paste their facebook page, which will appear under his name on the article page, or in other places.
I hope you can help me, I'm stuck :D
Best.
Next I added code in the profile.php like this:
<input type="text" size="50" value="<?php echo $this->K2User->fb; ?>" name="fb" id="fb"/>
And it works, I checkec and link which I pasted in this field shows in datebase.
Now, how can I show that link in another places? I tried on the user's page. But this is not working.
<span class="userFB">
<a href="<?php echo $this->user->profile->fb; ?>" target="_blank" rel="me">FACEBOOK</a>
</span>
For now I want in order to make it works, but later I'll have to add something like:
<?php if ($this->params->get('userFB') && isset($this->user->profile->fb) && $this->user->profile->fb): ?>
In general, like you for sure noticed, I want to give authors possibility to paste their facebook page, which will appear under his name on the article page, or in other places.
I hope you can help me, I'm stuck :D
Best.
Last edit: 10 years 2 months ago by Mikołaj Baczyński.
Please Log in or Create an account to join the conversation.
- Mohamed Abdelaziz
-
- Offline
- Platinum Member
- Joomla Developer
10 years 2 months ago #140939
by Mohamed Abdelaziz
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Replied by Mohamed Abdelaziz on topic Adding new input in user's account
Hi,
Why didn't you use the User Extended Fields plugin? www.joomlaworks.net/extensions/free/item/26-user-extended-fields-for-k2
Why didn't you use the User Extended Fields plugin? www.joomlaworks.net/extensions/free/item/26-user-extended-fields-for-k2
Multiple Extra Fields Groups for K2
AutoMeta for K2
Chained Fields for K2
More K2 Extensions In My Extensions Store
Please Log in or Create an account to join the conversation.
- Mikołaj Baczyński
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 6
10 years 2 months ago #140940
by Mikołaj Baczyński
Replied by Mikołaj Baczyński on topic Adding new input in user's account
Hi,
I didn't know that extension. I'll try it in a moment. This looks like something what I need. Thanks a lot :))
I didn't know that extension. I'll try it in a moment. This looks like something what I need. Thanks a lot :))
Please Log in or Create an account to join the conversation.
- Mikołaj Baczyński
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 6
10 years 2 months ago - 10 years 2 months ago #140948
by Mikołaj Baczyński
Replied by Mikołaj Baczyński on topic Adding new input in user's account
Looks fine on the users page, but what should I do if I want to show this on the item's page too?? This plugin have these dark icons, not these in color on the right corner.
authors page -> ideafortoday.com/all/workout/author/330-mikolajbaczynski
items page -> ideafortoday.com/all/date/visit-the-amusement-park
The funniest thing is, yesterday I did it and everything worked fine. I just copied code below from user.php and paste to item.php
But now I checked and icons shows only when I'm loged in. Any ideas? :))
authors page -> ideafortoday.com/all/workout/author/330-mikolajbaczynski
items page -> ideafortoday.com/all/date/visit-the-amusement-park
The funniest thing is, yesterday I did it and everything worked fine. I just copied code below from user.php and paste to item.php
<?php echo $this->user->event->K2UserDisplay; ?>
But now I checked and icons shows only when I'm loged in. Any ideas? :))
Last edit: 10 years 2 months ago by Mikołaj Baczyński.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 2 months ago #140973
by Krikor Boghossian
Replied by Krikor Boghossian on topic Adding new input in user's account
Did you use overrides, or did you edit directly K2's templates?
Please Log in or Create an account to join the conversation.
- Mikołaj Baczyński
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 6
10 years 2 months ago #140979
by Mikołaj Baczyński
Replied by Mikołaj Baczyński on topic Adding new input in user's account
I edited K2 directly, I know I should use overrides but I didn't know that earlier. Is it very important to use overrides? I can fix this.
You mean if I override this file, not edit it directly, social icons will show on the item's page?
You mean if I override this file, not edit it directly, social icons will show on the item's page?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 2 months ago #140992
by Krikor Boghossian
Replied by Krikor Boghossian on topic Adding new input in user's account
it is easier to determine if it is a bug and not an error in the overrides.
Finally if you do not override you will lose your changes when you override.
Finally if you do not override you will lose your changes when you override.
Please Log in or Create an account to join the conversation.
- Mikołaj Baczyński
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 6
10 years 2 months ago - 10 years 2 months ago #141009
by Mikołaj Baczyński
Replied by Mikołaj Baczyński on topic Adding new input in user's account
ANyway, maybe someone has an idea how to fix this? :)
Last edit: 10 years 2 months ago by Mikołaj Baczyński.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 2 months ago #141035
by Krikor Boghossian
Replied by Krikor Boghossian on topic Adding new input in user's account
Did you move your edits to the overrides?
Furtermore the item.php already contains the code show data from user plugins.
As for the styling the changes can be applied to your template's stylesheet.
Furtermore the item.php already contains the code show data from user plugins.
<?php echo $this->item->event->K2UserDisplay; ?>
As for the styling the changes can be applied to your template's stylesheet.
Please Log in or Create an account to join the conversation.
- Mikołaj Baczyński
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 6
10 years 2 months ago #141186
by Mikołaj Baczyński
Replied by Mikołaj Baczyński on topic Adding new input in user's account
Thanks Krikor. I deleted code which I added before and replaced it by
and later remove this code from default location in the file, to not double this.
<?php echo $this->item->event->K2UserDisplay; ?>
and later remove this code from default location in the file, to not double this.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
10 years 2 months ago #141275
by Krikor Boghossian
Replied by Krikor Boghossian on topic Adding new input in user's account
Hello,
Is it working?
Is it working?
Please Log in or Create an account to join the conversation.