Full service web hosting, great prices and support. Starts at $1.99/month!
Results 1 to 8 of 8

Thread: Links Manager For OSC v0.20 -- Help Please

  1. #1
    lil-raskals
    Guest


    Default Links Manager For OSC v0.20 -- Help Please

    I am looking to install this module "Links Manager For OSC v0.20"
    Before I get started, I have a couple of questions. I was reading the instructions thoroughly before I get started and stumped. In the instructions, see below: Step 3 & 4 I do not understand. Sounds like to me that a SQL script would be run to modify the data base? I don't understand because there was no SQL file included in the module.
    Can any one help me with this? Has any one used this mod before?

    Thanks
    Carla

    INSTALLATION
    ------------

    Step 1: Copy all the files listed in the "file additions" section to their respective directories.

    Step 2: Make changes in the files listed in the "file modifications" section.

    Step 3: Fire up your browser and run /catalog/links_setup.php, to update your database.

    Step 4: Delete /catalog/links_setup.php (THIS IS IMPORTANT, as your data can be overwritten, if the script is run again).

    Step 5: Admin -> Configuration -> Links, Admin -> Links Manager to get started.

  2. #2
    lil-raskals
    Guest


    Default RE: Links Manager For OSC v0.20 -- Help Please

    Well guys, I'm down to begging......
    I went ahead and installed this module. went step by step, everything good except the step number 3. If Any one know what is suppose to happen here, PLEASE let me know. Sounds like a database update is suppose to happen, but how? The only way I know how to execute that would be in "Mysql". But he talks about firing up a browser to update the DB with a .php file. Should there be a .sql file here? below is a copy of that links_setup.php file. Please any one now what up with this???

    <?php
    /*
    $Id: links_setup.php,v 1.00 2003/10/02 Exp $

    osCommerce, Open Source E-Commerce Solutions
    http://www.oscommerce.com

    Copyright (c) 2003 osCommerce

    Released under the GNU General Public License
    */

    require('includes/application_top.php');

    // check if links db already installed
    $links_check_query = tep_db_query("select * from configuration_group where configuration_group_title = 'Links'");

    if (tep_db_num_rows($links_check_query) > 0) {
    echo 'Looks like Links Manager is already installed. Aborting...';
    tep_exit();
    }

    $links_sql_array = array(array("DROP TABLE IF EXISTS link_categories"),
    array("CREATE TABLE link_categories (link_categories_id int NOT NULL auto_increment, link_categories_image varchar(64), link_categories_sort_order int(3), link_categories_date_added datetime, link_categories_last_modified datetime, link_categories_status tinyint(1) NOT NULL, PRIMARY KEY (link_categories_id), KEY idx_link_categories_date_added (link_categories_date_added))"),
    array("DROP TABLE IF EXISTS link_categories_description"),
    array("CREATE TABLE link_categories_description (link_categories_id int DEFAULT '0' NOT NULL, language_id int DEFAULT '1' NOT NULL, link_categories_name varchar(32) NOT NULL, link_categories_description text, PRIMARY KEY (link_categories_id, language_id), KEY idx_link_categories_name (link_categories_name))"),
    array("DROP TABLE IF EXISTS links_to_link_categories"),
    array("CREATE TABLE links_to_link_categories (links_id int NOT NULL, link_categories_id int NOT NULL, PRIMARY KEY (links_id,link_categories_id))"),
    array("DROP TABLE IF EXISTS links"),
    array("CREATE TABLE links (links_id int NOT NULL auto_increment, links_url varchar(255), links_reciprocal_url varchar(255), links_image_url varchar(255), links_contact_name varchar(64), links_contact_email varchar(96), links_date_added datetime NOT NULL, links_last_modified datetime, links_status tinyint(1) NOT NULL, links_clicked int NOT NULL default '0', links_rating tinyint(1) NOT NULL, PRIMARY KEY (links_id), KEY idx_links_date_added (links_date_added))"),
    array("DROP TABLE IF EXISTS links_description"),
    array("CREATE TABLE links_description (links_id int NOT NULL auto_increment, language_id int NOT NULL default '1', links_title varchar(64) NOT NULL default '', links_description text, PRIMARY KEY (links_id,language_id), KEY links_title (links_title))"),
    array("DROP TABLE IF EXISTS links_status"),
    array("CREATE TABLE links_status (links_status_id int DEFAULT '0' NOT NULL, language_id int DEFAULT '1' NOT NULL, links_status_name varchar(32) NOT NULL, PRIMARY KEY (links_status_id, language_id), KEY idx_links_status_name (links_status_name))"),
    array("INSERT INTO links_status VALUES ( '1', '1', 'Pending')"),
    array("INSERT INTO links_status VALUES ( '2', '1', 'Approved')"),
    array("INSERT INTO links_status VALUES ( '3', '1', 'Disabled')"));

    $db_error = false;

    // create tables
    foreach ($links_sql_array as $sql_array) {
    foreach ($sql_array as $value) {
    //echo $value . '<br>';
    if (tep_db_query($value) == false) {
    $db_error = true;
    }
    }
    }

    // create configuration group
    $group_query = "INSERT INTO configuration_group (configuration_group_title, configuration_group_description, sort_order) VALUES ('Links', 'Links Manager configuration options', '99')";

    if (tep_db_query($group_query) == false) {
    $db_error = true;
    }

    $configuration_group_id = tep_db_insert_id();

    // create configuration variables
    $config_sql_array = array(array("INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Click Count', 'ENABLE_LINKS_COUNT', 'True', 'Enable links click count.', '" . $configuration_group_id . "', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"),
    array("INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Spider Friendly Links', 'ENABLE_SPIDER_FRIENDLY_LINKS', 'True', 'Enable spider friendly links (recommended).', '" . $configuration_group_id . "', '2', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())"),
    array("INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Links Image Width', 'LINKS_IMAGE_WIDTH', '120', 'Maximum width of the links image.', '" . $configuration_group_id . "', '3', now())"),
    array("INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Links Image Height', 'LINKS_IMAGE_HEIGHT', '60', 'Maximum height of the links image.', '" . $configuration_group_id . "', '4', now())"),
    array("INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Link Image', 'LINK_LIST_IMAGE', '1', 'Do you want to display the Link Image?', '" . $configuration_group_id . "', '5', now())"),
    array("INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Link URL', 'LINK_LIST_URL', '4', 'Do you want to display the Link URL?', '" . $configuration_group_id . "', '6', now())"),
    array("INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Link Title', 'LINK_LIST_TITLE', '2', 'Do you want to display the Link Title?', '" . $configuration_group_id . "', '7', now())"),
    array("INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Link Description', 'LINK_LIST_DESCRIPTION', '3', 'Do you want to display the Link Description?', '" . $configuration_group_id . "', '8', now())"),
    array("INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Display Link Click Count', 'LINK_LIST_COUNT', '5', 'Do you want to display the Link Click Count?', '" . $configuration_group_id . "', '9', now())"),

    array("INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Link Title Minimum Length', 'ENTRY_LINKS_TITLE_MIN_LENGTH', '2', 'Minimum length of link title.', '" . $configuration_group_id . "', '10', now())"),
    array("INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Link URL Minimum Length', 'ENTRY_LINKS_URL_MIN_LENGTH', '10', 'Minimum length of link URL.', '" . $configuration_group_id . "', '11', now())"),
    array("INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Link Description Minimum Length', 'ENTRY_LINKS_DESCRIPTION_MIN_LENGTH', '10', 'Minimum length of link description.', '" . $configuration_group_id . "', '12', now())"),
    array("INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Link Contact Name Minimum Length', 'ENTRY_LINKS_CONTACT_NAME_MIN_LENGTH', '2', 'Minimum length of link contact name.', '" . $configuration_group_id . "', '13', now())"),

    array("INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Links Check Phrase', 'LINKS_CHECK_PHRASE', '" . $HTTP_SERVER_VARS['SERVER_NAME'] . "', 'Phrase to look for, when you perform a link check.', '" . $configuration_group_id . "', '14', now())"));

    foreach ($config_sql_array as $sql_array) {
    foreach ($sql_array as $value) {
    //echo $value . '<br>';
    if (tep_db_query($value) == false) {
    $db_error = true;
    }
    }
    }

    ?>
    <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html <?php echo HTML_PARAMS; ?>>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
    <title><?php echo TITLE; ?></title>
    <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
    <link rel="stylesheet" type="text/css" href="stylesheet.css">
    </head>
    <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
    <!-- header //-->
    <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
    <!-- header_eof //-->

    <!-- body //-->
    <table border="0" width="100%" cellspacing="3" cellpadding="3">
    <tr>
    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
    <!-- left_navigation //-->
    <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
    <!-- left_navigation_eof //-->
    </table></td>
    <!-- body_text //-->
    <td width="100%" valign="top"><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 'Links Manager Setup'; ?></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>
    <tr>
    <td class="main">
    <?php
    if ($db_error == false) {
    echo 'Database successfully updated!!!';
    } else {
    echo 'Error encountered during database update.';
    }
    ?>
    </td>
    </tr>
    <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>
    </table></td>
    <!-- body_text_eof //-->
    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
    <!-- right_navigation //-->
    <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
    <!-- right_navigation_eof //-->
    </table></td>
    </tr>
    </table>
    <!-- body_eof //-->

    <!-- footer //-->
    <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
    <!-- footer_eof //-->
    <br>
    </body>
    </html>
    <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

    1

  3. #3
    osCMax Developer


    Links Manager For OSC v0.20 -- Help Please


    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    23,134
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    michael_s     $ 10.00
    Rep Power
    598


    Default RE: Links Manager For OSC v0.20 -- Help Please

    What is so hard to understand?

    In your browser, visit http://yoursite.com/catalog/links_setup.php

    It will do the rest. It is an installer/setup script.

    As you can see in the php above, it adds the fields and data to the database. See all those nifty array("CREATE TABLE and array("INSERT INTO statements? Those are sql commands to create tables and insert data. PHP can do the same thing as an sql file. This mod has actually made things easy for you. All you have to do is visit the script in your browser and it automatically does the job.

    Just follow the instructions and stop thinking so much, it works for me...

  4. #4
    lil-raskals
    Guest


    Default RE: Links Manager For OSC v0.20 -- Help Please

    Ok, thanks. Thats all I needed to know. I did not realize that this was a another way to do this.
    Forgive me for the bother.

  5. #5
    osCMax Developer


    Links Manager For OSC v0.20 -- Help Please


    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    23,134
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    michael_s     $ 10.00
    Rep Power
    598


    Default RE: Links Manager For OSC v0.20 -- Help Please

    Glad I could help. It just makes me crazy when all you have to do is follow the instructions given. Instead of wasting a couple of days waiting for someone to tell you to follow the instructions, why not just try following them once and see what happens?

    By simply jumping in with both feet, you would have saved yourself a couple of days. The absolute worst that could happen is that the script fails. At least you would gain an understanding of how that script works (or doesn't). I do not mind helping out, and giving instructions, but sometimes I wonder what the issue is, and I just have to ask.

    I read the above instructions, and the only thing I could come up with is that you did not understand how to add that path to your browser. Was that the issue? I am curious because I do write a lot of instructions, and it is good to confirm where the hangup was. I would appreciate you letting me know.

  6. #6
    lil-raskals
    Guest


    Default RE: Links Manager For OSC v0.20 -- Help Please

    Thanks, I was following the instructions, but when youre new to OSC, and the other modules I've installed called for running the script in MYSQL, It just did not "click" to me that the similar script could be run from the browser. Maybe if he'd put the full path with domain as an example I would have knew right away what he was talking about. Maybe all the other new people that don't know any better would learn from this. It just makes me crazy when modules come with instructions that are vague and unclear. Not everyone starting in OCS are pro's.

    Well, all the trouble and it doesn't work anyway. I get this error when I click on the "links" from my home page.

    Fatal error: Cannot redeclare tep_db_connect() (previously declared in /hsphere/local/home/abuata/lil-raskals.com/catalog/includes/functions/database.php:13) in /hsphere/local/home/abuata/lil-raskals.com/catalog/includes/functions/database.php on line 13

    Starting to think that this is not the module I needed. I thought this module allowed you to set up new links from the admin area. But there is nowhere to do that, It's all about how to set up your preferences for your links. Maybe I should have another module for the creating of links.

    Thanks for your help.
    www.lil-raskals.com

  7. #7
    osCMax Developer


    Links Manager For OSC v0.20 -- Help Please


    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    23,134
    Contribute If you enjoy reading the
    content here, click the below
    image to support our site.
    Click Here To Contribute To Our Site

    Total Contributions For

    michael_s     $ 10.00
    Rep Power
    598


    Default RE: Links Manager For OSC v0.20 -- Help Please

    Yes, that is the hard thing about writing documentation - what is clear to me is vague to another. Thanks for the feedback.

    The error you are getting most likely is because of a missed step in the installation. Make sure you check your install... I am not familiar with the mod you are installing, but it sounds like it will allow you to have a links section on your shop...

  8. #8
    lil-raskals
    Guest


    Default RE: Links Manager For OSC v0.20 -- Help Please

    Still having problems:
    I went through the install and did find that I copied this:

    ------------------------------------
    /catalog/admin/includes/filenames.php
    ------------------------------------

    add this to the end,

    // VJ Links Manager v1.00 begin
    define('FILENAME_LINKS', 'links.php');
    define('FILENAME_LINK_CATEGORIES', 'link_categories.php');
    define('FILENAME_LINKS_CONTACT', 'links_contact.php');
    // VJ Links Manager v1.00 end

    To the wrong /includes/filenames.php ,
    I did fix this problem and I still get the error message fron "links" link @ www.lil-raskals.com

    I looked at the database.php file, but don't know enough about what I'd be looking for. File below:

    <?php
    /*
    $Id: database.php,v 1.21 2003/06/09 21:21:59 hpdl Exp $

    osCommerce, Open Source E-Commerce Solutions
    http://www.oscommerce.com

    Copyright (c) 2003 osCommerce

    Released under the GNU General Public License
    */

    function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {
    global $$link;

    if (USE_PCONNECT == 'true') {
    $$link = mysql_pconnect($server, $username, $password);
    } else {
    $$link = mysql_connect($server, $username, $password);
    }

    if ($$link) mysql_select_db($database);

    return $$link;
    }

    function tep_db_close($link = 'db_link') {
    global $$link;

    return mysql_close($$link);
    }

    function tep_db_error($query, $errno, $error) {
    die('<font color="#000000"><b>' . $errno . ' - ' . $error . '<br><br>' . $query . '<br><br><small><font color="#ff0000">[TEP STOP]</font></small><br><br></b></font>');
    }

    function tep_db_query($query, $link = 'db_link') {
    global $$link;

    if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
    error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
    }

    $result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error());

    if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) {
    $result_error = mysql_error();
    error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG);
    }

    return $result;
    }

    function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $link = 'db_link') {
    reset($data);
    if ($action == 'insert') {
    $query = 'insert into ' . $table . ' (';
    while (list($columns, ) = each($data)) {
    $query .= $columns . ', ';
    }
    $query = substr($query, 0, -2) . ') values (';
    reset($data);
    while (list(, $value) = each($data)) {
    switch ((string)$value) {
    case 'now()':
    $query .= 'now(), ';
    break;
    case 'null':
    $query .= 'null, ';
    break;
    default:
    $query .= '\'' . tep_db_input($value) . '\', ';
    break;
    }
    }
    $query = substr($query, 0, -2) . ')';
    } elseif ($action == 'update') {
    $query = 'update ' . $table . ' set ';
    while (list($columns, $value) = each($data)) {
    switch ((string)$value) {
    case 'now()':
    $query .= $columns . ' = now(), ';
    break;
    case 'null':
    $query .= $columns .= ' = null, ';
    break;
    default:
    $query .= $columns . ' = \'' . tep_db_input($value) . '\', ';
    break;
    }
    }
    $query = substr($query, 0, -2) . ' where ' . $parameters;
    }

    return tep_db_query($query, $link);
    }

    function tep_db_fetch_array($db_query) {
    return mysql_fetch_array($db_query, MYSQL_ASSOC);
    }

    function tep_db_num_rows($db_query) {
    return mysql_num_rows($db_query);
    }

    function tep_db_data_seek($db_query, $row_number) {
    return mysql_data_seek($db_query, $row_number);
    }

    function tep_db_insert_id() {
    return mysql_insert_id();
    }

    function tep_db_free_result($db_query) {
    return mysql_free_result($db_query);
    }

    function tep_db_fetch_fields($db_query) {
    return mysql_fetch_field($db_query);
    }

    function tep_db_output($string) {
    return htmlspecialchars($string);
    }

    function tep_db_input($string) {
    return addslashes($string);
    }

    function tep_db_prepare_input($string) {
    if (is_string($string)) {
    return trim(tep_sanitize_string(stripslashes($string)));
    } elseif (is_array($string)) {
    reset($string);
    while (list($key, $value) = each($string)) {
    $string[$key] = tep_db_prepare_input($value);
    }
    return $string;
    } else {
    return $string;
    }
    }
    ?>

    ****************

    Thanks for your help anyone?

Similar Threads

  1. Article Manager
    By pglock in forum osCMax v2 Features Discussion
    Replies: 2
    Last Post: 03-26-2006, 12:10 PM
  2. Article Manager with MS2-MAX
    By oakhill in forum osCMax v1.7 General Mods Discussion
    Replies: 1
    Last Post: 03-30-2005, 04:25 AM
  3. banner manager
    By joanstead in forum osCMax v1.7 General Mods Discussion
    Replies: 2
    Last Post: 03-12-2005, 06:21 AM
  4. Links manager
    By jbennette in forum osCMax v1.7 Installation
    Replies: 5
    Last Post: 02-16-2004, 03:43 PM
  5. File manager
    By jgkiefer in forum osCmax v1.7 Discussion
    Replies: 5
    Last Post: 08-19-2003, 07:38 AM

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •