Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fatal Error


gaspower

Recommended Posts

Hello,

 

I get this error:

Fatal error: Call to undefined function tep_get_sources() in /home/virtual/site3/fst/var/www/html/create_account.php on line 508

 

After installing the code in create_account.php

<!-- //rmh referral start -->
<?php
 if ((tep_not_null(tep_get_sources()) || DISPLAY_REFERRAL_OTHER == 'true') && (!tep_session_is_registered('referral_id') || (tep_session_is_registered('referral_id') && DISPLAY_REFERRAL_SOURCE == 'true')) ) {
?>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td class="main"><b><?php echo CATEGORY_SOURCE; ?></b></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" cellspacing="2" cellpadding="2">
             <tr>
               <td class="main"><?php echo ENTRY_SOURCE; ?></td>
               <td class="main"><?php echo tep_get_source_list('source', (DISPLAY_REFERRAL_OTHER == 'true' || (tep_session_is_registered('referral_id') && tep_not_null($referral_id)) ? true : false), (tep_session_is_registered('referral_id') && tep_not_null($referral_id)) ? '9999' : '') . ' ' . (tep_not_null(ENTRY_SOURCE_TEXT) ? '<span class="inputRequirement">' . ENTRY_SOURCE_TEXT . '</span>': ''); ?></td>
             </tr>
<?php
   if (DISPLAY_REFERRAL_OTHER == 'true' || (tep_session_is_registered('referral_id') && tep_not_null($referral_id))) {
?>
             <tr>
               <td class="main"><?php echo ENTRY_SOURCE_OTHER; ?></td>
               <td class="main"><?php echo tep_draw_input_field('source_other', (tep_not_null($referral_id) ? $referral_id : '')) . ' ' . (tep_not_null(ENTRY_SOURCE_OTHER_TEXT) ? '<span class="inputRequirement">' . ENTRY_SOURCE_OTHER_TEXT . '</span>': ''); ?></td>
             </tr>
<?php
   }
?>
           </table></td>
         </tr>
       </table></td>
     </tr>
<?php
 } else if (DISPLAY_REFERRAL_SOURCE == 'false') {
     echo tep_draw_hidden_field('source', ((tep_session_is_registered('referral_id') && tep_not_null($referral_id)) ? '9999' : '')) . tep_draw_hidden_field('source_other', (tep_not_null($referral_id) ? $referral_id : ''));
 }
?>
<!-- //rmh referral end -->

 

Right after the line:

 

<td class="main"><?php echo tep_draw_checkbox_field('newsletter', '1') . ' ' . (tep_not_null(ENTRY_NEWSLETTER_TEXT) ? '<span class="inputRequirement">' . ENTRY_NEWSLETTER_TEXT . '</span>': ''); ?></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

 

Thanks JR

Link to comment
Share on other sites

Read the install instructions again - you have missed an edit probably in a functions file

 

Probably this one in includes/functions/general.php

 

////rmh referral

// Returns an array with sources

// TABLES: sources

function tep_get_sources($sources_id = '') {

$sources_array = array();

if (tep_not_null($sources_id)) {

$sources = tep_db_query("select sources_name from " . TABLE_SOURCES . " where sources_id = '" . (int)$sources_id . "'");

$sources_values = tep_db_fetch_array($sources);

$sources_array = array('sources_name' => $sources_values['sources_name']);

} else {

$sources = tep_db_query("select sources_id, sources_name from " . TABLE_SOURCES . " order by sources_name");

while ($sources_values = tep_db_fetch_array($sources)) {

$sources_array[] = array('sources_id' => $sources_values['sources_id'],

'sources_name' => $sources_values['sources_name']);

}

}

 

return $sources_array;

}

Edited by crash3903

Regards

 

Mark A Reynolds

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...