Jump to content

VJ

Members
  • Content count

    170
  • Joined

  • Last visited

Everything posted by VJ

  1. Yes, this is something I would like to work on. I'm sure it'd make things easier to maintain, especially with these new attribute fields, getting added. Thanks so much for all your feedback and comments :). VJ
  2. Two more code fixes... 1. Now able to handle product attribute options/option values, that are not linked to any products. Earlier, only attrib options/option values that are linked to products were handled. 2. Redesigned the language specific sections of the code. Now able to handle language ids lot better. The language specific fields should now be, v_attribute_options_name_x_y, where x = options count, and y = language id (earlier, this was a count beginning from 1) v_attribute_values_name_x_y_z, where x = options count, y = option values count, and z = language_id (changes, same as above) You can download the updated code, here. If anyone has given this a try, I'd be happy to hear if this actually works! Today, I managed to test it with a set of 60 different attribute values, and it did handle it OK (the output file was huge, though) :). VJ
  3. Hello, I've added a code patch, that now enables removal of product attributes linked to a product. You can download the new code here. Currently working on testing and improving language support. I'd be glad if anyone could help me test this code. You can email me at - vj (at) vjdom (dot) com. Remember, this is experimental code, and you'd need a dev store setup give it a try. VJ
  4. VJ

    Links Manager

    I'm afraid I wasn't able to locate the code resembling your error snippet, in the original links.php file. Have you made any changes in the SQL queries? select count(l.links_id) as total select ld.links_title, ld.links_description, l.links_url, l.links_clicked, l.links_id from links_description ld, links l, links_to_link_categories l2lc where l.links_status = '2' and l.links_id = l2lc.links_id and ld.links_id = l2lc.links_id and ld.language_id = '1' and l2lc.link_categories_id = '4' Anyways, there's a mistake in the above query (obviously!). You might need to remove this section (right at the beginning), select count(l.links_id) as total HTH, VJ
  5. VJ

    Links Manager

    Oops, here you go... In your (original) links.php, replace the following (around line 90) - if ($number_of_categories > 0) { $rows = 0; while ($categories = tep_db_fetch_array($categories_query)) { $rows++; $lPath_new = 'lPath=' . $categories['link_categories_id']; $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_LINKS, $lPath_new) . '">'; if (tep_not_null($categories['link_categories_image'])) { echo tep_links_image(DIR_WS_IMAGES . $categories['link_categories_image'], $categories['link_categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>'; } else { echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', $categories['link_categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT, 'style="border: 3px double black"') . '<br>'; } echo '<br><b><u>' . $categories['link_categories_name'] . '</b></u></a><br><br>' . $categories['link_categories_description'] . '</td>' . "\n"; if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) { echo ' </tr>' . "\n"; echo ' <tr>' . "\n"; } } } else { with, if ($number_of_categories > 0) { $rows = 0; while ($categories = tep_db_fetch_array($categories_query)) { $rows++; $lPath_new = 'lPath=' . $categories['link_categories_id']; $width = (int)(100 / MAX_DISPLAY_CATEGORIES_PER_ROW) . '%'; $categories_count_query = tep_db_query("select links_id from " . TABLE_LINKS_TO_LINK_CATEGORIES . " where link_categories_id = '" . (int)$categories['link_categories_id'] . "'"); $number_of_links = tep_db_num_rows($categories_count_query); echo ' <td align="center" class="smallText" width="' . $width . '" valign="top"><a href="' . tep_href_link(FILENAME_LINKS, $lPath_new) . '">'; if (tep_not_null($categories['link_categories_image'])) { echo tep_links_image(DIR_WS_IMAGES . $categories['link_categories_image'], $categories['link_categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br>'; } else { echo tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', $categories['link_categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT, 'style="border: 3px double black"') . '<br>'; } echo '<br><b><u>' . $categories['link_categories_name'] . '</b></u></a> (' . $number_of_links . ')'; echo '<br><br>' . $categories['link_categories_description'] . '</td>' . "\n"; if ((($rows / MAX_DISPLAY_CATEGORIES_PER_ROW) == floor($rows / MAX_DISPLAY_CATEGORIES_PER_ROW)) && ($rows != $number_of_categories)) { echo ' </tr>' . "\n"; echo ' <tr>' . "\n"; } } } else { Good luck! :) VJ
  6. Oops, there's no admin interface for the Guestbook, yet... perhaps, in the next version. :) Till then... you'll have to delete offensive posts using phpmyadmin etc. VJ
  7. Ah, now comes the hard part... the version you run, is a CVS snapshot. I'm not sure how to find, if its a pre-MS2 snapshot or not. Do you have the osc setup file you downloaded. That filename should give you the date of the snapshot. VJ
  8. Open /catalog/includes/application_top.php, and look for the lines, // define the project version define('PROJECT_VERSION', 'osCommerce 2.2-MS2'); That should give you an idea of osC version you run. VJ
  9. Are you sure you're using osC version 2.2MS2? This contrib was built and tested on MS2. And, I'm not sure if it would work on previous versions of osC (at least, not out-of-the-box). VJ
  10. Oops, sorry! Here's some *real* code you might find handy... In /catalog/links.php, <?php } elseif ($display_mode == 'links') { /* REPLACE ALL THE CODE HERE, WITH THE FOLLOWING */ } ?> <?php } elseif ($display_mode == 'links') { ?> <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 HEADING_TITLE; ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <?php $links_query = tep_db_query("select l.links_id, l.links_url, l.links_image_url, l.links_clicked, ld.links_title, ld.links_description from " . TABLE_LINKS_DESCRIPTION . " ld, " . TABLE_LINKS . " l, " . TABLE_LINKS_TO_LINK_CATEGORIES . " l2lc where l.links_status = '2' and l.links_id = l2lc.links_id and ld.links_id = l2lc.links_id and ld.language_id = '" . (int)$languages_id . "' and l2lc.link_categories_id = '" . (int)$current_category_id . "' order by ld.links_title"); $number_of_links = tep_db_num_rows($links_query); if ($number_of_links > 0) { $rows = 0; while ($links = tep_db_fetch_array($links_query)) { echo ' <td class="main">'; echo '<b>' . $links['links_title'] . '</b> '; echo TEXT_NUMBER_OF_CLICKS . ': ' . $links['links_clicked'] . '<br>'; if (tep_not_null($links['links_image_url'])) { echo '<a href="' . tep_get_links_url($links['links_id']) . '" target="_blank">' . tep_links_image($links['links_image_url'], $links['links_title'], LINKS_IMAGE_WIDTH, LINKS_IMAGE_HEIGHT) . '</a>'; } else { echo '<a href="' . tep_get_links_url($links['links_id']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', $links['links_title'], LINKS_IMAGE_WIDTH, LINKS_IMAGE_HEIGHT, 'style="border: 3px double black"') . '</a>'; } echo '<br>' . $links['links_description'] . '<br><br></td>' . "\n"; echo ' </tr>' . "\n"; echo ' <tr>' . "\n"; } } else { ?> <td><?php new infoBox(array(array('text' => TEXT_NO_LINKS))); ?></td> <?php } ?> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <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> <td class="main" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_LINKS_SUBMIT, tep_get_all_get_params()) . '">' . tep_image_button('button_submit_link.gif', IMAGE_BUTTON_SUBMIT_LINK) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> </table></td> </tr> </table></td> <?php } ?> Again, this is just an example (with little or no aesthetics) of using a simpler layout (and doing away with the "link_listing" display module!). Hope you can take it from here, and come up with a really nice layout. :) VJ
  11. Hello interbikes, If you want a really simple layout, you can do away with the "link_listing" module (that I now use to display links). The link_listing module I have used, is based on the product_listing module. I understand it makes things a bit complicated... I just used it for the following reasons, * it provides ability to sort links based on title, click count, description, etc. * it has a built-in split page mechanism. If these things are of little importance to you, I see no reason why you shouldn't disable the link_listing thing, and go for a simpler layout. Here's a hint, if you like, on how I would go about this... if ($display_mode == 'categories') { /* CATEGORIES DISPLAY CODE HERE */ } elseif ($display_mode == 'links') { /* LINKS DISPLAY CODE HERE */ /* HACK THIS CODE AND USE THE DISPLAY MECHANISM USED BY CATEGORIES DISPLAY */ } Good luck! VJ
  12. Of course, the display layout can be customized. I have a *similar* layout (to the one you're looking for, with space enough for a standard half-banner - 234x60), here. You might find this code snippet (from /catalog/links.php) handy - look out for the commented lines, <?php } elseif ($display_mode == 'links') { // create column list $define_list = array('LINK_LIST_TITLE' => LINK_LIST_TITLE, //'LINK_LIST_URL' => LINK_LIST_URL, 'LINK_LIST_IMAGE' => LINK_LIST_IMAGE, //'LINK_LIST_DESCRIPTION' => LINK_LIST_DESCRIPTION, 'LINK_LIST_COUNT' => LINK_LIST_COUNT); asort($define_list); $column_list = array(); reset($define_list); while (list($key, $value) = each($define_list)) { if ($value > 0) $column_list[] = $key; } $select_column_list = ''; for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { switch ($column_list[$i]) { case 'LINK_LIST_TITLE': $select_column_list .= 'ld.links_title, ld.links_description, l.links_url, '; break; /*case 'LINK_LIST_URL': $select_column_list .= 'l.links_url, '; break;*/ case 'LINK_LIST_IMAGE': $select_column_list .= 'l.links_image_url, '; break; /*case 'LINK_LIST_DESCRIPTION': $select_column_list .= 'ld.links_description, '; break;*/ case 'LINK_LIST_COUNT': $select_column_list .= 'l.links_clicked, '; break; } } // show the links in a given category // We show them all $listing_sql = "select " . $select_column_list . " l.links_id from " . TABLE_LINKS_DESCRIPTION . " ld, " . TABLE_LINKS . " l, " . TABLE_LINKS_TO_LINK_CATEGORIES . " l2lc where l.links_status = '2' and l.links_id = l2lc.links_id and ld.links_id = l2lc.links_id and ld.language_id = '" . (int)$languages_id . "' and l2lc.link_categories_id = '" . (int)$current_category_id . "'"; if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) { for ($i=0, $n=sizeof($column_list); $i<$n; $i++) { if ($column_list[$i] == 'LINK_LIST_TITLE') { $HTTP_GET_VARS['sort'] = $i+1 . 'a'; $listing_sql .= " order by ld.links_title"; break; } } } else { $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1); $sort_order = substr($HTTP_GET_VARS['sort'], 1); $listing_sql .= ' order by '; switch ($column_list[$sort_col-1]) { case 'LINK_LIST_TITLE': $listing_sql .= "ld.links_title " . ($sort_order == 'd' ? 'desc' : ''); break; /*case 'LINK_LIST_URL': $listing_sql .= "l.links_url " . ($sort_order == 'd' ? 'desc' : '') . ", ld.links_title"; break;*/ case 'LINK_LIST_IMAGE': $listing_sql .= "ld.links_title"; break; /*case 'LINK_LIST_DESCRIPTION': $listing_sql .= "ld.links_description " . ($sort_order == 'd' ? 'desc' : '') . ", ld.links_title"; break;*/ case 'LINK_LIST_COUNT': $listing_sql .= "l.links_clicked " . ($sort_order == 'd' ? 'desc' : '') . ", ld.links_title"; break; } } ?> HTH, VJ
  13. A new version of the Links Manager (v1.01), meant for osCv2.2MS2 is now available http://www.oscommerce.com/community/contributions,1256. Discussion on this new version continues here. I'd be glad to hear your comments, ideas... and criticisms (;)) on this new version. Thanks so much to everyone, for wonderful feature requests, ideas and suggestions. VJ
  14. Ah yes, you are right... it indeed works similar to the product/product category system. I'd love to hear your comments and criticisms ;) . VJ P.S.: About my avatar... there's no real reason. I just liked that pic of Che. Thanks for asking! :)
  15. True, parts of this script are based on the product/product category system. It's not "just a copy" of the product system, I would think. :P VJ
  16. Hello, Just released a newer download, which includes 3 bugfixes in the following files, /catalog/admin/link_categories.php /catalog/includes/functions/links.php /catalog/admin/includes/functions/links.php Here's the link to the download page - http://www.oscommerce.com/community/contributions,1256. VJ
  17. Oops, I just found a outrageously silly mistake in one of the files. I forgot to remove a line (which i used for debugging). Please remove this line, (around 67) echo $language_id; in file, /catalog/admin/link_categories.php. Sorry! VJ
  18. VJ

    Links Manager Question

    Here's a quickfix you could try: In /admin/exchange_links_links.php, replace this code (around line 235), <td class="main"><?php echo tep_draw_input_field('link_url', $cInfo->link_url, 'maxlength="255"', true); ?></td> with, <td class="main"><?php echo tep_draw_input_field('link_url', (isset($cInfo->link_url)) ? $cInfo->link_url : 'http://', 'maxlength="255"', true); ?></td> and this code (around line 280), <td class="main"><?php echo tep_draw_input_field('link_reciprocal', $cInfo->link_reciprocal, 'maxlength="255"'); ?></td> with, <td class="main"><?php echo tep_draw_input_field('link_reciprocal', (isset($cInfo->link_reciprocal)) ? $cInfo->link_reciprocal : 'http://', 'maxlength="255"'); ?></td> By the way, I'm working on a newer version of this links program now. I hope to get it done in a couple of weekends (hopefully!). HTH, VJ
  19. In PHP, the semi-colon after the last statement before the "?>" is redundant. For example, <?php statement1; statement2; statement3; ?> and, <?php statement1; statement2; statement3 ?> are both valid. So, you can go ahead and make the changes. HTH, VJ
  20. Maybe your text editor doesn't handle the '<', '>' too well. Have you tried a search for 'TITLE'? If it still doesn't bring anything, I guess you might have replaced the existing title tags accidentally (I've done that while doing mass search/replace). In that case you can just paste the header tag controller code anywhere between the '<head>' and '</head>' tags in /catalog/*.php files. Hope this helps, VJ
  21. 1. Oops, sorry! Again, I believe contact information for link categories might make improvization easier. Like, someone might want to hack this script to enable customers to suggest/submit categories. It might come in handy, then. 2. Sure, I'd love to hear ideas on anything that'd make this script better. Thank you! VJ
  22. 1. Well, I thought getting the name and email of the person submitting his link would be handy, in case we ever need to get in touch with them. Anyway, its a matter of choice. They can be made optional. 2. Mass-emailing link partners isn't available yet. Nice idea, though :-). I might work on it in the next release. 3. Rating is a redundant field, right now. It can come in handy however, if someone wants to improvize this script. Like for example, it would be possible to group links based on their ratings and display higher-rated links on the top. Thank you, VJ
  23. Well, the "Poll Booth" installation instructions suggest setting up the box at the right column. That should probably explain why others didn't have a problem. You deviated from the trend, and ended up finding a "bug". Good thing you did too :-). Thanks again, VJ
  24. Hi Wolfgang, Just make sure that you add the code, // BOF: WebMakers.com Added: Header Tags Controller v1.0 require(DIR_WS_FUNCTIONS . 'header_tags.php'); // Clean out HTML comments from ALT tags etc. require(DIR_WS_FUNCTIONS . 'clean_html_comments.php'); // Also used by: WebMakers.com Added: FREE-CALL FOR PRICE // EOF: WebMakers.com Added: Header Tags Controller v1.0 anywhere after the following code (in application_top.php), // include server parameters require('includes/configure.php'); The definition, DIR_WS_FUNCTIONS is defined in configure.php, so it only makes sense when it comes after the inclusion of configure.php. Hope this helps, VJ
×