Tribe Support

In this group #Anahita Tribe members provide support and help each other out. All the posts must be public on this group. #support

Stories

Nick Swinford

Nick Swinford commented on the topic

How can I display the login for in a template file?

I want to display the login form in a template file in a custom component, but every thing I've tried so far has given me an error. Currently, I have:

Loading ...

If you don't set the format, you get...

Read More

I want to display the login form in a template file in a custom component, but every thing I've tried so far has given me an error. Currently, I have:

Loading ...

If you don't set the format, you get an error about the user not being logged in. It currently returns a form template not found error.

Any ideas? Thanks.

Read Less
I'm building an component where a user can either login or continue along as a guest. If that's not possible currently, I think I'll just provide links to the login page.
Rastin Mehr liked this
Rastin Mehr

Rastin Mehr commented on the topic

How can I display the login for in a template file?

I want to display the login form in a template file in a custom component, but every thing I've tried so far has given me an error. Currently, I have:

Loading ...

If you don't set the format, you get...

Read More

I want to display the login form in a template file in a custom component, but every thing I've tried so far has given me an error. Currently, I have:

Loading ...

If you don't set the format, you get an error about the user not being logged in. It currently returns a form template not found error.

Any ideas? Thanks.

Read Less
At this point perhaps just duplicate the form in your component. To make the form reusable we need to define it as a ui element. You are trying to access it via the session controller and that could really complicate ... Read More
At this point perhaps just duplicate the form in your component. To make the form reusable we need to define it as a ui element. You are trying to access it via the session controller and that could really complicate things.

Any reasons you are duplicating the login form? You can redirect guest users to the form and then return them back to where they were in your component once they're logged in. Read Less
Nick Swinford

Nick Swinford started a topic

How can I display the login for in a template file?

I want to display the login form in a template file in a custom component, but every thing I've tried so far has given me an error. Currently, I have:

Loading ...

If you don't set the format, you get...

Read More

I want to display the login form in a template file in a custom component, but every thing I've tried so far has given me an error. Currently, I have:

Loading ...

If you don't set the format, you get an error about the user not being logged in. It currently returns a form template not found error.

Any ideas? Thanks.

Read Less
Rastin Mehr

Rastin Mehr commented on the topic

Access for notes set to public on private groups

I have a group that's set so only followers can see the profile and only admins can add new users. For all the social apps, only followers can add or comment.

I've been looking at the database thoug...

Read More

I have a group that's set so only followers can see the profile and only admins can add new users. For all the social apps, only followers can add or comment.

I've been looking at the database though and I see that notes still have their access set as public. For all other medium nodes, their access is set to followers. I can't seem to figure why this is happening only for notes.

Which permission defines the access level of new nodes? Is there anyway to set the default access level for new notes for a group to followers?

Thanks.

Read Less
Rastin Mehr
Rastin Mehr
April 28 2017 Permalink
Another approach would be getting the ids of all the actors whose stories you want to follow and build a feed for them. That should work nicely with the current architecture of Anahita.
Nick Swinford

Nick Swinford and Rastin Mehr commented on the topic

Access for notes set to public on private groups

I have a group that's set so only followers can see the profile and only admins can add new users. For all the social apps, only followers can add or comment.

I've been looking at the database thoug...

Read More

I have a group that's set so only followers can see the profile and only admins can add new users. For all the social apps, only followers can add or comment.

I've been looking at the database though and I see that notes still have their access set as public. For all other medium nodes, their access is set to followers. I can't seem to figure why this is happening only for notes.

Which permission defines the access level of new nodes? Is there anyway to set the default access level for new notes for a group to followers?

Thanks.

Read Less
That's what's suppose to be happening and I believe that's what's intended here:

https://github.com/anahitasocial/anahita/blob/4732bfd1325fa6728e21f17e7fce5811d5f4fa55/src/site/components/com_medium/domains/behaviors/privatable.php#L54

But after some exhaustive debugging, I've found an odd behavior. When the @col(owner.id) and @col(owner.access) are processed through AnDomainQueryHelper::processColumn they are converted to subject.id and subject.access. Instead of checking the access on the story owner, it's checking access on the story subject.

I can't seem to figure out why this is happening and what's causing the issue is because after the third nested AnDomainQueryHelper::processColumn I loose my mind.

This wouldn't normally be an issue because the dashboards are filtered to either leaders or a singular owner, but my users have been clambering for a dashboard that shows stories from the entire site and not just their leaders. I've almost gotten everything figured out, but stories from notes on private groups are throwing a wrench into the works.

I noticed something odd while debugging this. This $result will never be returned. https://github.com/anahitasocial/anahita/blob/4732bfd1325fa6728e21f17e7fce5811d5f4fa55/src/libraries/anahita/domain/query/helper.php#L192 Read Less
Rastin Mehr
Rastin Mehr
April 26 2017 Permalink
I remember when we were implementing the feeds we were also asked to have a feed that showed everything and we realized not having at least one owner id was messing up the privacies.

We didn't implement it, becaus... Read More
I remember when we were implementing the feeds we were also asked to have a feed that showed everything and we realized not having at least one owner id was messing up the privacies.

We didn't implement it, because the feature was going against the Anahita design philosophy. Stories are coming from actors via the social graph. If you aren't following an actor, you aren't supposed to see the stories, because there isn't an edge connecting you to that actor. Building a feed that showed all the created stories was like submerging a network in water and short circuiting all the nodes.

I don't know the answer at this moment. This requires me to take the time and go over the code that we wrote quite some time ago and see what's going on. Read Less
Everything's working perfect, other than notes. The only issue with notes is that they don't have their access set. All other medium nodes have the access dropdown in their form and this sets the access. With notes th... Read More
Everything's working perfect, other than notes. The only issue with notes is that they don't have their access set. All other medium nodes have the access dropdown in their form and this sets the access. With notes tho, since we use them for private messages, they only have two access values, public or the ids of the users involved in a private messages.

I know this is a complicated issue. I don't expect an answer, just your insights are helpful enough. I'll figure something out. Thank you. Read Less
Rastin Mehr
Rastin Mehr
April 26 2017 Permalink
Have you tried overwriting the privatable behaviour in your component and changing the logic?
Rastin Mehr
Rastin Mehr
April 26 2017 Permalink
the private messages ones need to remain private anyways. The one's with public access are always public unless if the owner is private in which case the notes should stay private. Why don't you try overwriting the pr... Read More
the private messages ones need to remain private anyways. The one's with public access are always public unless if the owner is private in which case the notes should stay private. Why don't you try overwriting the privatable in your component and basically filter out all but public media nodes? Read Less
Rastin Mehr

Rastin Mehr commented on the topic

Access for notes set to public on private groups

I have a group that's set so only followers can see the profile and only admins can add new users. For all the social apps, only followers can add or comment.

I've been looking at the database thoug...

Read More

I have a group that's set so only followers can see the profile and only admins can add new users. For all the social apps, only followers can add or comment.

I've been looking at the database though and I see that notes still have their access set as public. For all other medium nodes, their access is set to followers. I can't seem to figure why this is happening only for notes.

Which permission defines the access level of new nodes? Is there anyway to set the default access level for new notes for a group to followers?

Thanks.

Read Less
Rastin Mehr
Rastin Mehr
April 25 2017 Permalink
I need to look in the code, but from what I remember, Anahita first checks with the Owner's privacy settings before checking the media nodes privacy setting.
Nick Swinford

Nick Swinford started a topic

Access for notes set to public on private groups

I have a group that's set so only followers can see the profile and only admins can add new users. For all the social apps, only followers can add or comment.

I've been looking at the database thoug...

Read More

I have a group that's set so only followers can see the profile and only admins can add new users. For all the social apps, only followers can add or comment.

I've been looking at the database though and I see that notes still have their access set as public. For all other medium nodes, their access is set to followers. I can't seem to figure why this is happening only for notes.

Which permission defines the access level of new nodes? Is there anyway to set the default access level for new notes for a group to followers?

Thanks.

Read Less
Rastin Mehr

Rastin Mehr shared a note

