Keyword

Adding new input in user's account

  • Mikołaj Baczyński
  • Mikołaj Baczyński's Avatar Topic Author
  • Offline
  • New Member
More
9 years 7 months ago - 9 years 7 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:
<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): ?>
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.
Last edit: 9 years 7 months ago by Mikołaj Baczyński.

Please Log in or Create an account to join the conversation.

  • Mohamed Abdelaziz
  • Mohamed Abdelaziz's Avatar
  • Offline
  • Platinum Member
  • Joomla Developer
More
9 years 7 months ago #140939 by Mohamed Abdelaziz
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

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
  • Mikołaj Baczyński's Avatar Topic Author
  • Offline
  • New Member
More
9 years 7 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 :))

Please Log in or Create an account to join the conversation.

  • Mikołaj Baczyński
  • Mikołaj Baczyński's Avatar Topic Author
  • Offline
  • New Member
More
9 years 7 months ago - 9 years 7 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
<?php echo $this->user->event->K2UserDisplay; ?>

But now I checked and icons shows only when I'm loged in. Any ideas? :))
Last edit: 9 years 7 months ago by Mikołaj Baczyński.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 7 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?

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Mikołaj Baczyński
  • Mikołaj Baczyński's Avatar Topic Author
  • Offline
  • New Member
More
9 years 7 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?

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 7 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.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Mikołaj Baczyński
  • Mikołaj Baczyński's Avatar Topic Author
  • Offline
  • New Member
More
9 years 7 months ago - 9 years 7 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: 9 years 7 months ago by Mikołaj Baczyński.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 7 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.
<?php echo $this->item->event->K2UserDisplay; ?>

As for the styling the changes can be applied to your template's stylesheet.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Mikołaj Baczyński
  • Mikołaj Baczyński's Avatar Topic Author
  • Offline
  • New Member
More
9 years 7 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
<?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.


Powered by Kunena Forum