New Zenner
- Join Date:
- Feb 2008
- Posts:
- 74
- Plugin Contributions:
- 0
Post #1 by alvalong
I create a shopping site and start to get sale. i happy. Suddently my home page deindex from google ,allmost all sale gone. calamity a month pass, i lost both passion and sale. but finally i found my homepage have this "<meta name="robots" content="noindex, nofollow" />" it is reason. WHY? My site hacked? after checking,no file changed.
BUT WHY? I found this:$categories->RecordCount() return < or = 0 so $robotsNoIndex = true; then output <meta name="robots" content="noindex, nofollow" />
why this happen to homepage? i check other site ,all work. WHICH make $categories->RecordCount() not >0 ? in my homepage?:shocking::frusty::oops:
i already take out robotsNoIndex = true. but it is not final resolve. i wanna find why to avoid it in future.
// from init_add_crumbs.php
if (isset($cPath_array) && isset($cPath)) {
for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
$categories_query = "select categories_name
from " . TABLE_CATEGORIES_DESCRIPTION . "
where categories_id = '" . (int)$cPath_array[$i] . "'
and language_id = '" . (int)$_SESSION['languages_id'] . "'";
$categories = $db->Execute($categories_query);
//echo 'I SEE ' . (int)$cPath_array[$i] . '<br>';
if ($categories->RecordCount() > 0) {
$breadcrumb->add($categories->fields['categories_name'], zen_href_link(FILENAME_DEFAULT, 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
} else {
// if invalid, set the robots noindex/nofollow for this page
$robotsNoIndex = true;
break;
}
}
}
//from html_header.php
<?php if (defined('ROBOTS_PAGES_TO_SKIP') && in_array($current_page_base,explode(",",constant('ROBOTS_PAGES_TO_SKIP'))) || $current_page_base=='down_for_maintenance' || $robotsNoIndex === true) { ?>
<meta name="robots" content="noindex, nofollow" />
<?php } ?>