SimplePortal

Support => Install and Upgrade => Topic started by: yangtastic on June 01, 2010, 07:27:58 PM

Title: Error in Package Installation
Post by: yangtastic on June 01, 2010, 07:27:58 PM
Hey SP forum members,

I have this problem when I try to Apply Mod. The tests fail.

(http://i49.tinypic.com/rt43t1.jpg)

I have just recently entered into SMF so assume I don't know much.

How do I fix up these errors?

Would I have to update my SMF version or download an older version of SP?

Thanks for replies.
Title: Re: Error in Package Installation
Post by: Nathaniel on June 01, 2010, 08:35:33 PM
Those two edits are related to changing urls, so that link which refer to a specific category on your forums work, even if you have the frontpage mode turned on.

Do you have any Url related mods installed?
Title: Re: Error in Package Installation
Post by: yangtastic on June 01, 2010, 08:40:22 PM
I have TinyPortal and SimplePortal uploaded.

I have ADK Portal applied.

Would you suggest that I uninstall the other portals to be able to successfully install and use SimplePortal?

Also, if this helps, the tests that failed are:

Thanks.
Title: Re: Error in Package Installation
Post by: Nathaniel on June 01, 2010, 08:43:26 PM
I can see the failed tests from your image, they are likely to be compatibility issues with another mod.

As Portal mods are large and alter quite a few files, you should probably only have one installed at a time. Uninstalling the other portals should make it easier to install SimplePortal.
Title: Re: Error in Package Installation
Post by: yangtastic on June 01, 2010, 08:54:01 PM
Thanks. That solved it. Now that I have it installed I want to use it for what I intended - creating pages.

I've created a page and what I don't see is a link to the created page that I saw in ADK Portal. How I need a link to the page so I can link the tab that is to be pressed to that tab.
Title: Re: Error in Package Installation
Post by: Nathaniel on June 01, 2010, 09:11:12 PM
If you want a link on the SMF menu, then you will have to manually add one. You can get the url for the page from the page list area in the SimplePortal admin section.
Title: Re: Error in Package Installation
Post by: yangtastic on June 01, 2010, 09:45:25 PM
If you want a link on the SMF menu, then you will have to manually add one. You can get the url for the page from the page list area in the SimplePortal admin section.
I created a new tab in a custom theme by adding a new action:
Code: [Select]
   if ($context['current_action'] == 'test')
      $current_action = 'test';

And also, creating the tab:
Code: [Select]
            // Show the [test] button.
            echo '<li><a' , $current_action=='test' ? ' class="current"' : '' , ' href="index.php?page=page3102"', $scripturl, '?action=test"><span>Test</span></a></li>';

It turns out that my "Test" tab is not highlighted... the Index tab is.
Title: Re: Error in Package Installation
Post by: Nathaniel on June 01, 2010, 09:52:21 PM
That's because pages aren't actions.

Try this for the first segment of code:
Code: [Select]
   if (!empty($_REQUEST['page']) && in_array($_REQUEST['page'], array('pageid1', 'pageid2', 'pageid3', 'etc')))
      $current_action = $_REQUEST['page'];

You will need to change the array which contains page ids, so that it only contains the page ids that you want. You may only want to have "array('pageid')" if you only want to add a single tab.
Title: Re: Error in Package Installation
Post by: yangtastic on June 02, 2010, 12:11:57 AM
Cool. That created a new tab for me and it's linking correctly.

But the test page is highlighting another tab. For example - The Test page should have the Test tab highlighted. At the moment, the Test page has the Forum tab highlighted.

EDIT: As many test pages I create, they all have the Forum tab highlighted.
Title: Re: Error in Package Installation
Post by: Nathaniel on June 02, 2010, 04:09:17 AM
Make sure that your have changed the "array('pageid1', 'pageid2', 'pageid3', 'etc')" example array of page ids, to the ids of your pages. You will also need to change the "$current_action=='test'" part of the code for each tab you add, so that it has the correct page id (where 'test' is the page id).
Title: Re: Error in Package Installation
Post by: yangtastic on June 02, 2010, 07:19:52 PM
This is the upper part of the code for the tabs.
Code: [Select]
   if (!empty($_REQUEST['test']) && in_array($_REQUEST['test'], array('test')))
      $current_action = $_REQUEST['test'];

This is the lower part of the code for the tabs.
Code: [Select]
            // Show the [test] button.
            echo '<li><a' , $current_action=='test' ? ' class="current"' : '' , ' href="index.php?page=page3102"', $scripturl, '?action=test"><span>' , $txt[test] = 'Test' , '</span></a></li>';

These pieces of code create the test tab correctly, link it correctly but the wrong tab is highlighted on the test page.
Title: Re: Error in Package Installation
Post by: yangtastic on June 02, 2010, 07:39:51 PM
I found this mod for custom tabs.

http://custom.simplemachines.org/mods/index.php?mod=1402

It doesn't say that it is compatible with 1.1.11 but there are instructions, related to chagning the code,  as found with other mods. Does applying the mod automatically install those instructions or do I have to manually change the code when I apply the mod.

I read the code instructions of SimplePortal but I didn't need to apply them manually.
http://custom.simplemachines.org/mods/index.php?action=parse

Thanks.
Title: Re: Error in Package Installation
Post by: Nathaniel on June 02, 2010, 08:30:47 PM
I haven't used that mod, although any tabs mod for SMF 1.1.x, will most likely have to be applied manually to any custom theme you are using, to me that would seem to be more effort than its worth.

What is the id for your page? I have altered the code below so that it will work for a page with id 'page3102'.

Try the code below:
Code: [Select]
   if (!empty($_REQUEST['page']) && in_array($_REQUEST['page'], array('page3102')))
      $current_action = $_REQUEST['page']; 

(for that code you should not have changed the 'page' part to 'test', just the array part needs changing)

Code: [Select]
            // Show the [test] button.
            echo '<li><a' , $current_action=='page3102' ? ' class="current"' : '' , ' href="', $scripturl, '?page=page3102"><span>Test</span></a></li>';

(you had an extra part in the url that said 'action=test')
Title: Re: Error in Package Installation
Post by: yangtastic on June 02, 2010, 08:46:20 PM
Didn't seem to make a difference the test tab still higlights the index tab.

I haven't used that mod, although any tabs mod for SMF 1.1.x, will most likely have to be applied manually to any custom theme you are using, to me that would seem to be more effort than its worth.

So the easiest way to get to my destination would be to upgrade my SMF version to the latest SMF version which is...
SMF 2.0 RC3?

Thanks.
Title: Re: Error in Package Installation
Post by: Nathaniel on June 02, 2010, 08:51:26 PM
What is the id for your page?

You can find the id of a page by looking at the url when you visit that page (format: 'index.php?page=id').

Upgrading to SMF 2 RC3 would not be the easiest way to add a tab to your forum... Upgrading to SMF 2 RC3, breaks themes and mods, meaning that you have to reinstall all of them (if they are compatible with SMF 2). If you have a large forum then this can be a pain (its also a pain if you have 50 mods installed or a theme that doesn't support SMF 2 RC3).
Title: Re: Error in Package Installation
Post by: yangtastic on June 02, 2010, 08:59:09 PM
The page id is page3102. So it would be "index.php?page=page3102"

I'm only using SimplePortal as the only mod at the moment.
SimplePortal 2.3.8 © 2008-2024, SimplePortal