Advertisement:

Author Topic: Image Sitemap notice-Undefined index: fk_i_item_id in /home/ [SOLVED]  (Read 3019 times)

PostFreeOnline.Com

  • Jr. Member
  • **
  • Posts: 77
  • PostFreeOnline.Com
Re: Image Sitemap notice-Undefined index: fk_i_item_id in [SOLVED]
« Reply #15 on: September 28, 2017, 01:20:16 pm »
I use 7.0.

Ok..I think Notices also coming because due to the old plugins are not designed for new php ver..  Well Thanks for your precious time and prompt response. Can I catch you directly. for other quries? 
« Last Edit: September 29, 2017, 09:20:36 am by PostFreeOnline.Com »

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
I'm only an "user" of the osclass opensource script, so not sort of an expert.

PostFreeOnline.Com

  • Jr. Member
  • **
  • Posts: 77
  • PostFreeOnline.Com
I'm only an "user" of the osclass opensource script, so not sort of an expert.

Ok


Those Notices are gone but Other are still coming

[28-Sep-2017 14:56:48 Asia/Kolkata] PHP Notice:  Undefined index: fk_i_category_id in /home/scorp4hj/public_html/postfreeonline.com/oc-includes/osclass/helpers/hDefines.php on line 491
[28-Sep-2017 14:56:48 Asia/Kolkata] PHP Notice:  Undefined index: pk_i_id in /home/scorp4hj/public_html/postfreeonline.com/oc-includes/osclass/helpers/hDefines.php on line 497
[28-Sep-2017 14:56:48 Asia/Kolkata] PHP Notice:  Undefined index: s_city in /home/scorp4hj/public_html/postfreeonline.com/oc-includes/osclass/helpers/hDefines.php on line 498
[28-Sep-2017 14:56:48 Asia/Kolkata] PHP Notice:  Undefined index: s_title in /home/scorp4hj/public_html/postfreeonline.com/oc-includes/osclass/helpers/hDefines.php on line 499
[28-Sep-2017 14:56:49 Asia/Kolkata] PHP Notice:  Undefined index: fk_i_category_id in /home/scorp4hj/public_html/postfreeonline.com/oc-includes/osclass/helpers/hDefines.php on line 491
[28-Sep-2017 14:56:49 Asia/Kolkata] PHP Notice:  Undefined index: pk_i_id in /home/scorp4hj/public_html/postfreeonline.com/oc-includes/osclass/helpers/hDefines.php on line 497
[28-Sep-2017 14:56:49 Asia/Kolkata] PHP Notice:  Undefined index: s_city in /home/scorp4hj/public_html/postfreeonline.com/oc-includes/osclass/helpers/hDefines.php on line 498
[28-Sep-2017 14:56:49 Asia/Kolkata] PHP Notice:  Undefined index: s_title in /home/scorp4hj/public_html/postfreeonline.com/oc-includes/osclass/helpers/hDefines.php on line 499
[28-Sep-2017 14:56:49 Asia/Kolkata] PHP Notice:  Undefined index: fk_i_category_id in /home/scorp4hj/public_html/postfreeonline.com/oc-includes/osclass/helpers/hDefines.php on line 491
[28-Sep-2017 14:56:49 Asia/Kolkata] PHP Notice:  Undefined index: pk_i_id in /home/scorp4hj/public_html/postfreeonline.com/oc-includes/osclass/helpers/hDefines.php on line 497
[28-Sep-2017 14:56:49 Asia/Kolkata] PHP Notice:  Undefined index: s_city in /home/scorp4hj/public_html/postfreeonline.com/oc-includes/osclass/helpers/hDefines.php on line 498
[28-Sep-2017 14:56:49 Asia/Kolkata] PHP Notice:  Undefined index: s_title in /home/scorp4hj/public_html/postfreeonline.com/oc-includes/osclass/helpers/hDefines.php on line 499

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Try php 7.0. If they don't go away, try applying the same ideea for all of them , with isset.

PostFreeOnline.Com

  • Jr. Member
  • **
  • Posts: 77
  • PostFreeOnline.Com
Try php 7.0. If they don't go away, try applying the same ideea for all of them , with isset.

Prefer to be on Ver 7.1 only..  Which line to change and which file ?  with

 if( isset($item_id['fk_i_item_id']))  $num = $item_id['fk_i_item_id'];


Is it  /home/scorp4hj/public_html/postfreeonline.com/oc-includes/osclass/helpers/hDefines.php


and line No.491 to 499


Code line 488 to 508

 $url = osc_get_preference('rewrite_item_url');
            if( preg_match('|{CATEGORIES}|', $url) ) {
                $sanitized_categories = array();
                $cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);
                for ($i = (count($cat)); $i > 0; $i--) {
                    $sanitized_categories[] = $cat[$i - 1]['s_slug'];
                }
                $url = str_replace('{CATEGORIES}', implode("/", $sanitized_categories), $url);
            }
            $url = str_replace('{ITEM_ID}', osc_sanitizeString($item['pk_i_id']), $url);
            $url = str_replace('{ITEM_CITY}', osc_sanitizeString($item['s_city']), $url);
            $url = str_replace('{ITEM_TITLE}', osc_sanitizeString(str_replace(',', '-', $item['s_title'])), $url);
            $url = str_replace('?', '', $url);
            if($locale!='') {
                $path = osc_base_url().$locale."/".$url;
            } else {
                $path = osc_base_url().$url;
            }
        } else {
            $path = osc_item_url_ns($item['pk_i_id'], $locale);
        }
« Last Edit: September 28, 2017, 01:39:06 pm by PostFreeOnline.Com »

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
You must look at your php notice

for example
[28-Sep-2017 14:56:48 Asia/Kolkata] PHP Notice:  Undefined index: fk_i_category_id in /home/scorp4hj/public_html/postfreeonline.com/oc-includes/osclass/helpers/hDefines.php on line 491

fk_i_category_id is the undefined value so you go to oc-includes/osclass/helpers/hDefines.php on line 491
and replace in a simillar way that line with something like

if( isset($array['fk_i_category_id']))  $something = $array['fk_i_category_id'];

something and array myst be replaced also with that line's values.


in your example

$cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);

must be replaced with

if( isset($item['fk_i_category_id'])) $cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);

« Last Edit: September 28, 2017, 01:46:53 pm by marius-ciclistu »

PostFreeOnline.Com

  • Jr. Member
  • **
  • Posts: 77
  • PostFreeOnline.Com
You must look at your php notice

for example
[28-Sep-2017 14:56:48 Asia/Kolkata] PHP Notice:  Undefined index: fk_i_category_id in /home/scorp4hj/public_html/postfreeonline.com/oc-includes/osclass/helpers/hDefines.php on line 491

fk_i_category_id is the undefined value so you go to oc-includes/osclass/helpers/hDefines.php on line 491
and replace in a simillar way that line with something like

if( isset($array['fk_i_category_id']))  $something = $array['fk_i_category_id'];

something and array myst be replaced also with that line's values.


in your example

$cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);

must be replaced with

if( isset($item['fk_i_category_id'])) $cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);

No Its Not working... Its giving more and more warnings

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Try like this

Code: [Select]
              if( isset($item['fk_i_category_id'])) { $cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);
                for ($i = (count($cat)); $i > 0; $i--) {
                    $sanitized_categories[] = $cat[$i - 1]['s_slug'];
                } }

instead of

Code: [Select]
                $cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);
                for ($i = (count($cat)); $i > 0; $i--) {
                    $sanitized_categories[] = $cat[$i - 1]['s_slug'];
                }

PostFreeOnline.Com

  • Jr. Member
  • **
  • Posts: 77
  • PostFreeOnline.Com
