By Mohammad Dourou on Monday, 01 January 2018
Posted in General Issues
Replies 11
Likes 0
Views 732
Votes 0
Manisha has explained to us that if a subscription expires, then the Mosets Tree directory listing attached to that subscription will get unpublished automatically.

I looked at the db table (jos_payplans_subscription), and tried to understand how the Payplan subscription and the Mosets Tree link_id are connected, and cannot find any relationship between them. I only find a relationship between the user_id and the subscription_id only (which means that the same user can have multiple subscriptions with multiple Mosets Tree listings) see screenshot http://prntscr.com/hupspl . Can you please explain to us how the exact link_id of the Mosets Tree is connected in the db with the subscription_id? We're trying to understand this to customize a feature we want to make.

Thanks,
Mohammad
Hello Mohammad,

For mapping of mtree listing with restriction , you need to check in table named #_payplans_resource.
Here you can find the restricted id, with user_id and from which subscription it's associated.

Let me know if you have any query.
·
Tuesday, 02 January 2018 11:45
·
0 Likes
·
0 Votes
·
0 Comments
·
I don't know what zoo is. I think you meant Mosets Tree. We checked in the jos_payplans_resource table and cannot see this "restricted_id" you mentioned. See here the structure of the table we see: https://prnt.sc/huzul8

Here is the table we see: https://prnt.sc/huzubk
·
Tuesday, 02 January 2018 12:50
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

Can you please explain me details , where you want to use these restrictions , so i'll assist you .
·
Tuesday, 02 January 2018 13:03
·
0 Likes
·
0 Votes
·
0 Comments
·
I don't want to use restriction. I want to show on front side that which listing has added to which particular subscription on "mydasboard" page.

That's why i am finding a connection between subscription table and mtree listing table. I know there is connection with user_id but that is returning me all listings for that user, and i want listing for only particular subscription.

Let me know if you have any questions.
·
Tuesday, 02 January 2018 13:54
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello,

For this , you need to create dashboard widget app for mosetts tree app, it will show listing to user on dashbaord.
https://stackideas.com/docs/payplans/administrators/essentials/dashboard-widgets

Let me know if still your issue not resolved.
·
Tuesday, 02 January 2018 14:36
·
0 Likes
·
0 Votes
·
0 Comments
·
I already know about that dashboard widget, which will show all listing of user. But i am not looking for it. As i said in my earlier message, i want to show listing name in front of subscription. see here: http://prntscr.com/hv0niq

That's why i am looking for connection between subscription table and mtree listing table, so i can fire custom query there.

Hope now it is clear. Let me know if you have any questions.
·
Tuesday, 02 January 2018 15:07
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Mohammad,

The only way to know the mapping on category and subscription as per mtree app is resource table.
We don't store listing id with subscription. We just store category id, userid and subscription id in payplans resource table.

Let me know if you still have any confusion.
·
Tuesday, 02 January 2018 17:40
·
0 Likes
·
0 Votes
·
0 Comments
·
Manisha, you mentioned to me before that when a subscription ends, the mosets tree listing gets unpublished. If resource table doesn't store the listing id with subscription, then how do you know which one to unpublish? There may be multiple listings and multiple subscriptions for the same user.
·
Wednesday, 03 January 2018 03:15
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Mohammad,

We just maintain the count and category id, according to count we unpublish the categories.
Also compare the feature lists and publish list , as per app configuration we will unpublish them.
You can see in function named _publishUnpublishList

Update me if you have any confusion.
·
Wednesday, 03 January 2018 11:18
·
0 Likes
·
0 Votes
·
0 Comments
·
It seems like you're confusing "categories" with "listings" link ID. I did not mention the word "Categories" in any part of my question. I am only interested in knowing how you unpublish MT Listings (not categories) when the subscription is cancelled or expires.

I don't have any restrictions on categories and don't plan to ever.

So few questions based on your last response:
1) What is the "count" column in resource table counting?
2) Where is the function "_publishUnpublishList" located? which file? and path?

If you're confused, just message me on Skype and we can talk!
·
Wednesday, 03 January 2018 12:42
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Mohammad,

Sorry for the confusion.

1) What is the "count" column in resource table counting?
# If you have set count to 100 in app configuration it means , 100 listing user can add (if subscription is active).
When user try to add listing then first we check that how many listing is allowed in app (if app is created).

2) Where is the function "_publishUnpublishList" located? which file? and path?
# The function located at root/system/mtreepayplans/mtreepayplans/app/mtree/mtree.php.
See attached screen shot.

Workflow of app : When subscription will get expire then we count the number of listing (published as well as featured) of that user (if applied on particular category then select user listing of that category).
Then we compare the count with the number of allowed count set in app, if user created more listing then allowed listing then we unpublish the listing. See attached screen shot. We don't maintain the listing id with subscription id, we just maintain the number of count allowed for listing. We count the listing and publish/unpublish them as per the app configuration.

Let me know if still have any confusion.
·
Wednesday, 03 January 2018 14:02
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post