How's the upgrade to 4.3.5 going? Please report any issues or bugs so we can fix them.

Mohamed Abdi and Rastin Mehr commented on the topic

How do we modify the order of the results for a global search?

Hi Rastin Mehr, I wanted to know how the profiles that are result of a global search can be ranked by modifying the php class that handles the database query.  I want to be able to display the resu...

Read More

Hi Rastin Mehr, I wanted to know how the profiles that are result of a global search can be ranked by modifying the php class that handles the database query.  I want to be able to display the results of a string search in way that orders them by database attributes of said profile e.g. show the profiles of users in the same city first. 

Thanks Mo

Read Less
PS Can you tell us the path of that php file?
Rastin Mehr
Rastin Mehr
April 14 2017 Permalink
The search is handled by the com_search component. More than one classes are involved to make the search happen. The query class is here:

https://github.com/anahitasocial/anahita/blob/master/src/components/com_sear... Read More
The search is handled by the com_search component. More than one classes are involved to make the search happen. The query class is here:

https://github.com/anahitasocial/anahita/blob/master/src/components/com_search/domains/queries/node.php

and of course this is the controller https://github.com/anahitasocial/anahita/blob/master/src/components/com_search/controllers/search.php

I don't recommend touching any of those files. The com_search is functioning independently which means you can choose to build your own alternative com_search or com_searches and implement your own unique logic. Right now if you pass the nearby parameters the results will be filtered based on the viewer's obtained location. Isn't that enough for your purpose? Read Less

Mohamed Abdi started a topic

How do we modify the order of the results for a global search?

Hi Rastin Mehr, I wanted to know how the profiles that are result of a global search can be ranked by modifying the php class that handles the database query.  I want to be able to display the resu...

Read More

Hi Rastin Mehr, I wanted to know how the profiles that are result of a global search can be ranked by modifying the php class that handles the database query.  I want to be able to display the results of a string search in way that orders them by database attributes of said profile e.g. show the profiles of users in the same city first. 

Thanks Mo

Read Less

Hunter Wilkes and Rastin Mehr commented on the topic

How to make a custom app

As I said earlier, I would like to make gadget that will display suggestions on dashboard. I was wondering if anyone had any pointers they could give me on the process of making a custom app and ga...

Read More

As I said earlier, I would like to make gadget that will display suggestions on dashboard. I was wondering if anyone had any pointers they could give me on the process of making a custom app and gadget.

Thanks

Hunter

#HowTo #CustomApp #AppDevelopment

Read Less
Where is the query for $context->query in Todo's _actionBrowse($context) coming from? I don't see it in KCommandContext, KConfig, or KConfigInterface.
I'm still confused. To me, it doesn't look like $context-query should ever return something, since I don't see query as a member of KCommandContext or any of the classes it is inheriting from. I'm not incredibly famil... Read More
I'm still confused. To me, it doesn't look like $context->query should ever return something, since I don't see query as a member of KCommandContext or any of the classes it is inheriting from. I'm not incredibly familiar with php, but it seems like one of those classes should have a query member, if you're accessing it with the -> operator. Am I mistaken? Read Less
Rastin Mehr
Rastin Mehr
April 13 2017 Permalink
$context-query holds the query object which is an instance of the AnDomainQuery class https://github.com/anahitasocial/anahita/blob/master/src/libraries/anahita/domain/query/query.php You use it to construct a query a... Read More
$context->query holds the query object which is an instance of the AnDomainQuery class https://github.com/anahitasocial/anahita/blob/master/src/libraries/anahita/domain/query/query.php You use it to construct a query and you can add more arguments and conditions to it in the child controller classes.

What are you trying to do? Read Less
Nothing yet, I was just reading through the code and got confused at that part. I couldn't figure out where it was coming from, so I figured I'd just ask.
Rastin Mehr
Rastin Mehr
April 13 2017 Permalink
I think to make matters less confusing it would be better if you focus on what problem you are about to solve and use the API and the code examples in the apps to make it happen. At first you many not know what happen... Read More
I think to make matters less confusing it would be better if you focus on what problem you are about to solve and use the API and the code examples in the apps to make it happen. At first you many not know what happens underneath the app API and at the framework level and that's ok.

Anahita is the result of 4+ years of development and understanding the code at the framework level could take you months. You can however build apps without knowing the underlying magic within days. Gradually as you are developing more sophisticated apps, you can go to the deeper layers of the framework code and make sense of it over time.

You can always post your questions here. We have people here with little technical background who have successfully launched their projects with a few custom components and extensions. You can do that too. Read Less
Rastin Mehr

Rastin Mehr commented on the topic

How to make a custom app

As I said earlier, I would like to make gadget that will display suggestions on dashboard. I was wondering if anyone had any pointers they could give me on the process of making a custom app and ga...

Read More

As I said earlier, I would like to make gadget that will display suggestions on dashboard. I was wondering if anyone had any pointers they could give me on the process of making a custom app and gadget.

Thanks

Hunter

#HowTo #CustomApp #AppDevelopment

Read Less
Rastin Mehr
Rastin Mehr
April 12 2017 Permalink
Hunter, to start I recommend you to look into the Todos and Topics apps:

https://github.com/anahitasocial/anahita/tree/master/packages/Todos/src
https://github.com/anahitasocial/anahita/tree/master/packages/Topics/src

They are two examples of Media publishing apps for Anahita. Then look into the Groups App:
https://github.com/anahitasocial/anahita/tree/master/packages/Groups/src

which is a good example of actor app in Anahita.

As you can see Anahita follows MVC design patterns in it's components. Anahita's Model is repository and domain entities. Anahita also places a graph architecture on top of the mysql database which is a relational database. An MVC triad is called a component. A package may contain multiple components.

Anahita supports component inheritance. For example media publishing apps (Todos, Topics, et.) are extending the com_medium. Groups and People apps both extend the com_actors component.

Anahita controllers have the main actions called BREAD (Browse, Read, Edit, Add, and Delete). For example _actionBrowse displays a list of entities or _actionRead displays an individual entity. There are two entities that you will be used most the time. Nodes and Graphs, because social networks are a network of nodes connect with graphs and some of the nodes exchanges messages (stories) that's why we call it the Nodes-Graphs-Stories architecture.

This is an old article the describes Anahita's lingo

Anahita Lingo

Learn the Anahita lingo and terms

this article describes what an actor node is

The Actor Manifesto

Defining an Actor in Anahita

now for building the suggestions app (components used directly by users) you don't even need to implement BREAD. Only the BR would do. The most challenging part is implementing the algorithm where each request checks the viewer against the list of conditions that I posted for you earlier and comes up with 1 or multiple suggestions https://www.getanahita.com/topics/161217-suggest-friends#scroll=161353
I don't know how to implement it yet until I sit down and code it myself. It is one of the apps on our 4.* road map.

So start code reading and try building an example app of your own which does a BREAD operation on a node entity. For example Blogs or Books, etc. Code reading and practicing is the best way to learn a new framework. Read Less
Hunter Wilkes liked this

Hunter Wilkes started a topic

How to make a custom app

As I said earlier, I would like to make gadget that will display suggestions on dashboard. I was wondering if anyone had any pointers they could give me on the process of making a custom app and ga...

Read More

As I said earlier, I would like to make gadget that will display suggestions on dashboard. I was wondering if anyone had any pointers they could give me on the process of making a custom app and gadget.

Thanks

Hunter

#HowTo #CustomApp #AppDevelopment

Read Less
Rastin Mehr

Rastin Mehr shared a note

Keep me informed of how your upgrades to Anahita 4.3.5 go. A lot of issues that you have reported regarding custom templates and language packages are resolved. Also the JQuery parallax plugin is n... Read More
Keep me informed of how your upgrades to Anahita 4.3.5 go. A lot of issues that you have reported regarding custom templates and language packages are resolved. Also the JQuery parallax plugin is now part of the core library for now, so you don't have to import it in your custom templates. We don't know the makeup of 4.4 javascript library is going to be yet until it is ready. Also we have further optimized the code so enjoy the bit of extra speed. Read Less
Rastin Mehr

