Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OSC CMS


digilee

Recommended Posts

I need to incorporate a cms as part of a new store I am building and opted for osCMS v0.1 - http://addons.oscommerce.com/info/3476

 

I had a few problems with the initial install but manage to fix most of them (the updates seemed to fix those that I already fixed!)

 

2 questions, 1, How do I fix the following problems:

 

PROBLEM 1:

In path-to-catalog/admin/cms_images.php

Fatal error: Call to undefined function: tep_info_cms_image() in path-to-catalog/admin/cms_images.php on line 200

 

cms_images.php line 200 is:

$contents[] = array('text' => '<br />' . tep_info_cms_image($iInfo->content_images_image, $iInfo->content_images_name));

 

PROBLEM 2:

When creating a new content item, on clicking 'preview' I get this error:

Fatal error: Call to undefined function: tep_cms_image_replace() in path-to-catalog/admin/cms_content.php on line 225

 

cms_content.php line 225 is:

<td class="main" valign="top"><?php echo tep_cms_image_replace(nl2br($cInfo->content_text[$i])); ?></td>

 

PROBLEM 3:

In application_top.php I need to include this, (strangely enough NOT including this line - the contrib displays fine!):

// osCMS

require(DIR_WS_FUNCTIONS . 'cms.php');

 

This brings up an error:

Fatal error: Cannot redeclare blockvars() (previously declared in /home/adhomine/public_html/includes/functions/cms.php:15) in path-to-catalog/includes/functions/cms.php on line 15

 

cms.php line 15 is:

function blockVars($sTpl,$beginSymbol='',$endSymbol='')

 

and my other question is ... Is this the best 'CMS' contrib to use?

 

I'll update if I manage to fix anything and, it goes without saying that I appreciate any input.

SolarFrenzy

Solar powered gadgets at down to earth prices.

 

CheekyNaughty

Promoting British Design

Link to comment
Share on other sites

I would think the functions

 

tep_cms_image_replace()

and

 

tep_cms_image()

 

are in

 

cms.php

 

Comment out the function blockvars() in cms.php and see if it works.

 

You might be best to find out where it already is on your web site and see if it is going to cause any problems

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

That just produces more errors.

 

This is the affected code:

 

function blockVars($sTpl,$beginSymbol='',$endSymbol='')
 {
if(strlen($beginSymbol) == 0) $beginSymbol = "{";
if(strlen($endSymbol) == 0) $endSymbol = "}";
$beginSymbolLength = strlen($beginSymbol);
$endTag = 0;
/* searching open symbol */
while (($beginTag = strpos($sTpl,$beginSymbol,$endTag)) !== false)
{
  /* searching close symbol */
  if (($endTag = strpos($sTpl,$endSymbol,$beginTag)) !== false)
  {
	/* add variable name to the array of variable */
	$vars[] = substr($sTpl, $beginTag + $beginSymbolLength, $endTag - $beginTag - $beginSymbolLength);
  }
}
/* if there is one or more variable in array then return this array */
if(isset($vars)) return $vars;
else return false;
 }

function tep_cms_image_replace($content_text)
{
$result = $content_text;
$vars = blockVars($result);
if($vars) foreach($vars as $key => $image_name){
	$content_image_query = tep_db_query("select content_images_image from " . TABLE_CONTENT_IMAGES . " where content_images_name='" . $image_name . "'");
	if(tep_db_num_rows($content_image_query)) {
		$content_image = tep_db_fetch_array($content_image_query);
		$result = str_replace("{".$image_name."}", tep_image(DIR_WS_CMS_IMAGES . $content_image['content_images_image']), $result);
	}else{
		$result = str_replace("{".$image_name."}", tep_image(DIR_WS_CMS_IMAGES . NO_CMS_IMAGE), $result);
	}
}

return $result;
}

SolarFrenzy

Solar powered gadgets at down to earth prices.

 

CheekyNaughty

Promoting British Design

Link to comment
Share on other sites

  • 1 month later...

Make sure that your editing correct file. Includes in catalog and admin both have application_top.php and its very easy to make a mistake. The error that you have posted here can be assessed as

 

In Admin section Error: Call to undefined function: [This means that function is not available and the reason could be that include state is missing or if the admin/includes/functions/cms.php is empty.

 

In catalog section Error: Fatal error: Cannot redeclare blockvars() [ This could be because of number of reasons and one that jumps to mind is that file is being included twice]

 

So in nutshell you might have added

 

require(DIR_WS_FUNCTIONS . 'cms.php');

 

twice in catalog/includes/application_top.php

 

and

 

non in catalog/admin/includes/application_top.php

 

 

Make sure there is only one include statement in catalog/includes/application_top.php

Search for cms.php and there should be only one in there.

 

In admin folder application_top.php is missing include statement for cms.php

Search for cms.php and there should be only one in there. If not found then add this

 

FIND (around line 140)

// Include validation functions (right now only email address)

require(DIR_WS_FUNCTIONS . 'validations.php');

 

ADD

// osCMS

require(DIR_WS_FUNCTIONS . 'cms.php');

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...