Jump to content
Latest News: (loading..)
kymation

[Contribution] Documents Manager

Recommended Posts

Yes, you can add new document classes fairly easily. You can then display your new class using the code form product_info.php, with an if() statement to select only your new class. This is pretty much beginner-level PHP.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Yes, you can add new document classes fairly easily. You can then display your new class using the code form product_info.php, with an if() statement to select only your new class. This is pretty much beginner-level PHP.

 

Regards

Jim

 

 

Hi Jim,

 

Thanks for reply. Will try to study the product_info.php and find the way to get the code working. I never study PHP before, hope it won't take long for me to achieve the beginner-level PHP.

 

Once again, thank you!

 

Lyn

Share this post


Link to post
Share on other sites

@ kymation

 

Hi Jim,

 

Kenja gave me docuemnt manager for osC2.3.1 before, got some errors, and finally it is working now.

 

However, it is not completely right. As under catalog / Document Manager, I can make new document type, which also save in the database.

I can upload files into Brochure, Product Catalog, Video Demos, Forms, Manuals, MSDS, Parts Lists, they all save into database as well.

However I can not uplaod the files into new document types I made. On front page, cause no files uploaded to the new document type, so it doesn't come up to the different infobox I requested.

 

which files I should check and modify? many thanks in advance.

 

Lyn

 

admin/documents.php

<?php
/*
$Id$
osCommerce, Open Source E-Commerce Solutions
[url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]
Copyright (c) 2010 osCommerce
Released under the GNU General Public License
*/
class bm_information {
var $code = 'bm_information';
var $group = 'boxes';
var $title;
var $description;
var $sort_order;
var $enabled = false;
var $pages;

function bm_information() {
$this->title = MODULE_BOXES_INFORMATION_TITLE;
$this->description = MODULE_BOXES_INFORMATION_DESCRIPTION;
$this->pages = MODULE_BOXES_INFORMATION_DISPLAY_PAGES;
if ( defined('MODULE_BOXES_INFORMATION_STATUS') ) {
$this->sort_order = MODULE_BOXES_INFORMATION_SORT_ORDER;
$this->enabled = (MODULE_BOXES_INFORMATION_STATUS == 'True');
$this->group = ((MODULE_BOXES_INFORMATION_CONTENT_PLACEMENT == 'Left Column') ? 'boxes_column_left' : 'boxes_column_right');
}
}
function execute() {
global $oscTemplate;
// BOF: Information Pages Unlimited BOX03
require_once(DIR_WS_FUNCTIONS . 'information.php');
// EOF: Information Pages Unlimited BOX03

//BOF Documents Manager _005_P67_Extra
$documents_string = '';
$document_type_array = document_types();
foreach ($document_type_array as $document_type) {
$documents_query_raw = "
select
count(*) as total
from
" . TABLE_DOCUMENTS . "
where
document_types_id = '" . $document_type['id'] . "'
and documents_visible = 'True'
";
// print 'Documents Query: ' . $documents_query_raw . '<br>';
$documents_query = tep_db_query( $documents_query_raw );
$documents = tep_db_fetch_array( $documents_query );
if ($documents['total'] > 0 AND $document_type['id'] !=='3' ) { // if ($documents['total'] > 0) {
$documents_string .= '<a href="' . tep_href_link (FILENAME_DOCUMENTS, 'type=' . $document_type['id'], 'NONSSL') . '">' . $document_type['text'] . '</a><br />' . "\n";
} // if ($documents['total']
} // foreach ($document_type_array
//EOF Documents Manager _005_P67_Extra
$data = '<div class="ui-widget infoBoxContainer">' .
' <div class="ui-widget-header ui-corner-top infoBoxHeading">' . MODULE_BOXES_INFORMATION_BOX_TITLE . '</div>' .
' <div class="ui-widget-content ui-corner-bottom infoBoxContents">' . tep_information_show_category(1) .
// ' <a href="' . tep_href_link(FILENAME_SHIPPING) . '">' . MODULE_BOXES_INFORMATION_BOX_SHIPPING . '</a><br />' .
// ' <a href="' . tep_href_link(FILENAME_PRIVACY) . '">' . MODULE_BOXES_INFORMATION_BOX_PRIVACY . '</a><br />' .
// ' <a href="' . tep_href_link(FILENAME_CONDITIONS) . '">' . MODULE_BOXES_INFORMATION_BOX_CONDITIONS . '</a><br />' .
/***** Begin Sitemap_SEO BOX09 *****/
' <a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . MODULE_BOXES_INFORMATION_BOX_CONTACT . '</a><br />' .
$documents_string .
// BOF Event Schedule 3.0 _RENT02
' <a href="' . tep_href_link(FILENAME_EVENT_SCH) . '">' . BOX_INFORMATION_EVENT_SCH . '</a><br />' .
// EOF Event Schedule 3.0 _RENT02
' <a href="' . tep_href_link(FILENAME_SITEMAP_SEO) . '">' . MODULE_BOXES_INFORMATION_BOX_SITEMAP_SEO . '</a>' .
/***** End Sitemap_SEO BOX09 *****/
' </div>' .
'</div>';
$oscTemplate->addBlock($data, $this->group);
}
function isEnabled() {
return $this->enabled;
}
function check() {
return defined('MODULE_BOXES_INFORMATION_STATUS');
}
function install() {
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Information Module', 'MODULE_BOXES_INFORMATION_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Placement', 'MODULE_BOXES_INFORMATION_CONTENT_PLACEMENT', 'Left Column', 'Should the module be loaded in the left or right column?', '6', '1', 'tep_cfg_select_option(array(\'Left Column\', \'Right Column\'), ', now())");
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_BOXES_INFORMATION_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
// BOF 121016_02_BOX049 Dynamic_Template_System_V2_EN
tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Display in pages.', 'MODULE_BOXES_INFORMATION_DISPLAY_PAGES', 'all', 'select pages where this box should be displayed. ', '6', '0','tep_cfg_select_pages(' , now())");
// EOF 121016_02_BOX049 Dynamic_Template_System_V2_EN
}
function remove() {
tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
}
function keys() {
return array('MODULE_BOXES_INFORMATION_STATUS', 'MODULE_BOXES_INFORMATION_CONTENT_PLACEMENT', 'MODULE_BOXES_INFORMATION_SORT_ORDER', 'MODULE_BOXES_INFORMATION_DISPLAY_PAGES');
}
}
?>


Share this post


Link to post
Share on other sites

Did you create a directory under /documents that exactly matches your new document type? That's the only thing I can think of that would stop the files being uploaded.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi Jim,

 

Thank you very much for your quick reply.

Really respect you, can help people and give right direction / quick correction.

 

I didn't know has to make a folder there even though it has set up there.

I now can save them and make them show in different infobox.

 

The only thing need to modify is the image next to the document name.

 

Once again, thank you so much.

 

Lyn

Share this post


Link to post
Share on other sites

this contribution was installed in my shop .. but when open the manager gives me the following error:

 

Fatal error: Call to undefined function tep_get_version () in C: \ Program Files \ AppServ \ www \ catalog \ admin \ includes \ header.php on line 20

please could help me solve this problem .. they are grateful .

. :'(

Share this post


Link to post
Share on other sites

The tep_get_version() function is a part of stock osCommerce 2.3.x. This addon only has 2.2x code, so it will not be calling for that function. This error is probably the result of something else that you installed. Always check that the version of an Addon matches your store before installing.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

ok thank you very much .. But there will be some way to adapt its response to 2.3.3 will be helpful

Share this post


Link to post
Share on other sites

is very important please help and sorry if I upset

:'(

Share this post


Link to post
Share on other sites

ok but then could you give me a link where you can download the version 2.3.3 and contribution to not want to seem lazy .. what happens is that I have more than two months looking and find nothing. Please be of much help.

 

:'(

Share this post


Link to post
Share on other sites

I know that I have no experience of php programmer and much less just am a person who needs to mount their website but with low income.

so I'm asking for help

o:)

Share this post


Link to post
Share on other sites

hello good afternoon ... I will help in this problem.?? I would add an additional page to upload new to osCommerce uses an image with some imformacion .. My version is 2.3 .. if I can help I would appreciate

Share this post


Link to post
Share on other sites

I'm sorry, but I don't understand what this new page will be used for. The Document Manager already has a page that lists all of the documents, so no additional page should be needed.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi I have a picture and I put on a page but without straying from the index or center of the page as I aria in this case my version is 2.3.3

Share this post


Link to post
Share on other sites

I'm sorry, this does not make any sense. Please get someone to help you with your English.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

excuse what happened is that I do not speak English .. I'm doing everything possible to make

Share this post


Link to post
Share on other sites

@ kymation

 

Hi Jim,

 

Happy New Year 2013.

 

I have question about the document manager again.

 

I had set up some extra different document type. Example: resume.

 

I had catalog/documents/resume (folder) as well.

 

In the admin, I upload the resume: staff_01.pdf, and it saved in the admin and database.

So I can see catalog/documents/resume/staff_01.pdf

 

When I go to the front end, it show up the link page Resume,

but when I click on the resume, it showed me:

 

TITLE

 

There are currently no documents in this category.

 

What should I do to make the document visible, did i do something wrong so it doesn't show up?

 

Many thanks in advance.

 

Lyn

Share this post


Link to post
Share on other sites

@ kymation

 

Jim,

 

another question about the video demo, which I also have problem to show on front page.

 

I don't want to upload a video demo and save it on my sever, cause my videos I need to upload is more then 20MB each one which my sever can not handle it.

 

How can I make a image show up for each video demo and then they link to other website like vismo or youtube?

 

Many thanks.

 

Lyn

Share this post


Link to post
Share on other sites

1. Did you add your new document type to the document_types table in the database?

 

2. The Document Manager is coded to handle documents stored on your server. There is no option for external files. You would have to code that capability.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

1. Did you add your new document type to the document_types table in the database?

 

2. The Document Manager is coded to handle documents stored on your server. There is no option for external files. You would have to code that capability.

 

Regards

Jim

 

Yes, Jim,

1. I had save the document type to the document_types table in the database. It show in the database and also admin, but it doesn't show in the front end. what should I check next?

2. I think I will just add a page with table and screen shot with link. I will have a try now.

 

Thanks.

 

Lyn

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×