Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Article Manager v1.0


RobAnderson

Recommended Posts

Is it possible that the version "Ultimate SEO Urls 5 Pro" error occurs when installing "send data automatique feeder" in "article Manager" or "links manager"?. I do not run the web links of "Articles RSS Feed" and "link" to "links manager". Could have something to do with the version of "ultimate seo urls PRO"? ..

My problem to migrate to version "Ultimate SEO V 2.2d" is that I use the character conversion file because I have several languages ​​and is useful I also use it to include a word in the title of the web. So if the problem is the ultimate version, not sure I could keep doing it the same way ... maybe I'm anticipating before finding the solution ... Would it matter much if I solve it by simply removing the links on the web? ... I would appreciate some help. thanks

Consuelo

Link to comment
Share on other sites

I can't follow the problems you are having but if you turn off that addon and this one works, then that is the problem. SEO 5 had a large number of incompatibility problems when it came out. Most were fixed but, apparently, not this one.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hello: :)

 

I see that the updated files will be posted in the near future, but I am wondering if anyone has figured out what code needs to be added to the catalog/tell_a_friend.php file?

 

I would replace my existing file with the one in the latest download, but the file that is included with the latest download appears to have the same code as the osC 2.3.3 file.

 

I've made some of the changes, but I cannot find some of the code that I am supposed to change; specifically:

 

catalog/tell_a_friend.php file

FIND (about line 153):

 

<!-- body_text //-->

<td width="100%" valign="top"><?php echo tep_draw_form('email_friend', tep_href_link(FILENAME_TELL_A_FRIEND, 'action=process&products_id=' . $HTTP_GET_VARS['products_id'])); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading"><?php echo sprintf(HEADING_TITLE, $product_info['products_name']); ?></td>

 

 

REPLACE WITH:

 

<!-- body_text //-->

<?php /**** BEGIN ARTICLE MANAGER ****/ ?>

<td width="100%" valign="top">

<?php

// Modify form processing depending on whether product or article

if ($valid_product) {

echo tep_draw_form('email_friend', tep_href_link(FILENAME_TELL_A_FRIEND, 'action=process&products_id=' . $HTTP_GET_VARS['products_id']));

} else if ($valid_article) {

echo tep_draw_form('email_friend', tep_href_link(FILENAME_TELL_A_FRIEND, 'action=process&articles_id=' . $HTTP_GET_VARS['articles_id']));

}

?><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading">

<?php

// Modify heading depending on whether product or article

if ($valid_product) {

$title = $product_info['products_name'];

} else if ($valid_article) {

$title = $article_info['articles_name'];

}

echo sprintf(HEADING_TITLE, $title);

?>

</td>

<?php /**** END ARTICLE MANAGER ****/ ?>

 

 

ALSO:

 

FIND (about line 268):

 

<td><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td>

 

 

REPLACE WITH:

 

<td><?php

/**** BEGIN ARTICLE MANAGER ****/

// Modify back button depending on whether product or article

if ($valid_product) {

echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>';

} else if ($valid_article) {

echo '<a href="' . tep_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . $HTTP_GET_VARS['articles_id']) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>';

}

/**** END ARTICLE MANAGER ****/

?></td>

 

I am also not finding the following in includes/application_top.php:

 

FIND:

 

/*** End Header Tags SEO ***/

 

ADD BENEATH:

 

/**** BEGIN ARTICLE MANAGER ****/

// include the articles functions

require(DIR_WS_FUNCTIONS . 'articles.php');

 

// calculate topic path

if (isset($HTTP_GET_VARS['tPath'])) {

$tPath = $HTTP_GET_VARS['tPath'];

} elseif (isset($HTTP_GET_VARS['articles_id']) && !isset($HTTP_GET_VARS['authors_id'])) {

$tPath = tep_get_article_path($HTTP_GET_VARS['articles_id']);

} else {

$tPath = '';

}

 

if (tep_not_null($tPath)) {

$tPath_array = tep_parse_topic_path($tPath);

$tPath = implode('_', $tPath_array);

$current_topic_id = $tPath_array[(sizeof($tPath_array)-1)];

} else {

$current_topic_id = 0;

}

 

if (isset($_GET['articles_id'])) {

$articlesPage = FILENAME_ARTICLE_INFO . "?articles_id=" . $_GET['articles_id'];

$pageTags_query = tep_db_query("select page_name, page_title from " . TABLE_HEADERTAGS . " where page_name like '" . $articlesPage . "' and language_id = '" . (int)$languages_id . "' LIMIT 1");

if (tep_db_num_rows($pageTags_query) == 1) {

$pageTags = tep_db_fetch_array($pageTags_query);

$breadcrumb->add('Articles', tep_href_link(FILENAME_ARTICLES));

$breadcrumb->add($pageTags['page_title'], tep_href_link($articlesPage));

}

}

/**** END ARTICLE MANAGER ****/

 

Does anyone have a solution for that as well?

 

Thank you,

Jewell

Link to comment
Share on other sites

Has anyone successfully installed this add-on? If so, would you be able to share the code that you use in the includes/application_top.php and catalog/tell_a_friend.php file files?

 

I know that everyone's files will not be the same if modifications have been made, but it would give me a place to start ... allowing me to keep see what changes I need to make.

 

Thank you,

Jewell

Link to comment
Share on other sites

I don't know if it will help but this is the final version I will be releasing when I can. It is not complete, as mentioned previously, but it may get you farther along until the next version is released.

<?php
/*
 $Id$
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2010 osCommerce
 Released under the GNU General Public License
*/
 require('includes/application_top.php');
 if (!tep_session_is_registered('customer_id') && (ALLOW_GUEST_TO_TELL_A_FRIEND == 'false')) {
   $navigation->set_snapshot();
   tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }
/**** BEGIN ARTICLE MANAGER ****/
 $valid_product = false;
 if (isset($HTTP_GET_VARS['products_id'])) {
   $product_info_query = tep_db_query("select pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
   if (tep_db_num_rows($product_info_query)) {
  $valid_product = true;
  $product_info = tep_db_fetch_array($product_info_query);
   } else {
  tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
   }
 }

 $aID = 0;
 if (isset($HTTP_GET_VARS['articles_id'])) {
  $aID = $HTTP_GET_VARS['articles_id'];
 } else {
  foreach ($_GET as $id => $get) {
    if (strpos($id, 'articles_id') !== FALSE) {
	   $aID = $get;
	  //echo 'get '.$id .' - '.$get.'<br>';
   }
  }
 }
 $valid_article = false;
 if ($aID) {
   $article_info_query = tep_db_query("select pd.articles_name from " . TABLE_ARTICLES . " p left join " . TABLE_ARTICLES_DESCRIPTION . " pd on p.articles_id = pd.articles_id where p.articles_status = '1' and p.articles_id = '" . (int)$aID . "' and pd.language_id = '" . (int)$languages_id . "'");
   if (tep_db_num_rows($article_info_query)) {
  $valid_article = true;
  $article_info = tep_db_fetch_array($article_info_query);
   } else {
  tep_redirect(tep_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . (int)$aID));
   }
 }
 // Modify heading depending on whether product or article
 if ($valid_product) {
  $title = $product_info['products_name'];
 } else if ($valid_article) {
  $title = $article_info['articles_name'];
 }
 /**** END ARTICLE MANAGER ****/
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_TELL_A_FRIEND);
 if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
   $error = false;
   $to_email_address = tep_db_prepare_input($HTTP_POST_VARS['to_email_address']);
   $to_name = tep_db_prepare_input($HTTP_POST_VARS['to_name']);
   $from_email_address = tep_db_prepare_input($HTTP_POST_VARS['from_email_address']);
   $from_name = tep_db_prepare_input($HTTP_POST_VARS['from_name']);
   $message = tep_db_prepare_input($HTTP_POST_VARS['message']);
   if (empty($from_name)) {
  $error = true;
  $messageStack->add('friend', ERROR_FROM_NAME);
   }
   if (!tep_validate_email($from_email_address)) {
  $error = true;
  $messageStack->add('friend', ERROR_FROM_ADDRESS);
   }
   if (empty($to_name)) {
  $error = true;
  $messageStack->add('friend', ERROR_TO_NAME);
   }
   if (!tep_validate_email($to_email_address)) {
  $error = true;
  $messageStack->add('friend', ERROR_TO_ADDRESS);
   }
   $actionRecorder = new actionRecorder('ar_tell_a_friend', (tep_session_is_registered('customer_id') ? $customer_id : null), $from_name);
   if (!$actionRecorder->canPerform()) {
  $error = true;
  $actionRecorder->record(false);
  $messageStack->add('friend', sprintf(ERROR_ACTION_RECORDER, (defined('MODULE_ACTION_RECORDER_TELL_A_FRIEND_EMAIL_MINUTES') ? (int)MODULE_ACTION_RECORDER_TELL_A_FRIEND_EMAIL_MINUTES : 15)));
   }
   /**** BEGIN ARTICLE MANAGER ****/
   if ($error == false) {
  // Modify e-mail depending on whether prodect or article
  // if product
  if ($valid_product) {
    $email_subject = sprintf(TEXT_EMAIL_SUBJECT, $from_name, STORE_NAME);
    $email_body = sprintf(TEXT_EMAIL_INTRO, $to_name, $from_name, $product_info['products_name'], STORE_NAME) . "\n\n";
   /**** END ARTICLE MANAGER ****/
  if (tep_not_null($message)) {
    $email_body .= $message . "\n\n";
  }
  $email_body .= sprintf(TEXT_EMAIL_LINK, tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$HTTP_GET_VARS['products_id'], 'NONSSL', false)) . "\n\n" .
				 sprintf(TEXT_EMAIL_SIGNATURE, STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n");
  tep_mail($to_name, $to_email_address, $email_subject, $email_body, $from_name, $from_email_address);
  $actionRecorder->record();
  $messageStack->add_session('header', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT, $product_info['products_name'], tep_output_string_protected($to_name)), 'success');
    tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
    /**** BEGIN ARTICLE MANAGER ****/
    } else if ($valid_article) {
	  $email_subject = sprintf(TEXT_EMAIL_SUBJECT, $from_name, STORE_NAME);
	  $email_body = sprintf(TEXT_EMAIL_INTRO, $to_name, $from_name, $article_info['articles_name'], STORE_NAME) . "\n\n";
	  if (tep_not_null($message)) {
	    $email_body .= $message . "\n\n";
	  }
	  $email_body .= sprintf(TEXT_EMAIL_LINK_ARTICLE, tep_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . (int)$aID)) . "\n\n" .
					 sprintf(TEXT_EMAIL_SIGNATURE, STORE_NAME . "\n" . HTTP_SERVER . DIR_WS_CATALOG . "\n");
	  tep_mail($to_name, $to_email_address, $email_subject, $email_body, $from_name, $from_email_address);
	  $messageStack->add_session('header', sprintf(TEXT_EMAIL_SUCCESSFUL_SENT, $article_info['articles_name'], tep_output_string_protected($to_name)), 'success');
	  tep_redirect(tep_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . $aID));
    }
    /**** END ARTICLE MANAGER ****/
   }
 } elseif (tep_session_is_registered('customer_id')) {
   $account_query = tep_db_query("select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "'");
   $account = tep_db_fetch_array($account_query);
   $from_name = $account['customers_firstname'] . ' ' . $account['customers_lastname'];
   $from_email_address = $account['customers_email_address'];
 }
 /**** BEGIN ARTICLE MANAGER ****/
 if ($valid_product) {
   $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_TELL_A_FRIEND, 'products_id=' . $HTTP_GET_VARS['products_id']));
   } else if ($valid_article) {
  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_TELL_A_FRIEND, 'articles_id=' . $aID));
  }
 /**** END ARTICLE MANAGER ****/
 require(DIR_WS_INCLUDES . 'template_top.php');
?>
<h1><?php echo sprintf(HEADING_TITLE, $title); ?></h1>
<?php
 if ($messageStack->size('friend') > 0) {
   echo $messageStack->output('friend');
 }
