Jump to content

uscetech

Members
  • Content count

    85
  • Joined

  • Last visited

2 Followers

Profile Information

  • Real Name
    Brett
  1. uscetech

    New UPS XML Shipping Module available

    I wanted to add this module to the product_info.php page. I made a form and single field button for the customers zipcode. So that the customer can check the price for shipping before checkout. Basically I just want it return the first/cheapest element, which is normally ground. I was just wondering if this is the correct way to do it: // shipping quote $shipping_quote_price = ''; if (isset($HTTP_GET_VARS['zipcode']) && $HTTP_GET_VARS['zipcode'] != 'zipcode' && isset($HTTP_GET_VARS['products_id']) && is_numeric(preg_replace('/-/', "", $HTTP_GET_VARS['zipcode']))) { $product_info_query = tep_db_query(" select p.products_weight, p.products_price from " . TABLE_PRODUCTS . " p where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' "); $product_info = tep_db_fetch_array($product_info_query); //$shipping_quote_price include_once(DIR_WS_MODULES.'shipping/upsxml.php'); include_once(DIR_WS_INCLUDES.'languages/english/modules/shipping/upsxml.php'); $rate_ups = new upsxml; $rate_ups->_upsOrigin("", "", "", $products_supplier_info['suppliers_shipping_origin_zipcode']); // Use ISO country codes! $rate_ups->_upsDest("", "", "", $HTTP_GET_VARS['zipcode']); // Use ISO country codes! $rate_ups->_addItem(0, 0, 0, $product_info['products_weight'], $product_info['products_price']); $shipping_quote_ups = $rate_ups->_upsGetQuote(); //print_r($shipping_quote_ups); // get the percentage increase $config = tep_db_fetch_array(tep_db_query(" select cfg.configuration_value from " . TABLE_CONFIGURATION . " cfg where cfg.configuration_key = 'MODULE_SHIPPING_UPSXML_RATES_HANDLING' ")); $shipping_handling_fee = $config['configuration_value']; for($i=0, $n=sizeof($shipping_quote_ups); $i<$n; $i++) { foreach($shipping_quote_ups[$i] as $type => $rate) { if (tep_not_null($type) && tep_not_null($rate)) { $shipping_quote_price = $type . ' $' . number_format(((($shipping_handling_fee * $rate)/100) + $rate),2,'.',''); $end_loop = 'true'; break; } } if ($end_loop == 'true') break; } } else { if (isset($HTTP_GET_VARS['zipcode'])) { $shipping_quote_price = 'Invalid Zipcode'; // invalid zipcode } else { $shipping_quote_price = 'Enter zipcode, Get Quote'; // default page load } } <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="main" align="right" nowrap="true" valign="top"> <?php echo tep_draw_form('get_shipping_quote', tep_href_link(basename($PHP_SELF), tep_get_all_get_params() . 'action=get_shipping_quote', 'NONSSL', false), 'get'); echo tep_draw_input_field('zipcode', 'zipcode', 'id="zipcode" size="10" onclick="clearField(this, \'zipcode\')" onblur="recallField(this,\'zipcode\')"'); ?> </td> <td class="main" align="left" width="100%" nowrap="true" valign="top"> <?php //echo tep_draw_hidden_field('products_id', $HTTP_GET_VARS['products_id']) . tep_hide_session_id(); echo tep_image_submit('button_get_quote.gif', 'Get Quote'); echo '</form>'; ?> </td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td class="main" align="right" nowrap="true" valign="top"> Shipping: </td> <td class="main" align="left" width="100%" nowrap="true" valign="top"> <?php if ($shipping_quote_price != '') { echo '<b>' . $shipping_quote_price . '*</b>'; } ?> </td> </tr> </table> It works perfect, but I'm still learning. Just wonder if anyone would advise a different solution or not? Thanks. Btw, this only works with percentage increase atm and not flat fee.
  2. uscetech

    New UPS XML Shipping Module available

    A little update to the problem above, the password I chose for UPS has html special characters in it, like &. the only way i can't get this module to work with my password it to use: function upsxml() { ... $this->access_password = htmlspecialchars(MODULE_SHIPPING_UPSXML_RATES_PASSWORD); ... } I don't know for sure if this actually fixed it because it was working with the wrong password before. But it is working this way regardless.
  3. uscetech

    New UPS XML Shipping Module available

    Excellent work on this contrib, one problem though. I followed the instructions to the T, I am not using any of the admin stuff for dimensions. This is what happens: If I put the correct username and password, I get the error: 10001: The XML document is not well formed If I put no username and no password, i get the error: 10002: The XML document is well formed but the document is not valid If I use any username and password combination other than blank or correct - it works :huh: So basically I was getting errors until just for spite, I tried making my username the letter "a" and the password the letter "a" and whalaa, it works. I mean it's working, but should it? I just want to make sure it will continue to work with incorrect login information or try to fix it. Thanks
  4. uscetech

    Article Manager v1.0

    Replace $articles_all_query_raw = "select a.articles_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_id, au.authors_name, td.topics_id, td.topics_name from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t left join " . TABLE_TOPICS_DESCRIPTION . " td on a2t.topics_id = td.topics_id left join " . TABLE_AUTHORS . " au on a.authors_id = au.authors_id, " . TABLE_ARTICLES_DESCRIPTION . " ad where (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_id = a2t.articles_id and a.articles_status = '1' and a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "' order by a.articles_date_added desc, ad.articles_name"; With $articles_all_query_raw = "select a.articles_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_id, au.authors_name, td.topics_id, td.topics_name from (" . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t) left join " . TABLE_TOPICS_DESCRIPTION . " td on a2t.topics_id = td.topics_id left join " . TABLE_AUTHORS . " au on a.authors_id = au.authors_id, " . TABLE_ARTICLES_DESCRIPTION . " ad where (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_id = a2t.articles_id and a.articles_status = '1' and a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "' order by a.articles_date_added desc, ad.articles_name";
  5. uscetech

    Article Manager v1.0

    Which version are you using?
  6. uscetech

    Article Manager v1.0

    There are a couple places where this contrib hickups with msql5. I don't remember exactly which files needed it, but I know /catalog/articles_new.php needed it for certain. This is the original query from articles_new.php $listing_sql = "select a.articles_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_id, au.authors_name, td.topics_id, td.topics_name from " . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t left join " . TABLE_TOPICS_DESCRIPTION . " td on a2t.topics_id = td.topics_id left join " . TABLE_AUTHORS . " au on a.authors_id = au.authors_id, " . TABLE_ARTICLES_DESCRIPTION . " ad where (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_id = a2t.articles_id and a.articles_status = '1' and a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "' and a.articles_date_added > SUBDATE(now( ), INTERVAL '" . NEW_ARTICLES_DAYS_DISPLAY . "' DAY) order by a.articles_date_added desc, ad.articles_name"; And this is what I replaced it with: $listing_sql = "select a.articles_id, a.articles_date_added, ad.articles_name, ad.articles_head_desc_tag, au.authors_id, au.authors_name, td.topics_id, td.topics_name from (" . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t) left join " . TABLE_TOPICS_DESCRIPTION . " td on a2t.topics_id = td.topics_id left join " . TABLE_AUTHORS . " au on a.authors_id = au.authors_id, " . TABLE_ARTICLES_DESCRIPTION . " ad where (a.articles_date_available IS NULL or to_days(a.articles_date_available) <= to_days(now())) and a.articles_id = a2t.articles_id and a.articles_status = '1' and a.articles_id = ad.articles_id and ad.language_id = '" . (int)$languages_id . "' and td.language_id = '" . (int)$languages_id . "' and a.articles_date_added > SUBDATE(now( ), INTERVAL '" . NEW_ARTICLES_DAYS_DISPLAY . "' DAY) order by a.articles_date_added desc, ad.articles_name"; Basically the only difference is that the tables between "from" and "left join" had to be encased with parentheses. from (" . TABLE_ARTICLES . " a, " . TABLE_ARTICLES_TO_TOPICS . " a2t) left join It was on a few other pages also. Just look for "left joins" in the article files and add the parentheses. After that it played nice with MYSQL5.
  7. Make a file in the admin section of your store and name it whatever you want (eg "customers_email_export.php") Then open that file and place this code in it: <?php require('includes/application_top.php'); $output = ''; $output .= 'Customers Lastname' . "\t"; $output .= 'Customers Firstname' . "\t"; $output .= 'Customers Email Address' . "\t"; $output .= "\n"; $customers_query_raw = "select customers_firstname, customers_lastname, customers_email_address from " . TABLE_CUSTOMERS . " order by customers_lastname, customers_firstname DESC"; $customers_query = tep_db_query($customers_query_raw); while ($customers = tep_db_fetch_array($customers_query)) { $output .= $customers['customers_lastname'] . "\t"; $output .= $customers['customers_firstname'] . "\t"; $output .= $customers['customers_email_address'] . "\t"; $output .= "\n"; } header("Content-type: application/x-msdownload"); header("Content-Disposition: attachment; filename=customer_emails.xls"); header("Pragma: no-cache"); header("Expires: 0"); print "$header$output"; require(DIR_WS_INCLUDES . 'application_bottom.php'); ?> Open your web browser and type in the url to the file and a download dialog box should appear. Select save and whaalaa.
  8. uscetech

    EasyPopulate Tricky Problem...

    I'm not sure of the answer to your question, but I believe that Google only searches 3 categories deep (yes/no?). So it might be a good thing you couldn't figure it out. ;)
  9. No problem :) I'm kind of stickler for standards, so this is just some constructive criticism for Jack. In future releases could you refrain from using colored text in the database entries? And use lowercase configuration variables? Every other true/false config var is lowercase except link manager which uses True/False. Nothing major, just a little obsessive compulsive over here :P
  10. uscetech

    Article Manager v1.0

    Hey all, I've been working on a way to split articles into multiple pages. I noticed someone made a page splitter based on the amount of characters on each page. But I wanted to be able to control where the page splits using a delimiter. I came up with a working solution but it could probably still be tweaked. For now it only works in the catalog end, in admin it looks like one long page. It's really easy to install: In /catalog/article_info.php Replace: roughly line 120 <p><?php echo stripslashes($article_info['articles_description']); ?></p> With: <?php $delimiter = '<pagebreak>'; $article_split_count = substr_count(stripslashes($article_info['articles_description']), $delimiter); $article_page_count = ($article_split_count+1); if (isset($HTTP_GET_VARS['page'])) { $page = $HTTP_GET_VARS['page']; } elseif (isset($HTTP_POST_VARS['page'])) { $page = $HTTP_POST_VARS['page']; } else { $page = ''; } if (empty($page) || !is_numeric($page)) $page = 1; $article_pages_array = array(); $article_pages_array = split($delimiter, stripslashes($article_info['articles_description']), $article_page_count); $article_page_text = $article_pages_array[($page-1)]; $article_pages_array = array(); // GET RESULT LINKS $display_links_string = ''; //next button if ($page > 1) $display_links_string .= '<a href="' . tep_href_link(basename($PHP_SELF), 'articles_id=' . $articles_id . '&page' . '=' . ($page-1)) . '" class="pageResults" title=" ' . PREVNEXT_TITLE_PREVIOUS_PAGE . ' "><u>' . PREVNEXT_BUTTON_PREV . '</u></a> '; //all pages - this could be better - ie max display results for ($i=0, $n=$article_page_count; $i<$n; ++$i) { if (($i+1) == $page) { $display_links_string .= '<b>' . ($i+1) . '</b> '; } else { $display_links_string .= '<a href="' . tep_href_link(basename($PHP_SELF), 'articles_id=' . $articles_id . '&page' . '=' . ($i+1)) . '" class="pageResults" title=" ' . $articles_name . TEXT_DISPLAY_ARTICLE_PAGE . ' ' . ($i+1) . ' "><u>' . ($i+1) . '</u></a> '; } } //previous button if (($page < $article_page_count) && ($article_page_count != 1)) $display_links_string .= ' <a href="' . tep_href_link(basename($PHP_SELF), 'articles_id=' . $articles_id . '&page=' . ($page+1)) . '" class="pageResults" title=" ' . PREVNEXT_TITLE_NEXT_PAGE . ' "><u>' . PREVNEXT_BUTTON_NEXT . '</u></a> '; // PRINT PAGE TEXT $continued_text = ''; if (($page < $article_page_count) && ($article_page_count != 1)) $continued_text = '</p><p align="right">' . TEXT_DISPLAY_ARTICLE_PAGE_CONTINUED . ' '; echo '<p>' . $article_page_text . $continued_text . '</p>'; ?> And then right before this: roughly line 128 </td> </tr> <?php if (tep_not_null($article_info['articles_url'])) { ?> Add this: <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="smallText"><?php echo sprintf(TEXT_DISPLAY_NUMBER_OF_ARTICLE_PAGES, $page, $article_page_count, $article_page_count); ?></td> <td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE . ' ' . $display_links_string; ?></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> </table> And add the following the your language file (ie /catalog/includes/languages/english.php) where the rest of the article manager code is located or before the last "?>": define('TEXT_DISPLAY_NUMBER_OF_ARTICLE_PAGES', 'Displaying <b>%d</b> of <b>%d</b> (of <b>%d</b> pages)'); define('TEXT_DISPLAY_ARTICLE_PAGE', 'Page'); define('TEXT_DISPLAY_ARTICLE_PAGE_CONTINUED', '<b>Continued...</b>'); That's it. Now when I write an article, i place a "<pagebreak>" (w/o quotes) in the body of the article to split it. For instance: This text is on page 1 <pagebreak> This text is on page 2 <pagebreak> This text is on page 3 As it stands now, it displays all of the pages in the results: ie [<< Prev] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 [Next >>] I couldn't figure out how to implement the max links per page like the one used for product/article listings. ie [<< Prev] 1 2 3 4 5 ... [Next >>] Other than that it works good. I am using Ultimate SEO URLS, I havn't tried it without SEO URLS but it should still work. If someone knows how to utilize the max links per page "...", I would be very interested to see how. :) Later
  11. I installed this awhile back and I'm just seeing if I can make it a little more useful. As far as I know, it only thumbnails product images? Is there a way to have it thumbnail other images as well? I install the "all manufacturers" contrib and it has allot of images and none of them seem to be getting thumbnailed. When I select "save image as" on a product's image, it appears like "product_thumb.php.jpg", but on the mfg page, it just says the filename (eg "compaq.jpg"). On the all manufacturers page, there is a random image for the featured products contrib I installed. The featured product image is thumbnailed, but the mfg images on the same page are not. Also I'm having a little quirk with transparency. I have a few images that use transparency that aren't transparent when thumbnailed. Just wondering if there is an update that adds transparency to version 1.5 (last official version by creator?). And one last thing, if there isn't a way to add transparency, is there a way to tell the thumbnailer not to thumbnail those images? I use xampp to test the site before I upload it and my xampp and host gd library versions are the same. I tried adding: //don't calculate transparent pics if ((strstr($image,'pixel') == false || strstr($image,'pixel') == false) || (strstr($image,'arrow') == false || strstr($image,'arrow') == false)) { $dont_calculate = 0; } else { $dont_calculate = 1; echo $image; } to html_output.php file below the "// Don't calculate if the image is set to a "%" width" code, but it only seems to work on the xampp install. The only pics I have on my site with transparency have the word "pixel" or "arrow" in the filename. For some reason, this is being ignored by the webhost but works in xampp. Perhaps someone here can shed some light? Thanks
  12. I was just wondering how you guys deal with link exchange programs that use the contribution. For instance, someone asks if I want to exchange links, I say yes. Then I post their link on my website (because they initiated the exchange, if I do, it's vise-versa) and send them the reciprocal link. Then I have to wait for them to add my link to their website and the exchange is complete. But it's hard to keep track of a bunch of links to make sure they followed up on their end. And the only way to have the link displayed on the link page is to give it the approved status (yes? no?). I was wondering if there is a status I could set links (such a pending or waiting) where they will appear on the links page but I will know that those are awaiting exchange completion? What is the difference between pending and waiting? Perhaps pending could apply to submitted links and waiting could apply to exchanges? Where waiting would be visible on the links page but incomplete? TIA
  13. One last thing, the category drop-down above is sorted by id, to sort alphabetically, just change: $links_categories_query = tep_db_query("select link_categories_id, link_categories_name from " . TABLE_LINK_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$languages_id . "'"); To $links_categories_query = tep_db_query("select link_categories_id, link_categories_name from " . TABLE_LINK_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$languages_id . "' order by link_categories_name");
  14. This might be useful to someone. I added a category filter so that it only shows links from a selected category. This works in conjunction with the status filter. For instance, you can select a category and then select a status, and will show link from the selected category with the selected status. Tested on SQL4/PHP4 and SQL5/PHP5 File: /catalog/admin/links.php Directly above: $showLinkStatus = 'All'; $links_statuses = array(); $linkShow = array(); $links_status_array = array(); $links_status_query = tep_db_query("select links_status_id, links_status_name from " . TABLE_LINKS_STATUS . " where language_id = '" . (int)$languages_id . "'"); $linkShow[] = array('id' => 'All', 'text' => 'All'); while ($links_status = tep_db_fetch_array($links_status_query)) { $linkShow[] = $links_statuses[] = array('id' => $links_status['links_status_id'], 'text' => $links_status['links_status_name']); $links_status_array[$links_status['links_status_id']] = $links_status['links_status_name']; } Add: $showLinkCategory = 'All'; $links_categories = array(); $linkShowCat = array(); $links_category_array = array(); $links_categories_query = tep_db_query("select link_categories_id, link_categories_name from " . TABLE_LINK_CATEGORIES_DESCRIPTION . " where language_id = '" . (int)$languages_id . "'"); $linkShowCat[] = array('id' => 'All', 'text' => 'All'); while ($links_category = tep_db_fetch_array($links_categories_query)) { $linkShowCat[] = $links_categories[] = array('id' => $links_category['link_categories_id'], 'text' => $links_category['link_categories_name']); $links_category_array[$links_category['link_categories_id']] = $links_category['link_categories_name']; } if (isset($_GET['links_category_list'])) $showLinkCategories = $_GET['links_category_list']; Change: <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr><?php echo tep_draw_form('search', FILENAME_LINKS, '', 'get'); ?> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td class="main" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td> <td class="main" align="right">Status: <?php echo tep_draw_pull_down_menu('links_status_list', $linkShow, '', 'onChange="this.form.submit();"');?></td> <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search'); ?></td> </form></tr> </table></td> </tr> To: <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr><?php echo tep_draw_form('search', FILENAME_LINKS, '', 'get'); ?> <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> <td class="main" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td> <td class="main" align="right">Category: <?php echo tep_draw_pull_down_menu('links_category_list', $linkShowCat, '', 'onChange="this.form.submit();"');?></td> <td class="main" align="right"><?php echo tep_draw_separator('pixel_trans.gif', 1, HEADING_IMAGE_HEIGHT); ?></td> <td class="main" align="right">Status: <?php echo tep_draw_pull_down_menu('links_status_list', $linkShow, '', 'onChange="this.form.submit();"');?></td> <td class="smallText" align="right"><?php echo HEADING_TITLE_SEARCH . ' ' . tep_draw_input_field('search'); ?></td> </form></tr> </table></td> </tr> Change: if ($showLinkStatus == 'All') $links_query_raw = "select l.links_id, l.links_url, l.links_image_url, l.links_date_added, l.links_last_modified, l.links_status, l.links_clicked, ld.links_title, ld.links_description, l.links_contact_name, l.links_contact_email, l.links_reciprocal_url, l.links_status from " . TABLE_LINKS . " l left join " . TABLE_LINKS_DESCRIPTION . " ld on l.links_id = ld.links_id " . $search . " order by " . $order; else $links_query_raw = "select l.links_id, l.links_url, l.links_image_url, l.links_date_added, l.links_last_modified, l.links_status, l.links_clicked, ld.links_title, ld.links_description, l.links_contact_name, l.links_contact_email, l.links_reciprocal_url, l.links_status from " . TABLE_LINKS . " l left join " . TABLE_LINKS_DESCRIPTION . " ld on l.links_id = ld.links_id where l.links_status = '" . $showLinkStatus . "'" . $search . " order by " . $order; To: if (isset($_GET['links_status_list']) && $showLinkStatus != 'All' && isset($_GET['links_category_list']) && $showLinkCategories != 'All') { $links_query_raw = "select l.links_id, l.links_url, l.links_image_url, l.links_date_added, l.links_last_modified, l.links_status, l.links_clicked, ld.links_title, ld.links_description, l.links_contact_name, l.links_contact_email, l.links_reciprocal_url, l.links_status from " . TABLE_LINKS . " l left join " . TABLE_LINKS_DESCRIPTION . " ld on l.links_id = ld.links_id left join " . TABLE_LINKS_TO_LINK_CATEGORIES . " l2lc on l.links_id = l2lc.links_id where l.links_status = '" . $showLinkStatus . "' and l2lc.link_categories_id = '" . $showLinkCategories . "'" . $search . " order by " . $order; } elseif (isset($_GET['links_status_list']) && $showLinkStatus != 'All') { $links_query_raw = "select l.links_id, l.links_url, l.links_image_url, l.links_date_added, l.links_last_modified, l.links_status, l.links_clicked, ld.links_title, ld.links_description, l.links_contact_name, l.links_contact_email, l.links_reciprocal_url, l.links_status from " . TABLE_LINKS . " l left join " . TABLE_LINKS_DESCRIPTION . " ld on l.links_id = ld.links_id where l.links_status = '" . $showLinkStatus . "'" . $search . " order by " . $order; } elseif (isset($_GET['links_category_list']) && $showLinkCategories != 'All') { $links_query_raw = "select l.links_id, l.links_url, l.links_image_url, l.links_date_added, l.links_last_modified, l.links_status, l.links_clicked, ld.links_title, ld.links_description, l.links_contact_name, l.links_contact_email, l.links_reciprocal_url, l.links_status from " . TABLE_LINKS . " l left join " . TABLE_LINKS_DESCRIPTION . " ld on l.links_id = ld.links_id left join " . TABLE_LINKS_TO_LINK_CATEGORIES . " l2lc on l.links_id = l2lc.links_id where l2lc.link_categories_id = '" . $showLinkCategories . "'" . $search . " order by " . $order; } else { $links_query_raw = "select l.links_id, l.links_url, l.links_image_url, l.links_date_added, l.links_last_modified, l.links_status, l.links_clicked, ld.links_title, ld.links_description, l.links_contact_name, l.links_contact_email, l.links_reciprocal_url, l.links_status from " . TABLE_LINKS . " l left join " . TABLE_LINKS_DESCRIPTION . " ld on l.links_id = ld.links_id " . $search . " order by " . $order; } Later
  15. I tried that and it still wasn't working. When I clicked on a category, it showed up as &lPath=# instead of the name of the category. I did some digging and found a fix. The only thing now is getting the category name to display on the title bar :P This is what I had to do to get "Links Manager V 1.14b" and "Ultimate SEO URLs - 2.1d" to play nice together. In /catalog/includes/classes/seo.class.php In the function href_link, I changed: if ( !in_array($page, $this->attributes['SEO_PAGES']) || $this->attributes['SEO_ENABLED'] == 'false' ) { return $this->stock_href_link($page, $parameters, $connection, $add_session_id); } To if (( !in_array($page, $this->attributes['SEO_PAGES']) || $this->attributes['SEO_ENABLED'] == 'false' ) && ($page != FILENAME_LINKS)) { return $this->stock_href_link($page, $parameters, $connection, $add_session_id); } Because it was erasing the html link parameters. Then in the function parse_parameters, I added: case 'lPath': switch(true){ case ($page == FILENAME_LINKS): $url = $this->make_url($page, $this->get_link_name($p2[1]), $p2[0], $p2[1], '.html', $separator); break; default: $container[$p2[0]] = $p2[1]; break; } # end switch break; right after the "break;" and right before "case 'cPath':" Then I added the function function get_link_name($lPath){ switch(true){ case ($this->attributes['USE_SEO_CACHE_GLOBAL'] == 'true' && defined('LINK_NAME_' . $lPath)): $this->performance['CACHE_QUERY_SAVINGS']++; $return = constant('LINK_NAME_' . $lPath); $this->cache['LINKS'][$lPath] = $return; break; case ($this->attributes['USE_SEO_CACHE_GLOBAL'] == 'true' && isset($this->cache['LINKS'][$lPath])): $this->performance['CACHE_QUERY_SAVINGS']++; $return = $this->cache['LINKS'][$lPath]; break; default: $this->performance['NUMBER_QUERIES']++; $sql = "SELECT link_categories_name as lName FROM ".TABLE_LINK_CATEGORIES_DESCRIPTION." WHERE link_categories_id='".(int)$lPath."' AND language_id='".(int)$this->languages_id."' LIMIT 1"; $result = $this->DB->FetchArray( $this->DB->Query( $sql ) ); $lName = $this->strip( $result['lName'] ); $this->cache['ARTICLES'][$aID] = $lName; $this->performance['QUERIES']['TOPICS'][] = $sql; $return = $lName; break; } # end switch return $return; } # end function right before the function "function get_category_name(&$cID){" In the function SEO_URL, I changed: $this->reg_anchors = array('products_id' => '-p-', 'cPath' => '-c-', 'manufacturers_id' => '-m-', 'pID' => '-pi-', 'tPath' => '-t-', 'articles_id' => '-a-', 'products_id_review' => '-pr-', 'products_id_review_info' => '-pri-', 'info_id' => '-i-' ); To $this->reg_anchors = array('products_id' => '-p-', 'cPath' => '-c-', 'manufacturers_id' => '-m-', 'pID' => '-pi-', 'tPath' => '-t-', 'articles_id' => '-a-', 'products_id_review' => '-pr-', 'products_id_review_info' => '-pri-', 'info_id' => '-i-', 'lPath' => '-links-' ); After that, then when I click on a link category, it displays the SEO URL instead of lPath=#. But the email link was giving me issues and I made a little change there also. Around line 205 in the file "/catalog/admin/links.php", I changed: $siteURL = sprintf("%s/%s-links-%s.html", HTTP_CATALOG_SERVER, $catname, $category['link_categories_id']); To $siteURL = sprintf("%s%s-links-%s.html", HTTP_CATALOG_SERVER . DIR_WS_CATALOG, strtolower($catname), $category['link_categories_id']); The catalog dir was missing from the link and I like all lowercase links so I added that also. Now its working fine ;)
×