You must look at your php notice

for example
[28-Sep-2017 14:56:48 Asia/Kolkata] PHP Notice:  Undefined index: fk_i_category_id in /home/scorp4hj/public_html/postfreeonline.com/oc-includes/osclass/helpers/hDefines.php on line 491

fk_i_category_id is the undefined value so you go to oc-includes/osclass/helpers/hDefines.php on line 491
and replace in a simillar way that line with something like

if( isset($array['fk_i_category_id']))  $something = $array['fk_i_category_id'];

something and array myst be replaced also with that line's values.


in your example

$cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);

must be replaced with

if( isset($item['fk_i_category_id'])) $cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);


You must look at your php notice

for example
[28-Sep-2017 14:56:48 Asia/Kolkata] PHP Notice:  Undefined index: fk_i_category_id in /home/scorp4hj/public_html/postfreeonline.com/oc-includes/osclass/helpers/hDefines.php on line 491

fk_i_category_id is the undefined value so you go to oc-includes/osclass/helpers/hDefines.php on line 491
and replace in a simillar way that line with something like

if( isset($array['fk_i_category_id']))  $something = $array['fk_i_category_id'];

something and array myst be replaced also with that line's values.


in your example

$cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);

must be replaced with

if( isset($item['fk_i_category_id'])) $cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);


I just did it let me check if its working....

PostFreeOnline.Com

  • Jr. Member
  • **
  • Posts: 77
  • PostFreeOnline.Com
Try like this

Code: [Select]
              if( isset($item['fk_i_category_id'])) { $cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);
                for ($i = (count($cat)); $i > 0; $i--) {
                    $sanitized_categories[] = $cat[$i - 1]['s_slug'];
                } }

instead of

Code: [Select]
                $cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);
                for ($i = (count($cat)); $i > 0; $i--) {
                    $sanitized_categories[] = $cat[$i - 1]['s_slug'];
                }

You must look at your php notice

for example
[28-Sep-2017 14:56:48 Asia/Kolkata] PHP Notice:  Undefined index: fk_i_category_id in /home/scorp4hj/public_html/postfreeonline.com/oc-includes/osclass/helpers/hDefines.php on line 491

fk_i_category_id is the undefined value so you go to oc-includes/osclass/helpers/hDefines.php on line 491
and replace in a simillar way that line with something like

if( isset($array['fk_i_category_id']))  $something = $array['fk_i_category_id'];

something and array myst be replaced also with that line's values.


in your example

$cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);

must be replaced with

if( isset($item['fk_i_category_id'])) $cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);


i used this one

if( isset($item['fk_i_category_id'])) { $cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);
                for ($i = (count($cat)); $i > 0; $i--) {
                    $sanitized_categories[] = $cat[$i - 1]['s_slug'];
                } }


And All gone but still giving time if everything OK
« Last Edit: September 28, 2017, 02:28:17 pm by PostFreeOnline.Com »

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
put in oc-includes/osclass/helpers/hDefines.php on lines 491 492 493 494

Code: [Select]
              if( isset($item['fk_i_category_id'])) { $cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);
                for ($i = (count($cat)); $i > 0; $i--) {
                    $sanitized_categories[] = $cat[$i - 1]['s_slug'];
                } }

instead of

Code: [Select]
                $cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);
                for ($i = (count($cat)); $i > 0; $i--) {
                    $sanitized_categories[] = $cat[$i - 1]['s_slug'];
                }

PostFreeOnline.Com

  • Jr. Member
  • **
  • Posts: 77
  • PostFreeOnline.Com
Re: Image Sitemap notice-Undefined index: fk_i_item_id in /home/ [SOLVED]
« Reply #26 on: September 28, 2017, 02:33:36 pm »
put in oc-includes/osclass/helpers/hDefines.php on lines 491 492 493 494

