TOPIC:

zeige user realname im Introtext 4 years 5 months ago #183649

  • Topic Author
  • hartmuts1
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 9
  • Thanks: 0
Ich habe einen frontend-view mit "Nur eigene Einträge".
Ich möchte im Introtext der Listen-Ansicht den user realname darstellen, siehe Anhang.
Wie und wo kann ich den entsprechenden <?php > schnipsel einfügen?
Attachments:

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

zeige user realname im Introtext 4 years 5 months ago #183687

  • Tihomir's Avatar
  • Tihomir
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 3564
  • Karma: 87
  • Thanks: 288
Hello,

sry for answering on english. Hope you will understand all the following steps.

First, locate this file in : ROOT\components\com_contentbuilder\views\list\tmpl\default.php

Once you found it , open this file and around the line (113 ) , right after this tag : <div class="cbListView<?php echo $this->page_class; ?>"> copy the following code and test it :
 <?php
    $user = JFactory::getUser();
 
if (!$user->guest) {
  echo 'You are logged in as:<br />';
  echo 'User name: ' . $user->username . '<br />';
  echo 'Real name: ' . $user->name . '<br />';
  echo 'User ID  : ' . $user->id . '<br />';
}
    
    ?>

As you can see, the code above shows username , name and id of the currently logged-on user . In case that you want to show only name of current user , then simply delete username and id.

Pls , let us know if that worked for you.

Kind regards
Tihomir
===============================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
===============================================
Regards
Tihomir
==========================================
+++ Purchase Professional Support: crosstec.org/en/support/purchase-additional-support.html +++

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

Last edit: Post by Tihomir.

zeige user realname im Introtext 4 years 5 months ago #183747

  • Topic Author
  • hartmuts1
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 9
  • Thanks: 0
thanks Tihomir,
it works, but now user infos are shown in all of my list forms, which is not exactly what I need. Actually, I'd like to have variables in a specific listviews intro-text, like {username}, anyhow.

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

zeige user realname im Introtext 4 years 5 months ago #183752

  • pedro81's Avatar
  • pedro81
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 15273
  • Karma: 287
  • Thanks: 1077
Hi,

and do you want it in only one view or in some list views?

can you please send us a link to this view?

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

zeige user realname im Introtext 4 years 5 months ago #183756

  • Tihomir's Avatar
  • Tihomir
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 3564
  • Karma: 87
  • Thanks: 288
Hi,

if you want to show these informations only for certain list view , then follow the next steps.

1) download php plugin which enables you to place PHP right into your content : extensions.joomla.org/extension/sourcerer

2) once you do it , go to the list view > list intro text tab >and put the following code into the editor
{source} <?php
$user = JFactory::getUser();

if (!$user->guest) {
echo 'You are logged in as:
';
echo 'User name: ' . $user->username . '
';
echo 'Real name: ' . $user->name . '
';
echo 'User ID : ' . $user->id . '
';
}

?>
{/source}

Pls let us know if it works for you.

Kind regards
Tihomir
===============================================
Support Crosstec and get ALL EXTENSIONS and professional support for just $5
Here!
===============================================
Regards
Tihomir
==========================================
+++ Purchase Professional Support: crosstec.org/en/support/purchase-additional-support.html +++

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

Last edit: Post by Tihomir.

zeige user realname im Introtext 4 years 5 months ago #183825

  • Topic Author
  • hartmuts1
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 9
  • Thanks: 0
ok, yes, this is much closer to what I want to achieve, but seams not to work outside of articles in the free version. Seams I have to spend 150 bugs for the pro version, which is not worth to me. And, as a general extension, sourcerer would apply to all joomla elements and by this cause some security issues - just a guess. Anyway, I'll try to reorganize my site a bit and avoid the need at all. Thanks for helping.

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

  • Page:
  • 1
  • 2
Time to create page: 0.054 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!