?>
   <?php
  // Modify form processing depending on whether product or article
  if ($valid_product) {
    echo tep_draw_form('email_friend', tep_href_link(FILENAME_TELL_A_FRIEND, 'action=process&products_id=' . (int)$HTTP_GET_VARS['products_id']), 'post', '', true);
  } else if ($valid_article) {
    echo tep_draw_form('email_friend', tep_href_link(FILENAME_TELL_A_FRIEND, 'action=process&articles_id=' . (int)$aID), 'post', '', true);
  }
   ?>
<div class="contentContainer">
 <div>
   <span class="inputRequirement" style="float: right;"><?php echo FORM_REQUIRED_INFORMATION; ?></span>
   <h2><?php echo $title; ?></h2>
 </div>
 <div class="contentText">
   <table border="0" cellspacing="2" cellpadding="2" width="100%">
  <tr>
    <td class="fieldKey"><?php echo FORM_FIELD_CUSTOMER_NAME; ?></td>
    <td class="fieldValue"><?php echo tep_draw_input_field('from_name', $from_name); ?></td>
  </tr>
  <tr>
    <td class="fieldKey"><?php echo FORM_FIELD_CUSTOMER_EMAIL; ?></td>
    <td class="fieldValue"><?php echo tep_draw_input_field('from_email_address', $from_email_address); ?></td>
  </tr>
   </table>
 </div>
 <h2><?php echo FORM_TITLE_FRIEND_DETAILS; ?></h2>
 <div class="contentText">
   <table border="0" cellspacing="2" cellpadding="2" width="100%">
  <tr>
    <td class="fieldKey"><?php echo FORM_FIELD_FRIEND_NAME; ?></td>
    <td class="fieldValue"><?php echo tep_draw_input_field('to_name') . ' <span class="inputRequirement">' . ENTRY_FIRST_NAME_TEXT . '</span>'; ?></td>
  </tr>
  <tr>
    <td class="fieldKey"><?php echo FORM_FIELD_FRIEND_EMAIL; ?></td>
    <td class="fieldValue"><?php echo tep_draw_input_field('to_email_address') . ' <span class="inputRequirement">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>'; ?></td>
  </tr>
   </table>
 </div>
 <h2><?php echo FORM_TITLE_FRIEND_MESSAGE; ?></h2>
 <div class="contentText">
   <table border="0" cellspacing="2" cellpadding="2" width="100%">
  <tr>
    <td class="fieldValue"><?php echo tep_draw_textarea_field('message', 'soft', 40, 8); ?></td>
  </tr>
  <tr>
    <td><table border="0" width="100%" cellspacing="1" cellpadding="2">
	  <tr >
	    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr>
		    <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
<?php
	   // Modify back button depending on whether product or article
		    if ($valid_product) {
			   $backButton = tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w', tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . (int)$HTTP_GET_VARS['products_id']));
		    } else if ($valid_article) {
			   $backButton = tep_draw_button(IMAGE_BUTTON_BACK, 'triangle-1-w', tep_href_link(FILENAME_ARTICLE_INFO, 'articles_id=' . (int)$HTTP_GET_VARS['products_id']));									   
		    }
		   /**** END ARTICLE MANAGER ****/
		    ?>

		  </tr>
	    </table></td>
	  </tr>
    </table></td>
  </tr>
   </table>
 </div>
 <div class="buttonSet">
   <span class="buttonAction"><?php echo tep_draw_button(IMAGE_BUTTON_SENDEMAIL, 'triangle-1-e', null, 'primary'); ?></span>
   <?php echo $backButton; ?>
 </div>
</div>
</form>
<?php
 require(DIR_WS_INCLUDES . 'template_bottom.php');
 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Thank you so much, Jack! I will try this out right away! I appreciate your help!

 

Do you have any suggestions regarding the I am also not finding the following in includes/application_top.php file? I'm not finding the following code to replace:

 

/*** End Header Tags SEO ***/

 

Thanks again!

Jewell :)

Edited by jeu4328
Link to comment
Share on other sites