Code: [Select]
              if( isset($item['fk_i_category_id'])) { $cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);
                for ($i = (count($cat)); $i > 0; $i--) {
                    $sanitized_categories[] = $cat[$i - 1]['s_slug'];
                } }

instead of

Code: [Select]
                $cat = Category::newInstance()->hierarchy($item['fk_i_category_id']);
                for ($i = (count($cat)); $i > 0; $i--) {
                    $sanitized_categories[] = $cat[$i - 1]['s_slug'];
                }

Yes did the same and I think Its all gone now... I just refreshed the log and not coming like that

only other log is there. I think it is related to Reminder Plugin...

[28-Sep-2017 16:00:28 Asia/Kolkata] SELECT pfo_t_item.*
FROM (pfo_t_item)
WHERE pfo_t_item.b_enabled = 1
AND pfo_t_item.dt_expiration > '2017-09-26 15:00:28'
AND pfo_t_item.dt_expiration <= '2017-09-26 16:00:28'
AND pfo_t_item.b_spam  = 0
[28-Sep-2017 16:00:28 Asia/Kolkata] PHP Notice:  Use of undefined constant ER_ITEM_NO_SPAM - assumed 'ER_ITEM_NO_SPAM' in /home/scorp4hj/public_html/postfreeonline.com/oc-content/plugins/reminder/classes/ReminderTest.php on line 70
[28-Sep-2017 16:00:28 Asia/Kolkata] PHP Notice:  Use of undefined constant ER_ITEM_NO_SPAM - assumed 'ER_ITEM_NO_SPAM' in /home/scorp4hj/public_html/postfreeonline.com/oc-content/plugins/reminder/classes/Reminders/ReminderItemMakePremium.php on line 11
[28-Sep-2017 16:00:28 Asia/Kolkata] PHP Notice:  Use of undefined constant ER_ITEM_NO_SPAM - assumed 'ER_ITEM_NO_SPAM' in /home/scorp4hj/public_html/postfreeonline.com/oc-content/plugins/reminder/classes/ReminderTest.php on line 70
[28-Sep-2017 16:00:28 Asia/Kolkata] 2017-09-26 15:00:28   2017-09-26 16:00:28
[28-Sep-2017 16:00:28 Asia/Kolkata] PHP Notice:  Use of undefined constant ER_ITEM_NO_SPAM - assumed 'ER_ITEM_NO_SPAM' in /home/scorp4hj/public_html/postfreeonline.com/oc-content/plugins/reminder/classes/ReminderTest.php on line 70
[28-Sep-2017 16:00:28 Asia/Kolkata] PHP Notice:  Use of undefined constant ER_ITEM_NO_SPAM - assumed 'ER_ITEM_NO_SPAM' in /home/scorp4hj/public_html/postfreeonline.com/oc-content/plugins/reminder/classes/ReminderTest.php on line 70
[28-Sep-2017 16:00:28 Asia/Kolkata] PHP Notice:  Use of undefined constant ER_ITEM_NO_SPAM - assumed 'ER_ITEM_NO_SPAM' in /home/scorp4hj/public_html/postfreeonline.com/oc-content/plugins/reminder/classes/ReminderTest.php on line 70
[28-Sep-2017 16:00:28 Asia/Kolkata] PHP Notice:  Use of undefined constant ER_ITEM_NO_SPAM - assumed 'ER_ITEM_NO_SPAM' in /home/scorp4hj/public_html/postfreeonline.com/oc-content/plugins/reminder/classes/ReminderTest.php on line 70
« Last Edit: September 29, 2017, 09:22:18 am by PostFreeOnline.Com »

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"

PostFreeOnline.Com

  • Jr. Member
  • **
  • Posts: 77
  • PostFreeOnline.Com
;)

You helped me alot removing those Notices which are coming from past 3 months.. You are superb..

Any Idea about this Notice :D

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
http://php.net/manual/en/language.constants.php

gues you must define it before using it