collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 760
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

Installation errors? Mod incompatibilities? Upgrade problems? Make your way over to the Install and Upgrade Support board for all your solutions!

Author Topic: Articles? Pages? Page Navigation  (Read 6301 times)

0 Members and 1 Guest are viewing this topic.

Offline russ skinner

  • Semi Newbie
  • *
  • Posts: 22
  • Gender: Male
    • Slough RC Model Club
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Articles? Pages? Page Navigation
« on: November 11, 2009, 04:25:48 AM »
Hi all,

I've been looking after a busy website and SMF forum for a Radio control model club for a number years and have reached the stage where I'd like to combine the two to simplify administration. I have dabbled with Tinyportal in the past, but found it a little arcane so I never persevered.   

I have just started experimenting with Simple Portal on a test server and wonder if someone could advise on a couple of basic questions.

My main task will be integrating stand alone HTML pages into the portal and my thinking so far is that I will need to use Simple Portal pages for this. Is this correct and how do I go about setting up a page navigation menu?

I'm also a little unsure on the use of 'Articles'. Apologies for a very basic question, but where should articles be used - what is their purpose?

Many thanks,

Russ


Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Articles? Pages? Page Navigation
« Reply #1 on: November 11, 2009, 06:49:08 AM »
1) My main task will be integrating stand alone HTML pages into the portal and my thinking so far is that I will need to use Simple Portal pages for this. Is this correct and how do I go about setting up a page navigation menu?

2) I'm also a little unsure on the use of 'Articles'. Apologies for a very basic question, but where should articles be used - what is their purpose?

1) You can definitely use SimplePortal to add a whole bunch of HTML pages through the Pages function. Setting up a navigation menu depends on how you want to do it. You could create a custom PHP/HTML/BBC block which has a series of links to the pages, you could modify your forum's menu, you could add a new menu, etc. You can get the url for each page by clicking on the link (the page title) on the list of pages in the admin area. The choice has to how to setup the navigation is yours, although if you need any help in setting it up then feel free to ask.

2) At the moment, SimplePortal articles are basically just published topics from your forum. When you add a topic as an article, it will be published/shown on your portal (if the Articles feature is enabled, and the article is one of your more recent articles - this is based on the settings you choose).

SimplePortal 2.4 will add a 'forum independant' articles system, that means that users with the correct permissions will be able to create BBC/HTML (different permissions for each, admin will be able to make PHP articles) will be able to create articles that resemble topics, where users can make comments (if applicable) and etc. We will also be looking at the navigation system, to make it easy to find/look at articles, although we are still tossing ideas around about this. ;)
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline russ skinner

  • Semi Newbie
  • *
  • Posts: 22
  • Gender: Male
    • Slough RC Model Club
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Articles? Pages? Page Navigation
« Reply #2 on: November 11, 2009, 07:05:04 AM »
Many thanks for the reply, which makes things a lot clearer for me.

I like the idea of adding page links to the forum menu. I'll research the SMF support forum for more info.

Russ

Offline russ skinner

  • Semi Newbie
  • *
  • Posts: 22
  • Gender: Male
    • Slough RC Model Club
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Articles? Pages? Page Navigation
« Reply #3 on: November 11, 2009, 11:14:15 AM »
Ok some progress.

I've created a page which works well and I've managed to add a tab to the forum menu to open the page using the tutorial here - Adding tabs to SMF 2.0

This works well, however I'm unable to get the tab to highlight (orange background) once selected.

One of my new tabs Membership is coded in Sources / Subs.php:

Code: [Select]
'membership' => array(
'title' => 'membership',
'href' => 'http://localhost/forum/index.php?page=page4618',
'show' => true,
'sub_buttons' => array(
),

I'm guessing the highlighting has something to do with the following:

Code: [Select]
// Figure out which action we are doing so we can set the active tab.
// Default to home.

$current_action = $modSettings['sp_portal_mode'] == 3 && empty($context['standalone']) && empty($context['disable_sp']) ? 'forum' : 'home';

if (isset($context['menu_buttons'][$context['current_action']]))
$current_action = $context['current_action'];
elseif ($context['current_action'] == 'search2')
$current_action = 'search';
elseif ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
elseif(empty($context['disable_sp']) && ((isset($_GET['board']) || isset($_GET['topic']) || in_array($context['current_action'], array('unread', 'unreadreplies'))) && in_array($modSettings['sp_portal_mode'], array(1, 3))))
$current_action = 'forum';
elseif ($context['current_action'] == 'register2')
$current_action = 'register';
elseif ($context['current_action'] == 'login2' || ($user_info['is_guest'] && $context['current_action'] == 'reminder'))
$current_action = 'login';
     
$context['menu_buttons'][$current_action]['active_button'] = true;

and that I need to add another elseif condition.

Am I on the right lines?


Russ

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Articles? Pages? Page Navigation
« Reply #4 on: November 11, 2009, 06:12:44 PM »
That is correct, you do need to add a new elseif statement. As the menu normal works with actions, it will need to be changed a bit to work with pages as well.

The edit below adds an elseif statment which will allow you to add a 'page id' as the index for an entry in the buttons array.

Code: ("Find") [Select]
  if (isset($context['menu_buttons'][$context['current_action']]))
      $current_action = $context['current_action'];

Code: ("Replace") [Select]
  if (isset($context['menu_buttons'][$context['current_action']]) && empty($context['menu_buttons'][$context['current_action']]['sp_page']))
      $current_action = $context['current_action'];
   elseif (empty($context['current_action']) && !empty($_REQUEST['page']) && isset($context['menu_buttons'][$_REQUEST['page']]))
      $current_action = $_REQUEST['page'];

Here is an example, note that I have used $scripturl instead of the full url, that will make it easier to port from your test website to your main website, because you won't need to change all the urls. I have also added a 'sp_page' field, when that is set to true, with the edit above, the button will not highlight when 'action=pageid' is part of the url, which it would do otherwise, because of how the menu system code works.

Code: [Select]
        'pageid' => array(
            'title' => 'Button Title',
            'href' => $scripturl . '?page=pageid',
            'show' => true,
            'sp_page' => true,
            'sub_buttons' => array(
         ),

Also, I would suggest that you change your pageids from 'page4618' to something like 'maintenance' (which you can do when you edit the page in the SP admin area).
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline russ skinner

  • Semi Newbie
  • *
  • Posts: 22
  • Gender: Male
    • Slough RC Model Club
  • SMF Version: 2 RC2
  • SP Version: 2.3.1
Re: Articles? Pages? Page Navigation
« Reply #5 on: November 12, 2009, 04:49:26 AM »
Many thanks. Have just tested your code and it works perfectly.

I've also changed my pageID to something more meaningful as you suggest.

Time to start adding some more pages.

Russ

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Articles? Pages? Page Navigation
« Reply #6 on: June 30, 2010, 05:58:11 AM »
Hi i have been looking for this type of fix for days..

but it does not seem to work for me?

is it because of the Version of SMF and SP, or PHP and MYSql ??

i have a limited knowage of PHP, and i manage to father things out but this one has stumped me.

i have added a few pages within SP

i have added a new Tab to the forum in Sources\Subs.php
including the "Sub Arrays"
with the 'sp_page' => true, and in the last entry of the sub array is   'is_last' => true,

i have even moved some of the Tabs around into different "sub arrays", and made the new "elseif" to accommodate the changes, so the correct Tab is Active

every thing seems to work no problems apart from the new Tab that accesses the pages and page ID's

the links work fine and the pages are shown, but the Tab does not got active, it reverts to the home Tab.

i am using the code from this post.

looking for help please
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Articles? Pages? Page Navigation
« Reply #7 on: June 30, 2010, 07:52:17 AM »
stupid mistake through me.... the above code does work...

when making the Array in Sources\Subs.php the name of the Array has to be the same as the PageID.

Quote
        'History' => array(
        'title' => 'Company Info',
        'href' => $scripturl . '?page=History',
        'show' => true,
        'sp_page' => true,
        'sub_buttons' => array(

        ),


i am now trying to get the Sub_buttons array to work...   
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Articles? Pages? Page Navigation
« Reply #8 on: July 01, 2010, 05:19:21 AM »
am i guesing theres no support for this..??  :'(
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.

Offline Nathaniel

  • Comrade
  • *
  • Posts: 5203
  • Gender: Male
    • Verbtest.com
  • SMF Version: 2 RC4
  • SP Version: 2.3.3
Re: Articles? Pages? Page Navigation
« Reply #9 on: July 02, 2010, 09:58:47 PM »
am i guesing theres no support for this..??  :'(

What exactly is your issue? If you are trying to get the sub buttons array to work properly, then please post what you have so far and I can help to correct it. Or I can post an example if you need one.

I have responded to your issue of highlighting the correct button: http://simpleportal.net/index.php?topic=5678.msg35088#msg35088
SMF Friend (Former Support Specialist) | SimplePortal DeveloperMy SMF Mods | SimplePortal"Quis custodiet ipsos custodes?" - Who will Guard the Guards?Please don't send me ANY support related PMs. I will just delete them.

Offline deansmar

  • Full Member
  • ***
  • Posts: 122
  • Gender: Male
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Articles? Pages? Page Navigation
« Reply #10 on: July 03, 2010, 08:52:33 AM »
Quote
What exactly is your issue?

the three or four posts in this thred posted by me should have given some clue to the issue..!!

problems all solved, the answers are in this post, i was not to sure wether it was a SP or SMF problem.

http://www.simplemachines.org/community/index.php?topic=357796.msg2686903#msg2686903

thanks for your answer, but by the time i had seen it, i had allready fixed my problem my self..
as a foot note:
i went from a SMF 1.1.11 to SMF2 RC3 with out any problems what so ever, first of all de-install all Mods, converted to RC3, then installed SP2.3.2, then installed the required Mods.