Jump to content

anvip

Members
  • Content count

    25
  • Joined

  • Last visited

  1. anvip

    SEO Assistant

    I found and tested this code for Google, it works. But I do not know how to implement it in Seo Assistant ... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Checking keyword position with PHP</title> <style type="text/css"> body{font-family:Verdana, Geneva, sans-serif; color:#666;} #center{width:350px;margin:5px auto 0 auto;} form { float:left; width:380px; } input, label { width:70%; clear:left; float:left; margin-top:5px; } input{color:#999;} input[type="submit"] { width:30%; clear:left; float:left; margin-top:20px; color:#666; } .small{ font-size:0.7em; color:#999999} h3{font-size:1.4em;} #kwdz{ width:400px; position:relative; top:5px;} #domainz{width:400px; margin-top:10px;} #result{margin-top:20px;} </style> </head> <body> <div id="center"> <form action="pr.php" method="post"> <div id="domainz"> <label>Domain:</label> <input name="domain" value="www.google.com" onclick="this.value=''" /> </div> <div id="kwdz"> <label>Keywords:</label> <input name="keywords" value="Seo Assistant" onclick="this.value=''" /> </div> <input type="submit" name="check" value="Get position" /> </form> <br style="clear:both" /> <?php $i = 1; $hit = 0; if($_POST) { // Clean the post data and make usable $domain = filter_var($_POST['domain'], FILTER_SANITIZE_STRING); $keywords = filter_var($_POST['keywords'], FILTER_SANITIZE_STRING); // Remove begining http and trailing / $domain = substr($domain, 0, 7) == 'http://' ? substr($domain, 7) : $domain; $domain = substr($domain, -1) == '/' ? substr_replace($domain, '', -1) : $domain; // Replace spaces with + $keywords = strstr($keywords, ' ') ? str_replace(' ', '+', $keywords) : $keywords; // Grab the Google page using the chosen keywords $html = new DOMDocument(); @$html->loadHtmlFile('http://www.google.com/search?q='.$keywords.'&num=100'); $xpath = new DOMXPath($html); // Store the domains to nodes $nodes = $xpath->query('//div[1]/cite'); // Loop through the nodes to look for our domain $hit = 2; foreach ($nodes as $n){ echo '<div style="font-size:0.7em">'.$n->nodeValue.'<br /></div>'; // Show all links if (strstr($n->nodeValue, $domain)) { $message = 'Position '.$i.'<br />'; $hit = 1; } else { ++$i; } } } ?> <div id="result"> <?php // Echo the result if ($hit == 1) { echo '<h2>'.$message.'</h2>'; } else if ($hit >= 2) { echo '<h2>Not found!</h2>'; } ?> </div> </div> </body> </html>
  2. anvip

    Daily Specials

    Hmm, My opinion is that with this query in includes/modules/daily_specials_banner.php $ds_query = tep_db_query("select * from " . TABLE_DAILY_SPECIALS . " where date_start <= current_date() and date_stop >= current_date() and ( language_id = 99 or language_id = '" . (int)$languages_id . "') order by rand() limit 1"); script will also show the campaign ended on a current date because of "and date_stop >= current_date()". Corect will be "and date_stop > current_date()". Or am I wrong?
  3. anvip

    Daily Specials

    I have a question, how to put limit for the duration of the campaign in the time (h, min, s)?
  4. anvip

    Daily Specials

    Strangely, the module works very similar to Specials, there is no problem with dates ...
  5. anvip

    Daily Specials

    Bug: Start Date and Stop Date Example: Start Date: 2011-03-31 Stop Date: 2011-04-01 Campaign continues to show up to 2011-04-02, basically 24 hours more. I tried multiple dates. I insert the code to check dates, dates are correct. <?php echo 'From: ' .tep_date_long($ds['date_start']) ?> <?php echo ' To: ' .tep_date_long($ds['date_stop']) ?>
  6. anvip

    Daily Specials

    Resolved This is a working code ->modules/daily_specials_cart.php ... (no matter what language you are using) <?php /* $Id: daily specials, v 1.1 2009/09/01 by Jack_mcs Created by Jack_mcs from http://www.oscommerce-solution.com osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Portions Copyright 2009 oscommerce-solution.com Released under the GNU General Public License */ include_once(DIR_WS_FUNCTIONS.FILENAME_DAILY_SPECIALS); $dsClear = true; if (DAILY_SPECIALS_ENABLE == 'true') { $ds_query = tep_db_query("select unique_id, special_name, page_type, page_text, popup_text, alt_text, image, categories, pages, products_list, condition1, condition2, condition3, coupon_amount, date_start, date_stop, recur_days, recur_mode, test_mode, use_css, language_id from " . TABLE_DAILY_SPECIALS . " where date_start <= current_date() and date_stop >= current_date() and ( language_id = 99 or language_id = '" . (int)$languages_id . "')"); if (tep_db_num_rows($ds_query) > 0) { $amt = 0; while ($ds = tep_db_fetch_array($ds_query)) { if (OKToContinue($ds['test_mode'], $customer_id)) //not in test mode or in test mode and shop owner logged in { $comparison = CheckConditions($ds, $cart, $amt); // echo 'result '.$ds['condition1'] ; switch ($ds['condition1']) { case 'Cart Total' : if ($comparison) { $easy_discount->set('DS_CTTL',$ds['special_name'], $amt); $dsClear = false; } else { $easy_discount->clear('DS_CTTL'.$ds['special_name']); } break; case 'Cart Quantity' : if ($comparison) { $easy_discount->set('DS_CQTY'.$ds['special_name'],$ds['special_name'],$amt); $dsClear = false; } else { $easy_discount->clear('DS_CQTY'.$ds['special_name']); } break; default: //just displaying a banner //echo 'ERROR: No definition found -> '. $ds['condition1']; } } } } } if ($dsClear) { if ($easy_discount->count() > 0) { $easy_discount->clear('DS_CTTL', true); $easy_discount->clear('DS_CQTY', true); } } ?>
  7. anvip

    Daily Specials

    I came to the following conclusions. Something is wrong with cases in file modules/daily_specials_cart.php ... If I copy if ($comparison) { $easy_discount->set('DS_CQTY'.$ds['special_name'],$ds['special_name'],$amt); $dsClear = false; } else { $easy_discount->clear('DS_CQTY'.$ds['special_name']); } under default: discounts appear ...
  8. anvip

    Daily Specials

    Yes, of course.
  9. anvip

    Daily Specials

    I tried all possible settings ... Included example also does not show discounts, only banner.
  10. anvip

    Daily Specials

    1. Condition 1 (Cart Quantity), Condition 2 (Greater Than), Condition 3 (1), Coupon Amount 55%, Products (4420) 2. oscommerce 2.2 3. Yes, banner is visible. 4. I tried also with other conitions, without success. 5. After all of that, the problem is that my shop side cannot see the definitons ...
  11. anvip

    Daily Specials

    I also have problem that the discount is not visible. Here is the output: cmp 1 def - no condition -> Cart Quantity Must be something in includes/functions/daily_specials.php ... I checked all 100 times but I do not see a solution. Any new idea?
  12. anvip

    SiteMonitor

    About: WARNING: Your images directory contains .php files but it should not. Also found a php file in images directory, but after checking, I have no such file there ... Well, the glob page says file: sitemonitor_admin.php if (count(glob(DIR_FS_CATALOG . DIR_WS_IMAGES . '*.php'))) { $messageStack->add(ERROR_IMAGES_HAS_PHP, 'error'); } If it's returning false, count() would count that as one value. Here is my solution file: sitemonitor_admin.php Replace if (count(glob(DIR_FS_CATALOG . DIR_WS_IMAGES . '*.php'))) { $messageStack->add(ERROR_IMAGES_HAS_PHP, 'error'); } with $phpdata = glob(DIR_FS_CATALOG . DIR_WS_IMAGES . '*.php'); if(empty($phpdata)) $phpdata = 0; else { $messageStack->add(ERROR_IMAGES_HAS_PHP, 'error'); }
  13. anvip

    auctionTastic

    ... You were righ about that. Are you sure that the sub total amount in shopping cart is showing the correct amount with auction product in it? <?php echo SUB_TITLE_SUB_TOTAL; ?> <?php echo $currencies->format($cart->show_total()); ?> Because for me, the amount is standard product price + auction final price. When in the shopping cart is non of the product in the auction, the amount is correct.
  14. anvip

    auctionTastic

    Checked. All correct. It is something with this part: if( $products[$i]['auctions_price'] != 'false' ){ $display_price = '<b>' . $currencies->display_price($products[$i]['auctions_price'], tep_get_tax_rate($products[$i]['tax_class_id']), '1') . '</b>'; } else { $display_price = '<b>' . $currencies->display_price($products[$i]['final_price'], tep_get_tax_rate($products[$i]['tax_class_id']), $products[$i]['quantity']) . '</b>'; If I change the code in the if( $products[$i]['auctions_price'] != '' ){ The price for auction product is shown = standard product price - auction final price. In checkout confirmation total amount is corect.
×