Rastin Mehr shared a note

Anahita 4.3.5 Birth release is out. It's time to update your installations because there are critical bug fixes in this release as well as significant performance boost. Our special thangs go to @s... Read More
Anahita 4.3.5 Birth release is out. It's time to update your installations because there are critical bug fixes in this release as well as significant performance boost. Our special thangs go to @scott and @NicholasJohn16 for the extensive testing, feedbacks, bug reports, and contributing PRs on Github. Their contribution and attention made a big difference. Read Less
Nick Swinford liked this
Rastin Mehr

Rastin Mehr commented on the topic

Use of "noreply@" email for notifications?

I'm curious what thoughts are in regards to using "noreply@..." emails for the notifications.  All my notifications coming from getanahita are treated as spam, and after researching a bit it seems ...

Read More

I'm curious what thoughts are in regards to using "noreply@..." emails for the notifications.  All my notifications coming from getanahita are treated as spam, and after researching a bit it seems the "noreply" from address is often, if not typically, treated as such by gmail, outlook, etc.

I am currently running a separate email account for my project, the address of which I have set the Site Settings to utilize.  I can though see the point of the email address itself conveying that what is being sent is informational only - e.g., no reply is to be expected - however I'm not crazy about the notifications defaulting to being treated as spam.

Thoughts?  Suggestions?

#mailnotifications

Read Less
Rastin Mehr liked this
Rastin Mehr
Rastin Mehr
April 09 2017 Permalink
I just changed the email to notification@getanahita.com to see if it would make a difference. I am also thinking of ways to reduce the number of email notifications. I don't think they serve much purpose unless import... Read More
I just changed the email to notification@getanahita.com to see if it would make a difference. I am also thinking of ways to reduce the number of email notifications. I don't think they serve much purpose unless important information is sent out such as password reset links. An alternative would be browser push notifications. Companies like https://onesignal.com are offering free unlimited packages for PNs. Read Less
Rastin Mehr

Rastin Mehr commented on the topic

mailAdmins available to com_pages?

I noticed in the com_mailer that the mailer.php behavior includes a function for mailAdmins, which I see is used, for example, by the com_people controller.

Would the mailAdmins funtion also availab...

Read More

I noticed in the com_mailer that the mailer.php behavior includes a function for mailAdmins, which I see is used, for example, by the com_people controller.

Would the mailAdmins funtion also available for use via com_pages?  I would assume a plugin would be required, but the intent would be a very lightweight contact form where the form is rendered via a com_pages page, and the submit button triggers the mailAdmins function.

I see the com_pages content controller primarily deals with the content path(s) being rendered... if a 'contact' plugin would be required, would it be correct to extend the ComPagesControllerPage class?

Read Less
Rastin Mehr
Rastin Mehr
April 09 2017 Permalink
com_pages is not intended to handle POST requests; only GET requests.
Rastin Mehr
Rastin Mehr
April 09 2017 Permalink
But you can make a component and make an ajax POST request to that component from any of the pages.
Unkown Person liked this
Nick Swinford

Nick Swinford commented on the topic

mailAdmins available to com_pages?

I noticed in the com_mailer that the mailer.php behavior includes a function for mailAdmins, which I see is used, for example, by the com_people controller.

Would the mailAdmins funtion also availab...

Read More

I noticed in the com_mailer that the mailer.php behavior includes a function for mailAdmins, which I see is used, for example, by the com_people controller.

Would the mailAdmins funtion also available for use via com_pages?  I would assume a plugin would be required, but the intent would be a very lightweight contact form where the form is rendered via a com_pages page, and the submit button triggers the mailAdmins function.

I see the com_pages content controller primarily deals with the content path(s) being rendered... if a 'contact' plugin would be required, would it be correct to extend the ComPagesControllerPage class?

Read Less
I currently just use https://formspree.io/ in a page for a contact page.

It would depend where you're submitting the contact form to (ei the form action). Sending the contact form to the main page controller prolly... Read More
I currently just use https://formspree.io/ in a page for a contact page.

It would depend where you're submitting the contact form to (ei the form action). Sending the contact form to the main page controller prolly wouldn't be the best idea. Read Less
Rastin Mehr

Rastin Mehr commented on the topic

User registration plugin

I'm trying this week to refactor a legacy registration plugin to be compliant with the 4.3.3 codebase; it had relied a bit on Joomla mainframe & other Joomla syntax.  Few questions:

  1. The plugin vali...

Read More

I'm trying this week to refactor a legacy registration plugin to be compliant with the 4.3.3 codebase; it had relied a bit on Joomla mainframe & other Joomla syntax.  Few questions:

  1. The plugin validations need to be performed prior to allowing the user to register, so is this best implemented as a 'system' plugin or a 'user' plugin ?
  2.  I see in the system/anahita.php plugin PlgAnahitaDefault class there are functions referenced for onAfterStoreUser and onBeforeDeleteUser ... is there one for onBeforeStoreUser already existing that can be accessed ?
  3. I had previously obtained the form variables using JRequest::getVar( 'variableName' ) syntax... how should these be picked up now that Joomla is removed ?
#plugin #events

Read Less
Rastin Mehr
Rastin Mehr
April 07 2017 Permalink
Why not? And yes there is no user object anymore. Viewer is the person object.

Although I like what the guys at Timble have done which is getting rid of plugins all together. All controllers have before and after ... Read More
Why not? And yes there is no user object anymore. Viewer is the person object.

Although I like what the guys at Timble have done which is getting rid of plugins all together. All controllers have before and after calls for their actions. Read Less
Unkown Person liked this
Rastin Mehr
Rastin Mehr
April 07 2017 Permalink
Plugins are hooks to intercept the execution process and get some tasks done. Plugins such as the authentication allow alternative ways of authenticating such as checking with a company's user database. Although we ca... Read More
Plugins are hooks to intercept the execution process and get some tasks done. Plugins such as the authentication allow alternative ways of authenticating such as checking with a company's user database. Although we can improve the overall architecture to support before and after calls for every action in a controller and also allow a component to inject behaviours to another component's controllers. This way we can gradually phase out the plugins and rely on components only. Read Less
Unkown Person liked this
Nick Swinford

Nick Swinford and Rastin Mehr commented on the topic

get_viewer()

I'm seeing get_viewer() being called, but I can't seem to find where it's defined. Could someone either tell me what it does or where it's defined?Thanks,

Hunter

I use WAMP on Windows to develop local. It's really a huge performance boost than working remotely.

No matter what, you should install an Integrated Development Environment (IDE). I've used Atom in the past which i... Read More
I use WAMP on Windows to develop local. It's really a huge performance boost than working remotely.

No matter what, you should install an Integrated Development Environment (IDE). I've used Atom in the past which is free and pretty good. I use Sublime Text which I love, but does cost $75.

You should download or git clone the anahita repo localy, create a project in the IDE, and from there you'll be able to do full text search of all the files. It makes it a lot easier to figure out where functions are defined and how everything works. Read Less
Rastin Mehr
Rastin Mehr
April 07 2017 Permalink
I use PhpStorm and Atom. I find myself using Atom more and more for both mobile and Anahita development.
@Scott, cp is a Linux command and there's no such command on Windows so the installer fails using the Command Prompt. You have to either install Cygwin or use a Linux dev enviroment. I use Cygwin.

Anahita CLI is a ... Read More
@Scott, cp is a Linux command and there's no such command on Windows so the installer fails using the Command Prompt. You have to either install Cygwin or use a Linux dev enviroment. I use Cygwin.

Anahita CLI is a bit buggy on Windows. I've tried patching things here and there as I find them, but there's a good amount of work to make it really cross platform. Read Less
Rastin Mehr liked this
Rastin Mehr
Rastin Mehr
April 07 2017 Permalink
We've gone way off topic here :) I think a vagrant box solution would be better similar to this https://github.com/joomlatools/joomlatools-vagrant that is something I'd like to accomplish if time allows.
@Scott, be sure to launch Cygwin as an Administrator.
Unkown Person liked this

Photos View All

Articles View All

Topics View All

Powered by Anahita