Keyword

K2 User Module and it's links

  • mattian
  • mattian's Avatar Topic Author
  • Offline
  • Senior Member
More
11 years 9 months ago #107575 by mattian
K2 User Module and it's links was created by mattian
Hi,
I have disabled commenting on the site and also front-end item-posting for non-admin users. I still have links in the module for both editing "My comments" and "My items". Is this not a contradiction? Should those links not be hidden when a regular registered user signs in. It looks a bit funny to have them visible. How can I easily erase the extra links without hacking the module? Hack would just cause this issue to come again after updating the modules later on.

Please make this as a feature in the module!

- Anne

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

More
11 years 9 months ago #107576 by Peter Grube
Replied by Peter Grube on topic Re: K2 User Module and it's links
Hi Anne,

Probably the easiest fix would be to create a overide of the module then in userblock.php remove / comment out the line containing
Log in  or Create an account to join the conversation.

  • mattian
  • mattian's Avatar Topic Author
  • Offline
  • Senior Member
More
11 years 9 months ago #107577 by mattian
Replied by mattian on topic Re: K2 User Module and it's links
Hi,

thanks! But would there be any way to choose that non of the links in the K2 User module are showing? I could do all the needed links as a menu inside the module. There really needs to be a way to hide extra links without hacking. :(

- Anne

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

More
11 years 9 months ago - 11 years 9 months ago #107578 by william white
Replied by william white on topic Re: K2 User Module and it's links
Creating an override is not hacking but the intended way to customize the output of K2 and its associated modules etc.

the code
<ul class="k2UserBlockActions">
<?php if(is_object($user->profile) && isset($user->profile->addLink)): ?>
<li>
<a class="modal" rel="{handler:'iframe',size:{x:990,y:550}}" href="<?php echo $user->profile->addLink; ?>"><?php echo JText::_('K2_ADD_NEW_ITEM'); ?></a>
</li>
<?php endif; ?>
<li>
<a href="<?php echo JRoute::_(K2HelperRoute::getUserRoute($user->id)); ?>"><?php echo JText::_('K2_MY_PAGE'); ?></a>
</li>
<li>
<a href="<?php echo $profileLink; ?>"><?php echo JText::_('K2_MY_ACCOUNT'); ?></a>
</li>
<li>
<a class="modal" rel="{handler:'iframe',size:{x:990,y:550}}" href="<?php echo JRoute::_('index.php?option=com_k2&view=comments&tmpl=component'); ?>"><?php echo JText::_('K2_MODERATE_COMMENTS_TO_MY_PUBLISHED_ITEMS'); ?></a>
</li>
</ul>
can be modified as above in an override,
or you may be able to use css to hide the class k2userblockactions
or you may be able to edit the language files and replace the strings with ""

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

More
11 years 9 months ago #107579 by Peter Grube
Replied by Peter Grube on topic Re: K2 User Module and it's links
Hi Anne,

Overiding the module is very easy, here's one I already created you just have to put it in the HTML folder in your sites default template, if there is no HTML folder just create one and unzip the file inside.

I removed the comments link.


Attachment not found

Attachments:

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

  • mattian
  • mattian's Avatar Topic Author
  • Offline
  • Senior Member
More
11 years 9 months ago #107580 by mattian
Replied by mattian on topic Re: K2 User Module and it's links
Hi Peter,

thanks alot! the template does not have a html-folder so I'll add that. But does the module need to be in the same path that it would be in the root? In otherwords if the module would be in root/modules/mod_k2_user then do I need to create same paths in the mytemplate/html or can I just dump every html override directly to the html-folder?

I see this instruction regarding overrides and in the example there is make the path like this:
YOUR_TEMPLATE/html/com_virtuemart/productdetails/default.php for the example in the

Here's the conversation that I'm talking about:
forum.virtuemart.net/index.php?topic=90935.0

I'm not a coder, but can try to do that override if I know where exactly I need to put the new module-file.

Thanks for both of you your help!

- Anne

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

  • mattian
  • mattian's Avatar Topic Author
  • Offline
  • Senior Member
More
11 years 9 months ago #107581 by mattian
Replied by mattian on topic Re: K2 User Module and it's links
Hi Peter,

I can see it forms the needed paths when unzipping in the template/html-folder. Great!

If I want to erase all links, which file I need to edit? I have created a User Menu where I add all the links I want the user to be able to use (Virtuemart my orders, my details etc). No need to have K2 details or My articles since the is mainly for Virtuemart shoppers not for admins/K2 users.

- Anne

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

More
11 years 9 months ago #107582 by Peter Grube
Replied by Peter Grube on topic Re: K2 User Module and it's links
Hi Anne it's good to see you got it worked out the file is userblock.php.

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

  • mattian
  • mattian's Avatar Topic Author
  • Offline
  • Senior Member
More
11 years 9 months ago #107583 by mattian
Replied by mattian on topic Re: K2 User Module and it's links
Hi Peter,

yes, thanks!

I erased all the links that are by default in the K2 User module and also the comment counter line. And then added the User Menu and I add menu-links that I want. By using a user-menu I can also define some menuitems as special instead of them all showing to all.

Would be a good idea to change the K2 User Module in the future editions so that you can have an option to show/hide "Comment counter" - line and also an option to show/hide links (My comments, my items etc). The best would be to give an option to hide and show the ones you want one by one. I like the possibility to add a menu to the module since that way you can do your own links.

Thanks for you help, both of you!

- Anne

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

More
10 years 6 months ago #107584 by goble
Replied by goble on topic Re: K2 User Module and it's links
Hello Peter,

Sorry to reply on such an old post but I guess it's better than opening a new one with the same issue.

I'm using K2 v2.6.8 (Dev Build) and K2 Store 3.7.2 on J!3.2.1

K2 comments is disable and I want to get rid of "You have 0 published comments".

So I removed the following from /modules/mod_k2_user/tmpl/userblock.php
Log in  or Create an account to join the conversation.