• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Fabrik - PHP - and Joomla Article

javier94

Member
i'm using joomla + fabrik component...

So in article i try using PHP get some datas from fabrik database.

If the user is registered.. i can see the datas.. but if i try, see the same datas with a not registered user, i can not see nothing.. although i see the article but empty only the title or print icons, or mail.. not fabrik datas. and the menu associated to this joomla article is public

What can i do..

i haver read a J2XML pluguin will solve this.. Any suggestion about??

Thanks

Javier
 
Last edited:
What is "some datas from fabrik database"? List? Form? Details? Individual element(s)?

"...i can see the datas" -- how? Fabrik content plugin? Or else?

"... see the same datas with a not registered user, i can not see nothing" -- indicates that "the datas" have ACL set for registered users only, not guests? Double-check?

However, you can always use an extension such as Sourcerer or similar and a database query to select and display anything from the database in your articles.
 
Maybe my explanation was not complete.. i explain more in detail.

The idea is, i have a link that i give to some "non registerers users", for example a link like this created as a registered user.

https://qrmenudigital.com/index.php?option=com_content&view=article&id=32&uid=969

as you see in the link, the link have the article_id and the user_id

so this link would allow to everybody that has this link.. see the article... the item menu for this article is "public"

till here... would be ok.. not troubles..
----------------

I try to create a dinamic article --> will create a different content article for each user_id registered..

So, one option i try is --> Use the PHP to extract information from some fabrik elements i try to get a "name of establecimiento" for example.

The code PHP use for that in the article is. (I not use a plugin, i found a {source}{/source}to insert php in the article)

source}<?php
$user = JFactory::getUser();
$userId = $user->get('id');
$db = JFactory::getDbo();
$query = $db->getQuery(true);
//echo $userId;
$query->select($db->quoteName(array('nombre_establecimiento', 'user_id',)))
->from($db-&gt;quoteName('insertar_logo'))
->where($db-&gt;quoteName('user_id') . ' = ' . $userId);
$db->setQuery($query);
$results = $db->loadAssocList();
foreach ($results as $rows) {
echo "<center>";
//echo "<img src='images/stories/" . $userId . "/image-1.png'>";
echo "<H1>" . $rows['nombre_establecimiento'] . "</H1>" . "<BR>";
echo "</center>";
}
?>
{/source}

------------

So, If i am registered, the article show me the ['nombre_establecimiento'] --> seem is working

But if i'm not registered and i use the link.. i see the article title, but not content from fabrik
----

i think the trouble is.. when i put the link.. the article don´t know which user_id is.. so can not extract the fabrik datas


One option would be --> How can i relate the link with the php code article... so the article will know which user_id is.. and i hope will show the fabrik info.

Or if you have other ideas to obtain the same, would be welcome

Any suggestions?

Many thanks in advance!

Javier
 
Not sure what you want to achieve.
All visitors not logged in are no "users" with a userid but guests (with userid 0).
 
what i want to achieve is:

i have a url -- i give this url to anybody (non registered user) -- and this person click on the url and can see 1 article --from a registered user.

this is why in the url.. I include the article_id and the user_id from the registered user.

(the non registered user, that will have the url --> only would access to 1 article of 1 registered user )

So first i created the url -- to link with the dinamic article -- that we will show to the non registered users.

Which trouble appears.

the article is dinamic.. will show a different information depending of which registered user filled the information previosly, for that i use the PHP and extract the fabrik information depending of the registered user.

so the dinamic article, if you are logged, you have the user_id.. and the PHP code .. show the information.

if you are not logged.. not user_id . .. not information.

The point is.. how can i add the user_id in the article...if the user is not logged.. to allow the public user see the content of this article.

maybe using the url???? or maybe there is other option??

Now, You understand what happend?

Thanks in advance!

javier
 
:confused:If the data you want to show is not related to the userid of the logged-in user but to any userid then you must let the visitors select which data they want to see, e.g. a list of names or pictures or menu items with a link containing the respective userid
 
the Timeline action is.

1.- i have a url with article_id and user_id

2.- with this url -- i can give to anybody -- non registered users -- not logged people - public people - to use and see the datas of only 1 user ( the user added in the url with his user_id)

3.- when i click in the url --> should open the dinamic article (also added in the url with the article_id)

4.- the dinamic article will extract the datas using PHP of this user_id and will show a list of urls from this user_id (the datas are saving with a fabrik form previosly)

5.- if i click in each urls of the dinamic article generates --> I will open a form --> in details view only from 1 user_id

this time line runs is i'm registered... if i try without registerd... PHP dont know the user_id .. and i think this is why i didn´t see nothing

so how can i see datas as not registered user???
 
i have some troubles with the parameters, or the article, o when i try to insert the php code in the article.

I found a solution.. i create a php folder out .. and with the php, I generated the urls to see the form ..
once i have the urls. i create a link.. and with the link i can see the forms in detailview.

Moreover.. the previous url.. was too long.. now as the php folder is out.. the new url is shorter..
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top