castlamp / zenbership

(2015) Zenbership Membership Software: Achieve Membership Nirvana
Other
112 stars 58 forks source link

Installation folder not taken in account on some links #101

Open Jayme65 opened 7 years ago

Jayme65 commented 7 years ago

Hi, I've edited the 'config.php' file that way: define('PP_BASE_PATH','/home/mysite/public_html'); define('PP_PATH','/home/mysite/public_html/zenbership'); define('PP_URL','https://mysite.com/zenbership'); define('PP_ADMINPATH','/home/mysite/public_html/zenbership/admin'); define('PP_ADMIN','https://mysite.com/zenbership/admin');

I've edited the 'Company URL' in 'GENERAL Options' too: https://mysite.com

...but I can see that URL's from the menu are all missing the installation folder in path! So, for example, the 'News' link URL is 'https://mysite.com/news.php'...where it should be 'https://mysite.com/zenbership/news.php' (I know that I can edit those path in the menu section...but shouldn't it work right out of the box without editing those paths?)

The same (for example) for the URL that allow to change the user password after transaction: the installation folder path is missing from the path!

Another example: on the user manage page (https://mysite.com/mysite/manage/), two links at the top (the one that say 'Welcome tom@tom.com' and the 'News' link) are there 'https://mysite.com/zenbershipmanage' & 'https://mysite.com/zenbershipmanage'...with no way to edit them in the menu section that time!

At the contrary, the button for order, checkout and payment is correct and take the installation folder in account

What is to be done to be certain that the installation folder path will be added to every links?

Thank you very much!

dsnyder0li commented 7 years ago

Hi @Jayme65,

I started to say that I have not been able to reproduce this...but I see what you're talking about now. Seems like that should be easy to fix. The problem probably exists in the database.

-- David

Jayme65 commented 7 years ago

Thanks for the reply David! Do you intend to work on a fix for an upcoming version?

dsnyder0li commented 7 years ago

I'm not an official developer for Zenbership...just started playing with it this week! I think a few changes to setup/process.php would be easy. Allowing users to change the path for the site after installation may be a bit more work.

I may submit a pull request if @jbelelieu is open to accepting them still.

dsnyder0li commented 7 years ago

Since I'll be installing Zenbership alongside MyBB, I'm a bit more motivated to find a fix for this. Will let you know. :)

jbelelieu commented 7 years ago

You can edit menus from Content > Menus. I am looking into why the installation paths are incorrect on some installations.

dsnyder0li commented 7 years ago

Hi @jbelelieu ,

It looks like ppSD_widgets_menus needs to have the subdir prepended to the links.

mysql> select title,link from ppSD_widgets_menus;
+---------------------+-----------------------------+
| title               | link                        |
+---------------------+-----------------------------+
| Your Content        | /manage                     |
| Update Account      | /manage/update_account.php  |
| Announcements       | /manage/announcements.php   |
| Billing History     | /manage/billing_history.php |
| Subscriptions       | /manage/subscriptions.php   |
| Credit Cards        | /manage/credit_cards.php    |
| Invoices            | /manage/invoices.php        |
| Event Registrations | /manage/events.php          |
| Uploads             | /manage/uploads.php         |
| Logout              | /logout.php                 |
| News                | /news.php                   |
| Members             | /manage                     |
| Events              | /calendar.php               |
| Shop                | /catalog.php                |
| Cart                | /cart.php                   |
| Welcome %username%  | manage                      |
| News                | manage                      |
| Events              | /calendar.php               |
| Shop                | /catalog.php                |
| Cart                | /cart.php                   |
| Logout              | /logout.php                 |
+---------------------+-----------------------------+
21 rows in set (0.00 sec)

setup/process.php calls setup/mysql/inserts.php which looks like it's doing the right thing...but perhaps $use_url is not getting passed correctly?

$inserts[] = "
        INSERT INTO `ppSD_widgets_menus` (`widget_id`, `submenu`, `title`, `link`, `link_type`, `link_target`, `position`) VALUES
        ('user_manage_menu', 0, 'Your Content','" . $use_url . "/manage', 2, 'same', 1),
        ('user_manage_menu', 0, 'Update Account','" . $use_url . "/manage/update_account.php', 2, 'same', 2),
        ('user_manage_menu', 0, 'Announcements','" . $use_url . "/manage/announcements.php', 2, 'same', 3),
        ('user_manage_menu', 0, 'Billing History','" . $use_url . "/manage/billing_history.php', 2, 'same', 4),
        ('user_manage_menu', 0, 'Subscriptions','" . $use_url . "/manage/subscriptions.php', 2, 'same', 5),
        ('user_manage_menu', 0, 'Credit Cards','" . $use_url . "/manage/credit_cards.php', 2, 'same', 6),
        ('user_manage_menu', 0,  'Invoices','" . $use_url . "/manage/invoices.php',  2,  'same',  7),
        ('user_manage_menu', 0, 'Event Registrations','" . $use_url . "/manage/events.php', 2, 'same', 8),
        ('user_manage_menu', 0, 'Uploads','" . $use_url . "/manage/uploads.php', 2, 'same', 9),
        ('user_manage_menu', 0, 'Logout','" . $use_url . "/logout.php', 2, 'same', 10),
        ('site_topbar', 0, 'News','" . $use_url . "/news.php', 2, 'same', 1),
        ('site_topbar', 0, 'Members','" . $use_url . "/manage', 2, 'same', 2),
        ('site_topbar', 0, 'Events','" . $use_url . "/calendar.php', 2, 'same', 3),
        ('site_topbar', 0, 'Shop','" . $use_url . "/catalog.php', 2, 'same', 4),
        ('site_topbar', 0, 'Cart','" . $use_url . "/cart.php', 2, 'same', 5),
        ('site_topbar_logged_in', 0, 'Welcome %username%', 'manage', 2, 'same', 1),
        ('site_topbar_logged_in', 0, 'News', 'manage', 2, '" . $use_url . "/news.php', 2),
        ('site_topbar_logged_in', 0, 'Events','" . $use_url . "/calendar.php', 2, 'same', 3),
        ('site_topbar_logged_in', 0, 'Shop','" . $use_url . "/catalog.php', 2, 'same', 4),
        ('site_topbar_logged_in', 0, 'Cart','" . $use_url . "/cart.php', 2, 'same', 5),
        ('site_topbar_logged_in', 0, 'Logout','" . $use_url . "/logout.php', 2, 'same', 6);
";
slashrjl commented 7 years ago

The menu process assumes that any link starting with a '/' is an absolute URL, whereas any menu starting with a letter is relative to the subdir. Simply remove the initial '/' from each menu item and it will start working properly.

ghost commented 6 years ago

dsnyder0li - seems like something is not appropriate in the setup/process.php as I am getting error "internal 500" something. I just cant figure out what it is. db connects though. Is there any log somewhere I can see whats wrong. Any ideas?

dsnyder0li commented 6 years ago

@hapishyguy - Hmm...last few times that I've tried to deploy Zenbership, I have been unable to login, and the captcha for resetting the password has been broken as well (as in, a broken image). As a result, it has been a while since I have tried using Zenbership...what is super frustrating is that there are no useful logs.

Please let me know if you find a way to enable more verbose logging so that we can figure out what's going on in cases like what is being discussed in this thread...and now my problem of not being able to login at all.