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: 685
  • 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]

If you're interested in helping other members with support requests, consider joining the Community Support Helpers group.

Author Topic: Undefined offset: 1 when viewing page  (Read 3223 times)

0 Members and 1 Guest are viewing this topic.

Offline Inti31

  • Semi Newbie
  • *
  • Posts: 37
  • SP Version: 2.3.3
Undefined offset: 1 when viewing page
« on: August 30, 2011, 02:12:16 AM »
Hi, won't start a new topic to this error which fills up just my error log.

Yesterday I did (again) a fresh install (testforum) of SMF 2.0 Gold, also I installed Simpleportal 2.3.3 and x other mods.
The error log shows for each page (xxx) that line:
Code: [Select]
....index.php?page=pg_xxx 8: Undefined offset: 1
Datei: /home/syscp/webs/<private>/smf/Sources/PortalPages.php
line: 91

line 91:
Code: [Select]
if (preg_match('~s:4:"page";s:\d+:"([^"]+)";~', $row['url'], $match) === false || $match[1] != $page_id)
Any updates to that? I searched for but I didn't find a solution.

cheers Inti31
« Last Edit: August 30, 2011, 09:09:26 AM by Inti31 »
my forum

my mods - which I only made them work for 2.0 Gold:
Topics Filter v3.2 SMF 2.0 Gold
MemberNumber

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Undefined offset: 1 when viewing page
« Reply #1 on: August 30, 2011, 09:25:24 AM »
I hope you will not mind that I split this topic from the other one.  It was not at all related
I am very confused by this error.
I just downloaded SimplePortal 2.3.3, simply to check. I looked in the smf2 directory, and found the file PortalPages.php.  In this file, I see only 69 lines.  None of them contain "preg_match".
Have you customized PortalPages.php in any way?
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline Inti31

  • Semi Newbie
  • *
  • Posts: 37
  • SP Version: 2.3.3
Re: Undefined offset: 1 when viewing page
« Reply #2 on: August 30, 2011, 04:21:15 PM »
I just implemented the language file in the installer package else I installed "who is online" on pages
in the past (and i installed simplePortal a lot) I had no errors in the error log.
please see att'ed file:

cheers inti31
my forum

my mods - which I only made them work for 2.0 Gold:
Topics Filter v3.2 SMF 2.0 Gold
MemberNumber

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Undefined offset: 1 when viewing page
« Reply #3 on: August 30, 2011, 09:13:53 PM »
$match at that point does not exist, let alone as an array. There might be some problem with the file itself or the way it is being executed, I can't be sure.

You could try doing this as a temporary fix until a developer looks at it or if I have time to look more closely.

Find:
Code: [Select]
if (preg_match('~s:4:"page";s:\d+:"([^"]+)";~', $row['url'], $match) === false || $match[1] != $page_id)
continue;

Replace with:
Code: [Select]
if (is_array($match) || !empty($match))
if (preg_match('~s:4:"page";s:\d+:"([^"]+)";~', $row['url'], $match) === false || $match[1] != $page_id)
continue;

Offline Inti31

  • Semi Newbie
  • *
  • Posts: 37
  • SP Version: 2.3.3
Re: Undefined offset: 1 when viewing page
« Reply #4 on: August 31, 2011, 12:30:44 AM »
okay, I tried this - as I said - all pages run fine - it  is just the error message which fills the log

now I have in the same line (91) this entry for each page.
Code: [Select]
8: Undefined variable: match
Datei: /home/syscp/webs/<private>/smf/Sources/PortalPages.php

cheers inti31
my forum

my mods - which I only made them work for 2.0 Gold:
Topics Filter v3.2 SMF 2.0 Gold
MemberNumber

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Undefined offset: 1 when viewing page
« Reply #5 on: August 31, 2011, 12:39:01 AM »
That's weird, it should not do that anymore, I guess $match is an array and is set, just no keys?

Could try this for now then,

Find:
Code: [Select]
if (is_array($match) || !empty($match))
if (preg_match('~s:4:"page";s:\d+:"([^"]+)";~', $row['url'], $match) === false || $match[1] != $page_id)
continue;

Replace with:
Code: [Select]
$match = array(1 => '');
if (preg_match('~s:4:"page";s:\d+:"([^"]+)";~', $row['url'], $match) === false || $match[1] != $page_id)
continue;

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Undefined offset: 1 when viewing page
« Reply #6 on: August 31, 2011, 10:54:02 AM »
preg_match() will return false only if an error occurs in preg_match(). If there are no errors, but still no matches, it will return 0. Changing the initial line with the following should fix it:

Code: [Select]
if (!preg_match('~s:4:"page";s:\d+:"([^"]+)";~', $row['url'], $match) || $match[1] != $page_id)
I should also note that the line is from a custom edit. That line doesn't exist in SP by default.
« Last Edit: August 31, 2011, 10:58:41 AM by [SiNaN] »
And slowly, you come to realize... It's all as it should be...

Offline grafitus

  • Comrade
  • *
  • Posts: 1554
  • Gender: Male
  • just looking for own old energy
  • SMF Version: None
  • SP Version: None
Re: Undefined offset: 1 when viewing page
« Reply #7 on: August 31, 2011, 04:26:35 PM »
I should also note that the line is from a custom edit. That line doesn't exist in SP by default.
That the line is from my customization. ;)

And thanks your solution! Updated pack on the mod topic.
my modsI don't reply support PMs. Please use support forums.

Offline Inti31

  • Semi Newbie
  • *
  • Posts: 37
  • SP Version: 2.3.3
Re: Undefined offset: 1 when viewing page
« Reply #8 on: September 01, 2011, 03:42:29 AM »
okay - very nice that I could help out -  :whistle: - to fix a problem has nothing to do with SimplePortal itself - sorry for that -
it's all grafitus fault - I am just kidding.

Thx to all helped out in that matter.

The error message is gone, by the way...  - well done...

cheers Inti31


Maybe an admin could update the "Profile - Account Settings" page -
 there is need to add  2.0 Gold as an option by "SMF Version".
« Last Edit: September 01, 2011, 04:06:41 AM by Inti31 »
my forum

my mods - which I only made them work for 2.0 Gold:
Topics Filter v3.2 SMF 2.0 Gold
MemberNumber