Jump to content

Jonojamesmac

Members
  • Content count

    145
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Jonojamesmac


  1. For installation of SEO-G (Database Changes) I'm trying to run the seo_g.sql file with phpmyadmin that is offered as a service through me hosting site. I have no idea of how to use this program and have no experience with mySQL or phpmyadmin. I attempted to check out the good tutorial listed at the readme web page and only found a chat thread about someone who had there site hacked. Could someone help me with what I should do for this part of the Seo-G installation? So far I opened up myphpadmin and opted it seemed that I had to choose a database first. I chose the file/extension in which my store was installed in, although I found all the default osCommerce produts, categories, manufacturers, and etc that I had deleted from my admin control panel. All my product additions have been through the admin screen (I assumed that they were all being saved in a mySQL database).

     

    Regardless I try to run the file and I get the following error message in these results.

     

    SQL-query:

     

    CREATE TABLE seo_to_products(

     

    seo_types_id int( 11 ) NOT NULL ,

    products_id int( 11 ) default NULL ,

    seo_name VARCHAR( 255 ) NOT NULL ,

    PRIMARY KEY ( seo_types_id, products_id )

    ) TYPE = MYISAM

    MySQL said:

     

    #1171 - All parts of a PRIMARY KEY must be NOT NULL; If you need NULL in a key, use UNIQUE instead.

     

    So basically I'm stuck on this part of the installation and would love it if someone could recommend a reference or tell me how and where to run this file.

     

    try

     

    CREATE TABLE seo_to_products(

     

    seo_types_id int( 11 ) NOT NULL ,

    products_id int( 11 ) NOT NULL ,

    seo_name VARCHAR( 255 ) NOT NULL ,

    PRIMARY KEY ( seo_types_id, products_id )

    ) TYPE = MYISAM


  2. <td align="center"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $featured_products['products_id']) . '">' . tep_image(DIR_EXT_HTTP . $featured_products['products_image'], $featured_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br> <a href="' . tep_href_link(FILENAME_FEATURED_PRODUCTS). '">' . tep_image(DIR_WS_IMAGES . '/buttons/featured.gif', IMAGE_FEATUREDPRODUCT). '</a> </td>
    <td class="smallText">'. strip_tags($description['products_description']) . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, "products_id=" . $featured_products["products_id"]). '">' . DESCR_READ_MORE . '</a><br><br><a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $featured_products['products_id']) . '">' . tep_image_button('cart_buy.gif', IMAGE_BUTTON_IN_CART) . '</a> ' . $currencies->display_price($featured_products['products_price'], tep_get_tax_rate($featured_products['products_tax_class_id'])) . '<a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $featured_products['manufacturers_id']) . '">' . tep_image(DIR_EXT_HTTP . $man['manufacturers_image'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></td>
    <td background="images/infobox/right.gif" class="smallText"><img src="images/infobox/right.gif" width="14" height="100" /></td>

     

    Try this...


  3. Replace

    if($product_info['products_quantity'] <= 0 || $product_info['products_status']==0)
    $linkbutton =  tep_image_button('button_out_of_stock.gif');
    else
    $linkbutton =  tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_add_to_cart1.gif', IMAGE_BUTTON_IN_CART);

    with

    if($product_info['products_quantity'] <= 0 || $product_info['products_status']==0) {
    $linkbutton =  tep_image_button('button_out_of_stock.gif'); }
    else
    {
    $linkbutton = '<a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$p_id).'">'.tep_image_button('button_add_to_cart1.gif').'</a>'; }

    and replace

    <a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$p_id).'">'.$linkbutton.'</a>

    with

    ' . $linkbutton . '


  4. I have this set in my index.php file

     

    <title><?php echo (strlen($title_tag) > 1) ? $title_tag . ' - ' . TITLE : $title_home_default . ' - ' . TITLE; ?></title>

     

    Is it possible to reverse the order in which this displays the title on the pages. How would I do this?

     

    I don't really understand your question...

     

    If you mean rearrange the title you have quoted, thats easy.

     

    Like..

    <title><?php echo (strlen($title_tag) > 1) ? TITLE . ' - ' . $title_tag  : TITLE . ' - ' . $title_home_default; ?></title>


  5. I get to the login page but keep getting Invalid Username? I know the password is correct because I set it up just for the iphone app?

    When you added the password for your new user did you encrypt it using md5 encryption first? If not there are plenty of tools on the net, just search :)

     

    Make sure when you type your username in, it matches including case.


  6. Same for all instances in the non working listings just

     

    replace

    <td width="100%"><a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$p_id).'">'.tep_image_button('button_add_to_cart1.gif').'</a>'.tep_image(DIR_WS_IMAGES.'z6.gif').'<a href="' . tep_href_link('product_info.php?products_id='.$p_id) . '">'.tep_image_button("button_details.gif").'</a></td><td>'.tep_draw_separator('spacer.gif', '5', '1').'</td>

    with

    <td width="100%"><a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$p_id).'">'.$linkbutton.'</a>'.tep_image(DIR_WS_IMAGES.'z6.gif').'<a href="' . tep_href_link('product_info.php?products_id='.$p_id) . '">'.tep_image_button("button_details.gif").'</a></td><td>'.tep_draw_separator('spacer.gif', '5', '1').'</td>

     

    add above out of the table

     

    if($product_info['products_quantity'] <= 0 || $product_info['products_status']==0)
    $linkbutton =  tep_image_button('button_out_of_stock.gif');
    else
    $linkbutton =  tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_add_to_cart1.gif', IMAGE_BUTTON_IN_CART);


  7. include manufacturers_id in the sql query like so..

     

    	$featured_products_query = tep_db_query("select p.manufacturers_id p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
     } else {
    $info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY, $cat_name));
    $featured_products_query = tep_db_query("select distinct p.manufacturers_id, p.products_id, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $featured_products_category_id . "' and p.products_status = '1' and f.status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);
     }

     

    and before both instances of

     

    $sql = 'SELECT `products_description` FROM `products_description` WHERE products_id ='.$featured_products['products_id'].' && language_id='.(int)$languages_id;

     

    add

     

    $mansql = "select manufacturers_image from manufacturers where manufacturers_id = $featured_products['manufacturers_id']";
     $manresult = mysql_query($mansql)
    or die(mysql_error()); 
    $man = mysql_fetch_array($manresult);

     

    then in both tables place the code to grab the image wherever you like something along these lines

     

    <a href="index.php?manufacturers_id=' . $featured_products['manufacturers_id']. '"><img src="images/'.$man['manufacturers_image'].'"/></a>


  8. in application_top.php find the line

     case 'buy_now' :		if (isset($HTTP_GET_VARS['products_id'])) {

     

    from that line down to the line above case'notify' replace with:

    	  case 'buy_now' :		if (isset($HTTP_GET_VARS['products_id'])) {
    							if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
    							  tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
    							} else {
    							  $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
    							}
    						  }
    						  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
    						  break;


  9. I spent few hours trying many different ways, rewording, moving code to different places, etc... nothing seems to works. I just keep getting the ID field numbers. I'm no programmer... but I am persistant in trying new ways... and I must say, I just can't get t it to work. Worse case scenario, i just remember which number corresponds to the referrer. Any other ideas... please let me know.

     

    Cheers & Thx, Todd - Sky Lanterns

     

    Steve's code is almost right i think, just missing a tiny piece.

     

    Replace

    <td class="dataTableContent" align="center"><?php echo htmlspecialchars($customers['entry_referral']);

    With

    <?php
    if ($entry_referral != 0) {
     $source_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_id = " . $customers['entry_referral']);
     $source = tep_db_fetch_array($source_query);
     $referrer_name = $source['customers_firstname'] . " " . $source['customers_lastname'];
    ?>
    <td class="dataTableContent" align="center"><?php echo htmlspecialchars($referrer_name); ?></td>
    <?php
    } else {
    ?>
    <td class="dataTableContent" align="center"> </td>
    <?php
    }
    ?>


  10. Replace:

    <a href="'.tep_href_link("products_new.php","action=buy_now&products_id=".$p_id).'">'.tep_image_button('button_add_to_cart1.gif').'</a>

     

    With:

    <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_add_to_cart1.gif', IMAGE_BUTTON_BUY_NOW) . '</a>

     

    The reason you may not get a response is mainly because your code is heavily modded from the orginal oscommerce.


  11. Ok edit login.php

     

    replace on line 35:

       $q = "select user_password from administrators where user_name = '$username'";

    with

       $q = "select admin_password from admin where user_name = '$username'";

     

    and line 43 replace

    	$stack = explode(':', $dbarray['user_password']);

    with

    	$stack = explode(':', $dbarray['admin_password']);

×