what does this error mean?

Started by bubbahs, July 13, 2005, 05:56:37 AM

Previous topic - Next topic

bubbahs

Notice: Only variables should be assigned by reference in /var/www/domains/x.homespunpizza.com/docs/forums/Sources/Subs.php on line 232

Notice: Only variables should be assigned by reference in /var/www/domains/x.homespunpizza.com/docs/forums/Sources/Subs.php on line 232

Notice: Only variables should be assigned by reference in /var/www/domains/x.homespunpizza.com/docs/forums/Sources/Subs.php on line 232

Notice: Only variables should be assigned by reference in /var/www/domains/x.homespunpizza.com/docs/forums/Sources/Subs.php on line 232

Notice: Only variables should be assigned by reference in /var/www/domains/x.homespunpizza.com/docs/forums/Sources/Subs.php on line 232

Notice: Only variables should be assigned by reference in /var/www/domains/x.homespunpizza.com/docs/forums/Sources/Subs.php on line 232

Notice: Only variables should be assigned by reference in /var/www/domains/x.homespunpizza.com/docs/forums/Sources/Subs.php on line 232

This comes up after the install

Tomer

Solution: Open /Sources/Subs.php

Find: = &mysql_query
Replace with: = mysql_query

- Tomer


digibike

http://www.testbank.hccnet.nl/yabbse/index.php?board=5.0

8: Uninitialized string offset: 0
Bestand: /vol/www/gg/testbank/web-docs/yabbse/Sources/Subs.php
Regel: 1726



Any idea how this can be repaired? Before I upgraded to SMF1.1b3 from 1.0 I got lots (pages of them) of errors. Now only this one keeps comming daily. Is there an error in the Subs.php (it comes from the upgrade so I assume it is correct)

[Unknown]

That shouldn't occur in 1.1 Beta 3 Public.

-[Unknown]

digibike

Quote from: [Unknown] on July 14, 2005, 05:03:03 PM
That shouldn't occur in 1.1 Beta 3 Public.


I was afraid you would say that  :D But how can this be solved?

[Unknown]

Can you tell me what you have on line 1726, exactly?

How do I modify files?

-[Unknown]

digibike

 // The idea is, if we are LOOKING for a block level tag, we can close them on the way.

                                        if (isset($look_for{0}, $bbc_codes[$lookf (isset($look_for{0}, $bbc_codes[$look_for{0}]))
                                       {
                                                foreach ($bbc_codes[$look_for{0}] as $temp)
                                                        if ($temp['tag'] == $look_for)
                                                        {
                                                                $block_level = !empty($temp['block_level']);
                                                                break;
                                                        }
                                        }


Line 1726 is in Red  ;) Hope you can find a solution.

[Unknown]

It should be:

if (isset($look_for{0}, $bbc_codes[$look_for{0}]))

-[Unknown]

digibike

#9
I fumbled when copiing the code. On line 1726 is the exact code you mentioned as you can see:

// The idea is, if we are LOOKING for a block level tag, we can close them on the way.
                                        if (isset($look_for{0}, $bbc_codes[$look_for{0}]))
                                        {
                                                foreach ($bbc_codes[$look_for{0}] as $temp)
                                                        if ($temp['tag'] == $look_for)
                                                        {
                                                                $block_level = !empty($temp['block_level']);
                                                                break;
                                                        }
                                        }


But since 13e of july I haven't seen any error like this. So maybe there was some self-repairing code in SMF :D For now I will check my logs and if it changes "I will be back" (no, I'm not from Austria)

PhrAcE

#10
Hi all,

we had the same error as stated above
QuoteNotice: Only variables should be assigned by reference in /var/www/domains/x.homespunpizza.com/docs/forums/Sources/Subs.php on line 232

I overwrote the Subs.php with the one given by Ben S
now, I get the following errors:
-a lot of avatars no longer work
-the wrapper no longer works (forum integrated in mambo-site)
-following error appears:
Fatal error: Call to undefined function: template_footer() in /usr/local/psa/home/vhosts/4bikers.be/httpdocs/forum/Sources/Subs.php on line 1300 and prevents users to log in...
Quote1298 // Just show the footer, then.
1299 loadSubTemplate(isset($context['sub_template']) ? $context['sub_template'] : 'main');
1300 template_footer();

anyone some advice?



I also tried removing the & from the original Subs.php and then I get the following error:
QuoteParse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /usr/local/psa/home/vhosts/4bikers.be/httpdocs/forum/Sources/Subs.php on line 1610

with 1610 bold:
Quote// Sets up the basic theme context stuff.
function setupThemeContext()
{
   global $modSettings, $user_info, $scripturl, $context, $settings, $options, $txt, $maintenance;

   // Get some news...
   $context['news_lines'] = explode("\n", str_replace("\r", '', trim(addslashes($modSettings['news']))));
   $context['fader_news_lines'] = array();
   for ($i = 0, $n = count($context['news_lines']); $i < $n; $i++)
   {
      if (trim($context['news_lines'][$i]) == '')
         continue;

      // Clean it up for presentation ;).
      $context['news_lines'][$i] = doUBBC(stripslashes(trim($context['news_lines'][$i])));

      // Gotta be special for the javascript.
      $context['fader_news_lines'][$i] = strtr(addslashes($context['news_lines'][$i]), array('/' => '\/', '<a href=' => '<a hre" + "f='));
   }
   $context['random_news_line'] ']= $context['news_lines'][rand(0, count($context['news_lines']) - 1)];
   if (!$user_info['is_guest'])
   {
      $context['user']['messages'] ']= &$user_info['messages'];
      $context['user']['unread_messages'] ']= &$user_info['unread_messages'];

      '];// Personal message popup...
      if ($user_info['unread_messages'] > (isset($_SESSION['unread_messages']) ? $_SESSION['unread_messages'] : 0))
         $context['user']['popup_messages'] = true;
      else
         $context['user']['popup_messages'] = false;
      $_SESSION['unread_messages'] = $user_info['unread_messages'];

      if (allowedTo('moderate_forum'))
         $context['unapproved_members'] = !empty($modSettings['registration_method']) && $modSettings['registration_method'] == 2 ? $modSettings['unapprovedMembers'] : 0;

      $context['user']['avatar'] = array();

      // Figure out the avatar... uploaded?
      if ($user_info['avatar']['url'] == '')
      {
         // If they are allowed to use an uploaded avatar.
         if (!empty($user_info['avatar']['ID_ATTACH']) && !empty($modSettings['avatar_allow_upload']))
            $context['user']['avatar']['href'] = $scripturl . '?action=dlattach;id=' . $user_info['avatar']['ID_ATTACH'] . ';type=avatar';
      }
      // Full URL?
      elseif (substr($user_info['avatar']['url'], 0, 7) == 'http://' && !empty($modSettings['avatar_allow_external_url']))
      {
         $context['user']['avatar']['href'] = $user_info['avatar']['url'];
         if ($modSettings['avatar_action_too_large'] == 'option_html_resize')
         {
            if (!empty($modSettings['avatar_max_width_external']))
               $context['user']['avatar']['width'] = $modSettings['avatar_max_width_external'];
            if (!empty($modSettings['avatar_max_height_external']))
               $context['user']['avatar']['height'] = $modSettings['avatar_max_height_external'];
         }
      }
      // Server stored?
      elseif (!empty($modSettings['avatar_allow_server_stored']))
         $context['user']['avatar']['href'] = $modSettings['avatar_url'] . '/' . htmlspecialchars($user_info['avatar']['url']);

      if (!empty($context['user']['avatar']))
         $context['user']['avatar']['image'] = '<img src="' . $context['user']['avatar']['href'] . '"' . (isset($context['user']['avatar']['width']) ? ' width="' . $context['user']['avatar']['width'] . '"' : '') . (isset($context['user']['avatar']['height']) ? ' height="' . $context['user']['avatar']['height'] . '"' : '') . ' alt="" border="0" />';

      // Figure out how long they've been logged in.
      $context['user']['total_time_logged_in'] = array(
         'days' => floor($user_info['total_time_logged_in'] / 86400),
         'hours' => floor(($user_info['total_time_logged_in'] % 86400) / 3600),
         'minutes' => floor(($user_info['total_time_logged_in'] % 3600) / 60)
      );
   }
   else
   {
      $context['user']['messages'] = 0;
      $context['user']['unread_messages'] = 0;
      $context['user']['avatar'] = array();
      $context['user']['total_time_logged_in'] = array('days' => 0, 'hours' => 0, 'minutes' => 0);
      $context['user']['popup_messages'] = false;

      if (!empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1)
         $txt['welcome_guest'] .= $txt['welcome_guest_activate'];
   }

   // Set up the menu privileges.
   $context['allow_search'] = allowedTo('search_posts');
   $context['allow_admin'] = allowedTo(array('admin_forum', 'manage_boards', 'manage_permissions', 'moderate_forum', 'manage_membergroups', 'manage_bans', 'send_mail', 'edit_news', 'manage_attachments', 'manage_smileys'));
   $context['allow_edit_profile'] = !$user_info['is_guest'] && allowedTo(array('profile_view_own', 'profile_view_any', 'profile_identity_own', 'profile_identity_any', 'profile_extra_own', 'profile_extra_any', 'profile_remove_own', 'profile_remove_any', 'moderate_forum', 'manage_membergroups'));
   $context['allow_calendar'] = allowedTo('calendar_view') && !empty($modSettings['cal_enabled']);

   $context['allow_pm'] = allowedTo('pm_read');

   $context['in_maintenance'] = !empty($maintenance);
   $context['current_time'] = timeformat(time(), false);
   $context['show_vBlogin'] = !empty($modSettings['enableVBStyleLogin']) && $user_info['is_guest'];

   // This is here because old index templates might still use it.
   $context['show_news'] = !empty($settings['enable_news']);

   // This is done to make it easier to add to all themes...
   if ($context['user']['popup_messages'] && !empty($options['popup_messages']))
   {
      $context['html_headers'] .= '
   <script language="JavaScript" type="text/javascript"><!--
      if (confirm("' . $txt['show_personal_messages'] . '"))
         hxxp:window.open [nonactive]("' . $scripturl . '?action=pm");
   // --></script>';
   }

   if (!isset($context['page_title']))
      $context['page_title'] = '';
}

[Unknown]

Please try uploading the file again - make sure it's in OVERWRITE mode.

-[Unknoen]

PhrAcE

Quote from: [Unknown] on July 21, 2005, 02:02:11 AM
Please try uploading the file again - make sure it's in OVERWRITE mode.
-[Unknoen]

I even deleted the subs.php-file from the server and uploaded the file... still the same...
-your file: forum works 90%
-our original file with the & removed: forum doesnt work, error in line 1610 (as mentioned above)

[Unknown]

The template_footer thing clearly indicates things weren't uploaded completely...

In the new file, it's '] '].  You're using Dreamweaver, aren't you?  It messes up PHP all the time.

-[Unknown]

PhrAcE

hmm, I indeed used DW to edit the files...
I re-upped your file without opening and now it's ok... thanks!!
sorry for the panic reaction but our admin is in the hospital, I'm only backup and still need to learn a lot...

itomic

Quote from: Tomer on July 13, 2005, 08:34:20 AM
Solution: Open /Sources/Subs.php

Find: = &mysql_query
Replace with: = mysql_query

- Tomer

Weird. I had a couple of forums running 1.05 perfectly fine, and then this morning we come in and have got the same error quoted in the original post, but the good news is that the above fixed worked for both.

My question is: what changed on our server over the w/e to cause this error?

My initial thought was the php had auto-upgraded to php 4.4 or 5, but I've checked that and it's not the case. We're still on 4.3.11.

Thanks.

[Unknown]

Well, I'm not sure what to tell you.

Only variables should be assigned by reference

Is a new error returned in PHP 4.4.0.

-[Unknown]

JayBachatero

Quote from: PhrAcE on July 22, 2005, 04:13:25 AM
hmm, I indeed used DW to edit the files...
I re-upped your file without opening and now it's ok... thanks!!
sorry for the panic reaction but our admin is in the hospital, I'm only backup and still need to learn a lot...
I suggest you use something like ConTExt to edit PHP files.  DW f***ed up a php script i was working on and i hard to restart the code go so messed up its not even funny.  Here is the link for ConTEXT.
www.context.cx
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert


Advertisement: