SimplePortal

Support => Install and Upgrade => Topic started by: 1cor1313 on December 02, 2010, 07:04:07 AM

Title: Home button for Standalone mode edit
Post by: 1cor1313 on December 02, 2010, 07:04:07 AM
 :-[

Ever since I updated Simple Portal, my home button no longer links to my front page (the front page of my site and not the front page of simple portal)

I tried following the tutorial on SMF for editing urls but I kept getting a parse error and it would crash my forum. I would open subs.php and tried to change the home button url from this:
Code: [Select]
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
),

to this:
Code: [Select]
'home' => array(
'title' => $txt['home'],
'href' => 'http://gay-nerds.com/site',
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
),


Also, I tried following the tutorial over here and various sites. I tried looking for this text in my index-template.php file but I could not find it.
Code: [Select]
// Show the [home] button.
          echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
            <td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
            <a href="', $scripturl, '">' , $txt[103] , '</a>
            </td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

What I have is:
Code: [Select]
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;

echo '
<div id="main_menu">
<ul class="dropmenu" id="menu_nav">';

foreach ($context['menu_buttons'] as $act => $button)
{
echo '
<li id="button_', $act, '">
<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
<span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>
</a>';
if (!empty($button['sub_buttons']))
{
echo '
<ul>';

foreach ($button['sub_buttons'] as $childbutton)
{
echo '
<li>
<a href="', $childbutton['href'], '"', isset($childbutton['target']) ? ' target="' . $childbutton['target'] . '"' : '', '>
<span', isset($childbutton['is_last']) ? ' class="last"' : '', '>', $childbutton['title'], !empty($childbutton['sub_buttons']) ? '...' : '', '</span>
</a>';
// 3rd level menus :)
if (!empty($childbutton['sub_buttons']))
{
echo '
<ul>';

foreach ($childbutton['sub_buttons'] as $grandchildbutton)
echo '
<li>
<a', $grandchildbutton['active_button'] ? ' class="active"' : '', ' href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '>
<span', isset($grandchildbutton['is_last']) ? ' class="last"' : '', '>', $grandchildbutton['title'], '</span>
</a>
</li>';

echo '
</ul>';
}

echo '
</li>';
}
echo '
</ul>';
}
echo '
</li>';
}

echo '
</ul>
</div>';
}


I also tried this part in the tutorial but I found the instance of the href="" part twice so I did either or and it still didn't work. (Didn't crash my forum this time though...
Quote
Editing the 'Home' button:
For standalone mode, you will have to edit the 'Home' button, so that 'Standalone Url' is used, instead of the normal forum url.

Find this code:
Code: [Select]
href="', $scripturl, '"
Replace with this code:
Code: [Select]
href="', ($modSettings['sp_portal_mode'] == 3 && empty($context['disable_sp']) ? $modSettings['sp_standalone_url'] : $scripturl), '"[/quote]

I'm really lost and I feel like I'm overlooking something simple. Please help me :(
Title: Re: Home button for Standalone mode edit
Post by: AngelinaBelle on December 02, 2010, 05:06:25 PM
I would classify this as an install problem. I'll explain:
 
It looks like SimplePortal did not install properly.
The Package Manager should have made certain changes to Subs.php. But, according to the snippet you showed me -- it did not.
 
I don't know why Package Manager failed. Maybe it was a permission problem.
I don't know if some other part of that install failed.
 
Did you get any "test failed" warnings before you did the install?
 
The good news is that you can use the manual install instructions to paste in the correct text.
For SMF 2 with a Curve-based theme, do not even look at template_menu. Ignore those SMF1 parts of the tutorial.
 
* go to the simplemachines.org mod site and search for SimplePortal
* Select your versions of SimplePortal and SMF and click the button for manual install instructions
* find the part about Subs.php
* copy the "replace" code in place of the "find" code.
* ftp that altered Subs.php up to your site.
 
I'm not sure, reading your post if you saw any evidence of install failures in your theme, but you can certainly use the manual install instructions to search through your theme files and fix anything that is missing.
 
You should be able to set up SimplePortal with the standalone URL of http://gay-nerds.com/site/index.php (http://gay-nerds.com/site/index.php)
SimplePortal standalone was meant to work with a Simpleportal standalone file. But I don't know of any reason it shouldn't work with a NON-SimplePortal standalone file. And I guess it did, before the upgrade.
 
Please let us know how it works after you fix Subs.php, using the manual install instructions.
Title: Re: Home button for Standalone mode edit
Post by: 1cor1313 on December 02, 2010, 06:40:47 PM
I did not get any install failed problems but I did upgrade from 2.3.2 to 2.3.3. There were no issues and everything is working fine minus that I can't add the buttons...

I'll try looking at the manual installation...
Title: Re: Home button for Standalone mode edit
Post by: AngelinaBelle on December 02, 2010, 08:15:01 PM
Sometimes that happens.
PackageManager cannot write the changed file, and it doesn't seem to realize that there is a problem.
 
You will be able to fix it.
Title: Re: Home button for Standalone mode edit
Post by: 1cor1313 on December 03, 2010, 05:29:47 AM
Thank you for your detailed instructions. What happened was that the home array part did not fully install (which sounds weird, I know)

So instead of the normal text below, my installation had everything except the red text
Quote
'home' => array(
            'title' => $txt['home'],
            'href' => $modSettings['sp_portal_mode'] == 3 && empty($context['disable_sp']) ? $modSettings['sp_standalone_url'] : $scripturl,
            'show' => true,
            'sub_buttons' => array(
            ),
         ),
         'forum' => array(
            'title' => empty($txt['sp-forum']) ? 'Forum' : $txt['sp-forum'],
            'href' => $scripturl . ($modSettings['sp_portal_mode'] == 1 && empty($context['disable_sp']) ? '?action=forum' : ''),
            'show' => in_array($modSettings['sp_portal_mode'], array(1, 3)) && empty($context['disable_sp']),
            'sub_buttons' => array(
            ),
         ),


Thank you for being so helpful :)

I'm posting this link over here just in case someone finds my topic looking for the instructions that I followed: http://custom.simplemachines.org/mods/index.php?mod=1104
Title: Re: Home button for Standalone mode edit
Post by: AngelinaBelle on December 03, 2010, 05:06:16 PM
Glad this helped.  Marked as solved.
SimplePortal 2.3.8 © 2008-2024, SimplePortal