My version requires Header Tags SEO to be installed. If you are not using it and don't want to install it, you can't use my version of this addon, at least, without many edits.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Hi, Jack: I'm trying to install Header Tags SEO, but after changing files I am unable to access my website. I receive this error message:

 

Passenger error #2

 

An error occurred while trying to access '/home4/jeu4328/config.ru': Cannot stat '/home4/jeu4328/config.ru': Permission denied (13)

Apache doesn't have read permissions to that file. Please fix the relevant file permissions.

 

Can you tell me where I need to go to correct this problem?

 

Thank you,

Jewell

Edited by jeu4328
Link to comment
Share on other sites

Host should: sudo apachectl graceful

 

But a .ru file is for Ruby on Rails, no? If so, you don't need such an account to run osCommerce, so (if they know how) get them to turn it off.

 

Hi, Burt: :(

 

The tech who helped me in the HostGator Chat Room could not find config.ru file and told me that I need to contact a webmaster or expert developer. That's a heck of a note!

 

He said he didn't think it was a database error, but a site code error. I have no idea what that means.

 

Anyway, he wanted to charge me $15 to restore my database from backup ... but he doesn't think that is the problem.

 

I'm totally frustrated and discouraged. At this point my website is not accessible at all.

 

I tried to go in and re-install osC ... thinking that if I have to start from scratch, now is the time to upgrade to 2.3.3.4. However, I get the same error message when I try to install the new osC:

 

Passenger error #2

 

An error occurred while trying to access '/home4/jeu4328/config.ru': Cannot stat '/home4/jeu4328/config.ru': Permission denied (13)

Apache doesn't have read permissions to that file. Please fix the relevant file permissions.

 

Have you ever seen that error?

 

Thank you,

Jewell

Link to comment
Share on other sites

well tell them you do not simply you do not use ruby that you are using oscommerce and ask why you are getting a ruby error

 

/home4/jeu4328/config.ru

where the files SHOULD NOT EXIST .ask maybe for 15 dollars back for bad service (w00t)

 

Probably something to do with the shared hosting but is a server problem and they should sort!!

 

Regards

John

Edited by joli1811
To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

Thank you :) I actually didn't go for it. He said that he could restore the database from backup, but it would cost me $15. So I declined. I am on 'hold', waiting to reach a tech to help me.

 

I've never had this type of problem ... and hope to never have it again! ha!

 

Have a great evening!

Jewell

Link to comment
Share on other sites

Skip the tech and go for direct email support you will maybe reach somebody better !!

 

The tech will have a title but normally know as much as I would about putting an eyeliner on :D

 

just my experience

 

john

 

PS: open your ftp... /public_html/ and delete any files ending in ru

 

actually looks one level above your /public_html/ so maybe you can not see so it is a host/server problem

Edited by joli1811
To improve is to change; to be perfect is to change often.

 

Link to comment
Share on other sites

Thank you, John: I'm not even able to get into my cPanel anymore. I get the same error message. <<sigh>>

I'm so disgusted! <_<

 

I've sent them an email. I hope they get back to me soon!

 

Thanks again for your help and encouragement,

Jewell

Link to comment
Share on other sites

  • 2 months later...

@Jack_mcs

 

Also I have this problem:

 

 

Cross-Sell Articles to Products

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1)' at line 1

 

INSERT INTO articles_xsell VALUES ('',0,,1)

 

[TEP STOP]

Edited by gvv
Link to comment
Share on other sites

For the first problem, look at that line in that file to see what code is causing the failure. My guess is that it is the article_info entry. Maybe it is corrupted for some reason, though I don't know why it might be.

 

For the second problem, what version of oscommerce are you using? What version of php?

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

For the first problem, look at that line in that file to see what code is causing the failure. My guess is that it is the article_info entry. Maybe it is corrupted for some reason, though I don't know why it might be.

 

For the second problem, what version of oscommerce are you using? What version of php?

 

When Im installing new addon I always backup all site and tables. So I uploaded header_tags.php from previous backup and all works.

When I compared this two files (header_tags.php from backup and from store wich doesnt work) I found in store file entry (it was yestarday night) if I remember correctly it was article_info.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...